parallel-web 0.3.1 → 0.4.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 (121) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +46 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +46 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +66 -19
  8. package/client.js.map +1 -1
  9. package/client.mjs +66 -19
  10. package/client.mjs.map +1 -1
  11. package/core/streaming.js.map +1 -1
  12. package/core/streaming.mjs.map +1 -1
  13. package/internal/parse.d.mts.map +1 -1
  14. package/internal/parse.d.ts.map +1 -1
  15. package/internal/parse.js +5 -0
  16. package/internal/parse.js.map +1 -1
  17. package/internal/parse.mjs +5 -0
  18. package/internal/parse.mjs.map +1 -1
  19. package/internal/utils/env.js +2 -2
  20. package/internal/utils/env.js.map +1 -1
  21. package/internal/utils/env.mjs +2 -2
  22. package/internal/utils/env.mjs.map +1 -1
  23. package/internal/utils/query.d.mts +5 -0
  24. package/internal/utils/query.d.mts.map +1 -0
  25. package/internal/utils/query.d.ts +5 -0
  26. package/internal/utils/query.d.ts.map +1 -0
  27. package/internal/utils/query.js +23 -0
  28. package/internal/utils/query.js.map +1 -0
  29. package/internal/utils/query.mjs +20 -0
  30. package/internal/utils/query.mjs.map +1 -0
  31. package/internal/utils.d.mts +1 -0
  32. package/internal/utils.d.ts +1 -0
  33. package/internal/utils.js +1 -0
  34. package/internal/utils.js.map +1 -1
  35. package/internal/utils.mjs +1 -0
  36. package/package.json +12 -1
  37. package/resources/beta/beta.d.mts +52 -72
  38. package/resources/beta/beta.d.mts.map +1 -1
  39. package/resources/beta/beta.d.ts +52 -72
  40. package/resources/beta/beta.d.ts.map +1 -1
  41. package/resources/beta/beta.js +10 -4
  42. package/resources/beta/beta.js.map +1 -1
  43. package/resources/beta/beta.mjs +10 -4
  44. package/resources/beta/beta.mjs.map +1 -1
  45. package/resources/beta/findall.d.mts +171 -9
  46. package/resources/beta/findall.d.mts.map +1 -1
  47. package/resources/beta/findall.d.ts +171 -9
  48. package/resources/beta/findall.d.ts.map +1 -1
  49. package/resources/beta/findall.js +111 -0
  50. package/resources/beta/findall.js.map +1 -1
  51. package/resources/beta/findall.mjs +111 -0
  52. package/resources/beta/findall.mjs.map +1 -1
  53. package/resources/beta/index.d.mts +2 -2
  54. package/resources/beta/index.d.mts.map +1 -1
  55. package/resources/beta/index.d.ts +2 -2
  56. package/resources/beta/index.d.ts.map +1 -1
  57. package/resources/beta/index.js.map +1 -1
  58. package/resources/beta/index.mjs.map +1 -1
  59. package/resources/beta/task-group.d.mts +60 -4
  60. package/resources/beta/task-group.d.mts.map +1 -1
  61. package/resources/beta/task-group.d.ts +60 -4
  62. package/resources/beta/task-group.d.ts.map +1 -1
  63. package/resources/beta/task-group.js +52 -1
  64. package/resources/beta/task-group.js.map +1 -1
  65. package/resources/beta/task-group.mjs +52 -1
  66. package/resources/beta/task-group.mjs.map +1 -1
  67. package/resources/beta/task-run.d.mts +85 -266
  68. package/resources/beta/task-run.d.mts.map +1 -1
  69. package/resources/beta/task-run.d.ts +85 -266
  70. package/resources/beta/task-run.d.ts.map +1 -1
  71. package/resources/beta/task-run.js +21 -2
  72. package/resources/beta/task-run.js.map +1 -1
  73. package/resources/beta/task-run.mjs +21 -2
  74. package/resources/beta/task-run.mjs.map +1 -1
  75. package/resources/index.d.mts +2 -1
  76. package/resources/index.d.mts.map +1 -1
  77. package/resources/index.d.ts +2 -1
  78. package/resources/index.d.ts.map +1 -1
  79. package/resources/index.js.map +1 -1
  80. package/resources/index.mjs.map +1 -1
  81. package/resources/shared.d.mts +4 -2
  82. package/resources/shared.d.mts.map +1 -1
  83. package/resources/shared.d.ts +4 -2
  84. package/resources/shared.d.ts.map +1 -1
  85. package/resources/task-run.d.mts +324 -29
  86. package/resources/task-run.d.mts.map +1 -1
  87. package/resources/task-run.d.ts +324 -29
  88. package/resources/task-run.d.ts.map +1 -1
  89. package/resources/task-run.js +71 -4
  90. package/resources/task-run.js.map +1 -1
  91. package/resources/task-run.mjs +71 -4
  92. package/resources/task-run.mjs.map +1 -1
  93. package/resources/top-level.d.mts +317 -0
  94. package/resources/top-level.d.mts.map +1 -0
  95. package/resources/top-level.d.ts +317 -0
  96. package/resources/top-level.d.ts.map +1 -0
  97. package/resources/top-level.js +4 -0
  98. package/resources/top-level.js.map +1 -0
  99. package/resources/top-level.mjs +3 -0
  100. package/resources/top-level.mjs.map +1 -0
  101. package/src/client.ts +118 -24
  102. package/src/core/streaming.ts +2 -2
  103. package/src/internal/parse.ts +6 -0
  104. package/src/internal/utils/env.ts +2 -2
  105. package/src/internal/utils/query.ts +23 -0
  106. package/src/internal/utils.ts +1 -0
  107. package/src/resources/beta/api.md +87 -0
  108. package/src/resources/beta/beta.ts +67 -84
  109. package/src/resources/beta/findall.ts +191 -7
  110. package/src/resources/beta/index.ts +7 -4
  111. package/src/resources/beta/task-group.ts +64 -6
  112. package/src/resources/beta/task-run.ts +103 -300
  113. package/src/resources/index.ts +20 -0
  114. package/src/resources/shared.ts +4 -2
  115. package/src/resources/task-run.ts +410 -31
  116. package/src/resources/top-level.ts +385 -0
  117. package/src/version.ts +1 -1
  118. package/version.d.mts +1 -1
  119. package/version.d.ts +1 -1
  120. package/version.js +1 -1
  121. package/version.mjs +1 -1
