anchorbrowser 1.0.0-dev.0 → 1.0.0-dev.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/CHANGELOG.md +8 -0
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +3 -3
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- 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 +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/tasks/generations.d.mts +42 -0
- package/resources/tasks/generations.d.mts.map +1 -0
- package/resources/tasks/generations.d.ts +42 -0
- package/resources/tasks/generations.d.ts.map +1 -0
- package/resources/tasks/generations.js +24 -0
- package/resources/tasks/generations.js.map +1 -0
- package/resources/tasks/generations.mjs +20 -0
- package/resources/tasks/generations.mjs.map +1 -0
- package/resources/tasks/index.d.mts +4 -0
- package/resources/tasks/index.d.mts.map +1 -0
- package/resources/tasks/index.d.ts +4 -0
- package/resources/tasks/index.d.ts.map +1 -0
- package/resources/tasks/index.js +11 -0
- package/resources/tasks/index.js.map +1 -0
- package/resources/tasks/index.mjs +5 -0
- package/resources/tasks/index.mjs.map +1 -0
- package/resources/tasks/runs.d.mts +42 -0
- package/resources/tasks/runs.d.mts.map +1 -0
- package/resources/tasks/runs.d.ts +42 -0
- package/resources/tasks/runs.d.ts.map +1 -0
- package/resources/tasks/runs.js +21 -0
- package/resources/tasks/runs.js.map +1 -0
- package/resources/tasks/runs.mjs +17 -0
- package/resources/tasks/runs.mjs.map +1 -0
- package/resources/tasks/tasks.d.mts +310 -0
- package/resources/tasks/tasks.d.mts.map +1 -0
- package/resources/tasks/tasks.d.ts +310 -0
- package/resources/tasks/tasks.d.ts.map +1 -0
- package/resources/tasks/tasks.js +80 -0
- package/resources/tasks/tasks.js.map +1 -0
- package/resources/tasks/tasks.mjs +75 -0
- package/resources/tasks/tasks.mjs.map +1 -0
- package/resources/tasks.d.mts +2 -0
- package/resources/tasks.d.mts.map +1 -0
- package/resources/tasks.d.ts +2 -0
- package/resources/tasks.d.ts.map +1 -0
- package/resources/tasks.js +6 -0
- package/resources/tasks.js.map +1 -0
- package/resources/tasks.mjs +3 -0
- package/resources/tasks.mjs.map +1 -0
- package/src/client.ts +16 -4
- package/src/resources/index.ts +7 -1
- package/src/resources/tasks/generations.ts +52 -0
- package/src/resources/tasks/index.ts +11 -0
- package/src/resources/tasks/runs.ts +51 -0
- package/src/resources/tasks/tasks.ts +518 -0
- package/src/resources/tasks.ts +3 -0
- 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/resources/task.d.mts +0 -4
- package/resources/task.d.mts.map +0 -1
- package/resources/task.d.ts +0 -4
- package/resources/task.d.ts.map +0 -1
- package/resources/task.js +0 -9
- package/resources/task.js.map +0 -1
- package/resources/task.mjs +0 -5
- package/resources/task.mjs.map +0 -1
- package/src/resources/task.ts +0 -5
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as GenerationsAPI from "./generations.js";
|
|
3
|
+
import { GenerationGetStatusResponse, Generations } from "./generations.js";
|
|
4
|
+
import * as RunsAPI from "./runs.js";
|
|
5
|
+
import { RunGetStatusResponse, Runs } from "./runs.js";
|
|
6
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
7
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
8
|
+
export declare class Tasks extends APIResource {
|
|
9
|
+
runs: RunsAPI.Runs;
|
|
10
|
+
generations: GenerationsAPI.Generations;
|
|
11
|
+
/**
|
|
12
|
+
* Initiates asynchronous task generation. Use the returned task ID to poll for
|
|
13
|
+
* completion, then execute the task.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response = await client.tasks.generate({
|
|
18
|
+
* description: 'Download a specific file from a URL',
|
|
19
|
+
* name: 'file-downloader',
|
|
20
|
+
* user_task: 'Create a task that downloads a specific file from a given URL.',
|
|
21
|
+
* input_schema: [
|
|
22
|
+
* {
|
|
23
|
+
* display_name: 'URL',
|
|
24
|
+
* type: 'string',
|
|
25
|
+
* required: true,
|
|
26
|
+
* description: 'URL of the file to download',
|
|
27
|
+
* },
|
|
28
|
+
* {
|
|
29
|
+
* display_name: 'File Name',
|
|
30
|
+
* type: 'string',
|
|
31
|
+
* required: true,
|
|
32
|
+
* description: 'Name of the file to download',
|
|
33
|
+
* },
|
|
34
|
+
* ],
|
|
35
|
+
* output_schema: [
|
|
36
|
+
* {
|
|
37
|
+
* display_name: 'Success',
|
|
38
|
+
* type: 'boolean',
|
|
39
|
+
* description: 'Whether the download succeeded',
|
|
40
|
+
* },
|
|
41
|
+
* {
|
|
42
|
+
* display_name: 'Message',
|
|
43
|
+
* type: 'string',
|
|
44
|
+
* description: 'Status or error message',
|
|
45
|
+
* },
|
|
46
|
+
* ],
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
generate(body: TaskGenerateParams, options?: RequestOptions): APIPromise<TaskGenerateResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Triggers execution of a task by ID using the V2 tasks API.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const response = await client.tasks.run('taskId', {
|
|
57
|
+
* input_params: {
|
|
58
|
+
* 'File Name': 'invoice-2026-02.pdf',
|
|
59
|
+
* Operation: 'extract_text',
|
|
60
|
+
* },
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
run(taskID: string, body: TaskRunParams, options?: RequestOptions): APIPromise<TaskRunResponse>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Response when task generation has been started (generation is asynchronous).
|
|
68
|
+
*/
|
|
69
|
+
export interface TaskGenerateResponse {
|
|
70
|
+
/**
|
|
71
|
+
* The ID of the created task (use with generation-status and run endpoints)
|
|
72
|
+
*/
|
|
73
|
+
id: string;
|
|
74
|
+
/**
|
|
75
|
+
* Whether the task is still generating, ready to run, or failed.
|
|
76
|
+
*/
|
|
77
|
+
status: 'generating';
|
|
78
|
+
}
|
|
79
|
+
export interface TaskRunResponse {
|
|
80
|
+
/**
|
|
81
|
+
* The ID of the task run
|
|
82
|
+
*/
|
|
83
|
+
run_id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Current task run status
|
|
86
|
+
*/
|
|
87
|
+
status: 'queued' | 'running' | 'success' | 'failure' | 'timeout' | 'cancelled';
|
|
88
|
+
/**
|
|
89
|
+
* Error message when the run fails
|
|
90
|
+
*/
|
|
91
|
+
error?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Task output when available
|
|
94
|
+
*/
|
|
95
|
+
result?: {
|
|
96
|
+
[key: string]: unknown;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Session ID used for this task run
|
|
100
|
+
*/
|
|
101
|
+
session_id?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface TaskGenerateParams {
|
|
104
|
+
/**
|
|
105
|
+
* Description of the task
|
|
106
|
+
*/
|
|
107
|
+
description: string;
|
|
108
|
+
/**
|
|
109
|
+
* Name of the task
|
|
110
|
+
*/
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Natural language description of what the task should do (used for AI generation)
|
|
114
|
+
*/
|
|
115
|
+
user_task: string;
|
|
116
|
+
/**
|
|
117
|
+
* Optional application (connection) ID to associate with the task
|
|
118
|
+
*/
|
|
119
|
+
application_id?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Optional list of input parameters for the task. Defaults to empty array.
|
|
122
|
+
*/
|
|
123
|
+
input_schema?: Array<TaskGenerateParams.InputSchema>;
|
|
124
|
+
/**
|
|
125
|
+
* Optional list of output parameters for the task. Defaults to empty array.
|
|
126
|
+
*/
|
|
127
|
+
output_schema?: Array<TaskGenerateParams.OutputSchema>;
|
|
128
|
+
/**
|
|
129
|
+
* Optional default browser/session configuration when running this task
|
|
130
|
+
*/
|
|
131
|
+
task_browser_default_configuration?: TaskGenerateParams.TaskBrowserDefaultConfiguration;
|
|
132
|
+
}
|
|
133
|
+
export declare namespace TaskGenerateParams {
|
|
134
|
+
/**
|
|
135
|
+
* A single input or output parameter for a generated task.
|
|
136
|
+
*/
|
|
137
|
+
interface InputSchema {
|
|
138
|
+
/**
|
|
139
|
+
* Human-readable name for the parameter
|
|
140
|
+
*/
|
|
141
|
+
display_name: string;
|
|
142
|
+
/**
|
|
143
|
+
* Data type of the parameter
|
|
144
|
+
*/
|
|
145
|
+
type: 'string' | 'number' | 'boolean' | 'date';
|
|
146
|
+
/**
|
|
147
|
+
* Optional default value as a string
|
|
148
|
+
*/
|
|
149
|
+
default_value?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Optional description of the parameter
|
|
152
|
+
*/
|
|
153
|
+
description?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Whether the parameter is required
|
|
156
|
+
*/
|
|
157
|
+
required?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A single input or output parameter for a generated task.
|
|
161
|
+
*/
|
|
162
|
+
interface OutputSchema {
|
|
163
|
+
/**
|
|
164
|
+
* Human-readable name for the parameter
|
|
165
|
+
*/
|
|
166
|
+
display_name: string;
|
|
167
|
+
/**
|
|
168
|
+
* Data type of the parameter
|
|
169
|
+
*/
|
|
170
|
+
type: 'string' | 'number' | 'boolean' | 'date';
|
|
171
|
+
/**
|
|
172
|
+
* Optional default value as a string
|
|
173
|
+
*/
|
|
174
|
+
default_value?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Optional description of the parameter
|
|
177
|
+
*/
|
|
178
|
+
description?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Whether the parameter is required
|
|
181
|
+
*/
|
|
182
|
+
required?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Optional default browser/session configuration when running this task
|
|
186
|
+
*/
|
|
187
|
+
interface TaskBrowserDefaultConfiguration {
|
|
188
|
+
/**
|
|
189
|
+
* The URL to navigate to when the browser session starts. If not provided, the
|
|
190
|
+
* browser will load an empty page.
|
|
191
|
+
*/
|
|
192
|
+
initial_url?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Configuration for live viewing the browser session.
|
|
195
|
+
*/
|
|
196
|
+
live_view?: TaskBrowserDefaultConfiguration.LiveView;
|
|
197
|
+
/**
|
|
198
|
+
* Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
|
|
199
|
+
*/
|
|
200
|
+
proxy?: TaskBrowserDefaultConfiguration.AnchorProxy | TaskBrowserDefaultConfiguration.CustomProxy;
|
|
201
|
+
/**
|
|
202
|
+
* Configuration for session recording.
|
|
203
|
+
*/
|
|
204
|
+
recording?: TaskBrowserDefaultConfiguration.Recording;
|
|
205
|
+
/**
|
|
206
|
+
* Timeout configurations for the browser session.
|
|
207
|
+
*/
|
|
208
|
+
timeout?: TaskBrowserDefaultConfiguration.Timeout;
|
|
209
|
+
}
|
|
210
|
+
namespace TaskBrowserDefaultConfiguration {
|
|
211
|
+
/**
|
|
212
|
+
* Configuration for live viewing the browser session.
|
|
213
|
+
*/
|
|
214
|
+
interface LiveView {
|
|
215
|
+
/**
|
|
216
|
+
* Enable or disable read-only mode for live viewing. Defaults to `false`.
|
|
217
|
+
*/
|
|
218
|
+
read_only?: boolean;
|
|
219
|
+
}
|
|
220
|
+
interface AnchorProxy {
|
|
221
|
+
active: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* City name for precise geographic targeting. Supported for anchor_proxy only. Can
|
|
224
|
+
* only be used when region is also provided.
|
|
225
|
+
*/
|
|
226
|
+
city?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Supported country codes ISO 2 lowercase
|
|
229
|
+
*/
|
|
230
|
+
country_code?: 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye';
|
|
231
|
+
/**
|
|
232
|
+
* Region code for more specific geographic targeting. The city parameter can only
|
|
233
|
+
* be used when region is also provided.
|
|
234
|
+
*/
|
|
235
|
+
region?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Create a session with a proxy to access websites as if you're browsing from a
|
|
238
|
+
* computer in that country.
|
|
239
|
+
*/
|
|
240
|
+
type?: 'anchor_proxy';
|
|
241
|
+
}
|
|
242
|
+
interface CustomProxy {
|
|
243
|
+
active: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Proxy password
|
|
246
|
+
*/
|
|
247
|
+
password: string;
|
|
248
|
+
/**
|
|
249
|
+
* Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
|
|
250
|
+
* https://proxy.example.com:443). See [proxy page](/advanced/proxy#custom-proxy).
|
|
251
|
+
*/
|
|
252
|
+
server: string;
|
|
253
|
+
type: 'custom';
|
|
254
|
+
/**
|
|
255
|
+
* Proxy username
|
|
256
|
+
*/
|
|
257
|
+
username: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Configuration for session recording.
|
|
261
|
+
*/
|
|
262
|
+
interface Recording {
|
|
263
|
+
/**
|
|
264
|
+
* Enable or disable video recording of the browser session. Defaults to `true`.
|
|
265
|
+
*/
|
|
266
|
+
active?: boolean;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Timeout configurations for the browser session.
|
|
270
|
+
*/
|
|
271
|
+
interface Timeout {
|
|
272
|
+
/**
|
|
273
|
+
* The amount of time (in minutes) the browser session waits for new connections
|
|
274
|
+
* after all others are closed before stopping. Defaults to `5`.
|
|
275
|
+
*/
|
|
276
|
+
idle_timeout?: number;
|
|
277
|
+
/**
|
|
278
|
+
* Maximum amount of time (in minutes) for the browser to run before terminating.
|
|
279
|
+
* Defaults to `20`.
|
|
280
|
+
*/
|
|
281
|
+
max_duration?: number;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
export interface TaskRunParams {
|
|
286
|
+
/**
|
|
287
|
+
* Key-value pairs of input parameters for the task
|
|
288
|
+
*/
|
|
289
|
+
input_params: {
|
|
290
|
+
[key: string]: string;
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Whether to clean up sessions after execution
|
|
294
|
+
*/
|
|
295
|
+
cleanup_sessions?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Optional identity ID to use for the task
|
|
298
|
+
*/
|
|
299
|
+
identity_id?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Optional session ID to run the task in
|
|
302
|
+
*/
|
|
303
|
+
session_id?: string;
|
|
304
|
+
}
|
|
305
|
+
export declare namespace Tasks {
|
|
306
|
+
export { type TaskGenerateResponse as TaskGenerateResponse, type TaskRunResponse as TaskRunResponse, type TaskGenerateParams as TaskGenerateParams, type TaskRunParams as TaskRunParams, };
|
|
307
|
+
export { Runs as Runs, type RunGetStatusResponse as RunGetStatusResponse };
|
|
308
|
+
export { Generations as Generations, type GenerationGetStatusResponse as GenerationGetStatusResponse };
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/resources/tasks/tasks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,2BAA2B,EAAE,WAAW,EAAE;OAC5C,KAAK,OAAO;OACZ,EAAE,oBAAoB,EAAE,IAAI,EAAE;OAC9B,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IACpD,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI9F;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAA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AkB,EAC7C,KAAK,aAAa,IAAI,aAAa,GACpC,CAAC;IAEF,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;IAE3E,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,KAAK,2BAA2B,IAAI,2BAA2B,EAAE,CAAC;CACxG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Tasks = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const GenerationsAPI = tslib_1.__importStar(require("./generations.js"));
|
|
8
|
+
const generations_1 = require("./generations.js");
|
|
9
|
+
const RunsAPI = tslib_1.__importStar(require("./runs.js"));
|
|
10
|
+
const runs_1 = require("./runs.js");
|
|
11
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
12
|
+
class Tasks extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.runs = new RunsAPI.Runs(this._client);
|
|
16
|
+
this.generations = new GenerationsAPI.Generations(this._client);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Initiates asynchronous task generation. Use the returned task ID to poll for
|
|
20
|
+
* completion, then execute the task.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response = await client.tasks.generate({
|
|
25
|
+
* description: 'Download a specific file from a URL',
|
|
26
|
+
* name: 'file-downloader',
|
|
27
|
+
* user_task: 'Create a task that downloads a specific file from a given URL.',
|
|
28
|
+
* input_schema: [
|
|
29
|
+
* {
|
|
30
|
+
* display_name: 'URL',
|
|
31
|
+
* type: 'string',
|
|
32
|
+
* required: true,
|
|
33
|
+
* description: 'URL of the file to download',
|
|
34
|
+
* },
|
|
35
|
+
* {
|
|
36
|
+
* display_name: 'File Name',
|
|
37
|
+
* type: 'string',
|
|
38
|
+
* required: true,
|
|
39
|
+
* description: 'Name of the file to download',
|
|
40
|
+
* },
|
|
41
|
+
* ],
|
|
42
|
+
* output_schema: [
|
|
43
|
+
* {
|
|
44
|
+
* display_name: 'Success',
|
|
45
|
+
* type: 'boolean',
|
|
46
|
+
* description: 'Whether the download succeeded',
|
|
47
|
+
* },
|
|
48
|
+
* {
|
|
49
|
+
* display_name: 'Message',
|
|
50
|
+
* type: 'string',
|
|
51
|
+
* description: 'Status or error message',
|
|
52
|
+
* },
|
|
53
|
+
* ],
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
generate(body, options) {
|
|
58
|
+
return this._client.post('/v2/tasks/generate', { body, ...options });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Triggers execution of a task by ID using the V2 tasks API.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const response = await client.tasks.run('taskId', {
|
|
66
|
+
* input_params: {
|
|
67
|
+
* 'File Name': 'invoice-2026-02.pdf',
|
|
68
|
+
* Operation: 'extract_text',
|
|
69
|
+
* },
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
run(taskID, body, options) {
|
|
74
|
+
return this._client.post((0, path_1.path) `/v2/tasks/${taskID}/run`, { body, ...options });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.Tasks = Tasks;
|
|
78
|
+
Tasks.Runs = runs_1.Runs;
|
|
79
|
+
Tasks.Generations = generations_1.Generations;
|
|
80
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/resources/tasks/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,kDAAyE;AACzE,2DAAkC;AAClC,oCAAoD;AAGpD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6DzF,CAAC;IA3DC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,MAAc,EAAE,IAAmB,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AA/DD,sBA+DC;AA6aD,KAAK,CAAC,IAAI,GAAG,WAAI,CAAC;AAClB,KAAK,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as GenerationsAPI from "./generations.mjs";
|
|
4
|
+
import { Generations } from "./generations.mjs";
|
|
5
|
+
import * as RunsAPI from "./runs.mjs";
|
|
6
|
+
import { Runs } from "./runs.mjs";
|
|
7
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
8
|
+
export class Tasks extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.runs = new RunsAPI.Runs(this._client);
|
|
12
|
+
this.generations = new GenerationsAPI.Generations(this._client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Initiates asynchronous task generation. Use the returned task ID to poll for
|
|
16
|
+
* completion, then execute the task.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const response = await client.tasks.generate({
|
|
21
|
+
* description: 'Download a specific file from a URL',
|
|
22
|
+
* name: 'file-downloader',
|
|
23
|
+
* user_task: 'Create a task that downloads a specific file from a given URL.',
|
|
24
|
+
* input_schema: [
|
|
25
|
+
* {
|
|
26
|
+
* display_name: 'URL',
|
|
27
|
+
* type: 'string',
|
|
28
|
+
* required: true,
|
|
29
|
+
* description: 'URL of the file to download',
|
|
30
|
+
* },
|
|
31
|
+
* {
|
|
32
|
+
* display_name: 'File Name',
|
|
33
|
+
* type: 'string',
|
|
34
|
+
* required: true,
|
|
35
|
+
* description: 'Name of the file to download',
|
|
36
|
+
* },
|
|
37
|
+
* ],
|
|
38
|
+
* output_schema: [
|
|
39
|
+
* {
|
|
40
|
+
* display_name: 'Success',
|
|
41
|
+
* type: 'boolean',
|
|
42
|
+
* description: 'Whether the download succeeded',
|
|
43
|
+
* },
|
|
44
|
+
* {
|
|
45
|
+
* display_name: 'Message',
|
|
46
|
+
* type: 'string',
|
|
47
|
+
* description: 'Status or error message',
|
|
48
|
+
* },
|
|
49
|
+
* ],
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
generate(body, options) {
|
|
54
|
+
return this._client.post('/v2/tasks/generate', { body, ...options });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Triggers execution of a task by ID using the V2 tasks API.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response = await client.tasks.run('taskId', {
|
|
62
|
+
* input_params: {
|
|
63
|
+
* 'File Name': 'invoice-2026-02.pdf',
|
|
64
|
+
* Operation: 'extract_text',
|
|
65
|
+
* },
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
run(taskID, body, options) {
|
|
70
|
+
return this._client.post(path `/v2/tasks/${taskID}/run`, { body, ...options });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
Tasks.Runs = Runs;
|
|
74
|
+
Tasks.Generations = Generations;
|
|
75
|
+
//# sourceMappingURL=tasks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../../src/resources/tasks/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAA+B,WAAW,EAAE;OAC5C,KAAK,OAAO;OACZ,EAAwB,IAAI,EAAE;OAG9B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6DzF,CAAC;IA3DC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,MAAc,EAAE,IAAmB,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AA6aD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;AAClB,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.mts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./tasks/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/src/client.ts
CHANGED
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
ProfileRetrieveResponse,
|
|
36
36
|
Profiles,
|
|
37
37
|
} from './resources/profiles';
|
|
38
|
-
import { Task } from './resources/task';
|
|
39
38
|
import {
|
|
40
39
|
ToolFetchWebpageParams,
|
|
41
40
|
ToolFetchWebpageResponse,
|
|
@@ -73,6 +72,13 @@ import {
|
|
|
73
72
|
SessionUploadFileResponse,
|
|
74
73
|
Sessions,
|
|
75
74
|
} from './resources/sessions/sessions';
|
|
75
|
+
import {
|
|
76
|
+
TaskGenerateParams,
|
|
77
|
+
TaskGenerateResponse,
|
|
78
|
+
TaskRunParams,
|
|
79
|
+
TaskRunResponse,
|
|
80
|
+
Tasks,
|
|
81
|
+
} from './resources/tasks/tasks';
|
|
76
82
|
import { type Fetch } from './internal/builtin-types';
|
|
77
83
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
78
84
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -782,7 +788,7 @@ export class Anchorbrowser {
|
|
|
782
788
|
browser: API.Browser = new API.Browser(this);
|
|
783
789
|
agent: API.Agent = new API.Agent(this);
|
|
784
790
|
events: API.Events = new API.Events(this);
|
|
785
|
-
|
|
791
|
+
tasks: API.Tasks = new API.Tasks(this);
|
|
786
792
|
identities: API.Identities = new API.Identities(this);
|
|
787
793
|
applications: API.Applications = new API.Applications(this);
|
|
788
794
|
}
|
|
@@ -792,7 +798,7 @@ Anchorbrowser.Sessions = Sessions;
|
|
|
792
798
|
Anchorbrowser.Tools = Tools;
|
|
793
799
|
Anchorbrowser.Extensions = Extensions;
|
|
794
800
|
Anchorbrowser.Events = Events;
|
|
795
|
-
Anchorbrowser.
|
|
801
|
+
Anchorbrowser.Tasks = Tasks;
|
|
796
802
|
Anchorbrowser.Identities = Identities;
|
|
797
803
|
Anchorbrowser.Applications = Applications;
|
|
798
804
|
|
|
@@ -845,7 +851,13 @@ export declare namespace Anchorbrowser {
|
|
|
845
851
|
type EventWaitForParams as EventWaitForParams,
|
|
846
852
|
};
|
|
847
853
|
|
|
848
|
-
export {
|
|
854
|
+
export {
|
|
855
|
+
Tasks as Tasks,
|
|
856
|
+
type TaskGenerateResponse as TaskGenerateResponse,
|
|
857
|
+
type TaskRunResponse as TaskRunResponse,
|
|
858
|
+
type TaskGenerateParams as TaskGenerateParams,
|
|
859
|
+
type TaskRunParams as TaskRunParams,
|
|
860
|
+
};
|
|
849
861
|
|
|
850
862
|
export {
|
|
851
863
|
Identities as Identities,
|
package/src/resources/index.ts
CHANGED
|
@@ -47,7 +47,13 @@ export {
|
|
|
47
47
|
type SessionScrollParams,
|
|
48
48
|
type SessionUploadFileParams,
|
|
49
49
|
} from './sessions/sessions';
|
|
50
|
-
export {
|
|
50
|
+
export {
|
|
51
|
+
Tasks,
|
|
52
|
+
type TaskGenerateResponse,
|
|
53
|
+
type TaskRunResponse,
|
|
54
|
+
type TaskGenerateParams,
|
|
55
|
+
type TaskRunParams,
|
|
56
|
+
} from './tasks/tasks';
|
|
51
57
|
export {
|
|
52
58
|
Tools,
|
|
53
59
|
type ToolFetchWebpageResponse,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Generations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the current status of asynchronous task generation. Poll this endpoint
|
|
11
|
+
* after generating a task until status is ready or failed.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.tasks.generations.getStatus(
|
|
16
|
+
* 'taskId',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
getStatus(taskID: string, options?: RequestOptions): APIPromise<GenerationGetStatusResponse> {
|
|
21
|
+
return this._client.get(path`/v2/tasks/${taskID}/generation-status`, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Current status of asynchronous task generation.
|
|
27
|
+
*/
|
|
28
|
+
export interface GenerationGetStatusResponse {
|
|
29
|
+
/**
|
|
30
|
+
* The task ID
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Whether the task is still generating, ready to run, or failed.
|
|
36
|
+
*/
|
|
37
|
+
status: 'generating' | 'ready' | 'failed';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Error message when status is failed
|
|
41
|
+
*/
|
|
42
|
+
error?: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Optional internal project state
|
|
46
|
+
*/
|
|
47
|
+
project_state?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare namespace Generations {
|
|
51
|
+
export { type GenerationGetStatusResponse as GenerationGetStatusResponse };
|
|
52
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Generations, type GenerationGetStatusResponse } from './generations';
|
|
4
|
+
export { Runs, type RunGetStatusResponse } from './runs';
|
|
5
|
+
export {
|
|
6
|
+
Tasks,
|
|
7
|
+
type TaskGenerateResponse,
|
|
8
|
+
type TaskRunResponse,
|
|
9
|
+
type TaskGenerateParams,
|
|
10
|
+
type TaskRunParams,
|
|
11
|
+
} from './tasks';
|