browser-use-sdk 3.4.1 → 3.4.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.
- package/dist/chunk-6TSB5AIP.js +99 -0
- package/dist/chunk-6TSB5AIP.js.map +1 -0
- package/dist/chunk-JT4IL3IZ.cjs +99 -0
- package/dist/chunk-JT4IL3IZ.cjs.map +1 -0
- package/dist/errors-BtB79l7x.d.cts +30 -0
- package/dist/errors-BtB79l7x.d.ts +30 -0
- package/dist/index.cjs +438 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2517 -0
- package/dist/index.d.ts +2517 -0
- package/dist/index.js +438 -0
- package/dist/index.js.map +1 -0
- package/dist/v3.cjs +480 -0
- package/dist/v3.cjs.map +1 -0
- package/dist/v3.d.cts +1413 -0
- package/dist/v3.d.ts +1413 -0
- package/dist/v3.js +480 -0
- package/dist/v3.js.map +1 -0
- package/package.json +1 -1
package/dist/v3.d.cts
ADDED
|
@@ -0,0 +1,1413 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { H as HttpClient } from './errors-BtB79l7x.cjs';
|
|
3
|
+
export { B as BrowserUseError } from './errors-BtB79l7x.cjs';
|
|
4
|
+
|
|
5
|
+
interface components {
|
|
6
|
+
schemas: {
|
|
7
|
+
/**
|
|
8
|
+
* AccountNotFoundError
|
|
9
|
+
* @description Error response when an account is not found
|
|
10
|
+
*/
|
|
11
|
+
AccountNotFoundError: {
|
|
12
|
+
/**
|
|
13
|
+
* Detail
|
|
14
|
+
* @default Account not found
|
|
15
|
+
*/
|
|
16
|
+
detail: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* AccountView
|
|
20
|
+
* @description View model for account information.
|
|
21
|
+
*/
|
|
22
|
+
AccountView: {
|
|
23
|
+
/**
|
|
24
|
+
* Name
|
|
25
|
+
* @description The name of the user
|
|
26
|
+
*/
|
|
27
|
+
name?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Credits Balance USD
|
|
30
|
+
* @description The total credits balance in USD
|
|
31
|
+
*/
|
|
32
|
+
totalCreditsBalanceUsd: number;
|
|
33
|
+
/**
|
|
34
|
+
* Monthly Credits Balance USD
|
|
35
|
+
* @description Monthly subscription credits balance in USD
|
|
36
|
+
*/
|
|
37
|
+
monthlyCreditsBalanceUsd: number;
|
|
38
|
+
/**
|
|
39
|
+
* Additional Credits Balance USD
|
|
40
|
+
* @description Additional top-up credits balance in USD
|
|
41
|
+
*/
|
|
42
|
+
additionalCreditsBalanceUsd: number;
|
|
43
|
+
/**
|
|
44
|
+
* Rate Limit
|
|
45
|
+
* @description The rate limit for the account
|
|
46
|
+
*/
|
|
47
|
+
rateLimit: number;
|
|
48
|
+
/**
|
|
49
|
+
* Plan Info
|
|
50
|
+
* @description The plan information
|
|
51
|
+
*/
|
|
52
|
+
planInfo: components["schemas"]["PlanInfo"];
|
|
53
|
+
/**
|
|
54
|
+
* Project ID
|
|
55
|
+
* Format: uuid
|
|
56
|
+
* @description The ID of the project
|
|
57
|
+
*/
|
|
58
|
+
projectId: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* BrowserSessionItemView
|
|
62
|
+
* @description View model for representing a browser session in list views.
|
|
63
|
+
*/
|
|
64
|
+
BrowserSessionItemView: {
|
|
65
|
+
/**
|
|
66
|
+
* ID
|
|
67
|
+
* Format: uuid
|
|
68
|
+
* @description Unique identifier for the session
|
|
69
|
+
*/
|
|
70
|
+
id: string;
|
|
71
|
+
/**
|
|
72
|
+
* Status
|
|
73
|
+
* @description Current status of the session (active/stopped)
|
|
74
|
+
*/
|
|
75
|
+
status: components["schemas"]["BrowserSessionStatus"];
|
|
76
|
+
/**
|
|
77
|
+
* Live URL
|
|
78
|
+
* @description URL where the browser can be viewed live in real-time
|
|
79
|
+
*/
|
|
80
|
+
liveUrl?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* CDP URL
|
|
83
|
+
* @description Chrome DevTools Protocol URL for browser automation
|
|
84
|
+
*/
|
|
85
|
+
cdpUrl?: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Timeout At
|
|
88
|
+
* Format: date-time
|
|
89
|
+
* @description Timestamp when the session will timeout
|
|
90
|
+
*/
|
|
91
|
+
timeoutAt: string;
|
|
92
|
+
/**
|
|
93
|
+
* Started At
|
|
94
|
+
* Format: date-time
|
|
95
|
+
* @description Timestamp when the session was created and started
|
|
96
|
+
*/
|
|
97
|
+
startedAt: string;
|
|
98
|
+
/**
|
|
99
|
+
* Finished At
|
|
100
|
+
* @description Timestamp when the session was stopped (None if still active)
|
|
101
|
+
*/
|
|
102
|
+
finishedAt?: string | null;
|
|
103
|
+
/**
|
|
104
|
+
* Proxy Used MB
|
|
105
|
+
* @description Amount of proxy data used in MB
|
|
106
|
+
* @default 0
|
|
107
|
+
*/
|
|
108
|
+
proxyUsedMb: string;
|
|
109
|
+
/**
|
|
110
|
+
* Proxy Cost
|
|
111
|
+
* @description Cost of proxy usage in USD
|
|
112
|
+
* @default 0
|
|
113
|
+
*/
|
|
114
|
+
proxyCost: string;
|
|
115
|
+
/**
|
|
116
|
+
* Browser Cost
|
|
117
|
+
* @description Cost of browser session hosting in USD
|
|
118
|
+
* @default 0
|
|
119
|
+
*/
|
|
120
|
+
browserCost: string;
|
|
121
|
+
/**
|
|
122
|
+
* Agent Session ID
|
|
123
|
+
* @description ID of the agent session that created this browser (None for standalone BaaS sessions)
|
|
124
|
+
*/
|
|
125
|
+
agentSessionId?: string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Recording URL
|
|
128
|
+
* @description Presigned URL to download the session recording (available after session ends, if recording was enabled)
|
|
129
|
+
*/
|
|
130
|
+
recordingUrl?: string | null;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* BrowserSessionListResponse
|
|
134
|
+
* @description Response model for paginated browser session list requests.
|
|
135
|
+
*/
|
|
136
|
+
BrowserSessionListResponse: {
|
|
137
|
+
/**
|
|
138
|
+
* Items
|
|
139
|
+
* @description List of browser session views for the current page
|
|
140
|
+
*/
|
|
141
|
+
items: components["schemas"]["BrowserSessionItemView"][];
|
|
142
|
+
/**
|
|
143
|
+
* Total Items
|
|
144
|
+
* @description Total number of items in the list
|
|
145
|
+
*/
|
|
146
|
+
totalItems: number;
|
|
147
|
+
/**
|
|
148
|
+
* Page Number
|
|
149
|
+
* @description Page number
|
|
150
|
+
*/
|
|
151
|
+
pageNumber: number;
|
|
152
|
+
/**
|
|
153
|
+
* Page Size
|
|
154
|
+
* @description Number of items per page
|
|
155
|
+
*/
|
|
156
|
+
pageSize: number;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* BrowserSessionStatus
|
|
160
|
+
* @description Enumeration of possible browser session states
|
|
161
|
+
*
|
|
162
|
+
* Attributes:
|
|
163
|
+
* ACTIVE: Session is currently active and running (browser is running)
|
|
164
|
+
* STOPPED: Session has been stopped and is no longer active (browser is stopped)
|
|
165
|
+
* @enum {string}
|
|
166
|
+
*/
|
|
167
|
+
BrowserSessionStatus: "active" | "stopped";
|
|
168
|
+
/**
|
|
169
|
+
* BrowserSessionUpdateAction
|
|
170
|
+
* @description Available actions that can be performed on a browser session
|
|
171
|
+
*
|
|
172
|
+
* Attributes:
|
|
173
|
+
* STOP: Stop the browser session (cannot be undone)
|
|
174
|
+
* @enum {string}
|
|
175
|
+
*/
|
|
176
|
+
BrowserSessionUpdateAction: "stop";
|
|
177
|
+
/**
|
|
178
|
+
* BrowserSessionView
|
|
179
|
+
* @description View model for representing a browser session.
|
|
180
|
+
*/
|
|
181
|
+
BrowserSessionView: {
|
|
182
|
+
/**
|
|
183
|
+
* ID
|
|
184
|
+
* Format: uuid
|
|
185
|
+
* @description Unique identifier for the session
|
|
186
|
+
*/
|
|
187
|
+
id: string;
|
|
188
|
+
/**
|
|
189
|
+
* Status
|
|
190
|
+
* @description Current status of the session (active/stopped)
|
|
191
|
+
*/
|
|
192
|
+
status: components["schemas"]["BrowserSessionStatus"];
|
|
193
|
+
/**
|
|
194
|
+
* Live URL
|
|
195
|
+
* @description URL where the browser can be viewed live in real-time
|
|
196
|
+
*/
|
|
197
|
+
liveUrl?: string | null;
|
|
198
|
+
/**
|
|
199
|
+
* CDP URL
|
|
200
|
+
* @description Chrome DevTools Protocol URL for browser automation
|
|
201
|
+
*/
|
|
202
|
+
cdpUrl?: string | null;
|
|
203
|
+
/**
|
|
204
|
+
* Timeout At
|
|
205
|
+
* Format: date-time
|
|
206
|
+
* @description Timestamp when the session will timeout
|
|
207
|
+
*/
|
|
208
|
+
timeoutAt: string;
|
|
209
|
+
/**
|
|
210
|
+
* Started At
|
|
211
|
+
* Format: date-time
|
|
212
|
+
* @description Timestamp when the session was created and started
|
|
213
|
+
*/
|
|
214
|
+
startedAt: string;
|
|
215
|
+
/**
|
|
216
|
+
* Finished At
|
|
217
|
+
* @description Timestamp when the session was stopped (None if still active)
|
|
218
|
+
*/
|
|
219
|
+
finishedAt?: string | null;
|
|
220
|
+
/**
|
|
221
|
+
* Proxy Used MB
|
|
222
|
+
* @description Amount of proxy data used in MB
|
|
223
|
+
* @default 0
|
|
224
|
+
*/
|
|
225
|
+
proxyUsedMb: string;
|
|
226
|
+
/**
|
|
227
|
+
* Proxy Cost
|
|
228
|
+
* @description Cost of proxy usage in USD
|
|
229
|
+
* @default 0
|
|
230
|
+
*/
|
|
231
|
+
proxyCost: string;
|
|
232
|
+
/**
|
|
233
|
+
* Browser Cost
|
|
234
|
+
* @description Cost of browser session hosting in USD
|
|
235
|
+
* @default 0
|
|
236
|
+
*/
|
|
237
|
+
browserCost: string;
|
|
238
|
+
/**
|
|
239
|
+
* Agent Session ID
|
|
240
|
+
* @description ID of the agent session that created this browser (None for standalone BaaS sessions)
|
|
241
|
+
*/
|
|
242
|
+
agentSessionId?: string | null;
|
|
243
|
+
/**
|
|
244
|
+
* Recording URL
|
|
245
|
+
* @description Presigned URL to download the session recording (available after session ends, if recording was enabled)
|
|
246
|
+
*/
|
|
247
|
+
recordingUrl?: string | null;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* BuAgentSessionStatus
|
|
251
|
+
* @description Session lifecycle status. Progresses through: created → idle → running → idle → ... → stopped / timed_out / error.
|
|
252
|
+
*
|
|
253
|
+
* - `created`: Sandbox is starting up. The session is not yet ready to accept tasks.
|
|
254
|
+
* - `idle`: Sandbox is healthy and waiting for a task. You can dispatch a task or upload files.
|
|
255
|
+
* - `running`: A task is currently being executed by the agent.
|
|
256
|
+
* - `stopped`: Session was stopped — either explicitly via the stop endpoint, or automatically after task completion (when `keepAlive` is false).
|
|
257
|
+
* - `timed_out`: Session was cleaned up due to inactivity timeout.
|
|
258
|
+
* - `error`: Sandbox failed to start or encountered an unrecoverable error.
|
|
259
|
+
* @enum {string}
|
|
260
|
+
*/
|
|
261
|
+
BuAgentSessionStatus: "created" | "idle" | "running" | "stopped" | "timed_out" | "error";
|
|
262
|
+
/**
|
|
263
|
+
* BuModel
|
|
264
|
+
* @description The model to use for the agent. Each model has different capabilities and pricing.
|
|
265
|
+
*
|
|
266
|
+
* - `bu-mini` / `gemini-3-flash`: Gemini 3 Flash — fast and cost-effective. Best for simple, well-defined tasks like form filling or data extraction.
|
|
267
|
+
* - `bu-max` / `claude-sonnet-4.6`: Claude Sonnet 4.6 — balanced performance. Best for multi-step workflows that require reasoning and decision-making.
|
|
268
|
+
* - `bu-ultra` / `claude-opus-4.6`: Claude Opus 4.6 — most capable. Best for complex tasks that require advanced reasoning, long-horizon planning, or handling ambiguous instructions.
|
|
269
|
+
* - `gpt-5.4-mini`: GPT-5.4 mini — OpenAI's fast and efficient model. Best for tasks that benefit from OpenAI's capabilities.
|
|
270
|
+
* @enum {string}
|
|
271
|
+
*/
|
|
272
|
+
BuModel: "bu-mini" | "bu-max" | "bu-ultra" | "gemini-3-flash" | "claude-sonnet-4.6" | "claude-opus-4.6" | "gpt-5.4-mini";
|
|
273
|
+
/**
|
|
274
|
+
* CreateBrowserSessionRequest
|
|
275
|
+
* @description Request model for creating a browser session.
|
|
276
|
+
*/
|
|
277
|
+
CreateBrowserSessionRequest: {
|
|
278
|
+
/**
|
|
279
|
+
* Profile ID
|
|
280
|
+
* @description The ID of the profile to use for the session
|
|
281
|
+
*/
|
|
282
|
+
profileId?: string | null;
|
|
283
|
+
/**
|
|
284
|
+
* Proxy Country Code
|
|
285
|
+
* @description Country code for proxy location. Defaults to US. Set to null to disable proxy.
|
|
286
|
+
* @default us
|
|
287
|
+
*/
|
|
288
|
+
proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
|
|
289
|
+
/**
|
|
290
|
+
* Timeout
|
|
291
|
+
* @description The timeout for the session in minutes. All users can use up to 240 minutes (4 hours). Pay As You Go users are charged $0.06/hour, subscribers get 50% off.
|
|
292
|
+
* @default 60
|
|
293
|
+
*/
|
|
294
|
+
timeout: number;
|
|
295
|
+
/**
|
|
296
|
+
* Browser Screen Width
|
|
297
|
+
* @description Custom screen width in pixels for the browser.
|
|
298
|
+
*/
|
|
299
|
+
browserScreenWidth?: number | null;
|
|
300
|
+
/**
|
|
301
|
+
* Browser Screen Height
|
|
302
|
+
* @description Custom screen height in pixels for the browser.
|
|
303
|
+
*/
|
|
304
|
+
browserScreenHeight?: number | null;
|
|
305
|
+
/**
|
|
306
|
+
* Allow Resizing
|
|
307
|
+
* @description Whether to allow the browser to be resized during the session (not recommended since it reduces stealthiness).
|
|
308
|
+
* @default false
|
|
309
|
+
*/
|
|
310
|
+
allowResizing: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Custom Proxy
|
|
313
|
+
* @description Custom proxy settings to use for the session. If not provided, our proxies will be used. Custom proxies are available on any active subscription.
|
|
314
|
+
*/
|
|
315
|
+
customProxy?: components["schemas"]["CustomProxy"] | null;
|
|
316
|
+
/**
|
|
317
|
+
* Enable Recording
|
|
318
|
+
* @description If True, enables session recording. Defaults to False.
|
|
319
|
+
* @default false
|
|
320
|
+
*/
|
|
321
|
+
enableRecording: boolean;
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* CustomProxy
|
|
325
|
+
* @description Request model for creating a custom proxy.
|
|
326
|
+
*/
|
|
327
|
+
CustomProxy: {
|
|
328
|
+
/**
|
|
329
|
+
* Host
|
|
330
|
+
* @description Host of the proxy.
|
|
331
|
+
*/
|
|
332
|
+
host: string;
|
|
333
|
+
/**
|
|
334
|
+
* Port
|
|
335
|
+
* @description Port of the proxy.
|
|
336
|
+
*/
|
|
337
|
+
port: number;
|
|
338
|
+
/**
|
|
339
|
+
* Username
|
|
340
|
+
* @description Username for proxy authentication.
|
|
341
|
+
*/
|
|
342
|
+
username?: string | null;
|
|
343
|
+
/**
|
|
344
|
+
* Password
|
|
345
|
+
* @description Password for proxy authentication.
|
|
346
|
+
*/
|
|
347
|
+
password?: string | null;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* FileInfo
|
|
351
|
+
* @description A file in a session's workspace.
|
|
352
|
+
*/
|
|
353
|
+
FileInfo: {
|
|
354
|
+
/**
|
|
355
|
+
* Path
|
|
356
|
+
* @description File path relative to the session workspace root.
|
|
357
|
+
*/
|
|
358
|
+
path: string;
|
|
359
|
+
/**
|
|
360
|
+
* Size
|
|
361
|
+
* @description File size in bytes.
|
|
362
|
+
*/
|
|
363
|
+
size: number;
|
|
364
|
+
/**
|
|
365
|
+
* Lastmodified
|
|
366
|
+
* Format: date-time
|
|
367
|
+
* @description When the file was last modified.
|
|
368
|
+
*/
|
|
369
|
+
lastModified: string;
|
|
370
|
+
/**
|
|
371
|
+
* Url
|
|
372
|
+
* @description Presigned download URL (60s expiry). Only included when `includeUrls=true`.
|
|
373
|
+
*/
|
|
374
|
+
url?: string | null;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* FileListResponse
|
|
378
|
+
* @description Paginated file listing with optional presigned download URLs.
|
|
379
|
+
*/
|
|
380
|
+
FileListResponse: {
|
|
381
|
+
/** Files */
|
|
382
|
+
files: components["schemas"]["FileInfo"][];
|
|
383
|
+
/**
|
|
384
|
+
* Folders
|
|
385
|
+
* @description Immediate sub-folder names at this prefix level
|
|
386
|
+
*/
|
|
387
|
+
folders?: string[];
|
|
388
|
+
/**
|
|
389
|
+
* Nextcursor
|
|
390
|
+
* @description Cursor for the next page. Pass as the `cursor` query parameter to fetch the next page.
|
|
391
|
+
*/
|
|
392
|
+
nextCursor?: string | null;
|
|
393
|
+
/**
|
|
394
|
+
* Hasmore
|
|
395
|
+
* @description Whether there are more files beyond this page.
|
|
396
|
+
* @default false
|
|
397
|
+
*/
|
|
398
|
+
hasMore: boolean;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* FileUploadItem
|
|
402
|
+
* @description A single file to upload.
|
|
403
|
+
*/
|
|
404
|
+
FileUploadItem: {
|
|
405
|
+
/**
|
|
406
|
+
* Name
|
|
407
|
+
* @description Filename, e.g. "data.csv"
|
|
408
|
+
*/
|
|
409
|
+
name: string;
|
|
410
|
+
/**
|
|
411
|
+
* Contenttype
|
|
412
|
+
* @description MIME type, e.g. "text/csv"
|
|
413
|
+
* @default application/octet-stream
|
|
414
|
+
*/
|
|
415
|
+
contentType: string;
|
|
416
|
+
/**
|
|
417
|
+
* Size
|
|
418
|
+
* @description File size in bytes (required for workspace uploads)
|
|
419
|
+
*/
|
|
420
|
+
size?: number | null;
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* FileUploadRequest
|
|
424
|
+
* @description Request body for generating presigned upload URLs.
|
|
425
|
+
*/
|
|
426
|
+
FileUploadRequest: {
|
|
427
|
+
/** Files */
|
|
428
|
+
files: components["schemas"]["FileUploadItem"][];
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* FileUploadResponse
|
|
432
|
+
* @description Presigned upload URLs for the requested files.
|
|
433
|
+
*/
|
|
434
|
+
FileUploadResponse: {
|
|
435
|
+
/** Files */
|
|
436
|
+
files: components["schemas"]["FileUploadResponseItem"][];
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* FileUploadResponseItem
|
|
440
|
+
* @description Presigned upload URL for a single file.
|
|
441
|
+
*/
|
|
442
|
+
FileUploadResponseItem: {
|
|
443
|
+
/**
|
|
444
|
+
* Name
|
|
445
|
+
* @description Original filename as requested.
|
|
446
|
+
*/
|
|
447
|
+
name: string;
|
|
448
|
+
/**
|
|
449
|
+
* Uploadurl
|
|
450
|
+
* @description Presigned PUT URL. Upload the file by sending a PUT request to this URL with the file content and matching Content-Type header. Expires after 5 minutes.
|
|
451
|
+
*/
|
|
452
|
+
uploadUrl: string;
|
|
453
|
+
/**
|
|
454
|
+
* Path
|
|
455
|
+
* @description Path where the file will be stored in the workspace, e.g. "uploads/data.csv".
|
|
456
|
+
*/
|
|
457
|
+
path: string;
|
|
458
|
+
};
|
|
459
|
+
/** HTTPValidationError */
|
|
460
|
+
HTTPValidationError: {
|
|
461
|
+
/** Detail */
|
|
462
|
+
detail?: components["schemas"]["ValidationError"][];
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* InsufficientCreditsError
|
|
466
|
+
* @description Error response when there are insufficient credits
|
|
467
|
+
*/
|
|
468
|
+
InsufficientCreditsError: {
|
|
469
|
+
/**
|
|
470
|
+
* Detail
|
|
471
|
+
* @default Insufficient credits
|
|
472
|
+
*/
|
|
473
|
+
detail: string;
|
|
474
|
+
};
|
|
475
|
+
/** MessageListResponse */
|
|
476
|
+
MessageListResponse: {
|
|
477
|
+
/**
|
|
478
|
+
* Messages
|
|
479
|
+
* @description List of messages in chronological order.
|
|
480
|
+
*/
|
|
481
|
+
messages: components["schemas"]["MessageResponse"][];
|
|
482
|
+
/**
|
|
483
|
+
* Hasmore
|
|
484
|
+
* @description Whether there are more messages available beyond this page. Use cursor-based pagination with the `after` or `before` query parameters to fetch more.
|
|
485
|
+
*/
|
|
486
|
+
hasMore: boolean;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* MessageResponse
|
|
490
|
+
* @description A single message from the session's message stream.
|
|
491
|
+
*
|
|
492
|
+
* Messages represent the agent's actions, observations, and decisions as it executes a task.
|
|
493
|
+
*/
|
|
494
|
+
MessageResponse: {
|
|
495
|
+
/**
|
|
496
|
+
* Id
|
|
497
|
+
* Format: uuid
|
|
498
|
+
* @description Unique message identifier.
|
|
499
|
+
*/
|
|
500
|
+
id: string;
|
|
501
|
+
/**
|
|
502
|
+
* Sessionid
|
|
503
|
+
* Format: uuid
|
|
504
|
+
* @description ID of the session this message belongs to.
|
|
505
|
+
*/
|
|
506
|
+
sessionId: string;
|
|
507
|
+
/**
|
|
508
|
+
* Role
|
|
509
|
+
* @description Message role: "human" for user-submitted tasks, "ai" for agent actions and responses.
|
|
510
|
+
*/
|
|
511
|
+
role: string;
|
|
512
|
+
/**
|
|
513
|
+
* Data
|
|
514
|
+
* @description Raw message content. Format depends on the message type — may be plain text, JSON, or structured action data.
|
|
515
|
+
*/
|
|
516
|
+
data: string;
|
|
517
|
+
/**
|
|
518
|
+
* Type
|
|
519
|
+
* @description Message category. Common values: `user_message`, `assistant_message`, `browser_action`, `file_operation`, `code_execution`, `integration`, `planning`, `completion`, `browser_action_result`, `browser_action_error`.
|
|
520
|
+
* @default
|
|
521
|
+
*/
|
|
522
|
+
type: string;
|
|
523
|
+
/**
|
|
524
|
+
* Summary
|
|
525
|
+
* @description One-liner human-readable description of the message (e.g. "Navigating to google.com", "Clicking element #5"). Useful for building activity feeds.
|
|
526
|
+
* @default
|
|
527
|
+
*/
|
|
528
|
+
summary: string;
|
|
529
|
+
/**
|
|
530
|
+
* Screenshoturl
|
|
531
|
+
* @description Browser screenshot captured at the time of this message. Presigned URL, expires after 5 minutes.
|
|
532
|
+
*/
|
|
533
|
+
screenshotUrl?: string | null;
|
|
534
|
+
/**
|
|
535
|
+
* Hidden
|
|
536
|
+
* @description Whether this message should be hidden from the user in a chat UI.
|
|
537
|
+
* @default false
|
|
538
|
+
*/
|
|
539
|
+
hidden: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* Createdat
|
|
542
|
+
* Format: date-time
|
|
543
|
+
* @description When this message was created.
|
|
544
|
+
*/
|
|
545
|
+
createdAt: string;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* PlanInfo
|
|
549
|
+
* @description View model for plan information
|
|
550
|
+
*/
|
|
551
|
+
PlanInfo: {
|
|
552
|
+
/**
|
|
553
|
+
* Plan Name
|
|
554
|
+
* @description The name of the plan
|
|
555
|
+
*/
|
|
556
|
+
planName: string;
|
|
557
|
+
/**
|
|
558
|
+
* Subscription Status
|
|
559
|
+
* @description The status of the subscription
|
|
560
|
+
*/
|
|
561
|
+
subscriptionStatus: string | null;
|
|
562
|
+
/**
|
|
563
|
+
* Subscription ID
|
|
564
|
+
* @description The ID of the subscription
|
|
565
|
+
*/
|
|
566
|
+
subscriptionId: string | null;
|
|
567
|
+
/**
|
|
568
|
+
* Subscription Current Period End
|
|
569
|
+
* @description The end of the current period
|
|
570
|
+
*/
|
|
571
|
+
subscriptionCurrentPeriodEnd: string | null;
|
|
572
|
+
/**
|
|
573
|
+
* Subscription Canceled At
|
|
574
|
+
* @description The date the subscription was canceled
|
|
575
|
+
*/
|
|
576
|
+
subscriptionCanceledAt: string | null;
|
|
577
|
+
};
|
|
578
|
+
/**
|
|
579
|
+
* ProfileCreateRequest
|
|
580
|
+
* @description Request model for creating a new profile.
|
|
581
|
+
*/
|
|
582
|
+
ProfileCreateRequest: {
|
|
583
|
+
/**
|
|
584
|
+
* Name
|
|
585
|
+
* @description Optional name for the profile
|
|
586
|
+
*/
|
|
587
|
+
name?: string | null;
|
|
588
|
+
/**
|
|
589
|
+
* User ID
|
|
590
|
+
* @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
|
|
591
|
+
*/
|
|
592
|
+
userId?: string | null;
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* ProfileListResponse
|
|
596
|
+
* @description Response model for paginated profile list requests.
|
|
597
|
+
*/
|
|
598
|
+
ProfileListResponse: {
|
|
599
|
+
/**
|
|
600
|
+
* Items
|
|
601
|
+
* @description List of profile views for the current page
|
|
602
|
+
*/
|
|
603
|
+
items: components["schemas"]["ProfileView"][];
|
|
604
|
+
/**
|
|
605
|
+
* Total Items
|
|
606
|
+
* @description Total number of items in the list
|
|
607
|
+
*/
|
|
608
|
+
totalItems: number;
|
|
609
|
+
/**
|
|
610
|
+
* Page Number
|
|
611
|
+
* @description Page number
|
|
612
|
+
*/
|
|
613
|
+
pageNumber: number;
|
|
614
|
+
/**
|
|
615
|
+
* Page Size
|
|
616
|
+
* @description Number of items per page
|
|
617
|
+
*/
|
|
618
|
+
pageSize: number;
|
|
619
|
+
};
|
|
620
|
+
/**
|
|
621
|
+
* ProfileNotFoundError
|
|
622
|
+
* @description Error response when a profile is not found
|
|
623
|
+
*/
|
|
624
|
+
ProfileNotFoundError: {
|
|
625
|
+
/**
|
|
626
|
+
* Detail
|
|
627
|
+
* @default Profile not found
|
|
628
|
+
*/
|
|
629
|
+
detail: string;
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* ProfileUpdateRequest
|
|
633
|
+
* @description Request model for updating a profile.
|
|
634
|
+
*/
|
|
635
|
+
ProfileUpdateRequest: {
|
|
636
|
+
/**
|
|
637
|
+
* Name
|
|
638
|
+
* @description Optional name for the profile
|
|
639
|
+
*/
|
|
640
|
+
name?: string | null;
|
|
641
|
+
/**
|
|
642
|
+
* User ID
|
|
643
|
+
* @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
|
|
644
|
+
*/
|
|
645
|
+
userId?: string | null;
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* ProfileView
|
|
649
|
+
* @description View model for representing a profile. A profile lets you preserve the login state between sessions.
|
|
650
|
+
*
|
|
651
|
+
* We recommend that you create a separate profile for each user of your app.
|
|
652
|
+
* You can assign a user_id to each profile to easily identify which user the profile belongs to.
|
|
653
|
+
*/
|
|
654
|
+
ProfileView: {
|
|
655
|
+
/**
|
|
656
|
+
* ID
|
|
657
|
+
* Format: uuid
|
|
658
|
+
* @description Unique identifier for the profile
|
|
659
|
+
*/
|
|
660
|
+
id: string;
|
|
661
|
+
/**
|
|
662
|
+
* User ID
|
|
663
|
+
* @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
|
|
664
|
+
*/
|
|
665
|
+
userId?: string | null;
|
|
666
|
+
/**
|
|
667
|
+
* Name
|
|
668
|
+
* @description Optional name for the profile
|
|
669
|
+
*/
|
|
670
|
+
name?: string | null;
|
|
671
|
+
/**
|
|
672
|
+
* Last Used At
|
|
673
|
+
* @description Timestamp when the profile was last used
|
|
674
|
+
*/
|
|
675
|
+
lastUsedAt?: string | null;
|
|
676
|
+
/**
|
|
677
|
+
* Created At
|
|
678
|
+
* Format: date-time
|
|
679
|
+
* @description Timestamp when the profile was created
|
|
680
|
+
*/
|
|
681
|
+
createdAt: string;
|
|
682
|
+
/**
|
|
683
|
+
* Updated At
|
|
684
|
+
* Format: date-time
|
|
685
|
+
* @description Timestamp when the profile was last updated
|
|
686
|
+
*/
|
|
687
|
+
updatedAt: string;
|
|
688
|
+
/**
|
|
689
|
+
* Cookie Domains
|
|
690
|
+
* @description List of domain URLs that have cookies stored for this profile
|
|
691
|
+
*/
|
|
692
|
+
cookieDomains?: string[] | null;
|
|
693
|
+
};
|
|
694
|
+
/**
|
|
695
|
+
* ProxyCountryCode
|
|
696
|
+
* @enum {string}
|
|
697
|
+
*/
|
|
698
|
+
ProxyCountryCode: "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "an" | "ao" | "aq" | "ar" | "as" | "at" | "au" | "aw" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ck" | "cl" | "cm" | "co" | "cr" | "cs" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "pg" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "uk" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "xk" | "ye" | "yt" | "za" | "zm" | "zw";
|
|
699
|
+
/**
|
|
700
|
+
* RunTaskRequest
|
|
701
|
+
* @description Create a new session, dispatch a task, or both.
|
|
702
|
+
*
|
|
703
|
+
* - **No `sessionId` + no `task`**: creates an idle session (useful for uploading files before running a task).
|
|
704
|
+
* - **No `sessionId` + `task`**: creates a new session and immediately runs the task.
|
|
705
|
+
* - **`sessionId` + `task`**: dispatches the task to an existing idle session.
|
|
706
|
+
* - **`sessionId` + no `task`**: returns 422 — a task is required when targeting an existing session.
|
|
707
|
+
*/
|
|
708
|
+
RunTaskRequest: {
|
|
709
|
+
/**
|
|
710
|
+
* Task
|
|
711
|
+
* @description The natural-language instruction for the agent to execute (e.g. "Go to amazon.com and find the best-rated wireless mouse under $50"). Required when dispatching to an existing session.
|
|
712
|
+
*/
|
|
713
|
+
task?: string | null;
|
|
714
|
+
/**
|
|
715
|
+
* @description The model to use. "gemini-3-flash" is fast and cheap, "claude-sonnet-4.6" is balanced, "claude-opus-4.6" is most capable. See BuModel for details.
|
|
716
|
+
* @default claude-sonnet-4.6
|
|
717
|
+
*/
|
|
718
|
+
model: components["schemas"]["BuModel"];
|
|
719
|
+
/**
|
|
720
|
+
* Sessionid
|
|
721
|
+
* @description ID of an existing idle session to dispatch the task to. If omitted, a new session is created.
|
|
722
|
+
*/
|
|
723
|
+
sessionId?: string | null;
|
|
724
|
+
/**
|
|
725
|
+
* Keepalive
|
|
726
|
+
* @description If true, the session stays alive in idle state after the task completes instead of automatically stopping. This lets you dispatch follow-up tasks to the same session, preserving browser state and files.
|
|
727
|
+
* @default false
|
|
728
|
+
*/
|
|
729
|
+
keepAlive: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Maxcostusd
|
|
732
|
+
* @description Maximum total cost in USD allowed for this session. The task will be stopped if this limit is reached. If omitted, a default limit applies (capped by your available balance).
|
|
733
|
+
*/
|
|
734
|
+
maxCostUsd?: number | string | null;
|
|
735
|
+
/**
|
|
736
|
+
* Profileid
|
|
737
|
+
* @description ID of a browser profile to load into the session. Profiles persist cookies, local storage, and other browser state across sessions. Create profiles via the Profiles API.
|
|
738
|
+
*/
|
|
739
|
+
profileId?: string | null;
|
|
740
|
+
/**
|
|
741
|
+
* Workspaceid
|
|
742
|
+
* @description ID of a workspace to attach to the session. Workspaces provide persistent file storage that carries across sessions. Create workspaces via the Workspaces API.
|
|
743
|
+
*/
|
|
744
|
+
workspaceId?: string | null;
|
|
745
|
+
/**
|
|
746
|
+
* @description Country code for the browser proxy (e.g. "US", "DE", "JP"). Set to null to disable the proxy. The proxy routes browser traffic through the specified country, useful for accessing geo-restricted content.
|
|
747
|
+
* @default us
|
|
748
|
+
*/
|
|
749
|
+
proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
|
|
750
|
+
/**
|
|
751
|
+
* Outputschema
|
|
752
|
+
* @description A JSON Schema that the agent's final output must conform to. When set, the agent will return structured data matching this schema in the `output` field of the response. Example: {"type": "object", "properties": {"price": {"type": "number"}, "title": {"type": "string"}}}.
|
|
753
|
+
*/
|
|
754
|
+
outputSchema?: {
|
|
755
|
+
[key: string]: unknown;
|
|
756
|
+
} | null;
|
|
757
|
+
/**
|
|
758
|
+
* Enablescheduledtasks
|
|
759
|
+
* @description If true, the agent can create scheduled tasks that run on a recurring basis (e.g. "every Monday morning, check my inbox and summarize new emails"). Scheduled tasks are tied to your project and persist beyond the session. Note: all scheduled tasks are visible project-wide, so avoid enabling this in multi-user setups where task isolation is needed.
|
|
760
|
+
* @default false
|
|
761
|
+
*/
|
|
762
|
+
enableScheduledTasks: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Sensitivedata
|
|
765
|
+
* @description Key-value pairs of sensitive data (e.g. passwords, API keys) that the agent can use via secure placeholders. Keys are exposed to the LLM; values are never shown. The agent uses `<secret>key</secret>` placeholders in browser_type_text to securely enter values. WARNING: sensitive data may be visible in screenshots if the page renders values in unmasked form fields.
|
|
766
|
+
*/
|
|
767
|
+
sensitiveData?: {
|
|
768
|
+
[key: string]: string;
|
|
769
|
+
} | null;
|
|
770
|
+
/**
|
|
771
|
+
* Enablerecording
|
|
772
|
+
* @description If true, records a video of the browser session. The recording URLs will be available in the `recordingUrls` field of the session response after the task completes.
|
|
773
|
+
* @default false
|
|
774
|
+
*/
|
|
775
|
+
enableRecording: boolean;
|
|
776
|
+
/**
|
|
777
|
+
* Skills
|
|
778
|
+
* @description If true, enables built-in agent skills like Google Sheets integration and file management. Set to false to restrict the agent to browser-only actions.
|
|
779
|
+
* @default true
|
|
780
|
+
*/
|
|
781
|
+
skills: boolean;
|
|
782
|
+
/**
|
|
783
|
+
* Agentmail
|
|
784
|
+
* @description If true, provisions a temporary email inbox (via AgentMail) for the session. The email address is available in the `agentmailEmail` field of the session response. Useful for tasks that require email verification or sign-ups.
|
|
785
|
+
* @default true
|
|
786
|
+
*/
|
|
787
|
+
agentmail: boolean;
|
|
788
|
+
/**
|
|
789
|
+
* Cachescript
|
|
790
|
+
* @description Controls deterministic script caching. `null` (default): auto-detected — enabled when the task contains `@{{value}}` brackets and a workspace is attached. `true`: force-enable script caching even without brackets (caches the exact task). `false`: force-disable, even if brackets are present. When active, the first call runs the full agent and saves a reusable script. Subsequent calls with the same task template execute the cached script with $0 LLM cost. Requires workspace_id when enabled. Example: "Get prices from @{{https://example.com}} for @{{electronics}}".
|
|
791
|
+
*/
|
|
792
|
+
cacheScript?: boolean | null;
|
|
793
|
+
/**
|
|
794
|
+
* Autoheal
|
|
795
|
+
* @description When cache_script is active, controls whether a lightweight LLM validates the cached script output. If the output looks incorrect (empty, error, wrong structure), the system automatically re-triggers the full agent to generate a new version of the script. Set to false to disable validation and always return the raw script output.
|
|
796
|
+
* @default true
|
|
797
|
+
*/
|
|
798
|
+
autoHeal: boolean;
|
|
799
|
+
};
|
|
800
|
+
/** SessionListResponse */
|
|
801
|
+
SessionListResponse: {
|
|
802
|
+
/**
|
|
803
|
+
* Sessions
|
|
804
|
+
* @description List of sessions.
|
|
805
|
+
*/
|
|
806
|
+
sessions: components["schemas"]["SessionResponse"][];
|
|
807
|
+
/**
|
|
808
|
+
* Total
|
|
809
|
+
* @description Total number of sessions matching the query.
|
|
810
|
+
*/
|
|
811
|
+
total: number;
|
|
812
|
+
/**
|
|
813
|
+
* Page
|
|
814
|
+
* @description Current page number (1-indexed).
|
|
815
|
+
*/
|
|
816
|
+
page: number;
|
|
817
|
+
/**
|
|
818
|
+
* Pagesize
|
|
819
|
+
* @description Number of sessions per page.
|
|
820
|
+
*/
|
|
821
|
+
pageSize: number;
|
|
822
|
+
};
|
|
823
|
+
/**
|
|
824
|
+
* SessionNotFoundError
|
|
825
|
+
* @description Error response when a session is not found
|
|
826
|
+
*/
|
|
827
|
+
SessionNotFoundError: {
|
|
828
|
+
/**
|
|
829
|
+
* Detail
|
|
830
|
+
* @default Session not found
|
|
831
|
+
*/
|
|
832
|
+
detail: string;
|
|
833
|
+
};
|
|
834
|
+
/**
|
|
835
|
+
* SessionResponse
|
|
836
|
+
* @description Represents a session and its current state.
|
|
837
|
+
*
|
|
838
|
+
* Poll this endpoint to track task progress. The `status` field indicates the session lifecycle stage,
|
|
839
|
+
* and `output` contains the agent's structured result once the task completes.
|
|
840
|
+
*/
|
|
841
|
+
SessionResponse: {
|
|
842
|
+
/**
|
|
843
|
+
* Id
|
|
844
|
+
* Format: uuid
|
|
845
|
+
* @description Unique session identifier.
|
|
846
|
+
*/
|
|
847
|
+
id: string;
|
|
848
|
+
/** @description Current session lifecycle status. Progresses through: `created` (sandbox starting) → `idle` (ready, waiting for task) → `running` (task executing) → `stopped` / `timed_out` / `error`. Poll this field to track progress. */
|
|
849
|
+
status: components["schemas"]["BuAgentSessionStatus"];
|
|
850
|
+
/** @description The model tier used for this session. */
|
|
851
|
+
model: components["schemas"]["BuModel"];
|
|
852
|
+
/**
|
|
853
|
+
* Title
|
|
854
|
+
* @description Auto-generated short title summarizing the task. Available after the task starts running.
|
|
855
|
+
*/
|
|
856
|
+
title?: string | null;
|
|
857
|
+
/**
|
|
858
|
+
* Output
|
|
859
|
+
* @description The agent's final output. If `outputSchema` was provided, this will be structured data conforming to that schema. Otherwise it may be a free-form string or null. Populated once the task completes, regardless of whether `isTaskSuccessful` is true or false.
|
|
860
|
+
*/
|
|
861
|
+
output?: unknown | null;
|
|
862
|
+
/**
|
|
863
|
+
* Outputschema
|
|
864
|
+
* @description The JSON Schema that was requested for structured output, if any.
|
|
865
|
+
*/
|
|
866
|
+
outputSchema?: {
|
|
867
|
+
[key: string]: unknown;
|
|
868
|
+
} | null;
|
|
869
|
+
/**
|
|
870
|
+
* Stepcount
|
|
871
|
+
* @description Number of steps the agent has executed so far.
|
|
872
|
+
* @default 0
|
|
873
|
+
*/
|
|
874
|
+
stepCount: number;
|
|
875
|
+
/**
|
|
876
|
+
* Laststepsummary
|
|
877
|
+
* @description Human-readable summary of the most recent agent step (e.g. "Clicking the Submit button"). Useful for showing real-time progress.
|
|
878
|
+
*/
|
|
879
|
+
lastStepSummary?: string | null;
|
|
880
|
+
/**
|
|
881
|
+
* Istasksuccessful
|
|
882
|
+
* @description Whether the task completed successfully. `true` if the agent achieved the goal, `false` if it failed or gave up, `null` if the task is still running or no task was dispatched.
|
|
883
|
+
*/
|
|
884
|
+
isTaskSuccessful?: boolean | null;
|
|
885
|
+
/**
|
|
886
|
+
* Liveurl
|
|
887
|
+
* @description URL to view the live browser session. Available immediately on session creation — can be embedded in an iframe to show the browser in real time.
|
|
888
|
+
*/
|
|
889
|
+
liveUrl?: string | null;
|
|
890
|
+
/**
|
|
891
|
+
* Recordingurls
|
|
892
|
+
* @description URLs to download session recordings. Only populated if `enableRecording` was set to true and the task has completed.
|
|
893
|
+
* @default []
|
|
894
|
+
*/
|
|
895
|
+
recordingUrls: string[];
|
|
896
|
+
/**
|
|
897
|
+
* Profileid
|
|
898
|
+
* @description ID of the browser profile loaded in this session, if any.
|
|
899
|
+
*/
|
|
900
|
+
profileId?: string | null;
|
|
901
|
+
/**
|
|
902
|
+
* Workspaceid
|
|
903
|
+
* @description ID of the workspace attached to this session, if any.
|
|
904
|
+
*/
|
|
905
|
+
workspaceId?: string | null;
|
|
906
|
+
/** @description Country code of the proxy used for this session, or null if no proxy. */
|
|
907
|
+
proxyCountryCode?: components["schemas"]["ProxyCountryCode"] | null;
|
|
908
|
+
/**
|
|
909
|
+
* Maxcostusd
|
|
910
|
+
* @description Maximum cost limit in USD set for this session.
|
|
911
|
+
*/
|
|
912
|
+
maxCostUsd?: string | null;
|
|
913
|
+
/**
|
|
914
|
+
* Totalinputtokens
|
|
915
|
+
* @description Total LLM input tokens consumed by this session.
|
|
916
|
+
* @default 0
|
|
917
|
+
*/
|
|
918
|
+
totalInputTokens: number;
|
|
919
|
+
/**
|
|
920
|
+
* Totaloutputtokens
|
|
921
|
+
* @description Total LLM output tokens consumed by this session.
|
|
922
|
+
* @default 0
|
|
923
|
+
*/
|
|
924
|
+
totalOutputTokens: number;
|
|
925
|
+
/**
|
|
926
|
+
* Proxyusedmb
|
|
927
|
+
* @description Proxy bandwidth used in megabytes.
|
|
928
|
+
* @default 0
|
|
929
|
+
*/
|
|
930
|
+
proxyUsedMb: string;
|
|
931
|
+
/**
|
|
932
|
+
* Llmcostusd
|
|
933
|
+
* @description Cost of LLM usage in USD.
|
|
934
|
+
* @default 0
|
|
935
|
+
*/
|
|
936
|
+
llmCostUsd: string;
|
|
937
|
+
/**
|
|
938
|
+
* Proxycostusd
|
|
939
|
+
* @description Cost of proxy bandwidth in USD.
|
|
940
|
+
* @default 0
|
|
941
|
+
*/
|
|
942
|
+
proxyCostUsd: string;
|
|
943
|
+
/**
|
|
944
|
+
* Browsercostusd
|
|
945
|
+
* @description Cost of browser compute time in USD.
|
|
946
|
+
* @default 0
|
|
947
|
+
*/
|
|
948
|
+
browserCostUsd: string;
|
|
949
|
+
/**
|
|
950
|
+
* Totalcostusd
|
|
951
|
+
* @description Total session cost in USD (LLM + proxy + browser).
|
|
952
|
+
* @default 0
|
|
953
|
+
*/
|
|
954
|
+
totalCostUsd: string;
|
|
955
|
+
/**
|
|
956
|
+
* Screenshoturl
|
|
957
|
+
* @description URL of the latest browser screenshot. This is a presigned URL that expires after 5 minutes. A new URL is generated each time you fetch the session.
|
|
958
|
+
*/
|
|
959
|
+
screenshotUrl?: string | null;
|
|
960
|
+
/**
|
|
961
|
+
* Agentmailemail
|
|
962
|
+
* @description Temporary email address provisioned for this session (via AgentMail). Only present if `agentmail` was enabled.
|
|
963
|
+
*/
|
|
964
|
+
agentmailEmail?: string | null;
|
|
965
|
+
/**
|
|
966
|
+
* Createdat
|
|
967
|
+
* Format: date-time
|
|
968
|
+
* @description When the session was created.
|
|
969
|
+
*/
|
|
970
|
+
createdAt: string;
|
|
971
|
+
/**
|
|
972
|
+
* Updatedat
|
|
973
|
+
* Format: date-time
|
|
974
|
+
* @description When the session was last updated.
|
|
975
|
+
*/
|
|
976
|
+
updatedAt: string;
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* SessionTimeoutLimitExceededError
|
|
980
|
+
* @description Error response when session timeout exceeds the maximum allowed limit
|
|
981
|
+
*/
|
|
982
|
+
SessionTimeoutLimitExceededError: {
|
|
983
|
+
/**
|
|
984
|
+
* Detail
|
|
985
|
+
* @default Maximum session timeout is 4 hours (240 minutes).
|
|
986
|
+
*/
|
|
987
|
+
detail: string;
|
|
988
|
+
};
|
|
989
|
+
/** StopSessionRequest */
|
|
990
|
+
StopSessionRequest: {
|
|
991
|
+
/**
|
|
992
|
+
* @description How to stop the session. Use "task" to stop only the current task and keep the session alive, or "session" to destroy the sandbox entirely.
|
|
993
|
+
* @default session
|
|
994
|
+
*/
|
|
995
|
+
strategy: components["schemas"]["StopStrategy"];
|
|
996
|
+
};
|
|
997
|
+
/**
|
|
998
|
+
* StopStrategy
|
|
999
|
+
* @description Strategy for stopping a session.
|
|
1000
|
+
*
|
|
1001
|
+
* - `task`: Stop the currently running task but keep the session alive in idle state. You can dispatch another task to the same session afterwards.
|
|
1002
|
+
* - `session`: Stop the session entirely and destroy the sandbox. The session cannot be reused after this.
|
|
1003
|
+
* @enum {string}
|
|
1004
|
+
*/
|
|
1005
|
+
StopStrategy: "task" | "session";
|
|
1006
|
+
/**
|
|
1007
|
+
* TooManyConcurrentActiveSessionsError
|
|
1008
|
+
* @description Error response when user has too many concurrent active sessions
|
|
1009
|
+
*/
|
|
1010
|
+
TooManyConcurrentActiveSessionsError: {
|
|
1011
|
+
/**
|
|
1012
|
+
* Detail
|
|
1013
|
+
* @default Too many concurrent active sessions. Please wait for one to finish, kill one, or upgrade your plan.
|
|
1014
|
+
*/
|
|
1015
|
+
detail: string;
|
|
1016
|
+
};
|
|
1017
|
+
/**
|
|
1018
|
+
* UpdateBrowserSessionRequest
|
|
1019
|
+
* @description Request model for updating browser session state.
|
|
1020
|
+
*/
|
|
1021
|
+
UpdateBrowserSessionRequest: {
|
|
1022
|
+
/**
|
|
1023
|
+
* Action
|
|
1024
|
+
* @description The action to perform on the session
|
|
1025
|
+
*/
|
|
1026
|
+
action: components["schemas"]["BrowserSessionUpdateAction"];
|
|
1027
|
+
};
|
|
1028
|
+
/** ValidationError */
|
|
1029
|
+
ValidationError: {
|
|
1030
|
+
/** Location */
|
|
1031
|
+
loc: (string | number)[];
|
|
1032
|
+
/** Message */
|
|
1033
|
+
msg: string;
|
|
1034
|
+
/** Error Type */
|
|
1035
|
+
type: string;
|
|
1036
|
+
};
|
|
1037
|
+
/**
|
|
1038
|
+
* WorkspaceCreateRequest
|
|
1039
|
+
* @description Request model for creating a new workspace.
|
|
1040
|
+
*/
|
|
1041
|
+
WorkspaceCreateRequest: {
|
|
1042
|
+
/**
|
|
1043
|
+
* Name
|
|
1044
|
+
* @description Optional name for the workspace
|
|
1045
|
+
*/
|
|
1046
|
+
name?: string | null;
|
|
1047
|
+
};
|
|
1048
|
+
/**
|
|
1049
|
+
* WorkspaceListResponse
|
|
1050
|
+
* @description Response model for paginated workspace list requests.
|
|
1051
|
+
*/
|
|
1052
|
+
WorkspaceListResponse: {
|
|
1053
|
+
/**
|
|
1054
|
+
* Items
|
|
1055
|
+
* @description List of workspace views for the current page
|
|
1056
|
+
*/
|
|
1057
|
+
items: components["schemas"]["WorkspaceView"][];
|
|
1058
|
+
/**
|
|
1059
|
+
* Total Items
|
|
1060
|
+
* @description Total number of items in the list
|
|
1061
|
+
*/
|
|
1062
|
+
totalItems: number;
|
|
1063
|
+
/**
|
|
1064
|
+
* Page Number
|
|
1065
|
+
* @description Page number
|
|
1066
|
+
*/
|
|
1067
|
+
pageNumber: number;
|
|
1068
|
+
/**
|
|
1069
|
+
* Page Size
|
|
1070
|
+
* @description Number of items per page
|
|
1071
|
+
*/
|
|
1072
|
+
pageSize: number;
|
|
1073
|
+
};
|
|
1074
|
+
/**
|
|
1075
|
+
* WorkspaceUpdateRequest
|
|
1076
|
+
* @description Request model for updating a workspace.
|
|
1077
|
+
*/
|
|
1078
|
+
WorkspaceUpdateRequest: {
|
|
1079
|
+
/**
|
|
1080
|
+
* Name
|
|
1081
|
+
* @description Optional name for the workspace
|
|
1082
|
+
*/
|
|
1083
|
+
name?: string | null;
|
|
1084
|
+
};
|
|
1085
|
+
/**
|
|
1086
|
+
* WorkspaceView
|
|
1087
|
+
* @description View model for a workspace — persistent shared storage across sessions.
|
|
1088
|
+
*/
|
|
1089
|
+
WorkspaceView: {
|
|
1090
|
+
/**
|
|
1091
|
+
* ID
|
|
1092
|
+
* Format: uuid
|
|
1093
|
+
* @description Unique identifier for the workspace
|
|
1094
|
+
*/
|
|
1095
|
+
id: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* Name
|
|
1098
|
+
* @description Optional name for the workspace
|
|
1099
|
+
*/
|
|
1100
|
+
name?: string | null;
|
|
1101
|
+
/**
|
|
1102
|
+
* Created At
|
|
1103
|
+
* Format: date-time
|
|
1104
|
+
* @description Timestamp when the workspace was created
|
|
1105
|
+
*/
|
|
1106
|
+
createdAt: string;
|
|
1107
|
+
/**
|
|
1108
|
+
* Updated At
|
|
1109
|
+
* Format: date-time
|
|
1110
|
+
* @description Timestamp when the workspace was last updated
|
|
1111
|
+
*/
|
|
1112
|
+
updatedAt: string;
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
responses: never;
|
|
1116
|
+
parameters: never;
|
|
1117
|
+
requestBodies: never;
|
|
1118
|
+
headers: never;
|
|
1119
|
+
pathItems: never;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
type AccountView$1 = components["schemas"]["AccountView"];
|
|
1123
|
+
declare class Billing {
|
|
1124
|
+
private readonly http;
|
|
1125
|
+
constructor(http: HttpClient);
|
|
1126
|
+
/** Get account billing information. */
|
|
1127
|
+
account(): Promise<AccountView$1>;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
type CreateBrowserSessionRequest$1 = components["schemas"]["CreateBrowserSessionRequest"];
|
|
1131
|
+
type BrowserSessionItemView$1 = components["schemas"]["BrowserSessionItemView"];
|
|
1132
|
+
type BrowserSessionView$1 = components["schemas"]["BrowserSessionView"];
|
|
1133
|
+
type BrowserSessionListResponse$1 = components["schemas"]["BrowserSessionListResponse"];
|
|
1134
|
+
type UpdateBrowserSessionRequest$1 = components["schemas"]["UpdateBrowserSessionRequest"];
|
|
1135
|
+
interface BrowserListParams {
|
|
1136
|
+
page?: number;
|
|
1137
|
+
page_size?: number;
|
|
1138
|
+
}
|
|
1139
|
+
declare class Browsers {
|
|
1140
|
+
private readonly http;
|
|
1141
|
+
constructor(http: HttpClient);
|
|
1142
|
+
/** Create a standalone browser session. */
|
|
1143
|
+
create(body?: Partial<CreateBrowserSessionRequest$1>): Promise<BrowserSessionItemView$1>;
|
|
1144
|
+
/** List browser sessions for the authenticated project. */
|
|
1145
|
+
list(params?: BrowserListParams): Promise<BrowserSessionListResponse$1>;
|
|
1146
|
+
/** Get browser session details. */
|
|
1147
|
+
get(sessionId: string): Promise<BrowserSessionView$1>;
|
|
1148
|
+
/** Update a browser session (e.g. stop it). */
|
|
1149
|
+
update(sessionId: string, body: UpdateBrowserSessionRequest$1): Promise<BrowserSessionView$1>;
|
|
1150
|
+
/** Stop a browser session. Convenience wrapper around update. */
|
|
1151
|
+
stop(sessionId: string): Promise<BrowserSessionView$1>;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
type ProfileView$1 = components["schemas"]["ProfileView"];
|
|
1155
|
+
type ProfileListResponse$1 = components["schemas"]["ProfileListResponse"];
|
|
1156
|
+
type ProfileCreateRequest$1 = components["schemas"]["ProfileCreateRequest"];
|
|
1157
|
+
type ProfileUpdateRequest$1 = components["schemas"]["ProfileUpdateRequest"];
|
|
1158
|
+
interface ProfileListParams {
|
|
1159
|
+
query?: string;
|
|
1160
|
+
page?: number;
|
|
1161
|
+
page_size?: number;
|
|
1162
|
+
}
|
|
1163
|
+
declare class Profiles {
|
|
1164
|
+
private readonly http;
|
|
1165
|
+
constructor(http: HttpClient);
|
|
1166
|
+
/** Create a browser profile. */
|
|
1167
|
+
create(body?: ProfileCreateRequest$1): Promise<ProfileView$1>;
|
|
1168
|
+
/** List profiles for the authenticated project. */
|
|
1169
|
+
list(params?: ProfileListParams): Promise<ProfileListResponse$1>;
|
|
1170
|
+
/** Get profile details. */
|
|
1171
|
+
get(profileId: string): Promise<ProfileView$1>;
|
|
1172
|
+
/** Update a profile. */
|
|
1173
|
+
update(profileId: string, body: ProfileUpdateRequest$1): Promise<ProfileView$1>;
|
|
1174
|
+
/** Delete a profile. */
|
|
1175
|
+
delete(profileId: string): Promise<void>;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
type RunTaskRequest$2 = components["schemas"]["RunTaskRequest"];
|
|
1179
|
+
/** All fields optional — omit `task` to create an idle session. */
|
|
1180
|
+
type CreateSessionBody = Partial<RunTaskRequest$2>;
|
|
1181
|
+
type SessionResponse$2 = components["schemas"]["SessionResponse"];
|
|
1182
|
+
type SessionListResponse$1 = components["schemas"]["SessionListResponse"];
|
|
1183
|
+
type StopSessionRequest$1 = components["schemas"]["StopSessionRequest"];
|
|
1184
|
+
type MessageListResponse$1 = components["schemas"]["MessageListResponse"];
|
|
1185
|
+
interface SessionListParams {
|
|
1186
|
+
page?: number;
|
|
1187
|
+
page_size?: number;
|
|
1188
|
+
}
|
|
1189
|
+
interface SessionMessagesParams {
|
|
1190
|
+
after?: string | null;
|
|
1191
|
+
before?: string | null;
|
|
1192
|
+
limit?: number;
|
|
1193
|
+
}
|
|
1194
|
+
declare class Sessions {
|
|
1195
|
+
private readonly http;
|
|
1196
|
+
constructor(http: HttpClient);
|
|
1197
|
+
/** Create a session and optionally dispatch a task. */
|
|
1198
|
+
create(body?: CreateSessionBody): Promise<SessionResponse$2>;
|
|
1199
|
+
/** List sessions for the authenticated project. */
|
|
1200
|
+
list(params?: SessionListParams): Promise<SessionListResponse$1>;
|
|
1201
|
+
/** Get session details. */
|
|
1202
|
+
get(sessionId: string): Promise<SessionResponse$2>;
|
|
1203
|
+
/** Stop a session or the running task. */
|
|
1204
|
+
stop(sessionId: string, body?: StopSessionRequest$1): Promise<SessionResponse$2>;
|
|
1205
|
+
/** Soft-delete a session. */
|
|
1206
|
+
delete(sessionId: string): Promise<void>;
|
|
1207
|
+
/** List messages for a session with cursor-based pagination. */
|
|
1208
|
+
messages(sessionId: string, params?: SessionMessagesParams): Promise<MessageListResponse$1>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Poll until recording URLs are available. Returns presigned MP4 URLs.
|
|
1211
|
+
*
|
|
1212
|
+
* Returns an empty array if no recording was produced (e.g. the agent
|
|
1213
|
+
* answered without opening a browser, or recording was not enabled).
|
|
1214
|
+
*/
|
|
1215
|
+
waitForRecording(sessionId: string, options?: {
|
|
1216
|
+
timeout?: number;
|
|
1217
|
+
interval?: number;
|
|
1218
|
+
}): Promise<string[]>;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
type WorkspaceView$1 = components["schemas"]["WorkspaceView"];
|
|
1222
|
+
type WorkspaceListResponse$1 = components["schemas"]["WorkspaceListResponse"];
|
|
1223
|
+
type WorkspaceCreateRequest$1 = components["schemas"]["WorkspaceCreateRequest"];
|
|
1224
|
+
type WorkspaceUpdateRequest$1 = components["schemas"]["WorkspaceUpdateRequest"];
|
|
1225
|
+
type FileListResponse$1 = components["schemas"]["FileListResponse"];
|
|
1226
|
+
type FileUploadRequest$1 = components["schemas"]["FileUploadRequest"];
|
|
1227
|
+
type FileUploadResponse$1 = components["schemas"]["FileUploadResponse"];
|
|
1228
|
+
interface WorkspaceListParams {
|
|
1229
|
+
pageSize?: number;
|
|
1230
|
+
pageNumber?: number;
|
|
1231
|
+
}
|
|
1232
|
+
interface WorkspaceFilesParams {
|
|
1233
|
+
prefix?: string;
|
|
1234
|
+
limit?: number;
|
|
1235
|
+
cursor?: string | null;
|
|
1236
|
+
includeUrls?: boolean;
|
|
1237
|
+
shallow?: boolean;
|
|
1238
|
+
}
|
|
1239
|
+
declare class Workspaces {
|
|
1240
|
+
private readonly http;
|
|
1241
|
+
constructor(http: HttpClient);
|
|
1242
|
+
/** List workspaces for the authenticated project. */
|
|
1243
|
+
list(params?: WorkspaceListParams): Promise<WorkspaceListResponse$1>;
|
|
1244
|
+
/** Create a new workspace. */
|
|
1245
|
+
create(body?: WorkspaceCreateRequest$1): Promise<WorkspaceView$1>;
|
|
1246
|
+
/** Get workspace details. */
|
|
1247
|
+
get(workspaceId: string): Promise<WorkspaceView$1>;
|
|
1248
|
+
/** Update a workspace. */
|
|
1249
|
+
update(workspaceId: string, body: WorkspaceUpdateRequest$1): Promise<WorkspaceView$1>;
|
|
1250
|
+
/** Delete a workspace and its data. */
|
|
1251
|
+
delete(workspaceId: string): Promise<void>;
|
|
1252
|
+
/** List files in a workspace. */
|
|
1253
|
+
files(workspaceId: string, params?: WorkspaceFilesParams): Promise<FileListResponse$1>;
|
|
1254
|
+
/** Get presigned upload URLs for workspace files. */
|
|
1255
|
+
uploadFiles(workspaceId: string, body: FileUploadRequest$1, query?: {
|
|
1256
|
+
prefix?: string;
|
|
1257
|
+
}): Promise<FileUploadResponse$1>;
|
|
1258
|
+
/** Delete a file from a workspace. */
|
|
1259
|
+
deleteFile(workspaceId: string, path: string): Promise<void>;
|
|
1260
|
+
/** Get storage usage for a workspace. */
|
|
1261
|
+
size(workspaceId: string): Promise<unknown>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Upload local files to a workspace. Returns the list of remote paths.
|
|
1264
|
+
*
|
|
1265
|
+
* ```ts
|
|
1266
|
+
* await client.workspaces.upload(wsId, "data.csv", "config.json");
|
|
1267
|
+
* await client.workspaces.upload(wsId, "data.csv", { prefix: "uploads/" });
|
|
1268
|
+
* ```
|
|
1269
|
+
*/
|
|
1270
|
+
upload(workspaceId: string, ...args: (string | {
|
|
1271
|
+
prefix?: string;
|
|
1272
|
+
})[]): Promise<string[]>;
|
|
1273
|
+
/**
|
|
1274
|
+
* Download a single file from a workspace. Returns the local path.
|
|
1275
|
+
*
|
|
1276
|
+
* ```ts
|
|
1277
|
+
* const local = await client.workspaces.download(wsId, "uploads/data.csv", { to: "./data.csv" });
|
|
1278
|
+
* ```
|
|
1279
|
+
*/
|
|
1280
|
+
download(workspaceId: string, path: string, options?: {
|
|
1281
|
+
to?: string;
|
|
1282
|
+
}): Promise<string>;
|
|
1283
|
+
/**
|
|
1284
|
+
* Download all files from a workspace. Returns list of local paths.
|
|
1285
|
+
*
|
|
1286
|
+
* ```ts
|
|
1287
|
+
* const paths = await client.workspaces.downloadAll(wsId, { to: "./output" });
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
downloadAll(workspaceId: string, options?: {
|
|
1291
|
+
to?: string;
|
|
1292
|
+
prefix?: string;
|
|
1293
|
+
}): Promise<string[]>;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
type SessionResponse$1 = components["schemas"]["SessionResponse"];
|
|
1297
|
+
type MessageResponse$1 = components["schemas"]["MessageResponse"];
|
|
1298
|
+
interface RunOptions {
|
|
1299
|
+
/** Maximum time to wait in milliseconds. Default: 14_400_000 (4 hours). */
|
|
1300
|
+
timeout?: number;
|
|
1301
|
+
/** Polling interval in milliseconds. Default: 2_000. */
|
|
1302
|
+
interval?: number;
|
|
1303
|
+
/** @internal Starting message cursor for follow-up runs on an existing session. */
|
|
1304
|
+
_startCursor?: string;
|
|
1305
|
+
}
|
|
1306
|
+
/** Session result with typed output. All SessionResponse fields are directly accessible. */
|
|
1307
|
+
type SessionResult<T = string | null> = Omit<SessionResponse$1, "output"> & {
|
|
1308
|
+
output: T;
|
|
1309
|
+
};
|
|
1310
|
+
/**
|
|
1311
|
+
* Dual-purpose session handle: `await` it for a typed SessionResult,
|
|
1312
|
+
* or access `.result` for the full SessionResult after resolution.
|
|
1313
|
+
*/
|
|
1314
|
+
declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
|
|
1315
|
+
private readonly _createPromise;
|
|
1316
|
+
private readonly _sessions;
|
|
1317
|
+
private readonly _schema?;
|
|
1318
|
+
private readonly _timeout;
|
|
1319
|
+
private readonly _interval;
|
|
1320
|
+
private readonly _options?;
|
|
1321
|
+
private _sessionId;
|
|
1322
|
+
private _result;
|
|
1323
|
+
constructor(createPromise: Promise<SessionResponse$1>, sessions: Sessions, schema?: z.ZodType<T>, options?: RunOptions);
|
|
1324
|
+
/** The session ID, available after task creation resolves. */
|
|
1325
|
+
get sessionId(): string | null;
|
|
1326
|
+
/** The full SessionResult, available after polling completes. */
|
|
1327
|
+
get result(): SessionResult<T> | null;
|
|
1328
|
+
/** Enable `await client.run(...)` — polls until terminal, returns SessionResult. */
|
|
1329
|
+
then<R1 = SessionResult<T>, R2 = never>(onFulfilled?: ((value: SessionResult<T>) => R1 | PromiseLike<R1>) | null, onRejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null): Promise<R1 | R2>;
|
|
1330
|
+
private _ensureSessionId;
|
|
1331
|
+
/** Poll session until terminal, return SessionResult. */
|
|
1332
|
+
private _waitForOutput;
|
|
1333
|
+
/**
|
|
1334
|
+
* Enable `for await (const msg of client.run(...))` — yields messages as they appear.
|
|
1335
|
+
* After iteration, `.result` contains the final SessionResult.
|
|
1336
|
+
*/
|
|
1337
|
+
[Symbol.asyncIterator](): AsyncGenerator<MessageResponse$1>;
|
|
1338
|
+
private _parseOutput;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
type RunTaskRequest$1 = components["schemas"]["RunTaskRequest"];
|
|
1342
|
+
interface BrowserUseOptions {
|
|
1343
|
+
apiKey?: string;
|
|
1344
|
+
baseUrl?: string;
|
|
1345
|
+
maxRetries?: number;
|
|
1346
|
+
timeout?: number;
|
|
1347
|
+
}
|
|
1348
|
+
type RunSessionOptions = Partial<Omit<RunTaskRequest$1, "task">> & RunOptions & {
|
|
1349
|
+
schema?: z.ZodType;
|
|
1350
|
+
};
|
|
1351
|
+
declare class BrowserUse {
|
|
1352
|
+
readonly billing: Billing;
|
|
1353
|
+
readonly browsers: Browsers;
|
|
1354
|
+
readonly profiles: Profiles;
|
|
1355
|
+
readonly sessions: Sessions;
|
|
1356
|
+
readonly workspaces: Workspaces;
|
|
1357
|
+
private readonly http;
|
|
1358
|
+
constructor(options?: BrowserUseOptions);
|
|
1359
|
+
/**
|
|
1360
|
+
* Create a session and run a task. `await` the result for a typed SessionResult.
|
|
1361
|
+
*
|
|
1362
|
+
* ```ts
|
|
1363
|
+
* // Simple — just get the output
|
|
1364
|
+
* const result = await client.run("Find the top HN post");
|
|
1365
|
+
* console.log(result.output);
|
|
1366
|
+
*
|
|
1367
|
+
* // Structured output (Zod)
|
|
1368
|
+
* const result = await client.run("Find product info", { schema: ProductSchema });
|
|
1369
|
+
* console.log(result.output.name); // fully typed
|
|
1370
|
+
* ```
|
|
1371
|
+
*/
|
|
1372
|
+
run(task: string, options?: Omit<RunSessionOptions, "schema">): SessionRun<string>;
|
|
1373
|
+
run<T extends z.ZodType>(task: string, options: RunSessionOptions & {
|
|
1374
|
+
schema: T;
|
|
1375
|
+
}): SessionRun<z.output<T>>;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
type S = components["schemas"];
|
|
1379
|
+
type SessionResponse = S["SessionResponse"];
|
|
1380
|
+
type SessionListResponse = S["SessionListResponse"];
|
|
1381
|
+
type FileListResponse = S["FileListResponse"];
|
|
1382
|
+
type FileInfo = S["FileInfo"];
|
|
1383
|
+
type FileUploadResponse = S["FileUploadResponse"];
|
|
1384
|
+
type FileUploadResponseItem = S["FileUploadResponseItem"];
|
|
1385
|
+
type MessageListResponse = S["MessageListResponse"];
|
|
1386
|
+
type MessageResponse = S["MessageResponse"];
|
|
1387
|
+
type WorkspaceView = S["WorkspaceView"];
|
|
1388
|
+
type WorkspaceListResponse = S["WorkspaceListResponse"];
|
|
1389
|
+
type RunTaskRequest = S["RunTaskRequest"];
|
|
1390
|
+
type StopSessionRequest = S["StopSessionRequest"];
|
|
1391
|
+
type FileUploadRequest = S["FileUploadRequest"];
|
|
1392
|
+
type FileUploadItem = S["FileUploadItem"];
|
|
1393
|
+
type WorkspaceCreateRequest = S["WorkspaceCreateRequest"];
|
|
1394
|
+
type WorkspaceUpdateRequest = S["WorkspaceUpdateRequest"];
|
|
1395
|
+
type BrowserSessionItemView = S["BrowserSessionItemView"];
|
|
1396
|
+
type BrowserSessionView = S["BrowserSessionView"];
|
|
1397
|
+
type BrowserSessionListResponse = S["BrowserSessionListResponse"];
|
|
1398
|
+
type CreateBrowserSessionRequest = S["CreateBrowserSessionRequest"];
|
|
1399
|
+
type UpdateBrowserSessionRequest = S["UpdateBrowserSessionRequest"];
|
|
1400
|
+
type BrowserSessionStatus = S["BrowserSessionStatus"];
|
|
1401
|
+
type BrowserSessionUpdateAction = S["BrowserSessionUpdateAction"];
|
|
1402
|
+
type ProfileView = S["ProfileView"];
|
|
1403
|
+
type ProfileListResponse = S["ProfileListResponse"];
|
|
1404
|
+
type ProfileCreateRequest = S["ProfileCreateRequest"];
|
|
1405
|
+
type ProfileUpdateRequest = S["ProfileUpdateRequest"];
|
|
1406
|
+
type AccountView = S["AccountView"];
|
|
1407
|
+
type PlanInfo = S["PlanInfo"];
|
|
1408
|
+
type BuAgentSessionStatus = S["BuAgentSessionStatus"];
|
|
1409
|
+
type BuModel = S["BuModel"];
|
|
1410
|
+
type ProxyCountryCode = S["ProxyCountryCode"];
|
|
1411
|
+
type StopStrategy = S["StopStrategy"];
|
|
1412
|
+
|
|
1413
|
+
export { type AccountView, Billing, type BrowserListParams, type BrowserSessionItemView, type BrowserSessionListResponse, type BrowserSessionStatus, type BrowserSessionUpdateAction, type BrowserSessionView, BrowserUse, type BrowserUseOptions, Browsers, type BuAgentSessionStatus, type BuModel, type CreateBrowserSessionRequest, type CreateSessionBody, type FileInfo, type FileListResponse, type FileUploadItem, type FileUploadRequest, type FileUploadResponse, type FileUploadResponseItem, type MessageListResponse, type MessageResponse, type PlanInfo, type ProfileCreateRequest, type ProfileListParams, type ProfileListResponse, type ProfileUpdateRequest, type ProfileView, Profiles, type ProxyCountryCode, type RunOptions, type RunSessionOptions, type RunTaskRequest, type SessionListParams, type SessionListResponse, type SessionMessagesParams, type SessionResponse, type SessionResult, SessionRun, Sessions, type StopSessionRequest, type StopStrategy, type UpdateBrowserSessionRequest, type components as V3Types, type WorkspaceCreateRequest, type WorkspaceFilesParams, type WorkspaceListParams, type WorkspaceListResponse, type WorkspaceUpdateRequest, type WorkspaceView, Workspaces };
|