@browserbasehq/orca 3.0.5-vertex-test → 3.0.7-alpha-1

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 (4) hide show
  1. package/README.md +3 -3
  2. package/dist/index.d.ts +2119 -189
  3. package/dist/index.js +6667 -2925
  4. package/package.json +15 -7
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { EventEmitter } from 'events';
1
2
  import { ZodTypeAny, z, ZodObject, ZodRawShape, ZodError } from 'zod';
2
3
  import * as z3 from 'zod/v3';
3
4
  import { ClientOptions as ClientOptions$2 } from '@anthropic-ai/sdk';
@@ -5,7 +6,9 @@ import { GoogleVertexProviderSettings as GoogleVertexProviderSettings$1 } from '
5
6
  import { LanguageModelV2 } from '@ai-sdk/provider';
6
7
  import { ClientOptions as ClientOptions$1 } from 'openai';
7
8
  import { Client, ClientOptions as ClientOptions$3 } from '@modelcontextprotocol/sdk/client/index.js';
8
- import { ToolSet, StreamTextResult, ModelMessage, wrapLanguageModel, generateObject, generateText, streamText, streamObject, experimental_generateImage, embed, embedMany, experimental_transcribe, experimental_generateSpeech } from 'ai';
9
+ import * as ai from 'ai';
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';
11
+ export { ModelMessage } from 'ai';
9
12
  import { Page as Page$1 } from 'playwright-core';
10
13
  export { Page as PlaywrightPage } from 'playwright-core';
11
14
  import { Page as Page$2 } from 'puppeteer-core';
@@ -14,7 +17,7 @@ import { Page as Page$3 } from 'patchright-core';
14
17
  export { Page as PatchrightPage } from 'patchright-core';
15
18
  import { Protocol } from 'devtools-protocol';
16
19
  import { Buffer as Buffer$1 } from 'buffer';
17
- import Browserbase from '@browserbasehq/sdk';
20
+ import { z as z$1 } from 'zod/v4';
18
21
  import { ChatCompletion } from 'openai/resources';
19
22
  import { ToolSet as ToolSet$1 } from 'ai/dist';
20
23
  import { Schema } from '@google/genai';
@@ -75,8 +78,22 @@ declare class CdpConnection implements CDPSessionLike {
75
78
  private inflight;
76
79
  private eventHandlers;
77
80
  private sessions;
81
+ /** Maps sessionId -> targetId (1:1 mapping) */
82
+ private sessionToTarget;
78
83
  readonly id: string | null;
79
84
  private transportCloseHandlers;
85
+ /** Optional CDP logger - set this to receive all outgoing CDP method calls */
86
+ cdpLogger?: (info: {
87
+ method: string;
88
+ params?: object;
89
+ targetId?: string | null;
90
+ }) => void;
91
+ /** Optional CDP event logger - set this to receive all incoming CDP events */
92
+ cdpEventLogger?: (info: {
93
+ method: string;
94
+ params?: unknown;
95
+ targetId?: string | null;
96
+ }) => void;
80
97
  onTransportClosed(handler: (why: string) => void): void;
81
98
  offTransportClosed(handler: (why: string) => void): void;
82
99
  private emitTransportClosed;
@@ -142,7 +159,7 @@ declare class Frame implements FrameManager {
142
159
  /** Accessibility.getFullAXTree (+ recurse into child frames if requested) */
143
160
  getAccessibilityTree(withFrames?: boolean): Promise<Protocol.Accessibility.AXNode[]>;
144
161
  /**
145
- * Evaluate a function or expression in this frame's isolated world.
162
+ * Evaluate a function or expression in this frame's main world.
146
163
  * - If a string is provided, treated as a JS expression.
147
164
  * - If a function is provided, it is stringified and invoked with the optional argument.
148
165
  */
@@ -169,8 +186,8 @@ declare class Frame implements FrameManager {
169
186
  deep?: boolean;
170
187
  depth?: number;
171
188
  }): Locator;
172
- /** Create/get an isolated world for this frame and return its executionContextId */
173
- private getExecutionContextId;
189
+ /** Resolve the main-world execution context id for this frame. */
190
+ private getMainWorldExecutionContextId;
174
191
  }
175
192
 
