@nimble-way/nimble-js 0.18.0 → 0.20.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agent.d.mts +14 -31
  10. package/resources/agent.d.mts.map +1 -1
  11. package/resources/agent.d.ts +14 -31
  12. package/resources/agent.d.ts.map +1 -1
  13. package/resources/agent.js +4 -21
  14. package/resources/agent.js.map +1 -1
  15. package/resources/agent.mjs +4 -21
  16. package/resources/agent.mjs.map +1 -1
  17. package/resources/batches.d.mts +5 -5
  18. package/resources/batches.d.mts.map +1 -1
  19. package/resources/batches.d.ts +5 -5
  20. package/resources/batches.d.ts.map +1 -1
  21. package/resources/crawl.d.mts +1 -0
  22. package/resources/crawl.d.mts.map +1 -1
  23. package/resources/crawl.d.ts +1 -0
  24. package/resources/crawl.d.ts.map +1 -1
  25. package/resources/fast-serp.d.mts +305 -0
  26. package/resources/fast-serp.d.mts.map +1 -1
  27. package/resources/fast-serp.d.ts +305 -0
  28. package/resources/fast-serp.d.ts.map +1 -1
  29. package/resources/fast-serp.js +13 -0
  30. package/resources/fast-serp.js.map +1 -1
  31. package/resources/fast-serp.mjs +13 -0
  32. package/resources/fast-serp.mjs.map +1 -1
  33. package/resources/index.d.mts +1 -1
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +1 -1
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/jobs/jobs.d.mts +36 -6
  40. package/resources/jobs/jobs.d.mts.map +1 -1
  41. package/resources/jobs/jobs.d.ts +36 -6
  42. package/resources/jobs/jobs.d.ts.map +1 -1
  43. package/resources/jobs/jobs.js +12 -0
  44. package/resources/jobs/jobs.js.map +1 -1
  45. package/resources/jobs/jobs.mjs +12 -0
  46. package/resources/jobs/jobs.mjs.map +1 -1
  47. package/resources/jobs/runs/artifacts.d.mts +17 -13
  48. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  49. package/resources/jobs/runs/artifacts.d.ts +17 -13
  50. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  51. package/resources/jobs/runs/artifacts.js +8 -0
  52. package/resources/jobs/runs/artifacts.js.map +1 -1
  53. package/resources/jobs/runs/artifacts.mjs +8 -0
  54. package/resources/jobs/runs/artifacts.mjs.map +1 -1
  55. package/resources/jobs/runs/runs.d.mts +12 -6
  56. package/resources/jobs/runs/runs.d.mts.map +1 -1
  57. package/resources/jobs/runs/runs.d.ts +12 -6
  58. package/resources/jobs/runs/runs.d.ts.map +1 -1
  59. package/resources/jobs/runs/runs.js +6 -0
  60. package/resources/jobs/runs/runs.js.map +1 -1
  61. package/resources/jobs/runs/runs.mjs +6 -0
  62. package/resources/jobs/runs/runs.mjs.map +1 -1
  63. package/resources/media.d.mts +5 -5
  64. package/resources/media.d.mts.map +1 -1
  65. package/resources/media.d.ts +5 -5
  66. package/resources/media.d.ts.map +1 -1
  67. package/resources/serp.d.mts +10 -10
  68. package/resources/serp.d.mts.map +1 -1
  69. package/resources/serp.d.ts +10 -10
  70. package/resources/serp.d.ts.map +1 -1
  71. package/resources/task-agent/index.d.mts +1 -1
  72. package/resources/task-agent/index.d.mts.map +1 -1
  73. package/resources/task-agent/index.d.ts +1 -1
  74. package/resources/task-agent/index.d.ts.map +1 -1
  75. package/resources/task-agent/index.js.map +1 -1
  76. package/resources/task-agent/index.mjs.map +1 -1
  77. package/resources/task-agent/runs.d.mts +440 -81
  78. package/resources/task-agent/runs.d.mts.map +1 -1
  79. package/resources/task-agent/runs.d.ts +440 -81
  80. package/resources/task-agent/runs.d.ts.map +1 -1
  81. package/resources/task-agent/runs.js +30 -17
  82. package/resources/task-agent/runs.js.map +1 -1
  83. package/resources/task-agent/runs.mjs +30 -17
  84. package/resources/task-agent/runs.mjs.map +1 -1
  85. package/resources/task-agent/task-agent.d.mts +641 -51
  86. package/resources/task-agent/task-agent.d.mts.map +1 -1
  87. package/resources/task-agent/task-agent.d.ts +641 -51
  88. package/resources/task-agent/task-agent.d.ts.map +1 -1
  89. package/resources/task-agent/task-agent.js +24 -14
  90. package/resources/task-agent/task-agent.js.map +1 -1
  91. package/resources/task-agent/task-agent.mjs +24 -14
  92. package/resources/task-agent/task-agent.mjs.map +1 -1
  93. package/resources/task-agent/templates.d.mts +175 -12
  94. package/resources/task-agent/templates.d.mts.map +1 -1
  95. package/resources/task-agent/templates.d.ts +175 -12
  96. package/resources/task-agent/templates.d.ts.map +1 -1
  97. package/resources/task-agent/templates.js +6 -2
  98. package/resources/task-agent/templates.js.map +1 -1
  99. package/resources/task-agent/templates.mjs +6 -2
  100. package/resources/task-agent/templates.mjs.map +1 -1
  101. package/resources/tasks.d.mts +10 -10
  102. package/resources/tasks.d.mts.map +1 -1
  103. package/resources/tasks.d.ts +10 -10
  104. package/resources/tasks.d.ts.map +1 -1
  105. package/resources/top-level.d.mts +14 -16
  106. package/resources/top-level.d.mts.map +1 -1
  107. package/resources/top-level.d.ts +14 -16
  108. package/resources/top-level.d.ts.map +1 -1
  109. package/src/client.ts +6 -2
  110. package/src/resources/agent.ts +15 -32
  111. package/src/resources/batches.ts +5 -5
  112. package/src/resources/crawl.ts +2 -0
  113. package/src/resources/fast-serp.ts +461 -1
  114. package/src/resources/index.ts +1 -1
  115. package/src/resources/jobs/jobs.ts +36 -6
  116. package/src/resources/jobs/runs/artifacts.ts +17 -13
  117. package/src/resources/jobs/runs/runs.ts +12 -6
  118. package/src/resources/media.ts +5 -5
  119. package/src/resources/serp.ts +10 -10
  120. package/src/resources/task-agent/index.ts +0 -2
  121. package/src/resources/task-agent/runs.ts +461 -111
  122. package/src/resources/task-agent/task-agent.ts +652 -78
  123. package/src/resources/task-agent/templates.ts +178 -14
  124. package/src/resources/tasks.ts +10 -10
  125. package/src/resources/top-level.ts +18 -15
  126. package/src/version.ts +1 -1
  127. package/version.d.mts +1 -1
  128. package/version.d.ts +1 -1
  129. package/version.js +1 -1
  130. package/version.mjs +1 -1