@@ -1,7 +1,20 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import * as Shared from "./shared.js";
3
+ import * as BetaTaskRunAPI from "./beta/task-run.js";
3
4
  import { APIPromise } from "../core/api-promise.js";
5
+ import { Stream } from "../core/streaming.js";
4
6
  import { RequestOptions } from "../internal/request-options.js";
7
+ /**
8
+ * The Task API executes web research and extraction tasks. Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
9
+ * - Output metadata: citations, excerpts, reasoning, and confidence per field
10
+ *
11
+ * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
12
+ * - Submit hundreds or thousands of Tasks as a single group
13
+ * - Observe group progress and receive results as they complete
14
+ * - Real-time updates via Server-Sent Events (SSE)
15
+ * - Add tasks to an existing group while it is running
16
+ * - Group-level retry and error aggregation
17
+ */
5
18
  export declare class TaskRun extends APIResource {
6
19
  /**
7
20
  * Initiates a task run.
@@ -9,18 +22,51 @@ export declare class TaskRun extends APIResource {
9
22
  * Returns immediately with a run object in status 'queued'.
10
23
  *
11
24
  * Beta features can be enabled by setting the 'parallel-beta' header.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const taskRun = await client.taskRun.create({
29
+ * input: 'What was the GDP of France in 2023?',
30
+ * processor: 'base',
31
+ * });
32
+ * ```
12
33
  */
13
- create(body: TaskRunCreateParams, options?: RequestOptions): APIPromise<TaskRun>;
34
+ create(params: TaskRunCreateParams, options?: RequestOptions): APIPromise<TaskRun>;
14
35
  /**
15
36
  * Retrieves run status by run_id.
16
37
  *
17
38
  * The run result is available from the `/result` endpoint.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const taskRun = await client.taskRun.retrieve('run_id');
43
+ * ```
18
44
  */
19
45
  retrieve(runID: string, options?: RequestOptions): APIPromise<TaskRun>;
46
+ /**
47
+ * Streams events for a task run.
48
+ *
49
+ * Returns a stream of events showing progress updates and state changes for the
50
+ * task run.
51
+ *
52
+ * For task runs that did not have enable_events set to true during creation, the
53
+ * frequency of events will be reduced.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.taskRun.events('run_id');
58
+ * ```
59
+ */
60
+ events(runID: string, options?: RequestOptions): APIPromise<Stream<TaskRunEventsResponse>>;
20
61
  /**
21
62
  * Retrieves a run result by run_id, blocking until the run is completed.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const taskRunResult = await client.taskRun.result('run_id');
67
+ * ```
22
68
  */
23
- result(runID: string, query?: TaskRunResultParams | null | undefined, options?: RequestOptions): APIPromise<TaskRunResult>;
69
+ result(runID: string, params?: TaskRunResultParams | null | undefined, options?: RequestOptions): APIPromise<TaskRunResult>;
24
70
  }
