@nimble-way/nimble-js 0.18.0 → 0.19.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 +14 -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/package.json +1 -1
- package/resources/agent.d.mts +10 -10
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +10 -10
- package/resources/agent.d.ts.map +1 -1
- package/resources/batches.d.mts +5 -5
- package/resources/batches.d.mts.map +1 -1
- package/resources/batches.d.ts +5 -5
- package/resources/batches.d.ts.map +1 -1
- package/resources/crawl.d.mts +1 -0
- package/resources/crawl.d.mts.map +1 -1
- package/resources/crawl.d.ts +1 -0
- package/resources/crawl.d.ts.map +1 -1
- package/resources/fast-serp.d.mts +305 -0
- package/resources/fast-serp.d.mts.map +1 -1
- package/resources/fast-serp.d.ts +305 -0
- package/resources/fast-serp.d.ts.map +1 -1
- package/resources/fast-serp.js +13 -0
- package/resources/fast-serp.js.map +1 -1
- package/resources/fast-serp.mjs +13 -0
- package/resources/fast-serp.mjs.map +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.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/jobs/jobs.d.mts +18 -0
- package/resources/jobs/jobs.d.mts.map +1 -1
- package/resources/jobs/jobs.d.ts +18 -0
- package/resources/jobs/jobs.d.ts.map +1 -1
- package/resources/jobs/jobs.js.map +1 -1
- package/resources/jobs/jobs.mjs.map +1 -1
- package/resources/jobs/runs/artifacts.d.mts +6 -0
- package/resources/jobs/runs/artifacts.d.mts.map +1 -1
- package/resources/jobs/runs/artifacts.d.ts +6 -0
- package/resources/jobs/runs/artifacts.d.ts.map +1 -1
- package/resources/media.d.mts +5 -5
- package/resources/media.d.mts.map +1 -1
- package/resources/media.d.ts +5 -5
- package/resources/media.d.ts.map +1 -1
- package/resources/serp.d.mts +10 -10
- package/resources/serp.d.mts.map +1 -1
- package/resources/serp.d.ts +10 -10
- package/resources/serp.d.ts.map +1 -1
- package/resources/task-agent/runs.d.mts +286 -63
- package/resources/task-agent/runs.d.mts.map +1 -1
- package/resources/task-agent/runs.d.ts +286 -63
- package/resources/task-agent/runs.d.ts.map +1 -1
- package/resources/task-agent/runs.js +21 -6
- package/resources/task-agent/runs.js.map +1 -1
- package/resources/task-agent/runs.mjs +21 -6
- package/resources/task-agent/runs.mjs.map +1 -1
- package/resources/task-agent/task-agent.d.mts +131 -33
- package/resources/task-agent/task-agent.d.mts.map +1 -1
- package/resources/task-agent/task-agent.d.ts +131 -33
- package/resources/task-agent/task-agent.d.ts.map +1 -1
- package/resources/task-agent/task-agent.js +12 -14
- package/resources/task-agent/task-agent.js.map +1 -1
- package/resources/task-agent/task-agent.mjs +12 -14
- package/resources/task-agent/task-agent.mjs.map +1 -1
- package/resources/task-agent/templates.d.mts +15 -6
- package/resources/task-agent/templates.d.mts.map +1 -1
- package/resources/task-agent/templates.d.ts +15 -6
- package/resources/task-agent/templates.d.ts.map +1 -1
- package/resources/task-agent/templates.js +2 -2
- package/resources/task-agent/templates.mjs +2 -2
- package/resources/tasks.d.mts +10 -10
- package/resources/tasks.d.mts.map +1 -1
- package/resources/tasks.d.ts +10 -10
- package/resources/tasks.d.ts.map +1 -1
- package/resources/top-level.d.mts +14 -10
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +14 -10
- package/resources/top-level.d.ts.map +1 -1
- package/src/client.ts +6 -2
- package/src/resources/agent.ts +11 -11
- package/src/resources/batches.ts +5 -5
- package/src/resources/crawl.ts +2 -0
- package/src/resources/fast-serp.ts +461 -1
- package/src/resources/index.ts +1 -1
- package/src/resources/jobs/jobs.ts +18 -0
- package/src/resources/jobs/runs/artifacts.ts +6 -0
- package/src/resources/media.ts +5 -5
- package/src/resources/serp.ts +10 -10
- package/src/resources/task-agent/runs.ts +304 -76
- package/src/resources/task-agent/task-agent.ts +141 -47
- package/src/resources/task-agent/templates.ts +16 -7
- package/src/resources/tasks.ts +10 -10
- package/src/resources/top-level.ts +18 -10
- 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
|
@@ -3,37 +3,66 @@ import { APIPromise } from "../../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
4
|
export declare class Runs extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* List
|
|
6
|
+
* List runs for this instance.
|
|
7
|
+
*
|
|
8
|
+
* `status` accepts a lowercase `TaskRunStatusValue` (e.g. "completed") or a
|
|
9
|
+
* comma-separated list of them (e.g. "queued,running").
|
|
7
10
|
*/
|
|
8
11
|
list(agentID: string, query?: RunListParams | null | undefined, options?: RequestOptions): APIPromise<RunListResponse>;
|
|
9
12
|
/**
|
|
10
13
|
* Cancel an in-progress or queued run.
|
|
14
|
+
*
|
|
15
|
+
* Verb is POST + `/cancel` action segment per the AGENTS-1666 spec (replaces the
|
|
16
|
+
* old `DELETE …/runs/{run_id}`).
|
|
11
17
|
*/
|
|
12
18
|
cancel(runID: string, params: RunCancelParams, options?: RequestOptions): APIPromise<void>;
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
20
|
+
* Fetch a run by id, scoped to the instance.
|
|
21
|
+
*
|
|
22
|
+
* A run resolves only when (run_id, agent_id) match — otherwise 404. This means a
|
|
23
|
+
* stale URL with a swapped agent_id won't leak runs across instances even if the
|
|
24
|
+
* run_id is real.
|
|
15
25
|
*/
|
|
16
26
|
get(runID: string, params: RunGetParams, options?: RequestOptions): APIPromise<RunGetResponse>;
|
|
17
27
|
/**
|
|
18
|
-
* Fetch the result for a terminal run
|
|
19
|
-
*
|
|
28
|
+
* Fetch the result for a terminal run on this instance.
|
|
29
|
+
*
|
|
30
|
+
* Mirrors the previous flat `GET /tasks/runs/:run_id/result` semantics:
|
|
31
|
+
*
|
|
32
|
+
* - 404 when the run doesn't belong to the agent.
|
|
33
|
+
* - 408 when the run is still active.
|
|
34
|
+
* - 422 (with TaskRunFailedResult body) when the run failed or was cancelled.
|
|
35
|
+
* - 200 (with TaskRunResult body) on success.
|
|
20
36
|
*/
|
|
21
37
|
getResult(runID: string, params: RunGetResultParams, options?: RequestOptions): APIPromise<RunGetResultResponse>;
|
|
22
38
|
/**
|
|
23
|
-
*
|
|
24
|
-
* have been created with `enable_events=true`.
|
|
39
|
+
* SSE stream of real-time progress events for a run on this instance.
|
|
25
40
|
*/
|
|
26
41
|
streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<unknown>;
|
|
27
42
|
}
|
|
28
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Paginated list of task runs for GET /tasks/runs.
|
|
45
|
+
*/
|
|
46
|
+
export interface RunListResponse {
|
|
47
|
+
items: Array<RunListResponse.Item>;
|
|
48
|
+
total: number;
|
|
49
|
+
limit?: number;
|
|
50
|
+
offset?: number;
|
|
51
|
+
}
|
|
29
52
|
export declare namespace RunListResponse {
|
|
30
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Task run status returned by list/create/get endpoints.
|
|
55
|
+
*/
|
|
56
|
+
interface Item {
|
|
31
57
|
/**
|
|
32
|
-
* Run identifier.
|
|
58
|
+
* Run identifier, format "task*run*{uuid}".
|
|
33
59
|
*/
|
|
34
60
|
id: string;
|
|
35
61
|
created_at: string;
|
|
36
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Canonical effort tier names for the research graph.
|
|
64
|
+
*/
|
|
65
|
+
effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
|
|
37
66
|
/**
|
|
38
67
|
* Interaction ID — pass as previous_interaction_id to reuse context.
|
|
39
68
|
*/
|
|
@@ -42,18 +71,33 @@ export declare namespace RunListResponse {
|
|
|
42
71
|
* True while status is 'queued' or 'running'.
|
|
43
72
|
*/
|
|
44
73
|
is_active: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Lowercase status values used in API responses (distinct from the DB-level
|
|
76
|
+
* TaskRunStatus enum).
|
|
77
|
+
*/
|
|
45
78
|
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
79
|
+
/**
|
|
80
|
+
* Web Search Agent instance this run belongs to. Every task run is agent-bound
|
|
81
|
+
* (see AGENTS-1666). Use this to build the nested URL
|
|
82
|
+
* /api/v2/web-search-agents/{web_search_agent_id}/runs/{id}.
|
|
83
|
+
*/
|
|
84
|
+
web_search_agent_id: string;
|
|
46
85
|
completed_at?: string | null;
|
|
47
|
-
error?: RunListResponseItem.Error | null;
|
|
48
|
-
prompt?: string | null;
|
|
49
|
-
started_at?: string | null;
|
|
50
86
|
/**
|
|
51
|
-
*
|
|
87
|
+
* Error detail for a failed run.
|
|
88
|
+
*/
|
|
89
|
+
error?: Item.Error | null;
|
|
90
|
+
/**
|
|
91
|
+
* Original user prompt before enrichment. Populated for Web Search Agent runs.
|
|
52
92
|
*/
|
|
53
|
-
|
|
93
|
+
prompt?: string | null;
|
|
94
|
+
started_at?: string | null;
|
|
54
95
|
workspace_id?: string | null;
|
|
55
96
|
}
|
|
56
|
-
namespace
|
|
97
|
+
namespace Item {
|
|
98
|
+
/**
|
|
99
|
+
* Error detail for a failed run.
|
|
100
|
+
*/
|
|
57
101
|
interface Error {
|
|
58
102
|
/**
|
|
59
103
|
* Human-readable error description.
|
|
@@ -66,13 +110,19 @@ export declare namespace RunListResponse {
|
|
|
66
110
|
}
|
|
67
111
|
}
|
|
68
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Task run status returned by list/create/get endpoints.
|
|
115
|
+
*/
|
|
69
116
|
export interface RunGetResponse {
|
|
70
117
|
/**
|
|
71
|
-
* Run identifier.
|
|
118
|
+
* Run identifier, format "task*run*{uuid}".
|
|
72
119
|
*/
|
|
73
120
|
id: string;
|
|
74
121
|
created_at: string;
|
|
75
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Canonical effort tier names for the research graph.
|
|
124
|
+
*/
|
|
125
|
+
effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
|
|
76
126
|
/**
|
|
77
127
|
* Interaction ID — pass as previous_interaction_id to reuse context.
|
|
78
128
|
*/
|
|
@@ -81,18 +131,33 @@ export interface RunGetResponse {
|
|
|
81
131
|
* True while status is 'queued' or 'running'.
|
|
82
132
|
*/
|
|
83
133
|
is_active: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Lowercase status values used in API responses (distinct from the DB-level
|
|
136
|
+
* TaskRunStatus enum).
|
|
137
|
+
*/
|
|
84
138
|
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
139
|
+
/**
|
|
140
|
+
* Web Search Agent instance this run belongs to. Every task run is agent-bound
|
|
141
|
+
* (see AGENTS-1666). Use this to build the nested URL
|
|
142
|
+
* /api/v2/web-search-agents/{web_search_agent_id}/runs/{id}.
|
|
143
|
+
*/
|
|
144
|
+
web_search_agent_id: string;
|
|
85
145
|
completed_at?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Error detail for a failed run.
|
|
148
|
+
*/
|
|
86
149
|
error?: RunGetResponse.Error | null;
|
|
87
|
-
prompt?: string | null;
|
|
88
|
-
started_at?: string | null;
|
|
89
150
|
/**
|
|
90
|
-
*
|
|
151
|
+
* Original user prompt before enrichment. Populated for Web Search Agent runs.
|
|
91
152
|
*/
|
|
92
|
-
|
|
153
|
+
prompt?: string | null;
|
|
154
|
+
started_at?: string | null;
|
|
93
155
|
workspace_id?: string | null;
|
|
94
156
|
}
|
|
95
157
|
export declare namespace RunGetResponse {
|
|
158
|
+
/**
|
|
159
|
+
* Error detail for a failed run.
|
|
160
|
+
*/
|
|
96
161
|
interface Error {
|
|
97
162
|
/**
|
|
98
163
|
* Human-readable error description.
|
|
@@ -104,22 +169,37 @@ export declare namespace RunGetResponse {
|
|
|
104
169
|
ref_id: string;
|
|
105
170
|
}
|
|
106
171
|
}
|
|
107
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Response for GET /tasks/runs/{run_id}/result — status 'completed'.
|
|
174
|
+
*/
|
|
175
|
+
export type RunGetResultResponse = RunGetResultResponse.TaskRunResult | RunGetResultResponse.TaskRunFailedResult;
|
|
108
176
|
export declare namespace RunGetResultResponse {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Response for GET /tasks/runs/{run_id}/result — status 'completed'.
|
|
179
|
+
*/
|
|
180
|
+
interface TaskRunResult {
|
|
181
|
+
/**
|
|
182
|
+
* Output from the completed task.
|
|
183
|
+
*/
|
|
184
|
+
output: TaskRunResult.TaskRunTextOutput | TaskRunResult.TaskRunJsonOutput;
|
|
185
|
+
/**
|
|
186
|
+
* Task run object with status 'completed'.
|
|
187
|
+
*/
|
|
188
|
+
run: TaskRunResult.Run;
|
|
112
189
|
}
|
|
113
|
-
namespace
|
|
114
|
-
|
|
190
|
+
namespace TaskRunResult {
|
|
191
|
+
/**
|
|
192
|
+
* Text output from a completed task.
|
|
193
|
+
*/
|
|
194
|
+
interface TaskRunTextOutput {
|
|
115
195
|
/**
|
|
116
196
|
* The final prose answer.
|
|
117
197
|
*/
|
|
118
198
|
content: string;
|
|
119
|
-
trust:
|
|
199
|
+
trust: TaskRunTextOutput.Trust;
|
|
120
200
|
type?: 'text';
|
|
121
201
|
}
|
|
122
|
-
namespace
|
|
202
|
+
namespace TaskRunTextOutput {
|
|
123
203
|
interface Trust {
|
|
124
204
|
claims: Array<Trust.Claim>;
|
|
125
205
|
confidence: 'high' | 'medium' | 'low';
|
|
@@ -132,19 +212,35 @@ export declare namespace RunGetResultResponse {
|
|
|
132
212
|
citations: Array<Claim.Citation>;
|
|
133
213
|
confidence: 'high' | 'medium' | 'low';
|
|
134
214
|
reasoning: string;
|
|
135
|
-
source?: Claim.Source | null;
|
|
136
215
|
}
|
|
137
216
|
namespace Claim {
|
|
138
217
|
interface Citation {
|
|
139
218
|
url: string;
|
|
140
219
|
excerpts?: Array<string> | null;
|
|
141
220
|
extract_template_name?: string | null;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
221
|
+
/**
|
|
222
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
223
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
224
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
225
|
+
*
|
|
226
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
227
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
228
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
229
|
+
* directly.
|
|
230
|
+
*/
|
|
231
|
+
source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
232
|
+
/**
|
|
233
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
234
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
235
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
236
|
+
*
|
|
237
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
238
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
239
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
240
|
+
* directly.
|
|
241
|
+
*/
|
|
242
|
+
source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
243
|
+
source_type?: 'primary' | 'secondary' | null;
|
|
148
244
|
title?: string | null;
|
|
149
245
|
}
|
|
150
246
|
}
|
|
@@ -152,18 +248,48 @@ export declare namespace RunGetResultResponse {
|
|
|
152
248
|
type: 'primary' | 'secondary';
|
|
153
249
|
url: string;
|
|
154
250
|
extract_template_name?: string | null;
|
|
251
|
+
/**
|
|
252
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
253
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
254
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
255
|
+
*
|
|
256
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
257
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
258
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
259
|
+
* directly.
|
|
260
|
+
*/
|
|
261
|
+
source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
262
|
+
/**
|
|
263
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
264
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
265
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
266
|
+
*
|
|
267
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
268
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
269
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
270
|
+
* directly.
|
|
271
|
+
*/
|
|
272
|
+
source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
155
273
|
title?: string | null;
|
|
156
274
|
}
|
|
157
275
|
}
|
|
158
276
|
}
|
|
159
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Structured JSON output from a completed task, produced when
|
|
279
|
+
* task_spec.output_schema.type is 'json'.
|
|
280
|
+
*/
|
|
281
|
+
interface TaskRunJsonOutput {
|
|
282
|
+
/**
|
|
283
|
+
* Data conforming to the caller-supplied JSON schema. A dict for object schemas; a
|
|
284
|
+
* list for array schemas.
|
|
285
|
+
*/
|
|
160
286
|
content: {
|
|
161
287
|
[key: string]: unknown;
|
|
162
288
|
} | Array<unknown>;
|
|
163
|
-
trust:
|
|
289
|
+
trust: TaskRunJsonOutput.Trust;
|
|
164
290
|
type?: 'json';
|
|
165
291
|
}
|
|
166
|
-
namespace
|
|
292
|
+
namespace TaskRunJsonOutput {
|
|
167
293
|
interface Trust {
|
|
168
294
|
claims: Array<Trust.Claim>;
|
|
169
295
|
confidence: 'high' | 'medium' | 'low';
|
|
@@ -176,19 +302,35 @@ export declare namespace RunGetResultResponse {
|
|
|
176
302
|
confidence: 'high' | 'medium' | 'low';
|
|
177
303
|
path: string;
|
|
178
304
|
reasoning: string;
|
|
179
|
-
source?: Claim.Source | null;
|
|
180
305
|
}
|
|
181
306
|
namespace Claim {
|
|
182
307
|
interface Citation {
|
|
183
308
|
url: string;
|
|
184
309
|
excerpts?: Array<string> | null;
|
|
185
310
|
extract_template_name?: string | null;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
311
|
+
/**
|
|
312
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
313
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
314
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
315
|
+
*
|
|
316
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
317
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
318
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
319
|
+
* directly.
|
|
320
|
+
*/
|
|
321
|
+
source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
322
|
+
/**
|
|
323
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
324
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
325
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
326
|
+
*
|
|
327
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
328
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
329
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
330
|
+
* directly.
|
|
331
|
+
*/
|
|
332
|
+
source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
333
|
+
source_type?: 'primary' | 'secondary' | null;
|
|
192
334
|
title?: string | null;
|
|
193
335
|
}
|
|
194
336
|
}
|
|
@@ -196,17 +338,45 @@ export declare namespace RunGetResultResponse {
|
|
|
196
338
|
type: 'primary' | 'secondary';
|
|
197
339
|
url: string;
|
|
198
340
|
extract_template_name?: string | null;
|
|
341
|
+
/**
|
|
342
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
343
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
344
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
345
|
+
*
|
|
346
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
347
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
348
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
349
|
+
* directly.
|
|
350
|
+
*/
|
|
351
|
+
source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
352
|
+
/**
|
|
353
|
+
* What _kind_ of source this is (classified by the compress LLM), independent of
|
|
354
|
+
* TrustSourceType (how authoritative it is for a specific claim). Deliberately
|
|
355
|
+
* uses "official" rather than "primary" so the two axes can never collide.
|
|
356
|
+
*
|
|
357
|
+
* Also doubles as the sub-question's `source_intent` (what kind of source a
|
|
358
|
+
* question _needs_) — the two concepts overlap enough that a single enum lets
|
|
359
|
+
* `classify_source_importance` compare "what we got" against "what we asked for"
|
|
360
|
+
* directly.
|
|
361
|
+
*/
|
|
362
|
+
source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
|
|
199
363
|
title?: string | null;
|
|
200
364
|
}
|
|
201
365
|
}
|
|
202
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Task run object with status 'completed'.
|
|
369
|
+
*/
|
|
203
370
|
interface Run {
|
|
204
371
|
/**
|
|
205
|
-
* Run identifier.
|
|
372
|
+
* Run identifier, format "task*run*{uuid}".
|
|
206
373
|
*/
|
|
207
374
|
id: string;
|
|
208
375
|
created_at: string;
|
|
209
|
-
|
|
376
|
+
/**
|
|
377
|
+
* Canonical effort tier names for the research graph.
|
|
378
|
+
*/
|
|
379
|
+
effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
|
|
210
380
|
/**
|
|
211
381
|
* Interaction ID — pass as previous_interaction_id to reuse context.
|
|
212
382
|
*/
|
|
@@ -215,18 +385,33 @@ export declare namespace RunGetResultResponse {
|
|
|
215
385
|
* True while status is 'queued' or 'running'.
|
|
216
386
|
*/
|
|
217
387
|
is_active: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Lowercase status values used in API responses (distinct from the DB-level
|
|
390
|
+
* TaskRunStatus enum).
|
|
391
|
+
*/
|
|
218
392
|
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
393
|
+
/**
|
|
394
|
+
* Web Search Agent instance this run belongs to. Every task run is agent-bound
|
|
395
|
+
* (see AGENTS-1666). Use this to build the nested URL
|
|
396
|
+
* /api/v2/web-search-agents/{web_search_agent_id}/runs/{id}.
|
|
397
|
+
*/
|
|
398
|
+
web_search_agent_id: string;
|
|
219
399
|
completed_at?: string | null;
|
|
400
|
+
/**
|
|
401
|
+
* Error detail for a failed run.
|
|
402
|
+
*/
|
|
220
403
|
error?: Run.Error | null;
|
|
221
|
-
prompt?: string | null;
|
|
222
|
-
started_at?: string | null;
|
|
223
404
|
/**
|
|
224
|
-
*
|
|
405
|
+
* Original user prompt before enrichment. Populated for Web Search Agent runs.
|
|
225
406
|
*/
|
|
226
|
-
|
|
407
|
+
prompt?: string | null;
|
|
408
|
+
started_at?: string | null;
|
|
227
409
|
workspace_id?: string | null;
|
|
228
410
|
}
|
|
229
411
|
namespace Run {
|
|
412
|
+
/**
|
|
413
|
+
* Error detail for a failed run.
|
|
414
|
+
*/
|
|
230
415
|
interface Error {
|
|
231
416
|
/**
|
|
232
417
|
* Human-readable error description.
|
|
@@ -239,11 +424,26 @@ export declare namespace RunGetResultResponse {
|
|
|
239
424
|
}
|
|
240
425
|
}
|
|
241
426
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
427
|
+
/**
|
|
428
|
+
* Response for GET /tasks/runs/{run_id}/result when the run failed.
|
|
429
|
+
*
|
|
430
|
+
* Returned with HTTP 422 so callers can distinguish a failed run from a missing
|
|
431
|
+
* one (404) or an active one (408).
|
|
432
|
+
*/
|
|
433
|
+
interface TaskRunFailedResult {
|
|
434
|
+
/**
|
|
435
|
+
* Structured error detail.
|
|
436
|
+
*/
|
|
437
|
+
error: TaskRunFailedResult.Error;
|
|
438
|
+
/**
|
|
439
|
+
* Task run object with status 'failed'.
|
|
440
|
+
*/
|
|
441
|
+
run: TaskRunFailedResult.Run;
|
|
245
442
|
}
|
|
246
|
-
namespace
|
|
443
|
+
namespace TaskRunFailedResult {
|
|
444
|
+
/**
|
|
445
|
+
* Structured error detail.
|
|
446
|
+
*/
|
|
247
447
|
interface Error {
|
|
248
448
|
/**
|
|
249
449
|
* Human-readable error description.
|
|
@@ -254,13 +454,19 @@ export declare namespace RunGetResultResponse {
|
|
|
254
454
|
*/
|
|
255
455
|
ref_id: string;
|
|
256
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* Task run object with status 'failed'.
|
|
459
|
+
*/
|
|
257
460
|
interface Run {
|
|
258
461
|
/**
|
|
259
|
-
* Run identifier.
|
|
462
|
+
* Run identifier, format "task*run*{uuid}".
|
|
260
463
|
*/
|
|
261
464
|
id: string;
|
|
262
465
|
created_at: string;
|
|
263
|
-
|
|
466
|
+
/**
|
|
467
|
+
* Canonical effort tier names for the research graph.
|
|
468
|
+
*/
|
|
469
|
+
effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
|
|
264
470
|
/**
|
|
265
471
|
* Interaction ID — pass as previous_interaction_id to reuse context.
|
|
266
472
|
*/
|
|
@@ -269,18 +475,33 @@ export declare namespace RunGetResultResponse {
|
|
|
269
475
|
* True while status is 'queued' or 'running'.
|
|
270
476
|
*/
|
|
271
477
|
is_active: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Lowercase status values used in API responses (distinct from the DB-level
|
|
480
|
+
* TaskRunStatus enum).
|
|
481
|
+
*/
|
|
272
482
|
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
483
|
+
/**
|
|
484
|
+
* Web Search Agent instance this run belongs to. Every task run is agent-bound
|
|
485
|
+
* (see AGENTS-1666). Use this to build the nested URL
|
|
486
|
+
* /api/v2/web-search-agents/{web_search_agent_id}/runs/{id}.
|
|
487
|
+
*/
|
|
488
|
+
web_search_agent_id: string;
|
|
273
489
|
completed_at?: string | null;
|
|
490
|
+
/**
|
|
491
|
+
* Error detail for a failed run.
|
|
492
|
+
*/
|
|
274
493
|
error?: Run.Error | null;
|
|
275
|
-
prompt?: string | null;
|
|
276
|
-
started_at?: string | null;
|
|
277
494
|
/**
|
|
278
|
-
*
|
|
495
|
+
* Original user prompt before enrichment. Populated for Web Search Agent runs.
|
|
279
496
|
*/
|
|
280
|
-
|
|
497
|
+
prompt?: string | null;
|
|
498
|
+
started_at?: string | null;
|
|
281
499
|
workspace_id?: string | null;
|
|
282
500
|
}
|
|
283
501
|
namespace Run {
|
|
502
|
+
/**
|
|
503
|
+
* Error detail for a failed run.
|
|
504
|
+
*/
|
|
284
505
|
interface Error {
|
|
285
506
|
/**
|
|
286
507
|
* Human-readable error description.
|
|
@@ -298,6 +519,8 @@ export type RunStreamEventsResponse = unknown;
|
|
|
298
519
|
export interface RunListParams {
|
|
299
520
|
limit?: number;
|
|
300
521
|
offset?: number;
|
|
522
|
+
q?: string | null;
|
|
523
|
+
status?: string | null;
|
|
301
524
|
}
|
|
302
525
|
export interface RunCancelParams {
|
|
303
526
|
agent_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/resources/task-agent/runs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCA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13 +7,19 @@ const headers_1 = require("../../internal/headers.js");
|
|
|
7
7
|
const path_1 = require("../../internal/utils/path.js");
|
|
8
8
|
class Runs extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* List
|
|
10
|
+
* List runs for this instance.
|
|
11
|
+
*
|
|
12
|
+
* `status` accepts a lowercase `TaskRunStatusValue` (e.g. "completed") or a
|
|
13
|
+
* comma-separated list of them (e.g. "queued,running").
|
|
11
14
|
*/
|
|
12
15
|
list(agentID, query = {}, options) {
|
|
13
16
|
return this._client.get((0, path_1.path) `/v1/task-agents/${agentID}/runs`, { query, ...options });
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Cancel an in-progress or queued run.
|
|
20
|
+
*
|
|
21
|
+
* Verb is POST + `/cancel` action segment per the AGENTS-1666 spec (replaces the
|
|
22
|
+
* old `DELETE …/runs/{run_id}`).
|
|
17
23
|
*/
|
|
18
24
|
cancel(runID, params, options) {
|
|
19
25
|
const { agent_id } = params;
|
|
@@ -23,23 +29,32 @@ class Runs extends resource_1.APIResource {
|
|
|
23
29
|
});
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
26
|
-
*
|
|
32
|
+
* Fetch a run by id, scoped to the instance.
|
|
33
|
+
*
|
|
34
|
+
* A run resolves only when (run_id, agent_id) match — otherwise 404. This means a
|
|
35
|
+
* stale URL with a swapped agent_id won't leak runs across instances even if the
|
|
36
|
+
* run_id is real.
|
|
27
37
|
*/
|
|
28
38
|
get(runID, params, options) {
|
|
29
39
|
const { agent_id } = params;
|
|
30
40
|
return this._client.get((0, path_1.path) `/v1/task-agents/${agent_id}/runs/${runID}`, options);
|
|
31
41
|
}
|
|
32
42
|
/**
|
|
33
|
-
* Fetch the result for a terminal run
|
|
34
|
-
*
|
|
43
|
+
* Fetch the result for a terminal run on this instance.
|
|
44
|
+
*
|
|
45
|
+
* Mirrors the previous flat `GET /tasks/runs/:run_id/result` semantics:
|
|
46
|
+
*
|
|
47
|
+
* - 404 when the run doesn't belong to the agent.
|
|
48
|
+
* - 408 when the run is still active.
|
|
49
|
+
* - 422 (with TaskRunFailedResult body) when the run failed or was cancelled.
|
|
50
|
+
* - 200 (with TaskRunResult body) on success.
|
|
35
51
|
*/
|
|
36
52
|
getResult(runID, params, options) {
|
|
37
53
|
const { agent_id } = params;
|
|
38
54
|
return this._client.get((0, path_1.path) `/v1/task-agents/${agent_id}/runs/${runID}/result`, options);
|
|
39
55
|
}
|
|
40
56
|
/**
|
|
41
|
-
*
|
|
42
|
-
* have been created with `enable_events=true`.
|
|
57
|
+
* SSE stream of real-time progress events for a run on this instance.
|
|
43
58
|
*/
|
|
44
59
|
streamEvents(runID, params, options) {
|
|
45
60
|
const { agent_id } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/resources/task-agent/runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IACnC
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/resources/task-agent/runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;OAKG;IACH,IAAI,CACF,OAAe,EACf,QAA0C,EAAE,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,OAAO,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAa,EAAE,MAAuB,EAAE,OAAwB;QACrE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EA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