Skip to content

Commit cfda83f

Browse files
authored
Merge pull request #13 from browser-use/release-please--branches--main--changes--next--components--browser-use-sdk
release: 0.5.0
2 parents 31f8b87 + 583af62 commit cfda83f

File tree

8 files changed

+86
-55
lines changed

8 files changed

+86
-55
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.4.0"
2+
".": "0.5.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-758a1c052b93e7e478fa650c1748f4b466653f44cb26f97fef1314c7a96924df.yml
3-
openapi_spec_hash: 9e0e99b613f2b9bf3993ac36aa0c7911
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-3a9488448292a0736b08b2d6427e702eaf7106d86345ca2e65b64bed4398b036.yml
3+
openapi_spec_hash: 5ff2781dcc11a0c9aa353f5cb14bcc16
44
config_hash: 9d52be5177b2ede4cb0633c04f4cc4ef

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.5.0 (2025-08-18)
4+
5+
Full Changelog: [v0.4.0...v0.5.0](https://github.com/browser-use/browser-use-node/compare/v0.4.0...v0.5.0)
6+
7+
### Features
8+
9+
* Add start_url ([10e4187](https://github.com/browser-use/browser-use-node/commit/10e4187e952398bb1bd7f1607a0450cca0e25b0f))
10+
* Align Task Filtering by Status with `status` Field ([1ea0943](https://github.com/browser-use/browser-use-node/commit/1ea0943b3cbca9fb9f40e36c33094756c979ac54))
11+
312
## 0.4.0 (2025-08-17)
413

514
Full Changelog: [v0.3.0...v0.4.0](https://github.com/browser-use/browser-use-node/compare/v0.3.0...v0.4.0)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser-use-sdk",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "The official TypeScript library for the Browser Use API",
55
"author": "Browser Use <[email protected]>",
66
"types": "dist/index.d.ts",

src/lib/bin/commands/listen.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Command } from 'commander';
22

3-
import { BrowserUse } from '../../../';
3+
import { APIUserAbortError, BrowserUse } from '../../../';
44
import { createWebhookSignature, Webhook } from '../../webhooks';
55
import { createBrowserUseClient, getBrowserUseWebhookSecret } from '../auth';
66

@@ -34,6 +34,7 @@ export const listen = new Command('listen')
3434

3535
//
3636

37+
const startTimeDate = new Date();
3738
const queue: { current: Webhook[] } = { current: [] };
3839
const runs: Map<string, BrowserUse.TaskStatus> = new Map();
3940

@@ -51,13 +52,26 @@ export const listen = new Command('listen')
5152

5253
const tasks: BrowserUse.Tasks.TaskItemView[] = await client.tasks
5354
.list(
54-
{ pageSize: 10 },
55+
{
56+
pageSize: 10,
57+
// NOTE: There's a bug in the API where the datetime needs to be provided in naive format.cur
58+
after: startTimeDate.toISOString().replace('Z', ''),
59+
},
5560
{
5661
signal: tickRef.abort.signal,
5762
},
5863
)
5964
.then((res) => res.items)
60-
.catch((_) => []);
65+
.catch((err) => {
66+
if (err instanceof APIUserAbortError) {
67+
return [];
68+
}
69+
70+
console.log(`[polling] ${new Date().toISOString()} failed`);
71+
console.error(err);
72+
73+
return [];
74+
});
6175

6276
for (const task of tasks) {
6377
const currentTaskStatus = runs.get(task.id);

src/resources/tasks.ts

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,18 @@ export class Tasks extends APIResource {
226226
}
227227

228228
/**
229-
* Get a paginated list of all AI agent tasks for the authenticated user.
229+
* Get a paginated list of all Browser Use Agent tasks for the authenticated user.
230230
*
231-
* AI agent tasks are the individual jobs that your agents perform within a
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
233233
* works on, such as filling out a form, extracting data, or navigating to specific
234234
* pages.
235235
*
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-
*
242236
* Returns:
243237
*
244-
* - A paginated list of agent tasks
245-
* - Total count of tasks
238+
* - A paginated list of Browser Use Agent tasks
239+
* - Total count of Browser Use Agent tasks
246240
* - Page information for navigation
247-
* - Optional detailed data based on your parameters
248241
*/
249242
list(
250243
query: TaskListParams | null | undefined = {},
@@ -417,9 +410,10 @@ export interface TaskItemView {
417410
/**
418411
* Enumeration of possible task execution states
419412
*
420-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
421-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
422-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
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).
423417
*/
424418
status: TaskStatus;
425419

@@ -439,11 +433,12 @@ export interface TaskItemView {
439433
/**
440434
* Enumeration of possible task execution states
441435
*
442-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
443-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
444-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
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).
445440
*/
446-
export type TaskStatus = 'started' | 'paused' | 'stopped' | 'finished';
441+
export type TaskStatus = 'started' | 'paused' | 'finished' | 'stopped';
447442

448443
/**
449444
* View model for representing a single step in a task's execution
@@ -501,9 +496,9 @@ export interface TaskView {
501496
* View model for representing a session that a task belongs to
502497
*
503498
* Attributes: id: Unique identifier for the session status: Current status of the
504-
* session live_url: URL where the browser can be viewed live in real-time.
505-
* started_at: Timestamp when the session was created and started. finished_at:
506-
* Timestamp when the session was stopped (None if still active).
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).
507502
*/
508503
session: TaskView.Session;
509504

@@ -514,9 +509,10 @@ export interface TaskView {
514509
/**
515510
* Enumeration of possible task execution states
516511
*
517-
* Attributes: STARTED: Task has been started and is currently running PAUSED: Task
518-
* execution has been temporarily paused (can be resumed) STOPPED: Task execution
519-
* has been stopped (cannot be resumed) FINISHED: Task has completed successfully
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).
520516
*/
521517
status: TaskStatus;
522518

@@ -542,9 +538,9 @@ export namespace TaskView {
542538
* View model for representing a session that a task belongs to
543539
*
544540
* Attributes: id: Unique identifier for the session status: Current status of the
545-
* session live_url: URL where the browser can be viewed live in real-time.
546-
* started_at: Timestamp when the session was created and started. finished_at:
547-
* Timestamp when the session was stopped (None if still active).
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).
548544
*/
549545
export interface Session {
550546
id: string;
@@ -633,19 +629,20 @@ export interface TaskCreateParams {
633629
task: string;
634630

635631
/**
636-
* Configuration settings for the AI agent
632+
* Configuration settings for the agent
637633
*
638-
* Attributes: llm: The LLM model to use for the agent profile_id: Unique
639-
* identifier of the agent profile to use for the task
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
640637
*/
641638
agentSettings?: TaskCreateParams.AgentSettings;
642639

643640
/**
644641
* Configuration settings for the browser session
645642
*
646643
* Attributes: session_id: Unique identifier of existing session to continue
647-
* profile_id: Unique identifier of browser profile to use save_browser_data:
648-
* Whether to save browser state/data for the user to download later
644+
* profile_id: Unique identifier of browser profile to use (use if you want to
645+
* start a new session)
649646
*/
650647
browserSettings?: TaskCreateParams.BrowserSettings;
651648

@@ -660,29 +657,30 @@ export interface TaskCreateParams {
660657

661658
export namespace TaskCreateParams {
662659
/**
663-
* Configuration settings for the AI agent
660+
* Configuration settings for the agent
664661
*
665-
* Attributes: llm: The LLM model to use for the agent profile_id: Unique
666-
* identifier of the agent profile to use for the task
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
667665
*/
668666
export interface AgentSettings {
669667
llm?: TasksAPI.LlmModel;
670668

671669
profileId?: string | null;
670+
671+
startUrl?: string | null;
672672
}
673673

674674
/**
675675
* Configuration settings for the browser session
676676
*
677677
* Attributes: session_id: Unique identifier of existing session to continue
678-
* profile_id: Unique identifier of browser profile to use save_browser_data:
679-
* Whether to save browser state/data for the user to download later
678+
* profile_id: Unique identifier of browser profile to use (use if you want to
679+
* start a new session)
680680
*/
681681
export interface BrowserSettings {
682682
profileId?: string | null;
683683

684-
saveBrowserData?: boolean;
685-
686684
sessionId?: string | null;
687685
}
688686
}
@@ -699,14 +697,19 @@ export interface TaskUpdateParams {
699697
}
700698

701699
export interface TaskListParams {
700+
after?: string | null;
701+
702+
before?: string | null;
703+
702704
/**
703-
* Enumeration of possible task filters
705+
* Enumeration of possible task execution states
704706
*
705-
* Attributes: STARTED: All started tasks PAUSED: All paused tasks STOPPED: All
706-
* stopped tasks FINISHED: All finished tasks SUCCESSFUL: All successful tasks
707-
* UNSUCCESSFUL: All unsuccessful tasks
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).
708711
*/
709-
filterBy?: 'started' | 'paused' | 'stopped' | 'finished' | 'successful' | 'unsuccessful' | null;
712+
filterBy?: TaskStatus | null;
710713

711714
pageNumber?: number;
712715

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.4.0'; // x-release-please-version
1+
export const VERSION = '0.5.0'; // x-release-please-version

tests/api-resources/tasks.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ describe('resource tasks', () => {
2424
test.skip('create: required and optional params', async () => {
2525
const response = await client.tasks.create({
2626
task: 'x',
27-
agentSettings: { llm: 'gpt-4o', profileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
27+
agentSettings: {
28+
llm: 'gpt-4o',
29+
profileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
30+
startUrl: 'startUrl',
31+
},
2832
browserSettings: {
2933
profileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
30-
saveBrowserData: true,
3134
sessionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
3235
},
3336
includedFileNames: ['string'],
@@ -84,6 +87,8 @@ describe('resource tasks', () => {
8487
await expect(
8588
client.tasks.list(
8689
{
90+
after: '2019-12-27T18:11:19.117Z',
91+
before: '2019-12-27T18:11:19.117Z',
8792
filterBy: 'started',
8893
pageNumber: 1,
8994
pageSize: 1,

0 commit comments

Comments
 (0)