@nimble-way/nimble-js 0.19.0 → 1.0.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 (255) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +10 -10
  3. package/client.d.mts +10 -39
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -39
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -43
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -43
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agents/agents.d.mts +811 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +811 -0
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +67 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +62 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/index.d.mts +4 -0
  21. package/resources/agents/index.d.mts.map +1 -0
  22. package/resources/agents/index.d.ts +4 -0
  23. package/resources/agents/index.d.ts.map +1 -0
  24. package/resources/{task-agent → agents}/index.js +3 -3
  25. package/resources/agents/index.js.map +1 -0
  26. package/resources/{task-agent → agents}/index.mjs +1 -1
  27. package/resources/agents/index.mjs.map +1 -0
  28. package/resources/{task-agent → agents}/runs.d.mts +413 -128
  29. package/resources/agents/runs.d.mts.map +1 -0
  30. package/resources/{task-agent → agents}/runs.d.ts +413 -128
  31. package/resources/agents/runs.d.ts.map +1 -0
  32. package/resources/agents/runs.js +63 -0
  33. package/resources/agents/runs.js.map +1 -0
  34. package/resources/agents/runs.mjs +59 -0
  35. package/resources/agents/runs.mjs.map +1 -0
  36. package/resources/agents/templates.d.mts +258 -0
  37. package/resources/agents/templates.d.mts.map +1 -0
  38. package/resources/agents/templates.d.ts +258 -0
  39. package/resources/agents/templates.d.ts.map +1 -0
  40. package/resources/{task-agent → agents}/templates.js +5 -4
  41. package/resources/agents/templates.js.map +1 -0
  42. package/resources/agents/templates.mjs +19 -0
  43. package/resources/agents/templates.mjs.map +1 -0
  44. package/resources/agents.d.mts +2 -0
  45. package/resources/agents.d.mts.map +1 -0
  46. package/resources/agents.d.ts +2 -0
  47. package/resources/agents.d.ts.map +1 -0
  48. package/resources/{task-agent.js → agents.js} +2 -2
  49. package/resources/agents.js.map +1 -0
  50. package/resources/{task-agent.mjs → agents.mjs} +2 -2
  51. package/resources/agents.mjs.map +1 -0
  52. package/resources/batches.js +3 -3
  53. package/resources/batches.mjs +3 -3
  54. package/resources/crawl.js +4 -4
  55. package/resources/crawl.mjs +4 -4
  56. package/resources/domain-knowledge.js +1 -1
  57. package/resources/domain-knowledge.mjs +1 -1
  58. package/resources/extract/extract.d.mts +1243 -0
  59. package/resources/extract/extract.d.mts.map +1 -0
  60. package/resources/extract/extract.d.ts +1243 -0
  61. package/resources/extract/extract.d.ts.map +1 -0
  62. package/resources/extract/extract.js +52 -0
  63. package/resources/extract/extract.js.map +1 -0
  64. package/resources/extract/extract.mjs +47 -0
  65. package/resources/extract/extract.mjs.map +1 -0
  66. package/resources/extract/index.d.mts +3 -0
  67. package/resources/extract/index.d.mts.map +1 -0
  68. package/resources/extract/index.d.ts +3 -0
  69. package/resources/extract/index.d.ts.map +1 -0
  70. package/resources/extract/index.js +9 -0
  71. package/resources/extract/index.js.map +1 -0
  72. package/resources/extract/index.mjs +4 -0
  73. package/resources/extract/index.mjs.map +1 -0
  74. package/resources/extract/templates/generations.d.mts +364 -0
  75. package/resources/extract/templates/generations.d.mts.map +1 -0
  76. package/resources/extract/templates/generations.d.ts +364 -0
  77. package/resources/extract/templates/generations.d.ts.map +1 -0
  78. package/resources/extract/templates/generations.js +39 -0
  79. package/resources/extract/templates/generations.js.map +1 -0
  80. package/resources/extract/templates/generations.mjs +35 -0
  81. package/resources/extract/templates/generations.mjs.map +1 -0
  82. package/resources/extract/templates/index.d.mts +4 -0
  83. package/resources/extract/templates/index.d.mts.map +1 -0
  84. package/resources/extract/templates/index.d.ts +4 -0
  85. package/resources/extract/templates/index.d.ts.map +1 -0
  86. package/resources/extract/templates/index.js +11 -0
  87. package/resources/extract/templates/index.js.map +1 -0
  88. package/resources/extract/templates/index.mjs +5 -0
  89. package/resources/extract/templates/index.mjs.map +1 -0
  90. package/resources/{agent.d.ts → extract/templates/templates.d.mts} +475 -263
  91. package/resources/extract/templates/templates.d.mts.map +1 -0
  92. package/resources/{agent.d.mts → extract/templates/templates.d.ts} +475 -263
  93. package/resources/extract/templates/templates.d.ts.map +1 -0
  94. package/resources/extract/templates/templates.js +120 -0
  95. package/resources/extract/templates/templates.js.map +1 -0
  96. package/resources/extract/templates/templates.mjs +115 -0
  97. package/resources/extract/templates/templates.mjs.map +1 -0
  98. package/resources/extract/templates/versions.d.mts +226 -0
  99. package/resources/extract/templates/versions.d.mts.map +1 -0
  100. package/resources/extract/templates/versions.d.ts +226 -0
  101. package/resources/extract/templates/versions.d.ts.map +1 -0
  102. package/resources/extract/templates/versions.js +42 -0
  103. package/resources/extract/templates/versions.js.map +1 -0
  104. package/resources/extract/templates/versions.mjs +38 -0
  105. package/resources/extract/templates/versions.mjs.map +1 -0
  106. package/resources/extract/templates.d.mts +2 -0
  107. package/resources/extract/templates.d.mts.map +1 -0
  108. package/resources/extract/templates.d.ts +2 -0
  109. package/resources/extract/templates.d.ts.map +1 -0
  110. package/resources/extract/templates.js +6 -0
  111. package/resources/extract/templates.js.map +1 -0
  112. package/resources/extract/templates.mjs +3 -0
  113. package/resources/extract/templates.mjs.map +1 -0
  114. package/resources/extract.d.mts +2 -0
  115. package/resources/extract.d.mts.map +1 -0
  116. package/resources/extract.d.ts +2 -0
  117. package/resources/extract.d.ts.map +1 -0
  118. package/resources/extract.js +6 -0
  119. package/resources/extract.js.map +1 -0
  120. package/resources/extract.mjs +3 -0
  121. package/resources/extract.mjs.map +1 -0
  122. package/resources/fast-serp.js +1 -1
  123. package/resources/fast-serp.mjs +1 -1
  124. package/resources/index.d.mts +4 -4
  125. package/resources/index.d.mts.map +1 -1
  126. package/resources/index.d.ts +4 -4
  127. package/resources/index.d.ts.map +1 -1
  128. package/resources/index.js +5 -5
  129. package/resources/index.js.map +1 -1
  130. package/resources/index.mjs +2 -2
  131. package/resources/index.mjs.map +1 -1
  132. package/resources/jobs/index.d.mts +2 -2
  133. package/resources/jobs/index.d.mts.map +1 -1
  134. package/resources/jobs/index.d.ts +2 -2
  135. package/resources/jobs/index.d.ts.map +1 -1
  136. package/resources/jobs/index.js.map +1 -1
  137. package/resources/jobs/index.mjs.map +1 -1
  138. package/resources/jobs/jobs.d.mts +34 -90
  139. package/resources/jobs/jobs.d.mts.map +1 -1
  140. package/resources/jobs/jobs.d.ts +34 -90
  141. package/resources/jobs/jobs.d.ts.map +1 -1
  142. package/resources/jobs/jobs.js +10 -16
  143. package/resources/jobs/jobs.js.map +1 -1
  144. package/resources/jobs/jobs.mjs +11 -17
  145. package/resources/jobs/jobs.mjs.map +1 -1
  146. package/resources/jobs/runs/artifacts.d.mts +7 -17
  147. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  148. package/resources/jobs/runs/artifacts.d.ts +7 -17
  149. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  150. package/resources/jobs/runs/artifacts.js +8 -8
  151. package/resources/jobs/runs/artifacts.mjs +8 -8
  152. package/resources/jobs/runs/index.d.mts +1 -1
  153. package/resources/jobs/runs/index.d.mts.map +1 -1
  154. package/resources/jobs/runs/index.d.ts +1 -1
  155. package/resources/jobs/runs/index.d.ts.map +1 -1
  156. package/resources/jobs/runs/index.js.map +1 -1
  157. package/resources/jobs/runs/index.mjs.map +1 -1
  158. package/resources/jobs/runs/runs.d.mts +59 -21
  159. package/resources/jobs/runs/runs.d.mts.map +1 -1
  160. package/resources/jobs/runs/runs.d.ts +59 -21
  161. package/resources/jobs/runs/runs.d.ts.map +1 -1
  162. package/resources/jobs/runs/runs.js +12 -6
  163. package/resources/jobs/runs/runs.js.map +1 -1
  164. package/resources/jobs/runs/runs.mjs +12 -6
  165. package/resources/jobs/runs/runs.mjs.map +1 -1
  166. package/resources/media.js +2 -2
  167. package/resources/media.mjs +2 -2
  168. package/resources/serp.js +3 -3
  169. package/resources/serp.mjs +3 -3
  170. package/resources/tasks.js +3 -3
  171. package/resources/tasks.mjs +3 -3
  172. package/resources/top-level.d.mts +1 -1208
  173. package/resources/top-level.d.mts.map +1 -1
  174. package/resources/top-level.d.ts +1 -1208
  175. package/resources/top-level.d.ts.map +1 -1
  176. package/src/client.ts +41 -123
  177. package/src/resources/agents/agents.ts +1039 -0
  178. package/src/resources/agents/index.ts +30 -0
  179. package/src/resources/{task-agent → agents}/runs.ts +450 -154
  180. package/src/resources/agents/templates.ts +324 -0
  181. package/src/resources/{task-agent.ts → agents.ts} +1 -1
  182. package/src/resources/batches.ts +3 -3
  183. package/src/resources/crawl.ts +4 -4
  184. package/src/resources/domain-knowledge.ts +1 -1
  185. package/src/resources/extract/extract.ts +5182 -0
  186. package/src/resources/extract/index.ts +25 -0
  187. package/src/resources/extract/templates/generations.ts +435 -0
  188. package/src/resources/extract/templates/index.ts +29 -0
  189. package/src/resources/extract/templates/templates.ts +1176 -0
  190. package/src/resources/extract/templates/versions.ts +284 -0
  191. package/src/resources/extract/templates.ts +3 -0
  192. package/src/resources/extract.ts +3 -0
  193. package/src/resources/fast-serp.ts +1 -1
  194. package/src/resources/index.ts +16 -36
  195. package/src/resources/jobs/index.ts +1 -1
  196. package/src/resources/jobs/jobs.ts +49 -112
  197. package/src/resources/jobs/runs/artifacts.ts +11 -21
  198. package/src/resources/jobs/runs/index.ts +1 -0
  199. package/src/resources/jobs/runs/runs.ts +74 -24
  200. package/src/resources/media.ts +2 -2
  201. package/src/resources/serp.ts +3 -3
  202. package/src/resources/tasks.ts +3 -3
  203. package/src/resources/top-level.ts +88 -5192
  204. package/src/version.ts +1 -1
  205. package/version.d.mts +1 -1
  206. package/version.d.mts.map +1 -1
  207. package/version.d.ts +1 -1
  208. package/version.d.ts.map +1 -1
  209. package/version.js +1 -1
  210. package/version.js.map +1 -1
  211. package/version.mjs +1 -1
  212. package/version.mjs.map +1 -1
  213. package/resources/agent.d.mts.map +0 -1
  214. package/resources/agent.d.ts.map +0 -1
  215. package/resources/agent.js +0 -101
  216. package/resources/agent.js.map +0 -1
  217. package/resources/agent.mjs +0 -97
  218. package/resources/agent.mjs.map +0 -1
  219. package/resources/task-agent/index.d.mts +0 -4
  220. package/resources/task-agent/index.d.mts.map +0 -1
  221. package/resources/task-agent/index.d.ts +0 -4
  222. package/resources/task-agent/index.d.ts.map +0 -1
  223. package/resources/task-agent/index.js.map +0 -1
  224. package/resources/task-agent/index.mjs.map +0 -1
  225. package/resources/task-agent/runs.d.mts.map +0 -1
  226. package/resources/task-agent/runs.d.ts.map +0 -1
  227. package/resources/task-agent/runs.js +0 -65
  228. package/resources/task-agent/runs.js.map +0 -1
  229. package/resources/task-agent/runs.mjs +0 -61
  230. package/resources/task-agent/runs.mjs.map +0 -1
  231. package/resources/task-agent/task-agent.d.mts +0 -481
  232. package/resources/task-agent/task-agent.d.mts.map +0 -1
  233. package/resources/task-agent/task-agent.d.ts +0 -481
  234. package/resources/task-agent/task-agent.d.ts.map +0 -1
  235. package/resources/task-agent/task-agent.js +0 -68
  236. package/resources/task-agent/task-agent.js.map +0 -1
  237. package/resources/task-agent/task-agent.mjs +0 -63
  238. package/resources/task-agent/task-agent.mjs.map +0 -1
  239. package/resources/task-agent/templates.d.mts +0 -107
  240. package/resources/task-agent/templates.d.mts.map +0 -1
  241. package/resources/task-agent/templates.d.ts +0 -107
  242. package/resources/task-agent/templates.d.ts.map +0 -1
  243. package/resources/task-agent/templates.js.map +0 -1
  244. package/resources/task-agent/templates.mjs +0 -18
  245. package/resources/task-agent/templates.mjs.map +0 -1
  246. package/resources/task-agent.d.mts +0 -2
  247. package/resources/task-agent.d.mts.map +0 -1
  248. package/resources/task-agent.d.ts +0 -2
  249. package/resources/task-agent.d.ts.map +0 -1
  250. package/resources/task-agent.js.map +0 -1
  251. package/resources/task-agent.mjs.map +0 -1
  252. package/src/resources/agent.ts +0 -952
  253. package/src/resources/task-agent/index.ts +0 -32
  254. package/src/resources/task-agent/task-agent.ts +0 -746
  255. package/src/resources/task-agent/templates.ts +0 -172