25
71
  /**
26
72
  * Auto schema for a task input or output.
@@ -49,6 +95,19 @@ export interface Citation {
49
95
  */
50
96
  title?: string | null;
51
97
  }
98
+ /**
99
+ * Event indicating an error.
100
+ */
101
+ export interface ErrorEvent {
102
+ /**
103
+ * Error.
104
+ */
105
+ error: Shared.ErrorObject;
106
+ /**
107
+ * Event type; always 'error'.
108
+ */
109
+ type: 'error';
110
+ }
52
111
  /**
53
112
  * Citations and reasoning supporting one field of a task output.
54
113
  */
@@ -86,6 +145,62 @@ export interface JsonSchema {
86
145
  */
87
146
  type?: 'json';
88
147
  }
148
+ /**
149
+ * MCP server configuration.
150
+ */
151
+ export interface McpServer {
152
+ /**
153
+ * Name of the MCP server.
154
+ */
155
+ name: string;
156
+ /**
157
+ * URL of the MCP server.
158
+ */
159
+ url: string;
160
+ /**
161
+ * List of allowed tools for the MCP server.
162
+ */
163
+ allowed_tools?: Array<string> | null;
164
+ /**
165
+ * Headers for the MCP server.
166
+ */
167
+ headers?: {
168
+ [key: string]: string;
169
+ } | null;
170
+ /**
171
+ * Type of MCP server being configured. Always `url`.
172
+ */
173
+ type?: 'url';
174
+ }
175
+ /**
176
+ * Result of an MCP tool call.
177
+ */
178
+ export interface McpToolCall {
179
+ /**
180
+ * Arguments used to call the MCP tool.
181
+ */
182
+ arguments: string;
183
+ /**
184
+ * Name of the MCP server.
185
+ */
186
+ server_name: string;
187
+ /**
188
+ * Identifier for the tool call.
189
+ */
190
+ tool_call_id: string;
191
+ /**
192
+ * Name of the tool being called.
193
+ */
194
+ tool_name: string;
195
+ /**
196
+ * Output received from the tool call, if successful.
197
+ */
198
+ content?: string | null;
199
+ /**
200
+ * Error message if the tool call failed.
201
+ */
202
+ error?: string | null;
203
+ }
89
204
  /**
90
205
  * Request to run a task.
91
206
  */
