@trigger.dev/core 0.0.0-prerelease-20240418145424 → 0.0.0-prerelease-20240528152213

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 (79) hide show
  1. package/dist/catalog-BUwiuDbt.d.mts +202 -0
  2. package/dist/catalog-eKgqBHUA.d.ts +202 -0
  3. package/dist/index.d.mts +60 -1
  4. package/dist/index.d.ts +60 -1
  5. package/dist/index.js +7 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +7 -1
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/manager-uPyMRN8k.d.mts +1159 -0
  10. package/dist/manager-uPyMRN8k.d.ts +1159 -0
  11. package/dist/messages-l9PdIyKF.d.mts +16741 -0
  12. package/dist/messages-l9PdIyKF.d.ts +16741 -0
  13. package/dist/schemas-b8tRw8dX.d.mts +2331 -0
  14. package/dist/schemas-b8tRw8dX.d.ts +2331 -0
  15. package/dist/v3/dev/index.d.mts +28 -0
  16. package/dist/v3/dev/index.d.ts +28 -0
  17. package/dist/v3/dev/index.js +93 -0
  18. package/dist/v3/dev/index.js.map +1 -0
  19. package/dist/v3/dev/index.mjs +91 -0
  20. package/dist/v3/dev/index.mjs.map +1 -0
  21. package/dist/v3/index.d.mts +517 -17166
  22. package/dist/v3/index.d.ts +517 -17166
  23. package/dist/v3/index.js +1591 -2828
  24. package/dist/v3/index.js.map +1 -1
  25. package/dist/v3/index.mjs +1580 -2802
  26. package/dist/v3/index.mjs.map +1 -1
  27. package/dist/v3/otel/index.js +85 -44
  28. package/dist/v3/otel/index.js.map +1 -1
  29. package/dist/v3/otel/index.mjs +85 -44
  30. package/dist/v3/otel/index.mjs.map +1 -1
  31. package/dist/v3/prod/index.d.mts +45 -0
  32. package/dist/v3/prod/index.d.ts +45 -0
  33. package/dist/v3/prod/index.js +304 -0
  34. package/dist/v3/prod/index.js.map +1 -0
  35. package/dist/v3/prod/index.mjs +302 -0
  36. package/dist/v3/prod/index.mjs.map +1 -0
  37. package/dist/v3/utils/structuredLogger.d.mts +31 -0
  38. package/dist/v3/utils/structuredLogger.d.ts +31 -0
  39. package/dist/v3/utils/structuredLogger.js +88 -0
  40. package/dist/v3/utils/structuredLogger.js.map +1 -0
  41. package/dist/v3/utils/structuredLogger.mjs +86 -0
  42. package/dist/v3/utils/structuredLogger.mjs.map +1 -0
  43. package/dist/v3/workers/index.d.mts +96 -0
  44. package/dist/v3/workers/index.d.ts +96 -0
  45. package/dist/v3/workers/index.js +2831 -0
  46. package/dist/v3/workers/index.js.map +1 -0
  47. package/dist/v3/workers/index.mjs +2815 -0
  48. package/dist/v3/workers/index.mjs.map +1 -0
  49. package/dist/v3/zodIpc.d.mts +32 -0
  50. package/dist/v3/zodIpc.d.ts +32 -0
  51. package/dist/v3/zodIpc.js +268 -0
  52. package/dist/v3/zodIpc.js.map +1 -0
  53. package/dist/v3/zodIpc.mjs +266 -0
  54. package/dist/v3/zodIpc.mjs.map +1 -0
  55. package/dist/v3/zodMessageHandler.d.mts +69 -0
  56. package/dist/v3/zodMessageHandler.d.ts +69 -0
  57. package/dist/v3/zodMessageHandler.js +168 -0
  58. package/dist/v3/zodMessageHandler.js.map +1 -0
  59. package/dist/v3/zodMessageHandler.mjs +163 -0
  60. package/dist/v3/zodMessageHandler.mjs.map +1 -0
  61. package/dist/v3/zodNamespace.d.mts +3663 -0
  62. package/dist/v3/zodNamespace.d.ts +3663 -0
  63. package/dist/v3/zodNamespace.js +366 -0
  64. package/dist/v3/zodNamespace.js.map +1 -0
  65. package/dist/v3/zodNamespace.mjs +364 -0
  66. package/dist/v3/zodNamespace.mjs.map +1 -0
  67. package/dist/v3/zodSocket.d.mts +88 -0
  68. package/dist/v3/zodSocket.d.ts +88 -0
  69. package/dist/v3/zodSocket.js +319 -0
  70. package/dist/v3/zodSocket.js.map +1 -0
  71. package/dist/v3/zodSocket.mjs +315 -0
  72. package/dist/v3/zodSocket.mjs.map +1 -0
  73. package/dist/v3/zodfetch.d.mts +78 -0
  74. package/dist/v3/zodfetch.d.ts +78 -0
  75. package/dist/v3/zodfetch.js +446 -0
  76. package/dist/v3/zodfetch.js.map +1 -0
  77. package/dist/v3/zodfetch.mjs +433 -0
  78. package/dist/v3/zodfetch.mjs.map +1 -0
  79. package/package.json +77 -4
