browser-use-sdk 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v3.d.ts CHANGED
@@ -4,6 +4,248 @@ export { B as BrowserUseError } from './errors-BtB79l7x.js';
4
4
 
5
5
  interface components {
6
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
+ };
7
249
  /**
8
250
  * BuAgentSessionStatus
9
251
  * @enum {string}
@@ -13,7 +255,83 @@ interface components {
13
255
  * BuModel
14
256
  * @enum {string}
15
257
  */
16
- BuModel: "bu-mini" | "bu-max";
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
+ };
17
335
  /**
18
336
  * FileInfo
19
337
  * @description A file in a session's workspace.
@@ -109,6 +427,17 @@ interface components {
109
427
  /** Detail */
110
428
  detail?: components["schemas"]["ValidationError"][];
111
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
+ };
112
441
  /** MessageListResponse */
113
442
  MessageListResponse: {
114
443
  /** Messages */
@@ -144,12 +473,167 @@ interface components {
144
473
  * @default
145
474
  */
146
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;
147
484
  /**
148
485
  * Createdat
149
486
  * Format: date-time
150
487
  */
151
488
  createdAt: string;
152
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
+ };
153
637
  /**
154
638
  * ProxyCountryCode
155
639
  * @enum {string}
@@ -167,7 +651,7 @@ interface components {
167
651
  RunTaskRequest: {
168
652
  /** Task */
169
653
  task?: string | null;
170
- /** @default bu-mini */
654
+ /** @default bu-max */
171
655
  model: components["schemas"]["BuModel"];
172
656
  /** Sessionid */
173
657
  sessionId?: string | null;
@@ -198,6 +682,16 @@ interface components {
198
682
  * @default false
199
683
  */
200
684
  enableRecording: boolean;
685
+ /**
686
+ * Skills
687
+ * @default true
688
+ */
689
+ skills: boolean;
690
+ /**
691
+ * Agentmail
692
+ * @default true
693
+ */
694
+ agentmail: boolean;
201
695
  };
202
696
  /** SessionListResponse */
203
697
  SessionListResponse: {
@@ -210,6 +704,17 @@ interface components {
210
704
  /** Pagesize */
211
705
  pageSize: number;
212
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
+ };
213
718
  /** SessionResponse */
214
719
  SessionResponse: {
215
720
  /**
@@ -218,7 +723,8 @@ interface components {
218
723
  */
219
724
  id: string;
220
725
  status: components["schemas"]["BuAgentSessionStatus"];
221
- model: components["schemas"]["BuModel"];
726
+ /** The model used. May be a BuModel alias or a resolved model name. */
727
+ model: string;
222
728
  /** Title */
223
729
  title?: string | null;
224
730
  /** Output */
@@ -238,8 +744,11 @@ interface components {
238
744
  isTaskSuccessful?: boolean | null;
239
745
  /** Liveurl */
240
746
  liveUrl?: string | null;
241
- /** Recordingurl */
242
- recordingUrl?: string | null;
747
+ /**
748
+ * Recordingurls
749
+ * @default []
750
+ */
751
+ recordingUrls: string[];
243
752
  /** Profileid */
244
753
  profileId?: string | null;
245
754
  /** Workspaceid */
@@ -282,6 +791,10 @@ interface components {
282
791
  * @default 0
283
792
  */
284
793
  totalCostUsd: string;
794
+ /** Screenshoturl */
795
+ screenshotUrl?: string | null;
796
+ /** Agentmailemail */
797
+ agentmailEmail?: string | null;
285
798
  /**
286
799
  * Createdat
287
800
  * Format: date-time
@@ -293,6 +806,17 @@ interface components {
293
806
  */
294
807
  updatedAt: string;
295
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
+ };
296
820
  /** StopSessionRequest */
297
821
  StopSessionRequest: {
298
822
  /** @default session */
@@ -303,6 +827,28 @@ interface components {
303
827
  * @enum {string}
304
828
  */
305
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
+ };
306
852
  /** ValidationError */
307
853
  ValidationError: {
308
854
  /** Location */
@@ -397,6 +943,62 @@ interface components {
397
943
  pathItems: never;
398
944
  }
399
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
+
400
1002
  type RunTaskRequest$2 = components["schemas"]["RunTaskRequest"];
401
1003
  /** All fields optional — omit `task` to create an idle session. */
402
1004
  type CreateSessionBody = Partial<RunTaskRequest$2>;
@@ -442,6 +1044,16 @@ declare class Sessions {
442
1044
  files(sessionId: string, params?: SessionFilesParams): Promise<FileListResponse$2>;
443
1045
  /** List messages for a session with cursor-based pagination. */
444
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[]>;
445
1057
  }
446
1058
 
447
1059
  type WorkspaceView$1 = components["schemas"]["WorkspaceView"];
@@ -485,14 +1097,49 @@ declare class Workspaces {
485
1097
  deleteFile(workspaceId: string, path: string): Promise<void>;
486
1098
  /** Get storage usage for a workspace. */
487
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[]>;
488
1132
  }
489
1133
 
490
1134
  type SessionResponse$1 = components["schemas"]["SessionResponse"];
1135
+ type MessageResponse$1 = components["schemas"]["MessageResponse"];
491
1136
  interface RunOptions {
492
- /** Maximum time to wait in milliseconds. Default: 300_000 (5 min). */
1137
+ /** Maximum time to wait in milliseconds. Default: 14_400_000 (4 hours). */
493
1138
  timeout?: number;
494
1139
  /** Polling interval in milliseconds. Default: 2_000. */
495
1140
  interval?: number;
1141
+ /** @internal Starting message cursor for follow-up runs on an existing session. */
1142
+ _startCursor?: string;
496
1143
  }
497
1144
  /** Session result with typed output. All SessionResponse fields are directly accessible. */
498
1145
  type SessionResult<T = string | null> = Omit<SessionResponse$1, "output"> & {
@@ -508,6 +1155,7 @@ declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
508
1155
  private readonly _schema?;
509
1156
  private readonly _timeout;
510
1157
  private readonly _interval;
1158
+ private readonly _options?;
511
1159
  private _sessionId;
512
1160
  private _result;
513
1161
  constructor(createPromise: Promise<SessionResponse$1>, sessions: Sessions, schema?: z.ZodType<T>, options?: RunOptions);
@@ -520,6 +1168,11 @@ declare class SessionRun<T = string> implements PromiseLike<SessionResult<T>> {
520
1168
  private _ensureSessionId;
521
1169
  /** Poll session until terminal, return SessionResult. */
522
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>;
523
1176
  private _parseOutput;
524
1177
  }
525
1178
 
@@ -534,6 +1187,9 @@ type RunSessionOptions = Partial<Omit<RunTaskRequest$1, "task">> & RunOptions &
534
1187
  schema?: z.ZodType;
535
1188
  };
536
1189
  declare class BrowserUse {
1190
+ readonly billing: Billing;
1191
+ readonly browsers: Browsers;
1192
+ readonly profiles: Profiles;
537
1193
  readonly sessions: Sessions;
538
1194
  readonly workspaces: Workspaces;
539
1195
  private readonly http;
@@ -574,9 +1230,22 @@ type FileUploadRequest = S["FileUploadRequest"];
574
1230
  type FileUploadItem = S["FileUploadItem"];
575
1231
  type WorkspaceCreateRequest = S["WorkspaceCreateRequest"];
576
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"];
577
1246
  type BuAgentSessionStatus = S["BuAgentSessionStatus"];
578
1247
  type BuModel = S["BuModel"];
579
1248
  type ProxyCountryCode = S["ProxyCountryCode"];
580
1249
  type StopStrategy = S["StopStrategy"];
581
1250
 
582
- export { BrowserUse, type BrowserUseOptions, type BuAgentSessionStatus, type BuModel, type CreateSessionBody, type FileInfo, type FileListResponse, type FileUploadItem, type FileUploadRequest, type FileUploadResponse, type FileUploadResponseItem, type MessageListResponse, type MessageResponse, 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 components as V3Types, type WorkspaceCreateRequest, type WorkspaceFilesParams, type WorkspaceListParams, type WorkspaceListResponse, type WorkspaceUpdateRequest, type WorkspaceView, Workspaces };
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 };