@@ -100,6 +215,23 @@ export interface RunInput {
100
215
  * Processor to use for the task.
101
216
  */
102
217
  processor: string;
218
+ /**
219
+ * Advanced search configuration for a task run.
220
+ */
221
+ advanced_settings?: RunInput.AdvancedSettings | null;
222
+ /**
223
+ * Controls tracking of task run execution progress. When set to true, progress
224
+ * events are recorded and can be accessed via the
225
+ * [Task Run events](https://docs.parallel.ai/api-reference) endpoint. When false,
226
+ * no progress events are tracked. Note that progress tracking cannot be enabled
227
+ * after a run has been created. The flag is set to true by default for premium
228
+ * processors (pro and above).
229
+ */
230
+ enable_events?: boolean | null;
231
+ /**
232
+ * Optional list of MCP servers to use for the run.
233
+ */
234
+ mcp_servers?: Array<McpServer> | null;
103
235
  /**
104
236
  * User-provided metadata stored with the run. Keys and values must be strings with
105
237
  * a maximum length of 16 and 512 characters respectively.
@@ -107,6 +239,10 @@ export interface RunInput {
107
239
  metadata?: {
108
240
  [key: string]: string | number | boolean;
109
241
  } | null;
242
+ /**
243
+ * Interaction ID to use as context for this request.
244
+ */
245
+ previous_interaction_id?: string | null;
110
246
  /**
111
247
  * Source policy for web search results.
112
248
  *
@@ -122,6 +258,21 @@ export interface RunInput {
122
258
  * For convenience bare strings are also accepted as input or output schemas.
123
259
  */
124
260
  task_spec?: TaskSpec | null;
261
+ /**
262
+ * Webhooks for Task Runs.
263
+ */
264
+ webhook?: Webhook | null;
265
+ }
266
+ export declare namespace RunInput {
267
+ /**
268
+ * Advanced search configuration for a task run.
269
+ */
270
+ interface AdvancedSettings {
271
+ /**
272
+ * ISO 3166-1 alpha-2 country code for geo-targeted search results.
273
+ */
274
+ location?: string | null;
275
+ }
125
276
  }
126
277
  /**
127
278
  * Status of a task run.
@@ -131,6 +282,11 @@ export interface TaskRun {
131
282
  * Timestamp of the creation of the task, as an RFC 3339 string.
132
283
  */
133
284
  created_at: string | null;
285
+ /**
286
+ * Identifier for this interaction. Pass this value as `previous_interaction_id` to
287
+ * reuse context for a future request.
288
+ */
289
+ interaction_id: string;
134
290
  /**
135
291
  * Whether the run is currently active, i.e. status is one of {'cancelling',
136
292
  * 'queued', 'running'}.
@@ -171,6 +327,33 @@ export interface TaskRun {
171
327
  */
172
328
  warnings?: Array<Shared.Warning> | null;
173
329
  }
330
+ /**
331
+ * Event when a task run transitions to a non-active status.
332
+ *
333
+ * May indicate completion, cancellation, or failure.
334
+ */
335
+ export interface TaskRunEvent {
336
+ /**
337
+ * Cursor to resume the event stream. Always empty for non Task Group runs.
338
+ */
339
+ event_id: string | null;
340
+ /**
341
+ * Task run object.
342
+ */
343
+ run: TaskRun;
344
+ /**
345
+ * Event type; always 'task_run.state'.
346
+ */
347
+ type: 'task_run.state';
348
+ /**
349
+ * Request to run a task.
350
+ */
351
+ input?: RunInput | null;
352
+ /**
353
+ * Output from the run; included only if requested and if status == `completed`.
354
+ */
355
+ output?: TaskRunTextOutput | TaskRunJsonOutput | null;
356
+ }
174
357
  /**
175
358
  * Output from a task that returns JSON.
176
359
  */
@@ -194,20 +377,16 @@ export interface TaskRunJsonOutput {
194
377
  */
195
378
  type: 'json';
196
379
  /**
197
- * Additional fields from beta features used in this task run. When beta features
198
- * are specified during both task run creation and result retrieval, this field
199
- * will be empty and instead the relevant beta attributes will be directly included
200
- * in the `BetaTaskRunJsonOutput` or corresponding output type. However, if beta
201
- * features were specified during task run creation but not during result
202
- * retrieval, this field will contain the dump of fields from those beta features.
203
- * Each key represents the beta feature version (one amongst parallel-beta headers)
204
- * and the values correspond to the beta feature attributes, if any. For now, only
205
- * MCP server beta features have attributes. For example,
206
- * `{mcp-server-2025-07-17: [{'server_name':'mcp_server', 'tool_call_id': 'tc_123', ...}]}}`
380
+ * @deprecated Deprecated. mcp-server-2025-07-17 is now included directly in the
381
+ * output (e.g. mcp_tool_calls).
207
382
  */
208
383
  beta_fields?: {
209
384
  [key: string]: unknown;
210
385
  } | null;
386
+ /**
387
+ * MCP tool calls made by the task.
388
+ */
389
+ mcp_tool_calls?: Array<McpToolCall> | null;
211
390
  /**
212
391
  * Output schema for the Task Run. Populated only if the task was executed with an
213
392
  * auto schema.
@@ -247,20 +426,16 @@ export interface TaskRunTextOutput {
247
426
  */
248
427
  type: 'text';
249
428
  /**
250
- * Additional fields from beta features used in this task run. When beta features
251
- * are specified during both task run creation and result retrieval, this field
252
- * will be empty and instead the relevant beta attributes will be directly included
253
- * in the `BetaTaskRunJsonOutput` or corresponding output type. However, if beta
254
- * features were specified during task run creation but not during result
255
- * retrieval, this field will contain the dump of fields from those beta features.
256
- * Each key represents the beta feature version (one amongst parallel-beta headers)
257
- * and the values correspond to the beta feature attributes, if any. For now, only
258
- * MCP server beta features have attributes. For example,
259
- * `{mcp-server-2025-07-17: [{'server_name':'mcp_server', 'tool_call_id': 'tc_123', ...}]}}`
429
+ * @deprecated Deprecated. mcp-server-2025-07-17 is now included directly in the
430
+ * output (e.g. mcp_tool_calls).
260
431
  */
261
432
  beta_fields?: {
262
433
  [key: string]: unknown;
263
434
  } | null;
435
+ /**
436
+ * MCP tool calls made by the task.
437
+ */
438
+ mcp_tool_calls?: Array<McpToolCall> | null;
264
439
  }