176
193
  interface SetInputFilePayload {
@@ -501,6 +518,1339 @@ declare class ConsoleMessage {
501
518
  toString(): string;
502
519
  }
503
520
 
521
+ interface SerializableResponse {
522
+ requestId: string;
523
+ frameId?: string;
524
+ loaderId?: string;
525
+ response: Protocol.Network.Response;
526
+ fromServiceWorkerFlag?: boolean;
527
+ finishedSettled?: boolean;
528
+ extraInfoHeaders?: Protocol.Network.Headers | null;
529
+ extraInfoHeadersText?: string;
530
+ }
531
+
532
+ /**
533
+ * Represents a path through a Zod schema from the root object down to a
534
+ * particular field. The `segments` array describes the chain of keys/indices.
535
+ *
536
+ * - **String** segments indicate object property names.
537
+ * - **Number** segments indicate array indices.
538
+ *
539
+ * For example, `["users", 0, "homepage"]` might describe reaching
540
+ * the `homepage` field in `schema.users[0].homepage`.
541
+ */
542
+ interface ZodPathSegments {
543
+ /**
544
+ * The ordered list of keys/indices leading from the schema root
545
+ * to the targeted field.
546
+ */
547
+ segments: Array<string | number>;
548
+ }
549
+ type InitScriptSource<Arg> = string | {
550
+ path?: string;
551
+ content?: string;
552
+ } | ((arg: Arg) => unknown);
553
+
554
+ type EvaluateOptions = {
555
+ /** The question to ask about the task state */
556
+ question: string;
557
+ /** The answer to the question */
558
+ answer?: string;
559
+ /** Whether to take a screenshot of the task state, or array of screenshots to evaluate */
560
+ screenshot?: boolean | Buffer[];
561
+ /** Custom system prompt for the evaluator */
562
+ systemPrompt?: string;
563
+ /** Delay in milliseconds before taking the screenshot @default 250 */
564
+ screenshotDelayMs?: number;
565
+ /** The agent's reasoning/thought process for completing the task */
566
+ agentReasoning?: string;
567
+ };
568
+ type BatchAskOptions = {
569
+ /** Array of questions with optional answers */
570
+ questions: Array<{
571
+ question: string;
572
+ answer?: string;
573
+ }>;
574
+ /** Whether to take a screenshot of the task state */
575
+ screenshot?: boolean;
576
+ /** Custom system prompt for the evaluator */
577
+ systemPrompt?: string;
578
+ /** Delay in milliseconds before taking the screenshot @default 1000 */
579
+ screenshotDelayMs?: number;
580
+ };
581
+ /**
582
+ * Result of an evaluation
583
+ */
584
+ interface EvaluationResult {
585
+ /**
586
+ * The evaluation result ('YES', 'NO', or 'INVALID' if parsing failed or value was unexpected)
587
+ */
588
+ evaluation: "YES" | "NO" | "INVALID";
589
+ /**
590
+ * The reasoning behind the evaluation
591
+ */
592
+ reasoning: string;
593
+ }
594
+
595
+ /**
596
+ * Centralized Zod schemas for Stagehand Server API
597
+ *
598
+ * Naming conventions:
599
+ * - `*RequestSchema` - Request body schemas (zod4), `*Request` is the inferred type
600
+ * - `*ResultSchema` - Inner response data (unwrapped), `*Result` is the inferred type
601
+ * - `*ResponseSchema` - Full response with success wrapper: { success: true, data: *Result }, `*Response` is the inferred type
602
+ *
603
+ * All TypeScript types are inferred from the Zod4 *Schemas using z.infer<>
604
+ */
605
+
606
+ /** Browser launch options for local browsers */
607
+ declare const LocalBrowserLaunchOptionsSchema: z$1.ZodObject<{
608
+ args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
609
+ executablePath: z$1.ZodOptional<z$1.ZodString>;
610
+ userDataDir: z$1.ZodOptional<z$1.ZodString>;
611
+ preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
612
+ headless: z$1.ZodOptional<z$1.ZodBoolean>;
613
+ devtools: z$1.ZodOptional<z$1.ZodBoolean>;
614
+ chromiumSandbox: z$1.ZodOptional<z$1.ZodBoolean>;
615
+ ignoreDefaultArgs: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodString>]>>;
616
+ proxy: z$1.ZodOptional<z$1.ZodObject<{
617
+ server: z$1.ZodString;
618
+ bypass: z$1.ZodOptional<z$1.ZodString>;
619
+ username: z$1.ZodOptional<z$1.ZodString>;
620
+ password: z$1.ZodOptional<z$1.ZodString>;
621
+ }, z$1.core.$strip>>;
622
+ locale: z$1.ZodOptional<z$1.ZodString>;
623
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
624
+ width: z$1.ZodNumber;
625
+ height: z$1.ZodNumber;
626
+ }, z$1.core.$strip>>;
627
+ deviceScaleFactor: z$1.ZodOptional<z$1.ZodNumber>;
628
+ hasTouch: z$1.ZodOptional<z$1.ZodBoolean>;
629
+ ignoreHTTPSErrors: z$1.ZodOptional<z$1.ZodBoolean>;
630
+ cdpUrl: z$1.ZodOptional<z$1.ZodString>;
631
+ connectTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
632
+ downloadsPath: z$1.ZodOptional<z$1.ZodString>;
633
+ acceptDownloads: z$1.ZodOptional<z$1.ZodBoolean>;
634
+ }, z$1.core.$strict>;
635
+ /** Simple model name string */
636
+ declare const ModelNameSchema: z$1.ZodString;
637
+ /** Detailed model configuration object */
638
+ declare const ModelConfigObjectSchema: z$1.ZodObject<{
639
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
640
+ openai: "openai";
641
+ anthropic: "anthropic";
642
+ google: "google";
643
+ microsoft: "microsoft";
644
+ }>>;
645
+ modelName: z$1.ZodString;
646
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
647
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
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<{
651
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
652
+ openai: "openai";
653
+ anthropic: "anthropic";
654
+ google: "google";
655
+ microsoft: "microsoft";
656
+ }>>;
657
+ modelName: z$1.ZodString;
658
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
659
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
660
+ }, z$1.core.$strip>]>;
661
+ /** Action object returned by observe and used by act */
662
+ declare const ActionSchema: z$1.ZodObject<{
663
+ selector: z$1.ZodString;
664
+ description: z$1.ZodString;
665
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
666
+ method: z$1.ZodOptional<z$1.ZodString>;
667
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
668
+ }, z$1.core.$strip>;
669
+ /** Session ID path parameter */
670
+ declare const SessionIdParamsSchema: z$1.ZodObject<{
671
+ id: z$1.ZodString;
672
+ }, z$1.core.$strict>;
673
+ /** Browser configuration for session start */
674
+ declare const BrowserConfigSchema: z$1.ZodObject<{
675
+ type: z$1.ZodOptional<z$1.ZodEnum<{
676
+ local: "local";
677
+ browserbase: "browserbase";
678
+ }>>;
679
+ cdpUrl: z$1.ZodOptional<z$1.ZodString>;
680
+ launchOptions: z$1.ZodOptional<z$1.ZodObject<{
681
+ args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
682
+ executablePath: z$1.ZodOptional<z$1.ZodString>;
683
+ userDataDir: z$1.ZodOptional<z$1.ZodString>;
684
+ preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
685
+ headless: z$1.ZodOptional<z$1.ZodBoolean>;
686
+ devtools: z$1.ZodOptional<z$1.ZodBoolean>;
687
+ chromiumSandbox: z$1.ZodOptional<z$1.ZodBoolean>;
688
+ ignoreDefaultArgs: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodString>]>>;
689
+ proxy: z$1.ZodOptional<z$1.ZodObject<{
690
+ server: z$1.ZodString;
691
+ bypass: z$1.ZodOptional<z$1.ZodString>;
692
+ username: z$1.ZodOptional<z$1.ZodString>;
693
+ password: z$1.ZodOptional<z$1.ZodString>;
694
+ }, z$1.core.$strip>>;
695
+ locale: z$1.ZodOptional<z$1.ZodString>;
696
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
697
+ width: z$1.ZodNumber;
698
+ height: z$1.ZodNumber;
699
+ }, z$1.core.$strip>>;
700
+ deviceScaleFactor: z$1.ZodOptional<z$1.ZodNumber>;
701
+ hasTouch: z$1.ZodOptional<z$1.ZodBoolean>;
702
+ ignoreHTTPSErrors: z$1.ZodOptional<z$1.ZodBoolean>;
703
+ cdpUrl: z$1.ZodOptional<z$1.ZodString>;
704
+ connectTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
705
+ downloadsPath: z$1.ZodOptional<z$1.ZodString>;
706
+ acceptDownloads: z$1.ZodOptional<z$1.ZodBoolean>;
707
+ }, z$1.core.$strict>>;
708
+ }, z$1.core.$strip>;
709
+ /** Operational headers for all session requests (auth handled via security schemes) */
710
+ declare const SessionHeadersSchema: z$1.ZodObject<{
711
+ "x-stream-response": z$1.ZodOptional<z$1.ZodEnum<{
712
+ true: "true";
713
+ false: "false";
714
+ }>>;
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
+ }, z$1.core.$strip>;
723
+ /** Standard error response */
724
+ declare const ErrorResponseSchema: z$1.ZodObject<{
725
+ success: z$1.ZodLiteral<false>;
726
+ error: z$1.ZodString;
727
+ code: z$1.ZodOptional<z$1.ZodString>;
728
+ }, z$1.core.$strict>;
729
+ /** Browserbase viewport configuration */
730
+ declare const BrowserbaseViewportSchema: z$1.ZodObject<{
731
+ width: z$1.ZodOptional<z$1.ZodNumber>;
732
+ height: z$1.ZodOptional<z$1.ZodNumber>;
733
+ }, z$1.core.$strip>;
734
+ /** Browserbase fingerprint screen configuration */
735
+ declare const BrowserbaseFingerprintScreenSchema: z$1.ZodObject<{
736
+ maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
737
+ maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
738
+ minHeight: z$1.ZodOptional<z$1.ZodNumber>;
739
+ minWidth: z$1.ZodOptional<z$1.ZodNumber>;
740
+ }, z$1.core.$strip>;
741
+ /** Browserbase fingerprint configuration for stealth mode */
742
+ declare const BrowserbaseFingerprintSchema: z$1.ZodObject<{
743
+ browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
744
+ chrome: "chrome";
745
+ edge: "edge";
746
+ firefox: "firefox";
747
+ safari: "safari";
748
+ }>>>;
749
+ devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
750
+ desktop: "desktop";
751
+ mobile: "mobile";
752
+ }>>>;
753
+ httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
754
+ 1: "1";
755
+ 2: "2";
756
+ }>>;
757
+ locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
758
+ operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
759
+ android: "android";
760
+ ios: "ios";
761
+ linux: "linux";
762
+ macos: "macos";
763
+ windows: "windows";
764
+ }>>>;
765
+ screen: z$1.ZodOptional<z$1.ZodObject<{
766
+ maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
767
+ maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
768
+ minHeight: z$1.ZodOptional<z$1.ZodNumber>;
769
+ minWidth: z$1.ZodOptional<z$1.ZodNumber>;
770
+ }, z$1.core.$strip>>;
771
+ }, z$1.core.$strip>;
772
+ /** Browserbase context configuration for session persistence */
773
+ declare const BrowserbaseContextSchema: z$1.ZodObject<{
774
+ id: z$1.ZodString;
775
+ persist: z$1.ZodOptional<z$1.ZodBoolean>;
776
+ }, z$1.core.$strip>;
777
+ /** Browserbase browser settings for session creation */
778
+ declare const BrowserbaseBrowserSettingsSchema: z$1.ZodObject<{
779
+ advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
780
+ blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
781
+ context: z$1.ZodOptional<z$1.ZodObject<{
782
+ id: z$1.ZodString;
783
+ persist: z$1.ZodOptional<z$1.ZodBoolean>;
784
+ }, z$1.core.$strip>>;
785
+ extensionId: z$1.ZodOptional<z$1.ZodString>;
786
+ fingerprint: z$1.ZodOptional<z$1.ZodObject<{
787
+ browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
788
+ chrome: "chrome";
789
+ edge: "edge";
790
+ firefox: "firefox";
791
+ safari: "safari";
792
+ }>>>;
793
+ devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
794
+ desktop: "desktop";
795
+ mobile: "mobile";
796
+ }>>>;
797
+ httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
798
+ 1: "1";
799
+ 2: "2";
800
+ }>>;
801
+ locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
802
+ operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
803
+ android: "android";
804
+ ios: "ios";
805
+ linux: "linux";
806
+ macos: "macos";
807
+ windows: "windows";
808
+ }>>>;
809
+ screen: z$1.ZodOptional<z$1.ZodObject<{
810
+ maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
811
+ maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
812
+ minHeight: z$1.ZodOptional<z$1.ZodNumber>;
813
+ minWidth: z$1.ZodOptional<z$1.ZodNumber>;
814
+ }, z$1.core.$strip>>;
815
+ }, z$1.core.$strip>>;
816
+ logSession: z$1.ZodOptional<z$1.ZodBoolean>;
817
+ recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
818
+ solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
819
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
820
+ width: z$1.ZodOptional<z$1.ZodNumber>;
821
+ height: z$1.ZodOptional<z$1.ZodNumber>;
822
+ }, z$1.core.$strip>>;
823
+ }, z$1.core.$strip>;
824
+ /** Browserbase managed proxy geolocation configuration */
825
+ declare const BrowserbaseProxyGeolocationSchema: z$1.ZodObject<{
826
+ country: z$1.ZodString;
827
+ city: z$1.ZodOptional<z$1.ZodString>;
828
+ state: z$1.ZodOptional<z$1.ZodString>;
829
+ }, z$1.core.$strip>;
830
+ /** Browserbase managed proxy configuration */
831
+ declare const BrowserbaseProxyConfigSchema: z$1.ZodObject<{
832
+ type: z$1.ZodLiteral<"browserbase">;
833
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
834
+ geolocation: z$1.ZodOptional<z$1.ZodObject<{
835
+ country: z$1.ZodString;
836
+ city: z$1.ZodOptional<z$1.ZodString>;
837
+ state: z$1.ZodOptional<z$1.ZodString>;
838
+ }, z$1.core.$strip>>;
839
+ }, z$1.core.$strip>;
840
+ /** External proxy configuration */
841
+ declare const ExternalProxyConfigSchema: z$1.ZodObject<{
842
+ type: z$1.ZodLiteral<"external">;
843
+ server: z$1.ZodString;
844
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
845
+ username: z$1.ZodOptional<z$1.ZodString>;
846
+ password: z$1.ZodOptional<z$1.ZodString>;
847
+ }, z$1.core.$strip>;
848
+ /** Union of proxy configuration types */
849
+ declare const ProxyConfigSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
850
+ type: z$1.ZodLiteral<"browserbase">;
851
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
852
+ geolocation: z$1.ZodOptional<z$1.ZodObject<{
853
+ country: z$1.ZodString;
854
+ city: z$1.ZodOptional<z$1.ZodString>;
855
+ state: z$1.ZodOptional<z$1.ZodString>;
856
+ }, z$1.core.$strip>>;
857
+ }, z$1.core.$strip>, z$1.ZodObject<{
858
+ type: z$1.ZodLiteral<"external">;
859
+ server: z$1.ZodString;
860
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
861
+ username: z$1.ZodOptional<z$1.ZodString>;
862
+ password: z$1.ZodOptional<z$1.ZodString>;
863
+ }, z$1.core.$strip>], "type">;
864
+ /** Browserbase session creation parameters */
865
+ declare const BrowserbaseSessionCreateParamsSchema: z$1.ZodObject<{
866
+ projectId: z$1.ZodOptional<z$1.ZodString>;
867
+ browserSettings: z$1.ZodOptional<z$1.ZodObject<{
868
+ advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
869
+ blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
870
+ context: z$1.ZodOptional<z$1.ZodObject<{
871
+ id: z$1.ZodString;
872
+ persist: z$1.ZodOptional<z$1.ZodBoolean>;
873
+ }, z$1.core.$strip>>;
874
+ extensionId: z$1.ZodOptional<z$1.ZodString>;
875
+ fingerprint: z$1.ZodOptional<z$1.ZodObject<{
876
+ browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
877
+ chrome: "chrome";
878
+ edge: "edge";
879
+ firefox: "firefox";
880
+ safari: "safari";
881
+ }>>>;
882
+ devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
883
+ desktop: "desktop";
884
+ mobile: "mobile";
885
+ }>>>;
886
+ httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
887
+ 1: "1";
888
+ 2: "2";
889
+ }>>;
890
+ locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
891
+ operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
892
+ android: "android";
893
+ ios: "ios";
894
+ linux: "linux";
895
+ macos: "macos";
896
+ windows: "windows";
897
+ }>>>;
898
+ screen: z$1.ZodOptional<z$1.ZodObject<{
899
+ maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
900
+ maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
901
+ minHeight: z$1.ZodOptional<z$1.ZodNumber>;
902
+ minWidth: z$1.ZodOptional<z$1.ZodNumber>;
903
+ }, z$1.core.$strip>>;
904
+ }, z$1.core.$strip>>;
905
+ logSession: z$1.ZodOptional<z$1.ZodBoolean>;
906
+ recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
907
+ solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
908
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
909
+ width: z$1.ZodOptional<z$1.ZodNumber>;
910
+ height: z$1.ZodOptional<z$1.ZodNumber>;
911
+ }, z$1.core.$strip>>;
912
+ }, z$1.core.$strip>>;
913
+ extensionId: z$1.ZodOptional<z$1.ZodString>;
914
+ keepAlive: z$1.ZodOptional<z$1.ZodBoolean>;
915
+ proxies: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
916
+ type: z$1.ZodLiteral<"browserbase">;
917
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
918
+ geolocation: z$1.ZodOptional<z$1.ZodObject<{
919
+ country: z$1.ZodString;
920
+ city: z$1.ZodOptional<z$1.ZodString>;
921
+ state: z$1.ZodOptional<z$1.ZodString>;
922
+ }, z$1.core.$strip>>;
923
+ }, z$1.core.$strip>, z$1.ZodObject<{
924
+ type: z$1.ZodLiteral<"external">;
925
+ server: z$1.ZodString;
926
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
927
+ username: z$1.ZodOptional<z$1.ZodString>;
928
+ password: z$1.ZodOptional<z$1.ZodString>;
929
+ }, z$1.core.$strip>], "type">>]>>;
930
+ region: z$1.ZodOptional<z$1.ZodEnum<{
931
+ "us-west-2": "us-west-2";
932
+ "us-east-1": "us-east-1";
933
+ "eu-central-1": "eu-central-1";
934
+ "ap-southeast-1": "ap-southeast-1";
935
+ }>>;
936
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
937
+ userMetadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
938
+ }, z$1.core.$strip>;
939
+ declare const SessionStartRequestSchema: z$1.ZodObject<{
940
+ modelName: z$1.ZodString;
941
+ domSettleTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
942
+ verbose: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodLiteral<0>, z$1.ZodLiteral<1>, z$1.ZodLiteral<2>]>>;
943
+ systemPrompt: z$1.ZodOptional<z$1.ZodString>;
944
+ browserbaseSessionCreateParams: z$1.ZodOptional<z$1.ZodObject<{
945
+ projectId: z$1.ZodOptional<z$1.ZodString>;
946
+ browserSettings: z$1.ZodOptional<z$1.ZodObject<{
947
+ advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
948
+ blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
949
+ context: z$1.ZodOptional<z$1.ZodObject<{
950
+ id: z$1.ZodString;
951
+ persist: z$1.ZodOptional<z$1.ZodBoolean>;
952
+ }, z$1.core.$strip>>;
953
+ extensionId: z$1.ZodOptional<z$1.ZodString>;
954
+ fingerprint: z$1.ZodOptional<z$1.ZodObject<{
955
+ browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
956
+ chrome: "chrome";
957
+ edge: "edge";
958
+ firefox: "firefox";
959
+ safari: "safari";
960
+ }>>>;
961
+ devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
962
+ desktop: "desktop";
963
+ mobile: "mobile";
964
+ }>>>;
965
+ httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
966
+ 1: "1";
967
+ 2: "2";
968
+ }>>;
969
+ locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
970
+ operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
971
+ android: "android";
972
+ ios: "ios";
973
+ linux: "linux";
974
+ macos: "macos";
975
+ windows: "windows";
976
+ }>>>;
977
+ screen: z$1.ZodOptional<z$1.ZodObject<{
978
+ maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
979
+ maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
980
+ minHeight: z$1.ZodOptional<z$1.ZodNumber>;
981
+ minWidth: z$1.ZodOptional<z$1.ZodNumber>;
982
+ }, z$1.core.$strip>>;
983
+ }, z$1.core.$strip>>;
984
+ logSession: z$1.ZodOptional<z$1.ZodBoolean>;
985
+ recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
986
+ solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
987
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
988
+ width: z$1.ZodOptional<z$1.ZodNumber>;
989
+ height: z$1.ZodOptional<z$1.ZodNumber>;
990
+ }, z$1.core.$strip>>;
991
+ }, z$1.core.$strip>>;
992
+ extensionId: z$1.ZodOptional<z$1.ZodString>;
993
+ keepAlive: z$1.ZodOptional<z$1.ZodBoolean>;
994
+ proxies: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
995
+ type: z$1.ZodLiteral<"browserbase">;
996
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
997
+ geolocation: z$1.ZodOptional<z$1.ZodObject<{
998
+ country: z$1.ZodString;
999
+ city: z$1.ZodOptional<z$1.ZodString>;
1000
+ state: z$1.ZodOptional<z$1.ZodString>;
1001
+ }, z$1.core.$strip>>;
1002
+ }, z$1.core.$strip>, z$1.ZodObject<{
1003
+ type: z$1.ZodLiteral<"external">;
1004
+ server: z$1.ZodString;
1005
+ domainPattern: z$1.ZodOptional<z$1.ZodString>;
1006
+ username: z$1.ZodOptional<z$1.ZodString>;
1007
+ password: z$1.ZodOptional<z$1.ZodString>;
1008
+ }, z$1.core.$strip>], "type">>]>>;
1009
+ region: z$1.ZodOptional<z$1.ZodEnum<{
1010
+ "us-west-2": "us-west-2";
1011
+ "us-east-1": "us-east-1";
1012
+ "eu-central-1": "eu-central-1";
1013
+ "ap-southeast-1": "ap-southeast-1";
1014
+ }>>;
1015
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1016
+ userMetadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1017
+ }, z$1.core.$strip>>;
1018
+ browser: z$1.ZodOptional<z$1.ZodObject<{
1019
+ type: z$1.ZodOptional<z$1.ZodEnum<{
1020
+ local: "local";
1021
+ browserbase: "browserbase";
1022
+ }>>;
1023
+ cdpUrl: z$1.ZodOptional<z$1.ZodString>;
1024
+ launchOptions: z$1.ZodOptional<z$1.ZodObject<{
1025
+ args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1026
+ executablePath: z$1.ZodOptional<z$1.ZodString>;
1027
+ userDataDir: z$1.ZodOptional<z$1.ZodString>;
1028
+ preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
1029
+ headless: z$1.ZodOptional<z$1.ZodBoolean>;
1030
+ devtools: z$1.ZodOptional<z$1.ZodBoolean>;
1031
+ chromiumSandbox: z$1.ZodOptional<z$1.ZodBoolean>;
1032
+ ignoreDefaultArgs: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodString>]>>;
1033
+ proxy: z$1.ZodOptional<z$1.ZodObject<{
1034
+ server: z$1.ZodString;
1035
+ bypass: z$1.ZodOptional<z$1.ZodString>;
1036
+ username: z$1.ZodOptional<z$1.ZodString>;
1037
+ password: z$1.ZodOptional<z$1.ZodString>;
1038
+ }, z$1.core.$strip>>;
1039
+ locale: z$1.ZodOptional<z$1.ZodString>;
1040
+ viewport: z$1.ZodOptional<z$1.ZodObject<{
1041
+ width: z$1.ZodNumber;
1042
+ height: z$1.ZodNumber;
1043
+ }, z$1.core.$strip>>;
1044
+ deviceScaleFactor: z$1.ZodOptional<z$1.ZodNumber>;
1045
+ hasTouch: z$1.ZodOptional<z$1.ZodBoolean>;
1046
+ ignoreHTTPSErrors: z$1.ZodOptional<z$1.ZodBoolean>;
1047
+ cdpUrl: z$1.ZodOptional<z$1.ZodString>;
1048
+ connectTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
1049
+ downloadsPath: z$1.ZodOptional<z$1.ZodString>;
1050
+ acceptDownloads: z$1.ZodOptional<z$1.ZodBoolean>;
1051
+ }, z$1.core.$strict>>;
1052
+ }, z$1.core.$strip>>;
1053
+ selfHeal: z$1.ZodOptional<z$1.ZodBoolean>;
1054
+ browserbaseSessionID: z$1.ZodOptional<z$1.ZodString>;
1055
+ experimental: z$1.ZodOptional<z$1.ZodBoolean>;
1056
+ waitForCaptchaSolves: z$1.ZodOptional<z$1.ZodBoolean>;
1057
+ actTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
1058
+ }, z$1.core.$strip>;
1059
+ declare const SessionStartResultSchema: z$1.ZodObject<{
1060
+ sessionId: z$1.ZodString;
1061
+ cdpUrl: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1062
+ available: z$1.ZodBoolean;
1063
+ }, z$1.core.$strip>;
1064
+ declare const SessionStartResponseSchema: z$1.ZodObject<{
1065
+ success: z$1.ZodBoolean;
1066
+ data: z$1.ZodObject<{
1067
+ sessionId: z$1.ZodString;
1068
+ cdpUrl: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
1069
+ available: z$1.ZodBoolean;
1070
+ }, z$1.core.$strip>;
1071
+ }, z$1.core.$strip>;
1072
+ declare const SessionEndResultSchema: z$1.ZodObject<{}, z$1.core.$strict>;
1073
+ /** Session end response - just success flag, no data wrapper */
1074
+ declare const SessionEndResponseSchema: z$1.ZodObject<{
1075
+ success: z$1.ZodBoolean;
1076
+ }, z$1.core.$strict>;
1077
+ declare const ActOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1078
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1079
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1080
+ openai: "openai";
1081
+ anthropic: "anthropic";
1082
+ google: "google";
1083
+ microsoft: "microsoft";
1084
+ }>>;
1085
+ modelName: z$1.ZodString;
1086
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1087
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1088
+ }, z$1.core.$strip>]>>;
1089
+ variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1090
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1091
+ }, z$1.core.$strip>>;
1092
+ declare const ActRequestSchema: z$1.ZodObject<{
1093
+ input: z$1.ZodUnion<[z$1.ZodString, z$1.ZodObject<{
1094
+ selector: z$1.ZodString;
1095
+ description: z$1.ZodString;
1096
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1097
+ method: z$1.ZodOptional<z$1.ZodString>;
1098
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1099
+ }, z$1.core.$strip>]>;
1100
+ options: z$1.ZodOptional<z$1.ZodObject<{
1101
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1102
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1103
+ openai: "openai";
1104
+ anthropic: "anthropic";
1105
+ google: "google";
1106
+ microsoft: "microsoft";
1107
+ }>>;
1108
+ modelName: z$1.ZodString;
1109
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1110
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1111
+ }, z$1.core.$strip>]>>;
1112
+ variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
1113
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1114
+ }, z$1.core.$strip>>;
1115
+ frameId: z$1.ZodOptional<z$1.ZodString>;
1116
+ streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1117
+ }, z$1.core.$strip>;
1118
+ /** Inner act result data */
1119
+ declare const ActResultDataSchema: z$1.ZodObject<{
1120
+ success: z$1.ZodBoolean;
1121
+ message: z$1.ZodString;
1122
+ actionDescription: z$1.ZodString;
1123
+ actions: z$1.ZodArray<z$1.ZodObject<{
1124
+ selector: z$1.ZodString;
1125
+ description: z$1.ZodString;
1126
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1127
+ method: z$1.ZodOptional<z$1.ZodString>;
1128
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1129
+ }, z$1.core.$strip>>;
1130
+ }, z$1.core.$strip>;
1131
+ declare const ActResultSchema: z$1.ZodObject<{
1132
+ result: z$1.ZodObject<{
1133
+ success: z$1.ZodBoolean;
1134
+ message: z$1.ZodString;
1135
+ actionDescription: z$1.ZodString;
1136
+ actions: z$1.ZodArray<z$1.ZodObject<{
1137
+ selector: z$1.ZodString;
1138
+ description: z$1.ZodString;
1139
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1140
+ method: z$1.ZodOptional<z$1.ZodString>;
1141
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1142
+ }, z$1.core.$strip>>;
1143
+ }, z$1.core.$strip>;
1144
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1145
+ }, z$1.core.$strip>;
1146
+ declare const ActResponseSchema: z$1.ZodObject<{
1147
+ success: z$1.ZodBoolean;
1148
+ data: z$1.ZodObject<{
1149
+ result: z$1.ZodObject<{
1150
+ success: z$1.ZodBoolean;
1151
+ message: z$1.ZodString;
1152
+ actionDescription: z$1.ZodString;
1153
+ actions: z$1.ZodArray<z$1.ZodObject<{
1154
+ selector: z$1.ZodString;
1155
+ description: z$1.ZodString;
1156
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1157
+ method: z$1.ZodOptional<z$1.ZodString>;
1158
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1159
+ }, z$1.core.$strip>>;
1160
+ }, z$1.core.$strip>;
1161
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1162
+ }, z$1.core.$strip>;
1163
+ }, z$1.core.$strip>;
1164
+ declare const ExtractOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1165
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1166
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1167
+ openai: "openai";
1168
+ anthropic: "anthropic";
1169
+ google: "google";
1170
+ microsoft: "microsoft";
1171
+ }>>;
1172
+ modelName: z$1.ZodString;
1173
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1174
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1175
+ }, z$1.core.$strip>]>>;
1176
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1177
+ selector: z$1.ZodOptional<z$1.ZodString>;
1178
+ }, z$1.core.$strip>>;
1179
+ declare const ExtractRequestSchema: z$1.ZodObject<{
1180
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1181
+ schema: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1182
+ options: z$1.ZodOptional<z$1.ZodObject<{
1183
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1184
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1185
+ openai: "openai";
1186
+ anthropic: "anthropic";
1187
+ google: "google";
1188
+ microsoft: "microsoft";
1189
+ }>>;
1190
+ modelName: z$1.ZodString;
1191
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1192
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1193
+ }, z$1.core.$strip>]>>;
1194
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1195
+ selector: z$1.ZodOptional<z$1.ZodString>;
1196
+ }, z$1.core.$strip>>;
1197
+ frameId: z$1.ZodOptional<z$1.ZodString>;
1198
+ streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1199
+ }, z$1.core.$strip>;
1200
+ declare const ExtractResultSchema: z$1.ZodObject<{
1201
+ result: z$1.ZodUnknown;
1202
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1203
+ }, z$1.core.$strip>;
1204
+ declare const ExtractResponseSchema: z$1.ZodObject<{
1205
+ success: z$1.ZodBoolean;
1206
+ data: z$1.ZodObject<{
1207
+ result: z$1.ZodUnknown;
1208
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1209
+ }, z$1.core.$strip>;
1210
+ }, z$1.core.$strip>;
1211
+ declare const ObserveOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1212
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1213
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1214
+ openai: "openai";
1215
+ anthropic: "anthropic";
1216
+ google: "google";
1217
+ microsoft: "microsoft";
1218
+ }>>;
1219
+ modelName: z$1.ZodString;
1220
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1221
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1222
+ }, z$1.core.$strip>]>>;
1223
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1224
+ selector: z$1.ZodOptional<z$1.ZodString>;
1225
+ }, z$1.core.$strip>>;
1226
+ declare const ObserveRequestSchema: z$1.ZodObject<{
1227
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1228
+ options: z$1.ZodOptional<z$1.ZodObject<{
1229
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1230
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1231
+ openai: "openai";
1232
+ anthropic: "anthropic";
1233
+ google: "google";
1234
+ microsoft: "microsoft";
1235
+ }>>;
1236
+ modelName: z$1.ZodString;
1237
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1238
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1239
+ }, z$1.core.$strip>]>>;
1240
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1241
+ selector: z$1.ZodOptional<z$1.ZodString>;
1242
+ }, z$1.core.$strip>>;
1243
+ frameId: z$1.ZodOptional<z$1.ZodString>;
1244
+ streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1245
+ }, z$1.core.$strip>;
1246
+ declare const ObserveResultSchema: z$1.ZodObject<{
1247
+ result: z$1.ZodArray<z$1.ZodObject<{
1248
+ selector: z$1.ZodString;
1249
+ description: z$1.ZodString;
1250
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1251
+ method: z$1.ZodOptional<z$1.ZodString>;
1252
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1253
+ }, z$1.core.$strip>>;
1254
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1255
+ }, z$1.core.$strip>;
1256
+ declare const ObserveResponseSchema: z$1.ZodObject<{
1257
+ success: z$1.ZodBoolean;
1258
+ data: z$1.ZodObject<{
1259
+ result: z$1.ZodArray<z$1.ZodObject<{
1260
+ selector: z$1.ZodString;
1261
+ description: z$1.ZodString;
1262
+ backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
1263
+ method: z$1.ZodOptional<z$1.ZodString>;
1264
+ arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1265
+ }, z$1.core.$strip>>;
1266
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1267
+ }, z$1.core.$strip>;
1268
+ }, z$1.core.$strip>;
1269
+ declare const AgentConfigSchema: z$1.ZodObject<{
1270
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1271
+ openai: "openai";
1272
+ anthropic: "anthropic";
1273
+ google: "google";
1274
+ microsoft: "microsoft";
1275
+ }>>;
1276
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1277
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1278
+ openai: "openai";
1279
+ anthropic: "anthropic";
1280
+ google: "google";
1281
+ microsoft: "microsoft";
1282
+ }>>;
1283
+ modelName: z$1.ZodString;
1284
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1285
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1286
+ }, z$1.core.$strip>]>>;
1287
+ systemPrompt: z$1.ZodOptional<z$1.ZodString>;
1288
+ cua: z$1.ZodOptional<z$1.ZodBoolean>;
1289
+ }, z$1.core.$strip>;
1290
+ /** Action taken by the agent during execution */
1291
+ declare const AgentActionSchema: z$1.ZodObject<{
1292
+ type: z$1.ZodString;
1293
+ reasoning: z$1.ZodOptional<z$1.ZodString>;
1294
+ taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
1295
+ action: z$1.ZodOptional<z$1.ZodString>;
1296
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1297
+ pageText: z$1.ZodOptional<z$1.ZodString>;
1298
+ pageUrl: z$1.ZodOptional<z$1.ZodString>;
1299
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1300
+ }, z$1.core.$loose>;
1301
+ /** Token usage statistics for agent execution */
1302
+ declare const AgentUsageSchema: z$1.ZodObject<{
1303
+ input_tokens: z$1.ZodNumber;
1304
+ output_tokens: z$1.ZodNumber;
1305
+ reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1306
+ cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1307
+ inference_time_ms: z$1.ZodNumber;
1308
+ }, z$1.core.$strip>;
1309
+ /** Result data from agent execution */
1310
+ declare const AgentResultDataSchema: z$1.ZodObject<{
1311
+ success: z$1.ZodBoolean;
1312
+ message: z$1.ZodString;
1313
+ actions: z$1.ZodArray<z$1.ZodObject<{
1314
+ type: z$1.ZodString;
1315
+ reasoning: z$1.ZodOptional<z$1.ZodString>;
1316
+ taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
1317
+ action: z$1.ZodOptional<z$1.ZodString>;
1318
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1319
+ pageText: z$1.ZodOptional<z$1.ZodString>;
1320
+ pageUrl: z$1.ZodOptional<z$1.ZodString>;
1321
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1322
+ }, z$1.core.$loose>>;
1323
+ completed: z$1.ZodBoolean;
1324
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1325
+ usage: z$1.ZodOptional<z$1.ZodObject<{
1326
+ input_tokens: z$1.ZodNumber;
1327
+ output_tokens: z$1.ZodNumber;
1328
+ reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1329
+ cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1330
+ inference_time_ms: z$1.ZodNumber;
1331
+ }, z$1.core.$strip>>;
1332
+ }, z$1.core.$strip>;
1333
+ declare const AgentExecuteOptionsSchema: z$1.ZodObject<{
1334
+ instruction: z$1.ZodString;
1335
+ maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
1336
+ highlightCursor: z$1.ZodOptional<z$1.ZodBoolean>;
1337
+ }, z$1.core.$strip>;
1338
+ declare const AgentExecuteRequestSchema: z$1.ZodObject<{
1339
+ agentConfig: z$1.ZodObject<{
1340
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1341
+ openai: "openai";
1342
+ anthropic: "anthropic";
1343
+ google: "google";
1344
+ microsoft: "microsoft";
1345
+ }>>;
1346
+ model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
1347
+ provider: z$1.ZodOptional<z$1.ZodEnum<{
1348
+ openai: "openai";
1349
+ anthropic: "anthropic";
1350
+ google: "google";
1351
+ microsoft: "microsoft";
1352
+ }>>;
1353
+ modelName: z$1.ZodString;
1354
+ apiKey: z$1.ZodOptional<z$1.ZodString>;
1355
+ baseURL: z$1.ZodOptional<z$1.ZodString>;
1356
+ }, z$1.core.$strip>]>>;
1357
+ systemPrompt: z$1.ZodOptional<z$1.ZodString>;
1358
+ cua: z$1.ZodOptional<z$1.ZodBoolean>;
1359
+ }, z$1.core.$strip>;
1360
+ executeOptions: z$1.ZodObject<{
1361
+ instruction: z$1.ZodString;
1362
+ maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
1363
+ highlightCursor: z$1.ZodOptional<z$1.ZodBoolean>;
1364
+ }, z$1.core.$strip>;
1365
+ frameId: z$1.ZodOptional<z$1.ZodString>;
1366
+ streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1367
+ }, z$1.core.$strip>;
1368
+ declare const AgentExecuteResultSchema: z$1.ZodObject<{
1369
+ result: z$1.ZodObject<{
1370
+ success: z$1.ZodBoolean;
1371
+ message: z$1.ZodString;
1372
+ actions: z$1.ZodArray<z$1.ZodObject<{
1373
+ type: z$1.ZodString;
1374
+ reasoning: z$1.ZodOptional<z$1.ZodString>;
1375
+ taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
1376
+ action: z$1.ZodOptional<z$1.ZodString>;
1377
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1378
+ pageText: z$1.ZodOptional<z$1.ZodString>;
1379
+ pageUrl: z$1.ZodOptional<z$1.ZodString>;
1380
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1381
+ }, z$1.core.$loose>>;
1382
+ completed: z$1.ZodBoolean;
1383
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1384
+ usage: z$1.ZodOptional<z$1.ZodObject<{
1385
+ input_tokens: z$1.ZodNumber;
1386
+ output_tokens: z$1.ZodNumber;
1387
+ reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1388
+ cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1389
+ inference_time_ms: z$1.ZodNumber;
1390
+ }, z$1.core.$strip>>;
1391
+ }, z$1.core.$strip>;
1392
+ }, z$1.core.$strip>;
1393
+ declare const AgentExecuteResponseSchema: z$1.ZodObject<{
1394
+ success: z$1.ZodBoolean;
1395
+ data: z$1.ZodObject<{
1396
+ result: z$1.ZodObject<{
1397
+ success: z$1.ZodBoolean;
1398
+ message: z$1.ZodString;
1399
+ actions: z$1.ZodArray<z$1.ZodObject<{
1400
+ type: z$1.ZodString;
1401
+ reasoning: z$1.ZodOptional<z$1.ZodString>;
1402
+ taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
1403
+ action: z$1.ZodOptional<z$1.ZodString>;
1404
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1405
+ pageText: z$1.ZodOptional<z$1.ZodString>;
1406
+ pageUrl: z$1.ZodOptional<z$1.ZodString>;
1407
+ instruction: z$1.ZodOptional<z$1.ZodString>;
1408
+ }, z$1.core.$loose>>;
1409
+ completed: z$1.ZodBoolean;
1410
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
1411
+ usage: z$1.ZodOptional<z$1.ZodObject<{
1412
+ input_tokens: z$1.ZodNumber;
1413
+ output_tokens: z$1.ZodNumber;
1414
+ reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1415
+ cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
1416
+ inference_time_ms: z$1.ZodNumber;
1417
+ }, z$1.core.$strip>>;
1418
+ }, z$1.core.$strip>;
1419
+ }, z$1.core.$strip>;
1420
+ }, z$1.core.$strip>;
1421
+ declare const NavigateOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
1422
+ referer: z$1.ZodOptional<z$1.ZodString>;
1423
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1424
+ waitUntil: z$1.ZodOptional<z$1.ZodEnum<{
1425
+ load: "load";
1426
+ domcontentloaded: "domcontentloaded";
1427
+ networkidle: "networkidle";
1428
+ }>>;
1429
+ }, z$1.core.$strip>>;
1430
+ declare const NavigateRequestSchema: z$1.ZodObject<{
1431
+ url: z$1.ZodString;
1432
+ options: z$1.ZodOptional<z$1.ZodObject<{
1433
+ referer: z$1.ZodOptional<z$1.ZodString>;
1434
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
1435
+ waitUntil: z$1.ZodOptional<z$1.ZodEnum<{
1436
+ load: "load";
1437
+ domcontentloaded: "domcontentloaded";
1438
+ networkidle: "networkidle";
1439
+ }>>;
1440
+ }, z$1.core.$strip>>;
1441
+ frameId: z$1.ZodOptional<z$1.ZodString>;
1442
+ streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
1443
+ }, z$1.core.$strip>;
1444
+ declare const NavigateResultSchema: z$1.ZodObject<{
1445
+ result: z$1.ZodNullable<z$1.ZodUnknown>;
1446
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1447
+ }, z$1.core.$strip>;
1448
+ declare const NavigateResponseSchema: z$1.ZodObject<{
1449
+ success: z$1.ZodBoolean;
1450
+ data: z$1.ZodObject<{
1451
+ result: z$1.ZodNullable<z$1.ZodUnknown>;
1452
+ actionId: z$1.ZodOptional<z$1.ZodString>;
1453
+ }, z$1.core.$strip>;
1454
+ }, z$1.core.$strip>;
1455
+ /** Token usage for a single action */
1456
+ declare const TokenUsageSchema: z$1.ZodObject<{
1457
+ inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1458
+ outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1459
+ reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
1460
+ cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1461
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1462
+ }, z$1.core.$strip>;
1463
+ /** Action entry in replay metrics */
1464
+ declare const ReplayActionSchema: z$1.ZodObject<{
1465
+ method: z$1.ZodOptional<z$1.ZodString>;
1466
+ tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
1467
+ inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1468
+ outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1469
+ reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
1470
+ cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1471
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1472
+ }, z$1.core.$strip>>;
1473
+ }, z$1.core.$strip>;
1474
+ /** Page entry in replay metrics */
1475
+ declare const ReplayPageSchema: z$1.ZodObject<{
1476
+ actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1477
+ method: z$1.ZodOptional<z$1.ZodString>;
1478
+ tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
1479
+ inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1480
+ outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1481
+ reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
1482
+ cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1483
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1484
+ }, z$1.core.$strip>>;
1485
+ }, z$1.core.$strip>>>;
1486
+ }, z$1.core.$strip>;
1487
+ /** Inner result data for replay */
1488
+ declare const ReplayResultSchema: z$1.ZodObject<{
1489
+ pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1490
+ actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1491
+ method: z$1.ZodOptional<z$1.ZodString>;
1492
+ tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
1493
+ inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1494
+ outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1495
+ reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
1496
+ cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1497
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1498
+ }, z$1.core.$strip>>;
1499
+ }, z$1.core.$strip>>>;
1500
+ }, z$1.core.$strip>>>;
1501
+ }, z$1.core.$strip>;
1502
+ declare const ReplayResponseSchema: z$1.ZodObject<{
1503
+ success: z$1.ZodBoolean;
1504
+ data: z$1.ZodObject<{
1505
+ pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1506
+ actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1507
+ method: z$1.ZodOptional<z$1.ZodString>;
1508
+ tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
1509
+ inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1510
+ outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1511
+ reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
1512
+ cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
1513
+ timeMs: z$1.ZodOptional<z$1.ZodNumber>;
1514
+ }, z$1.core.$strip>>;
1515
+ }, z$1.core.$strip>>>;
1516
+ }, z$1.core.$strip>>>;
1517
+ }, z$1.core.$strip>;
1518
+ }, z$1.core.$strip>;
1519
+ /** Status values for SSE stream events */
1520
+ declare const StreamEventStatusSchema: z$1.ZodEnum<{
1521
+ error: "error";
1522
+ starting: "starting";
1523
+ connected: "connected";
1524
+ running: "running";
1525
+ finished: "finished";
1526
+ }>;
1527
+ /** Type discriminator for SSE stream events */
1528
+ declare const StreamEventTypeSchema: z$1.ZodEnum<{
1529
+ system: "system";
1530
+ log: "log";
1531
+ }>;
1532
+ /** Data payload for system stream events */
1533
+ declare const StreamEventSystemDataSchema: z$1.ZodObject<{
1534
+ status: z$1.ZodEnum<{
1535
+ error: "error";
1536
+ starting: "starting";
1537
+ connected: "connected";
1538
+ running: "running";
1539
+ finished: "finished";
1540
+ }>;
1541
+ result: z$1.ZodOptional<z$1.ZodUnknown>;
1542
+ error: z$1.ZodOptional<z$1.ZodString>;
1543
+ }, z$1.core.$strip>;
1544
+ /** Data payload for log stream events */
1545
+ declare const StreamEventLogDataSchema: z$1.ZodObject<{
1546
+ status: z$1.ZodLiteral<"running">;
1547
+ message: z$1.ZodString;
1548
+ }, z$1.core.$strip>;
1549
+ /**
1550
+ * SSE stream event sent during streaming responses.
1551
+ *
1552
+ * IMPORTANT: Key ordering matters for Stainless SDK generation.
1553
+ * The `data` field MUST be serialized first, with `status` as the first key within it.
1554
+ * This allows Stainless to use `data_starts_with: '{"data":{"status":"finished"'` for event handling.
1555
+ *
1556
+ * Expected serialization order: {"data":{"status":...},"type":...,"id":...}
1557
+ */
1558
+ declare const StreamEventSchema: z$1.ZodObject<{
1559
+ data: z$1.ZodUnion<readonly [z$1.ZodObject<{
1560
+ status: z$1.ZodEnum<{
1561
+ error: "error";
1562
+ starting: "starting";
1563
+ connected: "connected";
1564
+ running: "running";
1565
+ finished: "finished";
1566
+ }>;
1567
+ result: z$1.ZodOptional<z$1.ZodUnknown>;
1568
+ error: z$1.ZodOptional<z$1.ZodString>;
1569
+ }, z$1.core.$strip>, z$1.ZodObject<{
1570
+ status: z$1.ZodLiteral<"running">;
1571
+ message: z$1.ZodString;
1572
+ }, z$1.core.$strip>]>;
1573
+ type: z$1.ZodEnum<{
1574
+ system: "system";
1575
+ log: "log";
1576
+ }>;
1577
+ id: z$1.ZodString;
1578
+ }, z$1.core.$strip>;
1579
+ /** OpenAPI security schemes for authentication */
1580
+ declare const openApiSecuritySchemes: {
1581
+ readonly BrowserbaseApiKey: {
1582
+ readonly type: "apiKey";
1583
+ readonly in: "header";
1584
+ readonly name: "x-bb-api-key";
1585
+ readonly description: "Browserbase API key for authentication";
1586
+ };
1587
+ readonly BrowserbaseProjectId: {
1588
+ readonly type: "apiKey";
1589
+ readonly in: "header";
1590
+ readonly name: "x-bb-project-id";
1591
+ readonly description: "Browserbase project ID";
1592
+ };
1593
+ readonly ModelApiKey: {
1594
+ readonly type: "apiKey";
1595
+ readonly in: "header";
1596
+ readonly name: "x-model-api-key";
1597
+ readonly description: "API key for the AI model provider (OpenAI, Anthropic, etc.)";
1598
+ };
1599
+ };
1600
+ /** OpenAPI links for session operations (used in SessionStart response) */
1601
+ declare const openApiLinks: {
1602
+ readonly SessionAct: {
1603
+ readonly operationId: "SessionAct";
1604
+ readonly parameters: {
1605
+ readonly id: "$response.body#/data/sessionId";
1606
+ };
1607
+ readonly description: "Perform an action on the session";
1608
+ };
1609
+ readonly SessionExtract: {
1610
+ readonly operationId: "SessionExtract";
1611
+ readonly parameters: {
1612
+ readonly id: "$response.body#/data/sessionId";
1613
+ };
1614
+ readonly description: "Extract data from the session";
1615
+ };
1616
+ readonly SessionObserve: {
1617
+ readonly operationId: "SessionObserve";
1618
+ readonly parameters: {
1619
+ readonly id: "$response.body#/data/sessionId";
1620
+ };
1621
+ readonly description: "Observe available actions on the session";
1622
+ };
1623
+ readonly SessionNavigate: {
1624
+ readonly operationId: "SessionNavigate";
1625
+ readonly parameters: {
1626
+ readonly id: "$response.body#/data/sessionId";
1627
+ };
1628
+ readonly description: "Navigate to a URL in the session";
1629
+ };
1630
+ readonly SessionAgentExecute: {
1631
+ readonly operationId: "SessionAgentExecute";
1632
+ readonly parameters: {
1633
+ readonly id: "$response.body#/data/sessionId";
1634
+ };
1635
+ readonly description: "Execute an agent on the session";
1636
+ };
1637
+ readonly SessionReplay: {
1638
+ readonly operationId: "SessionReplay";
1639
+ readonly parameters: {
1640
+ readonly id: "$response.body#/data/sessionId";
1641
+ };
1642
+ readonly description: "Replay session metrics";
1643
+ };
1644
+ readonly SessionEnd: {
1645
+ readonly operationId: "SessionEnd";
1646
+ readonly parameters: {
1647
+ readonly id: "$response.body#/data/sessionId";
1648
+ };
1649
+ readonly description: "End the session and release resources";
1650
+ };
1651
+ };
1652
+ /** OpenAPI operation metadata for each endpoint */
1653
+ declare const Operations: {
1654
+ readonly SessionStart: {
1655
+ readonly operationId: "SessionStart";
1656
+ readonly summary: "Start a new browser session";
1657
+ readonly description: "Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations.";
1658
+ };
1659
+ readonly SessionEnd: {
1660
+ readonly operationId: "SessionEnd";
1661
+ readonly summary: "End a browser session";
1662
+ readonly description: "Terminates the browser session and releases all associated resources.";
1663
+ };
1664
+ readonly SessionAct: {
1665
+ readonly operationId: "SessionAct";
1666
+ readonly summary: "Perform an action";
1667
+ readonly description: "Executes a browser action using natural language instructions or a predefined Action object.";
1668
+ };
1669
+ readonly SessionExtract: {
1670
+ readonly operationId: "SessionExtract";
1671
+ readonly summary: "Extract data from the page";
1672
+ readonly description: "Extracts structured data from the current page using AI-powered analysis.";
1673
+ };
1674
+ readonly SessionObserve: {
1675
+ readonly operationId: "SessionObserve";
1676
+ readonly summary: "Observe available actions";
1677
+ readonly description: "Identifies and returns available actions on the current page that match the given instruction.";
1678
+ };
1679
+ readonly SessionNavigate: {
1680
+ readonly operationId: "SessionNavigate";
1681
+ readonly summary: "Navigate to a URL";
1682
+ readonly description: "Navigates the browser to the specified URL.";
1683
+ };
1684
+ readonly SessionAgentExecute: {
1685
+ readonly operationId: "SessionAgentExecute";
1686
+ readonly summary: "Execute an AI agent";
1687
+ readonly description: "Runs an autonomous AI agent that can perform complex multi-step browser tasks.";
1688
+ };
1689
+ readonly SessionReplay: {
1690
+ readonly operationId: "SessionReplay";
1691
+ readonly summary: "Replay session metrics";
1692
+ readonly description: "Retrieves replay metrics for a session.";
1693
+ };
1694
+ };
1695
+ type Action$1 = z$1.infer<typeof ActionSchema>;
1696
+ type ModelConfig = z$1.infer<typeof ModelConfigSchema>;
1697
+ type BrowserConfig = z$1.infer<typeof BrowserConfigSchema>;
1698
+ type SessionIdParams = z$1.infer<typeof SessionIdParamsSchema>;
1699
+ type SessionHeaders = z$1.infer<typeof SessionHeadersSchema>;
1700
+ type BrowserbaseViewport = z$1.infer<typeof BrowserbaseViewportSchema>;
1701
+ type BrowserbaseFingerprintScreen = z$1.infer<typeof BrowserbaseFingerprintScreenSchema>;
1702
+ type BrowserbaseFingerprint = z$1.infer<typeof BrowserbaseFingerprintSchema>;
1703
+ type BrowserbaseContext = z$1.infer<typeof BrowserbaseContextSchema>;
1704
+ type BrowserbaseBrowserSettings = z$1.infer<typeof BrowserbaseBrowserSettingsSchema>;
1705
+ type BrowserbaseProxyGeolocation = z$1.infer<typeof BrowserbaseProxyGeolocationSchema>;
1706
+ type BrowserbaseProxyConfig = z$1.infer<typeof BrowserbaseProxyConfigSchema>;
1707
+ type ExternalProxyConfig = z$1.infer<typeof ExternalProxyConfigSchema>;
1708
+ type BrowserbaseSessionCreateParams = z$1.infer<typeof BrowserbaseSessionCreateParamsSchema>;
1709
+ type SessionStartRequest = z$1.infer<typeof SessionStartRequestSchema>;
1710
+ type SessionStartResult = z$1.infer<typeof SessionStartResultSchema>;
1711
+ type SessionStartResponse = z$1.infer<typeof SessionStartResponseSchema>;
1712
+ type SessionEndResult = z$1.infer<typeof SessionEndResultSchema>;
1713
+ type SessionEndResponse = z$1.infer<typeof SessionEndResponseSchema>;
1714
+ type ActRequest = z$1.infer<typeof ActRequestSchema>;
1715
+ type ActResultData = z$1.infer<typeof ActResultDataSchema>;
1716
+ type ActResult$1 = z$1.infer<typeof ActResultSchema>;
1717
+ type ActResponse = z$1.infer<typeof ActResponseSchema>;
1718
+ type ExtractRequest = z$1.infer<typeof ExtractRequestSchema>;
1719
+ type ExtractResult$1 = z$1.infer<typeof ExtractResultSchema>;
1720
+ type ExtractResponse = z$1.infer<typeof ExtractResponseSchema>;
1721
+ type ObserveRequest = z$1.infer<typeof ObserveRequestSchema>;
1722
+ type ObserveResult = z$1.infer<typeof ObserveResultSchema>;
1723
+ type ObserveResponse = z$1.infer<typeof ObserveResponseSchema>;
1724
+ type AgentAction$1 = z$1.infer<typeof AgentActionSchema>;
1725
+ type AgentUsage = z$1.infer<typeof AgentUsageSchema>;
1726
+ type AgentResultData = z$1.infer<typeof AgentResultDataSchema>;
1727
+ type AgentExecuteRequest = z$1.infer<typeof AgentExecuteRequestSchema>;
1728
+ type AgentExecuteResult = z$1.infer<typeof AgentExecuteResultSchema>;
1729
+ type AgentExecuteResponse = z$1.infer<typeof AgentExecuteResponseSchema>;
1730
+ type NavigateRequest = z$1.infer<typeof NavigateRequestSchema>;
1731
+ type NavigateResult = z$1.infer<typeof NavigateResultSchema>;
1732
+ type NavigateResponse = z$1.infer<typeof NavigateResponseSchema>;
1733
+ type TokenUsage = z$1.infer<typeof TokenUsageSchema>;
1734
+ type ReplayAction = z$1.infer<typeof ReplayActionSchema>;
1735
+ type ReplayPage = z$1.infer<typeof ReplayPageSchema>;
1736
+ type ReplayResult = z$1.infer<typeof ReplayResultSchema>;
1737
+ type ReplayResponse = z$1.infer<typeof ReplayResponseSchema>;
1738
+ type StreamEventStatus = z$1.infer<typeof StreamEventStatusSchema>;
1739
+ type StreamEventType = z$1.infer<typeof StreamEventTypeSchema>;
1740
+ type StreamEventSystemData = z$1.infer<typeof StreamEventSystemDataSchema>;
1741
+ type StreamEventLogData = z$1.infer<typeof StreamEventLogDataSchema>;
1742
+ type StreamEvent = z$1.infer<typeof StreamEventSchema>;
1743
+
1744
+ declare const api_ActOptionsSchema: typeof ActOptionsSchema;
1745
+ type api_ActRequest = ActRequest;
1746
+ declare const api_ActRequestSchema: typeof ActRequestSchema;
1747
+ type api_ActResponse = ActResponse;
1748
+ declare const api_ActResponseSchema: typeof ActResponseSchema;
1749
+ type api_ActResultData = ActResultData;
1750
+ declare const api_ActResultDataSchema: typeof ActResultDataSchema;
1751
+ declare const api_ActResultSchema: typeof ActResultSchema;
1752
+ declare const api_ActionSchema: typeof ActionSchema;
1753
+ declare const api_AgentActionSchema: typeof AgentActionSchema;
1754
+ declare const api_AgentConfigSchema: typeof AgentConfigSchema;
1755
+ declare const api_AgentExecuteOptionsSchema: typeof AgentExecuteOptionsSchema;
1756
+ type api_AgentExecuteRequest = AgentExecuteRequest;
1757
+ declare const api_AgentExecuteRequestSchema: typeof AgentExecuteRequestSchema;
1758
+ type api_AgentExecuteResponse = AgentExecuteResponse;
1759
+ declare const api_AgentExecuteResponseSchema: typeof AgentExecuteResponseSchema;
1760
+ type api_AgentExecuteResult = AgentExecuteResult;
1761
+ declare const api_AgentExecuteResultSchema: typeof AgentExecuteResultSchema;
1762
+ type api_AgentResultData = AgentResultData;
1763
+ declare const api_AgentResultDataSchema: typeof AgentResultDataSchema;
1764
+ type api_AgentUsage = AgentUsage;
1765
+ declare const api_AgentUsageSchema: typeof AgentUsageSchema;
1766
+ type api_BrowserConfig = BrowserConfig;
1767
+ declare const api_BrowserConfigSchema: typeof BrowserConfigSchema;
1768
+ type api_BrowserbaseBrowserSettings = BrowserbaseBrowserSettings;
1769
+ declare const api_BrowserbaseBrowserSettingsSchema: typeof BrowserbaseBrowserSettingsSchema;
1770
+ type api_BrowserbaseContext = BrowserbaseContext;
1771
+ declare const api_BrowserbaseContextSchema: typeof BrowserbaseContextSchema;
1772
+ type api_BrowserbaseFingerprint = BrowserbaseFingerprint;
1773
+ declare const api_BrowserbaseFingerprintSchema: typeof BrowserbaseFingerprintSchema;
1774
+ type api_BrowserbaseFingerprintScreen = BrowserbaseFingerprintScreen;
1775
+ declare const api_BrowserbaseFingerprintScreenSchema: typeof BrowserbaseFingerprintScreenSchema;
1776
+ type api_BrowserbaseProxyConfig = BrowserbaseProxyConfig;
1777
+ declare const api_BrowserbaseProxyConfigSchema: typeof BrowserbaseProxyConfigSchema;
1778
+ type api_BrowserbaseProxyGeolocation = BrowserbaseProxyGeolocation;
1779
+ declare const api_BrowserbaseProxyGeolocationSchema: typeof BrowserbaseProxyGeolocationSchema;
1780
+ type api_BrowserbaseSessionCreateParams = BrowserbaseSessionCreateParams;
1781
+ declare const api_BrowserbaseSessionCreateParamsSchema: typeof BrowserbaseSessionCreateParamsSchema;
1782
+ type api_BrowserbaseViewport = BrowserbaseViewport;
1783
+ declare const api_BrowserbaseViewportSchema: typeof BrowserbaseViewportSchema;
1784
+ declare const api_ErrorResponseSchema: typeof ErrorResponseSchema;
1785
+ type api_ExternalProxyConfig = ExternalProxyConfig;
1786
+ declare const api_ExternalProxyConfigSchema: typeof ExternalProxyConfigSchema;
1787
+ declare const api_ExtractOptionsSchema: typeof ExtractOptionsSchema;
1788
+ type api_ExtractRequest = ExtractRequest;
1789
+ declare const api_ExtractRequestSchema: typeof ExtractRequestSchema;
1790
+ type api_ExtractResponse = ExtractResponse;
1791
+ declare const api_ExtractResponseSchema: typeof ExtractResponseSchema;
1792
+ declare const api_ExtractResultSchema: typeof ExtractResultSchema;
1793
+ declare const api_LocalBrowserLaunchOptionsSchema: typeof LocalBrowserLaunchOptionsSchema;
1794
+ type api_ModelConfig = ModelConfig;
1795
+ declare const api_ModelConfigObjectSchema: typeof ModelConfigObjectSchema;
1796
+ declare const api_ModelConfigSchema: typeof ModelConfigSchema;
1797
+ declare const api_ModelNameSchema: typeof ModelNameSchema;
1798
+ declare const api_NavigateOptionsSchema: typeof NavigateOptionsSchema;
1799
+ type api_NavigateRequest = NavigateRequest;
1800
+ declare const api_NavigateRequestSchema: typeof NavigateRequestSchema;
1801
+ type api_NavigateResponse = NavigateResponse;
1802
+ declare const api_NavigateResponseSchema: typeof NavigateResponseSchema;
1803
+ type api_NavigateResult = NavigateResult;
1804
+ declare const api_NavigateResultSchema: typeof NavigateResultSchema;
1805
+ declare const api_ObserveOptionsSchema: typeof ObserveOptionsSchema;
1806
+ type api_ObserveRequest = ObserveRequest;
1807
+ declare const api_ObserveRequestSchema: typeof ObserveRequestSchema;
1808
+ type api_ObserveResponse = ObserveResponse;
1809
+ declare const api_ObserveResponseSchema: typeof ObserveResponseSchema;
1810
+ type api_ObserveResult = ObserveResult;
1811
+ declare const api_ObserveResultSchema: typeof ObserveResultSchema;
1812
+ declare const api_Operations: typeof Operations;
1813
+ declare const api_ProxyConfigSchema: typeof ProxyConfigSchema;
1814
+ type api_ReplayAction = ReplayAction;
1815
+ declare const api_ReplayActionSchema: typeof ReplayActionSchema;
1816
+ type api_ReplayPage = ReplayPage;
1817
+ declare const api_ReplayPageSchema: typeof ReplayPageSchema;
1818
+ type api_ReplayResponse = ReplayResponse;
1819
+ declare const api_ReplayResponseSchema: typeof ReplayResponseSchema;
1820
+ type api_ReplayResult = ReplayResult;
1821
+ declare const api_ReplayResultSchema: typeof ReplayResultSchema;
1822
+ type api_SessionEndResponse = SessionEndResponse;
1823
+ declare const api_SessionEndResponseSchema: typeof SessionEndResponseSchema;
1824
+ type api_SessionEndResult = SessionEndResult;
1825
+ declare const api_SessionEndResultSchema: typeof SessionEndResultSchema;
1826
+ type api_SessionHeaders = SessionHeaders;
1827
+ declare const api_SessionHeadersSchema: typeof SessionHeadersSchema;
1828
+ type api_SessionIdParams = SessionIdParams;
1829
+ declare const api_SessionIdParamsSchema: typeof SessionIdParamsSchema;
1830
+ type api_SessionStartRequest = SessionStartRequest;
1831
+ declare const api_SessionStartRequestSchema: typeof SessionStartRequestSchema;
1832
+ type api_SessionStartResponse = SessionStartResponse;
1833
+ declare const api_SessionStartResponseSchema: typeof SessionStartResponseSchema;
1834
+ type api_SessionStartResult = SessionStartResult;
1835
+ declare const api_SessionStartResultSchema: typeof SessionStartResultSchema;
1836
+ type api_StreamEvent = StreamEvent;
1837
+ type api_StreamEventLogData = StreamEventLogData;
1838
+ declare const api_StreamEventLogDataSchema: typeof StreamEventLogDataSchema;
1839
+ declare const api_StreamEventSchema: typeof StreamEventSchema;
1840
+ type api_StreamEventStatus = StreamEventStatus;
1841
+ declare const api_StreamEventStatusSchema: typeof StreamEventStatusSchema;
1842
+ type api_StreamEventSystemData = StreamEventSystemData;
1843
+ declare const api_StreamEventSystemDataSchema: typeof StreamEventSystemDataSchema;
1844
+ type api_StreamEventType = StreamEventType;
1845
+ declare const api_StreamEventTypeSchema: typeof StreamEventTypeSchema;
1846
+ type api_TokenUsage = TokenUsage;
1847
+ declare const api_TokenUsageSchema: typeof TokenUsageSchema;
1848
+ declare const api_openApiLinks: typeof openApiLinks;
1849
+ declare const api_openApiSecuritySchemes: typeof openApiSecuritySchemes;
1850
+ declare namespace api {
1851
+ 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, 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 };
1852
+ }
1853
+
504
1854
  declare class StagehandAPIError extends Error {
505
1855
  constructor(message: string);
506
1856
  }
