browser-use-sdk 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v3.d.ts DELETED
@@ -1,1251 +0,0 @@
1
- import { z } from 'zod';
2
- import { H as HttpClient } from './errors-BtB79l7x.js';
3
- export { B as BrowserUseError } from './errors-BtB79l7x.js';
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
- * @enum {string}
252
- */
253
- BuAgentSessionStatus: "created" | "idle" | "running" | "stopped" | "timed_out" | "error";
254
- /**
255
- * BuModel
256
- * @enum {string}
257
- */
258
- BuModel: "bu-mini" | "bu-max" | "bu-ultra";
259
- /**
260
- * CreateBrowserSessionRequest
261
- * @description Request model for creating a browser session.
262
- */
263
- CreateBrowserSessionRequest: {
264
- /**
265
- * Profile ID
266
- * @description The ID of the profile to use for the session
267
- */
268
- profileId?: string | null;
269
- /**
270
- * Proxy Country Code
271
- * @description Country code for proxy location. Defaults to US. Set to null to disable proxy.
272
- * @default us
273
- */
274
- proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
275
- /**
276
- * Timeout
277
- * @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.
278
- * @default 60
279
- */
280
- timeout: number;
281
- /**
282
- * Browser Screen Width
283
- * @description Custom screen width in pixels for the browser.
284
- */
285
- browserScreenWidth?: number | null;
286
- /**
287
- * Browser Screen Height
288
- * @description Custom screen height in pixels for the browser.
289
- */
290
- browserScreenHeight?: number | null;
291
- /**
292
- * Allow Resizing
293
- * @description Whether to allow the browser to be resized during the session (not recommended since it reduces stealthiness).
294
- * @default false
295
- */
296
- allowResizing: boolean;
297
- /**
298
- * Custom Proxy
299
- * @description Custom proxy settings to use for the session. If not provided, our proxies will be used. Custom proxies are only available on the Custom Enterprise plan.
300
- */
301
- customProxy?: components["schemas"]["CustomProxy"] | null;
302
- /**
303
- * Enable Recording
304
- * @description If True, enables session recording. Defaults to False.
305
- * @default false
306
- */
307
- enableRecording: boolean;
308
- };
309
- /**
310
- * CustomProxy
311
- * @description Request model for creating a custom proxy.
312
- */
313
- CustomProxy: {
314
- /**
315
- * Host
316
- * @description Host of the proxy.
317
- */
318
- host: string;
319
- /**
320
- * Port
321
- * @description Port of the proxy.
322
- */
323
- port: number;
324
- /**
325
- * Username
326
- * @description Username for proxy authentication.
327
- */
328
- username?: string | null;
329
- /**
330
- * Password
331
- * @description Password for proxy authentication.
332
- */
333
- password?: string | null;
334
- };
335
- /**
336
- * FileInfo
337
- * @description A file in a session's workspace.
338
- */
339
- FileInfo: {
340
- /** Path */
341
- path: string;
342
- /** Size */
343
- size: number;
344
- /**
345
- * Lastmodified
346
- * Format: date-time
347
- */
348
- lastModified: string;
349
- /** Url */
350
- url?: string | null;
351
- };
352
- /**
353
- * FileListResponse
354
- * @description Paginated file listing with optional presigned download URLs.
355
- */
356
- FileListResponse: {
357
- /** Files */
358
- files: components["schemas"]["FileInfo"][];
359
- /**
360
- * Folders
361
- * @description Immediate sub-folder names at this prefix level
362
- */
363
- folders?: string[];
364
- /** Nextcursor */
365
- nextCursor?: string | null;
366
- /**
367
- * Hasmore
368
- * @default false
369
- */
370
- hasMore: boolean;
371
- };
372
- /**
373
- * FileUploadItem
374
- * @description A single file to upload.
375
- */
376
- FileUploadItem: {
377
- /**
378
- * Name
379
- * @description Filename, e.g. "data.csv"
380
- */
381
- name: string;
382
- /**
383
- * Contenttype
384
- * @description MIME type, e.g. "text/csv"
385
- * @default application/octet-stream
386
- */
387
- contentType: string;
388
- /**
389
- * Size
390
- * @description File size in bytes (required for workspace uploads)
391
- */
392
- size?: number | null;
393
- };
394
- /**
395
- * FileUploadRequest
396
- * @description Request body for generating presigned upload URLs.
397
- */
398
- FileUploadRequest: {
399
- /** Files */
400
- files: components["schemas"]["FileUploadItem"][];
401
- };
402
- /**
403
- * FileUploadResponse
404
- * @description Presigned upload URLs for the requested files.
405
- */
406
- FileUploadResponse: {
407
- /** Files */
408
- files: components["schemas"]["FileUploadResponseItem"][];
409
- };
410
- /**
411
- * FileUploadResponseItem
412
- * @description Presigned upload URL for a single file.
413
- */
414
- FileUploadResponseItem: {
415
- /** Name */
416
- name: string;
417
- /** Uploadurl */
418
- uploadUrl: string;
419
- /**
420
- * Path
421
- * @description S3-relative path, e.g. "uploads/data.csv"
422
- */
423
- path: string;
424
- };
425
- /** HTTPValidationError */
426
- HTTPValidationError: {
427
- /** Detail */
428
- detail?: components["schemas"]["ValidationError"][];
429
- };
430
- /**
431
- * InsufficientCreditsError
432
- * @description Error response when there are insufficient credits
433
- */
434
- InsufficientCreditsError: {
435
- /**
436
- * Detail
437
- * @default Insufficient credits
438
- */
439
- detail: string;
440
- };
441
- /** MessageListResponse */
442
- MessageListResponse: {
443
- /** Messages */
444
- messages: components["schemas"]["MessageResponse"][];
445
- /** Hasmore */
446
- hasMore: boolean;
447
- };
448
- /** MessageResponse */
449
- MessageResponse: {
450
- /**
451
- * Id
452
- * Format: uuid
453
- */
454
- id: string;
455
- /**
456
- * Sessionid
457
- * Format: uuid
458
- */
459
- sessionId: string;
460
- /** Role */
461
- role: string;
462
- /** Data */
463
- data: string;
464
- /**
465
- * Type
466
- * @description Coarse category: user_message, assistant_message, browser_action, file_operation, code_execution, integration, planning, completion, browser_action_result, browser_action_error, etc.
467
- * @default
468
- */
469
- type: string;
470
- /**
471
- * Summary
472
- * @description One-liner human-readable description of the message (e.g. "Navigating to google.com", "Clicking element #5").
473
- * @default
474
- */
475
- summary: string;
476
- /** Screenshoturl */
477
- screenshotUrl?: string | null;
478
- /**
479
- * Hidden
480
- * @description Whether this message should be hidden from the user in a chat UI.
481
- * @default false
482
- */
483
- hidden: boolean;
484
- /**
485
- * Createdat
486
- * Format: date-time
487
- */
488
- createdAt: string;
489
- };
490
- /**
491
- * PlanInfo
492
- * @description View model for plan information
493
- */
494
- PlanInfo: {
495
- /**
496
- * Plan Name
497
- * @description The name of the plan
498
- */
499
- planName: string;
500
- /**
501
- * Subscription Status
502
- * @description The status of the subscription
503
- */
504
- subscriptionStatus: string | null;
505
- /**
506
- * Subscription ID
507
- * @description The ID of the subscription
508
- */
509
- subscriptionId: string | null;
510
- /**
511
- * Subscription Current Period End
512
- * @description The end of the current period
513
- */
514
- subscriptionCurrentPeriodEnd: string | null;
515
- /**
516
- * Subscription Canceled At
517
- * @description The date the subscription was canceled
518
- */
519
- subscriptionCanceledAt: string | null;
520
- };
521
- /**
522
- * ProfileCreateRequest
523
- * @description Request model for creating a new profile.
524
- */
525
- ProfileCreateRequest: {
526
- /**
527
- * Name
528
- * @description Optional name for the profile
529
- */
530
- name?: string | null;
531
- /**
532
- * User ID
533
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
534
- */
535
- userId?: string | null;
536
- };
537
- /**
538
- * ProfileListResponse
539
- * @description Response model for paginated profile list requests.
540
- */
541
- ProfileListResponse: {
542
- /**
543
- * Items
544
- * @description List of profile views for the current page
545
- */
546
- items: components["schemas"]["ProfileView"][];
547
- /**
548
- * Total Items
549
- * @description Total number of items in the list
550
- */
551
- totalItems: number;
552
- /**
553
- * Page Number
554
- * @description Page number
555
- */
556
- pageNumber: number;
557
- /**
558
- * Page Size
559
- * @description Number of items per page
560
- */
561
- pageSize: number;
562
- };
563
- /**
564
- * ProfileNotFoundError
565
- * @description Error response when a profile is not found
566
- */
567
- ProfileNotFoundError: {
568
- /**
569
- * Detail
570
- * @default Profile not found
571
- */
572
- detail: string;
573
- };
574
- /**
575
- * ProfileUpdateRequest
576
- * @description Request model for updating a profile.
577
- */
578
- ProfileUpdateRequest: {
579
- /**
580
- * Name
581
- * @description Optional name for the profile
582
- */
583
- name?: string | null;
584
- /**
585
- * User ID
586
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
587
- */
588
- userId?: string | null;
589
- };
590
- /**
591
- * ProfileView
592
- * @description View model for representing a profile. A profile lets you preserve the login state between sessions.
593
- *
594
- * We recommend that you create a separate profile for each user of your app.
595
- * You can assign a user_id to each profile to easily identify which user the profile belongs to.
596
- */
597
- ProfileView: {
598
- /**
599
- * ID
600
- * Format: uuid
601
- * @description Unique identifier for the profile
602
- */
603
- id: string;
604
- /**
605
- * User ID
606
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
607
- */
608
- userId?: string | null;
609
- /**
610
- * Name
611
- * @description Optional name for the profile
612
- */
613
- name?: string | null;
614
- /**
615
- * Last Used At
616
- * @description Timestamp when the profile was last used
617
- */
618
- lastUsedAt?: string | null;
619
- /**
620
- * Created At
621
- * Format: date-time
622
- * @description Timestamp when the profile was created
623
- */
624
- createdAt: string;
625
- /**
626
- * Updated At
627
- * Format: date-time
628
- * @description Timestamp when the profile was last updated
629
- */
630
- updatedAt: string;
631
- /**
632
- * Cookie Domains
633
- * @description List of domain URLs that have cookies stored for this profile
634
- */
635
- cookieDomains?: string[] | null;
636
- };
637
- /**
638
- * ProxyCountryCode
639
- * @enum {string}
640
- */
641
- 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";
642
- /**
643
- * RunTaskRequest
644
- * @description Unified request for creating a session or dispatching a task.
645
- *
646
- * - Without session_id + without task: creates a new idle session (for file uploads, etc.)
647
- * - Without session_id + with task: creates a new session and dispatches the task
648
- * - With session_id + with task: dispatches the task to an existing idle session
649
- * - With session_id + without task: 422 (task required when dispatching to existing session)
650
- */
651
- RunTaskRequest: {
652
- /** Task */
653
- task?: string | null;
654
- /** @default bu-max */
655
- model: components["schemas"]["BuModel"];
656
- /** Sessionid */
657
- sessionId?: string | null;
658
- /**
659
- * Keepalive
660
- * @default false
661
- */
662
- keepAlive: boolean;
663
- /** Maxcostusd */
664
- maxCostUsd?: number | string | null;
665
- /** Profileid */
666
- profileId?: string | null;
667
- /** Workspaceid */
668
- workspaceId?: string | null;
669
- /** @default us */
670
- proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
671
- /** Outputschema */
672
- outputSchema?: {
673
- [key: string]: unknown;
674
- } | null;
675
- /**
676
- * Enablescheduledtasks
677
- * @default false
678
- */
679
- enableScheduledTasks: boolean;
680
- /**
681
- * Enablerecording
682
- * @default false
683
- */
684
- enableRecording: boolean;
685
- /**
686
- * Skills
687
- * @default true
688
- */
689
- skills: boolean;
690
- /**
691
- * Agentmail
692
- * @default true
693
- */
694
- agentmail: boolean;
695
- };
696
- /** SessionListResponse */
697
- SessionListResponse: {
698
- /** Sessions */
699
- sessions: components["schemas"]["SessionResponse"][];
700
- /** Total */
701
- total: number;
702
- /** Page */
703
- page: number;
704
- /** Pagesize */
705
- pageSize: number;
706
- };
707
- /**
708
- * SessionNotFoundError
709
- * @description Error response when a session is not found
710
- */
711
- SessionNotFoundError: {
712
- /**
713
- * Detail
714
- * @default Session not found
715
- */
716
- detail: string;
717
- };
718
- /** SessionResponse */
719
- SessionResponse: {
720
- /**
721
- * Id
722
- * Format: uuid
723
- */
724
- id: string;
725
- status: components["schemas"]["BuAgentSessionStatus"];
726
- /** The model used. May be a BuModel alias or a resolved model name. */
727
- model: string;
728
- /** Title */
729
- title?: string | null;
730
- /** Output */
731
- output?: unknown | null;
732
- /** Outputschema */
733
- outputSchema?: {
734
- [key: string]: unknown;
735
- } | null;
736
- /**
737
- * Stepcount
738
- * @default 0
739
- */
740
- stepCount: number;
741
- /** Laststepsummary */
742
- lastStepSummary?: string | null;
743
- /** Istasksuccessful */
744
- isTaskSuccessful?: boolean | null;
745
- /** Liveurl */
746
- liveUrl?: string | null;
747
- /**
748
- * Recordingurls
749
- * @default []
750
- */
751
- recordingUrls: string[];
752
- /** Profileid */
753
- profileId?: string | null;
754
- /** Workspaceid */
755
- workspaceId?: string | null;
756
- proxyCountryCode?: components["schemas"]["ProxyCountryCode"] | null;
757
- /** Maxcostusd */
758
- maxCostUsd?: string | null;
759
- /**
760
- * Totalinputtokens
761
- * @default 0
762
- */
763
- totalInputTokens: number;
764
- /**
765
- * Totaloutputtokens
766
- * @default 0
767
- */
768
- totalOutputTokens: number;
769
- /**
770
- * Proxyusedmb
771
- * @default 0
772
- */
773
- proxyUsedMb: string;
774
- /**
775
- * Llmcostusd
776
- * @default 0
777
- */
778
- llmCostUsd: string;
779
- /**
780
- * Proxycostusd
781
- * @default 0
782
- */
783
- proxyCostUsd: string;
784
- /**
785
- * Browsercostusd
786
- * @default 0
787
- */
788
- browserCostUsd: string;
789
- /**
790
- * Totalcostusd
791
- * @default 0
792
- */
793
- totalCostUsd: string;
794
- /** Screenshoturl */
795
- screenshotUrl?: string | null;
796
- /** Agentmailemail */
797
- agentmailEmail?: string | null;
798
- /**
799
- * Createdat
800
- * Format: date-time
801
- */
802
- createdAt: string;
803
- /**
804
- * Updatedat
805
- * Format: date-time
806
- */
807
- updatedAt: string;
808
- };
809
- /**
810
- * SessionTimeoutLimitExceededError
811
- * @description Error response when session timeout exceeds the maximum allowed limit
812
- */
813
- SessionTimeoutLimitExceededError: {
814
- /**
815
- * Detail
816
- * @default Maximum session timeout is 4 hours (240 minutes).
817
- */
818
- detail: string;
819
- };
820
- /** StopSessionRequest */
821
- StopSessionRequest: {
822
- /** @default session */
823
- strategy: components["schemas"]["StopStrategy"];
824
- };
825
- /**
826
- * StopStrategy
827
- * @enum {string}
828
- */
829
- StopStrategy: "task" | "session";
830
- /**
831
- * TooManyConcurrentActiveSessionsError
832
- * @description Error response when user has too many concurrent active sessions
833
- */
834
- TooManyConcurrentActiveSessionsError: {
835
- /**
836
- * Detail
837
- * @default Too many concurrent active sessions. Please wait for one to finish, kill one, or upgrade your plan.
838
- */
839
- detail: string;
840
- };
841
- /**
842
- * UpdateBrowserSessionRequest
843
- * @description Request model for updating browser session state.
844
- */
845
- UpdateBrowserSessionRequest: {
846
- /**
847
- * Action
848
- * @description The action to perform on the session
849
- */
850
- action: components["schemas"]["BrowserSessionUpdateAction"];
851
- };
852
- /** ValidationError */
853
- ValidationError: {
854
- /** Location */
855
- loc: (string | number)[];
856
- /** Message */
857
- msg: string;
858
- /** Error Type */
859
- type: string;
860
- };
861
- /**
862
- * WorkspaceCreateRequest
863
- * @description Request model for creating a new workspace.
864
- */
865
- WorkspaceCreateRequest: {
866
- /**
867
- * Name
868
- * @description Optional name for the workspace
869
- */
870
- name?: string | null;
871
- };
872
- /**
873
- * WorkspaceListResponse
874
- * @description Response model for paginated workspace list requests.
875
- */
876
- WorkspaceListResponse: {
877
- /**
878
- * Items
879
- * @description List of workspace views for the current page
880
- */
881
- items: components["schemas"]["WorkspaceView"][];
882
- /**
883
- * Total Items
884
- * @description Total number of items in the list
885
- */
886
- totalItems: number;
887
- /**
888
- * Page Number
889
- * @description Page number
890
- */
891
- pageNumber: number;
892
- /**
893
- * Page Size
894
- * @description Number of items per page
895
- */
896
- pageSize: number;
897
- };
898
- /**
899
- * WorkspaceUpdateRequest
900
- * @description Request model for updating a workspace.
901
- */
902
- WorkspaceUpdateRequest: {
903
- /**
904
- * Name
905
- * @description Optional name for the workspace
906
- */
907
- name?: string | null;
908
- };
909
- /**
910
- * WorkspaceView
911
- * @description View model for a workspace — persistent shared storage across sessions.
912
- */
913
- WorkspaceView: {
914
- /**
915
- * ID
916
- * Format: uuid
917
- * @description Unique identifier for the workspace
918
- */
919
- id: string;
920
- /**
921
- * Name
922
- * @description Optional name for the workspace
923
- */
924
- name?: string | null;
925
- /**
926
- * Created At
927
- * Format: date-time
928
- * @description Timestamp when the workspace was created
929
- */
930
- createdAt: string;
931
- /**
932
- * Updated At
933
- * Format: date-time
934
- * @description Timestamp when the workspace was last updated
935
- */
936
- updatedAt: string;
937
- };
938
- };
939
- responses: never;
940
- parameters: never;
941
- requestBodies: never;
942
- headers: never;
943
- pathItems: never;
944
- }
945
-
946
- type AccountView$1 = components["schemas"]["AccountView"];
947
- declare class Billing {
948
- private readonly http;
949
- constructor(http: HttpClient);
950
- /** Get account billing information. */
951
- account(): Promise<AccountView$1>;
952
- }
953
-
954
- type CreateBrowserSessionRequest$1 = components["schemas"]["CreateBrowserSessionRequest"];
955
- type BrowserSessionItemView$1 = components["schemas"]["BrowserSessionItemView"];
956
- type BrowserSessionView$1 = components["schemas"]["BrowserSessionView"];
957
- type BrowserSessionListResponse$1 = components["schemas"]["BrowserSessionListResponse"];
958
- type UpdateBrowserSessionRequest$1 = components["schemas"]["UpdateBrowserSessionRequest"];
959
- interface BrowserListParams {
960
- page?: number;
961
- page_size?: number;
962
- }
963
- declare class Browsers {
964
- private readonly http;
965
- constructor(http: HttpClient);
966
- /** Create a standalone browser session. */
967
- create(body?: Partial<CreateBrowserSessionRequest$1>): Promise<BrowserSessionItemView$1>;
968
- /** List browser sessions for the authenticated project. */
969
- list(params?: BrowserListParams): Promise<BrowserSessionListResponse$1>;
970
- /** Get browser session details. */
971
- get(sessionId: string): Promise<BrowserSessionView$1>;
972
- /** Update a browser session (e.g. stop it). */
973
- update(sessionId: string, body: UpdateBrowserSessionRequest$1): Promise<BrowserSessionView$1>;
974
- /** Stop a browser session. Convenience wrapper around update. */
975
- stop(sessionId: string): Promise<BrowserSessionView$1>;
976
- }
977
-
978
- type ProfileView$1 = components["schemas"]["ProfileView"];
979
- type ProfileListResponse$1 = components["schemas"]["ProfileListResponse"];
980
- type ProfileCreateRequest$1 = components["schemas"]["ProfileCreateRequest"];
981
- type ProfileUpdateRequest$1 = components["schemas"]["ProfileUpdateRequest"];
982
- interface ProfileListParams {
983
- query?: string;
984
- page?: number;
985
- page_size?: number;
986
- }
987
- declare class Profiles {
988
- private readonly http;
989
- constructor(http: HttpClient);
990
- /** Create a browser profile. */
991
- create(body?: ProfileCreateRequest$1): Promise<ProfileView$1>;
992
- /** List profiles for the authenticated project. */
993
- list(params?: ProfileListParams): Promise<ProfileListResponse$1>;
994
- /** Get profile details. */
995
- get(profileId: string): Promise<ProfileView$1>;
996
- /** Update a profile. */
997
- update(profileId: string, body: ProfileUpdateRequest$1): Promise<ProfileView$1>;
998
- /** Delete a profile. */
999
- delete(profileId: string): Promise<void>;
1000
- }
1001
-
1002
- type RunTaskRequest$2 = components["schemas"]["RunTaskRequest"];
1003
- /** All fields optional — omit `task` to create an idle session. */
1004
- type CreateSessionBody = Partial<RunTaskRequest$2>;
1005
- type SessionResponse$2 = components["schemas"]["SessionResponse"];
1006
- type SessionListResponse$1 = components["schemas"]["SessionListResponse"];
1007
- type FileListResponse$2 = components["schemas"]["FileListResponse"];
1008
- type StopSessionRequest$1 = components["schemas"]["StopSessionRequest"];
1009
- type FileUploadRequest$2 = components["schemas"]["FileUploadRequest"];
1010
- type FileUploadResponse$2 = components["schemas"]["FileUploadResponse"];
1011
- type MessageListResponse$1 = components["schemas"]["MessageListResponse"];
1012
- interface SessionListParams {
1013
- page?: number;
1014
- page_size?: number;
1015
- }
1016
- interface SessionFilesParams {
1017
- prefix?: string;
1018
- limit?: number;
1019
- cursor?: string | null;
1020
- includeUrls?: boolean;
1021
- shallow?: boolean;
1022
- }
1023
- interface SessionMessagesParams {
1024
- after?: string | null;
1025
- before?: string | null;
1026
- limit?: number;
1027
- }
1028
- declare class Sessions {
1029
- private readonly http;
1030
- constructor(http: HttpClient);
1031
- /** Create a session and optionally dispatch a task. */
1032
- create(body?: CreateSessionBody): Promise<SessionResponse$2>;
1033
- /** List sessions for the authenticated project. */
1034
- list(params?: SessionListParams): Promise<SessionListResponse$1>;
1035
- /** Get session details. */
1036
- get(sessionId: string): Promise<SessionResponse$2>;
1037
- /** Stop a session or the running task. */
1038
- stop(sessionId: string, body?: StopSessionRequest$1): Promise<SessionResponse$2>;
1039
- /** Soft-delete a session. */
1040
- delete(sessionId: string): Promise<void>;
1041
- /** Get presigned upload URLs for session files. */
1042
- uploadFiles(sessionId: string, body: FileUploadRequest$2): Promise<FileUploadResponse$2>;
1043
- /** List files in a session's workspace. */
1044
- files(sessionId: string, params?: SessionFilesParams): Promise<FileListResponse$2>;
1045
- /** List messages for a session with cursor-based pagination. */
1046
- messages(sessionId: string, params?: SessionMessagesParams): Promise<MessageListResponse$1>;
1047
- /**
1048
- * Poll until recording URLs are available. Returns presigned MP4 URLs.
1049
- *
1050
- * Returns an empty array if no recording was produced (e.g. the agent
1051
- * answered without opening a browser, or recording was not enabled).
1052
- */
1053
- waitForRecording(sessionId: string, options?: {
1054
- timeout?: number;
1055
- interval?: number;
1056
- }): Promise<string[]>;
1057
- }
1058
-
1059
- type WorkspaceView$1 = components["schemas"]["WorkspaceView"];
1060
- type WorkspaceListResponse$1 = components["schemas"]["WorkspaceListResponse"];
1061
- type WorkspaceCreateRequest$1 = components["schemas"]["WorkspaceCreateRequest"];
1062
- type WorkspaceUpdateRequest$1 = components["schemas"]["WorkspaceUpdateRequest"];
1063
- type FileListResponse$1 = components["schemas"]["FileListResponse"];
1064
- type FileUploadRequest$1 = components["schemas"]["FileUploadRequest"];
1065
- type FileUploadResponse$1 = components["schemas"]["FileUploadResponse"];
1066
- interface WorkspaceListParams {
1067
- pageSize?: number;
1068
- pageNumber?: number;
1069
- }
1070
- interface WorkspaceFilesParams {
1071
- prefix?: string;
1072
- limit?: number;
1073
- cursor?: string | null;
1074
- includeUrls?: boolean;
1075
- shallow?: boolean;
1076
- }
1077
- declare class Workspaces {
1078
- private readonly http;
1079
- constructor(http: HttpClient);
1080
- /** List workspaces for the authenticated project. */
1081
- list(params?: WorkspaceListParams): Promise<WorkspaceListResponse$1>;
1082
- /** Create a new workspace. */
1083
- create(body?: WorkspaceCreateRequest$1): Promise<WorkspaceView$1>;
1084
- /** Get workspace details. */
1085
- get(workspaceId: string): Promise<WorkspaceView$1>;
1086
- /** Update a workspace. */
1087
- update(workspaceId: string, body: WorkspaceUpdateRequest$1): Promise<WorkspaceView$1>;
1088
- /** Delete a workspace and its data. */
1089
- delete(workspaceId: string): Promise<void>;
1090
- /** List files in a workspace. */
1091
- files(workspaceId: string, params?: WorkspaceFilesParams): Promise<FileListResponse$1>;
1092
- /** Get presigned upload URLs for workspace files. */
1093
- uploadFiles(workspaceId: string, body: FileUploadRequest$1, query?: {
1094
- prefix?: string;
1095
- }): Promise<FileUploadResponse$1>;
1096
- /** Delete a file from a workspace. */
1097
- deleteFile(workspaceId: string, path: string): Promise<void>;
1098
- /** Get storage usage for a workspace. */
1099
- size(workspaceId: string): Promise<unknown>;
1100
- /**
1101
- * Upload local files to a workspace. Returns the list of remote paths.
1102
- *
1103
- * ```ts
1104
- * await client.workspaces.upload(wsId, "data.csv", "config.json");
1105
- * await client.workspaces.upload(wsId, "data.csv", { prefix: "uploads/" });
1106
- * ```
1107
- */
1108
- upload(workspaceId: string, ...args: (string | {
1109
- prefix?: string;
1110
- })[]): Promise<string[]>;
1111
- /**
1112
- * Download a single file from a workspace. Returns the local path.
1113
- *
1114
- * ```ts
1115
- * const local = await client.workspaces.download(wsId, "uploads/data.csv", { to: "./data.csv" });
1116
- * ```
1117
- */
1118
- download(workspaceId: string, path: string, options?: {
1119
- to?: string;
1120
- }): Promise<string>;
1121
- /**
1122
- * Download all files from a workspace. Returns list of local paths.
1123
- *
1124
- * ```ts
1125
- * const paths = await client.workspaces.downloadAll(wsId, { to: "./output" });
1126
- * ```
1127
- */
1128
- downloadAll(workspaceId: string, options?: {
1129
- to?: string;
1130
- prefix?: string;
1131
- }): Promise<string[]>;
1132
- }
1133
-
1134
- type SessionResponse$1 = components["schemas"]["SessionResponse"];
1135
- type MessageResponse$1 = components["schemas"]["MessageResponse"];
1136
- interface RunOptions {
1137
- /** Maximum time to wait in milliseconds. Default: 14_400_000 (4 hours). */
1138
- timeout?: number;
1139
- /** Polling interval in milliseconds. Default: 2_000. */
1140
- interval?: number;
1141
- /** @internal Starting message cursor for follow-up runs on an existing session. */
1142
- _startCursor?: string;
1143
- }
1144
- /** Session result with typed output. All SessionResponse fields are directly accessible. */
1145
- type SessionResult<T = string | null> = Omit<SessionResponse$1, "output"> & {
1146
- output: T;
1147
- };
1148
- /**
1149
- * Dual-purpose session handle: `await` it for a typed SessionResult,
1150
- * or access `.result` for the full SessionResult after resolution.
1151
- */
1152
- declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
1153
- private readonly _createPromise;
1154
- private readonly _sessions;
1155
- private readonly _schema?;
1156
- private readonly _timeout;
1157
- private readonly _interval;
1158
- private readonly _options?;
1159
- private _sessionId;
1160
- private _result;
1161
- constructor(createPromise: Promise<SessionResponse$1>, sessions: Sessions, schema?: z.ZodType<T>, options?: RunOptions);
1162
- /** The session ID, available after task creation resolves. */
1163
- get sessionId(): string | null;
1164
- /** The full SessionResult, available after polling completes. */
1165
- get result(): SessionResult<T> | null;
1166
- /** Enable `await client.run(...)` — polls until terminal, returns SessionResult. */
1167
- then<R1 = SessionResult<T>, R2 = never>(onFulfilled?: ((value: SessionResult<T>) => R1 | PromiseLike<R1>) | null, onRejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null): Promise<R1 | R2>;
1168
- private _ensureSessionId;
1169
- /** Poll session until terminal, return SessionResult. */
1170
- private _waitForOutput;
1171
- /**
1172
- * Enable `for await (const msg of client.run(...))` — yields messages as they appear.
1173
- * After iteration, `.result` contains the final SessionResult.
1174
- */
1175
- [Symbol.asyncIterator](): AsyncGenerator<MessageResponse$1>;
1176
- private _parseOutput;
1177
- }
1178
-
1179
- type RunTaskRequest$1 = components["schemas"]["RunTaskRequest"];
1180
- interface BrowserUseOptions {
1181
- apiKey?: string;
1182
- baseUrl?: string;
1183
- maxRetries?: number;
1184
- timeout?: number;
1185
- }
1186
- type RunSessionOptions = Partial<Omit<RunTaskRequest$1, "task">> & RunOptions & {
1187
- schema?: z.ZodType;
1188
- };
1189
- declare class BrowserUse {
1190
- readonly billing: Billing;
1191
- readonly browsers: Browsers;
1192
- readonly profiles: Profiles;
1193
- readonly sessions: Sessions;
1194
- readonly workspaces: Workspaces;
1195
- private readonly http;
1196
- constructor(options?: BrowserUseOptions);
1197
- /**
1198
- * Create a session and run a task. `await` the result for a typed SessionResult.
1199
- *
1200
- * ```ts
1201
- * // Simple — just get the output
1202
- * const result = await client.run("Find the top HN post");
1203
- * console.log(result.output);
1204
- *
1205
- * // Structured output (Zod)
1206
- * const result = await client.run("Find product info", { schema: ProductSchema });
1207
- * console.log(result.output.name); // fully typed
1208
- * ```
1209
- */
1210
- run(task: string, options?: Omit<RunSessionOptions, "schema">): SessionRun<string>;
1211
- run<T extends z.ZodType>(task: string, options: RunSessionOptions & {
1212
- schema: T;
1213
- }): SessionRun<z.output<T>>;
1214
- }
1215
-
1216
- type S = components["schemas"];
1217
- type SessionResponse = S["SessionResponse"];
1218
- type SessionListResponse = S["SessionListResponse"];
1219
- type FileListResponse = S["FileListResponse"];
1220
- type FileInfo = S["FileInfo"];
1221
- type FileUploadResponse = S["FileUploadResponse"];
1222
- type FileUploadResponseItem = S["FileUploadResponseItem"];
1223
- type MessageListResponse = S["MessageListResponse"];
1224
- type MessageResponse = S["MessageResponse"];
1225
- type WorkspaceView = S["WorkspaceView"];
1226
- type WorkspaceListResponse = S["WorkspaceListResponse"];
1227
- type RunTaskRequest = S["RunTaskRequest"];
1228
- type StopSessionRequest = S["StopSessionRequest"];
1229
- type FileUploadRequest = S["FileUploadRequest"];
1230
- type FileUploadItem = S["FileUploadItem"];
1231
- type WorkspaceCreateRequest = S["WorkspaceCreateRequest"];
1232
- type WorkspaceUpdateRequest = S["WorkspaceUpdateRequest"];
1233
- type BrowserSessionItemView = S["BrowserSessionItemView"];
1234
- type BrowserSessionView = S["BrowserSessionView"];
1235
- type BrowserSessionListResponse = S["BrowserSessionListResponse"];
1236
- type CreateBrowserSessionRequest = S["CreateBrowserSessionRequest"];
1237
- type UpdateBrowserSessionRequest = S["UpdateBrowserSessionRequest"];
1238
- type BrowserSessionStatus = S["BrowserSessionStatus"];
1239
- type BrowserSessionUpdateAction = S["BrowserSessionUpdateAction"];
1240
- type ProfileView = S["ProfileView"];
1241
- type ProfileListResponse = S["ProfileListResponse"];
1242
- type ProfileCreateRequest = S["ProfileCreateRequest"];
1243
- type ProfileUpdateRequest = S["ProfileUpdateRequest"];
1244
- type AccountView = S["AccountView"];
1245
- type PlanInfo = S["PlanInfo"];
1246
- type BuAgentSessionStatus = S["BuAgentSessionStatus"];
1247
- type BuModel = S["BuModel"];
1248
- type ProxyCountryCode = S["ProxyCountryCode"];
1249
- type StopStrategy = S["StopStrategy"];
1250
-
1251
- 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 SessionFilesParams, 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 };