@browserbasehq/orca 3.0.0-preview.1 → 3.0.0-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/index.d.ts +759 -593
  2. package/dist/index.js +25560 -24375
  3. package/package.json +35 -74
  4. package/README.md +0 -165
  5. package/dist/lib/StagehandContext.d.ts +0 -25
  6. package/dist/lib/StagehandPage.d.ts +0 -103
  7. package/dist/lib/a11y/utils.d.ts +0 -144
  8. package/dist/lib/agent/AgentClient.d.ts +0 -20
  9. package/dist/lib/agent/AgentProvider.d.ts +0 -19
  10. package/dist/lib/agent/AnthropicCUAClient.d.ts +0 -56
  11. package/dist/lib/agent/GoogleCUAClient.d.ts +0 -63
  12. package/dist/lib/agent/OpenAICUAClient.d.ts +0 -65
  13. package/dist/lib/agent/StagehandAgent.d.ts +0 -15
  14. package/dist/lib/agent/tools/act.d.ts +0 -59
  15. package/dist/lib/agent/tools/ariaTree.d.ts +0 -11
  16. package/dist/lib/agent/tools/close.d.ts +0 -22
  17. package/dist/lib/agent/tools/extract.d.ts +0 -38
  18. package/dist/lib/agent/tools/fillform.d.ts +0 -37
  19. package/dist/lib/agent/tools/goto.d.ts +0 -29
  20. package/dist/lib/agent/tools/index.d.ts +0 -257
  21. package/dist/lib/agent/tools/navback.d.ts +0 -17
  22. package/dist/lib/agent/tools/screenshot.d.ts +0 -13
  23. package/dist/lib/agent/tools/scroll.d.ts +0 -23
  24. package/dist/lib/agent/tools/wait.d.ts +0 -18
  25. package/dist/lib/agent/utils/cuaKeyMapping.d.ts +0 -10
  26. package/dist/lib/agent/utils/imageCompression.d.ts +0 -53
  27. package/dist/lib/agent/utils/messageProcessing.d.ts +0 -13
  28. package/dist/lib/api.d.ts +0 -23
  29. package/dist/lib/browserbaseDefaults.d.ts +0 -9
  30. package/dist/lib/cache/ActionCache.d.ts +0 -62
  31. package/dist/lib/cache/BaseCache.d.ts +0 -66
  32. package/dist/lib/cache/LLMCache.d.ts +0 -22
  33. package/dist/lib/cache.d.ts +0 -29
  34. package/dist/lib/dom/build/scriptContent.d.ts +0 -1
  35. package/dist/lib/dom/elementCheckUtils.d.ts +0 -2
  36. package/dist/lib/dom/genDomScripts.d.ts +0 -1
  37. package/dist/lib/dom/index.d.ts +0 -2
  38. package/dist/lib/dom/process.d.ts +0 -17
  39. package/dist/lib/dom/utils.d.ts +0 -7
  40. package/dist/lib/dom/xpathUtils.d.ts +0 -14
  41. package/dist/lib/handlers/actHandler.d.ts +0 -33
  42. package/dist/lib/handlers/cuaAgentHandler.d.ts +0 -58
  43. package/dist/lib/handlers/extractHandler.d.ts +0 -54
  44. package/dist/lib/handlers/handlerUtils/actHandlerUtils.d.ts +0 -21
  45. package/dist/lib/handlers/observeHandler.d.ts +0 -40
  46. package/dist/lib/handlers/stagehandAgentHandler.d.ts +0 -27
  47. package/dist/lib/index.d.ts +0 -94
  48. package/dist/lib/inference.d.ts +0 -71
  49. package/dist/lib/inferenceLogUtils.d.ts +0 -12
  50. package/dist/lib/llm/AnthropicClient.d.ts +0 -21
  51. package/dist/lib/llm/CerebrasClient.d.ts +0 -22
  52. package/dist/lib/llm/GoogleClient.d.ts +0 -24
  53. package/dist/lib/llm/GroqClient.d.ts +0 -22
  54. package/dist/lib/llm/LLMClient.d.ts +0 -99
  55. package/dist/lib/llm/LLMProvider.d.ts +0 -13
  56. package/dist/lib/llm/OpenAIClient.d.ts +0 -20
  57. package/dist/lib/llm/aisdk.d.ts +0 -20
  58. package/dist/lib/logger.d.ts +0 -54
  59. package/dist/lib/mcp/connection.d.ts +0 -11
  60. package/dist/lib/mcp/utils.d.ts +0 -3
  61. package/dist/lib/prompt.d.ts +0 -12
  62. package/dist/lib/utils.d.ts +0 -65
  63. package/dist/lib/v3/agent/AgentClient.d.ts +0 -18
  64. package/dist/lib/v3/agent/AgentProvider.d.ts +0 -18
  65. package/dist/lib/v3/agent/AnthropicCUAClient.d.ts +0 -55
  66. package/dist/lib/v3/agent/OpenAICUAClient.d.ts +0 -64
  67. package/dist/lib/v3/agent/StagehandAgent.d.ts +0 -15
  68. package/dist/lib/v3/agent/tools/index.d.ts +0 -229
  69. package/dist/lib/v3/agent/tools/v3-act.d.ts +0 -29
  70. package/dist/lib/v3/agent/tools/v3-ariaTree.d.ts +0 -11
  71. package/dist/lib/v3/agent/tools/v3-close.d.ts +0 -24
  72. package/dist/lib/v3/agent/tools/v3-extract.d.ts +0 -38
  73. package/dist/lib/v3/agent/tools/v3-fillform.d.ts +0 -37
  74. package/dist/lib/v3/agent/tools/v3-goto.d.ts +0 -29
  75. package/dist/lib/v3/agent/tools/v3-navback.d.ts +0 -17
  76. package/dist/lib/v3/agent/tools/v3-screenshot.d.ts +0 -13
  77. package/dist/lib/v3/agent/tools/v3-scroll.d.ts +0 -23
  78. package/dist/lib/v3/agent/tools/v3-wait.d.ts +0 -19
  79. package/dist/lib/v3/agent/utils/cuaKeyMapping.d.ts +0 -10
  80. package/dist/lib/v3/agent/utils/imageCompression.d.ts +0 -18
  81. package/dist/lib/v3/agent/utils/messageProcessing.d.ts +0 -13
  82. package/dist/lib/v3/dom/build/scriptV3Content.d.ts +0 -1
  83. package/dist/lib/v3/dom/genDomScripts.d.ts +0 -1
  84. package/dist/lib/v3/dom/index.d.ts +0 -1
  85. package/dist/lib/v3/dom/piercer.entry.d.ts +0 -1
  86. package/dist/lib/v3/dom/piercer.runtime.d.ts +0 -25
  87. package/dist/lib/v3/handlers/actHandler.d.ts +0 -18
  88. package/dist/lib/v3/handlers/extractHandler.d.ts +0 -29
  89. package/dist/lib/v3/handlers/handlerUtils/actHandlerUtils.d.ts +0 -18
  90. package/dist/lib/v3/handlers/observeHandler.d.ts +0 -15
  91. package/dist/lib/v3/handlers/v3AgentHandler.d.ts +0 -17
  92. package/dist/lib/v3/handlers/v3CuaAgentHandler.d.ts +0 -26
  93. package/dist/lib/v3/index.d.ts +0 -10
  94. package/dist/lib/v3/launch/browserbase.d.ts +0 -8
  95. package/dist/lib/v3/launch/local.d.ts +0 -13
  96. package/dist/lib/v3/llm/AnthropicClient.d.ts +0 -16
  97. package/dist/lib/v3/llm/CerebrasClient.d.ts +0 -17
  98. package/dist/lib/v3/llm/GoogleClient.d.ts +0 -19
  99. package/dist/lib/v3/llm/GroqClient.d.ts +0 -17
  100. package/dist/lib/v3/llm/LLMClient.d.ts +0 -99
  101. package/dist/lib/v3/llm/LLMProvider.d.ts +0 -10
  102. package/dist/lib/v3/llm/OpenAIClient.d.ts +0 -15
  103. package/dist/lib/v3/llm/aisdk.d.ts +0 -15
  104. package/dist/lib/v3/logger.d.ts +0 -48
  105. package/dist/lib/v3/mcp/connection.d.ts +0 -11
  106. package/dist/lib/v3/mcp/utils.d.ts +0 -3
  107. package/dist/lib/v3/tests/default-page-tracking.spec.d.ts +0 -1
  108. package/dist/lib/v3/tests/downloads.spec.d.ts +0 -1
  109. package/dist/lib/v3/tests/perform-understudy-method.spec.d.ts +0 -1
  110. package/dist/lib/v3/tests/shadow-iframe.spec.d.ts +0 -1
  111. package/dist/lib/v3/tests/timeouts.spec.d.ts +0 -1
  112. package/dist/lib/v3/tests/v3.bb.config.d.ts +0 -4
  113. package/dist/lib/v3/tests/v3.config.d.ts +0 -4
  114. package/dist/lib/v3/tests/v3.playwright.config.d.ts +0 -2
  115. package/dist/lib/v3/tests/xpath-for-location-deep.spec.d.ts +0 -1
  116. package/dist/lib/v3/types/act.d.ts +0 -10
  117. package/dist/lib/v3/types/agent.d.ts +0 -132
  118. package/dist/lib/v3/types/api.d.ts +0 -40
  119. package/dist/lib/v3/types/cache.d.ts +0 -71
  120. package/dist/lib/v3/types/context.d.ts +0 -2
  121. package/dist/lib/v3/types/evals.d.ts +0 -71
  122. package/dist/lib/v3/types/evaluator.d.ts +0 -40
  123. package/dist/lib/v3/types/llm.d.ts +0 -11
  124. package/dist/lib/v3/types/log.d.ts +0 -23
  125. package/dist/lib/v3/types/model.d.ts +0 -20
  126. package/dist/lib/v3/types/playwright.d.ts +0 -6
  127. package/dist/lib/v3/types/stagehand.d.ts +0 -113
  128. package/dist/lib/v3/types/stagehandApiErrors.d.ts +0 -18
  129. package/dist/lib/v3/types/stagehandErrors.d.ts +0 -104
  130. package/dist/lib/v3/types.d.ts +0 -176
  131. package/dist/lib/v3/understudy/a11y/snapshot.d.ts +0 -71
  132. package/dist/lib/v3/understudy/cdp.d.ts +0 -58
  133. package/dist/lib/v3/understudy/context.d.ts +0 -120
  134. package/dist/lib/v3/understudy/deepLocator.d.ts +0 -69
  135. package/dist/lib/v3/understudy/executionContextRegistry.d.ts +0 -15
  136. package/dist/lib/v3/understudy/frame.d.ts +0 -63
  137. package/dist/lib/v3/understudy/frameLocator.d.ts +0 -46
  138. package/dist/lib/v3/understudy/frameRegistry.d.ts +0 -100
  139. package/dist/lib/v3/understudy/locator.d.ts +0 -196
  140. package/dist/lib/v3/understudy/page.d.ts +0 -241
  141. package/dist/lib/v3/understudy/piercer.d.ts +0 -4
  142. package/dist/lib/v3/v3.d.ts +0 -158
  143. package/dist/lib/version.d.ts +0 -5
  144. package/dist/stagehand.config.d.ts +0 -3
  145. package/dist/types/act.d.ts +0 -50
  146. package/dist/types/agent.d.ts +0 -143
  147. package/dist/types/api.d.ts +0 -40
  148. package/dist/types/browser.d.ts +0 -10
  149. package/dist/types/context.d.ts +0 -117
  150. package/dist/types/evals.d.ts +0 -94
  151. package/dist/types/evaluator.d.ts +0 -40
  152. package/dist/types/llm.d.ts +0 -11
  153. package/dist/types/log.d.ts +0 -23
  154. package/dist/types/model.d.ts +0 -17
  155. package/dist/types/page.d.ts +0 -38
  156. package/dist/types/playwright.d.ts +0 -12
  157. package/dist/types/stagehand.d.ts +0 -330
  158. package/dist/types/stagehandApiErrors.d.ts +0 -18
  159. package/dist/types/stagehandErrors.d.ts +0 -104