@@ -599,37 +1949,35 @@ interface StagehandMetrics {
599
1949
  }
600
1950
 
601
1951
  type V3Env = "LOCAL" | "BROWSERBASE";
602
- /** Local launch options for V3 (chrome-launcher + CDP).
603
- * Matches v2 shape where feasible; unsupported fields are accepted but ignored.
604
- */
605
- interface LocalBrowserLaunchOptions {
606
- args?: string[];
607
- executablePath?: string;
608
- userDataDir?: string;
609
- preserveUserDataDir?: boolean;
610
- headless?: boolean;
611
- devtools?: boolean;
612
- chromiumSandbox?: boolean;
613
- ignoreDefaultArgs?: boolean | string[];
614
- proxy?: {
615
- server: string;
616
- bypass?: string;
617
- username?: string;
618
- password?: string;
619
- };
620
- locale?: string;
621
- viewport?: {
622
- width: number;
623
- height: number;
624
- };
625
- deviceScaleFactor?: number;
626
- hasTouch?: boolean;
627
- ignoreHTTPSErrors?: boolean;
628
- cdpUrl?: string;
629
- connectTimeoutMs?: number;
630
- downloadsPath?: string;
631
- acceptDownloads?: boolean;
632
- }
1952
+ declare const localBrowserLaunchOptionsSchema: z.ZodObject<{
1953
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1954
+ executablePath: z.ZodOptional<z.ZodString>;
1955
+ userDataDir: z.ZodOptional<z.ZodString>;
1956
+ preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
1957
+ headless: z.ZodOptional<z.ZodBoolean>;
1958
+ devtools: z.ZodOptional<z.ZodBoolean>;
1959
+ chromiumSandbox: z.ZodOptional<z.ZodBoolean>;
1960
+ ignoreDefaultArgs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
1961
+ proxy: z.ZodOptional<z.ZodObject<{
1962
+ server: z.ZodString;
1963
+ bypass: z.ZodOptional<z.ZodString>;
1964
+ username: z.ZodOptional<z.ZodString>;
1965
+ password: z.ZodOptional<z.ZodString>;
1966
+ }, z.core.$strip>>;
1967
+ locale: z.ZodOptional<z.ZodString>;
1968
+ viewport: z.ZodOptional<z.ZodObject<{
1969
+ width: z.ZodNumber;
1970
+ height: z.ZodNumber;
1971
+ }, z.core.$strip>>;
1972
+ deviceScaleFactor: z.ZodOptional<z.ZodNumber>;
1973
+ hasTouch: z.ZodOptional<z.ZodBoolean>;
1974
+ ignoreHTTPSErrors: z.ZodOptional<z.ZodBoolean>;
1975
+ cdpUrl: z.ZodOptional<z.ZodString>;
1976
+ connectTimeoutMs: z.ZodOptional<z.ZodNumber>;
1977
+ downloadsPath: z.ZodOptional<z.ZodString>;
1978
+ acceptDownloads: z.ZodOptional<z.ZodBoolean>;
1979
+ }, z.core.$strict>;
1980
+ type LocalBrowserLaunchOptions = z.infer<typeof LocalBrowserLaunchOptionsSchema>;
633
1981
  /** Constructor options for V3 */