@@ -8,7 +8,12 @@ import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class Runs extends APIResource {
10
10
  /**
11
- * List task runs for the caller's workspace and the given agent, newest first.
11
+ * List runs for this instance.
12
+ *
13
+ * `status` accepts a lowercase `TaskRunStatusValue` (e.g. "completed") or a
14
+ * comma-separated list of them (e.g. "queued,running").
15
+ *
16
+ * @deprecated
12
17
  */
13
18
  list(
14
19
  agentID: string,
@@ -19,18 +24,13 @@ export class Runs extends APIResource {
19
24
  }
20
25
 
21
26
  /**
22
- * Cancel an in-progress or queued run.
23
- */
24
- cancel(runID: string, params: RunCancelParams, options?: RequestOptions): APIPromise<void> {
25
- const { agent_id } = params;
26
- return this._client.post(path`/v1/task-agents/${agent_id}/runs/${runID}/cancel`, {
27
- ...options,
28
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
29
- });
30
- }
31
-
32
- /**
33
- * Poll run status. Repeat until status is 'completed', 'failed', or 'cancelled'.
27
+ * Fetch a run by id, scoped to the instance.
28
+ *
29
+ * A run resolves only when (run_id, agent_id) match — otherwise 404. This means a
30
+ * stale URL with a swapped agent_id won't leak runs across instances even if the
31
+ * run_id is real.
32
+ *
33
+ * @deprecated
34
34
  */
35
35
  get(runID: string, params: RunGetParams, options?: RequestOptions): APIPromise<RunGetResponse> {
36
36
  const { agent_id } = params;
@@ -38,8 +38,16 @@ export class Runs extends APIResource {
38
38
  }
39
39
 
40
40
  /**
41
- * Fetch the result for a terminal run. Returns 408 if still active, 422 with
42
- * `AgentRunFailedResult` if failed.
41
+ * Fetch the result for a terminal run on this instance.
42
+ *
43
+ * Mirrors the previous flat `GET /tasks/runs/:run_id/result` semantics:
44
+ *
45
+ * - 404 when the run doesn't belong to the agent.
46
+ * - 408 when the run is still active.
47
+ * - 422 (with TaskRunFailedResult body) when the run failed or was cancelled.
48
+ * - 200 (with TaskRunResult body) on success.
49
+ *
50
+ * @deprecated
43
51
  */
44
52
  getResult(
45
53
  runID: string,
@@ -51,30 +59,60 @@ export class Runs extends APIResource {
51
59
  }
52
60
 
53
61
  /**
54
- * Server-Sent Events stream of real-time progress events for a run. The run must
55
- * have been created with `enable_events=true`.
62
+ * SSE stream of real-time progress events for a run on this instance.
63
+ *
64
+ * @deprecated
56
65
  */
57
- streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<unknown> {
66
+ streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<void> {
58
67
  const { agent_id } = params;
59
- return this._client.get(path`/v1/task-agents/${agent_id}/runs/${runID}/events`, options);
68
+ return this._client.get(path`/v1/task-agents/${agent_id}/runs/${runID}/events`, {
69
+ ...options,
70
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
71
+ });
60
72
  }
61
73
  }
62
74
 
63
- export type RunListResponse = Array<RunListResponse.RunListResponseItem>;
75
+ export interface RunListResponse {
76
+ /**
77
+ * Items returned in this page.
78
+ */
79
+ items: Array<RunListResponse.Item>;
80
+
81
+ /**
82
+ * Maximum number of items returned.
83
+ */
84
+ limit: number;
85
+
86
+ /**
87
+ * Number of items skipped before this page.
88
+ */
89
+ offset: number;
90
+
91
+ /**
92
+ * Total number of items matching the query.
93
+ */
94
+ total: number;
95
+ }
64
96
 
65
97
  export namespace RunListResponse {
66
- export interface RunListResponseItem {
98
+ export interface Item {
67
99
  /**
68
- * Run identifier.
100
+ * Run identifier, format "task*run*{uuid}".
69
101
  */
70
102
  id: string;
71
103
 
104
+ /**
105
+ * When the run was created.
106
+ */
72
107
  created_at: string;
73
108
 
74
- effort: 'quickest' | 'quick' | 'research' | 'pro' | 'max';
109
+ /**
110
+ * Effort level used for the run.
111
+ */
112
+ effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
75
113
 
76
114
  /**
77
- * Interaction ID — pass as previous_interaction_id to reuse context.
115
+ * Interaction ID.
78
116
  */
79
117
  interaction_id: string;
80
118
 
@@ -83,25 +121,41 @@ export namespace RunListResponse {
83
121
  */
84
122
  is_active: boolean;
85
123
 
124
+ /**
125
+ * Current run status.
126
+ */
86
127
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
87
128
 
129
+ /**
130
+ * Web Search Agent instance this run belongs to.
131
+ */
132
+ web_search_agent_id: string;
133
+
134
+ /**
135
+ * When the run completed.
136
+ */
88
137
  completed_at?: string | null;
89
138
 
90
- error?: RunListResponseItem.Error | null;
139
+ /**
140
+ * Error details when the run failed.
141
+ */
142
+ error?: Item.Error | null;
91
143
 
144
+ /**
145
+ * Prompt submitted for the run.
146
+ */
92
147
  prompt?: string | null;
93
148
 
94
- started_at?: string | null;
95
-
96
149
  /**
97
- * Web Search Agent instance this run belongs to.
150
+ * When the run started executing.
98
151
  */
99
- web_search_agent_id?: string | null;
100
-
101
- workspace_id?: string | null;
152
+ started_at?: string | null;
102
153
  }
103
154
 
104
- export namespace RunListResponseItem {
155
+ export namespace Item {
156
+ /**
157
+ * Error details when the run failed.
158
+ */
105
159
  export interface Error {
106
160
  /**
107
161
  * Human-readable error description.
@@ -118,16 +172,22 @@ export namespace RunListResponse {
118
172
 
119
173
  export interface RunGetResponse {
120
174
  /**
121
- * Run identifier.
175
+ * Run identifier, format "task*run*{uuid}".
122
176
  */
123
177
  id: string;
124
178
 
179
+ /**
180
+ * When the run was created.
181
+ */
125
182
  created_at: string;
126
183
 
127
- effort: 'quickest' | 'quick' | 'research' | 'pro' | 'max';
184
+ /**
185
+ * Effort level used for the run.
186
+ */
187
+ effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
128
188
 
129
189
  /**
130
- * Interaction ID — pass as previous_interaction_id to reuse context.
190
+ * Interaction ID.
131
191
  */
132
192
  interaction_id: string;
133
193
 
@@ -136,25 +196,41 @@ export interface RunGetResponse {
136
196
  */
137
197
  is_active: boolean;
138
198
 
199
+ /**
200
+ * Current run status.
201
+ */
139
202
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
140
203
 
204
+ /**
205
+ * Web Search Agent instance this run belongs to.
206
+ */
207
+ web_search_agent_id: string;
208
+
209
+ /**
210
+ * When the run completed.
211
+ */
141
212
  completed_at?: string | null;
142
213
 
214
+ /**
215
+ * Error details when the run failed.
216
+ */
143
217
  error?: RunGetResponse.Error | null;
144
218
 
219
+ /**
220
+ * Prompt submitted for the run.
221
+ */
145
222
  prompt?: string | null;
146
223
 
147
- started_at?: string | null;
148
-
149
224
  /**
150
- * Web Search Agent instance this run belongs to.
225
+ * When the run started executing.
151
226
  */
152
- web_search_agent_id?: string | null;
153
-
154
- workspace_id?: string | null;
227
+ started_at?: string | null;
155
228
  }
156
229
 
157
230
  export namespace RunGetResponse {
231
+ /**
232
+ * Error details when the run failed.
233
+ */
158
234
  export interface Error {
159
235
  /**
160
236
  * Human-readable error description.
@@ -169,164 +245,396 @@ export namespace RunGetResponse {
169
245
  }
170
246
 
171
247
  export type RunGetResultResponse =
172
- | RunGetResultResponse.AgentRunResult
173
- | RunGetResultResponse.AgentRunFailedResult;
248
+ | RunGetResultResponse.TaskRunResultPublicV1
249
+ | RunGetResultResponse.TaskRunFailedResultPublicV1;
174
250
 
175
251
  export namespace RunGetResultResponse {
176
- export interface AgentRunResult {
177
- output: AgentRunResult.AgentRunTextOutput | AgentRunResult.AgentRunJsonOutput;
252
+ export interface TaskRunResultPublicV1 {
253
+ /**
254
+ * Output from the completed task.
255
+ */
256
+ output: TaskRunResultPublicV1.TaskRunTextOutputPublicV1 | TaskRunResultPublicV1.TaskRunJsonOutputPublicV1;
178
257
 
179
- run: AgentRunResult.Run;
258
+ /**
259
+ * Task run object with status 'completed'.
260
+ */
261
+ run: TaskRunResultPublicV1.Run;
180
262
  }
181
263
 
182
- export namespace AgentRunResult {
183
- export interface AgentRunTextOutput {
264
+ export namespace TaskRunResultPublicV1 {
265
+ export interface TaskRunTextOutputPublicV1 {
184
266
  /**
185
267
  * The final prose answer.
186
268
  */
187
269
  content: string;
188
270
 
189
- trust: AgentRunTextOutput.Trust;
271
+ /**
272
+ * Trust and citation metadata for the output.
273
+ */
274
+ trust: TaskRunTextOutputPublicV1.Trust;
190
275
 
276
+ /**
277
+ * Output content type.
278
+ */
191
279
  type?: 'text';
192
280
  }
193
281
 
194
- export namespace AgentRunTextOutput {
282
+ export namespace TaskRunTextOutputPublicV1 {
283
+ /**
284
+ * Trust and citation metadata for the output.
285
+ */
195
286
  export interface Trust {
287
+ /**
288
+ * Per-claim trust, keyed by callout markers in the answer text.
289
+ */
196
290
  claims: Array<Trust.Claim>;
197
291
 
198
- confidence: 'high' | 'medium' | 'low';
292
+ /**
293
+ * Overall confidence in the answer.
294
+ */
295
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
199
296
 
297
+ /**
298
+ * Why this confidence level was assigned.
299
+ */
200
300
  reasoning: string;
201
301
 
302
+ /**
303
+ * Sources consulted while producing the answer.
304
+ */
202
305
  sources: Array<Trust.Source>;
203
306
  }
204
307
 
205
308
  export namespace Trust {
309
+ /**
310
+ * Trust metadata for one claim in a prose answer, keyed by callout marker.
311
+ */
206
312
  export interface Claim {
313
+ /**
314
+ * Callout marker number referencing this claim in the answer text.
315
+ */
207
316
  callout: number;
208
317
 
318
+ /**
319
+ * Citations backing this claim.
320
+ */
209
321
  citations: Array<Claim.Citation>;
210
322
 
211
- confidence: 'high' | 'medium' | 'low';
323
+ /**
324
+ * Confidence in this claim.
325
+ */
326
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
212
327
 
328
+ /**
329
+ * Why this confidence level was assigned.
330
+ */
213
331
  reasoning: string;
214
-
215
- source?: Claim.Source | null;
216
332
  }
217
333
 
218
334
  export namespace Claim {
335
+ /**
336
+ * A citation backing a specific claim in the answer.
337
+ */
219
338
  export interface Citation {
339
+ /**
340
+ * URL of the cited page.
341
+ */
220
342
  url: string;
221
343
 
344
+ /**
345
+ * Verbatim excerpts supporting the claim.
346
+ */
222
347
  excerpts?: Array<string> | null;
223
348
 
349
+ /**
350
+ * Extract template used to read the source, when one was used.
351
+ */
224
352
  extract_template_name?: string | null;
225
353
 
226
- title?: string | null;
227
- }
228
-
229
- export interface Source {
230
- type: 'primary' | 'secondary';
231
-
232
- url: string;
233
-
234
- extract_template_name?: string | null;
235
-
354
+ /**
355
+ * What _kind_ of source this is (classified by the compress LLM), independent of
356
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
357
+ * uses "official" rather than "primary" so the two axes can never collide.
358
+ *
359
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
360
+ * question _needs_) — the two concepts overlap enough that a single enum lets
361
+ * `classify_source_importance` compare "what we got" against "what we asked for"
362
+ * directly.
363
+ */
364
+ source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
365
+
366
+ /**
367
+ * What _kind_ of source this is (classified by the compress LLM), independent of
368
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
369
+ * uses "official" rather than "primary" so the two axes can never collide.
370
+ *
371
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
372
+ * question _needs_) — the two concepts overlap enough that a single enum lets
373
+ * `classify_source_importance` compare "what we got" against "what we asked for"
374
+ * directly.
375
+ */
376
+ source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
377
+
378
+ /**
379
+ * How authoritative the source is: 'primary' or 'secondary'.
380
+ */
381
+ source_type?: 'primary' | 'secondary' | null;
382
+
383
+ /**
384
+ * Title of the cited page.
385
+ */
236
386
  title?: string | null;
237
387
  }
238
388
  }
239
389
 
390
+ /**
391
+ * A source consulted while producing the answer.
392
+ */
240
393
  export interface Source {
394
+ /**
395
+ * How authoritative the source is: 'primary' or 'secondary'.
396
+ */
241
397
  type: 'primary' | 'secondary';
242
398
 
399
+ /**
400
+ * URL of the source page.
401
+ */
243
402
  url: string;
244
403
 
404
+ /**
405
+ * Extract template used to read the source, when one was used.
406
+ */
245
407
  extract_template_name?: string | null;
246
408
 
409
+ /**
410
+ * What _kind_ of source this is (classified by the compress LLM), independent of
411
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
412
+ * uses "official" rather than "primary" so the two axes can never collide.
413
+ *
414
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
415
+ * question _needs_) — the two concepts overlap enough that a single enum lets
416
+ * `classify_source_importance` compare "what we got" against "what we asked for"
417
+ * directly.
418
+ */
419
+ source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
420
+
421
+ /**
422
+ * What _kind_ of source this is (classified by the compress LLM), independent of
423
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
424
+ * uses "official" rather than "primary" so the two axes can never collide.
425
+ *
426
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
427
+ * question _needs_) — the two concepts overlap enough that a single enum lets
428
+ * `classify_source_importance` compare "what we got" against "what we asked for"
429
+ * directly.
430
+ */
431
+ source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
432
+
433
+ /**
434
+ * Title of the source page.
435
+ */
247
436
  title?: string | null;
248
437
  }
249
438
  }
250
439
  }
251
440
 
252
- export interface AgentRunJsonOutput {
441
+ export interface TaskRunJsonOutputPublicV1 {
442
+ /**
443
+ * The final structured output.
444
+ */
253
445
  content: { [key: string]: unknown } | Array<unknown>;
254
446
 
255
- trust: AgentRunJsonOutput.Trust;
447
+ /**
448
+ * Trust and citation metadata for the output.
449
+ */
450
+ trust: TaskRunJsonOutputPublicV1.Trust;
256
451
 
452
+ /**
453
+ * Output content type.
454
+ */
257
455
  type?: 'json';
258
456
  }
259
457
 
260
- export namespace AgentRunJsonOutput {
458
+ export namespace TaskRunJsonOutputPublicV1 {
459
+ /**
460
+ * Trust and citation metadata for the output.
461
+ */
261
462
  export interface Trust {
463
+ /**
464
+ * Per-value trust, keyed by JSON path in the structured output.
465
+ */
262
466
  claims: Array<Trust.Claim>;
263
467
 
264
- confidence: 'high' | 'medium' | 'low';
468
+ /**
469
+ * Overall confidence in the answer.
470
+ */
471
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
265
472
 
473
+ /**
474
+ * Why this confidence level was assigned.
475
+ */
266
476
  reasoning: string;
267
477
 
478
+ /**
479
+ * Sources consulted while producing the answer.
480
+ */
268
481
  sources: Array<Trust.Source>;
269
482
  }
270
483
 
271
484
  export namespace Trust {
485
+ /**
486
+ * Trust metadata for one value in a structured (JSON) answer, keyed by JSON path.
487
+ */
272
488
  export interface Claim {
489
+ /**
490
+ * Citations backing this value.
491
+ */
273
492
  citations: Array<Claim.Citation>;
274
493
 
275
- confidence: 'high' | 'medium' | 'low';
494
+ /**
495
+ * Confidence in this value.
496
+ */
497
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
276
498
 
499
+ /**
500
+ * JSON path of the value in the structured output this claim refers to.
501
+ */
277
502
  path: string;
278
503
 
504
+ /**
505
+ * Why this confidence level was assigned.
506
+ */
279
507
  reasoning: string;
280
-
281
- source?: Claim.Source | null;
282
508
  }
283
509
 
284
510
  export namespace Claim {
511
+ /**
512
+ * A citation backing a specific claim in the answer.
513
+ */
285
514
  export interface Citation {
515
+ /**
516
+ * URL of the cited page.
517
+ */
286
518
  url: string;
287
519
 
520
+ /**
521
+ * Verbatim excerpts supporting the claim.
522
+ */
288
523
  excerpts?: Array<string> | null;
289
524
 
525
+ /**
526
+ * Extract template used to read the source, when one was used.
527
+ */
290
528
  extract_template_name?: string | null;
291
529
 
292
- title?: string | null;
293
- }
294
-
295
- export interface Source {
296
- type: 'primary' | 'secondary';
297
-
298
- url: string;
299
-
300
- extract_template_name?: string | null;
301
-
530
+ /**
531
+ * What _kind_ of source this is (classified by the compress LLM), independent of
532
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
533
+ * uses "official" rather than "primary" so the two axes can never collide.
534
+ *
535
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
536
+ * question _needs_) — the two concepts overlap enough that a single enum lets
537
+ * `classify_source_importance` compare "what we got" against "what we asked for"
538
+ * directly.
539
+ */
540
+ source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
541
+
542
+ /**
543
+ * What _kind_ of source this is (classified by the compress LLM), independent of
544
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
545
+ * uses "official" rather than "primary" so the two axes can never collide.
546
+ *
547
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
548
+ * question _needs_) — the two concepts overlap enough that a single enum lets
549
+ * `classify_source_importance` compare "what we got" against "what we asked for"
550
+ * directly.
551
+ */
552
+ source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
553
+
554
+ /**
555
+ * How authoritative the source is: 'primary' or 'secondary'.
556
+ */
557
+ source_type?: 'primary' | 'secondary' | null;
558
+
559
+ /**
560
+ * Title of the cited page.
561
+ */
302
562
  title?: string | null;
303
563
  }
304
564
  }
305
565
 
566
+ /**
567
+ * A source consulted while producing the answer.
568
+ */
306
569
  export interface Source {
570
+ /**
571
+ * How authoritative the source is: 'primary' or 'secondary'.
572
+ */
307
573
  type: 'primary' | 'secondary';
308
574
 
575
+ /**
576
+ * URL of the source page.
577
+ */
309
578
  url: string;
310
579
 
580
+ /**
581
+ * Extract template used to read the source, when one was used.
582
+ */
311
583
  extract_template_name?: string | null;
312
584
 
585
+ /**
586
+ * What _kind_ of source this is (classified by the compress LLM), independent of
587
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
588
+ * uses "official" rather than "primary" so the two axes can never collide.
589
+ *
590
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
591
+ * question _needs_) — the two concepts overlap enough that a single enum lets
592
+ * `classify_source_importance` compare "what we got" against "what we asked for"
593
+ * directly.
594
+ */
595
+ source_category?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
596
+
597
+ /**
598
+ * What _kind_ of source this is (classified by the compress LLM), independent of
599
+ * TrustSourceType (how authoritative it is for a specific claim). Deliberately
600
+ * uses "official" rather than "primary" so the two axes can never collide.
601
+ *
602
+ * Also doubles as the sub-question's `source_intent` (what kind of source a
603
+ * question _needs_) — the two concepts overlap enough that a single enum lets
604
+ * `classify_source_importance` compare "what we got" against "what we asked for"
605
+ * directly.
606
+ */
607
+ source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
608
+
609
+ /**
610
+ * Title of the source page.
611
+ */
313
612
  title?: string | null;
314
613
  }
315
614
  }
316
615
  }
317
616
 
617
+ /**
618
+ * Task run object with status 'completed'.
619
+ */
318
620
  export interface Run {
319
621
  /**
320
- * Run identifier.
622
+ * Run identifier, format "task*run*{uuid}".
321
623
  */
322
624
  id: string;
323
625
 
626
+ /**
627
+ * When the run was created.
628
+ */
324
629
  created_at: string;
325
630
 
326
- effort: 'quickest' | 'quick' | 'research' | 'pro' | 'max';
631
+ /**
632
+ * Effort level used for the run.
633
+ */
634
+ effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
327
635
 
328
636
  /**
329
- * Interaction ID — pass as previous_interaction_id to reuse context.
637
+ * Interaction ID.
330
638
  */
331
639
  interaction_id: string;
332
640
 
@@ -335,25 +643,41 @@ export namespace RunGetResultResponse {
335
643
  */
336
644
  is_active: boolean;
337
645
 
646
+ /**
647
+ * Current run status.
648
+ */
338
649
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
339
650
 
651
+ /**
652
+ * Web Search Agent instance this run belongs to.
653
+ */
654
+ web_search_agent_id: string;
655
+
656
+ /**
657
+ * When the run completed.
658
+ */
340
659
  completed_at?: string | null;
341
660
 
661
+ /**
662
+ * Error details when the run failed.
663
+ */
342
664
  error?: Run.Error | null;
343
665
 
666
+ /**
667
+ * Prompt submitted for the run.
668
+ */
344
669
  prompt?: string | null;
345
670
 
346
- started_at?: string | null;
347
-
348
671
  /**
349
- * Web Search Agent instance this run belongs to.
672
+ * When the run started executing.
350
673
  */
351
- web_search_agent_id?: string | null;
352
-
353
- workspace_id?: string | null;
674
+ started_at?: string | null;
354
675
  }
355
676
 
356
677
  export namespace Run {
678
+ /**
679
+ * Error details when the run failed.
680
+ */
357
681
  export interface Error {
358
682
  /**
359
683
  * Human-readable error description.
@@ -368,13 +692,22 @@ export namespace RunGetResultResponse {
368
692
  }
369
693
  }
370
694
 
371
- export interface AgentRunFailedResult {
372
- error: AgentRunFailedResult.Error;
695
+ export interface TaskRunFailedResultPublicV1 {
696
+ /**
697
+ * Structured error detail.
698
+ */
699
+ error: TaskRunFailedResultPublicV1.Error;
373
700
 
374
- run: AgentRunFailedResult.Run;
701
+ /**
702
+ * Task run object with status 'failed'.
703
+ */
704
+ run: TaskRunFailedResultPublicV1.Run;
375
705
  }
376
706
 
377
- export namespace AgentRunFailedResult {
707
+ export namespace TaskRunFailedResultPublicV1 {
708
+ /**
709
+ * Structured error detail.
710
+ */
378
711
  export interface Error {
379
712
  /**
380
713
  * Human-readable error description.
@@ -387,18 +720,27 @@ export namespace RunGetResultResponse {
387
720
  ref_id: string;
388
721
  }
389
722
 
723
+ /**
724
+ * Task run object with status 'failed'.
725
+ */
390
726
  export interface Run {
391
727
  /**
392
- * Run identifier.
728
+ * Run identifier, format "task*run*{uuid}".
393
729
  */
394
730
  id: string;
395
731
 
732
+ /**
733
+ * When the run was created.
734
+ */
396
735
  created_at: string;
397
736
 
398
- effort: 'quickest' | 'quick' | 'research' | 'pro' | 'max';
737
+ /**
738
+ * Effort level used for the run.
739
+ */
740
+ effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
399
741
 
400
742
  /**
401
- * Interaction ID — pass as previous_interaction_id to reuse context.
743
+ * Interaction ID.
402
744
  */
403
745
  interaction_id: string;
404
746
 
@@ -407,25 +749,41 @@ export namespace RunGetResultResponse {
407
749
  */
408
750
  is_active: boolean;
409
751
 
752
+ /**
753
+ * Current run status.
754
+ */
410
755
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
411
756
 
757
+ /**
758
+ * Web Search Agent instance this run belongs to.
759
+ */
760
+ web_search_agent_id: string;
761
+
762
+ /**
763
+ * When the run completed.
764
+ */
412
765
  completed_at?: string | null;
413
766
 
767
+ /**
768
+ * Error details when the run failed.
769
+ */
414
770
  error?: Run.Error | null;
415
771
 
772
+ /**
773
+ * Prompt submitted for the run.
774
+ */
416
775
  prompt?: string | null;
417
776
 
418
- started_at?: string | null;
419
-
420
777
  /**
421
- * Web Search Agent instance this run belongs to.
778
+ * When the run started executing.
422
779
  */
423
- web_search_agent_id?: string | null;
424
-
425
- workspace_id?: string | null;
780
+ started_at?: string | null;
426
781
  }
427
782
 
428
783
  export namespace Run {
784
+ /**
785
+ * Error details when the run failed.
786
+ */
429
787
  export interface Error {
430
788
  /**
431
789
  * Human-readable error description.
@@ -441,18 +799,12 @@ export namespace RunGetResultResponse {
441
799
  }
442
800
  }
443
801
 
444
- export type RunStreamEventsResponse = unknown;
445
-
446
802
  export interface RunListParams {
447
803
  limit?: number;
448
804
 
449
805
  offset?: number;
450
806
  }
451
807
 
452
- export interface RunCancelParams {
453
- agent_id: string;
454
- }
455
-
456
808
  export interface RunGetParams {
457
809
  agent_id: string;
458
810
  }
@@ -470,9 +822,7 @@ export declare namespace Runs {
470
822
  type RunListResponse as RunListResponse,
471
823
  type RunGetResponse as RunGetResponse,
472
824
  type RunGetResultResponse as RunGetResultResponse,
473
- type RunStreamEventsResponse as RunStreamEventsResponse,
474
825
  type RunListParams as RunListParams,
475
- type RunCancelParams as RunCancelParams,
476
826
  type RunGetParams as RunGetParams,
477
827
  type RunGetResultParams as RunGetResultParams,
478
828
  type RunStreamEventsParams as RunStreamEventsParams,