@@ -1,56 +0,0 @@
1
- import { AgentAction, AgentExecutionOptions, AgentResult, AgentType, AnthropicContentBlock, AnthropicMessage, AnthropicToolResult, ToolUseItem } from "@/types/agent";
2
- import { LogLine } from "@/types/log";
3
- import { ToolSet } from "ai";
4
- import { AgentClient } from "./AgentClient";
5
- export type ResponseInputItem = AnthropicMessage | AnthropicToolResult;
6
- /**
7
- * Client for Anthropic's Computer Use API
8
- * This implementation uses the official Anthropic Messages API for Computer Use
9
- */
10
- export declare class AnthropicCUAClient extends AgentClient {
11
- private apiKey;
12
- private baseURL?;
13
- private client;
14
- lastMessageId?: string;
15
- private currentViewport;
16
- private currentUrl?;
17
- private screenshotProvider?;
18
- private actionHandler?;
19
- private thinkingBudget;
20
- private tools?;
21
- constructor(type: AgentType, modelName: string, userProvidedInstructions?: string, clientOptions?: Record<string, unknown>, tools?: ToolSet);
22
- setViewport(width: number, height: number): void;
23
- setCurrentUrl(url: string): void;
24
- setScreenshotProvider(provider: () => Promise<string>): void;
25
- setActionHandler(handler: (action: AgentAction) => Promise<void>): void;
26
- setTools(tools: ToolSet): void;
27
- /**
28
- * Execute a task with the Anthropic CUA
29
- * This is the main entry point for the agent
30
- * @implements AgentClient.execute
31
- */
32
- execute(executionOptions: AgentExecutionOptions): Promise<AgentResult>;
33
- executeStep(inputItems: ResponseInputItem[], logger: (message: LogLine) => void): Promise<{
34
- actions: AgentAction[];
35
- message: string;
36
- completed: boolean;
37
- nextInputItems: ResponseInputItem[];
38
- usage: {
39
- input_tokens: number;
40
- output_tokens: number;
41
- inference_time_ms: number;
42
- };
43
- }>;
44
- private createInitialInputItems;
45
- getAction(inputItems: ResponseInputItem[]): Promise<{
46
- content: AnthropicContentBlock[];
47
- id: string;
48
- usage: Record<string, number>;
49
- }>;
50
- takeAction(toolUseItems: ToolUseItem[], logger: (message: LogLine) => void): Promise<AnthropicToolResult[]>;
51
- private convertToolUseToAction;
52
- captureScreenshot(options?: {
53
- base64Image?: string;
54
- currentUrl?: string;
55
- }): Promise<string>;
56
- }
@@ -1,63 +0,0 @@
1
- import { LogLine } from "../../types/log";
2
- import { AgentAction, AgentResult, AgentType, AgentExecutionOptions } from "@/types/agent";
3
- import { AgentClient } from "./AgentClient";
4
- /**
5
- * Client for Google's Computer Use Assistant API
6
- * This implementation uses the Google Generative AI SDK for Computer Use
7
- */
8
- export declare class GoogleCUAClient extends AgentClient {
9
- private apiKey;
10
- private client;
11
- private currentViewport;
12
- private currentUrl?;
13
- private screenshotProvider?;
14
- private actionHandler?;
15
- private history;
16
- private environment;
17
- private generateContentConfig;
18
- constructor(type: AgentType, modelName: string, userProvidedInstructions?: string, clientOptions?: Record<string, unknown>);
19
- setViewport(width: number, height: number): void;
20
- setCurrentUrl(url: string): void;
21
- setScreenshotProvider(provider: () => Promise<string>): void;
22
- setActionHandler(handler: (action: AgentAction) => Promise<void>): void;
23
- setTools(): void;
24
- /**
25
- * Execute a task with the Google CUA
26
- * This is the main entry point for the agent
27
- * @implements AgentClient.execute
28
- */
29
- execute(executionOptions: AgentExecutionOptions): Promise<AgentResult>;
30
- /**
31
- * Initialize conversation history with the initial instruction
32
- */
33
- private initializeHistory;
34
- /**
35
- * Execute a single step of the agent
36
- */
37
- executeStep(logger: (message: LogLine) => void): Promise<{
38
- actions: AgentAction[];
39
- message: string;
40
- completed: boolean;
41
- usage: {
42
- input_tokens: number;
43
- output_tokens: number;
44
- inference_time_ms: number;
45
- };
46
- }>;
47
- /**
48
- * Process the response from Google's API
49
- */
50
- private processResponse;
51
- /**
52
- * Convert Google function call to Stagehand action
53
- */
54
- private convertFunctionCallToAction;
55
- /**
56
- * Normalize coordinates from Google's 0-1000 range to actual viewport dimensions
57
- */
58
- private normalizeCoordinates;
59
- captureScreenshot(options?: {
60
- base64Image?: string;
61
- currentUrl?: string;
62
- }): Promise<string>;
63
- }
@@ -1,65 +0,0 @@
1
- import { LogLine } from "../../types/log";
2
- import { AgentAction, AgentResult, AgentType, AgentExecutionOptions, ResponseInputItem, ResponseItem } from "@/types/agent";
3
- import { AgentClient } from "./AgentClient";
4
- import { ToolSet } from "ai/dist";
5
- /**
6
- * Client for OpenAI's Computer Use Assistant API
7
- * This implementation uses the official OpenAI Responses API for Computer Use
8
- */
9
- export declare class OpenAICUAClient extends AgentClient {
10
- private apiKey;
11
- private organization?;
12
- private baseURL;
13
- private client;
14
- lastResponseId?: string;
15
- private currentViewport;
16
- private currentUrl?;
17
- private screenshotProvider?;
18
- private actionHandler?;
19
- private reasoningItems;
20
- private environment;
21
- private tools?;
22
- constructor(type: AgentType, modelName: string, userProvidedInstructions?: string, clientOptions?: Record<string, unknown>, tools?: ToolSet);
23
- setViewport(width: number, height: number): void;
24
- setCurrentUrl(url: string): void;
25
- setScreenshotProvider(provider: () => Promise<string>): void;
26
- setActionHandler(handler: (action: AgentAction) => Promise<void>): void;
27
- setTools(tools: ToolSet): void;
28
- /**
29
- * Execute a task with the OpenAI CUA
30
- * This is the main entry point for the agent
31
- * @implements AgentClient.execute
32
- */
33
- execute(executionOptions: AgentExecutionOptions): Promise<AgentResult>;
34
- /**
35
- * Execute a single step of the agent
36
- * This coordinates the flow: Request → Get Action → Execute Action
37
- */
38
- executeStep(inputItems: ResponseInputItem[], previousResponseId: string | undefined, logger: (message: LogLine) => void): Promise<{
39
- actions: AgentAction[];
40
- message: string;
41
- completed: boolean;
42
- nextInputItems: ResponseInputItem[];
43
- responseId: string;
44
- usage: {
45
- input_tokens: number;
46
- output_tokens: number;
47
- inference_time_ms: number;
48
- };
49
- }>;
50
- private isComputerCallItem;
51
- private isFunctionCallItem;
52
- private createInitialInputItems;
53
- getAction(inputItems: ResponseInputItem[], previousResponseId?: string): Promise<{
54
- output: ResponseItem[];
55
- responseId: string;
56
- usage: Record<string, number>;
57
- }>;
58
- takeAction(output: ResponseItem[], logger: (message: LogLine) => void): Promise<ResponseInputItem[]>;
59
- private convertComputerCallToAction;
60
- private convertFunctionCallToAction;
61
- captureScreenshot(options?: {
62
- base64Image?: string;
63
- currentUrl?: string;
64
- }): Promise<string>;
65
- }
@@ -1,15 +0,0 @@
1
- import { LogLine } from "@/types/log";
2
- import { AgentExecuteOptions, AgentResult } from "@/types/agent";
3
- import { AgentClient } from "./AgentClient";
4
- /**
5
- * Main interface for agent operations in Stagehand
6
- * This class provides methods for executing tasks with an agent
7
- */
8
- export declare class StagehandAgent {
9
- private client;
10
- private logger;
11
- constructor(client: AgentClient, logger: (message: LogLine) => void);
12
- execute(optionsOrInstruction: AgentExecuteOptions | string): Promise<AgentResult>;
13
- getModelName(): string;
14
- getAgentType(): string;
15
- }
@@ -1,59 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createActTool: (stagehand: Stagehand, executionModel?: string) => import("ai/dist").Tool<z.ZodObject<{
4
- action: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- action?: string;
7
- }, {
8
- action?: string;
9
- }>, {
10
- success: boolean;
11
- error: string;
12
- isIframe: boolean;
13
- action?: undefined;
14
- playwrightArguments?: undefined;
15
- } | {
16
- success: boolean;
17
- action: string;
18
- isIframe: boolean;
19
- playwrightArguments: {
20
- description: string;
21
- method: string;
22
- arguments: string[];
23
- selector: string;
24
- };
25
- error?: undefined;
26
- } | {
27
- success: boolean;
28
- error: any;
29
- isIframe?: undefined;
30
- action?: undefined;
31
- playwrightArguments?: undefined;
32
- }> & {
33
- execute: (args: {
34
- action?: string;
35
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
36
- success: boolean;
37
- error: string;
38
- isIframe: boolean;
39
- action?: undefined;
40
- playwrightArguments?: undefined;
41
- } | {
42
- success: boolean;
43
- action: string;
44
- isIframe: boolean;
45
- playwrightArguments: {
46
- description: string;
47
- method: string;
48
- arguments: string[];
49
- selector: string;
50
- };
51
- error?: undefined;
52
- } | {
53
- success: boolean;
54
- error: any;
55
- isIframe?: undefined;
56
- action?: undefined;
57
- playwrightArguments?: undefined;
58
- }>;
59
- };
@@ -1,11 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createAriaTreeTool: (stagehand: Stagehand) => import("ai/dist").Tool<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, {
4
- content: string;
5
- pageUrl: string;
6
- }> & {
7
- execute: (args: {}, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
8
- content: string;
9
- pageUrl: string;
10
- }>;
11
- };
@@ -1,22 +0,0 @@
1
- import { z } from "zod/v3";
2
- export declare const createCloseTool: () => import("ai/dist").Tool<z.ZodObject<{
3
- reasoning: z.ZodString;
4
- success: z.ZodBoolean;
5
- }, "strip", z.ZodTypeAny, {
6
- reasoning?: string;
7
- success?: boolean;
8
- }, {
9
- reasoning?: string;
10
- success?: boolean;
11
- }>, {
12
- success: boolean;
13
- reasoning: string;
14
- }> & {
15
- execute: (args: {
16
- reasoning?: string;
17
- success?: boolean;
18
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
19
- success: boolean;
20
- reasoning: string;
21
- }>;
22
- };
@@ -1,38 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- import { LogLine } from "@/types/log";
4
- export declare const createExtractTool: (stagehand: Stagehand, executionModel?: string, logger?: (message: LogLine) => void) => import("ai/dist").Tool<z.ZodObject<{
5
- instruction: z.ZodString;
6
- schema: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- schema?: string;
9
- instruction?: string;
10
- }, {
11
- schema?: string;
12
- instruction?: string;
13
- }>, {
14
- success: boolean;
15
- data: any;
16
- timestamp: number;
17
- error?: undefined;
18
- } | {
19
- success: boolean;
20
- error: string;
21
- timestamp: number;
22
- data?: undefined;
23
- }> & {
24
- execute: (args: {
25
- schema?: string;
26
- instruction?: string;
27
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
28
- success: boolean;
29
- data: any;
30
- timestamp: number;
31
- error?: undefined;
32
- } | {
33
- success: boolean;
34
- error: string;
35
- timestamp: number;
36
- data?: undefined;
37
- }>;
38
- };
@@ -1,37 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createFillFormTool: (stagehand: Stagehand, executionModel?: string) => import("ai/dist").Tool<z.ZodObject<{
4
- fields: z.ZodArray<z.ZodObject<{
5
- action: z.ZodString;
6
- value: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- value?: string;
9
- action?: string;
10
- }, {
11
- value?: string;
12
- action?: string;
13
- }>, "many">;
14
- }, "strip", z.ZodTypeAny, {
15
- fields?: {
16
- value?: string;
17
- action?: string;
18
- }[];
19
- }, {
20
- fields?: {
21
- value?: string;
22
- action?: string;
23
- }[];
24
- }>, {
25
- success: boolean;
26
- actions: import("@/types/stagehand").ActResult[];
27
- }> & {
28
- execute: (args: {
29
- fields?: {
30
- value?: string;
31
- action?: string;
32
- }[];
33
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
34
- success: boolean;
35
- actions: import("@/types/stagehand").ActResult[];
36
- }>;
37
- };
@@ -1,29 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createGotoTool: (stagehand: Stagehand) => import("ai/dist").Tool<z.ZodObject<{
4
- url: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- url?: string;
7
- }, {
8
- url?: string;
9
- }>, {
10
- success: boolean;
11
- url: string;
12
- error?: undefined;
13
- } | {
14
- success: boolean;
15
- error: any;
16
- url?: undefined;
17
- }> & {
18
- execute: (args: {
19
- url?: string;
20
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
21
- success: boolean;
22
- url: string;
23
- error?: undefined;
24
- } | {
25
- success: boolean;
26
- error: any;
27
- url?: undefined;
28
- }>;
29
- };
@@ -1,257 +0,0 @@
1
- import { Stagehand } from "../../index";
2
- import { LogLine } from "@/types/log";
3
- export interface AgentToolOptions {
4
- executionModel?: string;
5
- logger?: (message: LogLine) => void;
6
- }
7
- export declare function createAgentTools(stagehand: Stagehand, options?: AgentToolOptions): {
8
- act: import("ai/dist").Tool<import("zod/v3").ZodObject<{
9
- action: import("zod/v3").ZodString;
10
- }, "strip", import("zod/v3").ZodTypeAny, {
11
- action?: string;
12
- }, {
13
- action?: string;
14
- }>, {
15
- success: boolean;
16
- error: string;
17
- isIframe: boolean;
18
- action?: undefined;
19
- playwrightArguments?: undefined;
20
- } | {
21
- success: boolean;
22
- action: string;
23
- isIframe: boolean;
24
- playwrightArguments: {
25
- description: string;
26
- method: string;
27
- arguments: string[];
28
- selector: string;
29
- };
30
- error?: undefined;
31
- } | {
32
- success: boolean;
33
- error: any;
34
- isIframe?: undefined;
35
- action?: undefined;
36
- playwrightArguments?: undefined;
37
- }> & {
38
- execute: (args: {
39
- action?: string;
40
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
41
- success: boolean;
42
- error: string;
43
- isIframe: boolean;
44
- action?: undefined;
45
- playwrightArguments?: undefined;
46
- } | {
47
- success: boolean;
48
- action: string;
49
- isIframe: boolean;
50
- playwrightArguments: {
51
- description: string;
52
- method: string;
53
- arguments: string[];
54
- selector: string;
55
- };
56
- error?: undefined;
57
- } | {
58
- success: boolean;
59
- error: any;
60
- isIframe?: undefined;
61
- action?: undefined;
62
- playwrightArguments?: undefined;
63
- }>;
64
- };
65
- ariaTree: import("ai/dist").Tool<import("zod/v3").ZodObject<{}, "strip", import("zod/v3").ZodTypeAny, {}, {}>, {
66
- content: string;
67
- pageUrl: string;
68
- }> & {
69
- execute: (args: {}, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
70
- content: string;
71
- pageUrl: string;
72
- }>;
73
- };
74
- close: import("ai/dist").Tool<import("zod/v3").ZodObject<{
75
- reasoning: import("zod/v3").ZodString;
76
- success: import("zod/v3").ZodBoolean;
77
- }, "strip", import("zod/v3").ZodTypeAny, {
78
- reasoning?: string;
79
- success?: boolean;
80
- }, {
81
- reasoning?: string;
82
- success?: boolean;
83
- }>, {
84
- success: boolean;
85
- reasoning: string;
86
- }> & {
87
- execute: (args: {
88
- reasoning?: string;
89
- success?: boolean;
90
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
91
- success: boolean;
92
- reasoning: string;
93
- }>;
94
- };
95
- extract: import("ai/dist").Tool<import("zod/v3").ZodObject<{
96
- instruction: import("zod/v3").ZodString;
97
- schema: import("zod/v3").ZodString;
98
- }, "strip", import("zod/v3").ZodTypeAny, {
99
- schema?: string;
100
- instruction?: string;
101
- }, {
102
- schema?: string;
103
- instruction?: string;
104
- }>, {
105
- success: boolean;
106
- data: any;
107
- timestamp: number;
108
- error?: undefined;
109
- } | {
110
- success: boolean;
111
- error: string;
112
- timestamp: number;
113
- data?: undefined;
114
- }> & {
115
- execute: (args: {
116
- schema?: string;
117
- instruction?: string;
118
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
119
- success: boolean;
120
- data: any;
121
- timestamp: number;
122
- error?: undefined;
123
- } | {
124
- success: boolean;
125
- error: string;
126
- timestamp: number;
127
- data?: undefined;
128
- }>;
129
- };
130
- fillForm: import("ai/dist").Tool<import("zod/v3").ZodObject<{
131
- fields: import("zod/v3").ZodArray<import("zod/v3").ZodObject<{
132
- action: import("zod/v3").ZodString;
133
- value: import("zod/v3").ZodString;
134
- }, "strip", import("zod/v3").ZodTypeAny, {
135
- value?: string;
136
- action?: string;
137
- }, {
138
- value?: string;
139
- action?: string;
140
- }>, "many">;
141
- }, "strip", import("zod/v3").ZodTypeAny, {
142
- fields?: {
143
- value?: string;
144
- action?: string;
145
- }[];
146
- }, {
147
- fields?: {
148
- value?: string;
149
- action?: string;
150
- }[];
151
- }>, {
152
- success: boolean;
153
- actions: import("@/types/stagehand").ActResult[];
154
- }> & {
155
- execute: (args: {
156
- fields?: {
157
- value?: string;
158
- action?: string;
159
- }[];
160
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
161
- success: boolean;
162
- actions: import("@/types/stagehand").ActResult[];
163
- }>;
164
- };
165
- goto: import("ai/dist").Tool<import("zod/v3").ZodObject<{
166
- url: import("zod/v3").ZodString;
167
- }, "strip", import("zod/v3").ZodTypeAny, {
168
- url?: string;
169
- }, {
170
- url?: string;
171
- }>, {
172
- success: boolean;
173
- url: string;
174
- error?: undefined;
175
- } | {
176
- success: boolean;
177
- error: any;
178
- url?: undefined;
179
- }> & {
180
- execute: (args: {
181
- url?: string;
182
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
183
- success: boolean;
184
- url: string;
185
- error?: undefined;
186
- } | {
187
- success: boolean;
188
- error: any;
189
- url?: undefined;
190
- }>;
191
- };
192
- navback: import("ai/dist").Tool<import("zod/v3").ZodObject<{
193
- reasoning: import("zod/v3").ZodString;
194
- }, "strip", import("zod/v3").ZodTypeAny, {
195
- reasoning?: string;
196
- }, {
197
- reasoning?: string;
198
- }>, {
199
- success: boolean;
200
- }> & {
201
- execute: (args: {
202
- reasoning?: string;
203
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
204
- success: boolean;
205
- }>;
206
- };
207
- screenshot: import("ai/dist").Tool<import("zod/v3").ZodObject<{}, "strip", import("zod/v3").ZodTypeAny, {}, {}>, {
208
- base64: string;
209
- timestamp: number;
210
- pageUrl: string;
211
- }> & {
212
- execute: (args: {}, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
213
- base64: string;
214
- timestamp: number;
215
- pageUrl: string;
216
- }>;
217
- };
218
- scroll: import("ai/dist").Tool<import("zod/v3").ZodObject<{
219
- pixels: import("zod/v3").ZodNumber;
220
- direction: import("zod/v3").ZodEnum<["up", "down"]>;
221
- }, "strip", import("zod/v3").ZodTypeAny, {
222
- direction?: "down" | "up";
223
- pixels?: number;
224
- }, {
225
- direction?: "down" | "up";
226
- pixels?: number;
227
- }>, {
228
- success: boolean;
229
- pixels: number;
230
- }> & {
231
- execute: (args: {
232
- direction?: "down" | "up";
233
- pixels?: number;
234
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
235
- success: boolean;
236
- pixels: number;
237
- }>;
238
- };
239
- wait: import("ai/dist").Tool<import("zod/v3").ZodObject<{
240
- timeMs: import("zod/v3").ZodNumber;
241
- }, "strip", import("zod/v3").ZodTypeAny, {
242
- timeMs?: number;
243
- }, {
244
- timeMs?: number;
245
- }>, {
246
- success: boolean;
247
- waited: number;
248
- }> & {
249
- execute: (args: {
250
- timeMs?: number;
251
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
252
- success: boolean;
253
- waited: number;
254
- }>;
255
- };
256
- };
257
- export type AgentTools = ReturnType<typeof createAgentTools>;
@@ -1,17 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createNavBackTool: (stagehand: Stagehand) => import("ai/dist").Tool<z.ZodObject<{
4
- reasoning: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- reasoning?: string;
7
- }, {
8
- reasoning?: string;
9
- }>, {
10
- success: boolean;
11
- }> & {
12
- execute: (args: {
13
- reasoning?: string;
14
- }, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
15
- success: boolean;
16
- }>;
17
- };
@@ -1,13 +0,0 @@
1
- import { z } from "zod/v3";
2
- import { Stagehand } from "../../index";
3
- export declare const createScreenshotTool: (stagehand: Stagehand) => import("ai/dist").Tool<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, {
4
- base64: string;
5
- timestamp: number;
6
- pageUrl: string;
7
- }> & {
8
- execute: (args: {}, options: import("ai/dist").ToolExecutionOptions) => PromiseLike<{
9
- base64: string;
10
- timestamp: number;
11
- pageUrl: string;
12
- }>;
13
- };