@@ -0,0 +1,1159 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const TaskRunBuiltInError: z.ZodObject<{
4
+ type: z.ZodLiteral<"BUILT_IN_ERROR">;
5
+ name: z.ZodString;
6
+ message: z.ZodString;
7
+ stackTrace: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: "BUILT_IN_ERROR";
10
+ message: string;
11
+ name: string;
12
+ stackTrace: string;
13
+ }, {
14
+ type: "BUILT_IN_ERROR";
15
+ message: string;
16
+ name: string;
17
+ stackTrace: string;
18
+ }>;
19
+ type TaskRunBuiltInError = z.infer<typeof TaskRunBuiltInError>;
20
+ declare const TaskRunCustomErrorObject: z.ZodObject<{
21
+ type: z.ZodLiteral<"CUSTOM_ERROR">;
22
+ raw: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ type: "CUSTOM_ERROR";
25
+ raw: string;
26
+ }, {
27
+ type: "CUSTOM_ERROR";
28
+ raw: string;
29
+ }>;
30
+ type TaskRunCustomErrorObject = z.infer<typeof TaskRunCustomErrorObject>;
31
+ declare const TaskRunStringError: z.ZodObject<{
32
+ type: z.ZodLiteral<"STRING_ERROR">;
33
+ raw: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "STRING_ERROR";
36
+ raw: string;
37
+ }, {
38
+ type: "STRING_ERROR";
39
+ raw: string;
40
+ }>;
41
+ type TaskRunStringError = z.infer<typeof TaskRunStringError>;
42
+ declare const TaskRunErrorCodes: {
43
+ readonly COULD_NOT_FIND_EXECUTOR: "COULD_NOT_FIND_EXECUTOR";
44
+ readonly COULD_NOT_FIND_TASK: "COULD_NOT_FIND_TASK";
45
+ readonly CONFIGURED_INCORRECTLY: "CONFIGURED_INCORRECTLY";
46
+ readonly TASK_ALREADY_RUNNING: "TASK_ALREADY_RUNNING";
47
+ readonly TASK_EXECUTION_FAILED: "TASK_EXECUTION_FAILED";
48
+ readonly TASK_EXECUTION_ABORTED: "TASK_EXECUTION_ABORTED";
49
+ readonly TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE: "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE";
50
+ readonly TASK_PROCESS_SIGKILL_TIMEOUT: "TASK_PROCESS_SIGKILL_TIMEOUT";
51
+ readonly TASK_RUN_CANCELLED: "TASK_RUN_CANCELLED";
52
+ readonly TASK_OUTPUT_ERROR: "TASK_OUTPUT_ERROR";
53
+ readonly HANDLE_ERROR_ERROR: "HANDLE_ERROR_ERROR";
54
+ readonly GRACEFUL_EXIT_TIMEOUT: "GRACEFUL_EXIT_TIMEOUT";
55
+ };
56
+ declare const TaskRunInternalError: z.ZodObject<{
57
+ type: z.ZodLiteral<"INTERNAL_ERROR">;
58
+ code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR", "COULD_NOT_FIND_TASK", "CONFIGURED_INCORRECTLY", "TASK_ALREADY_RUNNING", "TASK_EXECUTION_FAILED", "TASK_EXECUTION_ABORTED", "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE", "TASK_PROCESS_SIGKILL_TIMEOUT", "TASK_RUN_CANCELLED", "TASK_OUTPUT_ERROR", "HANDLE_ERROR_ERROR", "GRACEFUL_EXIT_TIMEOUT", "TASK_RUN_HEARTBEAT_TIMEOUT"]>;
59
+ message: z.ZodOptional<z.ZodString>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
62
+ type: "INTERNAL_ERROR";
63
+ message?: string | undefined;
64
+ }, {
65
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
66
+ type: "INTERNAL_ERROR";
67
+ message?: string | undefined;
68
+ }>;
69
+ type TaskRunInternalError = z.infer<typeof TaskRunInternalError>;
70
+ declare const TaskRunError: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
71
+ type: z.ZodLiteral<"BUILT_IN_ERROR">;
72
+ name: z.ZodString;
73
+ message: z.ZodString;
74
+ stackTrace: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ type: "BUILT_IN_ERROR";
77
+ message: string;
78
+ name: string;
79
+ stackTrace: string;
80
+ }, {
81
+ type: "BUILT_IN_ERROR";
82
+ message: string;
83
+ name: string;
84
+ stackTrace: string;
85
+ }>, z.ZodObject<{
86
+ type: z.ZodLiteral<"CUSTOM_ERROR">;
87
+ raw: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ type: "CUSTOM_ERROR";
90
+ raw: string;
91
+ }, {
92
+ type: "CUSTOM_ERROR";
93
+ raw: string;
94
+ }>, z.ZodObject<{
95
+ type: z.ZodLiteral<"STRING_ERROR">;
96
+ raw: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ type: "STRING_ERROR";
99
+ raw: string;
100
+ }, {
101
+ type: "STRING_ERROR";
102
+ raw: string;
103
+ }>, z.ZodObject<{
104
+ type: z.ZodLiteral<"INTERNAL_ERROR">;
105
+ code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR", "COULD_NOT_FIND_TASK", "CONFIGURED_INCORRECTLY", "TASK_ALREADY_RUNNING", "TASK_EXECUTION_FAILED", "TASK_EXECUTION_ABORTED", "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE", "TASK_PROCESS_SIGKILL_TIMEOUT", "TASK_RUN_CANCELLED", "TASK_OUTPUT_ERROR", "HANDLE_ERROR_ERROR", "GRACEFUL_EXIT_TIMEOUT", "TASK_RUN_HEARTBEAT_TIMEOUT"]>;
106
+ message: z.ZodOptional<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
109
+ type: "INTERNAL_ERROR";
110
+ message?: string | undefined;
111
+ }, {
112
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
113
+ type: "INTERNAL_ERROR";
114
+ message?: string | undefined;
115
+ }>]>;
116
+ type TaskRunError = z.infer<typeof TaskRunError>;
117
+ declare const TaskRun: z.ZodObject<{
118
+ id: z.ZodString;
119
+ payload: z.ZodString;
120
+ payloadType: z.ZodString;
121
+ context: z.ZodAny;
122
+ tags: z.ZodArray<z.ZodString, "many">;
123
+ isTest: z.ZodDefault<z.ZodBoolean>;
124
+ createdAt: z.ZodDate;
125
+ idempotencyKey: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ id: string;
128
+ payload: string;
129
+ payloadType: string;
130
+ tags: string[];
131
+ isTest: boolean;
132
+ createdAt: Date;
133
+ context?: any;
134
+ idempotencyKey?: string | undefined;
135
+ }, {
136
+ id: string;
137
+ payload: string;
138
+ payloadType: string;
139
+ tags: string[];
140
+ createdAt: Date;
141
+ context?: any;
142
+ isTest?: boolean | undefined;
143
+ idempotencyKey?: string | undefined;
144
+ }>;
145
+ type TaskRun = z.infer<typeof TaskRun>;
146
+ declare const TaskRunExecutionTask: z.ZodObject<{
147
+ id: z.ZodString;
148
+ filePath: z.ZodString;
149
+ exportName: z.ZodString;
150
+ }, "strip", z.ZodTypeAny, {
151
+ id: string;
152
+ filePath: string;
153
+ exportName: string;
154
+ }, {
155
+ id: string;
156
+ filePath: string;
157
+ exportName: string;
158
+ }>;
159
+ type TaskRunExecutionTask = z.infer<typeof TaskRunExecutionTask>;
160
+ declare const TaskRunExecutionAttempt: z.ZodObject<{
161
+ id: z.ZodString;
162
+ number: z.ZodNumber;
163
+ startedAt: z.ZodDate;
164
+ backgroundWorkerId: z.ZodString;
165
+ backgroundWorkerTaskId: z.ZodString;
166
+ status: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ number: number;
169
+ status: string;
170
+ id: string;
171
+ startedAt: Date;
172
+ backgroundWorkerId: string;
173
+ backgroundWorkerTaskId: string;
174
+ }, {
175
+ number: number;
176
+ status: string;
177
+ id: string;
178
+ startedAt: Date;
179
+ backgroundWorkerId: string;
180
+ backgroundWorkerTaskId: string;
181
+ }>;
182
+ type TaskRunExecutionAttempt = z.infer<typeof TaskRunExecutionAttempt>;
183
+ declare const TaskRunExecutionEnvironment: z.ZodObject<{
184
+ id: z.ZodString;
185
+ slug: z.ZodString;
186
+ type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
189
+ id: string;
190
+ slug: string;
191
+ }, {
192
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
193
+ id: string;
194
+ slug: string;
195
+ }>;
196
+ type TaskRunExecutionEnvironment = z.infer<typeof TaskRunExecutionEnvironment>;
197
+ declare const TaskRunExecutionOrganization: z.ZodObject<{
198
+ id: z.ZodString;
199
+ slug: z.ZodString;
200
+ name: z.ZodString;
201
+ }, "strip", z.ZodTypeAny, {
202
+ id: string;
203
+ name: string;
204
+ slug: string;
205
+ }, {
206
+ id: string;
207
+ name: string;
208
+ slug: string;
209
+ }>;
210
+ type TaskRunExecutionOrganization = z.infer<typeof TaskRunExecutionOrganization>;
211
+ declare const TaskRunExecutionProject: z.ZodObject<{
212
+ id: z.ZodString;
213
+ ref: z.ZodString;
214
+ slug: z.ZodString;
215
+ name: z.ZodString;
216
+ }, "strip", z.ZodTypeAny, {
217
+ id: string;
218
+ name: string;
219
+ slug: string;
220
+ ref: string;
221
+ }, {
222
+ id: string;
223
+ name: string;
224
+ slug: string;
225
+ ref: string;
226
+ }>;
227
+ type TaskRunExecutionProject = z.infer<typeof TaskRunExecutionProject>;
228
+ declare const TaskRunExecutionQueue: z.ZodObject<{
229
+ id: z.ZodString;
230
+ name: z.ZodString;
231
+ }, "strip", z.ZodTypeAny, {
232
+ id: string;
233
+ name: string;
234
+ }, {
235
+ id: string;
236
+ name: string;
237
+ }>;
238
+ type TaskRunExecutionQueue = z.infer<typeof TaskRunExecutionQueue>;
239
+ declare const TaskRunExecutionBatch: z.ZodObject<{
240
+ id: z.ZodString;
241
+ }, "strip", z.ZodTypeAny, {
242
+ id: string;
243
+ }, {
244
+ id: string;
245
+ }>;
246
+ declare const TaskRunExecution: z.ZodObject<{
247
+ task: z.ZodObject<{
248
+ id: z.ZodString;
249
+ filePath: z.ZodString;
250
+ exportName: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ id: string;
253
+ filePath: string;
254
+ exportName: string;
255
+ }, {
256
+ id: string;
257
+ filePath: string;
258
+ exportName: string;
259
+ }>;
260
+ attempt: z.ZodObject<{
261
+ id: z.ZodString;
262
+ number: z.ZodNumber;
263
+ startedAt: z.ZodDate;
264
+ backgroundWorkerId: z.ZodString;
265
+ backgroundWorkerTaskId: z.ZodString;
266
+ status: z.ZodString;
267
+ }, "strip", z.ZodTypeAny, {
268
+ number: number;
269
+ status: string;
270
+ id: string;
271
+ startedAt: Date;
272
+ backgroundWorkerId: string;
273
+ backgroundWorkerTaskId: string;
274
+ }, {
275
+ number: number;
276
+ status: string;
277
+ id: string;
278
+ startedAt: Date;
279
+ backgroundWorkerId: string;
280
+ backgroundWorkerTaskId: string;
281
+ }>;
282
+ run: z.ZodObject<{
283
+ id: z.ZodString;
284
+ payload: z.ZodString;
285
+ payloadType: z.ZodString;
286
+ context: z.ZodAny;
287
+ tags: z.ZodArray<z.ZodString, "many">;
288
+ isTest: z.ZodDefault<z.ZodBoolean>;
289
+ createdAt: z.ZodDate;
290
+ idempotencyKey: z.ZodOptional<z.ZodString>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ id: string;
293
+ payload: string;
294
+ payloadType: string;
295
+ tags: string[];
296
+ isTest: boolean;
297
+ createdAt: Date;
298
+ context?: any;
299
+ idempotencyKey?: string | undefined;
300
+ }, {
301
+ id: string;
302
+ payload: string;
303
+ payloadType: string;
304
+ tags: string[];
305
+ createdAt: Date;
306
+ context?: any;
307
+ isTest?: boolean | undefined;
308
+ idempotencyKey?: string | undefined;
309
+ }>;
310
+ queue: z.ZodObject<{
311
+ id: z.ZodString;
312
+ name: z.ZodString;
313
+ }, "strip", z.ZodTypeAny, {
314
+ id: string;
315
+ name: string;
316
+ }, {
317
+ id: string;
318
+ name: string;
319
+ }>;
320
+ environment: z.ZodObject<{
321
+ id: z.ZodString;
322
+ slug: z.ZodString;
323
+ type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
326
+ id: string;
327
+ slug: string;
328
+ }, {
329
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
330
+ id: string;
331
+ slug: string;
332
+ }>;
333
+ organization: z.ZodObject<{
334
+ id: z.ZodString;
335
+ slug: z.ZodString;
336
+ name: z.ZodString;
337
+ }, "strip", z.ZodTypeAny, {
338
+ id: string;
339
+ name: string;
340
+ slug: string;
341
+ }, {
342
+ id: string;
343
+ name: string;
344
+ slug: string;
345
+ }>;
346
+ project: z.ZodObject<{
347
+ id: z.ZodString;
348
+ ref: z.ZodString;
349
+ slug: z.ZodString;
350
+ name: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ id: string;
353
+ name: string;
354
+ slug: string;
355
+ ref: string;
356
+ }, {
357
+ id: string;
358
+ name: string;
359
+ slug: string;
360
+ ref: string;
361
+ }>;
362
+ batch: z.ZodOptional<z.ZodObject<{
363
+ id: z.ZodString;
364
+ }, "strip", z.ZodTypeAny, {
365
+ id: string;
366
+ }, {
367
+ id: string;
368
+ }>>;
369
+ }, "strip", z.ZodTypeAny, {
370
+ task: {
371
+ id: string;
372
+ filePath: string;
373
+ exportName: string;
374
+ };
375
+ attempt: {
376
+ number: number;
377
+ status: string;
378
+ id: string;
379
+ startedAt: Date;
380
+ backgroundWorkerId: string;
381
+ backgroundWorkerTaskId: string;
382
+ };
383
+ run: {
384
+ id: string;
385
+ payload: string;
386
+ payloadType: string;
387
+ tags: string[];
388
+ isTest: boolean;
389
+ createdAt: Date;
390
+ context?: any;
391
+ idempotencyKey?: string | undefined;
392
+ };
393
+ queue: {
394
+ id: string;
395
+ name: string;
396
+ };
397
+ environment: {
398
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
399
+ id: string;
400
+ slug: string;
401
+ };
402
+ organization: {
403
+ id: string;
404
+ name: string;
405
+ slug: string;
406
+ };
407
+ project: {
408
+ id: string;
409
+ name: string;
410
+ slug: string;
411
+ ref: string;
412
+ };
413
+ batch?: {
414
+ id: string;
415
+ } | undefined;
416
+ }, {
417
+ task: {
418
+ id: string;
419
+ filePath: string;
420
+ exportName: string;
421
+ };
422
+ attempt: {
423
+ number: number;
424
+ status: string;
425
+ id: string;
426
+ startedAt: Date;
427
+ backgroundWorkerId: string;
428
+ backgroundWorkerTaskId: string;
429
+ };
430
+ run: {
431
+ id: string;
432
+ payload: string;
433
+ payloadType: string;
434
+ tags: string[];
435
+ createdAt: Date;
436
+ context?: any;
437
+ isTest?: boolean | undefined;
438
+ idempotencyKey?: string | undefined;
439
+ };
440
+ queue: {
441
+ id: string;
442
+ name: string;
443
+ };
444
+ environment: {
445
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
446
+ id: string;
447
+ slug: string;
448
+ };
449
+ organization: {
450
+ id: string;
451
+ name: string;
452
+ slug: string;
453
+ };
454
+ project: {
455
+ id: string;
456
+ name: string;
457
+ slug: string;
458
+ ref: string;
459
+ };
460
+ batch?: {
461
+ id: string;
462
+ } | undefined;
463
+ }>;
464
+ type TaskRunExecution = z.infer<typeof TaskRunExecution>;
465
+ declare const TaskRunContext: z.ZodObject<{
466
+ task: z.ZodObject<{
467
+ id: z.ZodString;
468
+ filePath: z.ZodString;
469
+ exportName: z.ZodString;
470
+ }, "strip", z.ZodTypeAny, {
471
+ id: string;
472
+ filePath: string;
473
+ exportName: string;
474
+ }, {
475
+ id: string;
476
+ filePath: string;
477
+ exportName: string;
478
+ }>;
479
+ attempt: z.ZodObject<Omit<{
480
+ id: z.ZodString;
481
+ number: z.ZodNumber;
482
+ startedAt: z.ZodDate;
483
+ backgroundWorkerId: z.ZodString;
484
+ backgroundWorkerTaskId: z.ZodString;
485
+ status: z.ZodString;
486
+ }, "backgroundWorkerId" | "backgroundWorkerTaskId">, "strip", z.ZodTypeAny, {
487
+ number: number;
488
+ status: string;
489
+ id: string;
490
+ startedAt: Date;
491
+ }, {
492
+ number: number;
493
+ status: string;
494
+ id: string;
495
+ startedAt: Date;
496
+ }>;
497
+ run: z.ZodObject<Omit<{
498
+ id: z.ZodString;
499
+ payload: z.ZodString;
500
+ payloadType: z.ZodString;
501
+ context: z.ZodAny;
502
+ tags: z.ZodArray<z.ZodString, "many">;
503
+ isTest: z.ZodDefault<z.ZodBoolean>;
504
+ createdAt: z.ZodDate;
505
+ idempotencyKey: z.ZodOptional<z.ZodString>;
506
+ }, "payload" | "payloadType">, "strip", z.ZodTypeAny, {
507
+ id: string;
508
+ tags: string[];
509
+ isTest: boolean;
510
+ createdAt: Date;
511
+ context?: any;
512
+ idempotencyKey?: string | undefined;
513
+ }, {
514
+ id: string;
515
+ tags: string[];
516
+ createdAt: Date;
517
+ context?: any;
518
+ isTest?: boolean | undefined;
519
+ idempotencyKey?: string | undefined;
520
+ }>;
521
+ queue: z.ZodObject<{
522
+ id: z.ZodString;
523
+ name: z.ZodString;
524
+ }, "strip", z.ZodTypeAny, {
525
+ id: string;
526
+ name: string;
527
+ }, {
528
+ id: string;
529
+ name: string;
530
+ }>;
531
+ environment: z.ZodObject<{
532
+ id: z.ZodString;
533
+ slug: z.ZodString;
534
+ type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
535
+ }, "strip", z.ZodTypeAny, {
536
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
537
+ id: string;
538
+ slug: string;
539
+ }, {
540
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
541
+ id: string;
542
+ slug: string;
543
+ }>;
544
+ organization: z.ZodObject<{
545
+ id: z.ZodString;
546
+ slug: z.ZodString;
547
+ name: z.ZodString;
548
+ }, "strip", z.ZodTypeAny, {
549
+ id: string;
550
+ name: string;
551
+ slug: string;
552
+ }, {
553
+ id: string;
554
+ name: string;
555
+ slug: string;
556
+ }>;
557
+ project: z.ZodObject<{
558
+ id: z.ZodString;
559
+ ref: z.ZodString;
560
+ slug: z.ZodString;
561
+ name: z.ZodString;
562
+ }, "strip", z.ZodTypeAny, {
563
+ id: string;
564
+ name: string;
565
+ slug: string;
566
+ ref: string;
567
+ }, {
568
+ id: string;
569
+ name: string;
570
+ slug: string;
571
+ ref: string;
572
+ }>;
573
+ batch: z.ZodOptional<z.ZodObject<{
574
+ id: z.ZodString;
575
+ }, "strip", z.ZodTypeAny, {
576
+ id: string;
577
+ }, {
578
+ id: string;
579
+ }>>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ task: {
582
+ id: string;
583
+ filePath: string;
584
+ exportName: string;
585
+ };
586
+ attempt: {
587
+ number: number;
588
+ status: string;
589
+ id: string;
590
+ startedAt: Date;
591
+ };
592
+ run: {
593
+ id: string;
594
+ tags: string[];
595
+ isTest: boolean;
596
+ createdAt: Date;
597
+ context?: any;
598
+ idempotencyKey?: string | undefined;
599
+ };
600
+ queue: {
601
+ id: string;
602
+ name: string;
603
+ };
604
+ environment: {
605
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
606
+ id: string;
607
+ slug: string;
608
+ };
609
+ organization: {
610
+ id: string;
611
+ name: string;
612
+ slug: string;
613
+ };
614
+ project: {
615
+ id: string;
616
+ name: string;
617
+ slug: string;
618
+ ref: string;
619
+ };
620
+ batch?: {
621
+ id: string;
622
+ } | undefined;
623
+ }, {
624
+ task: {
625
+ id: string;
626
+ filePath: string;
627
+ exportName: string;
628
+ };
629
+ attempt: {
630
+ number: number;
631
+ status: string;
632
+ id: string;
633
+ startedAt: Date;
634
+ };
635
+ run: {
636
+ id: string;
637
+ tags: string[];
638
+ createdAt: Date;
639
+ context?: any;
640
+ isTest?: boolean | undefined;
641
+ idempotencyKey?: string | undefined;
642
+ };
643
+ queue: {
644
+ id: string;
645
+ name: string;
646
+ };
647
+ environment: {
648
+ type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
649
+ id: string;
650
+ slug: string;
651
+ };
652
+ organization: {
653
+ id: string;
654
+ name: string;
655
+ slug: string;
656
+ };
657
+ project: {
658
+ id: string;
659
+ name: string;
660
+ slug: string;
661
+ ref: string;
662
+ };
663
+ batch?: {
664
+ id: string;
665
+ } | undefined;
666
+ }>;
667
+ type TaskRunContext = z.infer<typeof TaskRunContext>;
668
+ declare const TaskRunExecutionRetry: z.ZodObject<{
669
+ timestamp: z.ZodNumber;
670
+ delay: z.ZodNumber;
671
+ error: z.ZodOptional<z.ZodUnknown>;
672
+ }, "strip", z.ZodTypeAny, {
673
+ timestamp: number;
674
+ delay: number;
675
+ error?: unknown;
676
+ }, {
677
+ timestamp: number;
678
+ delay: number;
679
+ error?: unknown;
680
+ }>;
681
+ type TaskRunExecutionRetry = z.infer<typeof TaskRunExecutionRetry>;
682
+ declare const TaskRunFailedExecutionResult: z.ZodObject<{
683
+ ok: z.ZodLiteral<false>;
684
+ id: z.ZodString;
685
+ error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
686
+ type: z.ZodLiteral<"BUILT_IN_ERROR">;
687
+ name: z.ZodString;
688
+ message: z.ZodString;
689
+ stackTrace: z.ZodString;
690
+ }, "strip", z.ZodTypeAny, {
691
+ type: "BUILT_IN_ERROR";
692
+ message: string;
693
+ name: string;
694
+ stackTrace: string;
695
+ }, {
696
+ type: "BUILT_IN_ERROR";
697
+ message: string;
698
+ name: string;
699
+ stackTrace: string;
700
+ }>, z.ZodObject<{
701
+ type: z.ZodLiteral<"CUSTOM_ERROR">;
702
+ raw: z.ZodString;
703
+ }, "strip", z.ZodTypeAny, {
704
+ type: "CUSTOM_ERROR";
705
+ raw: string;
706
+ }, {
707
+ type: "CUSTOM_ERROR";
708
+ raw: string;
709
+ }>, z.ZodObject<{
710
+ type: z.ZodLiteral<"STRING_ERROR">;
711
+ raw: z.ZodString;
712
+ }, "strip", z.ZodTypeAny, {
713
+ type: "STRING_ERROR";
714
+ raw: string;
715
+ }, {
716
+ type: "STRING_ERROR";
717
+ raw: string;
718
+ }>, z.ZodObject<{
719
+ type: z.ZodLiteral<"INTERNAL_ERROR">;
720
+ code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR", "COULD_NOT_FIND_TASK", "CONFIGURED_INCORRECTLY", "TASK_ALREADY_RUNNING", "TASK_EXECUTION_FAILED", "TASK_EXECUTION_ABORTED", "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE", "TASK_PROCESS_SIGKILL_TIMEOUT", "TASK_RUN_CANCELLED", "TASK_OUTPUT_ERROR", "HANDLE_ERROR_ERROR", "GRACEFUL_EXIT_TIMEOUT", "TASK_RUN_HEARTBEAT_TIMEOUT"]>;
721
+ message: z.ZodOptional<z.ZodString>;
722
+ }, "strip", z.ZodTypeAny, {
723
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
724
+ type: "INTERNAL_ERROR";
725
+ message?: string | undefined;
726
+ }, {
727
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
728
+ type: "INTERNAL_ERROR";
729
+ message?: string | undefined;
730
+ }>]>;
731
+ retry: z.ZodOptional<z.ZodObject<{
732
+ timestamp: z.ZodNumber;
733
+ delay: z.ZodNumber;
734
+ error: z.ZodOptional<z.ZodUnknown>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ timestamp: number;
737
+ delay: number;
738
+ error?: unknown;
739
+ }, {
740
+ timestamp: number;
741
+ delay: number;
742
+ error?: unknown;
743
+ }>>;
744
+ skippedRetrying: z.ZodOptional<z.ZodBoolean>;
745
+ }, "strip", z.ZodTypeAny, {
746
+ error: {
747
+ type: "BUILT_IN_ERROR";
748
+ message: string;
749
+ name: string;
750
+ stackTrace: string;
751
+ } | {
752
+ type: "CUSTOM_ERROR";
753
+ raw: string;
754
+ } | {
755
+ type: "STRING_ERROR";
756
+ raw: string;
757
+ } | {
758
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
759
+ type: "INTERNAL_ERROR";
760
+ message?: string | undefined;
761
+ };
762
+ id: string;
763
+ ok: false;
764
+ retry?: {
765
+ timestamp: number;
766
+ delay: number;
767
+ error?: unknown;
768
+ } | undefined;
769
+ skippedRetrying?: boolean | undefined;
770
+ }, {
771
+ error: {
772
+ type: "BUILT_IN_ERROR";
773
+ message: string;
774
+ name: string;
775
+ stackTrace: string;
776
+ } | {
777
+ type: "CUSTOM_ERROR";
778
+ raw: string;
779
+ } | {
780
+ type: "STRING_ERROR";
781
+ raw: string;
782
+ } | {
783
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
784
+ type: "INTERNAL_ERROR";
785
+ message?: string | undefined;
786
+ };
787
+ id: string;
788
+ ok: false;
789
+ retry?: {
790
+ timestamp: number;
791
+ delay: number;
792
+ error?: unknown;
793
+ } | undefined;
794
+ skippedRetrying?: boolean | undefined;
795
+ }>;
796
+ type TaskRunFailedExecutionResult = z.infer<typeof TaskRunFailedExecutionResult>;
797
+ declare const TaskRunSuccessfulExecutionResult: z.ZodObject<{
798
+ ok: z.ZodLiteral<true>;
799
+ id: z.ZodString;
800
+ output: z.ZodOptional<z.ZodString>;
801
+ outputType: z.ZodString;
802
+ }, "strip", z.ZodTypeAny, {
803
+ id: string;
804
+ ok: true;
805
+ outputType: string;
806
+ output?: string | undefined;
807
+ }, {
808
+ id: string;
809
+ ok: true;
810
+ outputType: string;
811
+ output?: string | undefined;
812
+ }>;
813
+ type TaskRunSuccessfulExecutionResult = z.infer<typeof TaskRunSuccessfulExecutionResult>;
814
+ declare const TaskRunExecutionResult: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
815
+ ok: z.ZodLiteral<true>;
816
+ id: z.ZodString;
817
+ output: z.ZodOptional<z.ZodString>;
818
+ outputType: z.ZodString;
819
+ }, "strip", z.ZodTypeAny, {
820
+ id: string;
821
+ ok: true;
822
+ outputType: string;
823
+ output?: string | undefined;
824
+ }, {
825
+ id: string;
826
+ ok: true;
827
+ outputType: string;
828
+ output?: string | undefined;
829
+ }>, z.ZodObject<{
830
+ ok: z.ZodLiteral<false>;
831
+ id: z.ZodString;
832
+ error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
833
+ type: z.ZodLiteral<"BUILT_IN_ERROR">;
834
+ name: z.ZodString;
835
+ message: z.ZodString;
836
+ stackTrace: z.ZodString;
837
+ }, "strip", z.ZodTypeAny, {
838
+ type: "BUILT_IN_ERROR";
839
+ message: string;
840
+ name: string;
841
+ stackTrace: string;
842
+ }, {
843
+ type: "BUILT_IN_ERROR";
844
+ message: string;
845
+ name: string;
846
+ stackTrace: string;
847
+ }>, z.ZodObject<{
848
+ type: z.ZodLiteral<"CUSTOM_ERROR">;
849
+ raw: z.ZodString;
850
+ }, "strip", z.ZodTypeAny, {
851
+ type: "CUSTOM_ERROR";
852
+ raw: string;
853
+ }, {
854
+ type: "CUSTOM_ERROR";
855
+ raw: string;
856
+ }>, z.ZodObject<{
857
+ type: z.ZodLiteral<"STRING_ERROR">;
858
+ raw: z.ZodString;
859
+ }, "strip", z.ZodTypeAny, {
860
+ type: "STRING_ERROR";
861
+ raw: string;
862
+ }, {
863
+ type: "STRING_ERROR";
864
+ raw: string;
865
+ }>, z.ZodObject<{
866
+ type: z.ZodLiteral<"INTERNAL_ERROR">;
867
+ code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR", "COULD_NOT_FIND_TASK", "CONFIGURED_INCORRECTLY", "TASK_ALREADY_RUNNING", "TASK_EXECUTION_FAILED", "TASK_EXECUTION_ABORTED", "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE", "TASK_PROCESS_SIGKILL_TIMEOUT", "TASK_RUN_CANCELLED", "TASK_OUTPUT_ERROR", "HANDLE_ERROR_ERROR", "GRACEFUL_EXIT_TIMEOUT", "TASK_RUN_HEARTBEAT_TIMEOUT"]>;
868
+ message: z.ZodOptional<z.ZodString>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
871
+ type: "INTERNAL_ERROR";
872
+ message?: string | undefined;
873
+ }, {
874
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
875
+ type: "INTERNAL_ERROR";
876
+ message?: string | undefined;
877
+ }>]>;
878
+ retry: z.ZodOptional<z.ZodObject<{
879
+ timestamp: z.ZodNumber;
880
+ delay: z.ZodNumber;
881
+ error: z.ZodOptional<z.ZodUnknown>;
882
+ }, "strip", z.ZodTypeAny, {
883
+ timestamp: number;
884
+ delay: number;
885
+ error?: unknown;
886
+ }, {
887
+ timestamp: number;
888
+ delay: number;
889
+ error?: unknown;
890
+ }>>;
891
+ skippedRetrying: z.ZodOptional<z.ZodBoolean>;
892
+ }, "strip", z.ZodTypeAny, {
893
+ error: {
894
+ type: "BUILT_IN_ERROR";
895
+ message: string;
896
+ name: string;
897
+ stackTrace: string;
898
+ } | {
899
+ type: "CUSTOM_ERROR";
900
+ raw: string;
901
+ } | {
902
+ type: "STRING_ERROR";
903
+ raw: string;
904
+ } | {
905
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
906
+ type: "INTERNAL_ERROR";
907
+ message?: string | undefined;
908
+ };
909
+ id: string;
910
+ ok: false;
911
+ retry?: {
912
+ timestamp: number;
913
+ delay: number;
914
+ error?: unknown;
915
+ } | undefined;
916
+ skippedRetrying?: boolean | undefined;
917
+ }, {
918
+ error: {
919
+ type: "BUILT_IN_ERROR";
920
+ message: string;
921
+ name: string;
922
+ stackTrace: string;
923
+ } | {
924
+ type: "CUSTOM_ERROR";
925
+ raw: string;
926
+ } | {
927
+ type: "STRING_ERROR";
928
+ raw: string;
929
+ } | {
930
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
931
+ type: "INTERNAL_ERROR";
932
+ message?: string | undefined;
933
+ };
934
+ id: string;
935
+ ok: false;
936
+ retry?: {
937
+ timestamp: number;
938
+ delay: number;
939
+ error?: unknown;
940
+ } | undefined;
941
+ skippedRetrying?: boolean | undefined;
942
+ }>]>;
943
+ type TaskRunExecutionResult = z.infer<typeof TaskRunExecutionResult>;
944
+ declare const BatchTaskRunExecutionResult: z.ZodObject<{
945
+ id: z.ZodString;
946
+ items: z.ZodArray<z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
947
+ ok: z.ZodLiteral<true>;
948
+ id: z.ZodString;
949
+ output: z.ZodOptional<z.ZodString>;
950
+ outputType: z.ZodString;
951
+ }, "strip", z.ZodTypeAny, {
952
+ id: string;
953
+ ok: true;
954
+ outputType: string;
955
+ output?: string | undefined;
956
+ }, {
957
+ id: string;
958
+ ok: true;
959
+ outputType: string;
960
+ output?: string | undefined;
961
+ }>, z.ZodObject<{
962
+ ok: z.ZodLiteral<false>;
963
+ id: z.ZodString;
964
+ error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
965
+ type: z.ZodLiteral<"BUILT_IN_ERROR">;
966
+ name: z.ZodString;
967
+ message: z.ZodString;
968
+ stackTrace: z.ZodString;
969
+ }, "strip", z.ZodTypeAny, {
970
+ type: "BUILT_IN_ERROR";
971
+ message: string;
972
+ name: string;
973
+ stackTrace: string;
974
+ }, {
975
+ type: "BUILT_IN_ERROR";
976
+ message: string;
977
+ name: string;
978
+ stackTrace: string;
979
+ }>, z.ZodObject<{
980
+ type: z.ZodLiteral<"CUSTOM_ERROR">;
981
+ raw: z.ZodString;
982
+ }, "strip", z.ZodTypeAny, {
983
+ type: "CUSTOM_ERROR";
984
+ raw: string;
985
+ }, {
986
+ type: "CUSTOM_ERROR";
987
+ raw: string;
988
+ }>, z.ZodObject<{
989
+ type: z.ZodLiteral<"STRING_ERROR">;
990
+ raw: z.ZodString;
991
+ }, "strip", z.ZodTypeAny, {
992
+ type: "STRING_ERROR";
993
+ raw: string;
994
+ }, {
995
+ type: "STRING_ERROR";
996
+ raw: string;
997
+ }>, z.ZodObject<{
998
+ type: z.ZodLiteral<"INTERNAL_ERROR">;
999
+ code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR", "COULD_NOT_FIND_TASK", "CONFIGURED_INCORRECTLY", "TASK_ALREADY_RUNNING", "TASK_EXECUTION_FAILED", "TASK_EXECUTION_ABORTED", "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE", "TASK_PROCESS_SIGKILL_TIMEOUT", "TASK_RUN_CANCELLED", "TASK_OUTPUT_ERROR", "HANDLE_ERROR_ERROR", "GRACEFUL_EXIT_TIMEOUT", "TASK_RUN_HEARTBEAT_TIMEOUT"]>;
1000
+ message: z.ZodOptional<z.ZodString>;
1001
+ }, "strip", z.ZodTypeAny, {
1002
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1003
+ type: "INTERNAL_ERROR";
1004
+ message?: string | undefined;
1005
+ }, {
1006
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1007
+ type: "INTERNAL_ERROR";
1008
+ message?: string | undefined;
1009
+ }>]>;
1010
+ retry: z.ZodOptional<z.ZodObject<{
1011
+ timestamp: z.ZodNumber;
1012
+ delay: z.ZodNumber;
1013
+ error: z.ZodOptional<z.ZodUnknown>;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ timestamp: number;
1016
+ delay: number;
1017
+ error?: unknown;
1018
+ }, {
1019
+ timestamp: number;
1020
+ delay: number;
1021
+ error?: unknown;
1022
+ }>>;
1023
+ skippedRetrying: z.ZodOptional<z.ZodBoolean>;
1024
+ }, "strip", z.ZodTypeAny, {
1025
+ error: {
1026
+ type: "BUILT_IN_ERROR";
1027
+ message: string;
1028
+ name: string;
1029
+ stackTrace: string;
1030
+ } | {
1031
+ type: "CUSTOM_ERROR";
1032
+ raw: string;
1033
+ } | {
1034
+ type: "STRING_ERROR";
1035
+ raw: string;
1036
+ } | {
1037
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1038
+ type: "INTERNAL_ERROR";
1039
+ message?: string | undefined;
1040
+ };
1041
+ id: string;
1042
+ ok: false;
1043
+ retry?: {
1044
+ timestamp: number;
1045
+ delay: number;
1046
+ error?: unknown;
1047
+ } | undefined;
1048
+ skippedRetrying?: boolean | undefined;
1049
+ }, {
1050
+ error: {
1051
+ type: "BUILT_IN_ERROR";
1052
+ message: string;
1053
+ name: string;
1054
+ stackTrace: string;
1055
+ } | {
1056
+ type: "CUSTOM_ERROR";
1057
+ raw: string;
1058
+ } | {
1059
+ type: "STRING_ERROR";
1060
+ raw: string;
1061
+ } | {
1062
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1063
+ type: "INTERNAL_ERROR";
1064
+ message?: string | undefined;
1065
+ };
1066
+ id: string;
1067
+ ok: false;
1068
+ retry?: {
1069
+ timestamp: number;
1070
+ delay: number;
1071
+ error?: unknown;
1072
+ } | undefined;
1073
+ skippedRetrying?: boolean | undefined;
1074
+ }>]>, "many">;
1075
+ }, "strip", z.ZodTypeAny, {
1076
+ id: string;
1077
+ items: ({
1078
+ id: string;
1079
+ ok: true;
1080
+ outputType: string;
1081
+ output?: string | undefined;
1082
+ } | {
1083
+ error: {
1084
+ type: "BUILT_IN_ERROR";
1085
+ message: string;
1086
+ name: string;
1087
+ stackTrace: string;
1088
+ } | {
1089
+ type: "CUSTOM_ERROR";
1090
+ raw: string;
1091
+ } | {
1092
+ type: "STRING_ERROR";
1093
+ raw: string;
1094
+ } | {
1095
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1096
+ type: "INTERNAL_ERROR";
1097
+ message?: string | undefined;
1098
+ };
1099
+ id: string;
1100
+ ok: false;
1101
+ retry?: {
1102
+ timestamp: number;
1103
+ delay: number;
1104
+ error?: unknown;
1105
+ } | undefined;
1106
+ skippedRetrying?: boolean | undefined;
1107
+ })[];
1108
+ }, {
1109
+ id: string;
1110
+ items: ({
1111
+ id: string;
1112
+ ok: true;
1113
+ outputType: string;
1114
+ output?: string | undefined;
1115
+ } | {
1116
+ error: {
1117
+ type: "BUILT_IN_ERROR";
1118
+ message: string;
1119
+ name: string;
1120
+ stackTrace: string;
1121
+ } | {
1122
+ type: "CUSTOM_ERROR";
1123
+ raw: string;
1124
+ } | {
1125
+ type: "STRING_ERROR";
1126
+ raw: string;
1127
+ } | {
1128
+ code: "COULD_NOT_FIND_EXECUTOR" | "COULD_NOT_FIND_TASK" | "CONFIGURED_INCORRECTLY" | "TASK_ALREADY_RUNNING" | "TASK_EXECUTION_FAILED" | "TASK_EXECUTION_ABORTED" | "TASK_PROCESS_EXITED_WITH_NON_ZERO_CODE" | "TASK_PROCESS_SIGKILL_TIMEOUT" | "TASK_RUN_CANCELLED" | "TASK_OUTPUT_ERROR" | "HANDLE_ERROR_ERROR" | "GRACEFUL_EXIT_TIMEOUT" | "TASK_RUN_HEARTBEAT_TIMEOUT";
1129
+ type: "INTERNAL_ERROR";
1130
+ message?: string | undefined;
1131
+ };
1132
+ id: string;
1133
+ ok: false;
1134
+ retry?: {
1135
+ timestamp: number;
1136
+ delay: number;
1137
+ error?: unknown;
1138
+ } | undefined;
1139
+ skippedRetrying?: boolean | undefined;
1140
+ })[];
1141
+ }>;
1142
+ type BatchTaskRunExecutionResult = z.infer<typeof BatchTaskRunExecutionResult>;
1143
+
1144
+ interface RuntimeManager {
1145
+ disable(): void;
1146
+ waitUntil(date: Date): Promise<void>;
1147
+ waitForDuration(ms: number): Promise<void>;
1148
+ waitForTask(params: {
1149
+ id: string;
1150
+ ctx: TaskRunContext;
1151
+ }): Promise<TaskRunExecutionResult>;
1152
+ waitForBatch(params: {
1153
+ id: string;
1154
+ runs: string[];
1155
+ ctx: TaskRunContext;
1156
+ }): Promise<BatchTaskRunExecutionResult>;
1157
+ }
1158
+
1159
+ export { BatchTaskRunExecutionResult as B, type RuntimeManager as R, TaskRunExecutionResult as T, TaskRunError as a, TaskRunContext as b, TaskRunBuiltInError as c, TaskRunCustomErrorObject as d, TaskRunStringError as e, TaskRunErrorCodes as f, TaskRunInternalError as g, TaskRun as h, TaskRunExecutionTask as i, TaskRunExecutionAttempt as j, TaskRunExecutionEnvironment as k, TaskRunExecutionOrganization as l, TaskRunExecutionProject as m, TaskRunExecutionQueue as n, TaskRunExecutionBatch as o, TaskRunExecution as p, TaskRunExecutionRetry as q, TaskRunFailedExecutionResult as r, TaskRunSuccessfulExecutionResult as s };