browser-use 0.0.1 → 0.1.0

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 (200) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +761 -0
  3. package/dist/agent/cloud-events.d.ts +264 -0
  4. package/dist/agent/cloud-events.js +318 -0
  5. package/dist/agent/gif.d.ts +15 -0
  6. package/dist/agent/gif.js +215 -0
  7. package/dist/agent/index.d.ts +8 -0
  8. package/dist/agent/index.js +8 -0
  9. package/dist/agent/message-manager/service.d.ts +30 -0
  10. package/dist/agent/message-manager/service.js +208 -0
  11. package/dist/agent/message-manager/utils.d.ts +2 -0
  12. package/dist/agent/message-manager/utils.js +41 -0
  13. package/dist/agent/message-manager/views.d.ts +26 -0
  14. package/dist/agent/message-manager/views.js +73 -0
  15. package/dist/agent/prompts.d.ts +52 -0
  16. package/dist/agent/prompts.js +259 -0
  17. package/dist/agent/service.d.ts +290 -0
  18. package/dist/agent/service.js +2200 -0
  19. package/dist/agent/views.d.ts +741 -0
  20. package/dist/agent/views.js +537 -0
  21. package/dist/browser/browser.d.ts +7 -0
  22. package/dist/browser/browser.js +5 -0
  23. package/dist/browser/context.d.ts +8 -0
  24. package/dist/browser/context.js +4 -0
  25. package/dist/browser/dvd-screensaver.d.ts +101 -0
  26. package/dist/browser/dvd-screensaver.js +270 -0
  27. package/dist/browser/extensions.d.ts +63 -0
  28. package/dist/browser/extensions.js +359 -0
  29. package/dist/browser/index.d.ts +10 -0
  30. package/dist/browser/index.js +9 -0
  31. package/dist/browser/playwright-manager.d.ts +47 -0
  32. package/dist/browser/playwright-manager.js +146 -0
  33. package/dist/browser/profile.d.ts +196 -0
  34. package/dist/browser/profile.js +815 -0
  35. package/dist/browser/session.d.ts +505 -0
  36. package/dist/browser/session.js +3409 -0
  37. package/dist/browser/types.d.ts +1184 -0
  38. package/dist/browser/types.js +1 -0
  39. package/dist/browser/utils.d.ts +1 -0
  40. package/dist/browser/utils.js +19 -0
  41. package/dist/browser/views.d.ts +78 -0
  42. package/dist/browser/views.js +72 -0
  43. package/dist/cli.d.ts +2 -0
  44. package/dist/cli.js +44 -0
  45. package/dist/config.d.ts +108 -0
  46. package/dist/config.js +430 -0
  47. package/dist/controller/index.d.ts +3 -0
  48. package/dist/controller/index.js +3 -0
  49. package/dist/controller/registry/index.d.ts +2 -0
  50. package/dist/controller/registry/index.js +2 -0
  51. package/dist/controller/registry/service.d.ts +45 -0
  52. package/dist/controller/registry/service.js +184 -0
  53. package/dist/controller/registry/views.d.ts +55 -0
  54. package/dist/controller/registry/views.js +174 -0
  55. package/dist/controller/service.d.ts +49 -0
  56. package/dist/controller/service.js +1176 -0
  57. package/dist/controller/views.d.ts +241 -0
  58. package/dist/controller/views.js +88 -0
  59. package/dist/dom/clickable-element-processor/service.d.ts +11 -0
  60. package/dist/dom/clickable-element-processor/service.js +60 -0
  61. package/dist/dom/dom_tree/index.js +1400 -0
  62. package/dist/dom/history-tree-processor/service.d.ts +14 -0
  63. package/dist/dom/history-tree-processor/service.js +75 -0
  64. package/dist/dom/history-tree-processor/view.d.ts +54 -0
  65. package/dist/dom/history-tree-processor/view.js +56 -0
  66. package/dist/dom/playground/extraction.d.ts +19 -0
  67. package/dist/dom/playground/extraction.js +187 -0
  68. package/dist/dom/playground/process-dom.d.ts +1 -0
  69. package/dist/dom/playground/process-dom.js +5 -0
  70. package/dist/dom/playground/test-accessibility.d.ts +44 -0
  71. package/dist/dom/playground/test-accessibility.js +111 -0
  72. package/dist/dom/service.d.ts +19 -0
  73. package/dist/dom/service.js +227 -0
  74. package/dist/dom/utils.d.ts +1 -0
  75. package/dist/dom/utils.js +6 -0
  76. package/dist/dom/views.d.ts +61 -0
  77. package/dist/dom/views.js +247 -0
  78. package/dist/event-bus.d.ts +11 -0
  79. package/dist/event-bus.js +19 -0
  80. package/dist/exceptions.d.ts +10 -0
  81. package/dist/exceptions.js +22 -0
  82. package/dist/filesystem/file-system.d.ts +68 -0
  83. package/dist/filesystem/file-system.js +412 -0
  84. package/dist/filesystem/index.d.ts +1 -0
  85. package/dist/filesystem/index.js +1 -0
  86. package/dist/index.d.ts +31 -0
  87. package/dist/index.js +33 -0
  88. package/dist/integrations/gmail/actions.d.ts +12 -0
  89. package/dist/integrations/gmail/actions.js +113 -0
  90. package/dist/integrations/gmail/index.d.ts +2 -0
  91. package/dist/integrations/gmail/index.js +2 -0
  92. package/dist/integrations/gmail/service.d.ts +61 -0
  93. package/dist/integrations/gmail/service.js +260 -0
  94. package/dist/llm/anthropic/chat.d.ts +28 -0
  95. package/dist/llm/anthropic/chat.js +126 -0
  96. package/dist/llm/anthropic/index.d.ts +2 -0
  97. package/dist/llm/anthropic/index.js +2 -0
  98. package/dist/llm/anthropic/serializer.d.ts +68 -0
  99. package/dist/llm/anthropic/serializer.js +285 -0
  100. package/dist/llm/aws/chat-anthropic.d.ts +61 -0
  101. package/dist/llm/aws/chat-anthropic.js +176 -0
  102. package/dist/llm/aws/chat-bedrock.d.ts +15 -0
  103. package/dist/llm/aws/chat-bedrock.js +80 -0
  104. package/dist/llm/aws/index.d.ts +3 -0
  105. package/dist/llm/aws/index.js +3 -0
  106. package/dist/llm/aws/serializer.d.ts +5 -0
  107. package/dist/llm/aws/serializer.js +68 -0
  108. package/dist/llm/azure/chat.d.ts +15 -0
  109. package/dist/llm/azure/chat.js +83 -0
  110. package/dist/llm/azure/index.d.ts +1 -0
  111. package/dist/llm/azure/index.js +1 -0
  112. package/dist/llm/base.d.ts +16 -0
  113. package/dist/llm/base.js +1 -0
  114. package/dist/llm/deepseek/chat.d.ts +15 -0
  115. package/dist/llm/deepseek/chat.js +51 -0
  116. package/dist/llm/deepseek/index.d.ts +2 -0
  117. package/dist/llm/deepseek/index.js +2 -0
  118. package/dist/llm/deepseek/serializer.d.ts +6 -0
  119. package/dist/llm/deepseek/serializer.js +57 -0
  120. package/dist/llm/exceptions.d.ts +10 -0
  121. package/dist/llm/exceptions.js +18 -0
  122. package/dist/llm/google/chat.d.ts +20 -0
  123. package/dist/llm/google/chat.js +144 -0
  124. package/dist/llm/google/index.d.ts +2 -0
  125. package/dist/llm/google/index.js +2 -0
  126. package/dist/llm/google/serializer.d.ts +6 -0
  127. package/dist/llm/google/serializer.js +64 -0
  128. package/dist/llm/groq/chat.d.ts +15 -0
  129. package/dist/llm/groq/chat.js +52 -0
  130. package/dist/llm/groq/index.d.ts +3 -0
  131. package/dist/llm/groq/index.js +3 -0
  132. package/dist/llm/groq/parser.d.ts +32 -0
  133. package/dist/llm/groq/parser.js +189 -0
  134. package/dist/llm/groq/serializer.d.ts +6 -0
  135. package/dist/llm/groq/serializer.js +56 -0
  136. package/dist/llm/messages.d.ts +77 -0
  137. package/dist/llm/messages.js +157 -0
  138. package/dist/llm/ollama/chat.d.ts +15 -0
  139. package/dist/llm/ollama/chat.js +77 -0
  140. package/dist/llm/ollama/index.d.ts +2 -0
  141. package/dist/llm/ollama/index.js +2 -0
  142. package/dist/llm/ollama/serializer.d.ts +6 -0
  143. package/dist/llm/ollama/serializer.js +53 -0
  144. package/dist/llm/openai/chat.d.ts +38 -0
  145. package/dist/llm/openai/chat.js +174 -0
  146. package/dist/llm/openai/index.d.ts +3 -0
  147. package/dist/llm/openai/index.js +3 -0
  148. package/dist/llm/openai/like.d.ts +17 -0
  149. package/dist/llm/openai/like.js +19 -0
  150. package/dist/llm/openai/serializer.d.ts +6 -0
  151. package/dist/llm/openai/serializer.js +57 -0
  152. package/dist/llm/openrouter/chat.d.ts +15 -0
  153. package/dist/llm/openrouter/chat.js +74 -0
  154. package/dist/llm/openrouter/index.d.ts +2 -0
  155. package/dist/llm/openrouter/index.js +2 -0
  156. package/dist/llm/openrouter/serializer.d.ts +3 -0
  157. package/dist/llm/openrouter/serializer.js +3 -0
  158. package/dist/llm/schema.d.ts +6 -0
  159. package/dist/llm/schema.js +77 -0
  160. package/dist/llm/views.d.ts +15 -0
  161. package/dist/llm/views.js +12 -0
  162. package/dist/logging-config.d.ts +25 -0
  163. package/dist/logging-config.js +89 -0
  164. package/dist/mcp/client.d.ts +142 -0
  165. package/dist/mcp/client.js +638 -0
  166. package/dist/mcp/controller.d.ts +6 -0
  167. package/dist/mcp/controller.js +38 -0
  168. package/dist/mcp/index.d.ts +3 -0
  169. package/dist/mcp/index.js +3 -0
  170. package/dist/mcp/server.d.ts +134 -0
  171. package/dist/mcp/server.js +759 -0
  172. package/dist/observability-decorators.d.ts +158 -0
  173. package/dist/observability-decorators.js +286 -0
  174. package/dist/observability.d.ts +23 -0
  175. package/dist/observability.js +58 -0
  176. package/dist/screenshots/index.d.ts +1 -0
  177. package/dist/screenshots/index.js +1 -0
  178. package/dist/screenshots/service.d.ts +6 -0
  179. package/dist/screenshots/service.js +28 -0
  180. package/dist/sync/auth.d.ts +27 -0
  181. package/dist/sync/auth.js +205 -0
  182. package/dist/sync/index.d.ts +2 -0
  183. package/dist/sync/index.js +2 -0
  184. package/dist/sync/service.d.ts +21 -0
  185. package/dist/sync/service.js +146 -0
  186. package/dist/telemetry/index.d.ts +2 -0
  187. package/dist/telemetry/index.js +2 -0
  188. package/dist/telemetry/service.d.ts +12 -0
  189. package/dist/telemetry/service.js +85 -0
  190. package/dist/telemetry/views.d.ts +112 -0
  191. package/dist/telemetry/views.js +112 -0
  192. package/dist/tokens/index.d.ts +2 -0
  193. package/dist/tokens/index.js +2 -0
  194. package/dist/tokens/service.d.ts +35 -0
  195. package/dist/tokens/service.js +423 -0
  196. package/dist/tokens/views.d.ts +58 -0
  197. package/dist/tokens/views.js +1 -0
  198. package/dist/utils.d.ts +128 -0
  199. package/dist/utils.js +529 -0
  200. package/package.json +94 -5
