browser-use-sdk 0.3.0 → 0.5.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/CHANGELOG.md +23 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/internal/detect-platform.js +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/lib/bin/auth.d.mts +10 -0
- package/lib/bin/auth.d.mts.map +1 -0
- package/lib/bin/auth.d.ts +10 -0
- package/lib/bin/auth.d.ts.map +1 -0
- package/lib/bin/auth.js +52 -0
- package/lib/bin/auth.js.map +1 -0
- package/lib/bin/auth.mjs +47 -0
- package/lib/bin/auth.mjs.map +1 -0
- package/lib/bin/cli.d.mts +3 -0
- package/lib/bin/cli.d.mts.map +1 -0
- package/lib/bin/cli.d.ts +3 -0
- package/lib/bin/cli.d.ts.map +1 -0
- package/lib/bin/cli.js +12 -0
- package/lib/bin/cli.js.map +1 -0
- package/lib/bin/cli.mjs +10 -0
- package/lib/bin/cli.mjs.map +1 -0
- package/lib/bin/commands/listen.d.mts +3 -0
- package/lib/bin/commands/listen.d.mts.map +1 -0
- package/lib/bin/commands/listen.d.ts +3 -0
- package/lib/bin/commands/listen.d.ts.map +1 -0
- package/lib/bin/commands/listen.js +133 -0
- package/lib/bin/commands/listen.js.map +1 -0
- package/lib/bin/commands/listen.mjs +130 -0
- package/lib/bin/commands/listen.mjs.map +1 -0
- package/lib/stream.d.mts.map +1 -1
- package/lib/stream.d.ts.map +1 -1
- package/lib/stream.js +6 -3
- package/lib/stream.js.map +1 -1
- package/lib/stream.mjs +6 -3
- package/lib/stream.mjs.map +1 -1
- package/lib/webhooks.d.mts +73 -0
- package/lib/webhooks.d.mts.map +1 -0
- package/lib/webhooks.d.ts +73 -0
- package/lib/webhooks.d.ts.map +1 -0
- package/lib/webhooks.js +84 -0
- package/lib/webhooks.js.map +1 -0
- package/lib/webhooks.mjs +78 -0
- package/lib/webhooks.mjs.map +1 -0
- package/package.json +9 -2
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sessions/index.d.mts +1 -1
- package/resources/sessions/index.d.mts.map +1 -1
- package/resources/sessions/index.d.ts +1 -1
- package/resources/sessions/index.d.ts.map +1 -1
- package/resources/sessions/index.js.map +1 -1
- package/resources/sessions/index.mjs.map +1 -1
- package/resources/sessions/sessions.d.mts +2 -8
- package/resources/sessions/sessions.d.mts.map +1 -1
- package/resources/sessions/sessions.d.ts +2 -8
- package/resources/sessions/sessions.d.ts.map +1 -1
- package/resources/sessions/sessions.js +2 -2
- package/resources/sessions/sessions.js.map +1 -1
- package/resources/sessions/sessions.mjs +2 -2
- package/resources/sessions/sessions.mjs.map +1 -1
- package/resources/tasks.d.mts +96 -65
- package/resources/tasks.d.mts.map +1 -1
- package/resources/tasks.d.ts +96 -65
- package/resources/tasks.d.ts.map +1 -1
- package/resources/tasks.js +5 -12
- package/resources/tasks.js.map +1 -1
- package/resources/tasks.mjs +5 -12
- package/resources/tasks.mjs.map +1 -1
- package/src/client.ts +2 -2
- package/src/internal/detect-platform.ts +1 -1
- package/src/lib/bin/auth.ts +63 -0
- package/src/lib/bin/cli.ts +11 -0
- package/src/lib/bin/commands/listen.ts +172 -0
- package/src/lib/stream.ts +6 -3
- package/src/lib/webhooks.ts +118 -0
- package/src/resources/index.ts +0 -1
- package/src/resources/sessions/index.ts +0 -1
- package/src/resources/sessions/sessions.ts +2 -16
- package/src/resources/tasks.ts +108 -73
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/tasks.ts
CHANGED
|
@@ -226,25 +226,18 @@ export class Tasks extends APIResource {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
|
-
* Get a paginated list of all
|
|
229
|
+
* Get a paginated list of all Browser Use Agent tasks for the authenticated user.
|
|
230
230
|
*
|
|
231
|
-
*
|
|
232
|
-
* session. Each task represents a specific instruction or goal that the agent
|
|
231
|
+
* Browser Use Agent tasks are the individual jobs that your agents perform within
|
|
232
|
+
* a session. Each task represents a specific instruction or goal that the agent
|
|
233
233
|
* works on, such as filling out a form, extracting data, or navigating to specific
|
|
234
234
|
* pages.
|
|
235
235
|
*
|
|
236
|
-
* You can control what data is included for each task:
|
|
237
|
-
*
|
|
238
|
-
* - Task steps: Detailed actions the agent took
|
|
239
|
-
* - User uploaded files: Files you provided for the task
|
|
240
|
-
* - Output files: Files generated by the agent during the task
|
|
241
|
-
*
|
|
242
236
|
* Returns:
|
|
243
237
|
*
|
|
244
|
-
* - A paginated list of
|
|
245
|
-
* - Total count of tasks
|
|
238
|
+
* - A paginated list of Browser Use Agent tasks
|
|
239
|
+
* - Total count of Browser Use Agent tasks
|
|
246
240
|
* - Page information for navigation
|
|
247
|
-
* - Optional detailed data based on your parameters
|
|
248
241
|
*/
|
|
249
242
|
list(
|
|
250
243
|
query: TaskListParams | null | undefined = {},
|
|
@@ -390,18 +383,18 @@ export type LlmModel =
|
|
|
390
383
|
* View model for representing a task with its execution details
|
|
391
384
|
*
|
|
392
385
|
* Attributes: id: Unique identifier for the task session_id: ID of the session
|
|
393
|
-
* this task belongs to
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* timestamp when the task
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
386
|
+
* this task belongs to llm: The LLM model used for this task task: The task
|
|
387
|
+
* prompt/instruction given to the agent status: Current status of the task
|
|
388
|
+
* execution started_at: Naive UTC timestamp when the task was started finished_at:
|
|
389
|
+
* Naive UTC timestamp when the task completed (None if still running) metadata:
|
|
390
|
+
* Optional additional metadata associated with the task set by the user
|
|
391
|
+
* is_scheduled: Whether this task was created as a scheduled task steps: Optional
|
|
392
|
+
* list of execution steps done_output: Final output/result of the task
|
|
393
|
+
* user_uploaded_files: Optional list of files uploaded by user for this task
|
|
394
|
+
* output_files: Optional list of files generated as output by this task
|
|
395
|
+
* browser_use_version: Version of browser-use used for this task (older tasks may
|
|
396
|
+
* not have this set) is_success: Whether the task was successful (self-reported by
|
|
397
|
+
* the agent)
|
|
405
398
|
*/
|
|
406
399
|
export interface TaskItemView {
|
|
407
400
|
id: string;
|
|
@@ -417,9 +410,10 @@ export interface TaskItemView {
|
|
|
417
410
|
/**
|
|
418
411
|
* Enumeration of possible task execution states
|
|
419
412
|
*
|
|
420
|
-
* Attributes: STARTED: Task has been started and is currently running PAUSED:
|
|
421
|
-
* execution has been temporarily paused (can be resumed)
|
|
422
|
-
*
|
|
413
|
+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
|
|
414
|
+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
|
|
415
|
+
* finished and the agent has completed the task. STOPPED: Task execution has been
|
|
416
|
+
* manually stopped (cannot be resumed).
|
|
423
417
|
*/
|
|
424
418
|
status: TaskStatus;
|
|
425
419
|
|
|
@@ -434,24 +428,17 @@ export interface TaskItemView {
|
|
|
434
428
|
isSuccess?: boolean | null;
|
|
435
429
|
|
|
436
430
|
metadata?: { [key: string]: unknown };
|
|
437
|
-
|
|
438
|
-
outputFiles?: Array<FileView> | null;
|
|
439
|
-
|
|
440
|
-
sessionLiveUrl?: string | null;
|
|
441
|
-
|
|
442
|
-
steps?: Array<TaskStepView> | null;
|
|
443
|
-
|
|
444
|
-
userUploadedFiles?: Array<FileView> | null;
|
|
445
431
|
}
|
|
446
432
|
|
|
447
433
|
/**
|
|
448
434
|
* Enumeration of possible task execution states
|
|
449
435
|
*
|
|
450
|
-
* Attributes: STARTED: Task has been started and is currently running PAUSED:
|
|
451
|
-
* execution has been temporarily paused (can be resumed)
|
|
452
|
-
*
|
|
436
|
+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
|
|
437
|
+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
|
|
438
|
+
* finished and the agent has completed the task. STOPPED: Task execution has been
|
|
439
|
+
* manually stopped (cannot be resumed).
|
|
453
440
|
*/
|
|
454
|
-
export type TaskStatus = 'started' | 'paused' | '
|
|
441
|
+
export type TaskStatus = 'started' | 'paused' | 'finished' | 'stopped';
|
|
455
442
|
|
|
456
443
|
/**
|
|
457
444
|
* View model for representing a single step in a task's execution
|
|
@@ -483,11 +470,11 @@ export interface TaskStepView {
|
|
|
483
470
|
* View model for representing a task with its execution details
|
|
484
471
|
*
|
|
485
472
|
* Attributes: id: Unique identifier for the task session_id: ID of the session
|
|
486
|
-
* this task belongs to
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
473
|
+
* this task belongs to session: The session this task belongs to llm: The LLM
|
|
474
|
+
* model used for this task task: The task prompt/instruction given to the agent
|
|
475
|
+
* status: Current status of the task execution started_at: Naive UTC timestamp
|
|
476
|
+
* when the task was started finished_at: Naive UTC timestamp when the task
|
|
477
|
+
* completed (None if still running) metadata: Optional additional metadata
|
|
491
478
|
* associated with the task set by the user is_scheduled: Whether this task was
|
|
492
479
|
* created as a scheduled task steps: List of execution steps done_output: Final
|
|
493
480
|
* output/result of the task user_uploaded_files: List of files uploaded by user
|
|
@@ -505,6 +492,16 @@ export interface TaskView {
|
|
|
505
492
|
|
|
506
493
|
outputFiles: Array<FileView>;
|
|
507
494
|
|
|
495
|
+
/**
|
|
496
|
+
* View model for representing a session that a task belongs to
|
|
497
|
+
*
|
|
498
|
+
* Attributes: id: Unique identifier for the session status: Current status of the
|
|
499
|
+
* session (active/stopped) live_url: URL where the browser can be viewed live in
|
|
500
|
+
* real-time. started_at: Timestamp when the session was created and started.
|
|
501
|
+
* finished_at: Timestamp when the session was stopped (None if still active).
|
|
502
|
+
*/
|
|
503
|
+
session: TaskView.Session;
|
|
504
|
+
|
|
508
505
|
sessionId: string;
|
|
509
506
|
|
|
510
507
|
startedAt: string;
|
|
@@ -512,9 +509,10 @@ export interface TaskView {
|
|
|
512
509
|
/**
|
|
513
510
|
* Enumeration of possible task execution states
|
|
514
511
|
*
|
|
515
|
-
* Attributes: STARTED: Task has been started and is currently running PAUSED:
|
|
516
|
-
* execution has been temporarily paused (can be resumed)
|
|
517
|
-
*
|
|
512
|
+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
|
|
513
|
+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
|
|
514
|
+
* finished and the agent has completed the task. STOPPED: Task execution has been
|
|
515
|
+
* manually stopped (cannot be resumed).
|
|
518
516
|
*/
|
|
519
517
|
status: TaskStatus;
|
|
520
518
|
|
|
@@ -533,8 +531,34 @@ export interface TaskView {
|
|
|
533
531
|
isSuccess?: boolean | null;
|
|
534
532
|
|
|
535
533
|
metadata?: { [key: string]: unknown };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export namespace TaskView {
|
|
537
|
+
/**
|
|
538
|
+
* View model for representing a session that a task belongs to
|
|
539
|
+
*
|
|
540
|
+
* Attributes: id: Unique identifier for the session status: Current status of the
|
|
541
|
+
* session (active/stopped) live_url: URL where the browser can be viewed live in
|
|
542
|
+
* real-time. started_at: Timestamp when the session was created and started.
|
|
543
|
+
* finished_at: Timestamp when the session was stopped (None if still active).
|
|
544
|
+
*/
|
|
545
|
+
export interface Session {
|
|
546
|
+
id: string;
|
|
547
|
+
|
|
548
|
+
startedAt: string;
|
|
536
549
|
|
|
537
|
-
|
|
550
|
+
/**
|
|
551
|
+
* Enumeration of possible (browser) session states
|
|
552
|
+
*
|
|
553
|
+
* Attributes: ACTIVE: Session is currently active and running (browser is running)
|
|
554
|
+
* STOPPED: Session has been stopped and is no longer active (browser is stopped)
|
|
555
|
+
*/
|
|
556
|
+
status: 'active' | 'stopped';
|
|
557
|
+
|
|
558
|
+
finishedAt?: string | null;
|
|
559
|
+
|
|
560
|
+
liveUrl?: string | null;
|
|
561
|
+
}
|
|
538
562
|
}
|
|
539
563
|
|
|
540
564
|
/**
|
|
@@ -576,29 +600,40 @@ export interface TaskGetLogsResponse {
|
|
|
576
600
|
/**
|
|
577
601
|
* Response model for output file requests
|
|
578
602
|
*
|
|
579
|
-
* Attributes:
|
|
603
|
+
* Attributes: id: Unique identifier for the output file file_name: Name of the
|
|
604
|
+
* output file download_url: URL to download the output file
|
|
580
605
|
*/
|
|
581
606
|
export interface TaskGetOutputFileResponse {
|
|
607
|
+
id: string;
|
|
608
|
+
|
|
582
609
|
downloadUrl: string;
|
|
610
|
+
|
|
611
|
+
fileName: string;
|
|
583
612
|
}
|
|
584
613
|
|
|
585
614
|
/**
|
|
586
615
|
* Response model for user uploaded file requests
|
|
587
616
|
*
|
|
588
|
-
* Attributes:
|
|
617
|
+
* Attributes: id: Unique identifier for the user uploaded file file_name: Name of
|
|
618
|
+
* the user uploaded file download_url: URL to download the user uploaded file
|
|
589
619
|
*/
|
|
590
620
|
export interface TaskGetUserUploadedFileResponse {
|
|
621
|
+
id: string;
|
|
622
|
+
|
|
591
623
|
downloadUrl: string;
|
|
624
|
+
|
|
625
|
+
fileName: string;
|
|
592
626
|
}
|
|
593
627
|
|
|
594
628
|
export interface TaskCreateParams {
|
|
595
629
|
task: string;
|
|
596
630
|
|
|
597
631
|
/**
|
|
598
|
-
* Configuration settings for the
|
|
632
|
+
* Configuration settings for the agent
|
|
599
633
|
*
|
|
600
|
-
* Attributes: llm: The LLM model to use for the agent
|
|
601
|
-
*
|
|
634
|
+
* Attributes: llm: The LLM model to use for the agent start_url: Optional URL to
|
|
635
|
+
* start the agent on (will not be changed as a step) profile_id: Unique identifier
|
|
636
|
+
* of the agent profile to use for the task
|
|
602
637
|
*/
|
|
603
638
|
agentSettings?: TaskCreateParams.AgentSettings;
|
|
604
639
|
|
|
@@ -606,8 +641,8 @@ export interface TaskCreateParams {
|
|
|
606
641
|
* Configuration settings for the browser session
|
|
607
642
|
*
|
|
608
643
|
* Attributes: session_id: Unique identifier of existing session to continue
|
|
609
|
-
* profile_id: Unique identifier of browser profile to use
|
|
610
|
-
*
|
|
644
|
+
* profile_id: Unique identifier of browser profile to use (use if you want to
|
|
645
|
+
* start a new session)
|
|
611
646
|
*/
|
|
612
647
|
browserSettings?: TaskCreateParams.BrowserSettings;
|
|
613
648
|
|
|
@@ -622,29 +657,30 @@ export interface TaskCreateParams {
|
|
|
622
657
|
|
|
623
658
|
export namespace TaskCreateParams {
|
|
624
659
|
/**
|
|
625
|
-
* Configuration settings for the
|
|
660
|
+
* Configuration settings for the agent
|
|
626
661
|
*
|
|
627
|
-
* Attributes: llm: The LLM model to use for the agent
|
|
628
|
-
*
|
|
662
|
+
* Attributes: llm: The LLM model to use for the agent start_url: Optional URL to
|
|
663
|
+
* start the agent on (will not be changed as a step) profile_id: Unique identifier
|
|
664
|
+
* of the agent profile to use for the task
|
|
629
665
|
*/
|
|
630
666
|
export interface AgentSettings {
|
|
631
667
|
llm?: TasksAPI.LlmModel;
|
|
632
668
|
|
|
633
669
|
profileId?: string | null;
|
|
670
|
+
|
|
671
|
+
startUrl?: string | null;
|
|
634
672
|
}
|
|
635
673
|
|
|
636
674
|
/**
|
|
637
675
|
* Configuration settings for the browser session
|
|
638
676
|
*
|
|
639
677
|
* Attributes: session_id: Unique identifier of existing session to continue
|
|
640
|
-
* profile_id: Unique identifier of browser profile to use
|
|
641
|
-
*
|
|
678
|
+
* profile_id: Unique identifier of browser profile to use (use if you want to
|
|
679
|
+
* start a new session)
|
|
642
680
|
*/
|
|
643
681
|
export interface BrowserSettings {
|
|
644
682
|
profileId?: string | null;
|
|
645
683
|
|
|
646
|
-
saveBrowserData?: boolean;
|
|
647
|
-
|
|
648
684
|
sessionId?: string | null;
|
|
649
685
|
}
|
|
650
686
|
}
|
|
@@ -661,20 +697,19 @@ export interface TaskUpdateParams {
|
|
|
661
697
|
}
|
|
662
698
|
|
|
663
699
|
export interface TaskListParams {
|
|
700
|
+
after?: string | null;
|
|
701
|
+
|
|
702
|
+
before?: string | null;
|
|
703
|
+
|
|
664
704
|
/**
|
|
665
|
-
* Enumeration of possible task
|
|
705
|
+
* Enumeration of possible task execution states
|
|
666
706
|
*
|
|
667
|
-
* Attributes: STARTED:
|
|
668
|
-
*
|
|
669
|
-
*
|
|
707
|
+
* Attributes: STARTED: Task has been started and is currently running. PAUSED:
|
|
708
|
+
* Task execution has been temporarily paused (can be resumed) FINISHED: Task has
|
|
709
|
+
* finished and the agent has completed the task. STOPPED: Task execution has been
|
|
710
|
+
* manually stopped (cannot be resumed).
|
|
670
711
|
*/
|
|
671
|
-
filterBy?:
|
|
672
|
-
|
|
673
|
-
includeOutputFiles?: boolean;
|
|
674
|
-
|
|
675
|
-
includeSteps?: boolean;
|
|
676
|
-
|
|
677
|
-
includeUserUploadedFiles?: boolean;
|
|
712
|
+
filterBy?: TaskStatus | null;
|
|
678
713
|
|
|
679
714
|
pageNumber?: number;
|
|
680
715
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.5.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.5.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|