@@ -3,68 +3,137 @@ import { APIPromise } from "../../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../../internal/request-options.mjs";
4
4
  export declare class Runs extends APIResource {
5
5
  /**
6
- * List runs for this instance.
6
+ * Start an agent run. The run executes asynchronously: the response returns
7
+ * immediately with status `queued`, then poll `GET .../runs/{run_id}` until
8
+ * `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set
9
+ * `enable_events: true` and follow `GET .../runs/{run_id}/events` for live
10
+ * progress.
7
11
  *
8
- * `status` accepts a lowercase `TaskRunStatusValue` (e.g. "completed") or a
9
- * comma-separated list of them (e.g. "queued,running").
12
+ * To enrich existing records instead of researching from scratch, pass them in
13
+ * `input_data`; this requires an `output_schema` (on the request or the agent).
10
14
  */
11
- list(agentID: string, query?: RunListParams | null | undefined, options?: RequestOptions): APIPromise<RunListResponse>;
15
+ create(agentID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse>;
12
16
  /**
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}`).
17
+ * List the runs of an agent, newest first, paginated with `offset`/`limit`.
17
18
  */
18
- cancel(runID: string, params: RunCancelParams, options?: RequestOptions): APIPromise<void>;
19
+ list(agentID: string, query?: RunListParams | null | undefined, options?: RequestOptions): APIPromise<RunListResponse>;
19
20
  /**
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.
21
+ * Retrieve a run's current state. Poll this endpoint after creating a run: the run
22
+ * is finished once `status` is `completed`, `failed`, or `cancelled`.
25
23
  */
26
24
  get(runID: string, params: RunGetParams, options?: RequestOptions): APIPromise<RunGetResponse>;
27
25
  /**
28
- * Fetch the result for a terminal run on this instance.
26
+ * Fetch the output of a completed run. The `output` is `type: "text"` (a prose
27
+ * answer) or `type: "json"` (structured data matching the output schema), plus
28
+ * `trust` metadata with per-claim citations for the answer.
29
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.
30
+ * While the run is still `queued` or `running` this endpoint returns `409`; if the
31
+ * run `failed` or was `cancelled` it returns `422` with the run and error details.
36
32
  */
37
- getResult(runID: string, params: RunGetResultParams, options?: RequestOptions): APIPromise<RunGetResultResponse>;
33
+ result(runID: string, params: RunResultParams, options?: RequestOptions): APIPromise<RunResultResponse>;
38
34
  /**
39
- * SSE stream of real-time progress events for a run on this instance.
35
+ * Stream a run's progress as
36
+ * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
37
+ * (`text/event-stream`). Create the run with `enable_events: true` to have events
38
+ * published. A keep-alive comment is sent every 15 seconds.
40
39
  */
41
- streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<unknown>;
40
+ streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<void>;
41
+ }
42
+ export interface RunCreateResponse {
43
+ /**
44
+ * Run identifier, format "task*run*{uuid}".
45
+ */
46
+ id: string;
47
+ /**
48
+ * When the run was created.
49
+ */
50
+ created_at: string;
51
+ /**
52
+ * Effort level used for the run.
53
+ */
54
+ effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
55
+ /**
56
+ * Interaction ID.
57
+ */
58
+ interaction_id: string;
59
+ /**
60
+ * True while status is 'queued' or 'running'.
61
+ */
62
+ is_active: boolean;
63
+ /**
64
+ * Current run status.
65
+ */
66
+ status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
67
+ /**
68
+ * Web Search Agent instance this run belongs to.
69
+ */
70
+ web_search_agent_id: string;
71
+ /**
72
+ * When the run completed.
73
+ */
74
+ completed_at?: string | null;
75
+ /**
76
+ * Error details when the run failed.
77
+ */
78
+ error?: RunCreateResponse.Error | null;
79
+ /**
80
+ * Prompt submitted for the run.
81
+ */
82
+ prompt?: string | null;
83
+ /**
84
+ * When the run started executing.
85
+ */
86
+ started_at?: string | null;
87
+ }
88
+ export declare namespace RunCreateResponse {
89
+ /**
90
+ * Error details when the run failed.
91
+ */
92
+ interface Error {
93
+ /**
94
+ * Human-readable error description.
95
+ */
96
+ message: string;
97
+ /**
98
+ * Reference ID (equals the run id).
99
+ */
100
+ ref_id: string;
101
+ }
42
102
  }
43
- /**
44
- * Paginated list of task runs for GET /tasks/runs.
45
- */
46
103
  export interface RunListResponse {
104
+ /**
105
+ * Items returned in this page.
106
+ */
47
107
  items: Array<RunListResponse.Item>;
108
+ /**
109
+ * Maximum number of items returned.
110
+ */
111
+ limit: number;
112
+ /**
113
+ * Number of items skipped before this page.
114
+ */
115
+ offset: number;
116
+ /**
117
+ * Total number of items matching the query.
118
+ */
48
119
  total: number;
49
- limit?: number;
50
- offset?: number;
51
120
  }
52
121
  export declare namespace RunListResponse {
53
- /**
54
- * Task run status returned by list/create/get endpoints.
55
- */
56
122
  interface Item {
57
123
  /**
58
124
  * Run identifier, format "task*run*{uuid}".
59
125
  */
60
126
  id: string;
127
+ /**
128
+ * When the run was created.
129
+ */
61
130
  created_at: string;
62
131
  /**
63
- * Canonical effort tier names for the research graph.
132
+ * Effort level used for the run.
64
133
  */
65
134
  effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
66
135
  /**
67
- * Interaction ID — pass as previous_interaction_id to reuse context.
136
+ * Interaction ID.
68
137
  */
69
138
  interaction_id: string;
70
139
  /**
@@ -72,31 +141,33 @@ export declare namespace RunListResponse {
72
141
  */
73
142
  is_active: boolean;
74
143
  /**
75
- * Lowercase status values used in API responses (distinct from the DB-level
76
- * TaskRunStatus enum).
144
+ * Current run status.
77
145
  */
78
146
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
79
147
  /**
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}.
148
+ * Web Search Agent instance this run belongs to.
83
149
  */
84
150
  web_search_agent_id: string;
151
+ /**
152
+ * When the run completed.
153
+ */
85
154
  completed_at?: string | null;
86
155
  /**
87
- * Error detail for a failed run.
156
+ * Error details when the run failed.
88
157
  */
89
158
  error?: Item.Error | null;
90
159
  /**
91
- * Original user prompt before enrichment. Populated for Web Search Agent runs.
160
+ * Prompt submitted for the run.
92
161
  */
93
162
  prompt?: string | null;
163
+ /**
164
+ * When the run started executing.
165
+ */
94
166
  started_at?: string | null;
95
- workspace_id?: string | null;
96
167
  }
97
168
  namespace Item {
98
169
  /**
99
- * Error detail for a failed run.
170
+ * Error details when the run failed.
100
171
  */
101
172
  interface Error {
102
173
  /**
@@ -110,21 +181,21 @@ export declare namespace RunListResponse {
110
181
  }
111
182
  }
112
183
  }
113
- /**
114
- * Task run status returned by list/create/get endpoints.
115
- */
116
184
  export interface RunGetResponse {
117
185
  /**
118
186
  * Run identifier, format "task*run*{uuid}".
119
187
  */
120
188
  id: string;
189
+ /**
190
+ * When the run was created.
191
+ */
121
192
  created_at: string;
122
193
  /**
123
- * Canonical effort tier names for the research graph.
194
+ * Effort level used for the run.
124
195
  */
125
196
  effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
126
197
  /**
127
- * Interaction ID — pass as previous_interaction_id to reuse context.
198
+ * Interaction ID.
128
199
  */
129
200
  interaction_id: string;
130
201
  /**
@@ -132,31 +203,33 @@ export interface RunGetResponse {
132
203
  */
133
204
  is_active: boolean;
134
205
  /**
135
- * Lowercase status values used in API responses (distinct from the DB-level
136
- * TaskRunStatus enum).
206
+ * Current run status.
137
207
  */
138
208
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
139
209
  /**
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}.
210
+ * Web Search Agent instance this run belongs to.
143
211
  */
144
212
  web_search_agent_id: string;
213
+ /**
214
+ * When the run completed.
215
+ */
145
216
  completed_at?: string | null;
146
217
  /**
147
- * Error detail for a failed run.
218
+ * Error details when the run failed.
148
219
  */
149
220
  error?: RunGetResponse.Error | null;
150
221
  /**
151
- * Original user prompt before enrichment. Populated for Web Search Agent runs.
222
+ * Prompt submitted for the run.
152
223
  */
153
224
  prompt?: string | null;
225
+ /**
226
+ * When the run started executing.
227
+ */
154
228
  started_at?: string | null;
155
- workspace_id?: string | null;
156
229
  }
157
230
  export declare namespace RunGetResponse {
158
231
  /**
159
- * Error detail for a failed run.
232
+ * Error details when the run failed.
160
233
  */
161
234
  interface Error {
162
235
  /**
@@ -169,54 +242,93 @@ export declare namespace RunGetResponse {
169
242
  ref_id: string;
170
243
  }
171
244
  }
172
- /**
173
- * Response for GET /tasks/runs/{run_id}/result — status 'completed'.
174
- */
175
- export type RunGetResultResponse = RunGetResultResponse.TaskRunResult | RunGetResultResponse.TaskRunFailedResult;
176
- export declare namespace RunGetResultResponse {
177
- /**
178
- * Response for GET /tasks/runs/{run_id}/result — status 'completed'.
179
- */
180
- interface TaskRunResult {
245
+ export type RunResultResponse = RunResultResponse.TaskRunResultPublicV2 | RunResultResponse.TaskRunFailedResultPublicV2;
246
+ export declare namespace RunResultResponse {
247
+ interface TaskRunResultPublicV2 {
181
248
  /**
182
249
  * Output from the completed task.
183
250
  */
184
- output: TaskRunResult.TaskRunTextOutput | TaskRunResult.TaskRunJsonOutput;
251
+ output: TaskRunResultPublicV2.TaskRunTextOutputPublicV2 | TaskRunResultPublicV2.TaskRunJsonOutputPublicV2;
185
252
  /**
186
253
  * Task run object with status 'completed'.
187
254
  */
188
- run: TaskRunResult.Run;
255
+ run: TaskRunResultPublicV2.Run;
189
256
  }
190
- namespace TaskRunResult {
191
- /**
192
- * Text output from a completed task.
193
- */
194
- interface TaskRunTextOutput {
257
+ namespace TaskRunResultPublicV2 {
258
+ interface TaskRunTextOutputPublicV2 {
195
259
  /**
196
260
  * The final prose answer.
197
261
  */
198
262
  content: string;
199
- trust: TaskRunTextOutput.Trust;
263
+ /**
264
+ * Trust and citation metadata for the output.
265
+ */
266
+ trust: TaskRunTextOutputPublicV2.Trust;
267
+ /**
268
+ * Output content type.
269
+ */
200
270
  type?: 'text';
201
271
  }
202
- namespace TaskRunTextOutput {
272
+ namespace TaskRunTextOutputPublicV2 {
273
+ /**
274
+ * Trust and citation metadata for the output.
275
+ */
203
276
  interface Trust {
277
+ /**
278
+ * Per-claim trust, keyed by callout markers in the answer text.
279
+ */
204
280
  claims: Array<Trust.Claim>;
205
- confidence: 'high' | 'medium' | 'low';
281
+ /**
282
+ * Overall confidence in the answer.
283
+ */
284
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
285
+ /**
286
+ * Why this confidence level was assigned.
287
+ */
206
288
  reasoning: string;
289
+ /**
290
+ * Sources consulted while producing the answer.
291
+ */
207
292
  sources: Array<Trust.Source>;
208
293
  }
209
294
  namespace Trust {
295
+ /**
296
+ * Trust metadata for one claim in a prose answer, keyed by callout marker.
297
+ */
210
298
  interface Claim {
299
+ /**
300
+ * Callout marker number referencing this claim in the answer text.
301
+ */
211
302
  callout: number;
303
+ /**
304
+ * Citations backing this claim.
305
+ */
212
306
  citations: Array<Claim.Citation>;
213
- confidence: 'high' | 'medium' | 'low';
307
+ /**
308
+ * Confidence in this claim.
309
+ */
310
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
311
+ /**
312
+ * Why this confidence level was assigned.
313
+ */
214
314
  reasoning: string;
215
315
  }
216
316
  namespace Claim {
317
+ /**
318
+ * A citation backing a specific claim in the answer.
319
+ */
217
320
  interface Citation {
321
+ /**
322
+ * URL of the cited page.
323
+ */
218
324
  url: string;
325
+ /**
326
+ * Verbatim excerpts supporting the claim.
327
+ */
219
328
  excerpts?: Array<string> | null;
329
+ /**
330
+ * Extract template used to read the source, when one was used.
331
+ */
220
332
  extract_template_name?: string | null;
221
333
  /**
222
334
  * What _kind_ of source this is (classified by the compress LLM), independent of
@@ -240,13 +352,31 @@ export declare namespace RunGetResultResponse {
240
352
  * directly.
241
353
  */
242
354
  source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
355
+ /**
356
+ * How authoritative the source is: 'primary' or 'secondary'.
357
+ */
243
358
  source_type?: 'primary' | 'secondary' | null;
359
+ /**
360
+ * Title of the cited page.
361
+ */
244
362
  title?: string | null;
245
363
  }
246
364
  }
365
+ /**
366
+ * A source consulted while producing the answer.
367
+ */
247
368
  interface Source {
369
+ /**
370
+ * How authoritative the source is: 'primary' or 'secondary'.
371
+ */
248
372
  type: 'primary' | 'secondary';
373
+ /**
374
+ * URL of the source page.
375
+ */
249
376
  url: string;
377
+ /**
378
+ * Extract template used to read the source, when one was used.
379
+ */
250
380
  extract_template_name?: string | null;
251
381
  /**
252
382
  * What _kind_ of source this is (classified by the compress LLM), independent of
@@ -270,43 +400,89 @@ export declare namespace RunGetResultResponse {
270
400
  * directly.
271
401
  */
272
402
  source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
403
+ /**
404
+ * Title of the source page.
405
+ */
273
406
  title?: string | null;
274
407
  }
275
408
  }
276
409
  }
277
- /**
278
- * Structured JSON output from a completed task, produced when
279
- * task_spec.output_schema.type is 'json'.
280
- */
281
- interface TaskRunJsonOutput {
410
+ interface TaskRunJsonOutputPublicV2 {
282
411
  /**
283
- * Data conforming to the caller-supplied JSON schema. A dict for object schemas; a
284
- * list for array schemas.
412
+ * The final structured output.
285
413
  */
286
414
  content: {
287
415
  [key: string]: unknown;
288
416
  } | Array<unknown>;
289
- trust: TaskRunJsonOutput.Trust;
417
+ /**
418
+ * Trust and citation metadata for the output.
419
+ */
420
+ trust: TaskRunJsonOutputPublicV2.Trust;
421
+ /**
422
+ * Output content type.
423
+ */
290
424
  type?: 'json';
291
425
  }
292
- namespace TaskRunJsonOutput {
426
+ namespace TaskRunJsonOutputPublicV2 {
427
+ /**
428
+ * Trust and citation metadata for the output.
429
+ */
293
430
  interface Trust {
431
+ /**
432
+ * Per-value trust, keyed by JSON path in the structured output.
433
+ */
294
434
  claims: Array<Trust.Claim>;
295
- confidence: 'high' | 'medium' | 'low';
435
+ /**
436
+ * Overall confidence in the answer.
437
+ */
438
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
439
+ /**
440
+ * Why this confidence level was assigned.
441
+ */
296
442
  reasoning: string;
443
+ /**
444
+ * Sources consulted while producing the answer.
445
+ */
297
446
  sources: Array<Trust.Source>;
298
447
  }
299
448
  namespace Trust {
449
+ /**
450
+ * Trust metadata for one value in a structured (JSON) answer, keyed by JSON path.
451
+ */
300
452
  interface Claim {
453
+ /**
454
+ * Citations backing this value.
455
+ */
301
456
  citations: Array<Claim.Citation>;
302
- confidence: 'high' | 'medium' | 'low';
457
+ /**
458
+ * Confidence in this value.
459
+ */
460
+ confidence: 'high' | 'medium' | 'low' | 'pre_existing';
461
+ /**
462
+ * JSON path of the value in the structured output this claim refers to.
463
+ */
303
464
  path: string;
465
+ /**
466
+ * Why this confidence level was assigned.
467
+ */
304
468
  reasoning: string;
305
469
  }
306
470
  namespace Claim {
471
+ /**
472
+ * A citation backing a specific claim in the answer.
473
+ */
307
474
  interface Citation {
475
+ /**
476
+ * URL of the cited page.
477
+ */
308
478
  url: string;
479
+ /**
480
+ * Verbatim excerpts supporting the claim.
481
+ */
309
482
  excerpts?: Array<string> | null;
483
+ /**
484
+ * Extract template used to read the source, when one was used.
485
+ */
310
486
  extract_template_name?: string | null;
311
487
  /**
312
488
  * What _kind_ of source this is (classified by the compress LLM), independent of
@@ -330,13 +506,31 @@ export declare namespace RunGetResultResponse {
330
506
  * directly.
331
507
  */
332
508
  source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
509
+ /**
510
+ * How authoritative the source is: 'primary' or 'secondary'.
511
+ */
333
512
  source_type?: 'primary' | 'secondary' | null;
513
+ /**
514
+ * Title of the cited page.
515
+ */
334
516
  title?: string | null;
335
517
  }
336
518
  }
519
+ /**
520
+ * A source consulted while producing the answer.
521
+ */
337
522
  interface Source {
523
+ /**
524
+ * How authoritative the source is: 'primary' or 'secondary'.
525
+ */
338
526
  type: 'primary' | 'secondary';
527
+ /**
528
+ * URL of the source page.
529
+ */
339
530
  url: string;
531
+ /**
532
+ * Extract template used to read the source, when one was used.
533
+ */
340
534
  extract_template_name?: string | null;
341
535
  /**
342
536
  * What _kind_ of source this is (classified by the compress LLM), independent of
@@ -360,6 +554,9 @@ export declare namespace RunGetResultResponse {
360
554
  * directly.
361
555
  */
362
556
  source_intent?: 'official' | 'news' | 'social' | 'academic' | 'aggregator' | 'other' | null;
557
+ /**
558
+ * Title of the source page.
559
+ */
363
560
  title?: string | null;
364
561
  }
365
562
  }
@@ -372,13 +569,16 @@ export declare namespace RunGetResultResponse {
372
569
  * Run identifier, format "task*run*{uuid}".
373
570
  */
374
571
  id: string;
572
+ /**
573
+ * When the run was created.
574
+ */
375
575
  created_at: string;
376
576
  /**
377
- * Canonical effort tier names for the research graph.
577
+ * Effort level used for the run.
378
578
  */
379
579
  effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
380
580
  /**
381
- * Interaction ID — pass as previous_interaction_id to reuse context.
581
+ * Interaction ID.
382
582
  */
383
583
  interaction_id: string;
384
584
  /**
@@ -386,31 +586,33 @@ export declare namespace RunGetResultResponse {
386
586
  */
387
587
  is_active: boolean;
388
588
  /**
389
- * Lowercase status values used in API responses (distinct from the DB-level
390
- * TaskRunStatus enum).
589
+ * Current run status.
391
590
  */
392
591
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
393
592
  /**
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}.
593
+ * Web Search Agent instance this run belongs to.
397
594
  */
398
595
  web_search_agent_id: string;
596
+ /**
597
+ * When the run completed.
598
+ */
399
599
  completed_at?: string | null;
400
600
  /**
401
- * Error detail for a failed run.
601
+ * Error details when the run failed.
402
602
  */
403
603
  error?: Run.Error | null;
404
604
  /**
405
- * Original user prompt before enrichment. Populated for Web Search Agent runs.
605
+ * Prompt submitted for the run.
406
606
  */
407
607
  prompt?: string | null;
608
+ /**
609
+ * When the run started executing.
610
+ */
408
611
  started_at?: string | null;
409
- workspace_id?: string | null;
410
612
  }
411
613
  namespace Run {
412
614
  /**
413
- * Error detail for a failed run.
615
+ * Error details when the run failed.
414
616
  */
415
617
  interface Error {
416
618
  /**
@@ -424,23 +626,17 @@ export declare namespace RunGetResultResponse {
424
626
  }
425
627
  }
426
628
  }
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 {
629
+ interface TaskRunFailedResultPublicV2 {
434
630
  /**
435
631
  * Structured error detail.
436
632
  */
437
- error: TaskRunFailedResult.Error;
633
+ error: TaskRunFailedResultPublicV2.Error;
438
634
  /**
439
635
  * Task run object with status 'failed'.
440
636
  */
441
- run: TaskRunFailedResult.Run;
637
+ run: TaskRunFailedResultPublicV2.Run;
442
638
  }
443
- namespace TaskRunFailedResult {
639
+ namespace TaskRunFailedResultPublicV2 {
444
640
  /**
445
641
  * Structured error detail.
446
642
  */
@@ -462,13 +658,16 @@ export declare namespace RunGetResultResponse {
462
658
  * Run identifier, format "task*run*{uuid}".
463
659
  */
464
660
  id: string;
661
+ /**
662
+ * When the run was created.
663
+ */
465
664
  created_at: string;
466
665
  /**
467
- * Canonical effort tier names for the research graph.
666
+ * Effort level used for the run.
468
667
  */
469
668
  effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
470
669
  /**
471
- * Interaction ID — pass as previous_interaction_id to reuse context.
670
+ * Interaction ID.
472
671
  */
473
672
  interaction_id: string;
474
673
  /**
@@ -476,31 +675,33 @@ export declare namespace RunGetResultResponse {
476
675
  */
477
676
  is_active: boolean;
478
677
  /**
479
- * Lowercase status values used in API responses (distinct from the DB-level
480
- * TaskRunStatus enum).
678
+ * Current run status.
481
679
  */
482
680
  status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
483
681
  /**
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}.
682
+ * Web Search Agent instance this run belongs to.
487
683
  */
488
684
  web_search_agent_id: string;
685
+ /**
686
+ * When the run completed.
687
+ */
489
688
  completed_at?: string | null;
490
689
  /**
491
- * Error detail for a failed run.
690
+ * Error details when the run failed.
492
691
  */
493
692
  error?: Run.Error | null;
494
693
  /**
495
- * Original user prompt before enrichment. Populated for Web Search Agent runs.
694
+ * Prompt submitted for the run.
496
695
  */
497
696
  prompt?: string | null;
697
+ /**
698
+ * When the run started executing.
699
+ */
498
700
  started_at?: string | null;
499
- workspace_id?: string | null;
500
701
  }
501
702
  namespace Run {
502
703
  /**
503
- * Error detail for a failed run.
704
+ * Error details when the run failed.
504
705
  */
505
706
  interface Error {
506
707
  /**
@@ -515,26 +716,110 @@ export declare namespace RunGetResultResponse {
515
716
  }
516
717
  }
517
718
  }
518
- export type RunStreamEventsResponse = unknown;
719
+ export interface RunCreateParams {
720
+ /**
721
+ * User prompt or task instructions for the run.
722
+ */
723
+ input: string;
724
+ /**
725
+ * Canonical effort tier names for the research graph.
726
+ */
727
+ effort?: 'low' | 'medium' | 'high' | 'x-high' | 'max' | null;
728
+ /**
729
+ * Whether to stream run events when supported.
730
+ */
731
+ enable_events?: boolean;
732
+ /**
733
+ * Existing records to ENRICH: a list of partial rows, or a single object,
734
+ * mirroring output_schema's shape.
735
+ */
736
+ input_data?: Array<{
737
+ [key: string]: unknown;
738
+ }> | {
739
+ [key: string]: unknown;
740
+ } | null;
741
+ /**
742
+ * JSON schema overriding the agent's default structured output for this run.
743
+ */
744
+ output_schema?: {
745
+ [key: string]: unknown;
746
+ } | null;
747
+ /**
748
+ * Previous interaction identifier used to continue a conversation.
749
+ */
750
+ previous_interaction_id?: string | null;
751
+ /**
752
+ * Source guidance overriding the agent default.
753
+ */
754
+ sources?: RunCreateParams.Sources | null;
755
+ }
756
+ export declare namespace RunCreateParams {
757
+ /**
758
+ * Source guidance overriding the agent default.
759
+ */
760
+ interface Sources {
761
+ /**
762
+ * Source groups the agent is allowed to use.
763
+ */
764
+ allow?: Array<Sources.Allow>;
765
+ /**
766
+ * Free-text guidance describing sources or domains to avoid.
767
+ */
768
+ avoid?: string | null;
769
+ /**
770
+ * Source groups the agent should not use.
771
+ */
772
+ block?: Array<Sources.Block>;
773
+ /**
774
+ * Free-text guidance describing sources or domains to prioritize.
775
+ */
776
+ prioritize?: string | null;
777
+ }
778
+ namespace Sources {
779
+ interface Allow {
780
+ /**
781
+ * Domains included in this source group.
782
+ */
783
+ domains: Array<string>;
784
+ /**
785
+ * Source group title.
786
+ */
787
+ title: string;
788
+ /**
789
+ * Zero-based source group position.
790
+ */
791
+ order?: number;
792
+ }
793
+ interface Block {
794
+ /**
795
+ * Domains included in this source group.
796
+ */
797
+ domains: Array<string>;
798
+ /**
799
+ * Source group title.
800
+ */
801
+ title: string;
802
+ /**
803
+ * Zero-based source group position.
804
+ */
805
+ order?: number;
806
+ }
807
+ }
808
+ }
519
809
  export interface RunListParams {
520
810
  limit?: number;
521
811
  offset?: number;
522
- q?: string | null;
523
- status?: string | null;
524
- }
525
- export interface RunCancelParams {
526
- agent_id: string;
527
812
  }
528
813
  export interface RunGetParams {
529
814
  agent_id: string;
530
815
  }
531
- export interface RunGetResultParams {
816
+ export interface RunResultParams {
532
817
  agent_id: string;
533
818
  }
534
819
  export interface RunStreamEventsParams {
535
820
  agent_id: string;
536
821
  }
537
822
  export declare namespace Runs {
538
- export { type RunListResponse as RunListResponse, type RunGetResponse as RunGetResponse, type RunGetResultResponse as RunGetResultResponse, type RunStreamEventsResponse as RunStreamEventsResponse, type RunListParams as RunListParams, type RunCancelParams as RunCancelParams, type RunGetParams as RunGetParams, type RunGetResultParams as RunGetResultParams, type RunStreamEventsParams as RunStreamEventsParams, };
823
+ export { type RunCreateResponse as RunCreateResponse, type RunListResponse as RunListResponse, type RunGetResponse as RunGetResponse, type RunResultResponse as RunResultResponse, type RunCreateParams as RunCreateParams, type RunListParams as RunListParams, type RunGetParams as RunGetParams, type RunResultParams as RunResultParams, type RunStreamEventsParams as RunStreamEventsParams, };
539
824
  }
540
825
  //# sourceMappingURL=runs.d.mts.map