@@ -0,0 +1,741 @@
1
+ import { ActionModel } from '../controller/registry/views.js';
2
+ import { BrowserStateHistory } from '../browser/views.js';
3
+ import type { DOMHistoryElement } from '../dom/history-tree-processor/view.js';
4
+ import type { SelectorMap } from '../dom/views.js';
5
+ import type { FileSystemState } from '../filesystem/file-system.js';
6
+ import { MessageManagerState } from './message-manager/views.js';
7
+ import type { UsageSummary } from '../tokens/views.js';
8
+ export { ActionModel };
9
+ export interface StructuredOutputParser<T = unknown> {
10
+ parse?: (input: string) => T;
11
+ model_validate_json?: (input: string) => T;
12
+ }
13
+ export interface ActionResultInit {
14
+ is_done?: boolean | null;
15
+ success?: boolean | null;
16
+ error?: string | null;
17
+ attachments?: string[] | null;
18
+ long_term_memory?: string | null;
19
+ extracted_content?: string | null;
20
+ include_extracted_content_only_once?: boolean;
21
+ include_in_memory?: boolean;
22
+ }
23
+ export declare class ActionResult {
24
+ is_done: boolean | null;
25
+ success: boolean | null;
26
+ error: string | null;
27
+ attachments: string[] | null;
28
+ long_term_memory: string | null;
29
+ extracted_content: string | null;
30
+ include_extracted_content_only_once: boolean;
31
+ include_in_memory: boolean;
32
+ constructor(init?: ActionResultInit);
33
+ private validate;
34
+ toJSON(): {
35
+ is_done: boolean | null;
36
+ success: boolean | null;
37
+ error: string | null;
38
+ attachments: string[] | null;
39
+ long_term_memory: string | null;
40
+ extracted_content: string | null;
41
+ include_extracted_content_only_once: boolean;
42
+ include_in_memory: boolean;
43
+ };
44
+ model_dump(): {
45
+ is_done: boolean | null;
46
+ success: boolean | null;
47
+ error: string | null;
48
+ attachments: string[] | null;
49
+ long_term_memory: string | null;
50
+ extracted_content: string | null;
51
+ include_extracted_content_only_once: boolean;
52
+ include_in_memory: boolean;
53
+ };
54
+ model_dump_json(): string;
55
+ }
56
+ export interface AgentSettings {
57
+ session_attachment_mode: 'copy' | 'strict' | 'shared';
58
+ use_vision: boolean;
59
+ vision_detail_level: 'auto' | 'low' | 'high';
60
+ use_vision_for_planner: boolean;
61
+ save_conversation_path: string | null;
62
+ save_conversation_path_encoding: string | null;
63
+ max_failures: number;
64
+ retry_delay: number;
65
+ validate_output: boolean;
66
+ generate_gif: boolean | string;
67
+ override_system_message: string | null;
68
+ extend_system_message: string | null;
69
+ include_attributes: string[];
70
+ max_actions_per_step: number;
71
+ use_thinking: boolean;
72
+ flash_mode: boolean;
73
+ max_history_items: number | null;
74
+ page_extraction_llm: unknown | null;
75
+ planner_llm: unknown | null;
76
+ planner_interval: number;
77
+ is_planner_reasoning: boolean;
78
+ extend_planner_system_message: string | null;
79
+ calculate_cost: boolean;
80
+ include_tool_call_examples: boolean;
81
+ llm_timeout: number;
82
+ step_timeout: number;
83
+ }
84
+ export declare const defaultAgentSettings: () => AgentSettings;
85
+ export declare class AgentState {
86
+ agent_id: string;
87
+ n_steps: number;
88
+ consecutive_failures: number;
89
+ last_result: ActionResult[] | null;
90
+ last_plan: string | null;
91
+ last_model_output: AgentOutput | null;
92
+ paused: boolean;
93
+ stopped: boolean;
94
+ message_manager_state: MessageManagerState;
95
+ file_system_state: FileSystemState | null;
96
+ constructor(init?: Partial<AgentState>);
97
+ model_dump(): Record<string, unknown>;
98
+ toJSON(): Record<string, unknown>;
99
+ }
100
+ export declare class AgentStepInfo {
101
+ step_number: number;
102
+ max_steps: number;
103
+ constructor(step_number: number, max_steps: number);
104
+ is_last_step(): boolean;
105
+ }
106
+ export declare class StepMetadata {
107
+ step_start_time: number;
108
+ step_end_time: number;
109
+ step_number: number;
110
+ constructor(step_start_time: number, step_end_time: number, step_number: number);
111
+ get duration_seconds(): number;
112
+ }
113
+ export interface AgentBrain {
114
+ thinking: string | null;
115
+ evaluation_previous_goal: string;
116
+ memory: string;
117
+ next_goal: string;
118
+ }
119
+ export declare class AgentOutput {
120
+ thinking: string | null;
121
+ evaluation_previous_goal: string | null;
122
+ memory: string | null;
123
+ next_goal: string | null;
124
+ action: ActionModel[];
125
+ constructor(init?: Partial<AgentOutput>);
126
+ get current_state(): AgentBrain;
127
+ model_dump(): {
128
+ thinking: string | null;
129
+ evaluation_previous_goal: string | null;
130
+ memory: string | null;
131
+ next_goal: string | null;
132
+ action: any[];
133
+ };
134
+ model_dump_json(): string;
135
+ toJSON(): {
136
+ thinking: string | null;
137
+ evaluation_previous_goal: string | null;
138
+ memory: string | null;
139
+ next_goal: string | null;
140
+ action: any[];
141
+ };
142
+ static fromJSON(data: any): AgentOutput;
143
+ static type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): {
144
+ new (init?: Partial<AgentOutput>): {
145
+ thinking: string | null;
146
+ evaluation_previous_goal: string | null;
147
+ memory: string | null;
148
+ next_goal: string | null;
149
+ action: ActionModel[];
150
+ get current_state(): AgentBrain;
151
+ model_dump(): {
152
+ thinking: string | null;
153
+ evaluation_previous_goal: string | null;
154
+ memory: string | null;
155
+ next_goal: string | null;
156
+ action: any[];
157
+ };
158
+ model_dump_json(): string;
159
+ toJSON(): {
160
+ thinking: string | null;
161
+ evaluation_previous_goal: string | null;
162
+ memory: string | null;
163
+ next_goal: string | null;
164
+ action: any[];
165
+ };
166
+ };
167
+ fromJSON(data: any): AgentOutput;
168
+ type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
169
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
170
+ new (init?: Partial<AgentOutput>): {
171
+ thinking: string | null;
172
+ evaluation_previous_goal: string | null;
173
+ memory: string | null;
174
+ next_goal: string | null;
175
+ action: ActionModel[];
176
+ get current_state(): AgentBrain;
177
+ model_dump(): {
178
+ thinking: string | null;
179
+ evaluation_previous_goal: string | null;
180
+ memory: string | null;
181
+ next_goal: string | null;
182
+ action: any[];
183
+ };
184
+ model_dump_json(): string;
185
+ toJSON(): {
186
+ thinking: string | null;
187
+ evaluation_previous_goal: string | null;
188
+ memory: string | null;
189
+ next_goal: string | null;
190
+ action: any[];
191
+ };
192
+ };
193
+ fromJSON(data: any): AgentOutput;
194
+ type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
195
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
196
+ type_with_custom_actions_flash_mode<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
197
+ new (init?: Partial<AgentOutput>): {
198
+ thinking: string | null;
199
+ evaluation_previous_goal: string | null;
200
+ memory: string | null;
201
+ next_goal: string | null;
202
+ action: ActionModel[];
203
+ get current_state(): AgentBrain;
204
+ model_dump(): {
205
+ thinking: string | null;
206
+ evaluation_previous_goal: string | null;
207
+ memory: string | null;
208
+ next_goal: string | null;
209
+ action: any[];
210
+ };
211
+ model_dump_json(): string;
212
+ toJSON(): {
213
+ thinking: string | null;
214
+ evaluation_previous_goal: string | null;
215
+ memory: string | null;
216
+ next_goal: string | null;
217
+ action: any[];
218
+ };
219
+ };
220
+ fromJSON(data: any): AgentOutput;
221
+ type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
222
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
223
+ type_with_custom_actions_flash_mode<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
224
+ };
225
+ };
226
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
227
+ new (init?: Partial<AgentOutput>): {
228
+ thinking: string | null;
229
+ evaluation_previous_goal: string | null;
230
+ memory: string | null;
231
+ next_goal: string | null;
232
+ action: ActionModel[];
233
+ get current_state(): AgentBrain;
234
+ model_dump(): {
235
+ thinking: string | null;
236
+ evaluation_previous_goal: string | null;
237
+ memory: string | null;
238
+ next_goal: string | null;
239
+ action: any[];
240
+ };
241
+ model_dump_json(): string;
242
+ toJSON(): {
243
+ thinking: string | null;
244
+ evaluation_previous_goal: string | null;
245
+ memory: string | null;
246
+ next_goal: string | null;
247
+ action: any[];
248
+ };
249
+ };
250
+ fromJSON(data: any): AgentOutput;
251
+ type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
252
+ type_with_custom_actions_no_thinking<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
253
+ new (init?: Partial<AgentOutput>): {
254
+ thinking: string | null;
255
+ evaluation_previous_goal: string | null;
256
+ memory: string | null;
257
+ next_goal: string | null;
258
+ action: ActionModel[];
259
+ get current_state(): AgentBrain;
260
+ model_dump(): {
261
+ thinking: string | null;
262
+ evaluation_previous_goal: string | null;
263
+ memory: string | null;
264
+ next_goal: string | null;
265
+ action: any[];
266
+ };
267
+ model_dump_json(): string;
268
+ toJSON(): {
269
+ thinking: string | null;
270
+ evaluation_previous_goal: string | null;
271
+ memory: string | null;
272
+ next_goal: string | null;
273
+ action: any[];
274
+ };
275
+ };
276
+ fromJSON(data: any): AgentOutput;
277
+ type_with_custom_actions<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
278
+ type_with_custom_actions_no_thinking<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
279
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
280
+ };
281
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
282
+ };
283
+ };
284
+ static type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): {
285
+ new (init?: Partial<AgentOutput>): {
286
+ thinking: string | null;
287
+ evaluation_previous_goal: string | null;
288
+ memory: string | null;
289
+ next_goal: string | null;
290
+ action: ActionModel[];
291
+ get current_state(): AgentBrain;
292
+ model_dump(): {
293
+ thinking: string | null;
294
+ evaluation_previous_goal: string | null;
295
+ memory: string | null;
296
+ next_goal: string | null;
297
+ action: any[];
298
+ };
299
+ model_dump_json(): string;
300
+ toJSON(): {
301
+ thinking: string | null;
302
+ evaluation_previous_goal: string | null;
303
+ memory: string | null;
304
+ next_goal: string | null;
305
+ action: any[];
306
+ };
307
+ };
308
+ fromJSON(data: any): AgentOutput;
309
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
310
+ new (init?: Partial<AgentOutput>): {
311
+ thinking: string | null;
312
+ evaluation_previous_goal: string | null;
313
+ memory: string | null;
314
+ next_goal: string | null;
315
+ action: ActionModel[];
316
+ get current_state(): AgentBrain;
317
+ model_dump(): {
318
+ thinking: string | null;
319
+ evaluation_previous_goal: string | null;
320
+ memory: string | null;
321
+ next_goal: string | null;
322
+ action: any[];
323
+ };
324
+ model_dump_json(): string;
325
+ toJSON(): {
326
+ thinking: string | null;
327
+ evaluation_previous_goal: string | null;
328
+ memory: string | null;
329
+ next_goal: string | null;
330
+ action: any[];
331
+ };
332
+ };
333
+ fromJSON(data: any): AgentOutput;
334
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
335
+ type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
336
+ type_with_custom_actions_flash_mode<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
337
+ new (init?: Partial<AgentOutput>): {
338
+ thinking: string | null;
339
+ evaluation_previous_goal: string | null;
340
+ memory: string | null;
341
+ next_goal: string | null;
342
+ action: ActionModel[];
343
+ get current_state(): AgentBrain;
344
+ model_dump(): {
345
+ thinking: string | null;
346
+ evaluation_previous_goal: string | null;
347
+ memory: string | null;
348
+ next_goal: string | null;
349
+ action: any[];
350
+ };
351
+ model_dump_json(): string;
352
+ toJSON(): {
353
+ thinking: string | null;
354
+ evaluation_previous_goal: string | null;
355
+ memory: string | null;
356
+ next_goal: string | null;
357
+ action: any[];
358
+ };
359
+ };
360
+ fromJSON(data: any): AgentOutput;
361
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
362
+ type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
363
+ type_with_custom_actions_flash_mode<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
364
+ };
365
+ };
366
+ type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
367
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
368
+ new (init?: Partial<AgentOutput>): {
369
+ thinking: string | null;
370
+ evaluation_previous_goal: string | null;
371
+ memory: string | null;
372
+ next_goal: string | null;
373
+ action: ActionModel[];
374
+ get current_state(): AgentBrain;
375
+ model_dump(): {
376
+ thinking: string | null;
377
+ evaluation_previous_goal: string | null;
378
+ memory: string | null;
379
+ next_goal: string | null;
380
+ action: any[];
381
+ };
382
+ model_dump_json(): string;
383
+ toJSON(): {
384
+ thinking: string | null;
385
+ evaluation_previous_goal: string | null;
386
+ memory: string | null;
387
+ next_goal: string | null;
388
+ action: any[];
389
+ };
390
+ };
391
+ fromJSON(data: any): AgentOutput;
392
+ type_with_custom_actions<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
393
+ new (init?: Partial<AgentOutput>): {
394
+ thinking: string | null;
395
+ evaluation_previous_goal: string | null;
396
+ memory: string | null;
397
+ next_goal: string | null;
398
+ action: ActionModel[];
399
+ get current_state(): AgentBrain;
400
+ model_dump(): {
401
+ thinking: string | null;
402
+ evaluation_previous_goal: string | null;
403
+ memory: string | null;
404
+ next_goal: string | null;
405
+ action: any[];
406
+ };
407
+ model_dump_json(): string;
408
+ toJSON(): {
409
+ thinking: string | null;
410
+ evaluation_previous_goal: string | null;
411
+ memory: string | null;
412
+ next_goal: string | null;
413
+ action: any[];
414
+ };
415
+ };
416
+ fromJSON(data: any): AgentOutput;
417
+ type_with_custom_actions<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
418
+ type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
419
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
420
+ };
421
+ type_with_custom_actions_no_thinking<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
422
+ type_with_custom_actions_flash_mode<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
423
+ };
424
+ };
425
+ static type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): {
426
+ new (init?: Partial<AgentOutput>): {
427
+ thinking: string | null;
428
+ evaluation_previous_goal: string | null;
429
+ memory: string | null;
430
+ next_goal: string | null;
431
+ action: ActionModel[];
432
+ get current_state(): AgentBrain;
433
+ model_dump(): {
434
+ thinking: string | null;
435
+ evaluation_previous_goal: string | null;
436
+ memory: string | null;
437
+ next_goal: string | null;
438
+ action: any[];
439
+ };
440
+ model_dump_json(): string;
441
+ toJSON(): {
442
+ thinking: string | null;
443
+ evaluation_previous_goal: string | null;
444
+ memory: string | null;
445
+ next_goal: string | null;
446
+ action: any[];
447
+ };
448
+ };
449
+ fromJSON(data: any): AgentOutput;
450
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
451
+ new (init?: Partial<AgentOutput>): {
452
+ thinking: string | null;
453
+ evaluation_previous_goal: string | null;
454
+ memory: string | null;
455
+ next_goal: string | null;
456
+ action: ActionModel[];
457
+ get current_state(): AgentBrain;
458
+ model_dump(): {
459
+ thinking: string | null;
460
+ evaluation_previous_goal: string | null;
461
+ memory: string | null;
462
+ next_goal: string | null;
463
+ action: any[];
464
+ };
465
+ model_dump_json(): string;
466
+ toJSON(): {
467
+ thinking: string | null;
468
+ evaluation_previous_goal: string | null;
469
+ memory: string | null;
470
+ next_goal: string | null;
471
+ action: any[];
472
+ };
473
+ };
474
+ fromJSON(data: any): AgentOutput;
475
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
476
+ type_with_custom_actions_no_thinking<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
477
+ new (init?: Partial<AgentOutput>): {
478
+ thinking: string | null;
479
+ evaluation_previous_goal: string | null;
480
+ memory: string | null;
481
+ next_goal: string | null;
482
+ action: ActionModel[];
483
+ get current_state(): AgentBrain;
484
+ model_dump(): {
485
+ thinking: string | null;
486
+ evaluation_previous_goal: string | null;
487
+ memory: string | null;
488
+ next_goal: string | null;
489
+ action: any[];
490
+ };
491
+ model_dump_json(): string;
492
+ toJSON(): {
493
+ thinking: string | null;
494
+ evaluation_previous_goal: string | null;
495
+ memory: string | null;
496
+ next_goal: string | null;
497
+ action: any[];
498
+ };
499
+ };
500
+ fromJSON(data: any): AgentOutput;
501
+ type_with_custom_actions<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
502
+ type_with_custom_actions_no_thinking<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
503
+ type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
504
+ };
505
+ type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
506
+ };
507
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): {
508
+ new (init?: Partial<AgentOutput>): {
509
+ thinking: string | null;
510
+ evaluation_previous_goal: string | null;
511
+ memory: string | null;
512
+ next_goal: string | null;
513
+ action: ActionModel[];
514
+ get current_state(): AgentBrain;
515
+ model_dump(): {
516
+ thinking: string | null;
517
+ evaluation_previous_goal: string | null;
518
+ memory: string | null;
519
+ next_goal: string | null;
520
+ action: any[];
521
+ };
522
+ model_dump_json(): string;
523
+ toJSON(): {
524
+ thinking: string | null;
525
+ evaluation_previous_goal: string | null;
526
+ memory: string | null;
527
+ next_goal: string | null;
528
+ action: any[];
529
+ };
530
+ };
531
+ fromJSON(data: any): AgentOutput;
532
+ type_with_custom_actions<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): {
533
+ new (init?: Partial<AgentOutput>): {
534
+ thinking: string | null;
535
+ evaluation_previous_goal: string | null;
536
+ memory: string | null;
537
+ next_goal: string | null;
538
+ action: ActionModel[];
539
+ get current_state(): AgentBrain;
540
+ model_dump(): {
541
+ thinking: string | null;
542
+ evaluation_previous_goal: string | null;
543
+ memory: string | null;
544
+ next_goal: string | null;
545
+ action: any[];
546
+ };
547
+ model_dump_json(): string;
548
+ toJSON(): {
549
+ thinking: string | null;
550
+ evaluation_previous_goal: string | null;
551
+ memory: string | null;
552
+ next_goal: string | null;
553
+ action: any[];
554
+ };
555
+ };
556
+ fromJSON(data: any): AgentOutput;
557
+ type_with_custom_actions<T_2 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_2): /*elided*/ any;
558
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
559
+ type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
560
+ };
561
+ type_with_custom_actions_no_thinking<T_1 extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T_1): /*elided*/ any;
562
+ type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
563
+ };
564
+ type_with_custom_actions_flash_mode<T extends ActionModel>(custom_actions: new (initialData?: Record<string, any>) => T): /*elided*/ any;
565
+ };
566
+ }
567
+ export declare class AgentHistory {
568
+ model_output: AgentOutput | null;
569
+ result: ActionResult[];
570
+ state: BrowserStateHistory;
571
+ metadata: StepMetadata | null;
572
+ constructor(model_output: AgentOutput | null, result: ActionResult[], state: BrowserStateHistory, metadata?: StepMetadata | null);
573
+ static get_interacted_element(model_output: AgentOutput, selector_map: SelectorMap): (DOMHistoryElement | null)[];
574
+ toJSON(): {
575
+ model_output: {
576
+ thinking: string | null;
577
+ evaluation_previous_goal: string | null;
578
+ memory: string | null;
579
+ next_goal: string | null;
580
+ action: any[];
581
+ } | null;
582
+ result: {
583
+ is_done: boolean | null;
584
+ success: boolean | null;
585
+ error: string | null;
586
+ attachments: string[] | null;
587
+ long_term_memory: string | null;
588
+ extracted_content: string | null;
589
+ include_extracted_content_only_once: boolean;
590
+ include_in_memory: boolean;
591
+ }[];
592
+ state: {
593
+ tabs: import("../index.js").TabInfo[];
594
+ screenshot_path: string | null;
595
+ interacted_element: ({
596
+ tag_name: string;
597
+ xpath: string;
598
+ highlight_index: number | null;
599
+ entire_parent_branch_path: string[];
600
+ attributes: Record<string, string>;
601
+ shadow_root: boolean;
602
+ css_selector: string | null;
603
+ page_coordinates: import("../index.js").CoordinateSet | null;
604
+ viewport_coordinates: import("../index.js").CoordinateSet | null;
605
+ viewport_info: import("../index.js").ViewportInfo | null;
606
+ } | null)[];
607
+ url: string;
608
+ title: string;
609
+ };
610
+ metadata: {
611
+ step_start_time: number;
612
+ step_end_time: number;
613
+ step_number: number;
614
+ } | null;
615
+ };
616
+ }
617
+ export declare class AgentHistoryList<TStructured = unknown> {
618
+ history: AgentHistory[];
619
+ usage: UsageSummary | null;
620
+ _output_model_schema: StructuredOutputParser<TStructured> | null;
621
+ constructor(history?: AgentHistory[], usage?: UsageSummary | null);
622
+ total_duration_seconds(): number;
623
+ add_item(history_item: AgentHistory): void;
624
+ last_action(): any;
625
+ errors(): (string | null)[];
626
+ final_result(): string | null;
627
+ is_done(): boolean;
628
+ is_successful(): boolean | null;
629
+ has_errors(): boolean;
630
+ urls(): string[];
631
+ screenshot_paths(n_last?: number | null, return_none_if_not_screenshot?: boolean): (string | null)[];
632
+ screenshots(n_last?: number | null, return_none_if_not_screenshot?: boolean): (string | null)[];
633
+ action_names(): string[];
634
+ model_thoughts(): AgentBrain[];
635
+ model_outputs(): AgentOutput[];
636
+ model_actions(): Record<string, unknown>[];
637
+ action_history(): Record<string, unknown>[][];
638
+ action_results(): ActionResult[];
639
+ extracted_content(): (string | null)[];
640
+ model_actions_filtered(include?: string[]): Record<string, unknown>[];
641
+ number_of_steps(): number;
642
+ get structured_output(): TStructured | null;
643
+ save_to_file(filepath: string): void;
644
+ static load_from_file(filepath: string, outputModel: typeof AgentOutput): AgentHistoryList;
645
+ toJSON(): {
646
+ history: {
647
+ model_output: {
648
+ thinking: string | null;
649
+ evaluation_previous_goal: string | null;
650
+ memory: string | null;
651
+ next_goal: string | null;
652
+ action: any[];
653
+ } | null;
654
+ result: {
655
+ is_done: boolean | null;
656
+ success: boolean | null;
657
+ error: string | null;
658
+ attachments: string[] | null;
659
+ long_term_memory: string | null;
660
+ extracted_content: string | null;
661
+ include_extracted_content_only_once: boolean;
662
+ include_in_memory: boolean;
663
+ }[];
664
+ state: {
665
+ tabs: import("../index.js").TabInfo[];
666
+ screenshot_path: string | null;
667
+ interacted_element: ({
668
+ tag_name: string;
669
+ xpath: string;
670
+ highlight_index: number | null;
671
+ entire_parent_branch_path: string[];
672
+ attributes: Record<string, string>;
673
+ shadow_root: boolean;
674
+ css_selector: string | null;
675
+ page_coordinates: import("../index.js").CoordinateSet | null;
676
+ viewport_coordinates: import("../index.js").CoordinateSet | null;
677
+ viewport_info: import("../index.js").ViewportInfo | null;
678
+ } | null)[];
679
+ url: string;
680
+ title: string;
681
+ };
682
+ metadata: {
683
+ step_start_time: number;
684
+ step_end_time: number;
685
+ step_number: number;
686
+ } | null;
687
+ }[];
688
+ usage: UsageSummary | null;
689
+ };
690
+ model_dump(): {
691
+ history: {
692
+ model_output: {
693
+ thinking: string | null;
694
+ evaluation_previous_goal: string | null;
695
+ memory: string | null;
696
+ next_goal: string | null;
697
+ action: any[];
698
+ } | null;
699
+ result: {
700
+ is_done: boolean | null;
701
+ success: boolean | null;
702
+ error: string | null;
703
+ attachments: string[] | null;
704
+ long_term_memory: string | null;
705
+ extracted_content: string | null;
706
+ include_extracted_content_only_once: boolean;
707
+ include_in_memory: boolean;
708
+ }[];
709
+ state: {
710
+ tabs: import("../index.js").TabInfo[];
711
+ screenshot_path: string | null;
712
+ interacted_element: ({
713
+ tag_name: string;
714
+ xpath: string;
715
+ highlight_index: number | null;
716
+ entire_parent_branch_path: string[];
717
+ attributes: Record<string, string>;
718
+ shadow_root: boolean;
719
+ css_selector: string | null;
720
+ page_coordinates: import("../index.js").CoordinateSet | null;
721
+ viewport_coordinates: import("../index.js").CoordinateSet | null;
722
+ viewport_info: import("../index.js").ViewportInfo | null;
723
+ } | null)[];
724
+ url: string;
725
+ title: string;
726
+ };
727
+ metadata: {
728
+ step_start_time: number;
729
+ step_end_time: number;
730
+ step_number: number;
731
+ } | null;
732
+ }[];
733
+ usage: UsageSummary | null;
734
+ };
735
+ }
736
+ export declare class AgentError extends Error {
737
+ static VALIDATION_ERROR: string;
738
+ static RATE_LIMIT_ERROR: string;
739
+ static NO_VALID_ACTION: string;
740
+ static format_error(error: Error, include_trace?: boolean): string;
741
+ }