265
440
  /**
266
441
  * Specification for a task.
@@ -297,32 +472,126 @@ export interface TextSchema {
297
472
  */
298
473
  type?: 'text';
299
474
  }
475
+ /**
476
+ * Webhooks for Task Runs.
477
+ */
478
+ export interface Webhook {
479
+ /**
480
+ * URL for the webhook.
481
+ */
482
+ url: string;
483
+ /**
484
+ * Event types to send the webhook notifications for.
485
+ */
486
+ event_types?: Array<'task_run.status'>;
487
+ }
488
+ /**
489
+ * A progress update for a task run.
490
+ */
491
+ export type TaskRunEventsResponse = TaskRunEventsResponse.TaskRunProgressStatsEvent | TaskRunEventsResponse.TaskRunProgressMessageEvent | TaskRunEvent | ErrorEvent;
492
+ export declare namespace TaskRunEventsResponse {
493
+ /**
494
+ * A progress update for a task run.
495
+ */
496
+ interface TaskRunProgressStatsEvent {
497
+ /**
498
+ * Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
499
+ * progress and 100 indicates completion.
500
+ */
501
+ progress_meter: number;
502
+ /**
503
+ * Source stats describing progress so far.
504
+ */
505
+ source_stats: TaskRunProgressStatsEvent.SourceStats;
506
+ /**
507
+ * Event type; always 'task_run.progress_stats'.
508
+ */
509
+ type: 'task_run.progress_stats';
510
+ }
511
+ namespace TaskRunProgressStatsEvent {
512
+ /**
513
+ * Source stats describing progress so far.
514
+ */
515
+ interface SourceStats {
516
+ /**
517
+ * Number of sources considered in processing the task.
518
+ */
519
+ num_sources_considered: number | null;
520
+ /**
521
+ * Number of sources read in processing the task.
522
+ */
523
+ num_sources_read: number | null;
524
+ /**
525
+ * A sample of URLs of sources read in processing the task.
526
+ */
527
+ sources_read_sample: Array<string> | null;
528
+ }
529
+ }
530
+ /**
531
+ * A message for a task run progress update.
532
+ */
533
+ interface TaskRunProgressMessageEvent {
534
+ /**
535
+ * Progress update message.
536
+ */
537
+ message: string;
538
+ /**
539
+ * Timestamp of the message.
540
+ */
541
+ timestamp: string | null;
542
+ /**
543
+ * Event type; always starts with 'task_run.progress_msg'.
544
+ */
545
+ type: 'task_run.progress_msg.plan' | 'task_run.progress_msg.search' | 'task_run.progress_msg.result' | 'task_run.progress_msg.tool_call' | 'task_run.progress_msg.exec_status';
546
+ }
547
+ }
300
548
  export interface TaskRunCreateParams {
301
549
  /**
302
- * Input to the task, either text or a JSON object.
550
+ * Body param: Input to the task, either text or a JSON object.
303
551
  */
304
552
  input: string | {
305
553
  [key: string]: unknown;
306
554
  };
307
555
  /**
308
- * Processor to use for the task.
556
+ * Body param: Processor to use for the task.
309
557
  */
310
558
  processor: string;
311
559
  /**
312
- * User-provided metadata stored with the run. Keys and values must be strings with
313
- * a maximum length of 16 and 512 characters respectively.
560
+ * Body param: Advanced search configuration for a task run.
561
+ */
562
+ advanced_settings?: TaskRunCreateParams.AdvancedSettings | null;
563
+ /**
564
+ * Body param: Controls tracking of task run execution progress. When set to true,
565
+ * progress events are recorded and can be accessed via the
566
+ * [Task Run events](https://docs.parallel.ai/api-reference) endpoint. When false,
567
+ * no progress events are tracked. Note that progress tracking cannot be enabled
568
+ * after a run has been created. The flag is set to true by default for premium
569
+ * processors (pro and above).
570
+ */
571
+ enable_events?: boolean | null;
572
+ /**
573
+ * Body param: Optional list of MCP servers to use for the run.
574
+ */
575
+ mcp_servers?: Array<McpServer> | null;
576
+ /**
577
+ * Body param: User-provided metadata stored with the run. Keys and values must be
578
+ * strings with a maximum length of 16 and 512 characters respectively.
314
579
  */
315
580
  metadata?: {
316
581
  [key: string]: string | number | boolean;
317
582
  } | null;
318
583
  /**
319
- * Source policy for web search results.
584
+ * Body param: Interaction ID to use as context for this request.
585
+ */
586
+ previous_interaction_id?: string | null;
587
+ /**
588
+ * Body param: Source policy for web search results.
320
589
  *
321
590
  * This policy governs which sources are allowed/disallowed in results.
322
591
  */
323
592
  source_policy?: Shared.SourcePolicy | null;
324
593
  /**
325
- * Specification for a task.
594
+ * Body param: Specification for a task.
326
595
  *
327
596
  * Auto output schemas can be specified by setting `output_schema={"type":"auto"}`.
328
597
  * Not specifying a TaskSpec is the same as setting an auto output schema.
@@ -330,11 +599,37 @@ export interface TaskRunCreateParams {
330
599
  * For convenience bare strings are also accepted as input or output schemas.
331
600
  */
332
601
  task_spec?: TaskSpec | null;
602
+ /**
603
+ * Body param: Webhooks for Task Runs.
604
+ */
605
+ webhook?: Webhook | null;
606
+ /**
607
+ * Header param: Optional header to specify the beta version(s) to enable.
608
+ */
609
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
610
+ }
611
+ export declare namespace TaskRunCreateParams {
612
+ /**
613
+ * Advanced search configuration for a task run.
614
+ */
615
+ interface AdvancedSettings {
616
+ /**
617
+ * ISO 3166-1 alpha-2 country code for geo-targeted search results.
618
+ */
619
+ location?: string | null;
620
+ }
333
621
  }