634
1982
  interface V3Options {
635
1983
  env: V3Env;
@@ -638,9 +1986,7 @@ interface V3Options {
638
1986
  /**
639
1987
  * Optional: fine-tune Browserbase session creation or resume an existing session.
640
1988
  */
641
- browserbaseSessionCreateParams?: Omit<Browserbase.Sessions.SessionCreateParams, "projectId"> & {
642
- projectId?: string;
643
- };
1989
+ browserbaseSessionCreateParams?: BrowserbaseSessionCreateParams;
644
1990
  browserbaseSessionID?: string;
645
1991
  localBrowserLaunchOptions?: LocalBrowserLaunchOptions;
646
1992
  model?: ModelConfiguration;
@@ -650,6 +1996,8 @@ interface V3Options {
650
1996
  experimental?: boolean;
651
1997
  verbose?: 0 | 1 | 2;
652
1998
  selfHeal?: boolean;
1999
+ waitForCaptchaSolves?: boolean;
2000
+ actTimeoutMs?: number;
653
2001
  /** Disable pino logging backend (useful for tests or minimal environments). */
654
2002
  disablePino?: boolean;
655
2003
  /** Optional external logger hook for integrating with host apps. */
@@ -778,12 +2126,32 @@ declare class ResponseParseError extends StagehandError {
778
2126
  declare class TimeoutError extends StagehandError {
779
2127
  constructor(operation: string, timeoutMs: number);
780
2128
  }
2129
+ declare class ActTimeoutError extends TimeoutError {
2130
+ constructor(timeoutMs: number);
2131
+ }
2132
+ declare class ExtractTimeoutError extends TimeoutError {
2133
+ constructor(timeoutMs: number);
2134
+ }
2135
+ declare class ObserveTimeoutError extends TimeoutError {
2136
+ constructor(timeoutMs: number);
2137
+ }
781
2138
  declare class PageNotFoundError extends StagehandError {
782
2139
  constructor(identifier: string);
783
2140
  }
784
2141
  declare class ConnectionTimeoutError extends StagehandError {
785
2142
  constructor(message: string);
786
2143
  }
2144
+ declare class StreamingCallbacksInNonStreamingModeError extends StagehandError {
2145
+ readonly invalidCallbacks: string[];
2146
+ constructor(invalidCallbacks: string[]);
2147
+ }
2148
+ declare class AgentAbortError extends StagehandError {
2149
+ readonly reason: string;
2150
+ constructor(reason?: string);
2151
+ }
2152
+ declare class StagehandClosedError extends StagehandError {
2153
+ constructor();
2154
+ }
787
2155
 
788
2156
  declare class AISdkClient extends LLMClient {
789
2157
  type: "aisdk";
@@ -794,139 +2162,85 @@ declare class AISdkClient extends LLMClient {
794
2162
  createChatCompletion<T = ChatCompletion>({ options, }: CreateChatCompletionOptions): Promise<T>;
795
2163
  }
796
2164
 
2165
+ /**
2166
+ * Constructor parameters for StagehandAPIClient
2167
+ */
797
2168
  interface StagehandAPIConstructorParams {
798
2169
  apiKey: string;
799
2170
  projectId: string;
800
2171
  logger: (message: LogLine) => void;
801
2172
  }
802
- interface StartSessionParams {
803
- modelName: string;
2173
+ /**
2174
+ * Parameters for starting a session via the API client.
2175
+ * Extends Api.SessionStartRequest with client-specific field (modelApiKey).
2176
+ *
2177
+ * Wire format: Api.SessionStartRequest (modelApiKey sent via header, not body)
2178
+ */
2179
+ interface ClientSessionStartParams extends SessionStartRequest {
2180
+ /** Model API key - sent via x-model-api-key header, not in request body */
804
2181
  modelApiKey: string;
805
- domSettleTimeoutMs: number;
806
- verbose: number;
807
- systemPrompt?: string;
808
- browserbaseSessionCreateParams?: Omit<Browserbase.Sessions.SessionCreateParams, "projectId"> & {
809
- projectId?: string;
810
- };
811
- selfHeal?: boolean;
812
- browserbaseSessionID?: string;
813
2182
  }
814
- interface StartSessionResult {
815
- sessionId: string;
816
- available?: boolean;
817
- }
818
- interface APIActParameters {
819
- input: string | Action;
2183
+ /**
2184
+ * Client parameters for act() method.
2185
+ * Derives structure from Api.ActRequest but uses SDK's ActOptions (which includes `page`).
2186
+ * Before serialization, `page` is stripped to produce Api.ActRequest wire format.
2187
+ */
2188
+ interface ClientActParameters {
2189
+ input: ActRequest["input"];
820
2190
  options?: ActOptions;
821
- frameId?: string;
822
- }
823
- interface APIExtractParameters {
824
- instruction?: string;
825
- schema?: StagehandZodSchema;
826
- options?: ExtractOptions;
827
- frameId?: string;
828
- }
829
- interface APIObserveParameters {
830
- instruction?: string;
831
- options?: ObserveOptions;
832
- frameId?: string;
2191
+ frameId?: ActRequest["frameId"];
833
2192
  }
834
- interface SerializableResponse {
835
- requestId: string;
836
- frameId?: string;
837
- loaderId?: string;
838
- response: Protocol.Network.Response;
839
- fromServiceWorkerFlag?: boolean;
840
- finishedSettled?: boolean;
841
- extraInfoHeaders?: Protocol.Network.Headers | null;
842
- extraInfoHeadersText?: string;
843
- }
844
-
845
2193
  /**
846
- * Represents a path through a Zod schema from the root object down to a
847
- * particular field. The `segments` array describes the chain of keys/indices.
848
- *
849
- * - **String** segments indicate object property names.
850
- * - **Number** segments indicate array indices.
851
- *
852
- * For example, `["users", 0, "homepage"]` might describe reaching
853
- * the `homepage` field in `schema.users[0].homepage`.
2194
+ * Client parameters for extract() method.
2195
+ * Derives structure from Api.ExtractRequest but uses SDK's ExtractOptions (which includes `page`)
2196
+ * and accepts Zod schema (converted to JSON schema for wire format).
854
2197
  */
855
- interface ZodPathSegments {
856
- /**
857
- * The ordered list of keys/indices leading from the schema root
858
- * to the targeted field.
859
- */
860
- segments: Array<string | number>;
2198
+ interface ClientExtractParameters {
2199
+ instruction?: ExtractRequest["instruction"];
2200
+ schema?: StagehandZodSchema;
2201
+ options?: ExtractOptions;
2202
+ frameId?: ExtractRequest["frameId"];
861
2203
  }
862
-
863
- type EvaluateOptions = {
864
- /** The question to ask about the task state */
865
- question: string;
866
- /** The answer to the question */
867
- answer?: string;
868
- /** Whether to take a screenshot of the task state, or array of screenshots to evaluate */
869
- screenshot?: boolean | Buffer[];
870
- /** Custom system prompt for the evaluator */
871
- systemPrompt?: string;
872
- /** Delay in milliseconds before taking the screenshot @default 250 */
873
- screenshotDelayMs?: number;
874
- /** The agent's reasoning/thought process for completing the task */
875
- agentReasoning?: string;
876
- };
877
- type BatchAskOptions = {
878
- /** Array of questions with optional answers */
879
- questions: Array<{
880
- question: string;
881
- answer?: string;
882
- }>;
883
- /** Whether to take a screenshot of the task state */
884
- screenshot?: boolean;
885
- /** Custom system prompt for the evaluator */
886
- systemPrompt?: string;
887
- /** Delay in milliseconds before taking the screenshot @default 1000 */
888
- screenshotDelayMs?: number;
889
- };
890
2204
  /**
891
- * Result of an evaluation
2205
+ * Client parameters for observe() method.
2206
+ * Derives structure from Api.ObserveRequest but uses SDK's ObserveOptions (which includes `page`).
2207
+ * Before serialization, `page` is stripped to produce Api.ObserveRequest wire format.
892
2208
  */
893
- interface EvaluationResult {
894
- /**
895
- * The evaluation result ('YES', 'NO', or 'INVALID' if parsing failed or value was unexpected)
896
- */
897
- evaluation: "YES" | "NO" | "INVALID";
898
- /**
899
- * The reasoning behind the evaluation
900
- */
901
- reasoning: string;
2209
+ interface ClientObserveParameters {
2210
+ instruction?: ObserveRequest["instruction"];
2211
+ options?: ObserveOptions;
2212
+ frameId?: ObserveRequest["frameId"];
902
2213
  }
903
-
904
2214
  declare class StagehandAPIClient {
905
2215
  private apiKey;
906
2216
  private projectId;
907
2217
  private sessionId?;
908
2218
  private modelApiKey;
2219
+ private modelProvider?;
909
2220
  private logger;
910
2221
  private fetchWithCookies;
911
2222
  constructor({ apiKey, projectId, logger }: StagehandAPIConstructorParams);
912
- init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: StartSessionParams): Promise<StartSessionResult>;
913
- act({ input, options, frameId }: APIActParameters): Promise<ActResult>;
914
- extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: APIExtractParameters): Promise<ExtractResult<T>>;
915
- observe({ instruction, options, frameId, }: APIObserveParameters): Promise<Action[]>;
916
- goto(url: string, options?: {
917
- waitUntil?: "load" | "domcontentloaded" | "networkidle";
918
- }, frameId?: string): Promise<SerializableResponse | null>;
2223
+ init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: ClientSessionStartParams): Promise<SessionStartResult>;
2224
+ act({ input, options, frameId, }: ClientActParameters): Promise<ActResult>;
2225
+ extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: ClientExtractParameters): Promise<ExtractResult<T>>;
2226
+ observe({ instruction, options, frameId, }: ClientObserveParameters): Promise<Action[]>;
2227
+ goto(url: string, options?: NavigateRequest["options"], frameId?: string): Promise<SerializableResponse | null>;
919
2228
  agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
920
2229
  end(): Promise<Response>;
921
2230
  getReplayMetrics(): Promise<StagehandMetrics>;
2231
+ /**
2232
+ * Prepares a model configuration for the API payload by ensuring the `apiKey`
2233
+ * is included. If the model is passed as a string, converts it to an object
2234
+ * with `modelName` and `apiKey`.
2235
+ *
2236
+ * In API mode, we only attempt to load an API key from env vars when the
2237
+ * model provider differs from the one used to init the session.
2238
+ */
2239
+ private prepareModelConfig;
922
2240
  private execute;
923
2241
  private request;
924
2242
  }
925
2243
 
926
- type InitScriptSource<Arg> = string | {
927
- path?: string;
928
- content?: string;
929
- } | ((arg: Arg) => unknown);
930
2244
  /**
931
2245
  * V3Context
932
2246
  *
@@ -1054,7 +2368,7 @@ declare class V3Context {
1054
2368
  awaitActivePage(timeoutMs?: number): Promise<Page>;
1055
2369
  }
1056
2370
 
1057
- type AgentReplayStep = AgentReplayActStep | AgentReplayFillFormStep | AgentReplayGotoStep | AgentReplayScrollStep | AgentReplayWaitStep | AgentReplayNavBackStep | {
2371
+ type AgentReplayStep = AgentReplayActStep | AgentReplayFillFormStep | AgentReplayGotoStep | AgentReplayScrollStep | AgentReplayWaitStep | AgentReplayNavBackStep | AgentReplayKeysStep | {
1058
2372
  type: string;
1059
2373
  [key: string]: unknown;
1060
2374
  };
@@ -1097,6 +2411,16 @@ interface AgentReplayNavBackStep {
1097
2411
  type: "navback";
1098
2412
  waitUntil?: LoadState;
1099
2413
  }
2414
+ interface AgentReplayKeysStep {
2415
+ type: "keys";
2416
+ instruction?: string;
2417
+ playwrightArguments: {
2418
+ method: "type" | "press";
2419
+ text?: string;
2420
+ keys?: string;
2421
+ times?: number;
2422
+ };
2423
+ }
1100
2424
 
1101
2425
  /**
1102
2426
  * Response
@@ -1296,6 +2620,7 @@ declare class Page {
1296
2620
  private ensureCursorScript;
1297
2621
  enableCursorOverlay(): Promise<void>;
1298
2622
  private updateCursor;
2623
+ addInitScript<Arg>(script: InitScriptSource<Arg>, arg?: Arg): Promise<void>;
1299
2624
  /**
1300
2625
  * Factory: create Page and seed registry with the shallow tree from Page.getFrameTree.
1301
2626
  * Assumes Page domain is already enabled on the session passed in.
@@ -1476,7 +2801,7 @@ declare class Page {
1476
2801
  */
1477
2802
  waitForLoadState(state: LoadState, timeoutMs?: number): Promise<void>;
1478
2803
  /**
1479
- * Evaluate a function or expression in the current main frame's isolated world.
2804
+ * Evaluate a function or expression in the current main frame's main world.
1480
2805
  * - If a string is provided, it is treated as a JS expression.
1481
2806
  * - If a function is provided, it is stringified and invoked with the optional argument.
1482
2807
  * - The return value should be JSON-serializable. Non-serializable objects will
@@ -1496,52 +2821,32 @@ declare class Page {
1496
2821
  * on the top-level page target's session. Coordinates are relative to the
1497
2822
  * viewport origin (top-left). Does not scroll.
1498
2823
  */
1499
- click(x: number, y: number, options: {
1500
- button?: "left" | "right" | "middle";
1501
- clickCount?: number;
1502
- returnXpath: true;
1503
- }): Promise<string>;
1504
2824
  click(x: number, y: number, options?: {
1505
2825
  button?: "left" | "right" | "middle";
1506
2826
  clickCount?: number;
1507
- returnXpath?: false;
1508
- }): Promise<void>;
1509
- click(x: number, y: number, options: {
1510
- button?: "left" | "right" | "middle";
1511
- clickCount?: number;
1512
- returnXpath: boolean;
1513
- }): Promise<void | string>;
1514
- scroll(x: number, y: number, deltaX: number, deltaY: number, options: {
1515
- returnXpath: true;
2827
+ returnXpath?: boolean;
2828
+ }): Promise<string>;
2829
+ /**
2830
+ * Hover at absolute page coordinates (CSS pixels).
2831
+ * Dispatches mouseMoved via CDP Input domain on the top-level page target's
2832
+ * session.
2833
+ */
2834
+ hover(x: number, y: number, options?: {
2835
+ returnXpath?: boolean;
1516
2836
  }): Promise<string>;
1517
2837
  scroll(x: number, y: number, deltaX: number, deltaY: number, options?: {
1518
- returnXpath?: false;
1519
- }): Promise<void>;
1520
- scroll(x: number, y: number, deltaX: number, deltaY: number, options: {
1521
- returnXpath: boolean;
1522
- }): Promise<void | string>;
2838
+ returnXpath?: boolean;
2839
+ }): Promise<string>;
1523
2840
  /**
1524
2841
  * Drag from (fromX, fromY) to (toX, toY) using mouse events.
1525
2842
  * Sends mouseMoved → mousePressed → mouseMoved (steps) → mouseReleased.
1526
2843
  */
1527
- dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options: {
1528
- button?: "left" | "right" | "middle";
1529
- steps?: number;
1530
- delay?: number;
1531
- returnXpath: true;
1532
- }): Promise<[string, string]>;
1533
2844
  dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options?: {
1534
2845
  button?: "left" | "right" | "middle";
1535
2846
  steps?: number;
1536
2847
  delay?: number;
1537
- returnXpath?: false;
1538
- }): Promise<void>;
1539
- dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options: {
1540
- button?: "left" | "right" | "middle";
1541
- steps?: number;
1542
- delay?: number;
1543
- returnXpath: boolean;
1544
- }): Promise<void | [string, string]>;
2848
+ returnXpath?: boolean;
2849
+ }): Promise<[string, string]>;
1545
2850
  /**
1546
2851
  * Type a string by dispatching keyDown/keyUp events per character.
1547
2852
  * Focus must already be on the desired element. Uses CDP Input.dispatchKeyEvent
@@ -1565,7 +2870,7 @@ declare class Page {
1565
2870
  private keyDown;
1566
2871
  /** Release a pressed key */
