browser-use-sdk 3.3.2 → 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,1238 +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
- * Createdat
480
- * Format: date-time
481
- */
482
- createdAt: string;
483
- };
484
- /**
485
- * PlanInfo
486
- * @description View model for plan information
487
- */
488
- PlanInfo: {
489
- /**
490
- * Plan Name
491
- * @description The name of the plan
492
- */
493
- planName: string;
494
- /**
495
- * Subscription Status
496
- * @description The status of the subscription
497
- */
498
- subscriptionStatus: string | null;
499
- /**
500
- * Subscription ID
501
- * @description The ID of the subscription
502
- */
503
- subscriptionId: string | null;
504
- /**
505
- * Subscription Current Period End
506
- * @description The end of the current period
507
- */
508
- subscriptionCurrentPeriodEnd: string | null;
509
- /**
510
- * Subscription Canceled At
511
- * @description The date the subscription was canceled
512
- */
513
- subscriptionCanceledAt: string | null;
514
- };
515
- /**
516
- * ProfileCreateRequest
517
- * @description Request model for creating a new profile.
518
- */
519
- ProfileCreateRequest: {
520
- /**
521
- * Name
522
- * @description Optional name for the profile
523
- */
524
- name?: string | null;
525
- /**
526
- * User ID
527
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
528
- */
529
- userId?: string | null;
530
- };
531
- /**
532
- * ProfileListResponse
533
- * @description Response model for paginated profile list requests.
534
- */
535
- ProfileListResponse: {
536
- /**
537
- * Items
538
- * @description List of profile views for the current page
539
- */
540
- items: components["schemas"]["ProfileView"][];
541
- /**
542
- * Total Items
543
- * @description Total number of items in the list
544
- */
545
- totalItems: number;
546
- /**
547
- * Page Number
548
- * @description Page number
549
- */
550
- pageNumber: number;
551
- /**
552
- * Page Size
553
- * @description Number of items per page
554
- */
555
- pageSize: number;
556
- };
557
- /**
558
- * ProfileNotFoundError
559
- * @description Error response when a profile is not found
560
- */
561
- ProfileNotFoundError: {
562
- /**
563
- * Detail
564
- * @default Profile not found
565
- */
566
- detail: string;
567
- };
568
- /**
569
- * ProfileUpdateRequest
570
- * @description Request model for updating a profile.
571
- */
572
- ProfileUpdateRequest: {
573
- /**
574
- * Name
575
- * @description Optional name for the profile
576
- */
577
- name?: string | null;
578
- /**
579
- * User ID
580
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
581
- */
582
- userId?: string | null;
583
- };
584
- /**
585
- * ProfileView
586
- * @description View model for representing a profile. A profile lets you preserve the login state between sessions.
587
- *
588
- * We recommend that you create a separate profile for each user of your app.
589
- * You can assign a user_id to each profile to easily identify which user the profile belongs to.
590
- */
591
- ProfileView: {
592
- /**
593
- * ID
594
- * Format: uuid
595
- * @description Unique identifier for the profile
596
- */
597
- id: string;
598
- /**
599
- * User ID
600
- * @description Your internal user identifier for this profile. Use this to associate a profile with a user in your system.
601
- */
602
- userId?: string | null;
603
- /**
604
- * Name
605
- * @description Optional name for the profile
606
- */
607
- name?: string | null;
608
- /**
609
- * Last Used At
610
- * @description Timestamp when the profile was last used
611
- */
612
- lastUsedAt?: string | null;
613
- /**
614
- * Created At
615
- * Format: date-time
616
- * @description Timestamp when the profile was created
617
- */
618
- createdAt: string;
619
- /**
620
- * Updated At
621
- * Format: date-time
622
- * @description Timestamp when the profile was last updated
623
- */
624
- updatedAt: string;
625
- /**
626
- * Cookie Domains
627
- * @description List of domain URLs that have cookies stored for this profile
628
- */
629
- cookieDomains?: string[] | null;
630
- };
631
- /**
632
- * ProxyCountryCode
633
- * @enum {string}
634
- */
635
- 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";
636
- /**
637
- * RunTaskRequest
638
- * @description Unified request for creating a session or dispatching a task.
639
- *
640
- * - Without session_id + without task: creates a new idle session (for file uploads, etc.)
641
- * - Without session_id + with task: creates a new session and dispatches the task
642
- * - With session_id + with task: dispatches the task to an existing idle session
643
- * - With session_id + without task: 422 (task required when dispatching to existing session)
644
- */
645
- RunTaskRequest: {
646
- /** Task */
647
- task?: string | null;
648
- /** @default bu-max */
649
- model: components["schemas"]["BuModel"];
650
- /** Sessionid */
651
- sessionId?: string | null;
652
- /**
653
- * Keepalive
654
- * @default false
655
- */
656
- keepAlive: boolean;
657
- /** Maxcostusd */
658
- maxCostUsd?: number | string | null;
659
- /** Profileid */
660
- profileId?: string | null;
661
- /** Workspaceid */
662
- workspaceId?: string | null;
663
- /** @default us */
664
- proxyCountryCode: components["schemas"]["ProxyCountryCode"] | null;
665
- /** Outputschema */
666
- outputSchema?: {
667
- [key: string]: unknown;
668
- } | null;
669
- /**
670
- * Enablescheduledtasks
671
- * @default false
672
- */
673
- enableScheduledTasks: boolean;
674
- /**
675
- * Enablerecording
676
- * @default false
677
- */
678
- enableRecording: boolean;
679
- /**
680
- * Skills
681
- * @default true
682
- */
683
- skills: boolean;
684
- /**
685
- * Agentmail
686
- * @default true
687
- */
688
- agentmail: boolean;
689
- };
690
- /** SessionListResponse */
691
- SessionListResponse: {
692
- /** Sessions */
693
- sessions: components["schemas"]["SessionResponse"][];
694
- /** Total */
695
- total: number;
696
- /** Page */
697
- page: number;
698
- /** Pagesize */
699
- pageSize: number;
700
- };
701
- /**
702
- * SessionNotFoundError
703
- * @description Error response when a session is not found
704
- */
705
- SessionNotFoundError: {
706
- /**
707
- * Detail
708
- * @default Session not found
709
- */
710
- detail: string;
711
- };
712
- /** SessionResponse */
713
- SessionResponse: {
714
- /**
715
- * Id
716
- * Format: uuid
717
- */
718
- id: string;
719
- status: components["schemas"]["BuAgentSessionStatus"];
720
- model: components["schemas"]["BuModel"];
721
- /** Title */
722
- title?: string | null;
723
- /** Output */
724
- output?: unknown | null;
725
- /** Outputschema */
726
- outputSchema?: {
727
- [key: string]: unknown;
728
- } | null;
729
- /**
730
- * Stepcount
731
- * @default 0
732
- */
733
- stepCount: number;
734
- /** Laststepsummary */
735
- lastStepSummary?: string | null;
736
- /** Istasksuccessful */
737
- isTaskSuccessful?: boolean | null;
738
- /** Liveurl */
739
- liveUrl?: string | null;
740
- /**
741
- * Recordingurls
742
- * @default []
743
- */
744
- recordingUrls: string[];
745
- /** Profileid */
746
- profileId?: string | null;
747
- /** Workspaceid */
748
- workspaceId?: string | null;
749
- proxyCountryCode?: components["schemas"]["ProxyCountryCode"] | null;
750
- /** Maxcostusd */
751
- maxCostUsd?: string | null;
752
- /**
753
- * Totalinputtokens
754
- * @default 0
755
- */
756
- totalInputTokens: number;
757
- /**
758
- * Totaloutputtokens
759
- * @default 0
760
- */
761
- totalOutputTokens: number;
762
- /**
763
- * Proxyusedmb
764
- * @default 0
765
- */
766
- proxyUsedMb: string;
767
- /**
768
- * Llmcostusd
769
- * @default 0
770
- */
771
- llmCostUsd: string;
772
- /**
773
- * Proxycostusd
774
- * @default 0
775
- */
776
- proxyCostUsd: string;
777
- /**
778
- * Browsercostusd
779
- * @default 0
780
- */
781
- browserCostUsd: string;
782
- /**
783
- * Totalcostusd
784
- * @default 0
785
- */
786
- totalCostUsd: string;
787
- /** Screenshoturl */
788
- screenshotUrl?: string | null;
789
- /** Agentmailemail */
790
- agentmailEmail?: string | null;
791
- /**
792
- * Createdat
793
- * Format: date-time
794
- */
795
- createdAt: string;
796
- /**
797
- * Updatedat
798
- * Format: date-time
799
- */
800
- updatedAt: string;
801
- };
802
- /**
803
- * SessionTimeoutLimitExceededError
804
- * @description Error response when session timeout exceeds the maximum allowed limit
805
- */
806
- SessionTimeoutLimitExceededError: {
807
- /**
808
- * Detail
809
- * @default Maximum session timeout is 4 hours (240 minutes).
810
- */
811
- detail: string;
812
- };
813
- /** StopSessionRequest */
814
- StopSessionRequest: {
815
- /** @default session */
816
- strategy: components["schemas"]["StopStrategy"];
817
- };
818
- /**
819
- * StopStrategy
820
- * @enum {string}
821
- */
822
- StopStrategy: "task" | "session";
823
- /**
824
- * TooManyConcurrentActiveSessionsError
825
- * @description Error response when user has too many concurrent active sessions
826
- */
827
- TooManyConcurrentActiveSessionsError: {
828
- /**
829
- * Detail
830
- * @default Too many concurrent active sessions. Please wait for one to finish, kill one, or upgrade your plan.
831
- */
832
- detail: string;
833
- };
834
- /**
835
- * UpdateBrowserSessionRequest
836
- * @description Request model for updating browser session state.
837
- */
838
- UpdateBrowserSessionRequest: {
839
- /**
840
- * Action
841
- * @description The action to perform on the session
842
- */
843
- action: components["schemas"]["BrowserSessionUpdateAction"];
844
- };
845
- /** ValidationError */
846
- ValidationError: {
847
- /** Location */
848
- loc: (string | number)[];
849
- /** Message */
850
- msg: string;
851
- /** Error Type */
852
- type: string;
853
- };
854
- /**
855
- * WorkspaceCreateRequest
856
- * @description Request model for creating a new workspace.
857
- */
858
- WorkspaceCreateRequest: {
859
- /**
860
- * Name
861
- * @description Optional name for the workspace
862
- */
863
- name?: string | null;
864
- };
865
- /**
866
- * WorkspaceListResponse
867
- * @description Response model for paginated workspace list requests.
868
- */
869
- WorkspaceListResponse: {
870
- /**
871
- * Items
872
- * @description List of workspace views for the current page
873
- */
874
- items: components["schemas"]["WorkspaceView"][];
875
- /**
876
- * Total Items
877
- * @description Total number of items in the list
878
- */
879
- totalItems: number;
880
- /**
881
- * Page Number
882
- * @description Page number
883
- */
884
- pageNumber: number;
885
- /**
886
- * Page Size
887
- * @description Number of items per page
888
- */
889
- pageSize: number;
890
- };
891
- /**
892
- * WorkspaceUpdateRequest
893
- * @description Request model for updating a workspace.
894
- */
895
- WorkspaceUpdateRequest: {
896
- /**
897
- * Name
898
- * @description Optional name for the workspace
899
- */
900
- name?: string | null;
901
- };
902
- /**
903
- * WorkspaceView
904
- * @description View model for a workspace — persistent shared storage across sessions.
905
- */
906
- WorkspaceView: {
907
- /**
908
- * ID
909
- * Format: uuid
910
- * @description Unique identifier for the workspace
911
- */
912
- id: string;
913
- /**
914
- * Name
915
- * @description Optional name for the workspace
916
- */
917
- name?: string | null;
918
- /**
919
- * Created At
920
- * Format: date-time
921
- * @description Timestamp when the workspace was created
922
- */
923
- createdAt: string;
924
- /**
925
- * Updated At
926
- * Format: date-time
927
- * @description Timestamp when the workspace was last updated
928
- */
929
- updatedAt: string;
930
- };
931
- };
932
- responses: never;
933
- parameters: never;
934
- requestBodies: never;
935
- headers: never;
936
- pathItems: never;
937
- }
938
-
939
- type AccountView$1 = components["schemas"]["AccountView"];
940
- declare class Billing {
941
- private readonly http;
942
- constructor(http: HttpClient);
943
- /** Get account billing information. */
944
- account(): Promise<AccountView$1>;
945
- }
946
-
947
- type CreateBrowserSessionRequest$1 = components["schemas"]["CreateBrowserSessionRequest"];
948
- type BrowserSessionItemView$1 = components["schemas"]["BrowserSessionItemView"];
949
- type BrowserSessionView$1 = components["schemas"]["BrowserSessionView"];
950
- type BrowserSessionListResponse$1 = components["schemas"]["BrowserSessionListResponse"];
951
- type UpdateBrowserSessionRequest$1 = components["schemas"]["UpdateBrowserSessionRequest"];
952
- interface BrowserListParams {
953
- page?: number;
954
- page_size?: number;
955
- }
956
- declare class Browsers {
957
- private readonly http;
958
- constructor(http: HttpClient);
959
- /** Create a standalone browser session. */
960
- create(body?: CreateBrowserSessionRequest$1): Promise<BrowserSessionItemView$1>;
961
- /** List browser sessions for the authenticated project. */
962
- list(params?: BrowserListParams): Promise<BrowserSessionListResponse$1>;
963
- /** Get browser session details. */
964
- get(sessionId: string): Promise<BrowserSessionView$1>;
965
- /** Update a browser session (e.g. stop it). */
966
- update(sessionId: string, body: UpdateBrowserSessionRequest$1): Promise<BrowserSessionView$1>;
967
- /** Stop a browser session. Convenience wrapper around update. */
968
- stop(sessionId: string): Promise<BrowserSessionView$1>;
969
- }
970
-
971
- type ProfileView$1 = components["schemas"]["ProfileView"];
972
- type ProfileListResponse$1 = components["schemas"]["ProfileListResponse"];
973
- type ProfileCreateRequest$1 = components["schemas"]["ProfileCreateRequest"];
974
- type ProfileUpdateRequest$1 = components["schemas"]["ProfileUpdateRequest"];
975
- interface ProfileListParams {
976
- query?: string;
977
- page?: number;
978
- page_size?: number;
979
- }
980
- declare class Profiles {
981
- private readonly http;
982
- constructor(http: HttpClient);
983
- /** Create a browser profile. */
984
- create(body?: ProfileCreateRequest$1): Promise<ProfileView$1>;
985
- /** List profiles for the authenticated project. */
986
- list(params?: ProfileListParams): Promise<ProfileListResponse$1>;
987
- /** Get profile details. */
988
- get(profileId: string): Promise<ProfileView$1>;
989
- /** Update a profile. */
990
- update(profileId: string, body: ProfileUpdateRequest$1): Promise<ProfileView$1>;
991
- /** Delete a profile. */
992
- delete(profileId: string): Promise<void>;
993
- }
994
-
995
- type RunTaskRequest$2 = components["schemas"]["RunTaskRequest"];
996
- /** All fields optional — omit `task` to create an idle session. */
997
- type CreateSessionBody = Partial<RunTaskRequest$2>;
998
- type SessionResponse$2 = components["schemas"]["SessionResponse"];
999
- type SessionListResponse$1 = components["schemas"]["SessionListResponse"];
1000
- type FileListResponse$2 = components["schemas"]["FileListResponse"];
1001
- type StopSessionRequest$1 = components["schemas"]["StopSessionRequest"];
1002
- type FileUploadRequest$2 = components["schemas"]["FileUploadRequest"];
1003
- type FileUploadResponse$2 = components["schemas"]["FileUploadResponse"];
1004
- type MessageListResponse$1 = components["schemas"]["MessageListResponse"];
1005
- interface SessionListParams {
1006
- page?: number;
1007
- page_size?: number;
1008
- }
1009
- interface SessionFilesParams {
1010
- prefix?: string;
1011
- limit?: number;
1012
- cursor?: string | null;
1013
- includeUrls?: boolean;
1014
- shallow?: boolean;
1015
- }
1016
- interface SessionMessagesParams {
1017
- after?: string | null;
1018
- before?: string | null;
1019
- limit?: number;
1020
- }
1021
- declare class Sessions {
1022
- private readonly http;
1023
- constructor(http: HttpClient);
1024
- /** Create a session and optionally dispatch a task. */
1025
- create(body?: CreateSessionBody): Promise<SessionResponse$2>;
1026
- /** List sessions for the authenticated project. */
1027
- list(params?: SessionListParams): Promise<SessionListResponse$1>;
1028
- /** Get session details. */
1029
- get(sessionId: string): Promise<SessionResponse$2>;
1030
- /** Stop a session or the running task. */
1031
- stop(sessionId: string, body?: StopSessionRequest$1): Promise<SessionResponse$2>;
1032
- /** Soft-delete a session. */
1033
- delete(sessionId: string): Promise<void>;
1034
- /** Get presigned upload URLs for session files. */
1035
- uploadFiles(sessionId: string, body: FileUploadRequest$2): Promise<FileUploadResponse$2>;
1036
- /** List files in a session's workspace. */
1037
- files(sessionId: string, params?: SessionFilesParams): Promise<FileListResponse$2>;
1038
- /** List messages for a session with cursor-based pagination. */
1039
- messages(sessionId: string, params?: SessionMessagesParams): Promise<MessageListResponse$1>;
1040
- /**
1041
- * Poll until recording URLs are available. Returns presigned MP4 URLs.
1042
- *
1043
- * Returns an empty array if no recording was produced (e.g. the agent
1044
- * answered without opening a browser, or recording was not enabled).
1045
- */
1046
- waitForRecording(sessionId: string, options?: {
1047
- timeout?: number;
1048
- interval?: number;
1049
- }): Promise<string[]>;
1050
- }
1051
-
1052
- type WorkspaceView$1 = components["schemas"]["WorkspaceView"];
1053
- type WorkspaceListResponse$1 = components["schemas"]["WorkspaceListResponse"];
1054
- type WorkspaceCreateRequest$1 = components["schemas"]["WorkspaceCreateRequest"];
1055
- type WorkspaceUpdateRequest$1 = components["schemas"]["WorkspaceUpdateRequest"];
1056
- type FileListResponse$1 = components["schemas"]["FileListResponse"];
1057
- type FileUploadRequest$1 = components["schemas"]["FileUploadRequest"];
1058
- type FileUploadResponse$1 = components["schemas"]["FileUploadResponse"];
1059
- interface WorkspaceListParams {
1060
- pageSize?: number;
1061
- pageNumber?: number;
1062
- }
1063
- interface WorkspaceFilesParams {
1064
- prefix?: string;
1065
- limit?: number;
1066
- cursor?: string | null;
1067
- includeUrls?: boolean;
1068
- shallow?: boolean;
1069
- }
1070
- declare class Workspaces {
1071
- private readonly http;
1072
- constructor(http: HttpClient);
1073
- /** List workspaces for the authenticated project. */
1074
- list(params?: WorkspaceListParams): Promise<WorkspaceListResponse$1>;
1075
- /** Create a new workspace. */
1076
- create(body?: WorkspaceCreateRequest$1): Promise<WorkspaceView$1>;
1077
- /** Get workspace details. */
1078
- get(workspaceId: string): Promise<WorkspaceView$1>;
1079
- /** Update a workspace. */
1080
- update(workspaceId: string, body: WorkspaceUpdateRequest$1): Promise<WorkspaceView$1>;
1081
- /** Delete a workspace and its data. */
1082
- delete(workspaceId: string): Promise<void>;
1083
- /** List files in a workspace. */
1084
- files(workspaceId: string, params?: WorkspaceFilesParams): Promise<FileListResponse$1>;
1085
- /** Get presigned upload URLs for workspace files. */
1086
- uploadFiles(workspaceId: string, body: FileUploadRequest$1, query?: {
1087
- prefix?: string;
1088
- }): Promise<FileUploadResponse$1>;
1089
- /** Delete a file from a workspace. */
1090
- deleteFile(workspaceId: string, path: string): Promise<void>;
1091
- /** Get storage usage for a workspace. */
1092
- size(workspaceId: string): Promise<unknown>;
1093
- /**
1094
- * Upload local files to a workspace. Returns the list of remote paths.
1095
- *
1096
- * ```ts
1097
- * await client.workspaces.upload(wsId, "data.csv", "config.json");
1098
- * ```
1099
- */
1100
- upload(workspaceId: string, ...paths: string[]): Promise<string[]>;
1101
- /**
1102
- * Download a single file from a workspace. Returns the local path.
1103
- *
1104
- * ```ts
1105
- * const local = await client.workspaces.download(wsId, "uploads/data.csv", { to: "./data.csv" });
1106
- * ```
1107
- */
1108
- download(workspaceId: string, path: string, options?: {
1109
- to?: string;
1110
- }): Promise<string>;
1111
- /**
1112
- * Download all files from a workspace. Returns list of local paths.
1113
- *
1114
- * ```ts
1115
- * const paths = await client.workspaces.downloadAll(wsId, { to: "./output" });
1116
- * ```
1117
- */
1118
- downloadAll(workspaceId: string, options?: {
1119
- to?: string;
1120
- prefix?: string;
1121
- }): Promise<string[]>;
1122
- }
1123
-
1124
- type SessionResponse$1 = components["schemas"]["SessionResponse"];
1125
- type MessageResponse$1 = components["schemas"]["MessageResponse"];
1126
- interface RunOptions {
1127
- /** Maximum time to wait in milliseconds. Default: 14_400_000 (4 hours). */
1128
- timeout?: number;
1129
- /** Polling interval in milliseconds. Default: 2_000. */
1130
- interval?: number;
1131
- }
1132
- /** Session result with typed output. All SessionResponse fields are directly accessible. */
1133
- type SessionResult<T = string | null> = Omit<SessionResponse$1, "output"> & {
1134
- output: T;
1135
- };
1136
- /**
1137
- * Dual-purpose session handle: `await` it for a typed SessionResult,
1138
- * or access `.result` for the full SessionResult after resolution.
1139
- */
1140
- declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
1141
- private readonly _createPromise;
1142
- private readonly _sessions;
1143
- private readonly _schema?;
1144
- private readonly _timeout;
1145
- private readonly _interval;
1146
- private _sessionId;
1147
- private _result;
1148
- constructor(createPromise: Promise<SessionResponse$1>, sessions: Sessions, schema?: z.ZodType<T>, options?: RunOptions);
1149
- /** The session ID, available after task creation resolves. */
1150
- get sessionId(): string | null;
1151
- /** The full SessionResult, available after polling completes. */
1152
- get result(): SessionResult<T> | null;
1153
- /** Enable `await client.run(...)` — polls until terminal, returns SessionResult. */
1154
- then<R1 = SessionResult<T>, R2 = never>(onFulfilled?: ((value: SessionResult<T>) => R1 | PromiseLike<R1>) | null, onRejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null): Promise<R1 | R2>;
1155
- private _ensureSessionId;
1156
- /** Poll session until terminal, return SessionResult. */
1157
- private _waitForOutput;
1158
- /**
1159
- * Enable `for await (const msg of client.run(...))` — yields messages as they appear.
1160
- * After iteration, `.result` contains the final SessionResult.
1161
- */
1162
- [Symbol.asyncIterator](): AsyncGenerator<MessageResponse$1>;
1163
- private _parseOutput;
1164
- }
1165
-
1166
- type RunTaskRequest$1 = components["schemas"]["RunTaskRequest"];
1167
- interface BrowserUseOptions {
1168
- apiKey?: string;
1169
- baseUrl?: string;
1170
- maxRetries?: number;
1171
- timeout?: number;
1172
- }
1173
- type RunSessionOptions = Partial<Omit<RunTaskRequest$1, "task">> & RunOptions & {
1174
- schema?: z.ZodType;
1175
- };
1176
- declare class BrowserUse {
1177
- readonly billing: Billing;
1178
- readonly browsers: Browsers;
1179
- readonly profiles: Profiles;
1180
- readonly sessions: Sessions;
1181
- readonly workspaces: Workspaces;
1182
- private readonly http;
1183
- constructor(options?: BrowserUseOptions);
1184
- /**
1185
- * Create a session and run a task. `await` the result for a typed SessionResult.
1186
- *
1187
- * ```ts
1188
- * // Simple — just get the output
1189
- * const result = await client.run("Find the top HN post");
1190
- * console.log(result.output);
1191
- *
1192
- * // Structured output (Zod)
1193
- * const result = await client.run("Find product info", { schema: ProductSchema });
1194
- * console.log(result.output.name); // fully typed
1195
- * ```
1196
- */
1197
- run(task: string, options?: Omit<RunSessionOptions, "schema">): SessionRun<string>;
1198
- run<T extends z.ZodType>(task: string, options: RunSessionOptions & {
1199
- schema: T;
1200
- }): SessionRun<z.output<T>>;
1201
- }
1202
-
1203
- type S = components["schemas"];
1204
- type SessionResponse = S["SessionResponse"];
1205
- type SessionListResponse = S["SessionListResponse"];
1206
- type FileListResponse = S["FileListResponse"];
1207
- type FileInfo = S["FileInfo"];
1208
- type FileUploadResponse = S["FileUploadResponse"];
1209
- type FileUploadResponseItem = S["FileUploadResponseItem"];
1210
- type MessageListResponse = S["MessageListResponse"];
1211
- type MessageResponse = S["MessageResponse"];
1212
- type WorkspaceView = S["WorkspaceView"];
1213
- type WorkspaceListResponse = S["WorkspaceListResponse"];
1214
- type RunTaskRequest = S["RunTaskRequest"];
1215
- type StopSessionRequest = S["StopSessionRequest"];
1216
- type FileUploadRequest = S["FileUploadRequest"];
1217
- type FileUploadItem = S["FileUploadItem"];
1218
- type WorkspaceCreateRequest = S["WorkspaceCreateRequest"];
1219
- type WorkspaceUpdateRequest = S["WorkspaceUpdateRequest"];
1220
- type BrowserSessionItemView = S["BrowserSessionItemView"];
1221
- type BrowserSessionView = S["BrowserSessionView"];
1222
- type BrowserSessionListResponse = S["BrowserSessionListResponse"];
1223
- type CreateBrowserSessionRequest = S["CreateBrowserSessionRequest"];
1224
- type UpdateBrowserSessionRequest = S["UpdateBrowserSessionRequest"];
1225
- type BrowserSessionStatus = S["BrowserSessionStatus"];
1226
- type BrowserSessionUpdateAction = S["BrowserSessionUpdateAction"];
1227
- type ProfileView = S["ProfileView"];
1228
- type ProfileListResponse = S["ProfileListResponse"];
1229
- type ProfileCreateRequest = S["ProfileCreateRequest"];
1230
- type ProfileUpdateRequest = S["ProfileUpdateRequest"];
1231
- type AccountView = S["AccountView"];
1232
- type PlanInfo = S["PlanInfo"];
1233
- type BuAgentSessionStatus = S["BuAgentSessionStatus"];
1234
- type BuModel = S["BuModel"];
1235
- type ProxyCountryCode = S["ProxyCountryCode"];
1236
- type StopStrategy = S["StopStrategy"];
1237
-
1238
- 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 };