@@ -2,7 +2,7 @@ import type { ZodType } from "zod";
22
33import * as BrowserUse from "../../api/index.js" ;
44import * as core from "../../core/index.js" ;
5- import { TasksClient } from "../../api/resources/tasks/client/Client.js" ;
5+ import { Tasks } from "../../api/resources/tasks/client/Client.js" ;
66import {
77 type CreateTaskRequestWithSchema ,
88 type WrappedTaskFnsWithSchema ,
@@ -13,22 +13,22 @@ import {
1313 parseStructuredTaskOutput ,
1414} from "../lib/parse.js" ;
1515
16- export class BrowserUseTasks extends TasksClient {
17- constructor ( options : TasksClient . Options ) {
16+ export class BrowserUseTasks extends Tasks {
17+ constructor ( options : Tasks . Options ) {
1818 super ( options ) ;
1919 }
2020
2121 public createTask < T extends ZodType > (
2222 request : CreateTaskRequestWithSchema < T > ,
23- requestOptions ?: TasksClient . RequestOptions ,
23+ requestOptions ?: Tasks . RequestOptions ,
2424 ) : core . HttpResponsePromise < WrappedTaskFnsWithSchema < T > > ;
2525 public createTask (
2626 request : BrowserUse . CreateTaskRequest ,
27- requestOptions ?: TasksClient . RequestOptions ,
27+ requestOptions ?: Tasks . RequestOptions ,
2828 ) : core . HttpResponsePromise < WrappedTaskFnsWithoutSchema > ;
2929 public createTask (
3030 request : BrowserUse . CreateTaskRequest | CreateTaskRequestWithSchema < ZodType > ,
31- requestOptions ?: TasksClient . RequestOptions ,
31+ requestOptions ?: Tasks . RequestOptions ,
3232 ) :
3333 | core . HttpResponsePromise < WrappedTaskFnsWithSchema < ZodType > >
3434 | core . HttpResponsePromise < WrappedTaskFnsWithoutSchema > {
@@ -41,7 +41,7 @@ export class BrowserUseTasks extends TasksClient {
4141 const promise : Promise < core . WithRawResponse < WrappedTaskFnsWithSchema < ZodType > > > = super
4242 . createTask ( req , requestOptions )
4343 . withRawResponse ( )
44- . then ( ( res ) => {
44+ . then ( ( res : core . WithRawResponse < BrowserUse . TaskCreatedResponse > ) => {
4545 const wrapped = wrapCreateTaskResponse ( this , res . data , request . schema ) ;
4646
4747 return {
@@ -56,7 +56,7 @@ export class BrowserUseTasks extends TasksClient {
5656 const promise : Promise < core . WithRawResponse < WrappedTaskFnsWithoutSchema > > = super
5757 . createTask ( request , requestOptions )
5858 . withRawResponse ( )
59- . then ( ( res ) => {
59+ . then ( ( res : core . WithRawResponse < BrowserUse . TaskCreatedResponse > ) => {
6060 const wrapped = wrapCreateTaskResponse ( this , res . data , null ) ;
6161
6262 return {
@@ -70,15 +70,15 @@ export class BrowserUseTasks extends TasksClient {
7070
7171 public getTask < T extends ZodType > (
7272 request : { task_id : string ; schema : T } ,
73- requestOptions ?: TasksClient . RequestOptions ,
73+ requestOptions ?: Tasks . RequestOptions ,
7474 ) : core . HttpResponsePromise < TaskViewWithSchema < T > > ;
7575 public getTask (
7676 request : BrowserUse . GetTaskTasksTaskIdGetRequest ,
77- requestOptions ?: TasksClient . RequestOptions ,
77+ requestOptions ?: Tasks . RequestOptions ,
7878 ) : core . HttpResponsePromise < BrowserUse . TaskView > ;
7979 public getTask (
8080 request : { task_id : string ; schema ?: ZodType } ,
81- requestOptions ?: TasksClient . RequestOptions ,
81+ requestOptions ?: Tasks . RequestOptions ,
8282 ) : core . HttpResponsePromise < BrowserUse . TaskView | TaskViewWithSchema < ZodType > > {
8383 if ( ! request . schema ) {
8484 return super . getTask ( request , requestOptions ) ;
@@ -89,7 +89,7 @@ export class BrowserUseTasks extends TasksClient {
8989 const promise : Promise < core . WithRawResponse < TaskViewWithSchema < ZodType > > > = super
9090 . getTask ( { task_id } , requestOptions )
9191 . withRawResponse ( )
92- . then ( ( res ) => {
92+ . then ( ( res : core . WithRawResponse < BrowserUse . TaskView > ) => {
9393 const parsed = parseStructuredTaskOutput ( res . data , schema ) ;
9494
9595 return {
0 commit comments