@browserbasehq/orca 3.0.6-alpha-1 → 3.0.8-ca-ching
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/index.d.ts +2002 -179
- package/dist/index.js +5906 -2596
- package/package.json +7 -6
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,8 +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
|
|
9
|
-
|
|
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, Tool, tool } from 'ai';
|
|
10
12
|
import { Page as Page$1 } from 'playwright-core';
|
|
11
13
|
export { Page as PlaywrightPage } from 'playwright-core';
|
|
12
14
|
import { Page as Page$2 } from 'puppeteer-core';
|
|
@@ -15,7 +17,7 @@ import { Page as Page$3 } from 'patchright-core';
|
|
|
15
17
|
export { Page as PatchrightPage } from 'patchright-core';
|
|
16
18
|
import { Protocol } from 'devtools-protocol';
|
|
17
19
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
18
|
-
import
|
|
20
|
+
import { z as z$1 } from 'zod/v4';
|
|
19
21
|
import { ChatCompletion } from 'openai/resources';
|
|
20
22
|
import { ToolSet as ToolSet$1 } from 'ai/dist';
|
|
21
23
|
import { Schema } from '@google/genai';
|
|
@@ -516,6 +518,1352 @@ declare class ConsoleMessage {
|
|
|
516
518
|
toString(): string;
|
|
517
519
|
}
|
|
518
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-sent-at": z$1.ZodOptional<z$1.ZodString>;
|
|
716
|
+
}, z$1.core.$strip>;
|
|
717
|
+
/** Standard error response */
|
|
718
|
+
declare const ErrorResponseSchema: z$1.ZodObject<{
|
|
719
|
+
success: z$1.ZodLiteral<false>;
|
|
720
|
+
error: z$1.ZodString;
|
|
721
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
722
|
+
}, z$1.core.$strict>;
|
|
723
|
+
/** Browserbase viewport configuration */
|
|
724
|
+
declare const BrowserbaseViewportSchema: z$1.ZodObject<{
|
|
725
|
+
width: z$1.ZodOptional<z$1.ZodNumber>;
|
|
726
|
+
height: z$1.ZodOptional<z$1.ZodNumber>;
|
|
727
|
+
}, z$1.core.$strip>;
|
|
728
|
+
/** Browserbase fingerprint screen configuration */
|
|
729
|
+
declare const BrowserbaseFingerprintScreenSchema: z$1.ZodObject<{
|
|
730
|
+
maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
731
|
+
maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
732
|
+
minHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
733
|
+
minWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
734
|
+
}, z$1.core.$strip>;
|
|
735
|
+
/** Browserbase fingerprint configuration for stealth mode */
|
|
736
|
+
declare const BrowserbaseFingerprintSchema: z$1.ZodObject<{
|
|
737
|
+
browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
738
|
+
chrome: "chrome";
|
|
739
|
+
edge: "edge";
|
|
740
|
+
firefox: "firefox";
|
|
741
|
+
safari: "safari";
|
|
742
|
+
}>>>;
|
|
743
|
+
devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
744
|
+
desktop: "desktop";
|
|
745
|
+
mobile: "mobile";
|
|
746
|
+
}>>>;
|
|
747
|
+
httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
|
|
748
|
+
1: "1";
|
|
749
|
+
2: "2";
|
|
750
|
+
}>>;
|
|
751
|
+
locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
752
|
+
operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
753
|
+
android: "android";
|
|
754
|
+
ios: "ios";
|
|
755
|
+
linux: "linux";
|
|
756
|
+
macos: "macos";
|
|
757
|
+
windows: "windows";
|
|
758
|
+
}>>>;
|
|
759
|
+
screen: z$1.ZodOptional<z$1.ZodObject<{
|
|
760
|
+
maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
761
|
+
maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
762
|
+
minHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
763
|
+
minWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
764
|
+
}, z$1.core.$strip>>;
|
|
765
|
+
}, z$1.core.$strip>;
|
|
766
|
+
/** Browserbase context configuration for session persistence */
|
|
767
|
+
declare const BrowserbaseContextSchema: z$1.ZodObject<{
|
|
768
|
+
id: z$1.ZodString;
|
|
769
|
+
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
770
|
+
}, z$1.core.$strip>;
|
|
771
|
+
/** Browserbase browser settings for session creation */
|
|
772
|
+
declare const BrowserbaseBrowserSettingsSchema: z$1.ZodObject<{
|
|
773
|
+
advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
774
|
+
blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
775
|
+
context: z$1.ZodOptional<z$1.ZodObject<{
|
|
776
|
+
id: z$1.ZodString;
|
|
777
|
+
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
778
|
+
}, z$1.core.$strip>>;
|
|
779
|
+
extensionId: z$1.ZodOptional<z$1.ZodString>;
|
|
780
|
+
fingerprint: z$1.ZodOptional<z$1.ZodObject<{
|
|
781
|
+
browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
782
|
+
chrome: "chrome";
|
|
783
|
+
edge: "edge";
|
|
784
|
+
firefox: "firefox";
|
|
785
|
+
safari: "safari";
|
|
786
|
+
}>>>;
|
|
787
|
+
devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
788
|
+
desktop: "desktop";
|
|
789
|
+
mobile: "mobile";
|
|
790
|
+
}>>>;
|
|
791
|
+
httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
|
|
792
|
+
1: "1";
|
|
793
|
+
2: "2";
|
|
794
|
+
}>>;
|
|
795
|
+
locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
796
|
+
operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
797
|
+
android: "android";
|
|
798
|
+
ios: "ios";
|
|
799
|
+
linux: "linux";
|
|
800
|
+
macos: "macos";
|
|
801
|
+
windows: "windows";
|
|
802
|
+
}>>>;
|
|
803
|
+
screen: z$1.ZodOptional<z$1.ZodObject<{
|
|
804
|
+
maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
805
|
+
maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
806
|
+
minHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
807
|
+
minWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
808
|
+
}, z$1.core.$strip>>;
|
|
809
|
+
}, z$1.core.$strip>>;
|
|
810
|
+
logSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
811
|
+
recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
812
|
+
solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
813
|
+
viewport: z$1.ZodOptional<z$1.ZodObject<{
|
|
814
|
+
width: z$1.ZodOptional<z$1.ZodNumber>;
|
|
815
|
+
height: z$1.ZodOptional<z$1.ZodNumber>;
|
|
816
|
+
}, z$1.core.$strip>>;
|
|
817
|
+
}, z$1.core.$strip>;
|
|
818
|
+
/** Browserbase managed proxy geolocation configuration */
|
|
819
|
+
declare const BrowserbaseProxyGeolocationSchema: z$1.ZodObject<{
|
|
820
|
+
country: z$1.ZodString;
|
|
821
|
+
city: z$1.ZodOptional<z$1.ZodString>;
|
|
822
|
+
state: z$1.ZodOptional<z$1.ZodString>;
|
|
823
|
+
}, z$1.core.$strip>;
|
|
824
|
+
/** Browserbase managed proxy configuration */
|
|
825
|
+
declare const BrowserbaseProxyConfigSchema: z$1.ZodObject<{
|
|
826
|
+
type: z$1.ZodLiteral<"browserbase">;
|
|
827
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
828
|
+
geolocation: z$1.ZodOptional<z$1.ZodObject<{
|
|
829
|
+
country: z$1.ZodString;
|
|
830
|
+
city: z$1.ZodOptional<z$1.ZodString>;
|
|
831
|
+
state: z$1.ZodOptional<z$1.ZodString>;
|
|
832
|
+
}, z$1.core.$strip>>;
|
|
833
|
+
}, z$1.core.$strip>;
|
|
834
|
+
/** External proxy configuration */
|
|
835
|
+
declare const ExternalProxyConfigSchema: z$1.ZodObject<{
|
|
836
|
+
type: z$1.ZodLiteral<"external">;
|
|
837
|
+
server: z$1.ZodString;
|
|
838
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
839
|
+
username: z$1.ZodOptional<z$1.ZodString>;
|
|
840
|
+
password: z$1.ZodOptional<z$1.ZodString>;
|
|
841
|
+
}, z$1.core.$strip>;
|
|
842
|
+
/** Union of proxy configuration types */
|
|
843
|
+
declare const ProxyConfigSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
844
|
+
type: z$1.ZodLiteral<"browserbase">;
|
|
845
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
846
|
+
geolocation: z$1.ZodOptional<z$1.ZodObject<{
|
|
847
|
+
country: z$1.ZodString;
|
|
848
|
+
city: z$1.ZodOptional<z$1.ZodString>;
|
|
849
|
+
state: z$1.ZodOptional<z$1.ZodString>;
|
|
850
|
+
}, z$1.core.$strip>>;
|
|
851
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
852
|
+
type: z$1.ZodLiteral<"external">;
|
|
853
|
+
server: z$1.ZodString;
|
|
854
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
855
|
+
username: z$1.ZodOptional<z$1.ZodString>;
|
|
856
|
+
password: z$1.ZodOptional<z$1.ZodString>;
|
|
857
|
+
}, z$1.core.$strip>], "type">;
|
|
858
|
+
/** Browserbase session creation parameters */
|
|
859
|
+
declare const BrowserbaseSessionCreateParamsSchema: z$1.ZodObject<{
|
|
860
|
+
projectId: z$1.ZodOptional<z$1.ZodString>;
|
|
861
|
+
browserSettings: z$1.ZodOptional<z$1.ZodObject<{
|
|
862
|
+
advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
863
|
+
blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
864
|
+
context: z$1.ZodOptional<z$1.ZodObject<{
|
|
865
|
+
id: z$1.ZodString;
|
|
866
|
+
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
867
|
+
}, z$1.core.$strip>>;
|
|
868
|
+
extensionId: z$1.ZodOptional<z$1.ZodString>;
|
|
869
|
+
fingerprint: z$1.ZodOptional<z$1.ZodObject<{
|
|
870
|
+
browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
871
|
+
chrome: "chrome";
|
|
872
|
+
edge: "edge";
|
|
873
|
+
firefox: "firefox";
|
|
874
|
+
safari: "safari";
|
|
875
|
+
}>>>;
|
|
876
|
+
devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
877
|
+
desktop: "desktop";
|
|
878
|
+
mobile: "mobile";
|
|
879
|
+
}>>>;
|
|
880
|
+
httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
|
|
881
|
+
1: "1";
|
|
882
|
+
2: "2";
|
|
883
|
+
}>>;
|
|
884
|
+
locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
885
|
+
operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
886
|
+
android: "android";
|
|
887
|
+
ios: "ios";
|
|
888
|
+
linux: "linux";
|
|
889
|
+
macos: "macos";
|
|
890
|
+
windows: "windows";
|
|
891
|
+
}>>>;
|
|
892
|
+
screen: z$1.ZodOptional<z$1.ZodObject<{
|
|
893
|
+
maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
894
|
+
maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
895
|
+
minHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
896
|
+
minWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
897
|
+
}, z$1.core.$strip>>;
|
|
898
|
+
}, z$1.core.$strip>>;
|
|
899
|
+
logSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
900
|
+
recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
901
|
+
solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
902
|
+
viewport: z$1.ZodOptional<z$1.ZodObject<{
|
|
903
|
+
width: z$1.ZodOptional<z$1.ZodNumber>;
|
|
904
|
+
height: z$1.ZodOptional<z$1.ZodNumber>;
|
|
905
|
+
}, z$1.core.$strip>>;
|
|
906
|
+
}, z$1.core.$strip>>;
|
|
907
|
+
extensionId: z$1.ZodOptional<z$1.ZodString>;
|
|
908
|
+
keepAlive: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
909
|
+
proxies: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
910
|
+
type: z$1.ZodLiteral<"browserbase">;
|
|
911
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
912
|
+
geolocation: z$1.ZodOptional<z$1.ZodObject<{
|
|
913
|
+
country: z$1.ZodString;
|
|
914
|
+
city: z$1.ZodOptional<z$1.ZodString>;
|
|
915
|
+
state: z$1.ZodOptional<z$1.ZodString>;
|
|
916
|
+
}, z$1.core.$strip>>;
|
|
917
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
918
|
+
type: z$1.ZodLiteral<"external">;
|
|
919
|
+
server: z$1.ZodString;
|
|
920
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
921
|
+
username: z$1.ZodOptional<z$1.ZodString>;
|
|
922
|
+
password: z$1.ZodOptional<z$1.ZodString>;
|
|
923
|
+
}, z$1.core.$strip>], "type">>]>>;
|
|
924
|
+
region: z$1.ZodOptional<z$1.ZodEnum<{
|
|
925
|
+
"us-west-2": "us-west-2";
|
|
926
|
+
"us-east-1": "us-east-1";
|
|
927
|
+
"eu-central-1": "eu-central-1";
|
|
928
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
929
|
+
}>>;
|
|
930
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
931
|
+
userMetadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
932
|
+
}, z$1.core.$strip>;
|
|
933
|
+
declare const SessionStartRequestSchema: z$1.ZodObject<{
|
|
934
|
+
modelName: z$1.ZodString;
|
|
935
|
+
domSettleTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
936
|
+
verbose: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodLiteral<0>, z$1.ZodLiteral<1>, z$1.ZodLiteral<2>]>>;
|
|
937
|
+
systemPrompt: z$1.ZodOptional<z$1.ZodString>;
|
|
938
|
+
browserbaseSessionCreateParams: z$1.ZodOptional<z$1.ZodObject<{
|
|
939
|
+
projectId: z$1.ZodOptional<z$1.ZodString>;
|
|
940
|
+
browserSettings: z$1.ZodOptional<z$1.ZodObject<{
|
|
941
|
+
advancedStealth: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
942
|
+
blockAds: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
943
|
+
context: z$1.ZodOptional<z$1.ZodObject<{
|
|
944
|
+
id: z$1.ZodString;
|
|
945
|
+
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
946
|
+
}, z$1.core.$strip>>;
|
|
947
|
+
extensionId: z$1.ZodOptional<z$1.ZodString>;
|
|
948
|
+
fingerprint: z$1.ZodOptional<z$1.ZodObject<{
|
|
949
|
+
browsers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
950
|
+
chrome: "chrome";
|
|
951
|
+
edge: "edge";
|
|
952
|
+
firefox: "firefox";
|
|
953
|
+
safari: "safari";
|
|
954
|
+
}>>>;
|
|
955
|
+
devices: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
956
|
+
desktop: "desktop";
|
|
957
|
+
mobile: "mobile";
|
|
958
|
+
}>>>;
|
|
959
|
+
httpVersion: z$1.ZodOptional<z$1.ZodEnum<{
|
|
960
|
+
1: "1";
|
|
961
|
+
2: "2";
|
|
962
|
+
}>>;
|
|
963
|
+
locales: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
964
|
+
operatingSystems: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
965
|
+
android: "android";
|
|
966
|
+
ios: "ios";
|
|
967
|
+
linux: "linux";
|
|
968
|
+
macos: "macos";
|
|
969
|
+
windows: "windows";
|
|
970
|
+
}>>>;
|
|
971
|
+
screen: z$1.ZodOptional<z$1.ZodObject<{
|
|
972
|
+
maxHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
973
|
+
maxWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
974
|
+
minHeight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
975
|
+
minWidth: z$1.ZodOptional<z$1.ZodNumber>;
|
|
976
|
+
}, z$1.core.$strip>>;
|
|
977
|
+
}, z$1.core.$strip>>;
|
|
978
|
+
logSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
979
|
+
recordSession: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
980
|
+
solveCaptchas: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
981
|
+
viewport: z$1.ZodOptional<z$1.ZodObject<{
|
|
982
|
+
width: z$1.ZodOptional<z$1.ZodNumber>;
|
|
983
|
+
height: z$1.ZodOptional<z$1.ZodNumber>;
|
|
984
|
+
}, z$1.core.$strip>>;
|
|
985
|
+
}, z$1.core.$strip>>;
|
|
986
|
+
extensionId: z$1.ZodOptional<z$1.ZodString>;
|
|
987
|
+
keepAlive: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
988
|
+
proxies: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
989
|
+
type: z$1.ZodLiteral<"browserbase">;
|
|
990
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
991
|
+
geolocation: z$1.ZodOptional<z$1.ZodObject<{
|
|
992
|
+
country: z$1.ZodString;
|
|
993
|
+
city: z$1.ZodOptional<z$1.ZodString>;
|
|
994
|
+
state: z$1.ZodOptional<z$1.ZodString>;
|
|
995
|
+
}, z$1.core.$strip>>;
|
|
996
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
997
|
+
type: z$1.ZodLiteral<"external">;
|
|
998
|
+
server: z$1.ZodString;
|
|
999
|
+
domainPattern: z$1.ZodOptional<z$1.ZodString>;
|
|
1000
|
+
username: z$1.ZodOptional<z$1.ZodString>;
|
|
1001
|
+
password: z$1.ZodOptional<z$1.ZodString>;
|
|
1002
|
+
}, z$1.core.$strip>], "type">>]>>;
|
|
1003
|
+
region: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1004
|
+
"us-west-2": "us-west-2";
|
|
1005
|
+
"us-east-1": "us-east-1";
|
|
1006
|
+
"eu-central-1": "eu-central-1";
|
|
1007
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
1008
|
+
}>>;
|
|
1009
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1010
|
+
userMetadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1011
|
+
}, z$1.core.$strip>>;
|
|
1012
|
+
browser: z$1.ZodOptional<z$1.ZodObject<{
|
|
1013
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1014
|
+
local: "local";
|
|
1015
|
+
browserbase: "browserbase";
|
|
1016
|
+
}>>;
|
|
1017
|
+
cdpUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1018
|
+
launchOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1019
|
+
args: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1020
|
+
executablePath: z$1.ZodOptional<z$1.ZodString>;
|
|
1021
|
+
userDataDir: z$1.ZodOptional<z$1.ZodString>;
|
|
1022
|
+
preserveUserDataDir: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1023
|
+
headless: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1024
|
+
devtools: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1025
|
+
chromiumSandbox: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1026
|
+
ignoreDefaultArgs: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodArray<z$1.ZodString>]>>;
|
|
1027
|
+
proxy: z$1.ZodOptional<z$1.ZodObject<{
|
|
1028
|
+
server: z$1.ZodString;
|
|
1029
|
+
bypass: z$1.ZodOptional<z$1.ZodString>;
|
|
1030
|
+
username: z$1.ZodOptional<z$1.ZodString>;
|
|
1031
|
+
password: z$1.ZodOptional<z$1.ZodString>;
|
|
1032
|
+
}, z$1.core.$strip>>;
|
|
1033
|
+
locale: z$1.ZodOptional<z$1.ZodString>;
|
|
1034
|
+
viewport: z$1.ZodOptional<z$1.ZodObject<{
|
|
1035
|
+
width: z$1.ZodNumber;
|
|
1036
|
+
height: z$1.ZodNumber;
|
|
1037
|
+
}, z$1.core.$strip>>;
|
|
1038
|
+
deviceScaleFactor: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1039
|
+
hasTouch: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1040
|
+
ignoreHTTPSErrors: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1041
|
+
cdpUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1042
|
+
connectTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1043
|
+
downloadsPath: z$1.ZodOptional<z$1.ZodString>;
|
|
1044
|
+
acceptDownloads: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1045
|
+
}, z$1.core.$strict>>;
|
|
1046
|
+
}, z$1.core.$strip>>;
|
|
1047
|
+
selfHeal: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1048
|
+
browserbaseSessionID: z$1.ZodOptional<z$1.ZodString>;
|
|
1049
|
+
experimental: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1050
|
+
waitForCaptchaSolves: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1051
|
+
actTimeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1052
|
+
}, z$1.core.$strip>;
|
|
1053
|
+
declare const SessionStartResultSchema: z$1.ZodObject<{
|
|
1054
|
+
sessionId: z$1.ZodString;
|
|
1055
|
+
cdpUrl: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1056
|
+
available: z$1.ZodBoolean;
|
|
1057
|
+
}, z$1.core.$strip>;
|
|
1058
|
+
declare const SessionStartResponseSchema: z$1.ZodObject<{
|
|
1059
|
+
success: z$1.ZodBoolean;
|
|
1060
|
+
data: z$1.ZodObject<{
|
|
1061
|
+
sessionId: z$1.ZodString;
|
|
1062
|
+
cdpUrl: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1063
|
+
available: z$1.ZodBoolean;
|
|
1064
|
+
}, z$1.core.$strip>;
|
|
1065
|
+
}, z$1.core.$strip>;
|
|
1066
|
+
/** Session end request - empty JSON object (required). */
|
|
1067
|
+
declare const SessionEndRequestSchema: z$1.ZodObject<{
|
|
1068
|
+
_forceBody: z$1.ZodOptional<z$1.ZodUndefined>;
|
|
1069
|
+
}, z$1.core.$strict>;
|
|
1070
|
+
declare const SessionEndResultSchema: z$1.ZodObject<{}, z$1.core.$strict>;
|
|
1071
|
+
/** Session end response - just success flag, no data wrapper */
|
|
1072
|
+
declare const SessionEndResponseSchema: z$1.ZodObject<{
|
|
1073
|
+
success: z$1.ZodBoolean;
|
|
1074
|
+
}, z$1.core.$strict>;
|
|
1075
|
+
declare const ActOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
|
|
1076
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1077
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1078
|
+
openai: "openai";
|
|
1079
|
+
anthropic: "anthropic";
|
|
1080
|
+
google: "google";
|
|
1081
|
+
microsoft: "microsoft";
|
|
1082
|
+
}>>;
|
|
1083
|
+
modelName: z$1.ZodString;
|
|
1084
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1085
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1086
|
+
}, z$1.core.$strip>]>>;
|
|
1087
|
+
variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1088
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1089
|
+
}, z$1.core.$strip>>;
|
|
1090
|
+
declare const ActRequestSchema: z$1.ZodObject<{
|
|
1091
|
+
input: z$1.ZodUnion<[z$1.ZodString, z$1.ZodObject<{
|
|
1092
|
+
selector: z$1.ZodString;
|
|
1093
|
+
description: z$1.ZodString;
|
|
1094
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1095
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1096
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1097
|
+
}, z$1.core.$strip>]>;
|
|
1098
|
+
options: z$1.ZodOptional<z$1.ZodObject<{
|
|
1099
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1100
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1101
|
+
openai: "openai";
|
|
1102
|
+
anthropic: "anthropic";
|
|
1103
|
+
google: "google";
|
|
1104
|
+
microsoft: "microsoft";
|
|
1105
|
+
}>>;
|
|
1106
|
+
modelName: z$1.ZodString;
|
|
1107
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1108
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1109
|
+
}, z$1.core.$strip>]>>;
|
|
1110
|
+
variables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1111
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1112
|
+
}, z$1.core.$strip>>;
|
|
1113
|
+
frameId: z$1.ZodOptional<z$1.ZodString>;
|
|
1114
|
+
streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1115
|
+
}, z$1.core.$strip>;
|
|
1116
|
+
/** Inner act result data */
|
|
1117
|
+
declare const ActResultDataSchema: z$1.ZodObject<{
|
|
1118
|
+
success: z$1.ZodBoolean;
|
|
1119
|
+
message: z$1.ZodString;
|
|
1120
|
+
actionDescription: z$1.ZodString;
|
|
1121
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1122
|
+
selector: z$1.ZodString;
|
|
1123
|
+
description: z$1.ZodString;
|
|
1124
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1125
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1126
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1127
|
+
}, z$1.core.$strip>>;
|
|
1128
|
+
}, z$1.core.$strip>;
|
|
1129
|
+
declare const ActResultSchema: z$1.ZodObject<{
|
|
1130
|
+
result: z$1.ZodObject<{
|
|
1131
|
+
success: z$1.ZodBoolean;
|
|
1132
|
+
message: z$1.ZodString;
|
|
1133
|
+
actionDescription: z$1.ZodString;
|
|
1134
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1135
|
+
selector: z$1.ZodString;
|
|
1136
|
+
description: z$1.ZodString;
|
|
1137
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1138
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1139
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1140
|
+
}, z$1.core.$strip>>;
|
|
1141
|
+
}, z$1.core.$strip>;
|
|
1142
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1143
|
+
}, z$1.core.$strip>;
|
|
1144
|
+
declare const ActResponseSchema: z$1.ZodObject<{
|
|
1145
|
+
success: z$1.ZodBoolean;
|
|
1146
|
+
data: z$1.ZodObject<{
|
|
1147
|
+
result: z$1.ZodObject<{
|
|
1148
|
+
success: z$1.ZodBoolean;
|
|
1149
|
+
message: z$1.ZodString;
|
|
1150
|
+
actionDescription: z$1.ZodString;
|
|
1151
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1152
|
+
selector: z$1.ZodString;
|
|
1153
|
+
description: z$1.ZodString;
|
|
1154
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1155
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1156
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1157
|
+
}, z$1.core.$strip>>;
|
|
1158
|
+
}, z$1.core.$strip>;
|
|
1159
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1160
|
+
}, z$1.core.$strip>;
|
|
1161
|
+
}, z$1.core.$strip>;
|
|
1162
|
+
declare const ExtractOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
|
|
1163
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1164
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1165
|
+
openai: "openai";
|
|
1166
|
+
anthropic: "anthropic";
|
|
1167
|
+
google: "google";
|
|
1168
|
+
microsoft: "microsoft";
|
|
1169
|
+
}>>;
|
|
1170
|
+
modelName: z$1.ZodString;
|
|
1171
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1172
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1173
|
+
}, z$1.core.$strip>]>>;
|
|
1174
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1175
|
+
selector: z$1.ZodOptional<z$1.ZodString>;
|
|
1176
|
+
}, z$1.core.$strip>>;
|
|
1177
|
+
declare const ExtractRequestSchema: z$1.ZodObject<{
|
|
1178
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1179
|
+
schema: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1180
|
+
options: z$1.ZodOptional<z$1.ZodObject<{
|
|
1181
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1182
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1183
|
+
openai: "openai";
|
|
1184
|
+
anthropic: "anthropic";
|
|
1185
|
+
google: "google";
|
|
1186
|
+
microsoft: "microsoft";
|
|
1187
|
+
}>>;
|
|
1188
|
+
modelName: z$1.ZodString;
|
|
1189
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1190
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1191
|
+
}, z$1.core.$strip>]>>;
|
|
1192
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1193
|
+
selector: z$1.ZodOptional<z$1.ZodString>;
|
|
1194
|
+
}, z$1.core.$strip>>;
|
|
1195
|
+
frameId: z$1.ZodOptional<z$1.ZodString>;
|
|
1196
|
+
streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1197
|
+
}, z$1.core.$strip>;
|
|
1198
|
+
declare const ExtractResultSchema: z$1.ZodObject<{
|
|
1199
|
+
result: z$1.ZodUnknown;
|
|
1200
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1201
|
+
}, z$1.core.$strip>;
|
|
1202
|
+
declare const ExtractResponseSchema: z$1.ZodObject<{
|
|
1203
|
+
success: z$1.ZodBoolean;
|
|
1204
|
+
data: z$1.ZodObject<{
|
|
1205
|
+
result: z$1.ZodUnknown;
|
|
1206
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1207
|
+
}, z$1.core.$strip>;
|
|
1208
|
+
}, z$1.core.$strip>;
|
|
1209
|
+
declare const ObserveOptionsSchema: z$1.ZodOptional<z$1.ZodObject<{
|
|
1210
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1211
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1212
|
+
openai: "openai";
|
|
1213
|
+
anthropic: "anthropic";
|
|
1214
|
+
google: "google";
|
|
1215
|
+
microsoft: "microsoft";
|
|
1216
|
+
}>>;
|
|
1217
|
+
modelName: z$1.ZodString;
|
|
1218
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1219
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1220
|
+
}, z$1.core.$strip>]>>;
|
|
1221
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1222
|
+
selector: z$1.ZodOptional<z$1.ZodString>;
|
|
1223
|
+
}, z$1.core.$strip>>;
|
|
1224
|
+
declare const ObserveRequestSchema: z$1.ZodObject<{
|
|
1225
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1226
|
+
options: z$1.ZodOptional<z$1.ZodObject<{
|
|
1227
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1228
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1229
|
+
openai: "openai";
|
|
1230
|
+
anthropic: "anthropic";
|
|
1231
|
+
google: "google";
|
|
1232
|
+
microsoft: "microsoft";
|
|
1233
|
+
}>>;
|
|
1234
|
+
modelName: z$1.ZodString;
|
|
1235
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1236
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1237
|
+
}, z$1.core.$strip>]>>;
|
|
1238
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1239
|
+
selector: z$1.ZodOptional<z$1.ZodString>;
|
|
1240
|
+
}, z$1.core.$strip>>;
|
|
1241
|
+
frameId: z$1.ZodOptional<z$1.ZodString>;
|
|
1242
|
+
streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1243
|
+
}, z$1.core.$strip>;
|
|
1244
|
+
declare const ObserveResultSchema: z$1.ZodObject<{
|
|
1245
|
+
result: z$1.ZodArray<z$1.ZodObject<{
|
|
1246
|
+
selector: z$1.ZodString;
|
|
1247
|
+
description: z$1.ZodString;
|
|
1248
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1249
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1250
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1251
|
+
}, z$1.core.$strip>>;
|
|
1252
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1253
|
+
}, z$1.core.$strip>;
|
|
1254
|
+
declare const ObserveResponseSchema: z$1.ZodObject<{
|
|
1255
|
+
success: z$1.ZodBoolean;
|
|
1256
|
+
data: z$1.ZodObject<{
|
|
1257
|
+
result: z$1.ZodArray<z$1.ZodObject<{
|
|
1258
|
+
selector: z$1.ZodString;
|
|
1259
|
+
description: z$1.ZodString;
|
|
1260
|
+
backendNodeId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1261
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1262
|
+
arguments: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1263
|
+
}, z$1.core.$strip>>;
|
|
1264
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1265
|
+
}, z$1.core.$strip>;
|
|
1266
|
+
}, z$1.core.$strip>;
|
|
1267
|
+
declare const AgentConfigSchema: z$1.ZodObject<{
|
|
1268
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1269
|
+
openai: "openai";
|
|
1270
|
+
anthropic: "anthropic";
|
|
1271
|
+
google: "google";
|
|
1272
|
+
microsoft: "microsoft";
|
|
1273
|
+
}>>;
|
|
1274
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1275
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1276
|
+
openai: "openai";
|
|
1277
|
+
anthropic: "anthropic";
|
|
1278
|
+
google: "google";
|
|
1279
|
+
microsoft: "microsoft";
|
|
1280
|
+
}>>;
|
|
1281
|
+
modelName: z$1.ZodString;
|
|
1282
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1283
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1284
|
+
}, z$1.core.$strip>]>>;
|
|
1285
|
+
systemPrompt: z$1.ZodOptional<z$1.ZodString>;
|
|
1286
|
+
cua: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1287
|
+
}, z$1.core.$strip>;
|
|
1288
|
+
/** Action taken by the agent during execution */
|
|
1289
|
+
declare const AgentActionSchema: z$1.ZodObject<{
|
|
1290
|
+
type: z$1.ZodString;
|
|
1291
|
+
reasoning: z$1.ZodOptional<z$1.ZodString>;
|
|
1292
|
+
taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1293
|
+
action: z$1.ZodOptional<z$1.ZodString>;
|
|
1294
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1295
|
+
pageText: z$1.ZodOptional<z$1.ZodString>;
|
|
1296
|
+
pageUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1297
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1298
|
+
}, z$1.core.$loose>;
|
|
1299
|
+
/** Token usage statistics for agent execution */
|
|
1300
|
+
declare const AgentUsageSchema: z$1.ZodObject<{
|
|
1301
|
+
input_tokens: z$1.ZodNumber;
|
|
1302
|
+
output_tokens: z$1.ZodNumber;
|
|
1303
|
+
reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1304
|
+
cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1305
|
+
inference_time_ms: z$1.ZodNumber;
|
|
1306
|
+
}, z$1.core.$strip>;
|
|
1307
|
+
/** Result data from agent execution */
|
|
1308
|
+
declare const AgentResultDataSchema: z$1.ZodObject<{
|
|
1309
|
+
success: z$1.ZodBoolean;
|
|
1310
|
+
message: z$1.ZodString;
|
|
1311
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1312
|
+
type: z$1.ZodString;
|
|
1313
|
+
reasoning: z$1.ZodOptional<z$1.ZodString>;
|
|
1314
|
+
taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1315
|
+
action: z$1.ZodOptional<z$1.ZodString>;
|
|
1316
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1317
|
+
pageText: z$1.ZodOptional<z$1.ZodString>;
|
|
1318
|
+
pageUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1319
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1320
|
+
}, z$1.core.$loose>>;
|
|
1321
|
+
completed: z$1.ZodBoolean;
|
|
1322
|
+
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1323
|
+
usage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1324
|
+
input_tokens: z$1.ZodNumber;
|
|
1325
|
+
output_tokens: z$1.ZodNumber;
|
|
1326
|
+
reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1327
|
+
cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1328
|
+
inference_time_ms: z$1.ZodNumber;
|
|
1329
|
+
}, z$1.core.$strip>>;
|
|
1330
|
+
}, z$1.core.$strip>;
|
|
1331
|
+
declare const AgentCacheEntrySchema: z$1.ZodObject<{
|
|
1332
|
+
cacheKey: z$1.ZodString;
|
|
1333
|
+
entry: z$1.ZodUnknown;
|
|
1334
|
+
}, z$1.core.$strip>;
|
|
1335
|
+
declare const AgentExecuteOptionsSchema: z$1.ZodObject<{
|
|
1336
|
+
instruction: z$1.ZodString;
|
|
1337
|
+
maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1338
|
+
highlightCursor: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1339
|
+
}, z$1.core.$strip>;
|
|
1340
|
+
declare const AgentExecuteRequestSchema: z$1.ZodObject<{
|
|
1341
|
+
agentConfig: z$1.ZodObject<{
|
|
1342
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1343
|
+
openai: "openai";
|
|
1344
|
+
anthropic: "anthropic";
|
|
1345
|
+
google: "google";
|
|
1346
|
+
microsoft: "microsoft";
|
|
1347
|
+
}>>;
|
|
1348
|
+
model: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
1349
|
+
provider: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1350
|
+
openai: "openai";
|
|
1351
|
+
anthropic: "anthropic";
|
|
1352
|
+
google: "google";
|
|
1353
|
+
microsoft: "microsoft";
|
|
1354
|
+
}>>;
|
|
1355
|
+
modelName: z$1.ZodString;
|
|
1356
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1357
|
+
baseURL: z$1.ZodOptional<z$1.ZodString>;
|
|
1358
|
+
}, z$1.core.$strip>]>>;
|
|
1359
|
+
systemPrompt: z$1.ZodOptional<z$1.ZodString>;
|
|
1360
|
+
cua: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1361
|
+
}, z$1.core.$strip>;
|
|
1362
|
+
executeOptions: z$1.ZodObject<{
|
|
1363
|
+
instruction: z$1.ZodString;
|
|
1364
|
+
maxSteps: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1365
|
+
highlightCursor: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1366
|
+
}, z$1.core.$strip>;
|
|
1367
|
+
frameId: z$1.ZodOptional<z$1.ZodString>;
|
|
1368
|
+
streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1369
|
+
shouldCache: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1370
|
+
}, z$1.core.$strip>;
|
|
1371
|
+
declare const AgentExecuteResultSchema: z$1.ZodObject<{
|
|
1372
|
+
result: z$1.ZodObject<{
|
|
1373
|
+
success: z$1.ZodBoolean;
|
|
1374
|
+
message: z$1.ZodString;
|
|
1375
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1376
|
+
type: z$1.ZodString;
|
|
1377
|
+
reasoning: z$1.ZodOptional<z$1.ZodString>;
|
|
1378
|
+
taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1379
|
+
action: z$1.ZodOptional<z$1.ZodString>;
|
|
1380
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1381
|
+
pageText: z$1.ZodOptional<z$1.ZodString>;
|
|
1382
|
+
pageUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1383
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1384
|
+
}, z$1.core.$loose>>;
|
|
1385
|
+
completed: z$1.ZodBoolean;
|
|
1386
|
+
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1387
|
+
usage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1388
|
+
input_tokens: z$1.ZodNumber;
|
|
1389
|
+
output_tokens: z$1.ZodNumber;
|
|
1390
|
+
reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1391
|
+
cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1392
|
+
inference_time_ms: z$1.ZodNumber;
|
|
1393
|
+
}, z$1.core.$strip>>;
|
|
1394
|
+
}, z$1.core.$strip>;
|
|
1395
|
+
cacheEntry: z$1.ZodOptional<z$1.ZodObject<{
|
|
1396
|
+
cacheKey: z$1.ZodString;
|
|
1397
|
+
entry: z$1.ZodUnknown;
|
|
1398
|
+
}, z$1.core.$strip>>;
|
|
1399
|
+
}, z$1.core.$strip>;
|
|
1400
|
+
declare const AgentExecuteResponseSchema: z$1.ZodObject<{
|
|
1401
|
+
success: z$1.ZodBoolean;
|
|
1402
|
+
data: z$1.ZodObject<{
|
|
1403
|
+
result: z$1.ZodObject<{
|
|
1404
|
+
success: z$1.ZodBoolean;
|
|
1405
|
+
message: z$1.ZodString;
|
|
1406
|
+
actions: z$1.ZodArray<z$1.ZodObject<{
|
|
1407
|
+
type: z$1.ZodString;
|
|
1408
|
+
reasoning: z$1.ZodOptional<z$1.ZodString>;
|
|
1409
|
+
taskCompleted: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1410
|
+
action: z$1.ZodOptional<z$1.ZodString>;
|
|
1411
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1412
|
+
pageText: z$1.ZodOptional<z$1.ZodString>;
|
|
1413
|
+
pageUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1414
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1415
|
+
}, z$1.core.$loose>>;
|
|
1416
|
+
completed: z$1.ZodBoolean;
|
|
1417
|
+
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1418
|
+
usage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1419
|
+
input_tokens: z$1.ZodNumber;
|
|
1420
|
+
output_tokens: z$1.ZodNumber;
|
|
1421
|
+
reasoning_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1422
|
+
cached_input_tokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1423
|
+
inference_time_ms: z$1.ZodNumber;
|
|
1424
|
+
}, z$1.core.$strip>>;
|
|
1425
|
+
}, z$1.core.$strip>;
|
|
1426
|
+
cacheEntry: z$1.ZodOptional<z$1.ZodObject<{
|
|
1427
|
+
cacheKey: z$1.ZodString;
|
|
1428
|
+
entry: z$1.ZodUnknown;
|
|
1429
|
+
}, z$1.core.$strip>>;
|
|
1430
|
+
}, z$1.core.$strip>;
|
|
1431
|
+
}, z$1.core.$strip>;
|
|
1432
|
+
declare const NavigateOptionsSchema: 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
|
+
declare const NavigateRequestSchema: z$1.ZodObject<{
|
|
1442
|
+
url: z$1.ZodString;
|
|
1443
|
+
options: z$1.ZodOptional<z$1.ZodObject<{
|
|
1444
|
+
referer: z$1.ZodOptional<z$1.ZodString>;
|
|
1445
|
+
timeout: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1446
|
+
waitUntil: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1447
|
+
load: "load";
|
|
1448
|
+
domcontentloaded: "domcontentloaded";
|
|
1449
|
+
networkidle: "networkidle";
|
|
1450
|
+
}>>;
|
|
1451
|
+
}, z$1.core.$strip>>;
|
|
1452
|
+
frameId: z$1.ZodOptional<z$1.ZodString>;
|
|
1453
|
+
streamResponse: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1454
|
+
}, z$1.core.$strip>;
|
|
1455
|
+
declare const NavigateResultSchema: z$1.ZodObject<{
|
|
1456
|
+
result: z$1.ZodNullable<z$1.ZodUnknown>;
|
|
1457
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1458
|
+
}, z$1.core.$strip>;
|
|
1459
|
+
declare const NavigateResponseSchema: z$1.ZodObject<{
|
|
1460
|
+
success: z$1.ZodBoolean;
|
|
1461
|
+
data: z$1.ZodObject<{
|
|
1462
|
+
result: z$1.ZodNullable<z$1.ZodUnknown>;
|
|
1463
|
+
actionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1464
|
+
}, z$1.core.$strip>;
|
|
1465
|
+
}, z$1.core.$strip>;
|
|
1466
|
+
/** Token usage for a single action */
|
|
1467
|
+
declare const TokenUsageSchema: z$1.ZodObject<{
|
|
1468
|
+
inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1469
|
+
outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1470
|
+
reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1471
|
+
cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1472
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1473
|
+
}, z$1.core.$strip>;
|
|
1474
|
+
/** Action entry in replay metrics */
|
|
1475
|
+
declare const ReplayActionSchema: z$1.ZodObject<{
|
|
1476
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1477
|
+
tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1478
|
+
inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1479
|
+
outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1480
|
+
reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1481
|
+
cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1482
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1483
|
+
}, z$1.core.$strip>>;
|
|
1484
|
+
}, z$1.core.$strip>;
|
|
1485
|
+
/** Page entry in replay metrics */
|
|
1486
|
+
declare const ReplayPageSchema: z$1.ZodObject<{
|
|
1487
|
+
actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1488
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1489
|
+
tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1490
|
+
inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1491
|
+
outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1492
|
+
reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1493
|
+
cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1494
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1495
|
+
}, z$1.core.$strip>>;
|
|
1496
|
+
}, z$1.core.$strip>>>;
|
|
1497
|
+
}, z$1.core.$strip>;
|
|
1498
|
+
/** Inner result data for replay */
|
|
1499
|
+
declare const ReplayResultSchema: z$1.ZodObject<{
|
|
1500
|
+
pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1501
|
+
actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1502
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1503
|
+
tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1504
|
+
inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1505
|
+
outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1506
|
+
reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1507
|
+
cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1508
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1509
|
+
}, z$1.core.$strip>>;
|
|
1510
|
+
}, z$1.core.$strip>>>;
|
|
1511
|
+
}, z$1.core.$strip>>>;
|
|
1512
|
+
}, z$1.core.$strip>;
|
|
1513
|
+
declare const ReplayResponseSchema: z$1.ZodObject<{
|
|
1514
|
+
success: z$1.ZodBoolean;
|
|
1515
|
+
data: z$1.ZodObject<{
|
|
1516
|
+
pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1517
|
+
actions: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1518
|
+
method: z$1.ZodOptional<z$1.ZodString>;
|
|
1519
|
+
tokenUsage: z$1.ZodOptional<z$1.ZodObject<{
|
|
1520
|
+
inputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1521
|
+
outputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1522
|
+
reasoningTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1523
|
+
cachedInputTokens: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1524
|
+
timeMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1525
|
+
}, z$1.core.$strip>>;
|
|
1526
|
+
}, z$1.core.$strip>>>;
|
|
1527
|
+
}, z$1.core.$strip>>>;
|
|
1528
|
+
}, z$1.core.$strip>;
|
|
1529
|
+
}, z$1.core.$strip>;
|
|
1530
|
+
/** Status values for SSE stream events */
|
|
1531
|
+
declare const StreamEventStatusSchema: z$1.ZodEnum<{
|
|
1532
|
+
error: "error";
|
|
1533
|
+
starting: "starting";
|
|
1534
|
+
connected: "connected";
|
|
1535
|
+
running: "running";
|
|
1536
|
+
finished: "finished";
|
|
1537
|
+
}>;
|
|
1538
|
+
/** Type discriminator for SSE stream events */
|
|
1539
|
+
declare const StreamEventTypeSchema: z$1.ZodEnum<{
|
|
1540
|
+
system: "system";
|
|
1541
|
+
log: "log";
|
|
1542
|
+
}>;
|
|
1543
|
+
/** Data payload for system stream events */
|
|
1544
|
+
declare const StreamEventSystemDataSchema: z$1.ZodObject<{
|
|
1545
|
+
status: z$1.ZodEnum<{
|
|
1546
|
+
error: "error";
|
|
1547
|
+
starting: "starting";
|
|
1548
|
+
connected: "connected";
|
|
1549
|
+
running: "running";
|
|
1550
|
+
finished: "finished";
|
|
1551
|
+
}>;
|
|
1552
|
+
result: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1553
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1554
|
+
}, z$1.core.$strip>;
|
|
1555
|
+
/** Data payload for log stream events */
|
|
1556
|
+
declare const StreamEventLogDataSchema: z$1.ZodObject<{
|
|
1557
|
+
status: z$1.ZodLiteral<"running">;
|
|
1558
|
+
message: z$1.ZodString;
|
|
1559
|
+
}, z$1.core.$strip>;
|
|
1560
|
+
/**
|
|
1561
|
+
* SSE stream event sent during streaming responses.
|
|
1562
|
+
*
|
|
1563
|
+
* IMPORTANT: Key ordering matters for Stainless SDK generation.
|
|
1564
|
+
* The `data` field MUST be serialized first, with `status` as the first key within it.
|
|
1565
|
+
* This allows Stainless to use `data_starts_with: '{"data":{"status":"finished"'` for event handling.
|
|
1566
|
+
*
|
|
1567
|
+
* Expected serialization order: {"data":{"status":...},"type":...,"id":...}
|
|
1568
|
+
*/
|
|
1569
|
+
declare const StreamEventSchema: z$1.ZodObject<{
|
|
1570
|
+
data: z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1571
|
+
status: z$1.ZodEnum<{
|
|
1572
|
+
error: "error";
|
|
1573
|
+
starting: "starting";
|
|
1574
|
+
connected: "connected";
|
|
1575
|
+
running: "running";
|
|
1576
|
+
finished: "finished";
|
|
1577
|
+
}>;
|
|
1578
|
+
result: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1579
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1580
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1581
|
+
status: z$1.ZodLiteral<"running">;
|
|
1582
|
+
message: z$1.ZodString;
|
|
1583
|
+
}, z$1.core.$strip>]>;
|
|
1584
|
+
type: z$1.ZodEnum<{
|
|
1585
|
+
system: "system";
|
|
1586
|
+
log: "log";
|
|
1587
|
+
}>;
|
|
1588
|
+
id: z$1.ZodString;
|
|
1589
|
+
}, z$1.core.$strip>;
|
|
1590
|
+
/** OpenAPI security schemes for authentication */
|
|
1591
|
+
declare const openApiSecuritySchemes: {
|
|
1592
|
+
readonly BrowserbaseApiKey: {
|
|
1593
|
+
readonly type: "apiKey";
|
|
1594
|
+
readonly in: "header";
|
|
1595
|
+
readonly name: "x-bb-api-key";
|
|
1596
|
+
readonly description: "Browserbase API key for authentication";
|
|
1597
|
+
};
|
|
1598
|
+
readonly BrowserbaseProjectId: {
|
|
1599
|
+
readonly type: "apiKey";
|
|
1600
|
+
readonly in: "header";
|
|
1601
|
+
readonly name: "x-bb-project-id";
|
|
1602
|
+
readonly description: "Browserbase project ID";
|
|
1603
|
+
};
|
|
1604
|
+
readonly ModelApiKey: {
|
|
1605
|
+
readonly type: "apiKey";
|
|
1606
|
+
readonly in: "header";
|
|
1607
|
+
readonly name: "x-model-api-key";
|
|
1608
|
+
readonly description: "API key for the AI model provider (OpenAI, Anthropic, etc.)";
|
|
1609
|
+
};
|
|
1610
|
+
};
|
|
1611
|
+
/** OpenAPI links for session operations (used in SessionStart response) */
|
|
1612
|
+
declare const openApiLinks: {
|
|
1613
|
+
readonly SessionAct: {
|
|
1614
|
+
readonly operationId: "SessionAct";
|
|
1615
|
+
readonly parameters: {
|
|
1616
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1617
|
+
};
|
|
1618
|
+
readonly description: "Perform an action on the session";
|
|
1619
|
+
};
|
|
1620
|
+
readonly SessionExtract: {
|
|
1621
|
+
readonly operationId: "SessionExtract";
|
|
1622
|
+
readonly parameters: {
|
|
1623
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1624
|
+
};
|
|
1625
|
+
readonly description: "Extract data from the session";
|
|
1626
|
+
};
|
|
1627
|
+
readonly SessionObserve: {
|
|
1628
|
+
readonly operationId: "SessionObserve";
|
|
1629
|
+
readonly parameters: {
|
|
1630
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1631
|
+
};
|
|
1632
|
+
readonly description: "Observe available actions on the session";
|
|
1633
|
+
};
|
|
1634
|
+
readonly SessionNavigate: {
|
|
1635
|
+
readonly operationId: "SessionNavigate";
|
|
1636
|
+
readonly parameters: {
|
|
1637
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1638
|
+
};
|
|
1639
|
+
readonly description: "Navigate to a URL in the session";
|
|
1640
|
+
};
|
|
1641
|
+
readonly SessionAgentExecute: {
|
|
1642
|
+
readonly operationId: "SessionAgentExecute";
|
|
1643
|
+
readonly parameters: {
|
|
1644
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1645
|
+
};
|
|
1646
|
+
readonly description: "Execute an agent on the session";
|
|
1647
|
+
};
|
|
1648
|
+
readonly SessionReplay: {
|
|
1649
|
+
readonly operationId: "SessionReplay";
|
|
1650
|
+
readonly parameters: {
|
|
1651
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1652
|
+
};
|
|
1653
|
+
readonly description: "Replay session metrics";
|
|
1654
|
+
};
|
|
1655
|
+
readonly SessionEnd: {
|
|
1656
|
+
readonly operationId: "SessionEnd";
|
|
1657
|
+
readonly parameters: {
|
|
1658
|
+
readonly id: "$response.body#/data/sessionId";
|
|
1659
|
+
};
|
|
1660
|
+
readonly description: "End the session and release resources";
|
|
1661
|
+
};
|
|
1662
|
+
};
|
|
1663
|
+
/** OpenAPI operation metadata for each endpoint */
|
|
1664
|
+
declare const Operations: {
|
|
1665
|
+
readonly SessionStart: {
|
|
1666
|
+
readonly operationId: "SessionStart";
|
|
1667
|
+
readonly summary: "Start a new browser session";
|
|
1668
|
+
readonly description: "Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations.";
|
|
1669
|
+
};
|
|
1670
|
+
readonly SessionEnd: {
|
|
1671
|
+
readonly operationId: "SessionEnd";
|
|
1672
|
+
readonly summary: "End a browser session";
|
|
1673
|
+
readonly description: "Terminates the browser session and releases all associated resources.";
|
|
1674
|
+
};
|
|
1675
|
+
readonly SessionAct: {
|
|
1676
|
+
readonly operationId: "SessionAct";
|
|
1677
|
+
readonly summary: "Perform an action";
|
|
1678
|
+
readonly description: "Executes a browser action using natural language instructions or a predefined Action object.";
|
|
1679
|
+
};
|
|
1680
|
+
readonly SessionExtract: {
|
|
1681
|
+
readonly operationId: "SessionExtract";
|
|
1682
|
+
readonly summary: "Extract data from the page";
|
|
1683
|
+
readonly description: "Extracts structured data from the current page using AI-powered analysis.";
|
|
1684
|
+
};
|
|
1685
|
+
readonly SessionObserve: {
|
|
1686
|
+
readonly operationId: "SessionObserve";
|
|
1687
|
+
readonly summary: "Observe available actions";
|
|
1688
|
+
readonly description: "Identifies and returns available actions on the current page that match the given instruction.";
|
|
1689
|
+
};
|
|
1690
|
+
readonly SessionNavigate: {
|
|
1691
|
+
readonly operationId: "SessionNavigate";
|
|
1692
|
+
readonly summary: "Navigate to a URL";
|
|
1693
|
+
readonly description: "Navigates the browser to the specified URL.";
|
|
1694
|
+
};
|
|
1695
|
+
readonly SessionAgentExecute: {
|
|
1696
|
+
readonly operationId: "SessionAgentExecute";
|
|
1697
|
+
readonly summary: "Execute an AI agent";
|
|
1698
|
+
readonly description: "Runs an autonomous AI agent that can perform complex multi-step browser tasks.";
|
|
1699
|
+
};
|
|
1700
|
+
readonly SessionReplay: {
|
|
1701
|
+
readonly operationId: "SessionReplay";
|
|
1702
|
+
readonly summary: "Replay session metrics";
|
|
1703
|
+
readonly description: "Retrieves replay metrics for a session.";
|
|
1704
|
+
};
|
|
1705
|
+
};
|
|
1706
|
+
type Action$1 = z$1.infer<typeof ActionSchema>;
|
|
1707
|
+
type ModelConfig = z$1.infer<typeof ModelConfigSchema>;
|
|
1708
|
+
type BrowserConfig = z$1.infer<typeof BrowserConfigSchema>;
|
|
1709
|
+
type SessionIdParams = z$1.infer<typeof SessionIdParamsSchema>;
|
|
1710
|
+
type SessionHeaders = z$1.infer<typeof SessionHeadersSchema>;
|
|
1711
|
+
type BrowserbaseViewport = z$1.infer<typeof BrowserbaseViewportSchema>;
|
|
1712
|
+
type BrowserbaseFingerprintScreen = z$1.infer<typeof BrowserbaseFingerprintScreenSchema>;
|
|
1713
|
+
type BrowserbaseFingerprint = z$1.infer<typeof BrowserbaseFingerprintSchema>;
|
|
1714
|
+
type BrowserbaseContext = z$1.infer<typeof BrowserbaseContextSchema>;
|
|
1715
|
+
type BrowserbaseBrowserSettings = z$1.infer<typeof BrowserbaseBrowserSettingsSchema>;
|
|
1716
|
+
type BrowserbaseProxyGeolocation = z$1.infer<typeof BrowserbaseProxyGeolocationSchema>;
|
|
1717
|
+
type BrowserbaseProxyConfig = z$1.infer<typeof BrowserbaseProxyConfigSchema>;
|
|
1718
|
+
type ExternalProxyConfig = z$1.infer<typeof ExternalProxyConfigSchema>;
|
|
1719
|
+
type BrowserbaseSessionCreateParams = z$1.infer<typeof BrowserbaseSessionCreateParamsSchema>;
|
|
1720
|
+
type SessionStartRequest = z$1.infer<typeof SessionStartRequestSchema>;
|
|
1721
|
+
type SessionStartResult = z$1.infer<typeof SessionStartResultSchema>;
|
|
1722
|
+
type SessionStartResponse = z$1.infer<typeof SessionStartResponseSchema>;
|
|
1723
|
+
type SessionEndResult = z$1.infer<typeof SessionEndResultSchema>;
|
|
1724
|
+
type SessionEndResponse = z$1.infer<typeof SessionEndResponseSchema>;
|
|
1725
|
+
type ActRequest = z$1.infer<typeof ActRequestSchema>;
|
|
1726
|
+
type ActResultData = z$1.infer<typeof ActResultDataSchema>;
|
|
1727
|
+
type ActResult$1 = z$1.infer<typeof ActResultSchema>;
|
|
1728
|
+
type ActResponse = z$1.infer<typeof ActResponseSchema>;
|
|
1729
|
+
type ExtractRequest = z$1.infer<typeof ExtractRequestSchema>;
|
|
1730
|
+
type ExtractResult$1 = z$1.infer<typeof ExtractResultSchema>;
|
|
1731
|
+
type ExtractResponse = z$1.infer<typeof ExtractResponseSchema>;
|
|
1732
|
+
type ObserveRequest = z$1.infer<typeof ObserveRequestSchema>;
|
|
1733
|
+
type ObserveResult = z$1.infer<typeof ObserveResultSchema>;
|
|
1734
|
+
type ObserveResponse = z$1.infer<typeof ObserveResponseSchema>;
|
|
1735
|
+
type AgentAction$1 = z$1.infer<typeof AgentActionSchema>;
|
|
1736
|
+
type AgentUsage = z$1.infer<typeof AgentUsageSchema>;
|
|
1737
|
+
type AgentResultData = z$1.infer<typeof AgentResultDataSchema>;
|
|
1738
|
+
type AgentExecuteRequest = z$1.infer<typeof AgentExecuteRequestSchema>;
|
|
1739
|
+
type AgentExecuteResult = z$1.infer<typeof AgentExecuteResultSchema>;
|
|
1740
|
+
type AgentExecuteResponse = z$1.infer<typeof AgentExecuteResponseSchema>;
|
|
1741
|
+
type NavigateRequest = z$1.infer<typeof NavigateRequestSchema>;
|
|
1742
|
+
type NavigateResult = z$1.infer<typeof NavigateResultSchema>;
|
|
1743
|
+
type NavigateResponse = z$1.infer<typeof NavigateResponseSchema>;
|
|
1744
|
+
type TokenUsage = z$1.infer<typeof TokenUsageSchema>;
|
|
1745
|
+
type ReplayAction = z$1.infer<typeof ReplayActionSchema>;
|
|
1746
|
+
type ReplayPage = z$1.infer<typeof ReplayPageSchema>;
|
|
1747
|
+
type ReplayResult = z$1.infer<typeof ReplayResultSchema>;
|
|
1748
|
+
type ReplayResponse = z$1.infer<typeof ReplayResponseSchema>;
|
|
1749
|
+
type StreamEventStatus = z$1.infer<typeof StreamEventStatusSchema>;
|
|
1750
|
+
type StreamEventType = z$1.infer<typeof StreamEventTypeSchema>;
|
|
1751
|
+
type StreamEventSystemData = z$1.infer<typeof StreamEventSystemDataSchema>;
|
|
1752
|
+
type StreamEventLogData = z$1.infer<typeof StreamEventLogDataSchema>;
|
|
1753
|
+
type StreamEvent = z$1.infer<typeof StreamEventSchema>;
|
|
1754
|
+
|
|
1755
|
+
declare const api_ActOptionsSchema: typeof ActOptionsSchema;
|
|
1756
|
+
type api_ActRequest = ActRequest;
|
|
1757
|
+
declare const api_ActRequestSchema: typeof ActRequestSchema;
|
|
1758
|
+
type api_ActResponse = ActResponse;
|
|
1759
|
+
declare const api_ActResponseSchema: typeof ActResponseSchema;
|
|
1760
|
+
type api_ActResultData = ActResultData;
|
|
1761
|
+
declare const api_ActResultDataSchema: typeof ActResultDataSchema;
|
|
1762
|
+
declare const api_ActResultSchema: typeof ActResultSchema;
|
|
1763
|
+
declare const api_ActionSchema: typeof ActionSchema;
|
|
1764
|
+
declare const api_AgentActionSchema: typeof AgentActionSchema;
|
|
1765
|
+
declare const api_AgentCacheEntrySchema: typeof AgentCacheEntrySchema;
|
|
1766
|
+
declare const api_AgentConfigSchema: typeof AgentConfigSchema;
|
|
1767
|
+
declare const api_AgentExecuteOptionsSchema: typeof AgentExecuteOptionsSchema;
|
|
1768
|
+
type api_AgentExecuteRequest = AgentExecuteRequest;
|
|
1769
|
+
declare const api_AgentExecuteRequestSchema: typeof AgentExecuteRequestSchema;
|
|
1770
|
+
type api_AgentExecuteResponse = AgentExecuteResponse;
|
|
1771
|
+
declare const api_AgentExecuteResponseSchema: typeof AgentExecuteResponseSchema;
|
|
1772
|
+
type api_AgentExecuteResult = AgentExecuteResult;
|
|
1773
|
+
declare const api_AgentExecuteResultSchema: typeof AgentExecuteResultSchema;
|
|
1774
|
+
type api_AgentResultData = AgentResultData;
|
|
1775
|
+
declare const api_AgentResultDataSchema: typeof AgentResultDataSchema;
|
|
1776
|
+
type api_AgentUsage = AgentUsage;
|
|
1777
|
+
declare const api_AgentUsageSchema: typeof AgentUsageSchema;
|
|
1778
|
+
type api_BrowserConfig = BrowserConfig;
|
|
1779
|
+
declare const api_BrowserConfigSchema: typeof BrowserConfigSchema;
|
|
1780
|
+
type api_BrowserbaseBrowserSettings = BrowserbaseBrowserSettings;
|
|
1781
|
+
declare const api_BrowserbaseBrowserSettingsSchema: typeof BrowserbaseBrowserSettingsSchema;
|
|
1782
|
+
type api_BrowserbaseContext = BrowserbaseContext;
|
|
1783
|
+
declare const api_BrowserbaseContextSchema: typeof BrowserbaseContextSchema;
|
|
1784
|
+
type api_BrowserbaseFingerprint = BrowserbaseFingerprint;
|
|
1785
|
+
declare const api_BrowserbaseFingerprintSchema: typeof BrowserbaseFingerprintSchema;
|
|
1786
|
+
type api_BrowserbaseFingerprintScreen = BrowserbaseFingerprintScreen;
|
|
1787
|
+
declare const api_BrowserbaseFingerprintScreenSchema: typeof BrowserbaseFingerprintScreenSchema;
|
|
1788
|
+
type api_BrowserbaseProxyConfig = BrowserbaseProxyConfig;
|
|
1789
|
+
declare const api_BrowserbaseProxyConfigSchema: typeof BrowserbaseProxyConfigSchema;
|
|
1790
|
+
type api_BrowserbaseProxyGeolocation = BrowserbaseProxyGeolocation;
|
|
1791
|
+
declare const api_BrowserbaseProxyGeolocationSchema: typeof BrowserbaseProxyGeolocationSchema;
|
|
1792
|
+
type api_BrowserbaseSessionCreateParams = BrowserbaseSessionCreateParams;
|
|
1793
|
+
declare const api_BrowserbaseSessionCreateParamsSchema: typeof BrowserbaseSessionCreateParamsSchema;
|
|
1794
|
+
type api_BrowserbaseViewport = BrowserbaseViewport;
|
|
1795
|
+
declare const api_BrowserbaseViewportSchema: typeof BrowserbaseViewportSchema;
|
|
1796
|
+
declare const api_ErrorResponseSchema: typeof ErrorResponseSchema;
|
|
1797
|
+
type api_ExternalProxyConfig = ExternalProxyConfig;
|
|
1798
|
+
declare const api_ExternalProxyConfigSchema: typeof ExternalProxyConfigSchema;
|
|
1799
|
+
declare const api_ExtractOptionsSchema: typeof ExtractOptionsSchema;
|
|
1800
|
+
type api_ExtractRequest = ExtractRequest;
|
|
1801
|
+
declare const api_ExtractRequestSchema: typeof ExtractRequestSchema;
|
|
1802
|
+
type api_ExtractResponse = ExtractResponse;
|
|
1803
|
+
declare const api_ExtractResponseSchema: typeof ExtractResponseSchema;
|
|
1804
|
+
declare const api_ExtractResultSchema: typeof ExtractResultSchema;
|
|
1805
|
+
declare const api_LocalBrowserLaunchOptionsSchema: typeof LocalBrowserLaunchOptionsSchema;
|
|
1806
|
+
type api_ModelConfig = ModelConfig;
|
|
1807
|
+
declare const api_ModelConfigObjectSchema: typeof ModelConfigObjectSchema;
|
|
1808
|
+
declare const api_ModelConfigSchema: typeof ModelConfigSchema;
|
|
1809
|
+
declare const api_ModelNameSchema: typeof ModelNameSchema;
|
|
1810
|
+
declare const api_NavigateOptionsSchema: typeof NavigateOptionsSchema;
|
|
1811
|
+
type api_NavigateRequest = NavigateRequest;
|
|
1812
|
+
declare const api_NavigateRequestSchema: typeof NavigateRequestSchema;
|
|
1813
|
+
type api_NavigateResponse = NavigateResponse;
|
|
1814
|
+
declare const api_NavigateResponseSchema: typeof NavigateResponseSchema;
|
|
1815
|
+
type api_NavigateResult = NavigateResult;
|
|
1816
|
+
declare const api_NavigateResultSchema: typeof NavigateResultSchema;
|
|
1817
|
+
declare const api_ObserveOptionsSchema: typeof ObserveOptionsSchema;
|
|
1818
|
+
type api_ObserveRequest = ObserveRequest;
|
|
1819
|
+
declare const api_ObserveRequestSchema: typeof ObserveRequestSchema;
|
|
1820
|
+
type api_ObserveResponse = ObserveResponse;
|
|
1821
|
+
declare const api_ObserveResponseSchema: typeof ObserveResponseSchema;
|
|
1822
|
+
type api_ObserveResult = ObserveResult;
|
|
1823
|
+
declare const api_ObserveResultSchema: typeof ObserveResultSchema;
|
|
1824
|
+
declare const api_Operations: typeof Operations;
|
|
1825
|
+
declare const api_ProxyConfigSchema: typeof ProxyConfigSchema;
|
|
1826
|
+
type api_ReplayAction = ReplayAction;
|
|
1827
|
+
declare const api_ReplayActionSchema: typeof ReplayActionSchema;
|
|
1828
|
+
type api_ReplayPage = ReplayPage;
|
|
1829
|
+
declare const api_ReplayPageSchema: typeof ReplayPageSchema;
|
|
1830
|
+
type api_ReplayResponse = ReplayResponse;
|
|
1831
|
+
declare const api_ReplayResponseSchema: typeof ReplayResponseSchema;
|
|
1832
|
+
type api_ReplayResult = ReplayResult;
|
|
1833
|
+
declare const api_ReplayResultSchema: typeof ReplayResultSchema;
|
|
1834
|
+
declare const api_SessionEndRequestSchema: typeof SessionEndRequestSchema;
|
|
1835
|
+
type api_SessionEndResponse = SessionEndResponse;
|
|
1836
|
+
declare const api_SessionEndResponseSchema: typeof SessionEndResponseSchema;
|
|
1837
|
+
type api_SessionEndResult = SessionEndResult;
|
|
1838
|
+
declare const api_SessionEndResultSchema: typeof SessionEndResultSchema;
|
|
1839
|
+
type api_SessionHeaders = SessionHeaders;
|
|
1840
|
+
declare const api_SessionHeadersSchema: typeof SessionHeadersSchema;
|
|
1841
|
+
type api_SessionIdParams = SessionIdParams;
|
|
1842
|
+
declare const api_SessionIdParamsSchema: typeof SessionIdParamsSchema;
|
|
1843
|
+
type api_SessionStartRequest = SessionStartRequest;
|
|
1844
|
+
declare const api_SessionStartRequestSchema: typeof SessionStartRequestSchema;
|
|
1845
|
+
type api_SessionStartResponse = SessionStartResponse;
|
|
1846
|
+
declare const api_SessionStartResponseSchema: typeof SessionStartResponseSchema;
|
|
1847
|
+
type api_SessionStartResult = SessionStartResult;
|
|
1848
|
+
declare const api_SessionStartResultSchema: typeof SessionStartResultSchema;
|
|
1849
|
+
type api_StreamEvent = StreamEvent;
|
|
1850
|
+
type api_StreamEventLogData = StreamEventLogData;
|
|
1851
|
+
declare const api_StreamEventLogDataSchema: typeof StreamEventLogDataSchema;
|
|
1852
|
+
declare const api_StreamEventSchema: typeof StreamEventSchema;
|
|
1853
|
+
type api_StreamEventStatus = StreamEventStatus;
|
|
1854
|
+
declare const api_StreamEventStatusSchema: typeof StreamEventStatusSchema;
|
|
1855
|
+
type api_StreamEventSystemData = StreamEventSystemData;
|
|
1856
|
+
declare const api_StreamEventSystemDataSchema: typeof StreamEventSystemDataSchema;
|
|
1857
|
+
type api_StreamEventType = StreamEventType;
|
|
1858
|
+
declare const api_StreamEventTypeSchema: typeof StreamEventTypeSchema;
|
|
1859
|
+
type api_TokenUsage = TokenUsage;
|
|
1860
|
+
declare const api_TokenUsageSchema: typeof TokenUsageSchema;
|
|
1861
|
+
declare const api_openApiLinks: typeof openApiLinks;
|
|
1862
|
+
declare const api_openApiSecuritySchemes: typeof openApiSecuritySchemes;
|
|
1863
|
+
declare namespace api {
|
|
1864
|
+
export { api_ActOptionsSchema as ActOptionsSchema, type api_ActRequest as ActRequest, api_ActRequestSchema as ActRequestSchema, type api_ActResponse as ActResponse, api_ActResponseSchema as ActResponseSchema, type ActResult$1 as ActResult, type api_ActResultData as ActResultData, api_ActResultDataSchema as ActResultDataSchema, api_ActResultSchema as ActResultSchema, type Action$1 as Action, api_ActionSchema as ActionSchema, type AgentAction$1 as AgentAction, api_AgentActionSchema as AgentActionSchema, api_AgentCacheEntrySchema as AgentCacheEntrySchema, api_AgentConfigSchema as AgentConfigSchema, api_AgentExecuteOptionsSchema as AgentExecuteOptionsSchema, type api_AgentExecuteRequest as AgentExecuteRequest, api_AgentExecuteRequestSchema as AgentExecuteRequestSchema, type api_AgentExecuteResponse as AgentExecuteResponse, api_AgentExecuteResponseSchema as AgentExecuteResponseSchema, type api_AgentExecuteResult as AgentExecuteResult, api_AgentExecuteResultSchema as AgentExecuteResultSchema, type api_AgentResultData as AgentResultData, api_AgentResultDataSchema as AgentResultDataSchema, type api_AgentUsage as AgentUsage, api_AgentUsageSchema as AgentUsageSchema, type api_BrowserConfig as BrowserConfig, api_BrowserConfigSchema as BrowserConfigSchema, type api_BrowserbaseBrowserSettings as BrowserbaseBrowserSettings, api_BrowserbaseBrowserSettingsSchema as BrowserbaseBrowserSettingsSchema, type api_BrowserbaseContext as BrowserbaseContext, api_BrowserbaseContextSchema as BrowserbaseContextSchema, type api_BrowserbaseFingerprint as BrowserbaseFingerprint, api_BrowserbaseFingerprintSchema as BrowserbaseFingerprintSchema, type api_BrowserbaseFingerprintScreen as BrowserbaseFingerprintScreen, api_BrowserbaseFingerprintScreenSchema as BrowserbaseFingerprintScreenSchema, type api_BrowserbaseProxyConfig as BrowserbaseProxyConfig, api_BrowserbaseProxyConfigSchema as BrowserbaseProxyConfigSchema, type api_BrowserbaseProxyGeolocation as BrowserbaseProxyGeolocation, api_BrowserbaseProxyGeolocationSchema as BrowserbaseProxyGeolocationSchema, type api_BrowserbaseSessionCreateParams as BrowserbaseSessionCreateParams, api_BrowserbaseSessionCreateParamsSchema as BrowserbaseSessionCreateParamsSchema, type api_BrowserbaseViewport as BrowserbaseViewport, api_BrowserbaseViewportSchema as BrowserbaseViewportSchema, api_ErrorResponseSchema as ErrorResponseSchema, type api_ExternalProxyConfig as ExternalProxyConfig, api_ExternalProxyConfigSchema as ExternalProxyConfigSchema, api_ExtractOptionsSchema as ExtractOptionsSchema, type api_ExtractRequest as ExtractRequest, api_ExtractRequestSchema as ExtractRequestSchema, type api_ExtractResponse as ExtractResponse, api_ExtractResponseSchema as ExtractResponseSchema, type ExtractResult$1 as ExtractResult, api_ExtractResultSchema as ExtractResultSchema, api_LocalBrowserLaunchOptionsSchema as LocalBrowserLaunchOptionsSchema, type api_ModelConfig as ModelConfig, api_ModelConfigObjectSchema as ModelConfigObjectSchema, api_ModelConfigSchema as ModelConfigSchema, api_ModelNameSchema as ModelNameSchema, api_NavigateOptionsSchema as NavigateOptionsSchema, type api_NavigateRequest as NavigateRequest, api_NavigateRequestSchema as NavigateRequestSchema, type api_NavigateResponse as NavigateResponse, api_NavigateResponseSchema as NavigateResponseSchema, type api_NavigateResult as NavigateResult, api_NavigateResultSchema as NavigateResultSchema, api_ObserveOptionsSchema as ObserveOptionsSchema, type api_ObserveRequest as ObserveRequest, api_ObserveRequestSchema as ObserveRequestSchema, type api_ObserveResponse as ObserveResponse, api_ObserveResponseSchema as ObserveResponseSchema, type api_ObserveResult as ObserveResult, api_ObserveResultSchema as ObserveResultSchema, api_Operations as Operations, api_ProxyConfigSchema as ProxyConfigSchema, type api_ReplayAction as ReplayAction, api_ReplayActionSchema as ReplayActionSchema, type api_ReplayPage as ReplayPage, api_ReplayPageSchema as ReplayPageSchema, type api_ReplayResponse as ReplayResponse, api_ReplayResponseSchema as ReplayResponseSchema, type api_ReplayResult as ReplayResult, api_ReplayResultSchema as ReplayResultSchema, api_SessionEndRequestSchema as SessionEndRequestSchema, type api_SessionEndResponse as SessionEndResponse, api_SessionEndResponseSchema as SessionEndResponseSchema, type api_SessionEndResult as SessionEndResult, api_SessionEndResultSchema as SessionEndResultSchema, type api_SessionHeaders as SessionHeaders, api_SessionHeadersSchema as SessionHeadersSchema, type api_SessionIdParams as SessionIdParams, api_SessionIdParamsSchema as SessionIdParamsSchema, type api_SessionStartRequest as SessionStartRequest, api_SessionStartRequestSchema as SessionStartRequestSchema, type api_SessionStartResponse as SessionStartResponse, api_SessionStartResponseSchema as SessionStartResponseSchema, type api_SessionStartResult as SessionStartResult, api_SessionStartResultSchema as SessionStartResultSchema, type api_StreamEvent as StreamEvent, type api_StreamEventLogData as StreamEventLogData, api_StreamEventLogDataSchema as StreamEventLogDataSchema, api_StreamEventSchema as StreamEventSchema, type api_StreamEventStatus as StreamEventStatus, api_StreamEventStatusSchema as StreamEventStatusSchema, type api_StreamEventSystemData as StreamEventSystemData, api_StreamEventSystemDataSchema as StreamEventSystemDataSchema, type api_StreamEventType as StreamEventType, api_StreamEventTypeSchema as StreamEventTypeSchema, type api_TokenUsage as TokenUsage, api_TokenUsageSchema as TokenUsageSchema, api_openApiLinks as openApiLinks, api_openApiSecuritySchemes as openApiSecuritySchemes };
|
|
1865
|
+
}
|
|
1866
|
+
|
|
519
1867
|
declare class StagehandAPIError extends Error {
|
|
520
1868
|
constructor(message: string);
|
|
521
1869
|
}
|
|
@@ -614,37 +1962,35 @@ interface StagehandMetrics {
|
|
|
614
1962
|
}
|
|
615
1963
|
|
|
616
1964
|
type V3Env = "LOCAL" | "BROWSERBASE";
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
acceptDownloads?: boolean;
|
|
647
|
-
}
|
|
1965
|
+
declare const localBrowserLaunchOptionsSchema: z.ZodObject<{
|
|
1966
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1967
|
+
executablePath: z.ZodOptional<z.ZodString>;
|
|
1968
|
+
userDataDir: z.ZodOptional<z.ZodString>;
|
|
1969
|
+
preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
|
|
1970
|
+
headless: z.ZodOptional<z.ZodBoolean>;
|
|
1971
|
+
devtools: z.ZodOptional<z.ZodBoolean>;
|
|
1972
|
+
chromiumSandbox: z.ZodOptional<z.ZodBoolean>;
|
|
1973
|
+
ignoreDefaultArgs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
1974
|
+
proxy: z.ZodOptional<z.ZodObject<{
|
|
1975
|
+
server: z.ZodString;
|
|
1976
|
+
bypass: z.ZodOptional<z.ZodString>;
|
|
1977
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1978
|
+
password: z.ZodOptional<z.ZodString>;
|
|
1979
|
+
}, z.core.$strip>>;
|
|
1980
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
1981
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
1982
|
+
width: z.ZodNumber;
|
|
1983
|
+
height: z.ZodNumber;
|
|
1984
|
+
}, z.core.$strip>>;
|
|
1985
|
+
deviceScaleFactor: z.ZodOptional<z.ZodNumber>;
|
|
1986
|
+
hasTouch: z.ZodOptional<z.ZodBoolean>;
|
|
1987
|
+
ignoreHTTPSErrors: z.ZodOptional<z.ZodBoolean>;
|
|
1988
|
+
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
1989
|
+
connectTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1990
|
+
downloadsPath: z.ZodOptional<z.ZodString>;
|
|
1991
|
+
acceptDownloads: z.ZodOptional<z.ZodBoolean>;
|
|
1992
|
+
}, z.core.$strict>;
|
|
1993
|
+
type LocalBrowserLaunchOptions = z.infer<typeof LocalBrowserLaunchOptionsSchema>;
|
|
648
1994
|
/** Constructor options for V3 */
|
|
649
1995
|
interface V3Options {
|
|
650
1996
|
env: V3Env;
|
|
@@ -653,9 +1999,7 @@ interface V3Options {
|
|
|
653
1999
|
/**
|
|
654
2000
|
* Optional: fine-tune Browserbase session creation or resume an existing session.
|
|
655
2001
|
*/
|
|
656
|
-
browserbaseSessionCreateParams?:
|
|
657
|
-
projectId?: string;
|
|
658
|
-
};
|
|
2002
|
+
browserbaseSessionCreateParams?: BrowserbaseSessionCreateParams;
|
|
659
2003
|
browserbaseSessionID?: string;
|
|
660
2004
|
localBrowserLaunchOptions?: LocalBrowserLaunchOptions;
|
|
661
2005
|
model?: ModelConfiguration;
|
|
@@ -665,6 +2009,8 @@ interface V3Options {
|
|
|
665
2009
|
experimental?: boolean;
|
|
666
2010
|
verbose?: 0 | 1 | 2;
|
|
667
2011
|
selfHeal?: boolean;
|
|
2012
|
+
waitForCaptchaSolves?: boolean;
|
|
2013
|
+
actTimeoutMs?: number;
|
|
668
2014
|
/** Disable pino logging backend (useful for tests or minimal environments). */
|
|
669
2015
|
disablePino?: boolean;
|
|
670
2016
|
/** Optional external logger hook for integrating with host apps. */
|
|
@@ -676,7 +2022,8 @@ interface V3Options {
|
|
|
676
2022
|
}
|
|
677
2023
|
|
|
678
2024
|
declare class StagehandError extends Error {
|
|
679
|
-
|
|
2025
|
+
readonly cause?: unknown;
|
|
2026
|
+
constructor(message: string, cause?: unknown);
|
|
680
2027
|
}
|
|
681
2028
|
declare class StagehandDefaultError extends StagehandError {
|
|
682
2029
|
constructor(error?: unknown);
|
|
@@ -816,6 +2163,12 @@ declare class AgentAbortError extends StagehandError {
|
|
|
816
2163
|
readonly reason: string;
|
|
817
2164
|
constructor(reason?: string);
|
|
818
2165
|
}
|
|
2166
|
+
declare class StagehandClosedError extends StagehandError {
|
|
2167
|
+
constructor();
|
|
2168
|
+
}
|
|
2169
|
+
declare class StagehandSnapshotError extends StagehandError {
|
|
2170
|
+
constructor(cause?: unknown);
|
|
2171
|
+
}
|
|
819
2172
|
|
|
820
2173
|
declare class AISdkClient extends LLMClient {
|
|
821
2174
|
type: "aisdk";
|
|
@@ -826,135 +2179,85 @@ declare class AISdkClient extends LLMClient {
|
|
|
826
2179
|
createChatCompletion<T = ChatCompletion>({ options, }: CreateChatCompletionOptions): Promise<T>;
|
|
827
2180
|
}
|
|
828
2181
|
|
|
2182
|
+
/**
|
|
2183
|
+
* Constructor parameters for StagehandAPIClient
|
|
2184
|
+
*/
|
|
829
2185
|
interface StagehandAPIConstructorParams {
|
|
830
2186
|
apiKey: string;
|
|
831
2187
|
projectId: string;
|
|
832
2188
|
logger: (message: LogLine) => void;
|
|
833
2189
|
}
|
|
834
|
-
|
|
835
|
-
|
|
2190
|
+
/**
|
|
2191
|
+
* Parameters for starting a session via the API client.
|
|
2192
|
+
* Extends Api.SessionStartRequest with client-specific field (modelApiKey).
|
|
2193
|
+
*
|
|
2194
|
+
* Wire format: Api.SessionStartRequest (modelApiKey sent via header, not body)
|
|
2195
|
+
*/
|
|
2196
|
+
interface ClientSessionStartParams extends SessionStartRequest {
|
|
2197
|
+
/** Model API key - sent via x-model-api-key header, not in request body */
|
|
836
2198
|
modelApiKey: string;
|
|
837
|
-
domSettleTimeoutMs: number;
|
|
838
|
-
verbose: number;
|
|
839
|
-
systemPrompt?: string;
|
|
840
|
-
browserbaseSessionCreateParams?: Omit<Browserbase.Sessions.SessionCreateParams, "projectId"> & {
|
|
841
|
-
projectId?: string;
|
|
842
|
-
};
|
|
843
|
-
selfHeal?: boolean;
|
|
844
|
-
browserbaseSessionID?: string;
|
|
845
|
-
}
|
|
846
|
-
interface StartSessionResult {
|
|
847
|
-
sessionId: string;
|
|
848
|
-
available?: boolean;
|
|
849
2199
|
}
|
|
850
|
-
|
|
851
|
-
|
|
2200
|
+
/**
|
|
2201
|
+
* Client parameters for act() method.
|
|
2202
|
+
* Derives structure from Api.ActRequest but uses SDK's ActOptions (which includes `page`).
|
|
2203
|
+
* Before serialization, `page` is stripped to produce Api.ActRequest wire format.
|
|
2204
|
+
*/
|
|
2205
|
+
interface ClientActParameters {
|
|
2206
|
+
input: ActRequest["input"];
|
|
852
2207
|
options?: ActOptions;
|
|
853
|
-
frameId?:
|
|
2208
|
+
frameId?: ActRequest["frameId"];
|
|
854
2209
|
}
|
|
855
|
-
interface APIExtractParameters {
|
|
856
|
-
instruction?: string;
|
|
857
|
-
schema?: StagehandZodSchema;
|
|
858
|
-
options?: ExtractOptions;
|
|
859
|
-
frameId?: string;
|
|
860
|
-
}
|
|
861
|
-
interface APIObserveParameters {
|
|
862
|
-
instruction?: string;
|
|
863
|
-
options?: ObserveOptions;
|
|
864
|
-
frameId?: string;
|
|
865
|
-
}
|
|
866
|
-
interface SerializableResponse {
|
|
867
|
-
requestId: string;
|
|
868
|
-
frameId?: string;
|
|
869
|
-
loaderId?: string;
|
|
870
|
-
response: Protocol.Network.Response;
|
|
871
|
-
fromServiceWorkerFlag?: boolean;
|
|
872
|
-
finishedSettled?: boolean;
|
|
873
|
-
extraInfoHeaders?: Protocol.Network.Headers | null;
|
|
874
|
-
extraInfoHeadersText?: string;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
2210
|
/**
|
|
878
|
-
*
|
|
879
|
-
*
|
|
880
|
-
*
|
|
881
|
-
* - **String** segments indicate object property names.
|
|
882
|
-
* - **Number** segments indicate array indices.
|
|
883
|
-
*
|
|
884
|
-
* For example, `["users", 0, "homepage"]` might describe reaching
|
|
885
|
-
* the `homepage` field in `schema.users[0].homepage`.
|
|
2211
|
+
* Client parameters for extract() method.
|
|
2212
|
+
* Derives structure from Api.ExtractRequest but uses SDK's ExtractOptions (which includes `page`)
|
|
2213
|
+
* and accepts Zod schema (converted to JSON schema for wire format).
|
|
886
2214
|
*/
|
|
887
|
-
interface
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
segments: Array<string | number>;
|
|
2215
|
+
interface ClientExtractParameters {
|
|
2216
|
+
instruction?: ExtractRequest["instruction"];
|
|
2217
|
+
schema?: StagehandZodSchema;
|
|
2218
|
+
options?: ExtractOptions;
|
|
2219
|
+
frameId?: ExtractRequest["frameId"];
|
|
893
2220
|
}
|
|
894
|
-
type InitScriptSource<Arg> = string | {
|
|
895
|
-
path?: string;
|
|
896
|
-
content?: string;
|
|
897
|
-
} | ((arg: Arg) => unknown);
|
|
898
|
-
|
|
899
|
-
type EvaluateOptions = {
|
|
900
|
-
/** The question to ask about the task state */
|
|
901
|
-
question: string;
|
|
902
|
-
/** The answer to the question */
|
|
903
|
-
answer?: string;
|
|
904
|
-
/** Whether to take a screenshot of the task state, or array of screenshots to evaluate */
|
|
905
|
-
screenshot?: boolean | Buffer[];
|
|
906
|
-
/** Custom system prompt for the evaluator */
|
|
907
|
-
systemPrompt?: string;
|
|
908
|
-
/** Delay in milliseconds before taking the screenshot @default 250 */
|
|
909
|
-
screenshotDelayMs?: number;
|
|
910
|
-
/** The agent's reasoning/thought process for completing the task */
|
|
911
|
-
agentReasoning?: string;
|
|
912
|
-
};
|
|
913
|
-
type BatchAskOptions = {
|
|
914
|
-
/** Array of questions with optional answers */
|
|
915
|
-
questions: Array<{
|
|
916
|
-
question: string;
|
|
917
|
-
answer?: string;
|
|
918
|
-
}>;
|
|
919
|
-
/** Whether to take a screenshot of the task state */
|
|
920
|
-
screenshot?: boolean;
|
|
921
|
-
/** Custom system prompt for the evaluator */
|
|
922
|
-
systemPrompt?: string;
|
|
923
|
-
/** Delay in milliseconds before taking the screenshot @default 1000 */
|
|
924
|
-
screenshotDelayMs?: number;
|
|
925
|
-
};
|
|
926
2221
|
/**
|
|
927
|
-
*
|
|
2222
|
+
* Client parameters for observe() method.
|
|
2223
|
+
* Derives structure from Api.ObserveRequest but uses SDK's ObserveOptions (which includes `page`).
|
|
2224
|
+
* Before serialization, `page` is stripped to produce Api.ObserveRequest wire format.
|
|
928
2225
|
*/
|
|
929
|
-
interface
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
evaluation: "YES" | "NO" | "INVALID";
|
|
934
|
-
/**
|
|
935
|
-
* The reasoning behind the evaluation
|
|
936
|
-
*/
|
|
937
|
-
reasoning: string;
|
|
2226
|
+
interface ClientObserveParameters {
|
|
2227
|
+
instruction?: ObserveRequest["instruction"];
|
|
2228
|
+
options?: ObserveOptions;
|
|
2229
|
+
frameId?: ObserveRequest["frameId"];
|
|
938
2230
|
}
|
|
939
|
-
|
|
940
2231
|
declare class StagehandAPIClient {
|
|
941
2232
|
private apiKey;
|
|
942
2233
|
private projectId;
|
|
943
2234
|
private sessionId?;
|
|
944
2235
|
private modelApiKey;
|
|
2236
|
+
private modelProvider?;
|
|
945
2237
|
private logger;
|
|
946
2238
|
private fetchWithCookies;
|
|
2239
|
+
private lastFinishedEventData;
|
|
2240
|
+
private latestAgentCacheEntry;
|
|
947
2241
|
constructor({ apiKey, projectId, logger }: StagehandAPIConstructorParams);
|
|
948
|
-
init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }:
|
|
949
|
-
act({ input, options, frameId }:
|
|
950
|
-
extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }:
|
|
951
|
-
observe({ instruction, options, frameId, }:
|
|
952
|
-
goto(url: string, options?:
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
|
|
2242
|
+
init({ modelName, modelApiKey, domSettleTimeoutMs, verbose, systemPrompt, selfHeal, browserbaseSessionCreateParams, browserbaseSessionID, }: ClientSessionStartParams): Promise<SessionStartResult>;
|
|
2243
|
+
act({ input, options, frameId, }: ClientActParameters): Promise<ActResult>;
|
|
2244
|
+
extract<T extends StagehandZodSchema>({ instruction, schema: zodSchema, options, frameId, }: ClientExtractParameters): Promise<ExtractResult<T>>;
|
|
2245
|
+
observe({ instruction, options, frameId, }: ClientObserveParameters): Promise<Action[]>;
|
|
2246
|
+
goto(url: string, options?: NavigateRequest["options"], frameId?: string): Promise<SerializableResponse | null>;
|
|
2247
|
+
agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string, shouldCache?: boolean): Promise<AgentResult>;
|
|
2248
|
+
consumeLatestAgentCacheEntry(): AgentCacheTransferPayload | null;
|
|
956
2249
|
end(): Promise<Response>;
|
|
957
2250
|
getReplayMetrics(): Promise<StagehandMetrics>;
|
|
2251
|
+
/**
|
|
2252
|
+
* Prepares a model configuration for the API payload by ensuring the `apiKey`
|
|
2253
|
+
* is included. If the model is passed as a string, converts it to an object
|
|
2254
|
+
* with `modelName` and `apiKey`.
|
|
2255
|
+
*
|
|
2256
|
+
* In API mode, we only attempt to load an API key from env vars when the
|
|
2257
|
+
* model provider differs from the one used to init the session.
|
|
2258
|
+
*/
|
|
2259
|
+
private prepareModelConfig;
|
|
2260
|
+
private consumeFinishedEventData;
|
|
958
2261
|
private execute;
|
|
959
2262
|
private request;
|
|
960
2263
|
}
|
|
@@ -1086,7 +2389,11 @@ declare class V3Context {
|
|
|
1086
2389
|
awaitActivePage(timeoutMs?: number): Promise<Page>;
|
|
1087
2390
|
}
|
|
1088
2391
|
|
|
1089
|
-
type
|
|
2392
|
+
type AgentCacheTransferPayload = {
|
|
2393
|
+
cacheKey: string;
|
|
2394
|
+
entry: CachedAgentEntry;
|
|
2395
|
+
};
|
|
2396
|
+
type AgentReplayStep = AgentReplayActStep | AgentReplayFillFormStep | AgentReplayGotoStep | AgentReplayScrollStep | AgentReplayWaitStep | AgentReplayNavBackStep | AgentReplayKeysStep | {
|
|
1090
2397
|
type: string;
|
|
1091
2398
|
[key: string]: unknown;
|
|
1092
2399
|
};
|
|
@@ -1129,6 +2436,30 @@ interface AgentReplayNavBackStep {
|
|
|
1129
2436
|
type: "navback";
|
|
1130
2437
|
waitUntil?: LoadState;
|
|
1131
2438
|
}
|
|
2439
|
+
interface AgentReplayKeysStep {
|
|
2440
|
+
type: "keys";
|
|
2441
|
+
instruction?: string;
|
|
2442
|
+
playwrightArguments: {
|
|
2443
|
+
method: "type" | "press";
|
|
2444
|
+
text?: string;
|
|
2445
|
+
keys?: string;
|
|
2446
|
+
times?: number;
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
interface SanitizedAgentExecuteOptions {
|
|
2450
|
+
maxSteps?: number;
|
|
2451
|
+
highlightCursor?: boolean;
|
|
2452
|
+
}
|
|
2453
|
+
interface CachedAgentEntry {
|
|
2454
|
+
version: 1;
|
|
2455
|
+
instruction: string;
|
|
2456
|
+
startUrl: string;
|
|
2457
|
+
options: SanitizedAgentExecuteOptions;
|
|
2458
|
+
configSignature: string;
|
|
2459
|
+
steps: AgentReplayStep[];
|
|
2460
|
+
result: AgentResult;
|
|
2461
|
+
timestamp: string;
|
|
2462
|
+
}
|
|
1132
2463
|
|
|
1133
2464
|
/**
|
|
1134
2465
|
* Response
|
|
@@ -1266,6 +2597,12 @@ type AnyPage = Page$1 | Page$2 | Page$3 | Page;
|
|
|
1266
2597
|
|
|
1267
2598
|
type LoadState = "load" | "domcontentloaded" | "networkidle";
|
|
1268
2599
|
|
|
2600
|
+
type SnapshotResult = {
|
|
2601
|
+
formattedTree: string;
|
|
2602
|
+
xpathMap: Record<string, string>;
|
|
2603
|
+
urlMap: Record<string, string>;
|
|
2604
|
+
};
|
|
2605
|
+
|
|
1269
2606
|
type ScreenshotAnimationsOption = "disabled" | "allow";
|
|
1270
2607
|
type ScreenshotCaretOption = "hide" | "initial";
|
|
1271
2608
|
type ScreenshotScaleOption = "css" | "device";
|
|
@@ -1508,6 +2845,30 @@ declare class Page {
|
|
|
1508
2845
|
* Mirrors Playwright's API signatures.
|
|
1509
2846
|
*/
|
|
1510
2847
|
waitForLoadState(state: LoadState, timeoutMs?: number): Promise<void>;
|
|
2848
|
+
/**
|
|
2849
|
+
* Wait for a specified amount of time.
|
|
2850
|
+
*
|
|
2851
|
+
* @param ms The number of milliseconds to wait.
|
|
2852
|
+
*/
|
|
2853
|
+
waitForTimeout(ms: number): Promise<void>;
|
|
2854
|
+
/**
|
|
2855
|
+
* Wait for an element matching the selector to appear in the DOM.
|
|
2856
|
+
* Uses MutationObserver for efficiency
|
|
2857
|
+
* Pierces shadow DOM by default.
|
|
2858
|
+
* Supports iframe hop notation with '>>' (e.g., 'iframe#checkout >> .submit-btn').
|
|
2859
|
+
*
|
|
2860
|
+
* @param selector CSS selector to wait for (supports '>>' for iframe hops)
|
|
2861
|
+
* @param options.state Element state to wait for: 'attached' | 'detached' | 'visible' | 'hidden' (default: 'visible')
|
|
2862
|
+
* @param options.timeout Maximum time to wait in milliseconds (default: 30000)
|
|
2863
|
+
* @param options.pierceShadow Whether to search inside shadow DOM (default: true)
|
|
2864
|
+
* @returns True when the condition is met
|
|
2865
|
+
* @throws Error if timeout is reached before the condition is met
|
|
2866
|
+
*/
|
|
2867
|
+
waitForSelector(selector: string, options?: {
|
|
2868
|
+
state?: "attached" | "detached" | "visible" | "hidden";
|
|
2869
|
+
timeout?: number;
|
|
2870
|
+
pierceShadow?: boolean;
|
|
2871
|
+
}): Promise<boolean>;
|
|
1511
2872
|
/**
|
|
1512
2873
|
* Evaluate a function or expression in the current main frame's main world.
|
|
1513
2874
|
* - If a string is provided, it is treated as a JS expression.
|
|
@@ -1529,52 +2890,32 @@ declare class Page {
|
|
|
1529
2890
|
* on the top-level page target's session. Coordinates are relative to the
|
|
1530
2891
|
* viewport origin (top-left). Does not scroll.
|
|
1531
2892
|
*/
|
|
1532
|
-
click(x: number, y: number, options: {
|
|
1533
|
-
button?: "left" | "right" | "middle";
|
|
1534
|
-
clickCount?: number;
|
|
1535
|
-
returnXpath: true;
|
|
1536
|
-
}): Promise<string>;
|
|
1537
2893
|
click(x: number, y: number, options?: {
|
|
1538
2894
|
button?: "left" | "right" | "middle";
|
|
1539
2895
|
clickCount?: number;
|
|
1540
|
-
returnXpath?:
|
|
1541
|
-
}): Promise<
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
returnXpath
|
|
2896
|
+
returnXpath?: boolean;
|
|
2897
|
+
}): Promise<string>;
|
|
2898
|
+
/**
|
|
2899
|
+
* Hover at absolute page coordinates (CSS pixels).
|
|
2900
|
+
* Dispatches mouseMoved via CDP Input domain on the top-level page target's
|
|
2901
|
+
* session.
|
|
2902
|
+
*/
|
|
2903
|
+
hover(x: number, y: number, options?: {
|
|
2904
|
+
returnXpath?: boolean;
|
|
1549
2905
|
}): Promise<string>;
|
|
1550
2906
|
scroll(x: number, y: number, deltaX: number, deltaY: number, options?: {
|
|
1551
|
-
returnXpath?:
|
|
1552
|
-
}): Promise<
|
|
1553
|
-
scroll(x: number, y: number, deltaX: number, deltaY: number, options: {
|
|
1554
|
-
returnXpath: boolean;
|
|
1555
|
-
}): Promise<void | string>;
|
|
2907
|
+
returnXpath?: boolean;
|
|
2908
|
+
}): Promise<string>;
|
|
1556
2909
|
/**
|
|
1557
2910
|
* Drag from (fromX, fromY) to (toX, toY) using mouse events.
|
|
1558
2911
|
* Sends mouseMoved → mousePressed → mouseMoved (steps) → mouseReleased.
|
|
1559
2912
|
*/
|
|
1560
|
-
dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options: {
|
|
1561
|
-
button?: "left" | "right" | "middle";
|
|
1562
|
-
steps?: number;
|
|
1563
|
-
delay?: number;
|
|
1564
|
-
returnXpath: true;
|
|
1565
|
-
}): Promise<[string, string]>;
|
|
1566
2913
|
dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options?: {
|
|
1567
2914
|
button?: "left" | "right" | "middle";
|
|
1568
2915
|
steps?: number;
|
|
1569
2916
|
delay?: number;
|
|
1570
|
-
returnXpath?:
|
|
1571
|
-
}): Promise<
|
|
1572
|
-
dragAndDrop(fromX: number, fromY: number, toX: number, toY: number, options: {
|
|
1573
|
-
button?: "left" | "right" | "middle";
|
|
1574
|
-
steps?: number;
|
|
1575
|
-
delay?: number;
|
|
1576
|
-
returnXpath: boolean;
|
|
1577
|
-
}): Promise<void | [string, string]>;
|
|
2917
|
+
returnXpath?: boolean;
|
|
2918
|
+
}): Promise<[string, string]>;
|
|
1578
2919
|
/**
|
|
1579
2920
|
* Type a string by dispatching keyDown/keyUp events per character.
|
|
1580
2921
|
* Focus must already be on the desired element. Uses CDP Input.dispatchKeyEvent
|
|
@@ -1593,12 +2934,13 @@ declare class Page {
|
|
|
1593
2934
|
keyPress(key: string, options?: {
|
|
1594
2935
|
delay?: number;
|
|
1595
2936
|
}): Promise<void>;
|
|
2937
|
+
snapshot(): Promise<SnapshotResult>;
|
|
1596
2938
|
private _pressedModifiers;
|
|
1597
2939
|
/** Press a key down without releasing it */
|
|
1598
2940
|
private keyDown;
|
|
1599
2941
|
/** Release a pressed key */
|
|
1600
2942
|
private keyUp;
|
|
1601
|
-
/** Normalize
|
|
2943
|
+
/** Normalize key names to match CDP expectations */
|
|
1602
2944
|
private normalizeModifierKey;
|
|
1603
2945
|
/**
|
|
1604
2946
|
* Get the map of named keys with their properties
|
|
@@ -1672,6 +3014,12 @@ interface AgentResult {
|
|
|
1672
3014
|
* @experimental
|
|
1673
3015
|
*/
|
|
1674
3016
|
messages?: ModelMessage[];
|
|
3017
|
+
/**
|
|
3018
|
+
* Custom output data extracted based on the `output` schema provided in execute options.
|
|
3019
|
+
* Only populated if an `output` schema was provided.
|
|
3020
|
+
* @experimental
|
|
3021
|
+
*/
|
|
3022
|
+
output?: Record<string, unknown>;
|
|
1675
3023
|
}
|
|
1676
3024
|
type AgentStreamResult = StreamTextResult<ToolSet, never> & {
|
|
1677
3025
|
result: Promise<AgentResult>;
|
|
@@ -1697,6 +3045,11 @@ interface AgentCallbacks {
|
|
|
1697
3045
|
* This provides a clear error message when users try to use streaming callbacks without stream: true.
|
|
1698
3046
|
*/
|
|
1699
3047
|
type StreamingCallbackNotAvailable = "This callback requires 'stream: true' in AgentConfig. Set stream: true to use streaming callbacks like onChunk, onFinish, onError, and onAbort.";
|
|
3048
|
+
/**
|
|
3049
|
+
* Error message for safety confirmation callback misuse.
|
|
3050
|
+
* Safety confirmations are only available for non-streaming CUA agent executions.
|
|
3051
|
+
*/
|
|
3052
|
+
type SafetyConfirmationCallbackNotAvailable = "Safety confirmation callbacks are only available via non-streaming AgentExecuteOptions.callbacks when using mode: 'cua'.";
|
|
1700
3053
|
/**
|
|
1701
3054
|
* Callbacks specific to the non-streaming execute method.
|
|
1702
3055
|
*/
|
|
@@ -1705,6 +3058,11 @@ interface AgentExecuteCallbacks extends AgentCallbacks {
|
|
|
1705
3058
|
* Callback called when each step (LLM call) is finished.
|
|
1706
3059
|
*/
|
|
1707
3060
|
onStepFinish?: GenerateTextOnStepFinishCallback<ToolSet>;
|
|
3061
|
+
/**
|
|
3062
|
+
* Callback for handling safety confirmation requests from CUA providers.
|
|
3063
|
+
* Only available when running an agent configured with mode: "cua".
|
|
3064
|
+
*/
|
|
3065
|
+
onSafetyConfirmation?: SafetyConfirmationHandler;
|
|
1708
3066
|
/**
|
|
1709
3067
|
* NOT AVAILABLE in non-streaming mode.
|
|
1710
3068
|
* This callback requires `stream: true` in AgentConfig.
|
|
@@ -1794,6 +3152,11 @@ interface AgentStreamCallbacks extends AgentCallbacks {
|
|
|
1794
3152
|
onAbort?: (event: {
|
|
1795
3153
|
steps: Array<StepResult<ToolSet>>;
|
|
1796
3154
|
}) => PromiseLike<void> | void;
|
|
3155
|
+
/**
|
|
3156
|
+
* NOT AVAILABLE in streaming mode.
|
|
3157
|
+
* Safety confirmations currently require non-streaming execute() on CUA agents.
|
|
3158
|
+
*/
|
|
3159
|
+
onSafetyConfirmation?: SafetyConfirmationCallbackNotAvailable;
|
|
1797
3160
|
}
|
|
1798
3161
|
/**
|
|
1799
3162
|
* Base options for agent execution (without callbacks).
|
|
@@ -1826,6 +3189,79 @@ interface AgentExecuteOptionsBase {
|
|
|
1826
3189
|
* ```
|
|
1827
3190
|
*/
|
|
1828
3191
|
signal?: AbortSignal;
|
|
3192
|
+
/**
|
|
3193
|
+
* Tools to exclude from this execution.
|
|
3194
|
+
* Pass an array of tool names to prevent the agent from using those tools.
|
|
3195
|
+
*
|
|
3196
|
+
* **Note:** Not supported in CUA mode (`mode: "cua"`).
|
|
3197
|
+
*
|
|
3198
|
+
* **Available tools by mode:**
|
|
3199
|
+
*
|
|
3200
|
+
* **DOM mode (default):**
|
|
3201
|
+
* - `act` - Perform semantic actions (click, type, etc.)
|
|
3202
|
+
* - `fillForm` - Fill form fields using DOM selectors
|
|
3203
|
+
* - `ariaTree` - Get accessibility tree of the page
|
|
3204
|
+
* - `extract` - Extract structured data from page
|
|
3205
|
+
* - `goto` - Navigate to a URL
|
|
3206
|
+
* - `scroll` - Scroll using semantic directions (up/down/left/right)
|
|
3207
|
+
* - `keys` - Press keyboard keys
|
|
3208
|
+
* - `navback` - Navigate back in history
|
|
3209
|
+
* - `screenshot` - Take a screenshot
|
|
3210
|
+
* - `think` - Agent reasoning/planning step
|
|
3211
|
+
* - `wait` - Wait for time or condition
|
|
3212
|
+
* - `close` - Mark task as complete
|
|
3213
|
+
* - `search` - Web search (requires BRAVE_API_KEY)
|
|
3214
|
+
*
|
|
3215
|
+
* **Hybrid mode:**
|
|
3216
|
+
* - `click` - Click at specific coordinates
|
|
3217
|
+
* - `type` - Type text at coordinates
|
|
3218
|
+
* - `dragAndDrop` - Drag from one point to another
|
|
3219
|
+
* - `clickAndHold` - Click and hold at coordinates
|
|
3220
|
+
* - `fillFormVision` - Fill forms using vision/coordinates
|
|
3221
|
+
* - `act` - Perform semantic actions
|
|
3222
|
+
* - `ariaTree` - Get accessibility tree
|
|
3223
|
+
* - `extract` - Extract data from page
|
|
3224
|
+
* - `goto` - Navigate to URL
|
|
3225
|
+
* - `scroll` - Scroll using coordinates
|
|
3226
|
+
* - `keys` - Press keyboard keys
|
|
3227
|
+
* - `navback` - Navigate back
|
|
3228
|
+
* - `screenshot` - Take screenshot
|
|
3229
|
+
* - `think` - Agent reasoning step
|
|
3230
|
+
* - `wait` - Wait for time/condition
|
|
3231
|
+
* - `close` - Mark task complete
|
|
3232
|
+
* - `search` - Web search (requires BRAVE_API_KEY)
|
|
3233
|
+
*
|
|
3234
|
+
* @experimental
|
|
3235
|
+
* @example
|
|
3236
|
+
* ```typescript
|
|
3237
|
+
* // Exclude screenshot and extract tools
|
|
3238
|
+
* const result = await agent.execute({
|
|
3239
|
+
* instruction: "Click the submit button",
|
|
3240
|
+
* excludeTools: ["screenshot", "extract"]
|
|
3241
|
+
* });
|
|
3242
|
+
* ```
|
|
3243
|
+
*/
|
|
3244
|
+
excludeTools?: string[];
|
|
3245
|
+
/**
|
|
3246
|
+
* A Zod schema defining custom output data to return when the task completes.
|
|
3247
|
+
* The agent will populate this data in the final close tool call.
|
|
3248
|
+
*
|
|
3249
|
+
* @experimental
|
|
3250
|
+
* @example
|
|
3251
|
+
* ```typescript
|
|
3252
|
+
* const result = await agent.execute({
|
|
3253
|
+
* instruction: "Find the cheapest flight from NYC to LA",
|
|
3254
|
+
* output: z.object({
|
|
3255
|
+
* price: z.string().describe("The price of the flight"),
|
|
3256
|
+
* airline: z.string().describe("The airline name"),
|
|
3257
|
+
* departureTime: z.string().describe("Departure time"),
|
|
3258
|
+
* }),
|
|
3259
|
+
* });
|
|
3260
|
+
*
|
|
3261
|
+
* console.log(result.output); // { price: "$199", airline: "Delta", departureTime: "8:00 AM" }
|
|
3262
|
+
* ```
|
|
3263
|
+
*/
|
|
3264
|
+
output?: StagehandZodObject;
|
|
1829
3265
|
}
|
|
1830
3266
|
/**
|
|
1831
3267
|
* Options for non-streaming agent execution.
|
|
@@ -1868,6 +3304,52 @@ interface ActionExecutionResult {
|
|
|
1868
3304
|
error?: string;
|
|
1869
3305
|
data?: unknown;
|
|
1870
3306
|
}
|
|
3307
|
+
/**
|
|
3308
|
+
* Represents a safety check that requires user confirmation before proceeding.
|
|
3309
|
+
* These are issued by CUA providers (OpenAI, Google) when the agent attempts
|
|
3310
|
+
* potentially risky actions.
|
|
3311
|
+
*/
|
|
3312
|
+
interface SafetyCheck {
|
|
3313
|
+
/** Unique identifier for this safety check */
|
|
3314
|
+
id: string;
|
|
3315
|
+
/** Code identifying the type of safety concern */
|
|
3316
|
+
code: string;
|
|
3317
|
+
/** Human-readable description of the safety concern */
|
|
3318
|
+
message: string;
|
|
3319
|
+
}
|
|
3320
|
+
/**
|
|
3321
|
+
* Response from the user for a safety confirmation request.
|
|
3322
|
+
*/
|
|
3323
|
+
interface SafetyConfirmationResponse {
|
|
3324
|
+
/** Whether the user acknowledged/approved the safety checks */
|
|
3325
|
+
acknowledged: boolean;
|
|
3326
|
+
}
|
|
3327
|
+
/**
|
|
3328
|
+
* Callback for handling safety confirmation requests.
|
|
3329
|
+
* Called when the CUA provider issues safety checks that require user confirmation.
|
|
3330
|
+
* The callback should return a promise that resolves when the user has made a decision.
|
|
3331
|
+
*
|
|
3332
|
+
* @param safetyChecks - Array of safety checks requiring confirmation
|
|
3333
|
+
* @returns Promise resolving to the user's response
|
|
3334
|
+
*
|
|
3335
|
+
* @example
|
|
3336
|
+
* ```typescript
|
|
3337
|
+
* const agent = stagehand.agent({
|
|
3338
|
+
* mode: "cua",
|
|
3339
|
+
* });
|
|
3340
|
+
* await agent.execute({
|
|
3341
|
+
* instruction: "...",
|
|
3342
|
+
* callbacks: {
|
|
3343
|
+
* onSafetyConfirmation: async (checks) => {
|
|
3344
|
+
* console.log("Safety checks:", checks);
|
|
3345
|
+
* const userApproved = await showConfirmationDialog(checks);
|
|
3346
|
+
* return { acknowledged: userApproved };
|
|
3347
|
+
* },
|
|
3348
|
+
* },
|
|
3349
|
+
* });
|
|
3350
|
+
* ```
|
|
3351
|
+
*/
|
|
3352
|
+
type SafetyConfirmationHandler = (safetyChecks: SafetyCheck[]) => Promise<SafetyConfirmationResponse>;
|
|
1871
3353
|
interface ToolUseItem extends ResponseItem {
|
|
1872
3354
|
type: "tool_use";
|
|
1873
3355
|
id: string;
|
|
@@ -1945,6 +3427,13 @@ type AgentProviderType = AgentType;
|
|
|
1945
3427
|
type AgentModelConfig<TModelName extends string = string> = {
|
|
1946
3428
|
modelName: TModelName;
|
|
1947
3429
|
} & Record<string, unknown>;
|
|
3430
|
+
/**
|
|
3431
|
+
* Agent tool mode determines which set of tools are available to the agent.
|
|
3432
|
+
* - 'dom': Uses DOM-based tools (act, fillForm) - better for structured page interactions
|
|
3433
|
+
* - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - better for visual/screenshot-based interactions
|
|
3434
|
+
* - 'cua': Uses Computer Use Agent (CUA) providers like Anthropic Claude or Google Gemini for screenshot-based automation
|
|
3435
|
+
*/
|
|
3436
|
+
type AgentToolMode = "dom" | "hybrid" | "cua";
|
|
1948
3437
|
type AgentConfig = {
|
|
1949
3438
|
/**
|
|
1950
3439
|
* Custom system prompt to provide to the agent. Overrides the default system prompt.
|
|
@@ -1959,7 +3448,8 @@ type AgentConfig = {
|
|
|
1959
3448
|
*/
|
|
1960
3449
|
tools?: ToolSet;
|
|
1961
3450
|
/**
|
|
1962
|
-
*
|
|
3451
|
+
* @deprecated Use `mode: "cua"` instead. This option will be removed in a future version.
|
|
3452
|
+
* Enables Computer Use Agent (CUA) mode.
|
|
1963
3453
|
*/
|
|
1964
3454
|
cua?: boolean;
|
|
1965
3455
|
/**
|
|
@@ -1978,6 +3468,14 @@ type AgentConfig = {
|
|
|
1978
3468
|
* When false (default), execute() returns AgentResult after completion.
|
|
1979
3469
|
*/
|
|
1980
3470
|
stream?: boolean;
|
|
3471
|
+
/**
|
|
3472
|
+
* Tool mode for the agent. Determines which set of tools are available.
|
|
3473
|
+
* - 'dom' (default): Uses DOM-based tools (act, fillForm) for structured interactions
|
|
3474
|
+
* - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, clickAndHold, fillFormVision)
|
|
3475
|
+
* for visual/screenshot-based interactions
|
|
3476
|
+
* - 'cua': Uses Computer Use Agent (CUA) providers for screenshot-based automation
|
|
3477
|
+
*/
|
|
3478
|
+
mode?: AgentToolMode;
|
|
1981
3479
|
};
|
|
1982
3480
|
/**
|
|
1983
3481
|
* Agent instance returned when stream: true is set in AgentConfig.
|
|
@@ -1995,6 +3493,63 @@ interface StreamingAgentInstance {
|
|
|
1995
3493
|
interface NonStreamingAgentInstance {
|
|
1996
3494
|
execute: (instructionOrOptions: string | AgentExecuteOptions) => Promise<AgentResult>;
|
|
1997
3495
|
}
|
|
3496
|
+
/**
|
|
3497
|
+
* Content item type for toModelOutput return values.
|
|
3498
|
+
* Used in tool definitions to return text and/or media to the model.
|
|
3499
|
+
*/
|
|
3500
|
+
type ModelOutputContentItem = {
|
|
3501
|
+
type: "text";
|
|
3502
|
+
text: string;
|
|
3503
|
+
} | {
|
|
3504
|
+
type: "media";
|
|
3505
|
+
mediaType: string;
|
|
3506
|
+
data: string;
|
|
3507
|
+
};
|
|
3508
|
+
interface ClickToolResult {
|
|
3509
|
+
success: boolean;
|
|
3510
|
+
describe?: string;
|
|
3511
|
+
coordinates?: number[];
|
|
3512
|
+
error?: string;
|
|
3513
|
+
screenshotBase64?: string;
|
|
3514
|
+
}
|
|
3515
|
+
interface TypeToolResult {
|
|
3516
|
+
success: boolean;
|
|
3517
|
+
describe?: string;
|
|
3518
|
+
text?: string;
|
|
3519
|
+
error?: string;
|
|
3520
|
+
screenshotBase64?: string;
|
|
3521
|
+
}
|
|
3522
|
+
interface DragAndDropToolResult {
|
|
3523
|
+
success: boolean;
|
|
3524
|
+
describe?: string;
|
|
3525
|
+
error?: string;
|
|
3526
|
+
screenshotBase64?: string;
|
|
3527
|
+
}
|
|
3528
|
+
interface FillFormField {
|
|
3529
|
+
action: string;
|
|
3530
|
+
value: string;
|
|
3531
|
+
coordinates: {
|
|
3532
|
+
x: number;
|
|
3533
|
+
y: number;
|
|
3534
|
+
};
|
|
3535
|
+
}
|
|
3536
|
+
interface FillFormVisionToolResult {
|
|
3537
|
+
success: boolean;
|
|
3538
|
+
playwrightArguments?: FillFormField[];
|
|
3539
|
+
error?: string;
|
|
3540
|
+
screenshotBase64?: string;
|
|
3541
|
+
}
|
|
3542
|
+
interface ScrollVisionToolResult {
|
|
3543
|
+
success: boolean;
|
|
3544
|
+
message: string;
|
|
3545
|
+
scrolledPixels: number;
|
|
3546
|
+
screenshotBase64?: string;
|
|
3547
|
+
}
|
|
3548
|
+
interface WaitToolResult {
|
|
3549
|
+
success: boolean;
|
|
3550
|
+
waited: number;
|
|
3551
|
+
screenshotBase64?: string;
|
|
3552
|
+
}
|
|
1998
3553
|
|
|
1999
3554
|
type OpenAIClientOptions = Pick<ClientOptions$1, "baseURL" | "apiKey">;
|
|
2000
3555
|
type AnthropicClientOptions = Pick<ClientOptions$2, "baseURL" | "apiKey">;
|
|
@@ -2196,6 +3751,11 @@ declare class V3 {
|
|
|
2196
3751
|
private observeHandler;
|
|
2197
3752
|
private ctx;
|
|
2198
3753
|
llmClient: LLMClient;
|
|
3754
|
+
/**
|
|
3755
|
+
* Event bus for internal communication.
|
|
3756
|
+
* Emits events like 'screenshot' when screenshots are captured during agent execution.
|
|
3757
|
+
*/
|
|
3758
|
+
readonly bus: EventEmitter;
|
|
2199
3759
|
private modelName;
|
|
2200
3760
|
private modelClientOptions;
|
|
2201
3761
|
private llmProvider;
|
|
@@ -2208,6 +3768,10 @@ declare class V3 {
|
|
|
2208
3768
|
get browserbaseSessionID(): string | undefined;
|
|
2209
3769
|
get browserbaseSessionURL(): string | undefined;
|
|
2210
3770
|
get browserbaseDebugURL(): string | undefined;
|
|
3771
|
+
/**
|
|
3772
|
+
* Returns true if the browser is running on Browserbase.
|
|
3773
|
+
*/
|
|
3774
|
+
get isBrowserbase(): boolean;
|
|
2211
3775
|
private _onCdpClosed;
|
|
2212
3776
|
readonly experimental: boolean;
|
|
2213
3777
|
readonly logInferenceToFile: boolean;
|
|
@@ -2366,6 +3930,259 @@ declare class AgentProvider {
|
|
|
2366
3930
|
static getAgentProvider(modelName: string): AgentProviderType;
|
|
2367
3931
|
}
|
|
2368
3932
|
|
|
3933
|
+
declare const gotoTool: (v3: V3) => ai.Tool<{
|
|
3934
|
+
url: string;
|
|
3935
|
+
}, {
|
|
3936
|
+
success: boolean;
|
|
3937
|
+
url: string;
|
|
3938
|
+
error?: undefined;
|
|
3939
|
+
} | {
|
|
3940
|
+
success: boolean;
|
|
3941
|
+
error: any;
|
|
3942
|
+
url?: undefined;
|
|
3943
|
+
}>;
|
|
3944
|
+
|
|
3945
|
+
declare const actTool: (v3: V3, executionModel?: string) => ai.Tool<{
|
|
3946
|
+
action: string;
|
|
3947
|
+
}, {
|
|
3948
|
+
success: boolean;
|
|
3949
|
+
action: string;
|
|
3950
|
+
playwrightArguments: Action;
|
|
3951
|
+
error?: undefined;
|
|
3952
|
+
} | {
|
|
3953
|
+
success: boolean;
|
|
3954
|
+
error: any;
|
|
3955
|
+
action?: undefined;
|
|
3956
|
+
playwrightArguments?: undefined;
|
|
3957
|
+
}>;
|
|
3958
|
+
|
|
3959
|
+
declare const screenshotTool: (v3: V3) => ai.Tool<Record<string, never>, {
|
|
3960
|
+
base64: string;
|
|
3961
|
+
timestamp: number;
|
|
3962
|
+
pageUrl: string;
|
|
3963
|
+
}>;
|
|
3964
|
+
|
|
3965
|
+
declare const waitTool: (v3: V3, mode?: AgentToolMode) => ai.Tool<{
|
|
3966
|
+
timeMs: number;
|
|
3967
|
+
}, WaitToolResult>;
|
|
3968
|
+
|
|
3969
|
+
declare const navBackTool: (v3: V3) => ai.Tool<{
|
|
3970
|
+
reasoningText: string;
|
|
3971
|
+
}, {
|
|
3972
|
+
success: boolean;
|
|
3973
|
+
}>;
|
|
3974
|
+
|
|
3975
|
+
declare const ariaTreeTool: (v3: V3) => ai.Tool<Record<string, never>, {
|
|
3976
|
+
content: string;
|
|
3977
|
+
pageUrl: string;
|
|
3978
|
+
}>;
|
|
3979
|
+
|
|
3980
|
+
declare const fillFormTool: (v3: V3, executionModel?: string) => ai.Tool<{
|
|
3981
|
+
fields: {
|
|
3982
|
+
action: string;
|
|
3983
|
+
value: string;
|
|
3984
|
+
}[];
|
|
3985
|
+
}, {
|
|
3986
|
+
success: boolean;
|
|
3987
|
+
actions: unknown[];
|
|
3988
|
+
playwrightArguments: Action[];
|
|
3989
|
+
}>;
|
|
3990
|
+
|
|
3991
|
+
/**
|
|
3992
|
+
* Simple scroll tool for DOM mode (non-grounding models).
|
|
3993
|
+
* No coordinates - scrolls from viewport center.
|
|
3994
|
+
*/
|
|
3995
|
+
declare const scrollTool: (v3: V3) => ai.Tool<{
|
|
3996
|
+
direction: "up" | "down";
|
|
3997
|
+
percentage?: number;
|
|
3998
|
+
}, {
|
|
3999
|
+
success: boolean;
|
|
4000
|
+
message: string;
|
|
4001
|
+
scrolledPixels: number;
|
|
4002
|
+
}>;
|
|
4003
|
+
/**
|
|
4004
|
+
* Scroll tool for hybrid mode (grounding models).
|
|
4005
|
+
* Supports optional coordinates for scrolling within nested scrollable elements.
|
|
4006
|
+
*/
|
|
4007
|
+
declare const scrollVisionTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4008
|
+
direction: "up" | "down";
|
|
4009
|
+
coordinates?: number[];
|
|
4010
|
+
percentage?: number;
|
|
4011
|
+
}, ScrollVisionToolResult>;
|
|
4012
|
+
|
|
4013
|
+
declare const extractTool: (v3: V3, executionModel?: string, logger?: (message: LogLine) => void) => ai.Tool<{
|
|
4014
|
+
instruction: string;
|
|
4015
|
+
schema?: string;
|
|
4016
|
+
}, {
|
|
4017
|
+
success: boolean;
|
|
4018
|
+
result: any;
|
|
4019
|
+
error?: undefined;
|
|
4020
|
+
} | {
|
|
4021
|
+
success: boolean;
|
|
4022
|
+
error: any;
|
|
4023
|
+
result?: undefined;
|
|
4024
|
+
}>;
|
|
4025
|
+
|
|
4026
|
+
declare const clickTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4027
|
+
describe: string;
|
|
4028
|
+
coordinates: number[];
|
|
4029
|
+
}, ClickToolResult>;
|
|
4030
|
+
|
|
4031
|
+
declare const typeTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4032
|
+
describe: string;
|
|
4033
|
+
text: string;
|
|
4034
|
+
coordinates: number[];
|
|
4035
|
+
}, TypeToolResult>;
|
|
4036
|
+
|
|
4037
|
+
declare const dragAndDropTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4038
|
+
describe: string;
|
|
4039
|
+
startCoordinates: number[];
|
|
4040
|
+
endCoordinates: number[];
|
|
4041
|
+
}, DragAndDropToolResult>;
|
|
4042
|
+
|
|
4043
|
+
declare const clickAndHoldTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4044
|
+
describe: string;
|
|
4045
|
+
duration: number;
|
|
4046
|
+
coordinates: number[];
|
|
4047
|
+
}, {
|
|
4048
|
+
success: boolean;
|
|
4049
|
+
describe: string;
|
|
4050
|
+
error?: undefined;
|
|
4051
|
+
} | {
|
|
4052
|
+
success: boolean;
|
|
4053
|
+
error: string;
|
|
4054
|
+
describe?: undefined;
|
|
4055
|
+
}>;
|
|
4056
|
+
|
|
4057
|
+
declare const keysTool: (v3: V3) => ai.Tool<{
|
|
4058
|
+
method: "type" | "press";
|
|
4059
|
+
value: string;
|
|
4060
|
+
repeat?: number;
|
|
4061
|
+
}, {
|
|
4062
|
+
success: boolean;
|
|
4063
|
+
method: "type";
|
|
4064
|
+
value: string;
|
|
4065
|
+
times: number;
|
|
4066
|
+
error?: undefined;
|
|
4067
|
+
} | {
|
|
4068
|
+
success: boolean;
|
|
4069
|
+
method: "press";
|
|
4070
|
+
value: string;
|
|
4071
|
+
times: number;
|
|
4072
|
+
error?: undefined;
|
|
4073
|
+
} | {
|
|
4074
|
+
success: boolean;
|
|
4075
|
+
error: string;
|
|
4076
|
+
method?: undefined;
|
|
4077
|
+
value?: undefined;
|
|
4078
|
+
times?: undefined;
|
|
4079
|
+
}>;
|
|
4080
|
+
|
|
4081
|
+
declare const fillFormVisionTool: (v3: V3, provider?: string) => ai.Tool<{
|
|
4082
|
+
fields: {
|
|
4083
|
+
action: string;
|
|
4084
|
+
value: string;
|
|
4085
|
+
coordinates: {
|
|
4086
|
+
x: number;
|
|
4087
|
+
y: number;
|
|
4088
|
+
};
|
|
4089
|
+
}[];
|
|
4090
|
+
}, FillFormVisionToolResult>;
|
|
4091
|
+
|
|
4092
|
+
declare const thinkTool: () => ai.Tool<{
|
|
4093
|
+
reasoning: string;
|
|
4094
|
+
}, {
|
|
4095
|
+
acknowledged: boolean;
|
|
4096
|
+
message: string;
|
|
4097
|
+
}>;
|
|
4098
|
+
|
|
4099
|
+
interface BraveSearchResult {
|
|
4100
|
+
title: string;
|
|
4101
|
+
url: string;
|
|
4102
|
+
description?: string;
|
|
4103
|
+
}
|
|
4104
|
+
declare const searchTool: (v3: V3) => ai.Tool<{
|
|
4105
|
+
query: string;
|
|
4106
|
+
}, {
|
|
4107
|
+
timestamp: number;
|
|
4108
|
+
data?: {
|
|
4109
|
+
results: BraveSearchResult[];
|
|
4110
|
+
};
|
|
4111
|
+
error?: string;
|
|
4112
|
+
}>;
|
|
4113
|
+
|
|
4114
|
+
interface V3AgentToolOptions {
|
|
4115
|
+
executionModel?: string;
|
|
4116
|
+
logger?: (message: LogLine) => void;
|
|
4117
|
+
/**
|
|
4118
|
+
* Tool mode determines which set of tools are available.
|
|
4119
|
+
* - 'dom' (default): Uses DOM-based tools (act, fillForm) - removes coordinate-based tools
|
|
4120
|
+
* - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - removes fillForm
|
|
4121
|
+
*/
|
|
4122
|
+
mode?: AgentToolMode;
|
|
4123
|
+
/**
|
|
4124
|
+
* The model provider. Used for model-specific coordinate handling
|
|
4125
|
+
*/
|
|
4126
|
+
provider?: string;
|
|
4127
|
+
/**
|
|
4128
|
+
* Tools to exclude from the available toolset.
|
|
4129
|
+
* These tools will be filtered out after mode-based filtering.
|
|
4130
|
+
*/
|
|
4131
|
+
excludeTools?: string[];
|
|
4132
|
+
}
|
|
4133
|
+
declare function createAgentTools(v3: V3, options?: V3AgentToolOptions): ToolSet;
|
|
4134
|
+
type AgentTools = ReturnType<typeof createAgentTools>;
|
|
4135
|
+
/**
|
|
4136
|
+
* Type map of all agent tools for strong typing of tool calls and results.
|
|
4137
|
+
* Note: `search` is optional as it's only available when BRAVE_API_KEY is configured.
|
|
4138
|
+
*/
|
|
4139
|
+
type AgentToolTypesMap = {
|
|
4140
|
+
act: ReturnType<typeof actTool>;
|
|
4141
|
+
ariaTree: ReturnType<typeof ariaTreeTool>;
|
|
4142
|
+
click: ReturnType<typeof clickTool>;
|
|
4143
|
+
clickAndHold: ReturnType<typeof clickAndHoldTool>;
|
|
4144
|
+
dragAndDrop: ReturnType<typeof dragAndDropTool>;
|
|
4145
|
+
extract: ReturnType<typeof extractTool>;
|
|
4146
|
+
fillForm: ReturnType<typeof fillFormTool>;
|
|
4147
|
+
fillFormVision: ReturnType<typeof fillFormVisionTool>;
|
|
4148
|
+
goto: ReturnType<typeof gotoTool>;
|
|
4149
|
+
keys: ReturnType<typeof keysTool>;
|
|
4150
|
+
navback: ReturnType<typeof navBackTool>;
|
|
4151
|
+
screenshot: ReturnType<typeof screenshotTool>;
|
|
4152
|
+
scroll: ReturnType<typeof scrollTool> | ReturnType<typeof scrollVisionTool>;
|
|
4153
|
+
search?: ReturnType<typeof searchTool>;
|
|
4154
|
+
think: ReturnType<typeof thinkTool>;
|
|
4155
|
+
type: ReturnType<typeof typeTool>;
|
|
4156
|
+
wait: ReturnType<typeof waitTool>;
|
|
4157
|
+
};
|
|
4158
|
+
/**
|
|
4159
|
+
* Inferred UI tools type for type-safe tool inputs and outputs.
|
|
4160
|
+
* Use with UIMessage for full type safety in UI contexts.
|
|
4161
|
+
*/
|
|
4162
|
+
type AgentUITools = InferUITools<AgentToolTypesMap>;
|
|
4163
|
+
/**
|
|
4164
|
+
* Union type for all possible agent tool calls.
|
|
4165
|
+
* Provides type-safe access to tool call arguments.
|
|
4166
|
+
*/
|
|
4167
|
+
type AgentToolCall = {
|
|
4168
|
+
[K in keyof AgentToolTypesMap]: {
|
|
4169
|
+
toolName: K;
|
|
4170
|
+
toolCallId: string;
|
|
4171
|
+
args: AgentUITools[K]["input"];
|
|
4172
|
+
};
|
|
4173
|
+
}[keyof AgentToolTypesMap];
|
|
4174
|
+
/**
|
|
4175
|
+
* Union type for all possible agent tool results.
|
|
4176
|
+
* Provides type-safe access to tool result values.
|
|
4177
|
+
*/
|
|
4178
|
+
type AgentToolResult = {
|
|
4179
|
+
[K in keyof AgentToolTypesMap]: {
|
|
4180
|
+
toolName: K;
|
|
4181
|
+
toolCallId: string;
|
|
4182
|
+
result: AgentUITools[K]["output"];
|
|
4183
|
+
};
|
|
4184
|
+
}[keyof AgentToolTypesMap];
|
|
4185
|
+
|
|
2369
4186
|
declare function validateZodSchema(schema: StagehandZodSchema, data: unknown): boolean;
|
|
2370
4187
|
/**
|
|
2371
4188
|
* Detects if the code is running in the Bun runtime environment.
|
|
@@ -2457,4 +4274,10 @@ declare class V3Evaluator {
|
|
|
2457
4274
|
private _evaluateWithMultipleScreenshots;
|
|
2458
4275
|
}
|
|
2459
4276
|
|
|
2460
|
-
|
|
4277
|
+
interface ServerAgentCacheHandle {
|
|
4278
|
+
complete(): AgentCacheTransferPayload | null;
|
|
4279
|
+
discard(): void;
|
|
4280
|
+
}
|
|
4281
|
+
declare function __internalCreateInMemoryAgentCacheHandle(stagehand: V3): ServerAgentCacheHandle;
|
|
4282
|
+
|
|
4283
|
+
export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, ActTimeoutError, type Action, type ActionExecutionResult, AgentAbortError, type AgentAction, type AgentCallbacks, type AgentConfig, type AgentContext, type AgentExecuteCallbacks, type AgentExecuteOptions, type AgentExecuteOptionsBase, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentState, type AgentStreamCallbacks, type AgentStreamExecuteOptions, type AgentStreamResult, type AgentToolCall, type AgentToolMode, type AgentToolResult, type AgentToolTypesMap, type AgentTools, type AgentType, type AgentUITools, AnnotatedScreenshotText, type AnthropicClientOptions, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, api as Api, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClickToolResult, type ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, type DragAndDropToolResult, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, ExtractTimeoutError, type FillFormField, type FillFormVisionToolResult, type FunctionCallItem, type GoogleServiceAccountCredentials, type GoogleVertexProviderSettings, HandlerNotInitializedError, type HistoryEntry, type InferStagehandSchema, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaDocument, type JsonSchemaProperty, LLMClient, type LLMParsedResponse, type LLMResponse, LLMResponseError, type LLMTool, type LLMUsage, LOG_LEVEL_NAMES, type LoadState, type LocalBrowserLaunchOptions, type LogLevel, type LogLine, type Logger, MCPConnectionError, MissingEnvironmentVariableError, MissingLLMConfigurationError, type ModelConfiguration, type ModelOutputContentItem, type ModelProvider, type NonStreamingAgentInstance, type ObserveOptions, ObserveTimeoutError, type OpenAIClientOptions, Page, PageNotFoundError, Response$1 as Response, ResponseBodyError, type ResponseInputItem, type ResponseItem, ResponseParseError, type SafetyCheck, type SafetyConfirmationHandler, type SafetyConfirmationResponse, type ScrollVisionToolResult, type ServerAgentCacheHandle, type SnapshotResult, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandClosedError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, StagehandSnapshotError, type StagehandZodObject, type StagehandZodSchema, type StreamingAgentInstance, StreamingCallbacksInNonStreamingModeError, TimeoutError, type ToolUseItem, type TypeToolResult, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, type WaitToolResult, XPathResolutionError, ZodSchemaValidationError, __internalCreateInMemoryAgentCacheHandle, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, isZod3Schema, isZod4Schema, jsonSchemaToZod, loadApiKeyFromEnv, localBrowserLaunchOptionsSchema, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, toJsonSchema, transformSchema, trimTrailingTextNode, validateZodSchema };
|