334
622
  export interface TaskRunResultParams {
623
+ /**
624
+ * Query param
625
+ */
335
626
  timeout?: number;
627
+ /**
628
+ * Header param: Optional header to specify the beta version(s) to enable.
629
+ */
630
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
336
631
  }
337
632
  export declare namespace TaskRun {
338
- export { type AutoSchema as AutoSchema, type Citation as Citation, type FieldBasis as FieldBasis, type JsonSchema as JsonSchema, type RunInput as RunInput, type TaskRun as TaskRun, type TaskRunJsonOutput as TaskRunJsonOutput, type TaskRunResult as TaskRunResult, type TaskRunTextOutput as TaskRunTextOutput, type TaskSpec as TaskSpec, type TextSchema as TextSchema, type TaskRunCreateParams as TaskRunCreateParams, type TaskRunResultParams as TaskRunResultParams, };
633
+ export { type AutoSchema as AutoSchema, type Citation as Citation, type ErrorEvent as ErrorEvent, type FieldBasis as FieldBasis, type JsonSchema as JsonSchema, type McpServer as McpServer, type McpToolCall as McpToolCall, type RunInput as RunInput, type TaskRun as TaskRun, type TaskRunEvent as TaskRunEvent, type TaskRunJsonOutput as TaskRunJsonOutput, type TaskRunResult as TaskRunResult, type TaskRunTextOutput as TaskRunTextOutput, type TaskSpec as TaskSpec, type TextSchema as TextSchema, type Webhook as Webhook, type TaskRunEventsResponse as TaskRunEventsResponse, type TaskRunCreateParams as TaskRunCreateParams, type TaskRunResultParams as TaskRunResultParams, };
339
634
  }
