@onkernel/sdk 0.147.0 → 0.149.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 +20 -0
- package/client.d.mts +18 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -0
- package/client.d.ts.map +1 -1
- package/client.js +18 -0
- package/client.js.map +1 -1
- package/client.mjs +18 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/browsers/browsers.d.mts +4 -0
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +4 -0
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +4 -0
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +4 -0
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -0
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -0
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js +3 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs +1 -0
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/live-view.d.mts +74 -0
- package/resources/browsers/live-view.d.mts.map +1 -0
- package/resources/browsers/live-view.d.ts +74 -0
- package/resources/browsers/live-view.d.ts.map +1 -0
- package/resources/browsers/live-view.js +33 -0
- package/resources/browsers/live-view.js.map +1 -0
- package/resources/browsers/live-view.mjs +29 -0
- package/resources/browsers/live-view.mjs.map +1 -0
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/report-types/index.d.mts +3 -0
- package/resources/report-types/index.d.mts.map +1 -0
- package/resources/report-types/index.d.ts +3 -0
- package/resources/report-types/index.d.ts.map +1 -0
- package/resources/report-types/index.js +9 -0
- package/resources/report-types/index.js.map +1 -0
- package/resources/report-types/index.mjs +4 -0
- package/resources/report-types/index.mjs.map +1 -0
- package/resources/report-types/report-types.d.mts +98 -0
- package/resources/report-types/report-types.d.mts.map +1 -0
- package/resources/report-types/report-types.d.ts +98 -0
- package/resources/report-types/report-types.d.ts.map +1 -0
- package/resources/report-types/report-types.js +38 -0
- package/resources/report-types/report-types.js.map +1 -0
- package/resources/report-types/report-types.mjs +33 -0
- package/resources/report-types/report-types.mjs.map +1 -0
- package/resources/report-types/versions.d.mts +47 -0
- package/resources/report-types/versions.d.mts.map +1 -0
- package/resources/report-types/versions.d.ts +47 -0
- package/resources/report-types/versions.d.ts.map +1 -0
- package/resources/report-types/versions.js +20 -0
- package/resources/report-types/versions.js.map +1 -0
- package/resources/report-types/versions.mjs +16 -0
- package/resources/report-types/versions.mjs.map +1 -0
- package/resources/report-types.d.mts +2 -0
- package/resources/report-types.d.mts.map +1 -0
- package/resources/report-types.d.ts +2 -0
- package/resources/report-types.d.ts.map +1 -0
- package/resources/report-types.js +6 -0
- package/resources/report-types.js.map +1 -0
- package/resources/report-types.mjs +3 -0
- package/resources/report-types.mjs.map +1 -0
- package/resources/reports.d.mts +136 -0
- package/resources/reports.d.mts.map +1 -0
- package/resources/reports.d.ts +136 -0
- package/resources/reports.d.ts.map +1 -0
- package/resources/reports.js +58 -0
- package/resources/reports.js.map +1 -0
- package/resources/reports.mjs +54 -0
- package/resources/reports.mjs.map +1 -0
- package/resources/tasks.d.mts +144 -0
- package/resources/tasks.d.mts.map +1 -0
- package/resources/tasks.d.ts +144 -0
- package/resources/tasks.d.ts.map +1 -0
- package/resources/tasks.js +67 -0
- package/resources/tasks.js.map +1 -0
- package/resources/tasks.mjs +63 -0
- package/resources/tasks.mjs.map +1 -0
- package/resources/vaults/items.d.mts +82 -17
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +82 -17
- package/resources/vaults/items.d.ts.map +1 -1
- package/resources/vaults/items.js +4 -0
- package/resources/vaults/items.js.map +1 -1
- package/resources/vaults/items.mjs +4 -0
- package/resources/vaults/items.mjs.map +1 -1
- package/resources/vaults/vaults.d.mts +4 -1
- package/resources/vaults/vaults.d.mts.map +1 -1
- package/resources/vaults/vaults.d.ts +4 -1
- package/resources/vaults/vaults.d.ts.map +1 -1
- package/resources/vaults/vaults.js +4 -1
- package/resources/vaults/vaults.js.map +1 -1
- package/resources/vaults/vaults.mjs +4 -1
- package/resources/vaults/vaults.mjs.map +1 -1
- package/src/client.ts +66 -0
- package/src/resources/browsers/browsers.ts +18 -0
- package/src/resources/browsers/index.ts +7 -0
- package/src/resources/browsers/live-view.ts +97 -0
- package/src/resources/index.ts +24 -0
- package/src/resources/report-types/index.ts +11 -0
- package/src/resources/report-types/report-types.ts +137 -0
- package/src/resources/report-types/versions.ts +61 -0
- package/src/resources/report-types.ts +3 -0
- package/src/resources/reports.ts +166 -0
- package/src/resources/tasks.ts +183 -0
- package/src/resources/vaults/items.ts +86 -9
- package/src/resources/vaults/vaults.ts +4 -1
- 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
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Define tasks that agents work toward and link the browsers they use.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Tasks extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Define a task before or while an agent works on it, optionally linking the
|
|
11
|
+
* browsers it uses. Submit reports against the returned task ID.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const task = await client.tasks.create({
|
|
16
|
+
* description: 'Book a hotel room for two nights',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body: TaskCreateParams, options?: RequestOptions): APIPromise<Task>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve a task and the IDs of its linked browsers.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const task = await client.tasks.retrieve('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Task>;
|
|
30
|
+
/**
|
|
31
|
+
* List tasks in the request's project, newest first.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const task of client.tasks.list()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
list(query?: TaskListParams | null | undefined, options?: RequestOptions): PagePromise<TasksOffsetPagination, Task>;
|
|
42
|
+
/**
|
|
43
|
+
* Link browsers to an existing task. Linking a browser that is already linked has
|
|
44
|
+
* no effect, so the call is safe to retry. Returns the updated task.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const task = await client.tasks.linkBrowsers('id', {
|
|
49
|
+
* session_ids: ['x'],
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
linkBrowsers(id: string, body: TaskLinkBrowsersParams, options?: RequestOptions): APIPromise<Task>;
|
|
54
|
+
}
|
|
55
|
+
export type TasksOffsetPagination = OffsetPagination<Task>;
|
|
56
|
+
/**
|
|
57
|
+
* A goal an agent works toward. Reports are submitted against a task, and browsers
|
|
58
|
+
* can be linked to it. Tasks are immutable apart from added browser links.
|
|
59
|
+
*/
|
|
60
|
+
export interface Task {
|
|
61
|
+
/**
|
|
62
|
+
* Unique identifier for the task
|
|
63
|
+
*/
|
|
64
|
+
id: string;
|
|
65
|
+
/**
|
|
66
|
+
* When the task was created
|
|
67
|
+
*/
|
|
68
|
+
created_at: string;
|
|
69
|
+
/**
|
|
70
|
+
* What the task is meant to accomplish
|
|
71
|
+
*/
|
|
72
|
+
description: string;
|
|
73
|
+
/**
|
|
74
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
75
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
76
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
77
|
+
*/
|
|
78
|
+
metadata: TaskMetadata;
|
|
79
|
+
/**
|
|
80
|
+
* IDs of browsers linked to the task, oldest link first. Linked browsers may since
|
|
81
|
+
* have been deleted.
|
|
82
|
+
*/
|
|
83
|
+
session_ids: Array<string>;
|
|
84
|
+
/**
|
|
85
|
+
* When work on the task started
|
|
86
|
+
*/
|
|
87
|
+
started_at: string;
|
|
88
|
+
/**
|
|
89
|
+
* Hostname of the website the task targets
|
|
90
|
+
*/
|
|
91
|
+
target_website?: string | null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
95
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
96
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
97
|
+
*/
|
|
98
|
+
export type TaskMetadata = {
|
|
99
|
+
[key: string]: string;
|
|
100
|
+
};
|
|
101
|
+
export interface TaskCreateParams {
|
|
102
|
+
/**
|
|
103
|
+
* What the task is meant to accomplish, at most 4 KB.
|
|
104
|
+
*/
|
|
105
|
+
description: string;
|
|
106
|
+
/**
|
|
107
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
108
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
109
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
110
|
+
*/
|
|
111
|
+
metadata?: TaskMetadata;
|
|
112
|
+
/**
|
|
113
|
+
* IDs of browsers to link to the task. Each must belong to the request's project;
|
|
114
|
+
* deleted browsers can be linked.
|
|
115
|
+
*/
|
|
116
|
+
session_ids?: Array<string>;
|
|
117
|
+
/**
|
|
118
|
+
* When work on the task started. Defaults to the time the task is created. Must be
|
|
119
|
+
* no more than 5 minutes in the future or 30 days in the past.
|
|
120
|
+
*/
|
|
121
|
+
started_at?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Hostname of the website the task targets, without a scheme or path.
|
|
124
|
+
*/
|
|
125
|
+
target_website?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface TaskListParams extends OffsetPaginationParams {
|
|
128
|
+
/**
|
|
129
|
+
* Only return tasks linked to this browser ID.
|
|
130
|
+
*/
|
|
131
|
+
session_id?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface TaskLinkBrowsersParams {
|
|
134
|
+
/**
|
|
135
|
+
* IDs of browsers to link. Each must belong to the task's project; deleted
|
|
136
|
+
* browsers can be linked. Browsers already linked are ignored. A task can have at
|
|
137
|
+
* most 100 linked browsers.
|
|
138
|
+
*/
|
|
139
|
+
session_ids: Array<string>;
|
|
140
|
+
}
|
|
141
|
+
export declare namespace Tasks {
|
|
142
|
+
export { type Task as Task, type TaskMetadata as TaskMetadata, type TasksOffsetPagination as TasksOffsetPagination, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskLinkBrowsersParams as TaskLinkBrowsersParams, };
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=tasks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.mts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAChG,OAAO,EAAE,cAAc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IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Define tasks that agents work toward and link the browsers they use.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Tasks extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Define a task before or while an agent works on it, optionally linking the
|
|
11
|
+
* browsers it uses. Submit reports against the returned task ID.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const task = await client.tasks.create({
|
|
16
|
+
* description: 'Book a hotel room for two nights',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body: TaskCreateParams, options?: RequestOptions): APIPromise<Task>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve a task and the IDs of its linked browsers.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const task = await client.tasks.retrieve('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Task>;
|
|
30
|
+
/**
|
|
31
|
+
* List tasks in the request's project, newest first.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const task of client.tasks.list()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
list(query?: TaskListParams | null | undefined, options?: RequestOptions): PagePromise<TasksOffsetPagination, Task>;
|
|
42
|
+
/**
|
|
43
|
+
* Link browsers to an existing task. Linking a browser that is already linked has
|
|
44
|
+
* no effect, so the call is safe to retry. Returns the updated task.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const task = await client.tasks.linkBrowsers('id', {
|
|
49
|
+
* session_ids: ['x'],
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
linkBrowsers(id: string, body: TaskLinkBrowsersParams, options?: RequestOptions): APIPromise<Task>;
|
|
54
|
+
}
|
|
55
|
+
export type TasksOffsetPagination = OffsetPagination<Task>;
|
|
56
|
+
/**
|
|
57
|
+
* A goal an agent works toward. Reports are submitted against a task, and browsers
|
|
58
|
+
* can be linked to it. Tasks are immutable apart from added browser links.
|
|
59
|
+
*/
|
|
60
|
+
export interface Task {
|
|
61
|
+
/**
|
|
62
|
+
* Unique identifier for the task
|
|
63
|
+
*/
|
|
64
|
+
id: string;
|
|
65
|
+
/**
|
|
66
|
+
* When the task was created
|
|
67
|
+
*/
|
|
68
|
+
created_at: string;
|
|
69
|
+
/**
|
|
70
|
+
* What the task is meant to accomplish
|
|
71
|
+
*/
|
|
72
|
+
description: string;
|
|
73
|
+
/**
|
|
74
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
75
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
76
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
77
|
+
*/
|
|
78
|
+
metadata: TaskMetadata;
|
|
79
|
+
/**
|
|
80
|
+
* IDs of browsers linked to the task, oldest link first. Linked browsers may since
|
|
81
|
+
* have been deleted.
|
|
82
|
+
*/
|
|
83
|
+
session_ids: Array<string>;
|
|
84
|
+
/**
|
|
85
|
+
* When work on the task started
|
|
86
|
+
*/
|
|
87
|
+
started_at: string;
|
|
88
|
+
/**
|
|
89
|
+
* Hostname of the website the task targets
|
|
90
|
+
*/
|
|
91
|
+
target_website?: string | null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
95
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
96
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
97
|
+
*/
|
|
98
|
+
export type TaskMetadata = {
|
|
99
|
+
[key: string]: string;
|
|
100
|
+
};
|
|
101
|
+
export interface TaskCreateParams {
|
|
102
|
+
/**
|
|
103
|
+
* What the task is meant to accomplish, at most 4 KB.
|
|
104
|
+
*/
|
|
105
|
+
description: string;
|
|
106
|
+
/**
|
|
107
|
+
* Caller-defined string key-value pairs for grouping and filtering tasks, such as
|
|
108
|
+
* a user or thread ID. At most 20 keys; keys are 1-64 characters, values at most
|
|
109
|
+
* 256 characters, and keys and values together at most 4 KB.
|
|
110
|
+
*/
|
|
111
|
+
metadata?: TaskMetadata;
|
|
112
|
+
/**
|
|
113
|
+
* IDs of browsers to link to the task. Each must belong to the request's project;
|
|
114
|
+
* deleted browsers can be linked.
|
|
115
|
+
*/
|
|
116
|
+
session_ids?: Array<string>;
|
|
117
|
+
/**
|
|
118
|
+
* When work on the task started. Defaults to the time the task is created. Must be
|
|
119
|
+
* no more than 5 minutes in the future or 30 days in the past.
|
|
120
|
+
*/
|
|
121
|
+
started_at?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Hostname of the website the task targets, without a scheme or path.
|
|
124
|
+
*/
|
|
125
|
+
target_website?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface TaskListParams extends OffsetPaginationParams {
|
|
128
|
+
/**
|
|
129
|
+
* Only return tasks linked to this browser ID.
|
|
130
|
+
*/
|
|
131
|
+
session_id?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface TaskLinkBrowsersParams {
|
|
134
|
+
/**
|
|
135
|
+
* IDs of browsers to link. Each must belong to the task's project; deleted
|
|
136
|
+
* browsers can be linked. Browsers already linked are ignored. A task can have at
|
|
137
|
+
* most 100 linked browsers.
|
|
138
|
+
*/
|
|
139
|
+
session_ids: Array<string>;
|
|
140
|
+
}
|
|
141
|
+
export declare namespace Tasks {
|
|
142
|
+
export { type Task as Task, type TaskMetadata as TaskMetadata, type TasksOffsetPagination as TasksOffsetPagination, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskLinkBrowsersParams as TaskLinkBrowsersParams, };
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM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K,CAAC,MAAM,CAAC,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Define tasks that agents work toward and link the browsers they use.
|
|
10
|
+
*/
|
|
11
|
+
class Tasks extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Define a task before or while an agent works on it, optionally linking the
|
|
14
|
+
* browsers it uses. Submit reports against the returned task ID.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const task = await client.tasks.create({
|
|
19
|
+
* description: 'Book a hotel room for two nights',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body, options) {
|
|
24
|
+
return this._client.post('/tasks', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieve a task and the IDs of its linked browsers.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const task = await client.tasks.retrieve('id');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
retrieve(id, options) {
|
|
35
|
+
return this._client.get((0, path_1.path) `/tasks/${id}`, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* List tasks in the request's project, newest first.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* // Automatically fetches more pages as needed.
|
|
43
|
+
* for await (const task of client.tasks.list()) {
|
|
44
|
+
* // ...
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(query = {}, options) {
|
|
49
|
+
return this._client.getAPIList('/tasks', (pagination_1.OffsetPagination), { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Link browsers to an existing task. Linking a browser that is already linked has
|
|
53
|
+
* no effect, so the call is safe to retry. Returns the updated task.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const task = await client.tasks.linkBrowsers('id', {
|
|
58
|
+
* session_ids: ['x'],
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
linkBrowsers(id, body, options) {
|
|
63
|
+
return this._client.post((0, path_1.path) `/tasks/${id}/browsers`, { body, ...options });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.Tasks = Tasks;
|
|
67
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAEhG,oDAA8C;AAE9C;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAA,6BAAsB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAU,EAAE,IAA4B,EAAE,OAAwB;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,UAAU,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AA5DD,sBA4DC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { OffsetPagination } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Define tasks that agents work toward and link the browsers they use.
|
|
7
|
+
*/
|
|
8
|
+
export class Tasks extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Define a task before or while an agent works on it, optionally linking the
|
|
11
|
+
* browsers it uses. Submit reports against the returned task ID.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const task = await client.tasks.create({
|
|
16
|
+
* description: 'Book a hotel room for two nights',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this._client.post('/tasks', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve a task and the IDs of its linked browsers.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const task = await client.tasks.retrieve('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
retrieve(id, options) {
|
|
32
|
+
return this._client.get(path `/tasks/${id}`, options);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* List tasks in the request's project, newest first.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Automatically fetches more pages as needed.
|
|
40
|
+
* for await (const task of client.tasks.list()) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
list(query = {}, options) {
|
|
46
|
+
return this._client.getAPIList('/tasks', (OffsetPagination), { query, ...options });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Link browsers to an existing task. Linking a browser that is already linked has
|
|
50
|
+
* no effect, so the call is safe to retry. Returns the updated task.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const task = await client.tasks.linkBrowsers('id', {
|
|
55
|
+
* session_ids: ['x'],
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
linkBrowsers(id, body, options) {
|
|
60
|
+
return this._client.post(path `/tasks/${id}/browsers`, { body, ...options });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=tasks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAEhG,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAA,gBAAsB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAU,EAAE,IAA4B,EAAE,OAAwB;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,UAAU,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
|