@trigger.dev/core 0.0.0-prerelease-20240219135254 → 0.0.0-prerelease-20240401121508

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.
@@ -1,3651 +0,0 @@
1
- import * as zod from 'zod';
2
- import { z } from 'zod';
3
- import * as logsAPI from '@opentelemetry/api-logs';
4
- import { Logger } from '@opentelemetry/api-logs';
5
- import { Attributes, Context, Span, SpanOptions, Tracer } from '@opentelemetry/api';
6
-
7
- declare const CreateAuthorizationCodeResponseSchema: z.ZodObject<{
8
- url: z.ZodString;
9
- authorizationCode: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- url: string;
12
- authorizationCode: string;
13
- }, {
14
- url: string;
15
- authorizationCode: string;
16
- }>;
17
- type CreateAuthorizationCodeResponse = z.infer<typeof CreateAuthorizationCodeResponseSchema>;
18
- declare const GetPersonalAccessTokenRequestSchema: z.ZodObject<{
19
- authorizationCode: z.ZodString;
20
- }, "strip", z.ZodTypeAny, {
21
- authorizationCode: string;
22
- }, {
23
- authorizationCode: string;
24
- }>;
25
- type GetPersonalAccessTokenRequest = z.infer<typeof GetPersonalAccessTokenRequestSchema>;
26
- declare const GetPersonalAccessTokenResponseSchema: z.ZodObject<{
27
- token: z.ZodNullable<z.ZodObject<{
28
- token: z.ZodString;
29
- obfuscatedToken: z.ZodString;
30
- }, "strip", z.ZodTypeAny, {
31
- token: string;
32
- obfuscatedToken: string;
33
- }, {
34
- token: string;
35
- obfuscatedToken: string;
36
- }>>;
37
- }, "strip", z.ZodTypeAny, {
38
- token: {
39
- token: string;
40
- obfuscatedToken: string;
41
- } | null;
42
- }, {
43
- token: {
44
- token: string;
45
- obfuscatedToken: string;
46
- } | null;
47
- }>;
48
- type GetPersonalAccessTokenResponse = z.infer<typeof GetPersonalAccessTokenResponseSchema>;
49
-
50
- declare const WhoAmIResponseSchema: z.ZodObject<{
51
- userId: z.ZodString;
52
- email: z.ZodString;
53
- }, "strip", z.ZodTypeAny, {
54
- userId: string;
55
- email: string;
56
- }, {
57
- userId: string;
58
- email: string;
59
- }>;
60
- type WhoAmIResponse = z.infer<typeof WhoAmIResponseSchema>;
61
- declare const GetProjectDevResponse: z.ZodObject<{
62
- apiKey: z.ZodString;
63
- name: z.ZodString;
64
- }, "strip", z.ZodTypeAny, {
65
- apiKey: string;
66
- name: string;
67
- }, {
68
- apiKey: string;
69
- name: string;
70
- }>;
71
- type GetProjectDevResponse = z.infer<typeof GetProjectDevResponse>;
72
- declare const CreateBackgroundWorkerRequestBody: z.ZodObject<{
73
- localOnly: z.ZodBoolean;
74
- metadata: z.ZodObject<{
75
- packageVersion: z.ZodString;
76
- contentHash: z.ZodString;
77
- cliPackageVersion: z.ZodString;
78
- tasks: z.ZodArray<z.ZodObject<{
79
- id: z.ZodString;
80
- filePath: z.ZodString;
81
- exportName: z.ZodString;
82
- }, "strip", z.ZodTypeAny, {
83
- id: string;
84
- filePath: string;
85
- exportName: string;
86
- }, {
87
- id: string;
88
- filePath: string;
89
- exportName: string;
90
- }>, "many">;
91
- }, "strip", z.ZodTypeAny, {
92
- packageVersion: string;
93
- contentHash: string;
94
- cliPackageVersion: string;
95
- tasks: {
96
- id: string;
97
- filePath: string;
98
- exportName: string;
99
- }[];
100
- }, {
101
- packageVersion: string;
102
- contentHash: string;
103
- cliPackageVersion: string;
104
- tasks: {
105
- id: string;
106
- filePath: string;
107
- exportName: string;
108
- }[];
109
- }>;
110
- }, "strip", z.ZodTypeAny, {
111
- localOnly: boolean;
112
- metadata: {
113
- packageVersion: string;
114
- contentHash: string;
115
- cliPackageVersion: string;
116
- tasks: {
117
- id: string;
118
- filePath: string;
119
- exportName: string;
120
- }[];
121
- };
122
- }, {
123
- localOnly: boolean;
124
- metadata: {
125
- packageVersion: string;
126
- contentHash: string;
127
- cliPackageVersion: string;
128
- tasks: {
129
- id: string;
130
- filePath: string;
131
- exportName: string;
132
- }[];
133
- };
134
- }>;
135
- type CreateBackgroundWorkerRequestBody = z.infer<typeof CreateBackgroundWorkerRequestBody>;
136
- declare const CreateBackgroundWorkerResponse: z.ZodObject<{
137
- id: z.ZodString;
138
- version: z.ZodString;
139
- contentHash: z.ZodString;
140
- }, "strip", z.ZodTypeAny, {
141
- id: string;
142
- contentHash: string;
143
- version: string;
144
- }, {
145
- id: string;
146
- contentHash: string;
147
- version: string;
148
- }>;
149
- type CreateBackgroundWorkerResponse = z.infer<typeof CreateBackgroundWorkerResponse>;
150
- declare const BackgroundWorkerRecord: z.ZodObject<{
151
- id: z.ZodString;
152
- version: z.ZodString;
153
- contentHash: z.ZodString;
154
- }, "strip", z.ZodTypeAny, {
155
- id: string;
156
- contentHash: string;
157
- version: string;
158
- }, {
159
- id: string;
160
- contentHash: string;
161
- version: string;
162
- }>;
163
- type BackgroundWorkerRecord = CreateBackgroundWorkerResponse;
164
- declare const TriggerTaskRequestBody: z.ZodObject<{
165
- payload: z.ZodAny;
166
- context: z.ZodAny;
167
- options: z.ZodOptional<z.ZodObject<{
168
- parentAttempt: z.ZodOptional<z.ZodString>;
169
- lockToCurrentVersion: z.ZodOptional<z.ZodBoolean>;
170
- }, "strip", z.ZodTypeAny, {
171
- parentAttempt?: string | undefined;
172
- lockToCurrentVersion?: boolean | undefined;
173
- }, {
174
- parentAttempt?: string | undefined;
175
- lockToCurrentVersion?: boolean | undefined;
176
- }>>;
177
- }, "strip", z.ZodTypeAny, {
178
- payload?: any;
179
- context?: any;
180
- options?: {
181
- parentAttempt?: string | undefined;
182
- lockToCurrentVersion?: boolean | undefined;
183
- } | undefined;
184
- }, {
185
- payload?: any;
186
- context?: any;
187
- options?: {
188
- parentAttempt?: string | undefined;
189
- lockToCurrentVersion?: boolean | undefined;
190
- } | undefined;
191
- }>;
192
- type TriggerTaskRequestBody = z.infer<typeof TriggerTaskRequestBody>;
193
- declare const TriggerTaskResponse: z.ZodObject<{
194
- id: z.ZodString;
195
- }, "strip", z.ZodTypeAny, {
196
- id: string;
197
- }, {
198
- id: string;
199
- }>;
200
- type TriggerTaskResponse = z.infer<typeof TriggerTaskResponse>;
201
-
202
- declare const TaskResource: z.ZodObject<{
203
- id: z.ZodString;
204
- filePath: z.ZodString;
205
- exportName: z.ZodString;
206
- }, "strip", z.ZodTypeAny, {
207
- id: string;
208
- filePath: string;
209
- exportName: string;
210
- }, {
211
- id: string;
212
- filePath: string;
213
- exportName: string;
214
- }>;
215
- type TaskResource = z.infer<typeof TaskResource>;
216
- declare const BackgroundWorkerMetadata: z.ZodObject<{
217
- packageVersion: z.ZodString;
218
- contentHash: z.ZodString;
219
- cliPackageVersion: z.ZodString;
220
- tasks: z.ZodArray<z.ZodObject<{
221
- id: z.ZodString;
222
- filePath: z.ZodString;
223
- exportName: z.ZodString;
224
- }, "strip", z.ZodTypeAny, {
225
- id: string;
226
- filePath: string;
227
- exportName: string;
228
- }, {
229
- id: string;
230
- filePath: string;
231
- exportName: string;
232
- }>, "many">;
233
- }, "strip", z.ZodTypeAny, {
234
- packageVersion: string;
235
- contentHash: string;
236
- cliPackageVersion: string;
237
- tasks: {
238
- id: string;
239
- filePath: string;
240
- exportName: string;
241
- }[];
242
- }, {
243
- packageVersion: string;
244
- contentHash: string;
245
- cliPackageVersion: string;
246
- tasks: {
247
- id: string;
248
- filePath: string;
249
- exportName: string;
250
- }[];
251
- }>;
252
- type BackgroundWorkerMetadata = z.infer<typeof BackgroundWorkerMetadata>;
253
-
254
- declare const TaskRunBuiltInError: z.ZodObject<{
255
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
256
- name: z.ZodString;
257
- message: z.ZodString;
258
- stackTrace: z.ZodString;
259
- }, "strip", z.ZodTypeAny, {
260
- message: string;
261
- type: "BUILT_IN_ERROR";
262
- name: string;
263
- stackTrace: string;
264
- }, {
265
- message: string;
266
- type: "BUILT_IN_ERROR";
267
- name: string;
268
- stackTrace: string;
269
- }>;
270
- type TaskRunBuiltInError = z.infer<typeof TaskRunBuiltInError>;
271
- declare const TaskRunCustomErrorObject: z.ZodObject<{
272
- type: z.ZodLiteral<"CUSTOM_ERROR">;
273
- raw: z.ZodString;
274
- }, "strip", z.ZodTypeAny, {
275
- type: "CUSTOM_ERROR";
276
- raw: string;
277
- }, {
278
- type: "CUSTOM_ERROR";
279
- raw: string;
280
- }>;
281
- type TaskRunCustomErrorObject = z.infer<typeof TaskRunCustomErrorObject>;
282
- declare const TaskRunStringError: z.ZodObject<{
283
- type: z.ZodLiteral<"STRING_ERROR">;
284
- raw: z.ZodString;
285
- }, "strip", z.ZodTypeAny, {
286
- type: "STRING_ERROR";
287
- raw: string;
288
- }, {
289
- type: "STRING_ERROR";
290
- raw: string;
291
- }>;
292
- type TaskRunStringError = z.infer<typeof TaskRunStringError>;
293
- declare const TaskRunErrorCodes: {
294
- readonly COULD_NOT_FIND_EXECUTOR: "COULD_NOT_FIND_EXECUTOR";
295
- };
296
- declare const TaskRunInternalError: z.ZodObject<{
297
- type: z.ZodLiteral<"INTERNAL_ERROR">;
298
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
299
- }, "strip", z.ZodTypeAny, {
300
- code: "COULD_NOT_FIND_EXECUTOR";
301
- type: "INTERNAL_ERROR";
302
- }, {
303
- code: "COULD_NOT_FIND_EXECUTOR";
304
- type: "INTERNAL_ERROR";
305
- }>;
306
- type TaskRunInternalError = z.infer<typeof TaskRunInternalError>;
307
- declare const TaskRunError: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
308
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
309
- name: z.ZodString;
310
- message: z.ZodString;
311
- stackTrace: z.ZodString;
312
- }, "strip", z.ZodTypeAny, {
313
- message: string;
314
- type: "BUILT_IN_ERROR";
315
- name: string;
316
- stackTrace: string;
317
- }, {
318
- message: string;
319
- type: "BUILT_IN_ERROR";
320
- name: string;
321
- stackTrace: string;
322
- }>, z.ZodObject<{
323
- type: z.ZodLiteral<"CUSTOM_ERROR">;
324
- raw: z.ZodString;
325
- }, "strip", z.ZodTypeAny, {
326
- type: "CUSTOM_ERROR";
327
- raw: string;
328
- }, {
329
- type: "CUSTOM_ERROR";
330
- raw: string;
331
- }>, z.ZodObject<{
332
- type: z.ZodLiteral<"STRING_ERROR">;
333
- raw: z.ZodString;
334
- }, "strip", z.ZodTypeAny, {
335
- type: "STRING_ERROR";
336
- raw: string;
337
- }, {
338
- type: "STRING_ERROR";
339
- raw: string;
340
- }>, z.ZodObject<{
341
- type: z.ZodLiteral<"INTERNAL_ERROR">;
342
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
343
- }, "strip", z.ZodTypeAny, {
344
- code: "COULD_NOT_FIND_EXECUTOR";
345
- type: "INTERNAL_ERROR";
346
- }, {
347
- code: "COULD_NOT_FIND_EXECUTOR";
348
- type: "INTERNAL_ERROR";
349
- }>]>;
350
- type TaskRunError = z.infer<typeof TaskRunError>;
351
- declare const TaskRun: z.ZodObject<{
352
- id: z.ZodString;
353
- payload: z.ZodString;
354
- payloadType: z.ZodString;
355
- context: z.ZodAny;
356
- tags: z.ZodArray<z.ZodString, "many">;
357
- createdAt: z.ZodDate;
358
- }, "strip", z.ZodTypeAny, {
359
- payload: string;
360
- id: string;
361
- payloadType: string;
362
- tags: string[];
363
- createdAt: Date;
364
- context?: any;
365
- }, {
366
- payload: string;
367
- id: string;
368
- payloadType: string;
369
- tags: string[];
370
- createdAt: Date;
371
- context?: any;
372
- }>;
373
- type TaskRun = z.infer<typeof TaskRun>;
374
- declare const TaskRunExecutionTask: z.ZodObject<{
375
- id: z.ZodString;
376
- filePath: z.ZodString;
377
- exportName: z.ZodString;
378
- }, "strip", z.ZodTypeAny, {
379
- id: string;
380
- filePath: string;
381
- exportName: string;
382
- }, {
383
- id: string;
384
- filePath: string;
385
- exportName: string;
386
- }>;
387
- type TaskRunExecutionTask = z.infer<typeof TaskRunExecutionTask>;
388
- declare const TaskRunExecutionAttempt: z.ZodObject<{
389
- id: z.ZodString;
390
- number: z.ZodNumber;
391
- startedAt: z.ZodDate;
392
- backgroundWorkerId: z.ZodString;
393
- backgroundWorkerTaskId: z.ZodString;
394
- status: z.ZodString;
395
- }, "strip", z.ZodTypeAny, {
396
- number: number;
397
- status: string;
398
- id: string;
399
- startedAt: Date;
400
- backgroundWorkerId: string;
401
- backgroundWorkerTaskId: string;
402
- }, {
403
- number: number;
404
- status: string;
405
- id: string;
406
- startedAt: Date;
407
- backgroundWorkerId: string;
408
- backgroundWorkerTaskId: string;
409
- }>;
410
- type TaskRunExecutionAttempt = z.infer<typeof TaskRunExecutionAttempt>;
411
- declare const TaskRunExecutionEnvironment: z.ZodObject<{
412
- id: z.ZodString;
413
- slug: z.ZodString;
414
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
415
- }, "strip", z.ZodTypeAny, {
416
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
417
- id: string;
418
- slug: string;
419
- }, {
420
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
421
- id: string;
422
- slug: string;
423
- }>;
424
- type TaskRunExecutionEnvironment = z.infer<typeof TaskRunExecutionEnvironment>;
425
- declare const TaskRunExecutionOrganization: z.ZodObject<{
426
- id: z.ZodString;
427
- slug: z.ZodString;
428
- name: z.ZodString;
429
- }, "strip", z.ZodTypeAny, {
430
- id: string;
431
- name: string;
432
- slug: string;
433
- }, {
434
- id: string;
435
- name: string;
436
- slug: string;
437
- }>;
438
- type TaskRunExecutionOrganization = z.infer<typeof TaskRunExecutionOrganization>;
439
- declare const TaskRunExecutionProject: z.ZodObject<{
440
- id: z.ZodString;
441
- ref: z.ZodString;
442
- slug: z.ZodString;
443
- name: z.ZodString;
444
- }, "strip", z.ZodTypeAny, {
445
- id: string;
446
- name: string;
447
- slug: string;
448
- ref: string;
449
- }, {
450
- id: string;
451
- name: string;
452
- slug: string;
453
- ref: string;
454
- }>;
455
- type TaskRunExecutionProject = z.infer<typeof TaskRunExecutionProject>;
456
- declare const TaskRunExecution: z.ZodObject<{
457
- task: z.ZodObject<{
458
- id: z.ZodString;
459
- filePath: z.ZodString;
460
- exportName: z.ZodString;
461
- }, "strip", z.ZodTypeAny, {
462
- id: string;
463
- filePath: string;
464
- exportName: string;
465
- }, {
466
- id: string;
467
- filePath: string;
468
- exportName: string;
469
- }>;
470
- attempt: z.ZodObject<{
471
- id: z.ZodString;
472
- number: z.ZodNumber;
473
- startedAt: z.ZodDate;
474
- backgroundWorkerId: z.ZodString;
475
- backgroundWorkerTaskId: z.ZodString;
476
- status: z.ZodString;
477
- }, "strip", z.ZodTypeAny, {
478
- number: number;
479
- status: string;
480
- id: string;
481
- startedAt: Date;
482
- backgroundWorkerId: string;
483
- backgroundWorkerTaskId: string;
484
- }, {
485
- number: number;
486
- status: string;
487
- id: string;
488
- startedAt: Date;
489
- backgroundWorkerId: string;
490
- backgroundWorkerTaskId: string;
491
- }>;
492
- run: z.ZodObject<{
493
- id: z.ZodString;
494
- payload: z.ZodString;
495
- payloadType: z.ZodString;
496
- context: z.ZodAny;
497
- tags: z.ZodArray<z.ZodString, "many">;
498
- createdAt: z.ZodDate;
499
- }, "strip", z.ZodTypeAny, {
500
- payload: string;
501
- id: string;
502
- payloadType: string;
503
- tags: string[];
504
- createdAt: Date;
505
- context?: any;
506
- }, {
507
- payload: string;
508
- id: string;
509
- payloadType: string;
510
- tags: string[];
511
- createdAt: Date;
512
- context?: any;
513
- }>;
514
- environment: z.ZodObject<{
515
- id: z.ZodString;
516
- slug: z.ZodString;
517
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
518
- }, "strip", z.ZodTypeAny, {
519
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
520
- id: string;
521
- slug: string;
522
- }, {
523
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
524
- id: string;
525
- slug: string;
526
- }>;
527
- organization: z.ZodObject<{
528
- id: z.ZodString;
529
- slug: z.ZodString;
530
- name: z.ZodString;
531
- }, "strip", z.ZodTypeAny, {
532
- id: string;
533
- name: string;
534
- slug: string;
535
- }, {
536
- id: string;
537
- name: string;
538
- slug: string;
539
- }>;
540
- project: z.ZodObject<{
541
- id: z.ZodString;
542
- ref: z.ZodString;
543
- slug: z.ZodString;
544
- name: z.ZodString;
545
- }, "strip", z.ZodTypeAny, {
546
- id: string;
547
- name: string;
548
- slug: string;
549
- ref: string;
550
- }, {
551
- id: string;
552
- name: string;
553
- slug: string;
554
- ref: string;
555
- }>;
556
- }, "strip", z.ZodTypeAny, {
557
- task: {
558
- id: string;
559
- filePath: string;
560
- exportName: string;
561
- };
562
- attempt: {
563
- number: number;
564
- status: string;
565
- id: string;
566
- startedAt: Date;
567
- backgroundWorkerId: string;
568
- backgroundWorkerTaskId: string;
569
- };
570
- run: {
571
- payload: string;
572
- id: string;
573
- payloadType: string;
574
- tags: string[];
575
- createdAt: Date;
576
- context?: any;
577
- };
578
- environment: {
579
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
580
- id: string;
581
- slug: string;
582
- };
583
- organization: {
584
- id: string;
585
- name: string;
586
- slug: string;
587
- };
588
- project: {
589
- id: string;
590
- name: string;
591
- slug: string;
592
- ref: string;
593
- };
594
- }, {
595
- task: {
596
- id: string;
597
- filePath: string;
598
- exportName: string;
599
- };
600
- attempt: {
601
- number: number;
602
- status: string;
603
- id: string;
604
- startedAt: Date;
605
- backgroundWorkerId: string;
606
- backgroundWorkerTaskId: string;
607
- };
608
- run: {
609
- payload: string;
610
- id: string;
611
- payloadType: string;
612
- tags: string[];
613
- createdAt: Date;
614
- context?: any;
615
- };
616
- environment: {
617
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
618
- id: string;
619
- slug: string;
620
- };
621
- organization: {
622
- id: string;
623
- name: string;
624
- slug: string;
625
- };
626
- project: {
627
- id: string;
628
- name: string;
629
- slug: string;
630
- ref: string;
631
- };
632
- }>;
633
- type TaskRunExecution = z.infer<typeof TaskRunExecution>;
634
- declare const TaskRunContext: z.ZodObject<{
635
- task: z.ZodObject<{
636
- id: z.ZodString;
637
- filePath: z.ZodString;
638
- exportName: z.ZodString;
639
- }, "strip", z.ZodTypeAny, {
640
- id: string;
641
- filePath: string;
642
- exportName: string;
643
- }, {
644
- id: string;
645
- filePath: string;
646
- exportName: string;
647
- }>;
648
- attempt: z.ZodObject<Omit<{
649
- id: z.ZodString;
650
- number: z.ZodNumber;
651
- startedAt: z.ZodDate;
652
- backgroundWorkerId: z.ZodString;
653
- backgroundWorkerTaskId: z.ZodString;
654
- status: z.ZodString;
655
- }, "backgroundWorkerId" | "backgroundWorkerTaskId">, "strip", z.ZodTypeAny, {
656
- number: number;
657
- status: string;
658
- id: string;
659
- startedAt: Date;
660
- }, {
661
- number: number;
662
- status: string;
663
- id: string;
664
- startedAt: Date;
665
- }>;
666
- run: z.ZodObject<Omit<{
667
- id: z.ZodString;
668
- payload: z.ZodString;
669
- payloadType: z.ZodString;
670
- context: z.ZodAny;
671
- tags: z.ZodArray<z.ZodString, "many">;
672
- createdAt: z.ZodDate;
673
- }, "payload" | "payloadType">, "strip", z.ZodTypeAny, {
674
- id: string;
675
- tags: string[];
676
- createdAt: Date;
677
- context?: any;
678
- }, {
679
- id: string;
680
- tags: string[];
681
- createdAt: Date;
682
- context?: any;
683
- }>;
684
- environment: z.ZodObject<{
685
- id: z.ZodString;
686
- slug: z.ZodString;
687
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
688
- }, "strip", z.ZodTypeAny, {
689
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
690
- id: string;
691
- slug: string;
692
- }, {
693
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
694
- id: string;
695
- slug: string;
696
- }>;
697
- organization: z.ZodObject<{
698
- id: z.ZodString;
699
- slug: z.ZodString;
700
- name: z.ZodString;
701
- }, "strip", z.ZodTypeAny, {
702
- id: string;
703
- name: string;
704
- slug: string;
705
- }, {
706
- id: string;
707
- name: string;
708
- slug: string;
709
- }>;
710
- project: z.ZodObject<{
711
- id: z.ZodString;
712
- ref: z.ZodString;
713
- slug: z.ZodString;
714
- name: z.ZodString;
715
- }, "strip", z.ZodTypeAny, {
716
- id: string;
717
- name: string;
718
- slug: string;
719
- ref: string;
720
- }, {
721
- id: string;
722
- name: string;
723
- slug: string;
724
- ref: string;
725
- }>;
726
- }, "strip", z.ZodTypeAny, {
727
- task: {
728
- id: string;
729
- filePath: string;
730
- exportName: string;
731
- };
732
- attempt: {
733
- number: number;
734
- status: string;
735
- id: string;
736
- startedAt: Date;
737
- };
738
- run: {
739
- id: string;
740
- tags: string[];
741
- createdAt: Date;
742
- context?: any;
743
- };
744
- environment: {
745
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
746
- id: string;
747
- slug: string;
748
- };
749
- organization: {
750
- id: string;
751
- name: string;
752
- slug: string;
753
- };
754
- project: {
755
- id: string;
756
- name: string;
757
- slug: string;
758
- ref: string;
759
- };
760
- }, {
761
- task: {
762
- id: string;
763
- filePath: string;
764
- exportName: string;
765
- };
766
- attempt: {
767
- number: number;
768
- status: string;
769
- id: string;
770
- startedAt: Date;
771
- };
772
- run: {
773
- id: string;
774
- tags: string[];
775
- createdAt: Date;
776
- context?: any;
777
- };
778
- environment: {
779
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
780
- id: string;
781
- slug: string;
782
- };
783
- organization: {
784
- id: string;
785
- name: string;
786
- slug: string;
787
- };
788
- project: {
789
- id: string;
790
- name: string;
791
- slug: string;
792
- ref: string;
793
- };
794
- }>;
795
- type TaskRunContext = z.infer<typeof TaskRunContext>;
796
- declare const TaskRunFailedExecutionResult: z.ZodObject<{
797
- ok: z.ZodLiteral<false>;
798
- id: z.ZodString;
799
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
800
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
801
- name: z.ZodString;
802
- message: z.ZodString;
803
- stackTrace: z.ZodString;
804
- }, "strip", z.ZodTypeAny, {
805
- message: string;
806
- type: "BUILT_IN_ERROR";
807
- name: string;
808
- stackTrace: string;
809
- }, {
810
- message: string;
811
- type: "BUILT_IN_ERROR";
812
- name: string;
813
- stackTrace: string;
814
- }>, z.ZodObject<{
815
- type: z.ZodLiteral<"CUSTOM_ERROR">;
816
- raw: z.ZodString;
817
- }, "strip", z.ZodTypeAny, {
818
- type: "CUSTOM_ERROR";
819
- raw: string;
820
- }, {
821
- type: "CUSTOM_ERROR";
822
- raw: string;
823
- }>, z.ZodObject<{
824
- type: z.ZodLiteral<"STRING_ERROR">;
825
- raw: z.ZodString;
826
- }, "strip", z.ZodTypeAny, {
827
- type: "STRING_ERROR";
828
- raw: string;
829
- }, {
830
- type: "STRING_ERROR";
831
- raw: string;
832
- }>, z.ZodObject<{
833
- type: z.ZodLiteral<"INTERNAL_ERROR">;
834
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
835
- }, "strip", z.ZodTypeAny, {
836
- code: "COULD_NOT_FIND_EXECUTOR";
837
- type: "INTERNAL_ERROR";
838
- }, {
839
- code: "COULD_NOT_FIND_EXECUTOR";
840
- type: "INTERNAL_ERROR";
841
- }>]>;
842
- }, "strip", z.ZodTypeAny, {
843
- id: string;
844
- error: {
845
- message: string;
846
- type: "BUILT_IN_ERROR";
847
- name: string;
848
- stackTrace: string;
849
- } | {
850
- type: "CUSTOM_ERROR";
851
- raw: string;
852
- } | {
853
- type: "STRING_ERROR";
854
- raw: string;
855
- } | {
856
- code: "COULD_NOT_FIND_EXECUTOR";
857
- type: "INTERNAL_ERROR";
858
- };
859
- ok: false;
860
- }, {
861
- id: string;
862
- error: {
863
- message: string;
864
- type: "BUILT_IN_ERROR";
865
- name: string;
866
- stackTrace: string;
867
- } | {
868
- type: "CUSTOM_ERROR";
869
- raw: string;
870
- } | {
871
- type: "STRING_ERROR";
872
- raw: string;
873
- } | {
874
- code: "COULD_NOT_FIND_EXECUTOR";
875
- type: "INTERNAL_ERROR";
876
- };
877
- ok: false;
878
- }>;
879
- type TaskRunFailedExecutionResult = z.infer<typeof TaskRunFailedExecutionResult>;
880
- declare const TaskRunSuccessfulExecutionResult: z.ZodObject<{
881
- ok: z.ZodLiteral<true>;
882
- id: z.ZodString;
883
- output: z.ZodString;
884
- outputType: z.ZodString;
885
- }, "strip", z.ZodTypeAny, {
886
- id: string;
887
- ok: true;
888
- output: string;
889
- outputType: string;
890
- }, {
891
- id: string;
892
- ok: true;
893
- output: string;
894
- outputType: string;
895
- }>;
896
- type TaskRunSuccessfulExecutionResult = z.infer<typeof TaskRunSuccessfulExecutionResult>;
897
- declare const TaskRunExecutionResult: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
898
- ok: z.ZodLiteral<true>;
899
- id: z.ZodString;
900
- output: z.ZodString;
901
- outputType: z.ZodString;
902
- }, "strip", z.ZodTypeAny, {
903
- id: string;
904
- ok: true;
905
- output: string;
906
- outputType: string;
907
- }, {
908
- id: string;
909
- ok: true;
910
- output: string;
911
- outputType: string;
912
- }>, z.ZodObject<{
913
- ok: z.ZodLiteral<false>;
914
- id: z.ZodString;
915
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
916
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
917
- name: z.ZodString;
918
- message: z.ZodString;
919
- stackTrace: z.ZodString;
920
- }, "strip", z.ZodTypeAny, {
921
- message: string;
922
- type: "BUILT_IN_ERROR";
923
- name: string;
924
- stackTrace: string;
925
- }, {
926
- message: string;
927
- type: "BUILT_IN_ERROR";
928
- name: string;
929
- stackTrace: string;
930
- }>, z.ZodObject<{
931
- type: z.ZodLiteral<"CUSTOM_ERROR">;
932
- raw: z.ZodString;
933
- }, "strip", z.ZodTypeAny, {
934
- type: "CUSTOM_ERROR";
935
- raw: string;
936
- }, {
937
- type: "CUSTOM_ERROR";
938
- raw: string;
939
- }>, z.ZodObject<{
940
- type: z.ZodLiteral<"STRING_ERROR">;
941
- raw: z.ZodString;
942
- }, "strip", z.ZodTypeAny, {
943
- type: "STRING_ERROR";
944
- raw: string;
945
- }, {
946
- type: "STRING_ERROR";
947
- raw: string;
948
- }>, z.ZodObject<{
949
- type: z.ZodLiteral<"INTERNAL_ERROR">;
950
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
951
- }, "strip", z.ZodTypeAny, {
952
- code: "COULD_NOT_FIND_EXECUTOR";
953
- type: "INTERNAL_ERROR";
954
- }, {
955
- code: "COULD_NOT_FIND_EXECUTOR";
956
- type: "INTERNAL_ERROR";
957
- }>]>;
958
- }, "strip", z.ZodTypeAny, {
959
- id: string;
960
- error: {
961
- message: string;
962
- type: "BUILT_IN_ERROR";
963
- name: string;
964
- stackTrace: string;
965
- } | {
966
- type: "CUSTOM_ERROR";
967
- raw: string;
968
- } | {
969
- type: "STRING_ERROR";
970
- raw: string;
971
- } | {
972
- code: "COULD_NOT_FIND_EXECUTOR";
973
- type: "INTERNAL_ERROR";
974
- };
975
- ok: false;
976
- }, {
977
- id: string;
978
- error: {
979
- message: string;
980
- type: "BUILT_IN_ERROR";
981
- name: string;
982
- stackTrace: string;
983
- } | {
984
- type: "CUSTOM_ERROR";
985
- raw: string;
986
- } | {
987
- type: "STRING_ERROR";
988
- raw: string;
989
- } | {
990
- code: "COULD_NOT_FIND_EXECUTOR";
991
- type: "INTERNAL_ERROR";
992
- };
993
- ok: false;
994
- }>]>;
995
- type TaskRunExecutionResult = z.infer<typeof TaskRunExecutionResult>;
996
-
997
- declare const TaskRunExecutionPayload: z.ZodObject<{
998
- execution: z.ZodObject<{
999
- task: z.ZodObject<{
1000
- id: z.ZodString;
1001
- filePath: z.ZodString;
1002
- exportName: z.ZodString;
1003
- }, "strip", z.ZodTypeAny, {
1004
- id: string;
1005
- filePath: string;
1006
- exportName: string;
1007
- }, {
1008
- id: string;
1009
- filePath: string;
1010
- exportName: string;
1011
- }>;
1012
- attempt: z.ZodObject<{
1013
- id: z.ZodString;
1014
- number: z.ZodNumber;
1015
- startedAt: z.ZodDate;
1016
- backgroundWorkerId: z.ZodString;
1017
- backgroundWorkerTaskId: z.ZodString;
1018
- status: z.ZodString;
1019
- }, "strip", z.ZodTypeAny, {
1020
- number: number;
1021
- status: string;
1022
- id: string;
1023
- startedAt: Date;
1024
- backgroundWorkerId: string;
1025
- backgroundWorkerTaskId: string;
1026
- }, {
1027
- number: number;
1028
- status: string;
1029
- id: string;
1030
- startedAt: Date;
1031
- backgroundWorkerId: string;
1032
- backgroundWorkerTaskId: string;
1033
- }>;
1034
- run: z.ZodObject<{
1035
- id: z.ZodString;
1036
- payload: z.ZodString;
1037
- payloadType: z.ZodString;
1038
- context: z.ZodAny;
1039
- tags: z.ZodArray<z.ZodString, "many">;
1040
- createdAt: z.ZodDate;
1041
- }, "strip", z.ZodTypeAny, {
1042
- payload: string;
1043
- id: string;
1044
- payloadType: string;
1045
- tags: string[];
1046
- createdAt: Date;
1047
- context?: any;
1048
- }, {
1049
- payload: string;
1050
- id: string;
1051
- payloadType: string;
1052
- tags: string[];
1053
- createdAt: Date;
1054
- context?: any;
1055
- }>;
1056
- environment: z.ZodObject<{
1057
- id: z.ZodString;
1058
- slug: z.ZodString;
1059
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
1060
- }, "strip", z.ZodTypeAny, {
1061
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1062
- id: string;
1063
- slug: string;
1064
- }, {
1065
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1066
- id: string;
1067
- slug: string;
1068
- }>;
1069
- organization: z.ZodObject<{
1070
- id: z.ZodString;
1071
- slug: z.ZodString;
1072
- name: z.ZodString;
1073
- }, "strip", z.ZodTypeAny, {
1074
- id: string;
1075
- name: string;
1076
- slug: string;
1077
- }, {
1078
- id: string;
1079
- name: string;
1080
- slug: string;
1081
- }>;
1082
- project: z.ZodObject<{
1083
- id: z.ZodString;
1084
- ref: z.ZodString;
1085
- slug: z.ZodString;
1086
- name: z.ZodString;
1087
- }, "strip", z.ZodTypeAny, {
1088
- id: string;
1089
- name: string;
1090
- slug: string;
1091
- ref: string;
1092
- }, {
1093
- id: string;
1094
- name: string;
1095
- slug: string;
1096
- ref: string;
1097
- }>;
1098
- }, "strip", z.ZodTypeAny, {
1099
- task: {
1100
- id: string;
1101
- filePath: string;
1102
- exportName: string;
1103
- };
1104
- attempt: {
1105
- number: number;
1106
- status: string;
1107
- id: string;
1108
- startedAt: Date;
1109
- backgroundWorkerId: string;
1110
- backgroundWorkerTaskId: string;
1111
- };
1112
- run: {
1113
- payload: string;
1114
- id: string;
1115
- payloadType: string;
1116
- tags: string[];
1117
- createdAt: Date;
1118
- context?: any;
1119
- };
1120
- environment: {
1121
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1122
- id: string;
1123
- slug: string;
1124
- };
1125
- organization: {
1126
- id: string;
1127
- name: string;
1128
- slug: string;
1129
- };
1130
- project: {
1131
- id: string;
1132
- name: string;
1133
- slug: string;
1134
- ref: string;
1135
- };
1136
- }, {
1137
- task: {
1138
- id: string;
1139
- filePath: string;
1140
- exportName: string;
1141
- };
1142
- attempt: {
1143
- number: number;
1144
- status: string;
1145
- id: string;
1146
- startedAt: Date;
1147
- backgroundWorkerId: string;
1148
- backgroundWorkerTaskId: string;
1149
- };
1150
- run: {
1151
- payload: string;
1152
- id: string;
1153
- payloadType: string;
1154
- tags: string[];
1155
- createdAt: Date;
1156
- context?: any;
1157
- };
1158
- environment: {
1159
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1160
- id: string;
1161
- slug: string;
1162
- };
1163
- organization: {
1164
- id: string;
1165
- name: string;
1166
- slug: string;
1167
- };
1168
- project: {
1169
- id: string;
1170
- name: string;
1171
- slug: string;
1172
- ref: string;
1173
- };
1174
- }>;
1175
- traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1176
- }, "strip", z.ZodTypeAny, {
1177
- execution: {
1178
- task: {
1179
- id: string;
1180
- filePath: string;
1181
- exportName: string;
1182
- };
1183
- attempt: {
1184
- number: number;
1185
- status: string;
1186
- id: string;
1187
- startedAt: Date;
1188
- backgroundWorkerId: string;
1189
- backgroundWorkerTaskId: string;
1190
- };
1191
- run: {
1192
- payload: string;
1193
- id: string;
1194
- payloadType: string;
1195
- tags: string[];
1196
- createdAt: Date;
1197
- context?: any;
1198
- };
1199
- environment: {
1200
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1201
- id: string;
1202
- slug: string;
1203
- };
1204
- organization: {
1205
- id: string;
1206
- name: string;
1207
- slug: string;
1208
- };
1209
- project: {
1210
- id: string;
1211
- name: string;
1212
- slug: string;
1213
- ref: string;
1214
- };
1215
- };
1216
- traceContext: Record<string, unknown>;
1217
- }, {
1218
- execution: {
1219
- task: {
1220
- id: string;
1221
- filePath: string;
1222
- exportName: string;
1223
- };
1224
- attempt: {
1225
- number: number;
1226
- status: string;
1227
- id: string;
1228
- startedAt: Date;
1229
- backgroundWorkerId: string;
1230
- backgroundWorkerTaskId: string;
1231
- };
1232
- run: {
1233
- payload: string;
1234
- id: string;
1235
- payloadType: string;
1236
- tags: string[];
1237
- createdAt: Date;
1238
- context?: any;
1239
- };
1240
- environment: {
1241
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1242
- id: string;
1243
- slug: string;
1244
- };
1245
- organization: {
1246
- id: string;
1247
- name: string;
1248
- slug: string;
1249
- };
1250
- project: {
1251
- id: string;
1252
- name: string;
1253
- slug: string;
1254
- ref: string;
1255
- };
1256
- };
1257
- traceContext: Record<string, unknown>;
1258
- }>;
1259
- type TaskRunExecutionPayload = z.infer<typeof TaskRunExecutionPayload>;
1260
- declare const BackgroundWorkerServerMessages: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1261
- type: z.ZodLiteral<"EXECUTE_RUNS">;
1262
- payloads: z.ZodArray<z.ZodObject<{
1263
- execution: z.ZodObject<{
1264
- task: z.ZodObject<{
1265
- id: z.ZodString;
1266
- filePath: z.ZodString;
1267
- exportName: z.ZodString;
1268
- }, "strip", z.ZodTypeAny, {
1269
- id: string;
1270
- filePath: string;
1271
- exportName: string;
1272
- }, {
1273
- id: string;
1274
- filePath: string;
1275
- exportName: string;
1276
- }>;
1277
- attempt: z.ZodObject<{
1278
- id: z.ZodString;
1279
- number: z.ZodNumber;
1280
- startedAt: z.ZodDate;
1281
- backgroundWorkerId: z.ZodString;
1282
- backgroundWorkerTaskId: z.ZodString;
1283
- status: z.ZodString;
1284
- }, "strip", z.ZodTypeAny, {
1285
- number: number;
1286
- status: string;
1287
- id: string;
1288
- startedAt: Date;
1289
- backgroundWorkerId: string;
1290
- backgroundWorkerTaskId: string;
1291
- }, {
1292
- number: number;
1293
- status: string;
1294
- id: string;
1295
- startedAt: Date;
1296
- backgroundWorkerId: string;
1297
- backgroundWorkerTaskId: string;
1298
- }>;
1299
- run: z.ZodObject<{
1300
- id: z.ZodString;
1301
- payload: z.ZodString;
1302
- payloadType: z.ZodString;
1303
- context: z.ZodAny;
1304
- tags: z.ZodArray<z.ZodString, "many">;
1305
- createdAt: z.ZodDate;
1306
- }, "strip", z.ZodTypeAny, {
1307
- payload: string;
1308
- id: string;
1309
- payloadType: string;
1310
- tags: string[];
1311
- createdAt: Date;
1312
- context?: any;
1313
- }, {
1314
- payload: string;
1315
- id: string;
1316
- payloadType: string;
1317
- tags: string[];
1318
- createdAt: Date;
1319
- context?: any;
1320
- }>;
1321
- environment: z.ZodObject<{
1322
- id: z.ZodString;
1323
- slug: z.ZodString;
1324
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
1325
- }, "strip", z.ZodTypeAny, {
1326
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1327
- id: string;
1328
- slug: string;
1329
- }, {
1330
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1331
- id: string;
1332
- slug: string;
1333
- }>;
1334
- organization: z.ZodObject<{
1335
- id: z.ZodString;
1336
- slug: z.ZodString;
1337
- name: z.ZodString;
1338
- }, "strip", z.ZodTypeAny, {
1339
- id: string;
1340
- name: string;
1341
- slug: string;
1342
- }, {
1343
- id: string;
1344
- name: string;
1345
- slug: string;
1346
- }>;
1347
- project: z.ZodObject<{
1348
- id: z.ZodString;
1349
- ref: z.ZodString;
1350
- slug: z.ZodString;
1351
- name: z.ZodString;
1352
- }, "strip", z.ZodTypeAny, {
1353
- id: string;
1354
- name: string;
1355
- slug: string;
1356
- ref: string;
1357
- }, {
1358
- id: string;
1359
- name: string;
1360
- slug: string;
1361
- ref: string;
1362
- }>;
1363
- }, "strip", z.ZodTypeAny, {
1364
- task: {
1365
- id: string;
1366
- filePath: string;
1367
- exportName: string;
1368
- };
1369
- attempt: {
1370
- number: number;
1371
- status: string;
1372
- id: string;
1373
- startedAt: Date;
1374
- backgroundWorkerId: string;
1375
- backgroundWorkerTaskId: string;
1376
- };
1377
- run: {
1378
- payload: string;
1379
- id: string;
1380
- payloadType: string;
1381
- tags: string[];
1382
- createdAt: Date;
1383
- context?: any;
1384
- };
1385
- environment: {
1386
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1387
- id: string;
1388
- slug: string;
1389
- };
1390
- organization: {
1391
- id: string;
1392
- name: string;
1393
- slug: string;
1394
- };
1395
- project: {
1396
- id: string;
1397
- name: string;
1398
- slug: string;
1399
- ref: string;
1400
- };
1401
- }, {
1402
- task: {
1403
- id: string;
1404
- filePath: string;
1405
- exportName: string;
1406
- };
1407
- attempt: {
1408
- number: number;
1409
- status: string;
1410
- id: string;
1411
- startedAt: Date;
1412
- backgroundWorkerId: string;
1413
- backgroundWorkerTaskId: string;
1414
- };
1415
- run: {
1416
- payload: string;
1417
- id: string;
1418
- payloadType: string;
1419
- tags: string[];
1420
- createdAt: Date;
1421
- context?: any;
1422
- };
1423
- environment: {
1424
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1425
- id: string;
1426
- slug: string;
1427
- };
1428
- organization: {
1429
- id: string;
1430
- name: string;
1431
- slug: string;
1432
- };
1433
- project: {
1434
- id: string;
1435
- name: string;
1436
- slug: string;
1437
- ref: string;
1438
- };
1439
- }>;
1440
- traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1441
- }, "strip", z.ZodTypeAny, {
1442
- execution: {
1443
- task: {
1444
- id: string;
1445
- filePath: string;
1446
- exportName: string;
1447
- };
1448
- attempt: {
1449
- number: number;
1450
- status: string;
1451
- id: string;
1452
- startedAt: Date;
1453
- backgroundWorkerId: string;
1454
- backgroundWorkerTaskId: string;
1455
- };
1456
- run: {
1457
- payload: string;
1458
- id: string;
1459
- payloadType: string;
1460
- tags: string[];
1461
- createdAt: Date;
1462
- context?: any;
1463
- };
1464
- environment: {
1465
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1466
- id: string;
1467
- slug: string;
1468
- };
1469
- organization: {
1470
- id: string;
1471
- name: string;
1472
- slug: string;
1473
- };
1474
- project: {
1475
- id: string;
1476
- name: string;
1477
- slug: string;
1478
- ref: string;
1479
- };
1480
- };
1481
- traceContext: Record<string, unknown>;
1482
- }, {
1483
- execution: {
1484
- task: {
1485
- id: string;
1486
- filePath: string;
1487
- exportName: string;
1488
- };
1489
- attempt: {
1490
- number: number;
1491
- status: string;
1492
- id: string;
1493
- startedAt: Date;
1494
- backgroundWorkerId: string;
1495
- backgroundWorkerTaskId: string;
1496
- };
1497
- run: {
1498
- payload: string;
1499
- id: string;
1500
- payloadType: string;
1501
- tags: string[];
1502
- createdAt: Date;
1503
- context?: any;
1504
- };
1505
- environment: {
1506
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1507
- id: string;
1508
- slug: string;
1509
- };
1510
- organization: {
1511
- id: string;
1512
- name: string;
1513
- slug: string;
1514
- };
1515
- project: {
1516
- id: string;
1517
- name: string;
1518
- slug: string;
1519
- ref: string;
1520
- };
1521
- };
1522
- traceContext: Record<string, unknown>;
1523
- }>, "many">;
1524
- }, "strip", z.ZodTypeAny, {
1525
- type: "EXECUTE_RUNS";
1526
- payloads: {
1527
- execution: {
1528
- task: {
1529
- id: string;
1530
- filePath: string;
1531
- exportName: string;
1532
- };
1533
- attempt: {
1534
- number: number;
1535
- status: string;
1536
- id: string;
1537
- startedAt: Date;
1538
- backgroundWorkerId: string;
1539
- backgroundWorkerTaskId: string;
1540
- };
1541
- run: {
1542
- payload: string;
1543
- id: string;
1544
- payloadType: string;
1545
- tags: string[];
1546
- createdAt: Date;
1547
- context?: any;
1548
- };
1549
- environment: {
1550
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1551
- id: string;
1552
- slug: string;
1553
- };
1554
- organization: {
1555
- id: string;
1556
- name: string;
1557
- slug: string;
1558
- };
1559
- project: {
1560
- id: string;
1561
- name: string;
1562
- slug: string;
1563
- ref: string;
1564
- };
1565
- };
1566
- traceContext: Record<string, unknown>;
1567
- }[];
1568
- }, {
1569
- type: "EXECUTE_RUNS";
1570
- payloads: {
1571
- execution: {
1572
- task: {
1573
- id: string;
1574
- filePath: string;
1575
- exportName: string;
1576
- };
1577
- attempt: {
1578
- number: number;
1579
- status: string;
1580
- id: string;
1581
- startedAt: Date;
1582
- backgroundWorkerId: string;
1583
- backgroundWorkerTaskId: string;
1584
- };
1585
- run: {
1586
- payload: string;
1587
- id: string;
1588
- payloadType: string;
1589
- tags: string[];
1590
- createdAt: Date;
1591
- context?: any;
1592
- };
1593
- environment: {
1594
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1595
- id: string;
1596
- slug: string;
1597
- };
1598
- organization: {
1599
- id: string;
1600
- name: string;
1601
- slug: string;
1602
- };
1603
- project: {
1604
- id: string;
1605
- name: string;
1606
- slug: string;
1607
- ref: string;
1608
- };
1609
- };
1610
- traceContext: Record<string, unknown>;
1611
- }[];
1612
- }>]>;
1613
- type BackgroundWorkerServerMessages = z.infer<typeof BackgroundWorkerServerMessages>;
1614
- declare const serverWebsocketMessages: {
1615
- SERVER_READY: z.ZodObject<{
1616
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
1617
- id: z.ZodString;
1618
- }, "strip", z.ZodTypeAny, {
1619
- id: string;
1620
- version: "v1";
1621
- }, {
1622
- id: string;
1623
- version?: "v1" | undefined;
1624
- }>;
1625
- BACKGROUND_WORKER_MESSAGE: z.ZodObject<{
1626
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
1627
- backgroundWorkerId: z.ZodString;
1628
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1629
- type: z.ZodLiteral<"EXECUTE_RUNS">;
1630
- payloads: z.ZodArray<z.ZodObject<{
1631
- execution: z.ZodObject<{
1632
- task: z.ZodObject<{
1633
- id: z.ZodString;
1634
- filePath: z.ZodString;
1635
- exportName: z.ZodString;
1636
- }, "strip", z.ZodTypeAny, {
1637
- id: string;
1638
- filePath: string;
1639
- exportName: string;
1640
- }, {
1641
- id: string;
1642
- filePath: string;
1643
- exportName: string;
1644
- }>;
1645
- attempt: z.ZodObject<{
1646
- id: z.ZodString;
1647
- number: z.ZodNumber;
1648
- startedAt: z.ZodDate;
1649
- backgroundWorkerId: z.ZodString;
1650
- backgroundWorkerTaskId: z.ZodString;
1651
- status: z.ZodString;
1652
- }, "strip", z.ZodTypeAny, {
1653
- number: number;
1654
- status: string;
1655
- id: string;
1656
- startedAt: Date;
1657
- backgroundWorkerId: string;
1658
- backgroundWorkerTaskId: string;
1659
- }, {
1660
- number: number;
1661
- status: string;
1662
- id: string;
1663
- startedAt: Date;
1664
- backgroundWorkerId: string;
1665
- backgroundWorkerTaskId: string;
1666
- }>;
1667
- run: z.ZodObject<{
1668
- id: z.ZodString;
1669
- payload: z.ZodString;
1670
- payloadType: z.ZodString;
1671
- context: z.ZodAny;
1672
- tags: z.ZodArray<z.ZodString, "many">;
1673
- createdAt: z.ZodDate;
1674
- }, "strip", z.ZodTypeAny, {
1675
- payload: string;
1676
- id: string;
1677
- payloadType: string;
1678
- tags: string[];
1679
- createdAt: Date;
1680
- context?: any;
1681
- }, {
1682
- payload: string;
1683
- id: string;
1684
- payloadType: string;
1685
- tags: string[];
1686
- createdAt: Date;
1687
- context?: any;
1688
- }>;
1689
- environment: z.ZodObject<{
1690
- id: z.ZodString;
1691
- slug: z.ZodString;
1692
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
1693
- }, "strip", z.ZodTypeAny, {
1694
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1695
- id: string;
1696
- slug: string;
1697
- }, {
1698
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1699
- id: string;
1700
- slug: string;
1701
- }>;
1702
- organization: z.ZodObject<{
1703
- id: z.ZodString;
1704
- slug: z.ZodString;
1705
- name: z.ZodString;
1706
- }, "strip", z.ZodTypeAny, {
1707
- id: string;
1708
- name: string;
1709
- slug: string;
1710
- }, {
1711
- id: string;
1712
- name: string;
1713
- slug: string;
1714
- }>;
1715
- project: z.ZodObject<{
1716
- id: z.ZodString;
1717
- ref: z.ZodString;
1718
- slug: z.ZodString;
1719
- name: z.ZodString;
1720
- }, "strip", z.ZodTypeAny, {
1721
- id: string;
1722
- name: string;
1723
- slug: string;
1724
- ref: string;
1725
- }, {
1726
- id: string;
1727
- name: string;
1728
- slug: string;
1729
- ref: string;
1730
- }>;
1731
- }, "strip", z.ZodTypeAny, {
1732
- task: {
1733
- id: string;
1734
- filePath: string;
1735
- exportName: string;
1736
- };
1737
- attempt: {
1738
- number: number;
1739
- status: string;
1740
- id: string;
1741
- startedAt: Date;
1742
- backgroundWorkerId: string;
1743
- backgroundWorkerTaskId: string;
1744
- };
1745
- run: {
1746
- payload: string;
1747
- id: string;
1748
- payloadType: string;
1749
- tags: string[];
1750
- createdAt: Date;
1751
- context?: any;
1752
- };
1753
- environment: {
1754
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1755
- id: string;
1756
- slug: string;
1757
- };
1758
- organization: {
1759
- id: string;
1760
- name: string;
1761
- slug: string;
1762
- };
1763
- project: {
1764
- id: string;
1765
- name: string;
1766
- slug: string;
1767
- ref: string;
1768
- };
1769
- }, {
1770
- task: {
1771
- id: string;
1772
- filePath: string;
1773
- exportName: string;
1774
- };
1775
- attempt: {
1776
- number: number;
1777
- status: string;
1778
- id: string;
1779
- startedAt: Date;
1780
- backgroundWorkerId: string;
1781
- backgroundWorkerTaskId: string;
1782
- };
1783
- run: {
1784
- payload: string;
1785
- id: string;
1786
- payloadType: string;
1787
- tags: string[];
1788
- createdAt: Date;
1789
- context?: any;
1790
- };
1791
- environment: {
1792
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1793
- id: string;
1794
- slug: string;
1795
- };
1796
- organization: {
1797
- id: string;
1798
- name: string;
1799
- slug: string;
1800
- };
1801
- project: {
1802
- id: string;
1803
- name: string;
1804
- slug: string;
1805
- ref: string;
1806
- };
1807
- }>;
1808
- traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1809
- }, "strip", z.ZodTypeAny, {
1810
- execution: {
1811
- task: {
1812
- id: string;
1813
- filePath: string;
1814
- exportName: string;
1815
- };
1816
- attempt: {
1817
- number: number;
1818
- status: string;
1819
- id: string;
1820
- startedAt: Date;
1821
- backgroundWorkerId: string;
1822
- backgroundWorkerTaskId: string;
1823
- };
1824
- run: {
1825
- payload: string;
1826
- id: string;
1827
- payloadType: string;
1828
- tags: string[];
1829
- createdAt: Date;
1830
- context?: any;
1831
- };
1832
- environment: {
1833
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1834
- id: string;
1835
- slug: string;
1836
- };
1837
- organization: {
1838
- id: string;
1839
- name: string;
1840
- slug: string;
1841
- };
1842
- project: {
1843
- id: string;
1844
- name: string;
1845
- slug: string;
1846
- ref: string;
1847
- };
1848
- };
1849
- traceContext: Record<string, unknown>;
1850
- }, {
1851
- execution: {
1852
- task: {
1853
- id: string;
1854
- filePath: string;
1855
- exportName: string;
1856
- };
1857
- attempt: {
1858
- number: number;
1859
- status: string;
1860
- id: string;
1861
- startedAt: Date;
1862
- backgroundWorkerId: string;
1863
- backgroundWorkerTaskId: string;
1864
- };
1865
- run: {
1866
- payload: string;
1867
- id: string;
1868
- payloadType: string;
1869
- tags: string[];
1870
- createdAt: Date;
1871
- context?: any;
1872
- };
1873
- environment: {
1874
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1875
- id: string;
1876
- slug: string;
1877
- };
1878
- organization: {
1879
- id: string;
1880
- name: string;
1881
- slug: string;
1882
- };
1883
- project: {
1884
- id: string;
1885
- name: string;
1886
- slug: string;
1887
- ref: string;
1888
- };
1889
- };
1890
- traceContext: Record<string, unknown>;
1891
- }>, "many">;
1892
- }, "strip", z.ZodTypeAny, {
1893
- type: "EXECUTE_RUNS";
1894
- payloads: {
1895
- execution: {
1896
- task: {
1897
- id: string;
1898
- filePath: string;
1899
- exportName: string;
1900
- };
1901
- attempt: {
1902
- number: number;
1903
- status: string;
1904
- id: string;
1905
- startedAt: Date;
1906
- backgroundWorkerId: string;
1907
- backgroundWorkerTaskId: string;
1908
- };
1909
- run: {
1910
- payload: string;
1911
- id: string;
1912
- payloadType: string;
1913
- tags: string[];
1914
- createdAt: Date;
1915
- context?: any;
1916
- };
1917
- environment: {
1918
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1919
- id: string;
1920
- slug: string;
1921
- };
1922
- organization: {
1923
- id: string;
1924
- name: string;
1925
- slug: string;
1926
- };
1927
- project: {
1928
- id: string;
1929
- name: string;
1930
- slug: string;
1931
- ref: string;
1932
- };
1933
- };
1934
- traceContext: Record<string, unknown>;
1935
- }[];
1936
- }, {
1937
- type: "EXECUTE_RUNS";
1938
- payloads: {
1939
- execution: {
1940
- task: {
1941
- id: string;
1942
- filePath: string;
1943
- exportName: string;
1944
- };
1945
- attempt: {
1946
- number: number;
1947
- status: string;
1948
- id: string;
1949
- startedAt: Date;
1950
- backgroundWorkerId: string;
1951
- backgroundWorkerTaskId: string;
1952
- };
1953
- run: {
1954
- payload: string;
1955
- id: string;
1956
- payloadType: string;
1957
- tags: string[];
1958
- createdAt: Date;
1959
- context?: any;
1960
- };
1961
- environment: {
1962
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
1963
- id: string;
1964
- slug: string;
1965
- };
1966
- organization: {
1967
- id: string;
1968
- name: string;
1969
- slug: string;
1970
- };
1971
- project: {
1972
- id: string;
1973
- name: string;
1974
- slug: string;
1975
- ref: string;
1976
- };
1977
- };
1978
- traceContext: Record<string, unknown>;
1979
- }[];
1980
- }>]>;
1981
- }, "strip", z.ZodTypeAny, {
1982
- data: {
1983
- type: "EXECUTE_RUNS";
1984
- payloads: {
1985
- execution: {
1986
- task: {
1987
- id: string;
1988
- filePath: string;
1989
- exportName: string;
1990
- };
1991
- attempt: {
1992
- number: number;
1993
- status: string;
1994
- id: string;
1995
- startedAt: Date;
1996
- backgroundWorkerId: string;
1997
- backgroundWorkerTaskId: string;
1998
- };
1999
- run: {
2000
- payload: string;
2001
- id: string;
2002
- payloadType: string;
2003
- tags: string[];
2004
- createdAt: Date;
2005
- context?: any;
2006
- };
2007
- environment: {
2008
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2009
- id: string;
2010
- slug: string;
2011
- };
2012
- organization: {
2013
- id: string;
2014
- name: string;
2015
- slug: string;
2016
- };
2017
- project: {
2018
- id: string;
2019
- name: string;
2020
- slug: string;
2021
- ref: string;
2022
- };
2023
- };
2024
- traceContext: Record<string, unknown>;
2025
- }[];
2026
- };
2027
- version: "v1";
2028
- backgroundWorkerId: string;
2029
- }, {
2030
- data: {
2031
- type: "EXECUTE_RUNS";
2032
- payloads: {
2033
- execution: {
2034
- task: {
2035
- id: string;
2036
- filePath: string;
2037
- exportName: string;
2038
- };
2039
- attempt: {
2040
- number: number;
2041
- status: string;
2042
- id: string;
2043
- startedAt: Date;
2044
- backgroundWorkerId: string;
2045
- backgroundWorkerTaskId: string;
2046
- };
2047
- run: {
2048
- payload: string;
2049
- id: string;
2050
- payloadType: string;
2051
- tags: string[];
2052
- createdAt: Date;
2053
- context?: any;
2054
- };
2055
- environment: {
2056
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2057
- id: string;
2058
- slug: string;
2059
- };
2060
- organization: {
2061
- id: string;
2062
- name: string;
2063
- slug: string;
2064
- };
2065
- project: {
2066
- id: string;
2067
- name: string;
2068
- slug: string;
2069
- ref: string;
2070
- };
2071
- };
2072
- traceContext: Record<string, unknown>;
2073
- }[];
2074
- };
2075
- backgroundWorkerId: string;
2076
- version?: "v1" | undefined;
2077
- }>;
2078
- };
2079
- declare const BackgroundWorkerClientMessages: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2080
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2081
- type: z.ZodLiteral<"TASK_RUN_COMPLETED">;
2082
- completion: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
2083
- ok: z.ZodLiteral<true>;
2084
- id: z.ZodString;
2085
- output: z.ZodString;
2086
- outputType: z.ZodString;
2087
- }, "strip", z.ZodTypeAny, {
2088
- id: string;
2089
- ok: true;
2090
- output: string;
2091
- outputType: string;
2092
- }, {
2093
- id: string;
2094
- ok: true;
2095
- output: string;
2096
- outputType: string;
2097
- }>, z.ZodObject<{
2098
- ok: z.ZodLiteral<false>;
2099
- id: z.ZodString;
2100
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2101
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
2102
- name: z.ZodString;
2103
- message: z.ZodString;
2104
- stackTrace: z.ZodString;
2105
- }, "strip", z.ZodTypeAny, {
2106
- message: string;
2107
- type: "BUILT_IN_ERROR";
2108
- name: string;
2109
- stackTrace: string;
2110
- }, {
2111
- message: string;
2112
- type: "BUILT_IN_ERROR";
2113
- name: string;
2114
- stackTrace: string;
2115
- }>, z.ZodObject<{
2116
- type: z.ZodLiteral<"CUSTOM_ERROR">;
2117
- raw: z.ZodString;
2118
- }, "strip", z.ZodTypeAny, {
2119
- type: "CUSTOM_ERROR";
2120
- raw: string;
2121
- }, {
2122
- type: "CUSTOM_ERROR";
2123
- raw: string;
2124
- }>, z.ZodObject<{
2125
- type: z.ZodLiteral<"STRING_ERROR">;
2126
- raw: z.ZodString;
2127
- }, "strip", z.ZodTypeAny, {
2128
- type: "STRING_ERROR";
2129
- raw: string;
2130
- }, {
2131
- type: "STRING_ERROR";
2132
- raw: string;
2133
- }>, z.ZodObject<{
2134
- type: z.ZodLiteral<"INTERNAL_ERROR">;
2135
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
2136
- }, "strip", z.ZodTypeAny, {
2137
- code: "COULD_NOT_FIND_EXECUTOR";
2138
- type: "INTERNAL_ERROR";
2139
- }, {
2140
- code: "COULD_NOT_FIND_EXECUTOR";
2141
- type: "INTERNAL_ERROR";
2142
- }>]>;
2143
- }, "strip", z.ZodTypeAny, {
2144
- id: string;
2145
- error: {
2146
- message: string;
2147
- type: "BUILT_IN_ERROR";
2148
- name: string;
2149
- stackTrace: string;
2150
- } | {
2151
- type: "CUSTOM_ERROR";
2152
- raw: string;
2153
- } | {
2154
- type: "STRING_ERROR";
2155
- raw: string;
2156
- } | {
2157
- code: "COULD_NOT_FIND_EXECUTOR";
2158
- type: "INTERNAL_ERROR";
2159
- };
2160
- ok: false;
2161
- }, {
2162
- id: string;
2163
- error: {
2164
- message: string;
2165
- type: "BUILT_IN_ERROR";
2166
- name: string;
2167
- stackTrace: string;
2168
- } | {
2169
- type: "CUSTOM_ERROR";
2170
- raw: string;
2171
- } | {
2172
- type: "STRING_ERROR";
2173
- raw: string;
2174
- } | {
2175
- code: "COULD_NOT_FIND_EXECUTOR";
2176
- type: "INTERNAL_ERROR";
2177
- };
2178
- ok: false;
2179
- }>]>;
2180
- }, "strip", z.ZodTypeAny, {
2181
- type: "TASK_RUN_COMPLETED";
2182
- version: "v1";
2183
- completion: {
2184
- id: string;
2185
- error: {
2186
- message: string;
2187
- type: "BUILT_IN_ERROR";
2188
- name: string;
2189
- stackTrace: string;
2190
- } | {
2191
- type: "CUSTOM_ERROR";
2192
- raw: string;
2193
- } | {
2194
- type: "STRING_ERROR";
2195
- raw: string;
2196
- } | {
2197
- code: "COULD_NOT_FIND_EXECUTOR";
2198
- type: "INTERNAL_ERROR";
2199
- };
2200
- ok: false;
2201
- } | {
2202
- id: string;
2203
- ok: true;
2204
- output: string;
2205
- outputType: string;
2206
- };
2207
- }, {
2208
- type: "TASK_RUN_COMPLETED";
2209
- completion: {
2210
- id: string;
2211
- error: {
2212
- message: string;
2213
- type: "BUILT_IN_ERROR";
2214
- name: string;
2215
- stackTrace: string;
2216
- } | {
2217
- type: "CUSTOM_ERROR";
2218
- raw: string;
2219
- } | {
2220
- type: "STRING_ERROR";
2221
- raw: string;
2222
- } | {
2223
- code: "COULD_NOT_FIND_EXECUTOR";
2224
- type: "INTERNAL_ERROR";
2225
- };
2226
- ok: false;
2227
- } | {
2228
- id: string;
2229
- ok: true;
2230
- output: string;
2231
- outputType: string;
2232
- };
2233
- version?: "v1" | undefined;
2234
- }>]>;
2235
- type BackgroundWorkerClientMessages = z.infer<typeof BackgroundWorkerClientMessages>;
2236
- declare const clientWebsocketMessages: {
2237
- READY_FOR_TASKS: z.ZodObject<{
2238
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2239
- backgroundWorkerId: z.ZodString;
2240
- }, "strip", z.ZodTypeAny, {
2241
- version: "v1";
2242
- backgroundWorkerId: string;
2243
- }, {
2244
- backgroundWorkerId: string;
2245
- version?: "v1" | undefined;
2246
- }>;
2247
- WORKER_DEPRECATED: z.ZodObject<{
2248
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2249
- backgroundWorkerId: z.ZodString;
2250
- }, "strip", z.ZodTypeAny, {
2251
- version: "v1";
2252
- backgroundWorkerId: string;
2253
- }, {
2254
- backgroundWorkerId: string;
2255
- version?: "v1" | undefined;
2256
- }>;
2257
- BACKGROUND_WORKER_MESSAGE: z.ZodObject<{
2258
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2259
- backgroundWorkerId: z.ZodString;
2260
- data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2261
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2262
- type: z.ZodLiteral<"TASK_RUN_COMPLETED">;
2263
- completion: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
2264
- ok: z.ZodLiteral<true>;
2265
- id: z.ZodString;
2266
- output: z.ZodString;
2267
- outputType: z.ZodString;
2268
- }, "strip", z.ZodTypeAny, {
2269
- id: string;
2270
- ok: true;
2271
- output: string;
2272
- outputType: string;
2273
- }, {
2274
- id: string;
2275
- ok: true;
2276
- output: string;
2277
- outputType: string;
2278
- }>, z.ZodObject<{
2279
- ok: z.ZodLiteral<false>;
2280
- id: z.ZodString;
2281
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2282
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
2283
- name: z.ZodString;
2284
- message: z.ZodString;
2285
- stackTrace: z.ZodString;
2286
- }, "strip", z.ZodTypeAny, {
2287
- message: string;
2288
- type: "BUILT_IN_ERROR";
2289
- name: string;
2290
- stackTrace: string;
2291
- }, {
2292
- message: string;
2293
- type: "BUILT_IN_ERROR";
2294
- name: string;
2295
- stackTrace: string;
2296
- }>, z.ZodObject<{
2297
- type: z.ZodLiteral<"CUSTOM_ERROR">;
2298
- raw: z.ZodString;
2299
- }, "strip", z.ZodTypeAny, {
2300
- type: "CUSTOM_ERROR";
2301
- raw: string;
2302
- }, {
2303
- type: "CUSTOM_ERROR";
2304
- raw: string;
2305
- }>, z.ZodObject<{
2306
- type: z.ZodLiteral<"STRING_ERROR">;
2307
- raw: z.ZodString;
2308
- }, "strip", z.ZodTypeAny, {
2309
- type: "STRING_ERROR";
2310
- raw: string;
2311
- }, {
2312
- type: "STRING_ERROR";
2313
- raw: string;
2314
- }>, z.ZodObject<{
2315
- type: z.ZodLiteral<"INTERNAL_ERROR">;
2316
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
2317
- }, "strip", z.ZodTypeAny, {
2318
- code: "COULD_NOT_FIND_EXECUTOR";
2319
- type: "INTERNAL_ERROR";
2320
- }, {
2321
- code: "COULD_NOT_FIND_EXECUTOR";
2322
- type: "INTERNAL_ERROR";
2323
- }>]>;
2324
- }, "strip", z.ZodTypeAny, {
2325
- id: string;
2326
- error: {
2327
- message: string;
2328
- type: "BUILT_IN_ERROR";
2329
- name: string;
2330
- stackTrace: string;
2331
- } | {
2332
- type: "CUSTOM_ERROR";
2333
- raw: string;
2334
- } | {
2335
- type: "STRING_ERROR";
2336
- raw: string;
2337
- } | {
2338
- code: "COULD_NOT_FIND_EXECUTOR";
2339
- type: "INTERNAL_ERROR";
2340
- };
2341
- ok: false;
2342
- }, {
2343
- id: string;
2344
- error: {
2345
- message: string;
2346
- type: "BUILT_IN_ERROR";
2347
- name: string;
2348
- stackTrace: string;
2349
- } | {
2350
- type: "CUSTOM_ERROR";
2351
- raw: string;
2352
- } | {
2353
- type: "STRING_ERROR";
2354
- raw: string;
2355
- } | {
2356
- code: "COULD_NOT_FIND_EXECUTOR";
2357
- type: "INTERNAL_ERROR";
2358
- };
2359
- ok: false;
2360
- }>]>;
2361
- }, "strip", z.ZodTypeAny, {
2362
- type: "TASK_RUN_COMPLETED";
2363
- version: "v1";
2364
- completion: {
2365
- id: string;
2366
- error: {
2367
- message: string;
2368
- type: "BUILT_IN_ERROR";
2369
- name: string;
2370
- stackTrace: string;
2371
- } | {
2372
- type: "CUSTOM_ERROR";
2373
- raw: string;
2374
- } | {
2375
- type: "STRING_ERROR";
2376
- raw: string;
2377
- } | {
2378
- code: "COULD_NOT_FIND_EXECUTOR";
2379
- type: "INTERNAL_ERROR";
2380
- };
2381
- ok: false;
2382
- } | {
2383
- id: string;
2384
- ok: true;
2385
- output: string;
2386
- outputType: string;
2387
- };
2388
- }, {
2389
- type: "TASK_RUN_COMPLETED";
2390
- completion: {
2391
- id: string;
2392
- error: {
2393
- message: string;
2394
- type: "BUILT_IN_ERROR";
2395
- name: string;
2396
- stackTrace: string;
2397
- } | {
2398
- type: "CUSTOM_ERROR";
2399
- raw: string;
2400
- } | {
2401
- type: "STRING_ERROR";
2402
- raw: string;
2403
- } | {
2404
- code: "COULD_NOT_FIND_EXECUTOR";
2405
- type: "INTERNAL_ERROR";
2406
- };
2407
- ok: false;
2408
- } | {
2409
- id: string;
2410
- ok: true;
2411
- output: string;
2412
- outputType: string;
2413
- };
2414
- version?: "v1" | undefined;
2415
- }>]>;
2416
- }, "strip", z.ZodTypeAny, {
2417
- data: {
2418
- type: "TASK_RUN_COMPLETED";
2419
- version: "v1";
2420
- completion: {
2421
- id: string;
2422
- error: {
2423
- message: string;
2424
- type: "BUILT_IN_ERROR";
2425
- name: string;
2426
- stackTrace: string;
2427
- } | {
2428
- type: "CUSTOM_ERROR";
2429
- raw: string;
2430
- } | {
2431
- type: "STRING_ERROR";
2432
- raw: string;
2433
- } | {
2434
- code: "COULD_NOT_FIND_EXECUTOR";
2435
- type: "INTERNAL_ERROR";
2436
- };
2437
- ok: false;
2438
- } | {
2439
- id: string;
2440
- ok: true;
2441
- output: string;
2442
- outputType: string;
2443
- };
2444
- };
2445
- version: "v1";
2446
- backgroundWorkerId: string;
2447
- }, {
2448
- data: {
2449
- type: "TASK_RUN_COMPLETED";
2450
- completion: {
2451
- id: string;
2452
- error: {
2453
- message: string;
2454
- type: "BUILT_IN_ERROR";
2455
- name: string;
2456
- stackTrace: string;
2457
- } | {
2458
- type: "CUSTOM_ERROR";
2459
- raw: string;
2460
- } | {
2461
- type: "STRING_ERROR";
2462
- raw: string;
2463
- } | {
2464
- code: "COULD_NOT_FIND_EXECUTOR";
2465
- type: "INTERNAL_ERROR";
2466
- };
2467
- ok: false;
2468
- } | {
2469
- id: string;
2470
- ok: true;
2471
- output: string;
2472
- outputType: string;
2473
- };
2474
- version?: "v1" | undefined;
2475
- };
2476
- backgroundWorkerId: string;
2477
- version?: "v1" | undefined;
2478
- }>;
2479
- };
2480
- declare const workerToChildMessages: {
2481
- EXECUTE_TASK_RUN: z.ZodObject<{
2482
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2483
- execution: z.ZodObject<{
2484
- task: z.ZodObject<{
2485
- id: z.ZodString;
2486
- filePath: z.ZodString;
2487
- exportName: z.ZodString;
2488
- }, "strip", z.ZodTypeAny, {
2489
- id: string;
2490
- filePath: string;
2491
- exportName: string;
2492
- }, {
2493
- id: string;
2494
- filePath: string;
2495
- exportName: string;
2496
- }>;
2497
- attempt: z.ZodObject<{
2498
- id: z.ZodString;
2499
- number: z.ZodNumber;
2500
- startedAt: z.ZodDate;
2501
- backgroundWorkerId: z.ZodString;
2502
- backgroundWorkerTaskId: z.ZodString;
2503
- status: z.ZodString;
2504
- }, "strip", z.ZodTypeAny, {
2505
- number: number;
2506
- status: string;
2507
- id: string;
2508
- startedAt: Date;
2509
- backgroundWorkerId: string;
2510
- backgroundWorkerTaskId: string;
2511
- }, {
2512
- number: number;
2513
- status: string;
2514
- id: string;
2515
- startedAt: Date;
2516
- backgroundWorkerId: string;
2517
- backgroundWorkerTaskId: string;
2518
- }>;
2519
- run: z.ZodObject<{
2520
- id: z.ZodString;
2521
- payload: z.ZodString;
2522
- payloadType: z.ZodString;
2523
- context: z.ZodAny;
2524
- tags: z.ZodArray<z.ZodString, "many">;
2525
- createdAt: z.ZodDate;
2526
- }, "strip", z.ZodTypeAny, {
2527
- payload: string;
2528
- id: string;
2529
- payloadType: string;
2530
- tags: string[];
2531
- createdAt: Date;
2532
- context?: any;
2533
- }, {
2534
- payload: string;
2535
- id: string;
2536
- payloadType: string;
2537
- tags: string[];
2538
- createdAt: Date;
2539
- context?: any;
2540
- }>;
2541
- environment: z.ZodObject<{
2542
- id: z.ZodString;
2543
- slug: z.ZodString;
2544
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
2545
- }, "strip", z.ZodTypeAny, {
2546
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2547
- id: string;
2548
- slug: string;
2549
- }, {
2550
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2551
- id: string;
2552
- slug: string;
2553
- }>;
2554
- organization: z.ZodObject<{
2555
- id: z.ZodString;
2556
- slug: z.ZodString;
2557
- name: z.ZodString;
2558
- }, "strip", z.ZodTypeAny, {
2559
- id: string;
2560
- name: string;
2561
- slug: string;
2562
- }, {
2563
- id: string;
2564
- name: string;
2565
- slug: string;
2566
- }>;
2567
- project: z.ZodObject<{
2568
- id: z.ZodString;
2569
- ref: z.ZodString;
2570
- slug: z.ZodString;
2571
- name: z.ZodString;
2572
- }, "strip", z.ZodTypeAny, {
2573
- id: string;
2574
- name: string;
2575
- slug: string;
2576
- ref: string;
2577
- }, {
2578
- id: string;
2579
- name: string;
2580
- slug: string;
2581
- ref: string;
2582
- }>;
2583
- }, "strip", z.ZodTypeAny, {
2584
- task: {
2585
- id: string;
2586
- filePath: string;
2587
- exportName: string;
2588
- };
2589
- attempt: {
2590
- number: number;
2591
- status: string;
2592
- id: string;
2593
- startedAt: Date;
2594
- backgroundWorkerId: string;
2595
- backgroundWorkerTaskId: string;
2596
- };
2597
- run: {
2598
- payload: string;
2599
- id: string;
2600
- payloadType: string;
2601
- tags: string[];
2602
- createdAt: Date;
2603
- context?: any;
2604
- };
2605
- environment: {
2606
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2607
- id: string;
2608
- slug: string;
2609
- };
2610
- organization: {
2611
- id: string;
2612
- name: string;
2613
- slug: string;
2614
- };
2615
- project: {
2616
- id: string;
2617
- name: string;
2618
- slug: string;
2619
- ref: string;
2620
- };
2621
- }, {
2622
- task: {
2623
- id: string;
2624
- filePath: string;
2625
- exportName: string;
2626
- };
2627
- attempt: {
2628
- number: number;
2629
- status: string;
2630
- id: string;
2631
- startedAt: Date;
2632
- backgroundWorkerId: string;
2633
- backgroundWorkerTaskId: string;
2634
- };
2635
- run: {
2636
- payload: string;
2637
- id: string;
2638
- payloadType: string;
2639
- tags: string[];
2640
- createdAt: Date;
2641
- context?: any;
2642
- };
2643
- environment: {
2644
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2645
- id: string;
2646
- slug: string;
2647
- };
2648
- organization: {
2649
- id: string;
2650
- name: string;
2651
- slug: string;
2652
- };
2653
- project: {
2654
- id: string;
2655
- name: string;
2656
- slug: string;
2657
- ref: string;
2658
- };
2659
- }>;
2660
- traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2661
- metadata: z.ZodObject<{
2662
- id: z.ZodString;
2663
- version: z.ZodString;
2664
- contentHash: z.ZodString;
2665
- }, "strip", z.ZodTypeAny, {
2666
- id: string;
2667
- contentHash: string;
2668
- version: string;
2669
- }, {
2670
- id: string;
2671
- contentHash: string;
2672
- version: string;
2673
- }>;
2674
- }, "strip", z.ZodTypeAny, {
2675
- metadata: {
2676
- id: string;
2677
- contentHash: string;
2678
- version: string;
2679
- };
2680
- version: "v1";
2681
- execution: {
2682
- task: {
2683
- id: string;
2684
- filePath: string;
2685
- exportName: string;
2686
- };
2687
- attempt: {
2688
- number: number;
2689
- status: string;
2690
- id: string;
2691
- startedAt: Date;
2692
- backgroundWorkerId: string;
2693
- backgroundWorkerTaskId: string;
2694
- };
2695
- run: {
2696
- payload: string;
2697
- id: string;
2698
- payloadType: string;
2699
- tags: string[];
2700
- createdAt: Date;
2701
- context?: any;
2702
- };
2703
- environment: {
2704
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2705
- id: string;
2706
- slug: string;
2707
- };
2708
- organization: {
2709
- id: string;
2710
- name: string;
2711
- slug: string;
2712
- };
2713
- project: {
2714
- id: string;
2715
- name: string;
2716
- slug: string;
2717
- ref: string;
2718
- };
2719
- };
2720
- traceContext: Record<string, unknown>;
2721
- }, {
2722
- metadata: {
2723
- id: string;
2724
- contentHash: string;
2725
- version: string;
2726
- };
2727
- execution: {
2728
- task: {
2729
- id: string;
2730
- filePath: string;
2731
- exportName: string;
2732
- };
2733
- attempt: {
2734
- number: number;
2735
- status: string;
2736
- id: string;
2737
- startedAt: Date;
2738
- backgroundWorkerId: string;
2739
- backgroundWorkerTaskId: string;
2740
- };
2741
- run: {
2742
- payload: string;
2743
- id: string;
2744
- payloadType: string;
2745
- tags: string[];
2746
- createdAt: Date;
2747
- context?: any;
2748
- };
2749
- environment: {
2750
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2751
- id: string;
2752
- slug: string;
2753
- };
2754
- organization: {
2755
- id: string;
2756
- name: string;
2757
- slug: string;
2758
- };
2759
- project: {
2760
- id: string;
2761
- name: string;
2762
- slug: string;
2763
- ref: string;
2764
- };
2765
- };
2766
- traceContext: Record<string, unknown>;
2767
- version?: "v1" | undefined;
2768
- }>;
2769
- TASK_RUN_COMPLETED: z.ZodObject<{
2770
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
2771
- completion: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
2772
- ok: z.ZodLiteral<true>;
2773
- id: z.ZodString;
2774
- output: z.ZodString;
2775
- outputType: z.ZodString;
2776
- }, "strip", z.ZodTypeAny, {
2777
- id: string;
2778
- ok: true;
2779
- output: string;
2780
- outputType: string;
2781
- }, {
2782
- id: string;
2783
- ok: true;
2784
- output: string;
2785
- outputType: string;
2786
- }>, z.ZodObject<{
2787
- ok: z.ZodLiteral<false>;
2788
- id: z.ZodString;
2789
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2790
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
2791
- name: z.ZodString;
2792
- message: z.ZodString;
2793
- stackTrace: z.ZodString;
2794
- }, "strip", z.ZodTypeAny, {
2795
- message: string;
2796
- type: "BUILT_IN_ERROR";
2797
- name: string;
2798
- stackTrace: string;
2799
- }, {
2800
- message: string;
2801
- type: "BUILT_IN_ERROR";
2802
- name: string;
2803
- stackTrace: string;
2804
- }>, z.ZodObject<{
2805
- type: z.ZodLiteral<"CUSTOM_ERROR">;
2806
- raw: z.ZodString;
2807
- }, "strip", z.ZodTypeAny, {
2808
- type: "CUSTOM_ERROR";
2809
- raw: string;
2810
- }, {
2811
- type: "CUSTOM_ERROR";
2812
- raw: string;
2813
- }>, z.ZodObject<{
2814
- type: z.ZodLiteral<"STRING_ERROR">;
2815
- raw: z.ZodString;
2816
- }, "strip", z.ZodTypeAny, {
2817
- type: "STRING_ERROR";
2818
- raw: string;
2819
- }, {
2820
- type: "STRING_ERROR";
2821
- raw: string;
2822
- }>, z.ZodObject<{
2823
- type: z.ZodLiteral<"INTERNAL_ERROR">;
2824
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
2825
- }, "strip", z.ZodTypeAny, {
2826
- code: "COULD_NOT_FIND_EXECUTOR";
2827
- type: "INTERNAL_ERROR";
2828
- }, {
2829
- code: "COULD_NOT_FIND_EXECUTOR";
2830
- type: "INTERNAL_ERROR";
2831
- }>]>;
2832
- }, "strip", z.ZodTypeAny, {
2833
- id: string;
2834
- error: {
2835
- message: string;
2836
- type: "BUILT_IN_ERROR";
2837
- name: string;
2838
- stackTrace: string;
2839
- } | {
2840
- type: "CUSTOM_ERROR";
2841
- raw: string;
2842
- } | {
2843
- type: "STRING_ERROR";
2844
- raw: string;
2845
- } | {
2846
- code: "COULD_NOT_FIND_EXECUTOR";
2847
- type: "INTERNAL_ERROR";
2848
- };
2849
- ok: false;
2850
- }, {
2851
- id: string;
2852
- error: {
2853
- message: string;
2854
- type: "BUILT_IN_ERROR";
2855
- name: string;
2856
- stackTrace: string;
2857
- } | {
2858
- type: "CUSTOM_ERROR";
2859
- raw: string;
2860
- } | {
2861
- type: "STRING_ERROR";
2862
- raw: string;
2863
- } | {
2864
- code: "COULD_NOT_FIND_EXECUTOR";
2865
- type: "INTERNAL_ERROR";
2866
- };
2867
- ok: false;
2868
- }>]>;
2869
- execution: z.ZodObject<{
2870
- task: z.ZodObject<{
2871
- id: z.ZodString;
2872
- filePath: z.ZodString;
2873
- exportName: z.ZodString;
2874
- }, "strip", z.ZodTypeAny, {
2875
- id: string;
2876
- filePath: string;
2877
- exportName: string;
2878
- }, {
2879
- id: string;
2880
- filePath: string;
2881
- exportName: string;
2882
- }>;
2883
- attempt: z.ZodObject<{
2884
- id: z.ZodString;
2885
- number: z.ZodNumber;
2886
- startedAt: z.ZodDate;
2887
- backgroundWorkerId: z.ZodString;
2888
- backgroundWorkerTaskId: z.ZodString;
2889
- status: z.ZodString;
2890
- }, "strip", z.ZodTypeAny, {
2891
- number: number;
2892
- status: string;
2893
- id: string;
2894
- startedAt: Date;
2895
- backgroundWorkerId: string;
2896
- backgroundWorkerTaskId: string;
2897
- }, {
2898
- number: number;
2899
- status: string;
2900
- id: string;
2901
- startedAt: Date;
2902
- backgroundWorkerId: string;
2903
- backgroundWorkerTaskId: string;
2904
- }>;
2905
- run: z.ZodObject<{
2906
- id: z.ZodString;
2907
- payload: z.ZodString;
2908
- payloadType: z.ZodString;
2909
- context: z.ZodAny;
2910
- tags: z.ZodArray<z.ZodString, "many">;
2911
- createdAt: z.ZodDate;
2912
- }, "strip", z.ZodTypeAny, {
2913
- payload: string;
2914
- id: string;
2915
- payloadType: string;
2916
- tags: string[];
2917
- createdAt: Date;
2918
- context?: any;
2919
- }, {
2920
- payload: string;
2921
- id: string;
2922
- payloadType: string;
2923
- tags: string[];
2924
- createdAt: Date;
2925
- context?: any;
2926
- }>;
2927
- environment: z.ZodObject<{
2928
- id: z.ZodString;
2929
- slug: z.ZodString;
2930
- type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
2931
- }, "strip", z.ZodTypeAny, {
2932
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2933
- id: string;
2934
- slug: string;
2935
- }, {
2936
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2937
- id: string;
2938
- slug: string;
2939
- }>;
2940
- organization: z.ZodObject<{
2941
- id: z.ZodString;
2942
- slug: z.ZodString;
2943
- name: z.ZodString;
2944
- }, "strip", z.ZodTypeAny, {
2945
- id: string;
2946
- name: string;
2947
- slug: string;
2948
- }, {
2949
- id: string;
2950
- name: string;
2951
- slug: string;
2952
- }>;
2953
- project: z.ZodObject<{
2954
- id: z.ZodString;
2955
- ref: z.ZodString;
2956
- slug: z.ZodString;
2957
- name: z.ZodString;
2958
- }, "strip", z.ZodTypeAny, {
2959
- id: string;
2960
- name: string;
2961
- slug: string;
2962
- ref: string;
2963
- }, {
2964
- id: string;
2965
- name: string;
2966
- slug: string;
2967
- ref: string;
2968
- }>;
2969
- }, "strip", z.ZodTypeAny, {
2970
- task: {
2971
- id: string;
2972
- filePath: string;
2973
- exportName: string;
2974
- };
2975
- attempt: {
2976
- number: number;
2977
- status: string;
2978
- id: string;
2979
- startedAt: Date;
2980
- backgroundWorkerId: string;
2981
- backgroundWorkerTaskId: string;
2982
- };
2983
- run: {
2984
- payload: string;
2985
- id: string;
2986
- payloadType: string;
2987
- tags: string[];
2988
- createdAt: Date;
2989
- context?: any;
2990
- };
2991
- environment: {
2992
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
2993
- id: string;
2994
- slug: string;
2995
- };
2996
- organization: {
2997
- id: string;
2998
- name: string;
2999
- slug: string;
3000
- };
3001
- project: {
3002
- id: string;
3003
- name: string;
3004
- slug: string;
3005
- ref: string;
3006
- };
3007
- }, {
3008
- task: {
3009
- id: string;
3010
- filePath: string;
3011
- exportName: string;
3012
- };
3013
- attempt: {
3014
- number: number;
3015
- status: string;
3016
- id: string;
3017
- startedAt: Date;
3018
- backgroundWorkerId: string;
3019
- backgroundWorkerTaskId: string;
3020
- };
3021
- run: {
3022
- payload: string;
3023
- id: string;
3024
- payloadType: string;
3025
- tags: string[];
3026
- createdAt: Date;
3027
- context?: any;
3028
- };
3029
- environment: {
3030
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
3031
- id: string;
3032
- slug: string;
3033
- };
3034
- organization: {
3035
- id: string;
3036
- name: string;
3037
- slug: string;
3038
- };
3039
- project: {
3040
- id: string;
3041
- name: string;
3042
- slug: string;
3043
- ref: string;
3044
- };
3045
- }>;
3046
- }, "strip", z.ZodTypeAny, {
3047
- version: "v1";
3048
- execution: {
3049
- task: {
3050
- id: string;
3051
- filePath: string;
3052
- exportName: string;
3053
- };
3054
- attempt: {
3055
- number: number;
3056
- status: string;
3057
- id: string;
3058
- startedAt: Date;
3059
- backgroundWorkerId: string;
3060
- backgroundWorkerTaskId: string;
3061
- };
3062
- run: {
3063
- payload: string;
3064
- id: string;
3065
- payloadType: string;
3066
- tags: string[];
3067
- createdAt: Date;
3068
- context?: any;
3069
- };
3070
- environment: {
3071
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
3072
- id: string;
3073
- slug: string;
3074
- };
3075
- organization: {
3076
- id: string;
3077
- name: string;
3078
- slug: string;
3079
- };
3080
- project: {
3081
- id: string;
3082
- name: string;
3083
- slug: string;
3084
- ref: string;
3085
- };
3086
- };
3087
- completion: {
3088
- id: string;
3089
- error: {
3090
- message: string;
3091
- type: "BUILT_IN_ERROR";
3092
- name: string;
3093
- stackTrace: string;
3094
- } | {
3095
- type: "CUSTOM_ERROR";
3096
- raw: string;
3097
- } | {
3098
- type: "STRING_ERROR";
3099
- raw: string;
3100
- } | {
3101
- code: "COULD_NOT_FIND_EXECUTOR";
3102
- type: "INTERNAL_ERROR";
3103
- };
3104
- ok: false;
3105
- } | {
3106
- id: string;
3107
- ok: true;
3108
- output: string;
3109
- outputType: string;
3110
- };
3111
- }, {
3112
- execution: {
3113
- task: {
3114
- id: string;
3115
- filePath: string;
3116
- exportName: string;
3117
- };
3118
- attempt: {
3119
- number: number;
3120
- status: string;
3121
- id: string;
3122
- startedAt: Date;
3123
- backgroundWorkerId: string;
3124
- backgroundWorkerTaskId: string;
3125
- };
3126
- run: {
3127
- payload: string;
3128
- id: string;
3129
- payloadType: string;
3130
- tags: string[];
3131
- createdAt: Date;
3132
- context?: any;
3133
- };
3134
- environment: {
3135
- type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
3136
- id: string;
3137
- slug: string;
3138
- };
3139
- organization: {
3140
- id: string;
3141
- name: string;
3142
- slug: string;
3143
- };
3144
- project: {
3145
- id: string;
3146
- name: string;
3147
- slug: string;
3148
- ref: string;
3149
- };
3150
- };
3151
- completion: {
3152
- id: string;
3153
- error: {
3154
- message: string;
3155
- type: "BUILT_IN_ERROR";
3156
- name: string;
3157
- stackTrace: string;
3158
- } | {
3159
- type: "CUSTOM_ERROR";
3160
- raw: string;
3161
- } | {
3162
- type: "STRING_ERROR";
3163
- raw: string;
3164
- } | {
3165
- code: "COULD_NOT_FIND_EXECUTOR";
3166
- type: "INTERNAL_ERROR";
3167
- };
3168
- ok: false;
3169
- } | {
3170
- id: string;
3171
- ok: true;
3172
- output: string;
3173
- outputType: string;
3174
- };
3175
- version?: "v1" | undefined;
3176
- }>;
3177
- CLEANUP: z.ZodObject<{
3178
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
3179
- flush: z.ZodDefault<z.ZodBoolean>;
3180
- }, "strip", z.ZodTypeAny, {
3181
- version: "v1";
3182
- flush: boolean;
3183
- }, {
3184
- version?: "v1" | undefined;
3185
- flush?: boolean | undefined;
3186
- }>;
3187
- };
3188
- declare const TaskMetadata: z.ZodObject<{
3189
- id: z.ZodString;
3190
- exportName: z.ZodString;
3191
- packageVersion: z.ZodString;
3192
- }, "strip", z.ZodTypeAny, {
3193
- id: string;
3194
- exportName: string;
3195
- packageVersion: string;
3196
- }, {
3197
- id: string;
3198
- exportName: string;
3199
- packageVersion: string;
3200
- }>;
3201
- type TaskMetadata = z.infer<typeof TaskMetadata>;
3202
- declare const TaskMetadataWithFilePath: z.ZodObject<{
3203
- id: z.ZodString;
3204
- exportName: z.ZodString;
3205
- packageVersion: z.ZodString;
3206
- filePath: z.ZodString;
3207
- }, "strip", z.ZodTypeAny, {
3208
- id: string;
3209
- filePath: string;
3210
- exportName: string;
3211
- packageVersion: string;
3212
- }, {
3213
- id: string;
3214
- filePath: string;
3215
- exportName: string;
3216
- packageVersion: string;
3217
- }>;
3218
- type TaskMetadataWithFilePath = z.infer<typeof TaskMetadataWithFilePath>;
3219
- declare const childToWorkerMessages: {
3220
- TASK_RUN_COMPLETED: z.ZodObject<{
3221
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
3222
- result: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
3223
- ok: z.ZodLiteral<true>;
3224
- id: z.ZodString;
3225
- output: z.ZodString;
3226
- outputType: z.ZodString;
3227
- }, "strip", z.ZodTypeAny, {
3228
- id: string;
3229
- ok: true;
3230
- output: string;
3231
- outputType: string;
3232
- }, {
3233
- id: string;
3234
- ok: true;
3235
- output: string;
3236
- outputType: string;
3237
- }>, z.ZodObject<{
3238
- ok: z.ZodLiteral<false>;
3239
- id: z.ZodString;
3240
- error: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3241
- type: z.ZodLiteral<"BUILT_IN_ERROR">;
3242
- name: z.ZodString;
3243
- message: z.ZodString;
3244
- stackTrace: z.ZodString;
3245
- }, "strip", z.ZodTypeAny, {
3246
- message: string;
3247
- type: "BUILT_IN_ERROR";
3248
- name: string;
3249
- stackTrace: string;
3250
- }, {
3251
- message: string;
3252
- type: "BUILT_IN_ERROR";
3253
- name: string;
3254
- stackTrace: string;
3255
- }>, z.ZodObject<{
3256
- type: z.ZodLiteral<"CUSTOM_ERROR">;
3257
- raw: z.ZodString;
3258
- }, "strip", z.ZodTypeAny, {
3259
- type: "CUSTOM_ERROR";
3260
- raw: string;
3261
- }, {
3262
- type: "CUSTOM_ERROR";
3263
- raw: string;
3264
- }>, z.ZodObject<{
3265
- type: z.ZodLiteral<"STRING_ERROR">;
3266
- raw: z.ZodString;
3267
- }, "strip", z.ZodTypeAny, {
3268
- type: "STRING_ERROR";
3269
- raw: string;
3270
- }, {
3271
- type: "STRING_ERROR";
3272
- raw: string;
3273
- }>, z.ZodObject<{
3274
- type: z.ZodLiteral<"INTERNAL_ERROR">;
3275
- code: z.ZodEnum<["COULD_NOT_FIND_EXECUTOR"]>;
3276
- }, "strip", z.ZodTypeAny, {
3277
- code: "COULD_NOT_FIND_EXECUTOR";
3278
- type: "INTERNAL_ERROR";
3279
- }, {
3280
- code: "COULD_NOT_FIND_EXECUTOR";
3281
- type: "INTERNAL_ERROR";
3282
- }>]>;
3283
- }, "strip", z.ZodTypeAny, {
3284
- id: string;
3285
- error: {
3286
- message: string;
3287
- type: "BUILT_IN_ERROR";
3288
- name: string;
3289
- stackTrace: string;
3290
- } | {
3291
- type: "CUSTOM_ERROR";
3292
- raw: string;
3293
- } | {
3294
- type: "STRING_ERROR";
3295
- raw: string;
3296
- } | {
3297
- code: "COULD_NOT_FIND_EXECUTOR";
3298
- type: "INTERNAL_ERROR";
3299
- };
3300
- ok: false;
3301
- }, {
3302
- id: string;
3303
- error: {
3304
- message: string;
3305
- type: "BUILT_IN_ERROR";
3306
- name: string;
3307
- stackTrace: string;
3308
- } | {
3309
- type: "CUSTOM_ERROR";
3310
- raw: string;
3311
- } | {
3312
- type: "STRING_ERROR";
3313
- raw: string;
3314
- } | {
3315
- code: "COULD_NOT_FIND_EXECUTOR";
3316
- type: "INTERNAL_ERROR";
3317
- };
3318
- ok: false;
3319
- }>]>;
3320
- }, "strip", z.ZodTypeAny, {
3321
- version: "v1";
3322
- result: {
3323
- id: string;
3324
- error: {
3325
- message: string;
3326
- type: "BUILT_IN_ERROR";
3327
- name: string;
3328
- stackTrace: string;
3329
- } | {
3330
- type: "CUSTOM_ERROR";
3331
- raw: string;
3332
- } | {
3333
- type: "STRING_ERROR";
3334
- raw: string;
3335
- } | {
3336
- code: "COULD_NOT_FIND_EXECUTOR";
3337
- type: "INTERNAL_ERROR";
3338
- };
3339
- ok: false;
3340
- } | {
3341
- id: string;
3342
- ok: true;
3343
- output: string;
3344
- outputType: string;
3345
- };
3346
- }, {
3347
- result: {
3348
- id: string;
3349
- error: {
3350
- message: string;
3351
- type: "BUILT_IN_ERROR";
3352
- name: string;
3353
- stackTrace: string;
3354
- } | {
3355
- type: "CUSTOM_ERROR";
3356
- raw: string;
3357
- } | {
3358
- type: "STRING_ERROR";
3359
- raw: string;
3360
- } | {
3361
- code: "COULD_NOT_FIND_EXECUTOR";
3362
- type: "INTERNAL_ERROR";
3363
- };
3364
- ok: false;
3365
- } | {
3366
- id: string;
3367
- ok: true;
3368
- output: string;
3369
- outputType: string;
3370
- };
3371
- version?: "v1" | undefined;
3372
- }>;
3373
- TASKS_READY: z.ZodObject<{
3374
- version: z.ZodDefault<z.ZodLiteral<"v1">>;
3375
- tasks: z.ZodArray<z.ZodObject<{
3376
- id: z.ZodString;
3377
- exportName: z.ZodString;
3378
- packageVersion: z.ZodString;
3379
- filePath: z.ZodString;
3380
- }, "strip", z.ZodTypeAny, {
3381
- id: string;
3382
- filePath: string;
3383
- exportName: string;
3384
- packageVersion: string;
3385
- }, {
3386
- id: string;
3387
- filePath: string;
3388
- exportName: string;
3389
- packageVersion: string;
3390
- }>, "many">;
3391
- }, "strip", z.ZodTypeAny, {
3392
- tasks: {
3393
- id: string;
3394
- filePath: string;
3395
- exportName: string;
3396
- packageVersion: string;
3397
- }[];
3398
- version: "v1";
3399
- }, {
3400
- tasks: {
3401
- id: string;
3402
- filePath: string;
3403
- exportName: string;
3404
- packageVersion: string;
3405
- }[];
3406
- version?: "v1" | undefined;
3407
- }>;
3408
- READY_TO_DISPOSE: z.ZodUndefined;
3409
- };
3410
-
3411
- /**
3412
- * Trigger.dev v3 API client
3413
- */
3414
- declare class ApiClient {
3415
- #private;
3416
- private readonly baseUrl;
3417
- private readonly accessToken;
3418
- constructor(baseUrl: string, accessToken: string);
3419
- triggerTask(taskId: string, options: TriggerTaskRequestBody): Promise<{
3420
- ok: false;
3421
- error: string;
3422
- } | {
3423
- ok: true;
3424
- data: {
3425
- id: string;
3426
- };
3427
- }>;
3428
- }
3429
-
3430
- interface ZodMessageCatalogSchema {
3431
- [key: string]: z.ZodFirstPartySchemaTypes | z.ZodDiscriminatedUnion<any, any>;
3432
- }
3433
- type ZodMessageHandlers<TCatalogSchema extends ZodMessageCatalogSchema> = Partial<{
3434
- [K in keyof TCatalogSchema]: (payload: z.infer<TCatalogSchema[K]>) => Promise<void>;
3435
- }>;
3436
- type ZodMessageHandlerOptions<TMessageCatalog extends ZodMessageCatalogSchema> = {
3437
- schema: TMessageCatalog;
3438
- messages?: ZodMessageHandlers<TMessageCatalog>;
3439
- };
3440
- type MessageFromSchema<K extends keyof TMessageCatalog, TMessageCatalog extends ZodMessageCatalogSchema> = {
3441
- type: K;
3442
- payload: z.input<TMessageCatalog[K]>;
3443
- };
3444
- type MessageFromCatalog<TMessageCatalog extends ZodMessageCatalogSchema> = {
3445
- [K in keyof TMessageCatalog]: MessageFromSchema<K, TMessageCatalog>;
3446
- }[keyof TMessageCatalog];
3447
- declare class ZodMessageHandler<TMessageCatalog extends ZodMessageCatalogSchema> {
3448
- #private;
3449
- constructor(options: ZodMessageHandlerOptions<TMessageCatalog>);
3450
- handleMessage(message: unknown): Promise<void>;
3451
- parseMessage(message: unknown): MessageFromCatalog<TMessageCatalog>;
3452
- }
3453
- type ZodMessageSenderCallback<TMessageCatalog extends ZodMessageCatalogSchema> = (message: {
3454
- type: keyof TMessageCatalog;
3455
- payload: z.infer<TMessageCatalog[keyof TMessageCatalog]>;
3456
- version: "v1";
3457
- }) => Promise<void>;
3458
- type ZodMessageSenderOptions<TMessageCatalog extends ZodMessageCatalogSchema> = {
3459
- schema: TMessageCatalog;
3460
- sender: ZodMessageSenderCallback<TMessageCatalog>;
3461
- };
3462
- declare class ZodMessageSender<TMessageCatalog extends ZodMessageCatalogSchema> {
3463
- #private;
3464
- constructor(options: ZodMessageSenderOptions<TMessageCatalog>);
3465
- send<K extends keyof TMessageCatalog>(type: K, payload: z.input<TMessageCatalog[K]>): Promise<void>;
3466
- }
3467
-
3468
- declare function parseError(error: unknown): TaskRunError;
3469
- declare function createErrorTaskError(error: TaskRunError): any;
3470
-
3471
- interface RuntimeManager {
3472
- disable(): void;
3473
- waitUntil(date: Date): Promise<void>;
3474
- waitForDuration(ms: number): Promise<void>;
3475
- waitForTask(params: {
3476
- id: string;
3477
- ctx: TaskRunContext;
3478
- }): Promise<TaskRunExecutionResult>;
3479
- }
3480
-
3481
- declare class RuntimeAPI {
3482
- #private;
3483
- private static _instance?;
3484
- private constructor();
3485
- static getInstance(): RuntimeAPI;
3486
- waitForDuration(ms: number): Promise<void>;
3487
- waitUntil(date: Date): Promise<void>;
3488
- waitForTask(params: {
3489
- id: string;
3490
- ctx: TaskRunContext;
3491
- }): Promise<TaskRunExecutionResult>;
3492
- setGlobalRuntimeManager(runtimeManager: RuntimeManager): boolean;
3493
- disable(): void;
3494
- }
3495
-
3496
- /** Entrypoint for runtime API */
3497
- declare const runtime: RuntimeAPI;
3498
-
3499
- type LogLevel = "log" | "error" | "warn" | "info" | "debug";
3500
- type TaskLoggerConfig = {
3501
- logger: Logger;
3502
- level: LogLevel;
3503
- };
3504
- interface TaskLogger {
3505
- debug(message: string, properties?: Record<string, unknown>): void;
3506
- log(message: string, properties?: Record<string, unknown>): void;
3507
- info(message: string, properties?: Record<string, unknown>): void;
3508
- warn(message: string, properties?: Record<string, unknown>): void;
3509
- error(message: string, properties?: Record<string, unknown>): void;
3510
- }
3511
- declare class OtelTaskLogger implements TaskLogger {
3512
- #private;
3513
- private readonly _config;
3514
- private readonly _level;
3515
- constructor(_config: TaskLoggerConfig);
3516
- debug(message: string, properties?: Record<string, unknown>): void;
3517
- log(message: string, properties?: Record<string, unknown>): void;
3518
- info(message: string, properties?: Record<string, unknown>): void;
3519
- warn(message: string, properties?: Record<string, unknown>): void;
3520
- error(message: string, properties?: Record<string, unknown>): void;
3521
- }
3522
-
3523
- declare class LoggerAPI implements TaskLogger {
3524
- #private;
3525
- private static _instance?;
3526
- private constructor();
3527
- static getInstance(): LoggerAPI;
3528
- disable(): void;
3529
- setGlobalTaskLogger(taskLogger: TaskLogger): boolean;
3530
- debug(message: string, metadata?: Record<string, unknown>): void;
3531
- log(message: string, metadata?: Record<string, unknown>): void;
3532
- info(message: string, metadata?: Record<string, unknown>): void;
3533
- warn(message: string, metadata?: Record<string, unknown>): void;
3534
- error(message: string, metadata?: Record<string, unknown>): void;
3535
- }
3536
-
3537
- /** Entrypoint for logger API */
3538
- declare const logger: LoggerAPI;
3539
-
3540
- declare const SemanticInternalAttributes: {
3541
- ENVIRONMENT_ID: string;
3542
- ENVIRONMENT_TYPE: string;
3543
- ORGANIZATION_ID: string;
3544
- PROJECT_ID: string;
3545
- PROJECT_REF: string;
3546
- ATTEMPT_ID: string;
3547
- ATTEMP_NUMBER: string;
3548
- RUN_ID: string;
3549
- TASK_SLUG: string;
3550
- TASK_PATH: string;
3551
- TASK_EXPORT_NAME: string;
3552
- SPAN_PARTIAL: string;
3553
- SPAN_ID: string;
3554
- OUTPUT: string;
3555
- STYLE: string;
3556
- STYLE_ICON: string;
3557
- METADATA: string;
3558
- TRIGGER: string;
3559
- PAYLOAD: string;
3560
- WORKER_ID: string;
3561
- WORKER_VERSION: string;
3562
- CLI_VERSION: string;
3563
- SDK_VERSION: string;
3564
- SDK_LANGUAGE: string;
3565
- };
3566
-
3567
- type TaskContext = {
3568
- ctx: TaskRunContext;
3569
- payload: any;
3570
- worker: BackgroundWorkerRecord;
3571
- };
3572
- declare class TaskContextManager {
3573
- #private;
3574
- private _storage;
3575
- get isInsideTask(): boolean;
3576
- get ctx(): TaskRunContext | undefined;
3577
- get payload(): any | undefined;
3578
- get worker(): BackgroundWorkerRecord | undefined;
3579
- get attributes(): Attributes;
3580
- runWith<R extends (...args: any[]) => Promise<any>>(context: TaskContext, fn: R): Promise<ReturnType<R>>;
3581
- }
3582
- declare const taskContextManager: TaskContextManager;
3583
-
3584
- type TriggerTracerConfig = {
3585
- name: string;
3586
- version: string;
3587
- } | {
3588
- tracer: Tracer;
3589
- logger: Logger;
3590
- };
3591
- declare class TriggerTracer {
3592
- private readonly _config;
3593
- constructor(_config: TriggerTracerConfig);
3594
- private _tracer;
3595
- private get tracer();
3596
- private _logger;
3597
- private get logger();
3598
- extractContext(traceContext?: Record<string, unknown>): Context;
3599
- startActiveSpan<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions, ctx?: Context): Promise<T>;
3600
- }
3601
-
3602
- type DevRuntimeManagerOptions = {
3603
- tracer: TriggerTracer;
3604
- };
3605
- declare class DevRuntimeManager implements RuntimeManager {
3606
- private readonly options;
3607
- _taskWaits: Map<string, {
3608
- resolve: (value: TaskRunExecutionResult) => void;
3609
- reject: (err?: any) => void;
3610
- }>;
3611
- constructor(options: DevRuntimeManagerOptions);
3612
- disable(): void;
3613
- waitForDuration(ms: number): Promise<void>;
3614
- waitUntil(date: Date): Promise<void>;
3615
- waitForTask(params: {
3616
- id: string;
3617
- ctx: TaskRunContext;
3618
- }): Promise<TaskRunExecutionResult>;
3619
- resumeTask(completion: TaskRunExecutionResult, execution: TaskRunExecution): void;
3620
- }
3621
-
3622
- declare class ConsoleInterceptor {
3623
- #private;
3624
- private readonly logger;
3625
- constructor(logger: logsAPI.Logger);
3626
- intercept<T, R extends Promise<T>>(console: Console, callback: () => R): Promise<T>;
3627
- log(...args: unknown[]): void;
3628
- info(...args: unknown[]): void;
3629
- warn(...args: unknown[]): void;
3630
- error(...args: unknown[]): void;
3631
- }
3632
-
3633
- declare function flattenAttributes(obj: Record<string, unknown> | null | undefined, prefix?: string): Attributes;
3634
-
3635
- declare function parseTriggerTaskRequestBody(body: unknown): zod.SafeParseReturnType<{
3636
- payload?: any;
3637
- context?: any;
3638
- options?: {
3639
- parentAttempt?: string | undefined;
3640
- lockToCurrentVersion?: boolean | undefined;
3641
- } | undefined;
3642
- }, {
3643
- payload?: any;
3644
- context?: any;
3645
- options?: {
3646
- parentAttempt?: string | undefined;
3647
- lockToCurrentVersion?: boolean | undefined;
3648
- } | undefined;
3649
- }>;
3650
-
3651
- export { ApiClient, BackgroundWorkerClientMessages, BackgroundWorkerMetadata, BackgroundWorkerRecord, BackgroundWorkerServerMessages, ConsoleInterceptor, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, DevRuntimeManager, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectDevResponse, OtelTaskLogger, type RuntimeManager, SemanticInternalAttributes, type TaskLogger, TaskMetadata, TaskMetadataWithFilePath, TaskResource, TaskRun, TaskRunBuiltInError, TaskRunContext, TaskRunCustomErrorObject, TaskRunError, TaskRunErrorCodes, TaskRunExecution, TaskRunExecutionAttempt, TaskRunExecutionEnvironment, TaskRunExecutionOrganization, TaskRunExecutionPayload, TaskRunExecutionProject, TaskRunExecutionResult, TaskRunExecutionTask, TaskRunFailedExecutionResult, TaskRunInternalError, TaskRunStringError, TaskRunSuccessfulExecutionResult, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, type WhoAmIResponse, WhoAmIResponseSchema, type ZodMessageCatalogSchema, ZodMessageHandler, type ZodMessageHandlerOptions, type ZodMessageHandlers, ZodMessageSender, type ZodMessageSenderOptions, childToWorkerMessages, clientWebsocketMessages, createErrorTaskError, flattenAttributes, logger, parseError, parseTriggerTaskRequestBody, runtime, serverWebsocketMessages, taskContextManager, workerToChildMessages };