340
635
  //# sourceMappingURL=task-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-run.d.ts","sourceRoot":"","sources":["../src/resources/task-run.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIhF;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAItE;;OAEG;IACH,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,KAAK,GA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AAC;KAC1B;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -3,7 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.TaskRun = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ const headers_1 = require("../internal/headers.js");
6
7
  const path_1 = require("../internal/utils/path.js");
8
+ /**
9
+ * The Task API executes web research and extraction tasks. Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
10
+ * - Output metadata: citations, excerpts, reasoning, and confidence per field
11
+ *
12
+ * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
13
+ * - Submit hundreds or thousands of Tasks as a single group
14
+ * - Observe group progress and receive results as they complete
15
+ * - Real-time updates via Server-Sent Events (SSE)
16
+ * - Add tasks to an existing group while it is running
17
+ * - Group-level retry and error aggregation
18
+ */
7
19
  class TaskRun extends resource_1.APIResource {
8
20
  /**
9
21
  * Initiates a task run.
@@ -11,23 +23,78 @@ class TaskRun extends resource_1.APIResource {
11
23
  * Returns immediately with a run object in status 'queued'.
12
24
  *
13
25
  * Beta features can be enabled by setting the 'parallel-beta' header.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const taskRun = await client.taskRun.create({
30
+ * input: 'What was the GDP of France in 2023?',
31
+ * processor: 'base',
32
+ * });
33
+ * ```
14
34
  */
15
- create(body, options) {
16
- return this._client.post('/v1/tasks/runs', { body, ...options });
35
+ create(params, options) {
36
+ const { betas, ...body } = params;
37
+ return this._client.post('/v1/tasks/runs', {
38
+ body,
39
+ ...options,
40
+ headers: (0, headers_1.buildHeaders)([
41
+ { ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
42
+ options?.headers,
43
+ ]),
44
+ });
17
45
  }
18
46
  /**
19
47
  * Retrieves run status by run_id.
20
48
  *
21
49
  * The run result is available from the `/result` endpoint.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const taskRun = await client.taskRun.retrieve('run_id');
54
+ * ```
22
55
  */
23
56
  retrieve(runID, options) {
24
57
  return this._client.get((0, path_1.path) `/v1/tasks/runs/${runID}`, options);
25
58
  }
59
+ /**
60
+ * Streams events for a task run.
61
+ *
62
+ * Returns a stream of events showing progress updates and state changes for the
63
+ * task run.
64
+ *
65
+ * For task runs that did not have enable_events set to true during creation, the
66
+ * frequency of events will be reduced.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const response = await client.taskRun.events('run_id');
71
+ * ```
72
+ */
73
+ events(runID, options) {
74
+ return this._client.get((0, path_1.path) `/v1/tasks/runs/${runID}/events`, {
75
+ ...options,
76
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
77
+ stream: true,
78
+ });
79
+ }
26
80
  /**
27
81
  * Retrieves a run result by run_id, blocking until the run is completed.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const taskRunResult = await client.taskRun.result('run_id');
86
+ * ```
28
87
  */
29
- result(runID, query = {}, options) {
30
- return this._client.get((0, path_1.path) `/v1/tasks/runs/${runID}/result`, { query, ...options });
88
+ result(runID, params = {}, options) {
89
+ const { betas, ...query } = params ?? {};
90
+ return this._client.get((0, path_1.path) `/v1/tasks/runs/${runID}/result`, {
91
+ query,
92
+ ...options,
93
+ headers: (0, headers_1.buildHeaders)([
94
+ { ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
95
+ options?.headers,
96
+ ]),
97
+ });
31
98
  }
32
99
  }
33
100
  exports.TaskRun = TaskRun;
@@ -1 +1 @@
1
- {"version":3,"file":"task-run.js","sourceRoot":"","sources":["../src/resources/task-run.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,KAAa,EACb,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,I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