1567
2872
  private keyUp;
1568
- /** Normalize modifier key names to match CDP expectations */
2873
+ /** Normalize key names to match CDP expectations */
1569
2874
  private normalizeModifierKey;
1570
2875
  /**
1571
2876
  * Get the map of named keys with their properties
@@ -1582,10 +2887,8 @@ declare class Page {
1582
2887
  * Only used on macOS to trigger system editing shortcuts (e.g., selectAll, copy, paste...).
1583
2888
  */
1584
2889
  private macCommandsFor;
1585
- /**
1586
- * Create an isolated world for the **current** main frame and return its context id.
1587
- */
1588
- private createIsolatedWorldForCurrentMain;
2890
+ /** Resolve the main-world execution context for the current main frame. */
2891
+ private mainWorldExecutionContextId;
1589
2892
  /**
1590
2893
  * Wait until the **current** main frame reaches a lifecycle state.
1591
2894
  * - Fast path via `document.readyState`.
@@ -1596,7 +2899,7 @@ declare class Page {
1596
2899
  }
1597
2900
 
1598
2901
  interface AgentContext {
1599
- options: AgentExecuteOptions;
2902
+ options: AgentExecuteOptionsBase;
1600
2903
  maxSteps: number;
1601
2904
  systemPrompt: string;
1602
2905
  allTools: ToolSet;
@@ -1635,18 +2938,259 @@ interface AgentResult {
1635
2938
  cached_input_tokens?: number;
1636
2939
  inference_time_ms: number;
1637
2940
  };
2941
+ /**
2942
+ * The conversation messages from this execution.
2943
+ * Pass these to a subsequent execute() call via the `messages` option to continue the conversation.
2944
+ * @experimental
2945
+ */
2946
+ messages?: ModelMessage[];
1638
2947
  }
1639
2948
  type AgentStreamResult = StreamTextResult<ToolSet, never> & {
1640
2949
  result: Promise<AgentResult>;
1641
2950
  };
1642
- interface AgentExecuteOptions {
2951
+ /**
2952
+ * Base callbacks shared between execute (non-streaming) and streaming modes.
2953
+ */
2954
+ interface AgentCallbacks {
2955
+ /**
2956
+ * Optional function called before each step to modify settings.
2957
+ * You can change the model, tool choices, active tools, system prompt,
2958
+ * and input messages for each step.
2959
+ */
2960
+ prepareStep?: PrepareStepFunction<ToolSet>;
2961
+ /**
2962
+ * Callback called when each step (LLM call) is finished.
2963
+ * This is called for intermediate steps as well as the final step.
2964
+ */
2965
+ onStepFinish?: GenerateTextOnStepFinishCallback<ToolSet> | StreamTextOnStepFinishCallback<ToolSet>;
2966
+ }
2967
+ /**
2968
+ * Error message type for streaming-only callbacks used in non-streaming mode.
2969
+ * This provides a clear error message when users try to use streaming callbacks without stream: true.
2970
+ */
2971
+ type StreamingCallbackNotAvailable = "This callback requires 'stream: true' in AgentConfig. Set stream: true to use streaming callbacks like onChunk, onFinish, onError, and onAbort.";
2972
+ /**
2973
+ * Error message for safety confirmation callback misuse.
2974
+ * Safety confirmations are only available for non-streaming CUA agent executions.
2975
+ */
2976
+ type SafetyConfirmationCallbackNotAvailable = "Safety confirmation callbacks are only available via non-streaming AgentExecuteOptions.callbacks when using mode: 'cua'.";
2977
+ /**
2978
+ * Callbacks specific to the non-streaming execute method.
2979
+ */
2980
+ interface AgentExecuteCallbacks extends AgentCallbacks {
2981
+ /**
2982
+ * Callback called when each step (LLM call) is finished.
2983
+ */
2984
+ onStepFinish?: GenerateTextOnStepFinishCallback<ToolSet>;
2985
+ /**
2986
+ * Callback for handling safety confirmation requests from CUA providers.
2987
+ * Only available when running an agent configured with mode: "cua".
2988
+ */
2989
+ onSafetyConfirmation?: SafetyConfirmationHandler;
2990
+ /**
2991
+ * NOT AVAILABLE in non-streaming mode.
2992
+ * This callback requires `stream: true` in AgentConfig.
2993
+ *
2994
+ * @example
2995
+ * ```typescript
2996
+ * // Enable streaming to use onChunk:
2997
+ * const agent = stagehand.agent({ stream: true });
2998
+ * await agent.execute({
2999
+ * instruction: "...",
3000
+ * callbacks: { onChunk: async (chunk) => console.log(chunk) }
3001
+ * });
3002
+ * ```
3003
+ */
3004
+ onChunk?: StreamingCallbackNotAvailable;
3005
+ /**
3006
+ * NOT AVAILABLE in non-streaming mode.
3007
+ * This callback requires `stream: true` in AgentConfig.
3008
+ *
3009
+ * @example
3010
+ * ```typescript
3011
+ * // Enable streaming to use onFinish:
3012
+ * const agent = stagehand.agent({ stream: true });
3013
+ * await agent.execute({
3014
+ * instruction: "...",
3015
+ * callbacks: { onFinish: (event) => console.log("Done!", event) }
3016
+ * });
3017
+ * ```
3018
+ */
3019
+ onFinish?: StreamingCallbackNotAvailable;
3020
+ /**
3021
+ * NOT AVAILABLE in non-streaming mode.
3022
+ * This callback requires `stream: true` in AgentConfig.
3023
+ *
3024
+ * @example
3025
+ * ```typescript
3026
+ * // Enable streaming to use onError:
3027
+ * const agent = stagehand.agent({ stream: true });
3028
+ * await agent.execute({
3029
+ * instruction: "...",
3030
+ * callbacks: { onError: ({ error }) => console.error(error) }
3031
+ * });
3032
+ * ```
3033
+ */
3034
+ onError?: StreamingCallbackNotAvailable;
3035
+ /**
3036
+ * NOT AVAILABLE in non-streaming mode.
3037
+ * This callback requires `stream: true` in AgentConfig.
3038
+ *
3039
+ * @example
3040
+ * ```typescript
3041
+ * // Enable streaming to use onAbort:
3042
+ * const agent = stagehand.agent({ stream: true });
3043
+ * await agent.execute({
3044
+ * instruction: "...",
3045
+ * callbacks: { onAbort: (event) => console.log("Aborted", event.steps) }
3046
+ * });
3047
+ * ```
3048
+ */
3049
+ onAbort?: StreamingCallbackNotAvailable;
3050
+ }
3051
+ /**
3052
+ * Callbacks specific to the streaming mode.
3053
+ */
3054
+ interface AgentStreamCallbacks extends AgentCallbacks {
3055
+ /**
3056
+ * Callback called when each step (LLM call) is finished during streaming.
3057
+ */
3058
+ onStepFinish?: StreamTextOnStepFinishCallback<ToolSet>;
3059
+ /**
3060
+ * Callback called when an error occurs during streaming.
3061
+ * Use this to log errors or handle error states.
3062
+ */
3063
+ onError?: StreamTextOnErrorCallback;
3064
+ /**
3065
+ * Callback called for each chunk of the stream.
3066
+ * Stream processing will pause until the callback promise resolves.
3067
+ */
3068
+ onChunk?: StreamTextOnChunkCallback<ToolSet>;
3069
+ /**
3070
+ * Callback called when the stream finishes.
3071
+ */
3072
+ onFinish?: StreamTextOnFinishCallback<ToolSet>;
3073
+ /**
3074
+ * Callback called when the stream is aborted.
3075
+ */
3076
+ onAbort?: (event: {
3077
+ steps: Array<StepResult<ToolSet>>;
3078
+ }) => PromiseLike<void> | void;
3079
+ /**
3080
+ * NOT AVAILABLE in streaming mode.
3081
+ * Safety confirmations currently require non-streaming execute() on CUA agents.
3082
+ */
3083
+ onSafetyConfirmation?: SafetyConfirmationCallbackNotAvailable;
3084
+ }
3085
+ /**
3086
+ * Base options for agent execution (without callbacks).
3087
+ */
3088
+ interface AgentExecuteOptionsBase {
1643
3089
  instruction: string;
1644
3090
  maxSteps?: number;
1645
3091
  page?: Page$1 | Page$2 | Page$3 | Page;
1646
3092
  highlightCursor?: boolean;
3093
+ /**
3094
+ * Previous conversation messages to continue from.
3095
+ * Pass the `messages` from a previous AgentResult to continue that conversation.
3096
+ * @experimental
3097
+ */
3098
+ messages?: ModelMessage[];
3099
+ /**
3100
+ * An AbortSignal that can be used to cancel the agent execution.
3101
+ * When aborted, the agent will stop and return a partial result.
3102
+ * @experimental
3103
+ *
3104
+ * @example
3105
+ * ```typescript
3106
+ * const controller = new AbortController();
3107
+ * setTimeout(() => controller.abort(), 30000); // 30 second timeout
3108
+ *
3109
+ * const result = await agent.execute({
3110
+ * instruction: "...",
3111
+ * signal: controller.signal
3112
+ * });
3113
+ * ```
3114
+ */
3115
+ signal?: AbortSignal;
3116
+ /**
3117
+ * Tools to exclude from this execution.
3118
+ * Pass an array of tool names to prevent the agent from using those tools.
3119
+ *
3120
+ * **Note:** Not supported in CUA mode (`mode: "cua"`).
3121
+ *
3122
+ * **Available tools by mode:**
3123
+ *
3124
+ * **DOM mode (default):**
3125
+ * - `act` - Perform semantic actions (click, type, etc.)
3126
+ * - `fillForm` - Fill form fields using DOM selectors
3127
+ * - `ariaTree` - Get accessibility tree of the page
3128
+ * - `extract` - Extract structured data from page
3129
+ * - `goto` - Navigate to a URL
3130
+ * - `scroll` - Scroll using semantic directions (up/down/left/right)
3131
+ * - `keys` - Press keyboard keys
3132
+ * - `navback` - Navigate back in history
3133
+ * - `screenshot` - Take a screenshot
3134
+ * - `think` - Agent reasoning/planning step
3135
+ * - `wait` - Wait for time or condition
3136
+ * - `close` - Mark task as complete
3137
+ * - `search` - Web search (requires BRAVE_API_KEY)
3138
+ *
3139
+ * **Hybrid mode:**
3140
+ * - `click` - Click at specific coordinates
3141
+ * - `type` - Type text at coordinates
3142
+ * - `dragAndDrop` - Drag from one point to another
3143
+ * - `clickAndHold` - Click and hold at coordinates
3144
+ * - `fillFormVision` - Fill forms using vision/coordinates
3145
+ * - `act` - Perform semantic actions
3146
+ * - `ariaTree` - Get accessibility tree
3147
+ * - `extract` - Extract data from page
3148
+ * - `goto` - Navigate to URL
3149
+ * - `scroll` - Scroll using coordinates
3150
+ * - `keys` - Press keyboard keys
3151
+ * - `navback` - Navigate back
3152
+ * - `screenshot` - Take screenshot
3153
+ * - `think` - Agent reasoning step
3154
+ * - `wait` - Wait for time/condition
3155
+ * - `close` - Mark task complete
3156
+ * - `search` - Web search (requires BRAVE_API_KEY)
3157
+ *
3158
+ * @experimental
3159
+ * @example
3160
+ * ```typescript
3161
+ * // Exclude screenshot and extract tools
3162
+ * const result = await agent.execute({
3163
+ * instruction: "Click the submit button",
3164
+ * excludeTools: ["screenshot", "extract"]
3165
+ * });
3166
+ * ```
3167
+ */
3168
+ excludeTools?: string[];
3169
+ }
3170
+ /**
3171
+ * Options for non-streaming agent execution.
3172
+ * Only accepts AgentExecuteCallbacks (no streaming-specific callbacks like onChunk, onFinish).
3173
+ */
3174
+ interface AgentExecuteOptions extends AgentExecuteOptionsBase {
3175
+ /**
3176
+ * Callbacks for non-streaming agent execution.
3177
+ * For streaming callbacks (onChunk, onFinish, onError, onAbort), use stream: true in AgentConfig.
3178
+ */
3179
+ callbacks?: AgentExecuteCallbacks;
3180
+ }
3181
+ /**
3182
+ * Options for streaming agent execution.
3183
+ * Accepts AgentStreamCallbacks including onChunk, onFinish, onError, and onAbort.
3184
+ */
3185
+ interface AgentStreamExecuteOptions extends AgentExecuteOptionsBase {
3186
+ /**
3187
+ * Callbacks for streaming agent execution.
3188
+ * Includes streaming-specific callbacks: onChunk, onFinish, onError, onAbort.
3189
+ */
3190
+ callbacks?: AgentStreamCallbacks;
1647
3191
  }
1648
3192
  type AgentType = "openai" | "anthropic" | "google" | "microsoft";
1649
- 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-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"];
3193
+ 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"];
1650
3194
  type AvailableCuaModel = (typeof AVAILABLE_CUA_MODELS)[number];
1651
3195
  interface AgentExecutionOptions<TOptions extends AgentExecuteOptions = AgentExecuteOptions> {
1652
3196
  options: TOptions;
@@ -1664,6 +3208,52 @@ interface ActionExecutionResult {
1664
3208
  error?: string;
1665
3209
  data?: unknown;
1666
3210
  }
3211
+ /**
3212
+ * Represents a safety check that requires user confirmation before proceeding.
3213
+ * These are issued by CUA providers (OpenAI, Google) when the agent attempts
3214
+ * potentially risky actions.
3215
+ */
3216
+ interface SafetyCheck {
3217
+ /** Unique identifier for this safety check */
3218
+ id: string;
3219
+ /** Code identifying the type of safety concern */
3220
+ code: string;
3221
+ /** Human-readable description of the safety concern */
3222
+ message: string;
3223
+ }
3224
+ /**
3225
+ * Response from the user for a safety confirmation request.
3226
+ */
3227
+ interface SafetyConfirmationResponse {
3228
+ /** Whether the user acknowledged/approved the safety checks */
3229
+ acknowledged: boolean;
3230
+ }
3231
+ /**
3232
+ * Callback for handling safety confirmation requests.
3233
+ * Called when the CUA provider issues safety checks that require user confirmation.
3234
+ * The callback should return a promise that resolves when the user has made a decision.
3235
+ *
3236
+ * @param safetyChecks - Array of safety checks requiring confirmation
3237
+ * @returns Promise resolving to the user's response
3238
+ *
3239
+ * @example
3240
+ * ```typescript
3241
+ * const agent = stagehand.agent({
3242
+ * mode: "cua",
3243
+ * });
3244
+ * await agent.execute({
3245
+ * instruction: "...",
3246
+ * callbacks: {
3247
+ * onSafetyConfirmation: async (checks) => {
3248
+ * console.log("Safety checks:", checks);
3249
+ * const userApproved = await showConfirmationDialog(checks);
3250
+ * return { acknowledged: userApproved };
3251
+ * },
3252
+ * },
3253
+ * });
3254
+ * ```
3255
+ */
3256
+ type SafetyConfirmationHandler = (safetyChecks: SafetyCheck[]) => Promise<SafetyConfirmationResponse>;
1667
3257
  interface ToolUseItem extends ResponseItem {
1668
3258
  type: "tool_use";
1669
3259
  id: string;
@@ -1741,6 +3331,13 @@ type AgentProviderType = AgentType;
1741
3331
  type AgentModelConfig<TModelName extends string = string> = {
1742
3332
  modelName: TModelName;
1743
3333
  } & Record<string, unknown>;
3334
+ /**
3335
+ * Agent tool mode determines which set of tools are available to the agent.
3336
+ * - 'dom': Uses DOM-based tools (act, fillForm) - better for structured page interactions
3337
+ * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - better for visual/screenshot-based interactions
3338
+ * - 'cua': Uses Computer Use Agent (CUA) providers like Anthropic Claude or Google Gemini for screenshot-based automation
3339
+ */
3340
+ type AgentToolMode = "dom" | "hybrid" | "cua";
1744
3341
  type AgentConfig = {
1745
3342
  /**
1746
3343
  * Custom system prompt to provide to the agent. Overrides the default system prompt.
@@ -1755,7 +3352,8 @@ type AgentConfig = {
1755
3352
  */
1756
3353
  tools?: ToolSet;
1757
3354
  /**
1758
- * Indicates CUA is disabled for this configuration
3355
+ * @deprecated Use `mode: "cua"` instead. This option will be removed in a future version.
3356
+ * Enables Computer Use Agent (CUA) mode.
1759
3357
  */
1760
3358
  cua?: boolean;
1761
3359
  /**
@@ -1774,17 +3372,27 @@ type AgentConfig = {
1774
3372
  * When false (default), execute() returns AgentResult after completion.
1775
3373
  */
1776
3374
  stream?: boolean;
3375
+ /**
3376
+ * Tool mode for the agent. Determines which set of tools are available.
3377
+ * - 'dom' (default): Uses DOM-based tools (act, fillForm) for structured interactions
3378
+ * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, clickAndHold, fillFormVision)
3379
+ * for visual/screenshot-based interactions
3380
+ * - 'cua': Uses Computer Use Agent (CUA) providers for screenshot-based automation
3381
+ */
3382
+ mode?: AgentToolMode;
1777
3383
  };
1778
3384
  /**
1779
3385
  * Agent instance returned when stream: true is set in AgentConfig.
1780
3386
  * execute() returns a streaming result that can be consumed incrementally.
3387
+ * Accepts AgentStreamExecuteOptions with streaming-specific callbacks.
1781
3388
  */
1782
3389
  interface StreamingAgentInstance {
1783
- execute: (instructionOrOptions: string | AgentExecuteOptions) => Promise<AgentStreamResult>;
3390
+ execute: (instructionOrOptions: string | AgentStreamExecuteOptions) => Promise<AgentStreamResult>;
1784
3391
  }
1785
3392
  /**
1786
3393
  * Agent instance returned when stream is false or not set in AgentConfig.
1787
3394
  * execute() returns a result after the agent completes.
3395
+ * Accepts AgentExecuteOptions with non-streaming callbacks only.
1788
3396
  */
1789
3397
  interface NonStreamingAgentInstance {
1790
3398
  execute: (instructionOrOptions: string | AgentExecuteOptions) => Promise<AgentResult>;
@@ -1990,6 +3598,11 @@ declare class V3 {
1990
3598
  private observeHandler;
1991
3599
  private ctx;
1992
3600
  llmClient: LLMClient;
3601
+ /**
3602
+ * Event bus for internal communication.
3603
+ * Emits events like 'screenshot' when screenshots are captured during agent execution.
3604
+ */
3605
+ readonly bus: EventEmitter;
1993
3606
  private modelName;
1994
3607
  private modelClientOptions;
1995
3608
  private llmProvider;
@@ -2002,6 +3615,10 @@ declare class V3 {
2002
3615
  get browserbaseSessionID(): string | undefined;
2003
3616
  get browserbaseSessionURL(): string | undefined;
2004
3617
  get browserbaseDebugURL(): string | undefined;
3618
+ /**
3619
+ * Returns true if the browser is running on Browserbase.
3620
+ */
3621
+ get isBrowserbase(): boolean;
2005
3622
  private _onCdpClosed;
2006
3623
  readonly experimental: boolean;
2007
3624
  readonly logInferenceToFile: boolean;
@@ -2117,7 +3734,7 @@ declare class V3 {
2117
3734
  agent(options: AgentConfig & {
2118
3735
  stream: true;
2119
3736
  }): {
2120
- execute: (instructionOrOptions: string | AgentExecuteOptions) => Promise<AgentStreamResult>;
3737
+ execute: (instructionOrOptions: string | AgentStreamExecuteOptions) => Promise<AgentStreamResult>;
2121
3738
  };
2122
3739
  agent(options?: AgentConfig & {
2123
3740
  stream?: false;
@@ -2160,6 +3777,319 @@ declare class AgentProvider {
2160
3777
  static getAgentProvider(modelName: string): AgentProviderType;
2161
3778
  }
2162
3779
 
3780
+ declare const gotoTool: (v3: V3) => ai.Tool<{
3781
+ url: string;
3782
+ }, {
3783
+ success: boolean;
3784
+ url: string;
3785
+ error?: undefined;
3786
+ } | {
3787
+ success: boolean;
3788
+ error: any;
3789
+ url?: undefined;
3790
+ }>;
3791
+
3792
+ declare const actTool: (v3: V3, executionModel?: string) => ai.Tool<{
3793
+ action: string;
3794
+ }, {
3795
+ success: boolean;
3796
+ action: string;
3797
+ playwrightArguments: Action;
3798
+ error?: undefined;
3799
+ } | {
3800
+ success: boolean;
3801
+ error: any;
3802
+ action?: undefined;
3803
+ playwrightArguments?: undefined;
3804
+ }>;
3805
+
3806
+ declare const screenshotTool: (v3: V3) => ai.Tool<Record<string, never>, {
3807
+ base64: string;
3808
+ timestamp: number;
3809
+ pageUrl: string;
3810
+ }>;
3811
+
3812
+ declare const waitTool: (v3: V3) => ai.Tool<{
3813
+ timeMs: number;
3814
+ }, {
3815
+ success: boolean;
3816
+ waited: number;
3817
+ }>;
3818
+
3819
+ declare const navBackTool: (v3: V3) => ai.Tool<{
3820
+ reasoningText: string;
3821
+ }, {
3822
+ success: boolean;
3823
+ }>;
3824
+
3825
+ declare const closeTool: () => ai.Tool<{
3826
+ reasoning: string;
3827
+ taskComplete: boolean;
3828
+ }, {
3829
+ success: boolean;
3830
+ reasoning: string;
3831
+ taskComplete: boolean;
3832
+ }>;
3833
+
3834
+ declare const ariaTreeTool: (v3: V3) => ai.Tool<Record<string, never>, {
3835
+ content: string;
3836
+ pageUrl: string;
3837
+ }>;
3838
+
3839
+ declare const fillFormTool: (v3: V3, executionModel?: string) => ai.Tool<{
3840
+ fields: {
3841
+ action: string;
3842
+ value: string;
3843
+ }[];
3844
+ }, {
3845
+ success: boolean;
3846
+ actions: unknown[];
3847
+ playwrightArguments: Action[];
3848
+ }>;
3849
+
3850
+ /**
3851
+ * Simple scroll tool for DOM mode (non-grounding models).
3852
+ * No coordinates - scrolls from viewport center.
3853
+ */
3854
+ declare const scrollTool: (v3: V3) => ai.Tool<{
3855
+ direction: "up" | "down";
3856
+ percentage?: number;
3857
+ }, {
3858
+ success: boolean;
3859
+ message: string;
3860
+ scrolledPixels: number;
3861
+ }>;
3862
+ /**
3863
+ * Scroll tool for hybrid mode (grounding models).
3864
+ * Supports optional coordinates for scrolling within nested scrollable elements.
3865
+ */
3866
+ declare const scrollVisionTool: (v3: V3, provider?: string) => ai.Tool<{
3867
+ direction: "up" | "down";
3868
+ coordinates?: number[];
3869
+ percentage?: number;
3870
+ }, {
3871
+ success: boolean;
3872
+ message: string;
3873
+ scrolledPixels: number;
3874
+ }>;
3875
+
3876
+ declare const extractTool: (v3: V3, executionModel?: string, logger?: (message: LogLine) => void) => ai.Tool<{
3877
+ instruction: string;
3878
+ schema?: string;
3879
+ }, {
3880
+ success: boolean;
3881
+ result: any;
3882
+ error?: undefined;
3883
+ } | {
3884
+ success: boolean;
3885
+ error: any;
3886
+ result?: undefined;
3887
+ }>;
3888
+
3889
+ declare const clickTool: (v3: V3, provider?: string) => ai.Tool<{
3890
+ describe: string;
3891
+ coordinates: number[];
3892
+ }, {
3893
+ success: boolean;
3894
+ describe: string;
3895
+ coordinates: number[];
3896
+ error?: undefined;
3897
+ } | {
3898
+ success: boolean;
3899
+ error: string;
3900
+ describe?: undefined;
3901
+ coordinates?: undefined;
3902
+ }>;
3903
+
3904
+ declare const typeTool: (v3: V3, provider?: string) => ai.Tool<{
3905
+ describe: string;
3906
+ text: string;
3907
+ coordinates: number[];
3908
+ }, {
3909
+ success: boolean;
3910
+ describe: string;
3911
+ text: string;
3912
+ error?: undefined;
3913
+ } | {
3914
+ success: boolean;
3915
+ error: string;
3916
+ describe?: undefined;
3917
+ text?: undefined;
3918
+ }>;
3919
+
3920
+ declare const dragAndDropTool: (v3: V3, provider?: string) => ai.Tool<{
3921
+ describe: string;
3922
+ startCoordinates: number[];
3923
+ endCoordinates: number[];
3924
+ }, {
3925
+ success: boolean;
3926
+ describe: string;
3927
+ error?: undefined;
3928
+ } | {
3929
+ success: boolean;
3930
+ error: string;
3931
+ describe?: undefined;
3932
+ }>;
3933
+
3934
+ declare const clickAndHoldTool: (v3: V3, provider?: string) => ai.Tool<{
3935
+ describe: string;
3936
+ duration: number;
3937
+ coordinates: number[];
3938
+ }, {
3939
+ success: boolean;
3940
+ describe: string;
3941
+ error?: undefined;
3942
+ } | {
3943
+ success: boolean;
3944
+ error: string;
3945
+ describe?: undefined;
3946
+ }>;
3947
+
3948
+ declare const keysTool: (v3: V3) => ai.Tool<{
3949
+ method: "type" | "press";
3950
+ value: string;
3951
+ repeat?: number;
3952
+ }, {
3953
+ success: boolean;
3954
+ method: "type";
3955
+ value: string;
3956
+ times: number;
3957
+ error?: undefined;
3958
+ } | {
3959
+ success: boolean;
3960
+ method: "press";
3961
+ value: string;
3962
+ times: number;
3963
+ error?: undefined;
3964
+ } | {
3965
+ success: boolean;
3966
+ error: string;
3967
+ method?: undefined;
3968
+ value?: undefined;
3969
+ times?: undefined;
3970
+ }>;
3971
+
3972
+ declare const fillFormVisionTool: (v3: V3, provider?: string) => ai.Tool<{
3973
+ fields: {
3974
+ action: string;
3975
+ value: string;
3976
+ coordinates: {
3977
+ x: number;
3978
+ y: number;
3979
+ };
3980
+ }[];
3981
+ }, {
3982
+ success: boolean;
3983
+ playwrightArguments: {
3984
+ coordinates: {
3985
+ x: number;
3986
+ y: number;
3987
+ };
3988
+ action: string;
3989
+ value: string;
3990
+ }[];
3991
+ error?: undefined;
3992
+ } | {
3993
+ success: boolean;
3994
+ error: string;
3995
+ playwrightArguments?: undefined;
3996
+ }>;
3997
+
3998
+ declare const thinkTool: () => ai.Tool<{
3999
+ reasoning: string;
4000
+ }, {
4001
+ acknowledged: boolean;
4002
+ message: string;
4003
+ }>;
4004
+
4005
+ interface BraveSearchResult {
4006
+ title: string;
4007
+ url: string;
4008
+ description?: string;
4009
+ }
4010
+ declare const searchTool: (v3: V3) => ai.Tool<{
4011
+ query: string;
4012
+ }, {
4013
+ timestamp: number;
4014
+ data?: {
4015
+ results: BraveSearchResult[];
4016
+ };
4017
+ error?: string;
4018
+ }>;
4019
+
4020
+ interface V3AgentToolOptions {
4021
+ executionModel?: string;
4022
+ logger?: (message: LogLine) => void;
4023
+ /**
4024
+ * Tool mode determines which set of tools are available.
4025
+ * - 'dom' (default): Uses DOM-based tools (act, fillForm) - removes coordinate-based tools
4026
+ * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - removes fillForm
4027
+ */
4028
+ mode?: AgentToolMode;
4029
+ /**
4030
+ * The model provider. Used for model-specific coordinate handling
4031
+ */
4032
+ provider?: string;
4033
+ /**
4034
+ * Tools to exclude from the available toolset.
4035
+ * These tools will be filtered out after mode-based filtering.
4036
+ */
4037
+ excludeTools?: string[];
4038
+ }
4039
+ declare function createAgentTools(v3: V3, options?: V3AgentToolOptions): ToolSet;
4040
+ type AgentTools = ReturnType<typeof createAgentTools>;
4041
+ /**
4042
+ * Type map of all agent tools for strong typing of tool calls and results.
4043
+ * Note: `search` is optional as it's only available when BRAVE_API_KEY is configured.
4044
+ */
4045
+ type AgentToolTypesMap = {
4046
+ act: ReturnType<typeof actTool>;
4047
+ ariaTree: ReturnType<typeof ariaTreeTool>;
4048
+ click: ReturnType<typeof clickTool>;
4049
+ clickAndHold: ReturnType<typeof clickAndHoldTool>;
4050
+ close: ReturnType<typeof closeTool>;
4051
+ dragAndDrop: ReturnType<typeof dragAndDropTool>;
4052
+ extract: ReturnType<typeof extractTool>;
4053
+ fillForm: ReturnType<typeof fillFormTool>;
4054
+ fillFormVision: ReturnType<typeof fillFormVisionTool>;
4055
+ goto: ReturnType<typeof gotoTool>;
4056
+ keys: ReturnType<typeof keysTool>;
4057
+ navback: ReturnType<typeof navBackTool>;
4058
+ screenshot: ReturnType<typeof screenshotTool>;
4059
+ scroll: ReturnType<typeof scrollTool> | ReturnType<typeof scrollVisionTool>;
4060
+ search?: ReturnType<typeof searchTool>;
4061
+ think: ReturnType<typeof thinkTool>;
4062
+ type: ReturnType<typeof typeTool>;
4063
+ wait: ReturnType<typeof waitTool>;
4064
+ };
4065
+ /**
4066
+ * Inferred UI tools type for type-safe tool inputs and outputs.
4067
+ * Use with UIMessage for full type safety in UI contexts.
4068
+ */
4069
+ type AgentUITools = InferUITools<AgentToolTypesMap>;
4070
+ /**
4071
+ * Union type for all possible agent tool calls.
4072
+ * Provides type-safe access to tool call arguments.
4073
+ */
4074
+ type AgentToolCall = {
4075
+ [K in keyof AgentToolTypesMap]: {
4076
+ toolName: K;
4077
+ toolCallId: string;
4078
+ args: AgentUITools[K]["input"];
4079
+ };
4080
+ }[keyof AgentToolTypesMap];
4081
+ /**
4082
+ * Union type for all possible agent tool results.
4083
+ * Provides type-safe access to tool result values.
4084
+ */
4085
+ type AgentToolResult = {
4086
+ [K in keyof AgentToolTypesMap]: {
4087
+ toolName: K;
4088
+ toolCallId: string;
4089
+ result: AgentUITools[K]["output"];
4090
+ };
4091
+ }[keyof AgentToolTypesMap];
4092
+
2163
4093
  declare function validateZodSchema(schema: StagehandZodSchema, data: unknown): boolean;
2164
4094
  /**
2165
4095
  * Detects if the code is running in the Bun runtime environment.
@@ -2251,4 +4181,4 @@ declare class V3Evaluator {
2251
4181
  private _evaluateWithMultipleScreenshots;
2252
4182
  }
2253
4183
 
2254
- export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, type Action, type ActionExecutionResult, type AgentAction, type AgentConfig, type AgentContext, type AgentExecuteOptions, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentState, type AgentStreamResult, type AgentType, AnnotatedScreenshotText, type AnthropicClientOptions, 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, 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 ModelProvider, type NonStreamingAgentInstance, type ObserveOptions, type OpenAIClientOptions, 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, type StreamingAgentInstance, 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 };
4184
+ 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 ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, ExtractTimeoutError, 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 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, 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, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, isZod3Schema, isZod4Schema, jsonSchemaToZod, loadApiKeyFromEnv, localBrowserLaunchOptionsSchema, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, toJsonSchema, transformSchema, trimTrailingTextNode, validateZodSchema };