@ebowwa/workflows 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,823 @@
1
+ /**
2
+ * Core types for CI/CD Workflow System
3
+ */
4
+ import { z } from 'zod';
5
+ export declare const TriggerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6
+ type: z.ZodLiteral<"manual">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "manual";
9
+ }, {
10
+ type: "manual";
11
+ }>, z.ZodObject<{
12
+ type: z.ZodLiteral<"schedule">;
13
+ cron: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ type: "schedule";
16
+ cron: string;
17
+ }, {
18
+ type: "schedule";
19
+ cron: string;
20
+ }>, z.ZodObject<{
21
+ type: z.ZodLiteral<"webhook">;
22
+ path: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ type: "webhook";
25
+ path: string;
26
+ }, {
27
+ type: "webhook";
28
+ path: string;
29
+ }>, z.ZodObject<{
30
+ type: z.ZodLiteral<"git">;
31
+ events: z.ZodArray<z.ZodEnum<["push", "pr", "merge"]>, "many">;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: "git";
34
+ events: ("push" | "pr" | "merge")[];
35
+ }, {
36
+ type: "git";
37
+ events: ("push" | "pr" | "merge")[];
38
+ }>]>;
39
+ export type Trigger = z.infer<typeof TriggerSchema>;
40
+ export declare const StepSchema: z.ZodObject<{
41
+ id: z.ZodOptional<z.ZodString>;
42
+ name: z.ZodOptional<z.ZodString>;
43
+ run: z.ZodString;
44
+ cwd: z.ZodOptional<z.ZodString>;
45
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
46
+ condition: z.ZodOptional<z.ZodString>;
47
+ retry: z.ZodOptional<z.ZodNumber>;
48
+ timeout: z.ZodOptional<z.ZodNumber>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ run: string;
51
+ id?: string | undefined;
52
+ name?: string | undefined;
53
+ cwd?: string | undefined;
54
+ env?: Record<string, string> | undefined;
55
+ condition?: string | undefined;
56
+ retry?: number | undefined;
57
+ timeout?: number | undefined;
58
+ }, {
59
+ run: string;
60
+ id?: string | undefined;
61
+ name?: string | undefined;
62
+ cwd?: string | undefined;
63
+ env?: Record<string, string> | undefined;
64
+ condition?: string | undefined;
65
+ retry?: number | undefined;
66
+ timeout?: number | undefined;
67
+ }>;
68
+ export type Step = z.infer<typeof StepSchema>;
69
+ export declare const JobSchema: z.ZodObject<{
70
+ name: z.ZodString;
71
+ runsOn: z.ZodEnum<["bun", "tsx", "rust", "bash"]>;
72
+ steps: z.ZodArray<z.ZodObject<{
73
+ id: z.ZodOptional<z.ZodString>;
74
+ name: z.ZodOptional<z.ZodString>;
75
+ run: z.ZodString;
76
+ cwd: z.ZodOptional<z.ZodString>;
77
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
78
+ condition: z.ZodOptional<z.ZodString>;
79
+ retry: z.ZodOptional<z.ZodNumber>;
80
+ timeout: z.ZodOptional<z.ZodNumber>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ run: string;
83
+ id?: string | undefined;
84
+ name?: string | undefined;
85
+ cwd?: string | undefined;
86
+ env?: Record<string, string> | undefined;
87
+ condition?: string | undefined;
88
+ retry?: number | undefined;
89
+ timeout?: number | undefined;
90
+ }, {
91
+ run: string;
92
+ id?: string | undefined;
93
+ name?: string | undefined;
94
+ cwd?: string | undefined;
95
+ env?: Record<string, string> | undefined;
96
+ condition?: string | undefined;
97
+ retry?: number | undefined;
98
+ timeout?: number | undefined;
99
+ }>, "many">;
100
+ needs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
101
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
102
+ timeout: z.ZodOptional<z.ZodNumber>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ name: string;
105
+ runsOn: "bun" | "tsx" | "rust" | "bash";
106
+ steps: {
107
+ run: string;
108
+ id?: string | undefined;
109
+ name?: string | undefined;
110
+ cwd?: string | undefined;
111
+ env?: Record<string, string> | undefined;
112
+ condition?: string | undefined;
113
+ retry?: number | undefined;
114
+ timeout?: number | undefined;
115
+ }[];
116
+ env?: Record<string, string> | undefined;
117
+ timeout?: number | undefined;
118
+ needs?: string[] | undefined;
119
+ }, {
120
+ name: string;
121
+ runsOn: "bun" | "tsx" | "rust" | "bash";
122
+ steps: {
123
+ run: string;
124
+ id?: string | undefined;
125
+ name?: string | undefined;
126
+ cwd?: string | undefined;
127
+ env?: Record<string, string> | undefined;
128
+ condition?: string | undefined;
129
+ retry?: number | undefined;
130
+ timeout?: number | undefined;
131
+ }[];
132
+ env?: Record<string, string> | undefined;
133
+ timeout?: number | undefined;
134
+ needs?: string[] | undefined;
135
+ }>;
136
+ export type Job = z.infer<typeof JobSchema>;
137
+ export declare const WorkflowSchema: z.ZodObject<{
138
+ id: z.ZodString;
139
+ name: z.ZodString;
140
+ description: z.ZodOptional<z.ZodString>;
141
+ triggers: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
142
+ type: z.ZodLiteral<"manual">;
143
+ }, "strip", z.ZodTypeAny, {
144
+ type: "manual";
145
+ }, {
146
+ type: "manual";
147
+ }>, z.ZodObject<{
148
+ type: z.ZodLiteral<"schedule">;
149
+ cron: z.ZodString;
150
+ }, "strip", z.ZodTypeAny, {
151
+ type: "schedule";
152
+ cron: string;
153
+ }, {
154
+ type: "schedule";
155
+ cron: string;
156
+ }>, z.ZodObject<{
157
+ type: z.ZodLiteral<"webhook">;
158
+ path: z.ZodString;
159
+ }, "strip", z.ZodTypeAny, {
160
+ type: "webhook";
161
+ path: string;
162
+ }, {
163
+ type: "webhook";
164
+ path: string;
165
+ }>, z.ZodObject<{
166
+ type: z.ZodLiteral<"git">;
167
+ events: z.ZodArray<z.ZodEnum<["push", "pr", "merge"]>, "many">;
168
+ }, "strip", z.ZodTypeAny, {
169
+ type: "git";
170
+ events: ("push" | "pr" | "merge")[];
171
+ }, {
172
+ type: "git";
173
+ events: ("push" | "pr" | "merge")[];
174
+ }>]>, "many">;
175
+ jobs: z.ZodRecord<z.ZodString, z.ZodObject<{
176
+ name: z.ZodString;
177
+ runsOn: z.ZodEnum<["bun", "tsx", "rust", "bash"]>;
178
+ steps: z.ZodArray<z.ZodObject<{
179
+ id: z.ZodOptional<z.ZodString>;
180
+ name: z.ZodOptional<z.ZodString>;
181
+ run: z.ZodString;
182
+ cwd: z.ZodOptional<z.ZodString>;
183
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
184
+ condition: z.ZodOptional<z.ZodString>;
185
+ retry: z.ZodOptional<z.ZodNumber>;
186
+ timeout: z.ZodOptional<z.ZodNumber>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ run: string;
189
+ id?: string | undefined;
190
+ name?: string | undefined;
191
+ cwd?: string | undefined;
192
+ env?: Record<string, string> | undefined;
193
+ condition?: string | undefined;
194
+ retry?: number | undefined;
195
+ timeout?: number | undefined;
196
+ }, {
197
+ run: string;
198
+ id?: string | undefined;
199
+ name?: string | undefined;
200
+ cwd?: string | undefined;
201
+ env?: Record<string, string> | undefined;
202
+ condition?: string | undefined;
203
+ retry?: number | undefined;
204
+ timeout?: number | undefined;
205
+ }>, "many">;
206
+ needs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
207
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
208
+ timeout: z.ZodOptional<z.ZodNumber>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ name: string;
211
+ runsOn: "bun" | "tsx" | "rust" | "bash";
212
+ steps: {
213
+ run: string;
214
+ id?: string | undefined;
215
+ name?: string | undefined;
216
+ cwd?: string | undefined;
217
+ env?: Record<string, string> | undefined;
218
+ condition?: string | undefined;
219
+ retry?: number | undefined;
220
+ timeout?: number | undefined;
221
+ }[];
222
+ env?: Record<string, string> | undefined;
223
+ timeout?: number | undefined;
224
+ needs?: string[] | undefined;
225
+ }, {
226
+ name: string;
227
+ runsOn: "bun" | "tsx" | "rust" | "bash";
228
+ steps: {
229
+ run: string;
230
+ id?: string | undefined;
231
+ name?: string | undefined;
232
+ cwd?: string | undefined;
233
+ env?: Record<string, string> | undefined;
234
+ condition?: string | undefined;
235
+ retry?: number | undefined;
236
+ timeout?: number | undefined;
237
+ }[];
238
+ env?: Record<string, string> | undefined;
239
+ timeout?: number | undefined;
240
+ needs?: string[] | undefined;
241
+ }>>;
242
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
243
+ }, "strip", z.ZodTypeAny, {
244
+ id: string;
245
+ name: string;
246
+ triggers: ({
247
+ type: "manual";
248
+ } | {
249
+ type: "schedule";
250
+ cron: string;
251
+ } | {
252
+ type: "webhook";
253
+ path: string;
254
+ } | {
255
+ type: "git";
256
+ events: ("push" | "pr" | "merge")[];
257
+ })[];
258
+ jobs: Record<string, {
259
+ name: string;
260
+ runsOn: "bun" | "tsx" | "rust" | "bash";
261
+ steps: {
262
+ run: string;
263
+ id?: string | undefined;
264
+ name?: string | undefined;
265
+ cwd?: string | undefined;
266
+ env?: Record<string, string> | undefined;
267
+ condition?: string | undefined;
268
+ retry?: number | undefined;
269
+ timeout?: number | undefined;
270
+ }[];
271
+ env?: Record<string, string> | undefined;
272
+ timeout?: number | undefined;
273
+ needs?: string[] | undefined;
274
+ }>;
275
+ env?: Record<string, string> | undefined;
276
+ description?: string | undefined;
277
+ }, {
278
+ id: string;
279
+ name: string;
280
+ triggers: ({
281
+ type: "manual";
282
+ } | {
283
+ type: "schedule";
284
+ cron: string;
285
+ } | {
286
+ type: "webhook";
287
+ path: string;
288
+ } | {
289
+ type: "git";
290
+ events: ("push" | "pr" | "merge")[];
291
+ })[];
292
+ jobs: Record<string, {
293
+ name: string;
294
+ runsOn: "bun" | "tsx" | "rust" | "bash";
295
+ steps: {
296
+ run: string;
297
+ id?: string | undefined;
298
+ name?: string | undefined;
299
+ cwd?: string | undefined;
300
+ env?: Record<string, string> | undefined;
301
+ condition?: string | undefined;
302
+ retry?: number | undefined;
303
+ timeout?: number | undefined;
304
+ }[];
305
+ env?: Record<string, string> | undefined;
306
+ timeout?: number | undefined;
307
+ needs?: string[] | undefined;
308
+ }>;
309
+ env?: Record<string, string> | undefined;
310
+ description?: string | undefined;
311
+ }>;
312
+ export type Workflow = z.infer<typeof WorkflowSchema>;
313
+ export declare const StepRunStatusSchema: z.ZodEnum<["pending", "running", "success", "failed", "skipped"]>;
314
+ export type StepRunStatus = z.infer<typeof StepRunStatusSchema>;
315
+ export declare const JobRunStatusSchema: z.ZodEnum<["pending", "running", "success", "failed", "skipped", "cancelled"]>;
316
+ export type JobRunStatus = z.infer<typeof JobRunStatusSchema>;
317
+ export declare const WorkflowRunStatusSchema: z.ZodEnum<["pending", "running", "success", "failed", "cancelled"]>;
318
+ export type WorkflowRunStatus = z.infer<typeof WorkflowRunStatusSchema>;
319
+ export declare const StepRunSchema: z.ZodObject<{
320
+ id: z.ZodString;
321
+ stepId: z.ZodString;
322
+ status: z.ZodEnum<["pending", "running", "success", "failed", "skipped"]>;
323
+ exitCode: z.ZodOptional<z.ZodNumber>;
324
+ duration: z.ZodOptional<z.ZodNumber>;
325
+ startedAt: z.ZodOptional<z.ZodDate>;
326
+ finishedAt: z.ZodOptional<z.ZodDate>;
327
+ }, "strip", z.ZodTypeAny, {
328
+ status: "pending" | "running" | "success" | "failed" | "skipped";
329
+ id: string;
330
+ stepId: string;
331
+ exitCode?: number | undefined;
332
+ duration?: number | undefined;
333
+ startedAt?: Date | undefined;
334
+ finishedAt?: Date | undefined;
335
+ }, {
336
+ status: "pending" | "running" | "success" | "failed" | "skipped";
337
+ id: string;
338
+ stepId: string;
339
+ exitCode?: number | undefined;
340
+ duration?: number | undefined;
341
+ startedAt?: Date | undefined;
342
+ finishedAt?: Date | undefined;
343
+ }>;
344
+ export type StepRun = z.infer<typeof StepRunSchema>;
345
+ export declare const LogEntrySchema: z.ZodObject<{
346
+ timestamp: z.ZodDate;
347
+ jobId: z.ZodString;
348
+ stepId: z.ZodString;
349
+ stream: z.ZodEnum<["stdout", "stderr"]>;
350
+ content: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ stepId: string;
353
+ timestamp: Date;
354
+ jobId: string;
355
+ stream: "stdout" | "stderr";
356
+ content: string;
357
+ }, {
358
+ stepId: string;
359
+ timestamp: Date;
360
+ jobId: string;
361
+ stream: "stdout" | "stderr";
362
+ content: string;
363
+ }>;
364
+ export type LogEntry = z.infer<typeof LogEntrySchema>;
365
+ export declare const JobRunSchema: z.ZodObject<{
366
+ id: z.ZodString;
367
+ jobId: z.ZodString;
368
+ status: z.ZodEnum<["pending", "running", "success", "failed", "skipped", "cancelled"]>;
369
+ steps: z.ZodArray<z.ZodObject<{
370
+ id: z.ZodString;
371
+ stepId: z.ZodString;
372
+ status: z.ZodEnum<["pending", "running", "success", "failed", "skipped"]>;
373
+ exitCode: z.ZodOptional<z.ZodNumber>;
374
+ duration: z.ZodOptional<z.ZodNumber>;
375
+ startedAt: z.ZodOptional<z.ZodDate>;
376
+ finishedAt: z.ZodOptional<z.ZodDate>;
377
+ }, "strip", z.ZodTypeAny, {
378
+ status: "pending" | "running" | "success" | "failed" | "skipped";
379
+ id: string;
380
+ stepId: string;
381
+ exitCode?: number | undefined;
382
+ duration?: number | undefined;
383
+ startedAt?: Date | undefined;
384
+ finishedAt?: Date | undefined;
385
+ }, {
386
+ status: "pending" | "running" | "success" | "failed" | "skipped";
387
+ id: string;
388
+ stepId: string;
389
+ exitCode?: number | undefined;
390
+ duration?: number | undefined;
391
+ startedAt?: Date | undefined;
392
+ finishedAt?: Date | undefined;
393
+ }>, "many">;
394
+ logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
395
+ timestamp: z.ZodDate;
396
+ jobId: z.ZodString;
397
+ stepId: z.ZodString;
398
+ stream: z.ZodEnum<["stdout", "stderr"]>;
399
+ content: z.ZodString;
400
+ }, "strip", z.ZodTypeAny, {
401
+ stepId: string;
402
+ timestamp: Date;
403
+ jobId: string;
404
+ stream: "stdout" | "stderr";
405
+ content: string;
406
+ }, {
407
+ stepId: string;
408
+ timestamp: Date;
409
+ jobId: string;
410
+ stream: "stdout" | "stderr";
411
+ content: string;
412
+ }>, "many">>;
413
+ startedAt: z.ZodOptional<z.ZodDate>;
414
+ finishedAt: z.ZodOptional<z.ZodDate>;
415
+ }, "strip", z.ZodTypeAny, {
416
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
417
+ id: string;
418
+ steps: {
419
+ status: "pending" | "running" | "success" | "failed" | "skipped";
420
+ id: string;
421
+ stepId: string;
422
+ exitCode?: number | undefined;
423
+ duration?: number | undefined;
424
+ startedAt?: Date | undefined;
425
+ finishedAt?: Date | undefined;
426
+ }[];
427
+ jobId: string;
428
+ startedAt?: Date | undefined;
429
+ finishedAt?: Date | undefined;
430
+ logs?: {
431
+ stepId: string;
432
+ timestamp: Date;
433
+ jobId: string;
434
+ stream: "stdout" | "stderr";
435
+ content: string;
436
+ }[] | undefined;
437
+ }, {
438
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
439
+ id: string;
440
+ steps: {
441
+ status: "pending" | "running" | "success" | "failed" | "skipped";
442
+ id: string;
443
+ stepId: string;
444
+ exitCode?: number | undefined;
445
+ duration?: number | undefined;
446
+ startedAt?: Date | undefined;
447
+ finishedAt?: Date | undefined;
448
+ }[];
449
+ jobId: string;
450
+ startedAt?: Date | undefined;
451
+ finishedAt?: Date | undefined;
452
+ logs?: {
453
+ stepId: string;
454
+ timestamp: Date;
455
+ jobId: string;
456
+ stream: "stdout" | "stderr";
457
+ content: string;
458
+ }[] | undefined;
459
+ }>;
460
+ export type JobRun = z.infer<typeof JobRunSchema>;
461
+ export declare const WorkflowRunSchema: z.ZodObject<{
462
+ id: z.ZodString;
463
+ workflowId: z.ZodString;
464
+ status: z.ZodEnum<["pending", "running", "success", "failed", "cancelled"]>;
465
+ trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
466
+ type: z.ZodLiteral<"manual">;
467
+ }, "strip", z.ZodTypeAny, {
468
+ type: "manual";
469
+ }, {
470
+ type: "manual";
471
+ }>, z.ZodObject<{
472
+ type: z.ZodLiteral<"schedule">;
473
+ cron: z.ZodString;
474
+ }, "strip", z.ZodTypeAny, {
475
+ type: "schedule";
476
+ cron: string;
477
+ }, {
478
+ type: "schedule";
479
+ cron: string;
480
+ }>, z.ZodObject<{
481
+ type: z.ZodLiteral<"webhook">;
482
+ path: z.ZodString;
483
+ }, "strip", z.ZodTypeAny, {
484
+ type: "webhook";
485
+ path: string;
486
+ }, {
487
+ type: "webhook";
488
+ path: string;
489
+ }>, z.ZodObject<{
490
+ type: z.ZodLiteral<"git">;
491
+ events: z.ZodArray<z.ZodEnum<["push", "pr", "merge"]>, "many">;
492
+ }, "strip", z.ZodTypeAny, {
493
+ type: "git";
494
+ events: ("push" | "pr" | "merge")[];
495
+ }, {
496
+ type: "git";
497
+ events: ("push" | "pr" | "merge")[];
498
+ }>]>;
499
+ jobs: z.ZodRecord<z.ZodString, z.ZodObject<{
500
+ id: z.ZodString;
501
+ jobId: z.ZodString;
502
+ status: z.ZodEnum<["pending", "running", "success", "failed", "skipped", "cancelled"]>;
503
+ steps: z.ZodArray<z.ZodObject<{
504
+ id: z.ZodString;
505
+ stepId: z.ZodString;
506
+ status: z.ZodEnum<["pending", "running", "success", "failed", "skipped"]>;
507
+ exitCode: z.ZodOptional<z.ZodNumber>;
508
+ duration: z.ZodOptional<z.ZodNumber>;
509
+ startedAt: z.ZodOptional<z.ZodDate>;
510
+ finishedAt: z.ZodOptional<z.ZodDate>;
511
+ }, "strip", z.ZodTypeAny, {
512
+ status: "pending" | "running" | "success" | "failed" | "skipped";
513
+ id: string;
514
+ stepId: string;
515
+ exitCode?: number | undefined;
516
+ duration?: number | undefined;
517
+ startedAt?: Date | undefined;
518
+ finishedAt?: Date | undefined;
519
+ }, {
520
+ status: "pending" | "running" | "success" | "failed" | "skipped";
521
+ id: string;
522
+ stepId: string;
523
+ exitCode?: number | undefined;
524
+ duration?: number | undefined;
525
+ startedAt?: Date | undefined;
526
+ finishedAt?: Date | undefined;
527
+ }>, "many">;
528
+ logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
529
+ timestamp: z.ZodDate;
530
+ jobId: z.ZodString;
531
+ stepId: z.ZodString;
532
+ stream: z.ZodEnum<["stdout", "stderr"]>;
533
+ content: z.ZodString;
534
+ }, "strip", z.ZodTypeAny, {
535
+ stepId: string;
536
+ timestamp: Date;
537
+ jobId: string;
538
+ stream: "stdout" | "stderr";
539
+ content: string;
540
+ }, {
541
+ stepId: string;
542
+ timestamp: Date;
543
+ jobId: string;
544
+ stream: "stdout" | "stderr";
545
+ content: string;
546
+ }>, "many">>;
547
+ startedAt: z.ZodOptional<z.ZodDate>;
548
+ finishedAt: z.ZodOptional<z.ZodDate>;
549
+ }, "strip", z.ZodTypeAny, {
550
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
551
+ id: string;
552
+ steps: {
553
+ status: "pending" | "running" | "success" | "failed" | "skipped";
554
+ id: string;
555
+ stepId: string;
556
+ exitCode?: number | undefined;
557
+ duration?: number | undefined;
558
+ startedAt?: Date | undefined;
559
+ finishedAt?: Date | undefined;
560
+ }[];
561
+ jobId: string;
562
+ startedAt?: Date | undefined;
563
+ finishedAt?: Date | undefined;
564
+ logs?: {
565
+ stepId: string;
566
+ timestamp: Date;
567
+ jobId: string;
568
+ stream: "stdout" | "stderr";
569
+ content: string;
570
+ }[] | undefined;
571
+ }, {
572
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
573
+ id: string;
574
+ steps: {
575
+ status: "pending" | "running" | "success" | "failed" | "skipped";
576
+ id: string;
577
+ stepId: string;
578
+ exitCode?: number | undefined;
579
+ duration?: number | undefined;
580
+ startedAt?: Date | undefined;
581
+ finishedAt?: Date | undefined;
582
+ }[];
583
+ jobId: string;
584
+ startedAt?: Date | undefined;
585
+ finishedAt?: Date | undefined;
586
+ logs?: {
587
+ stepId: string;
588
+ timestamp: Date;
589
+ jobId: string;
590
+ stream: "stdout" | "stderr";
591
+ content: string;
592
+ }[] | undefined;
593
+ }>>;
594
+ startedAt: z.ZodDate;
595
+ finishedAt: z.ZodOptional<z.ZodDate>;
596
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ status: "pending" | "running" | "success" | "failed" | "cancelled";
599
+ id: string;
600
+ jobs: Record<string, {
601
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
602
+ id: string;
603
+ steps: {
604
+ status: "pending" | "running" | "success" | "failed" | "skipped";
605
+ id: string;
606
+ stepId: string;
607
+ exitCode?: number | undefined;
608
+ duration?: number | undefined;
609
+ startedAt?: Date | undefined;
610
+ finishedAt?: Date | undefined;
611
+ }[];
612
+ jobId: string;
613
+ startedAt?: Date | undefined;
614
+ finishedAt?: Date | undefined;
615
+ logs?: {
616
+ stepId: string;
617
+ timestamp: Date;
618
+ jobId: string;
619
+ stream: "stdout" | "stderr";
620
+ content: string;
621
+ }[] | undefined;
622
+ }>;
623
+ startedAt: Date;
624
+ workflowId: string;
625
+ trigger: {
626
+ type: "manual";
627
+ } | {
628
+ type: "schedule";
629
+ cron: string;
630
+ } | {
631
+ type: "webhook";
632
+ path: string;
633
+ } | {
634
+ type: "git";
635
+ events: ("push" | "pr" | "merge")[];
636
+ };
637
+ env?: Record<string, string> | undefined;
638
+ finishedAt?: Date | undefined;
639
+ }, {
640
+ status: "pending" | "running" | "success" | "failed" | "cancelled";
641
+ id: string;
642
+ jobs: Record<string, {
643
+ status: "pending" | "running" | "success" | "failed" | "skipped" | "cancelled";
644
+ id: string;
645
+ steps: {
646
+ status: "pending" | "running" | "success" | "failed" | "skipped";
647
+ id: string;
648
+ stepId: string;
649
+ exitCode?: number | undefined;
650
+ duration?: number | undefined;
651
+ startedAt?: Date | undefined;
652
+ finishedAt?: Date | undefined;
653
+ }[];
654
+ jobId: string;
655
+ startedAt?: Date | undefined;
656
+ finishedAt?: Date | undefined;
657
+ logs?: {
658
+ stepId: string;
659
+ timestamp: Date;
660
+ jobId: string;
661
+ stream: "stdout" | "stderr";
662
+ content: string;
663
+ }[] | undefined;
664
+ }>;
665
+ startedAt: Date;
666
+ workflowId: string;
667
+ trigger: {
668
+ type: "manual";
669
+ } | {
670
+ type: "schedule";
671
+ cron: string;
672
+ } | {
673
+ type: "webhook";
674
+ path: string;
675
+ } | {
676
+ type: "git";
677
+ events: ("push" | "pr" | "merge")[];
678
+ };
679
+ env?: Record<string, string> | undefined;
680
+ finishedAt?: Date | undefined;
681
+ }>;
682
+ export type WorkflowRun = z.infer<typeof WorkflowRunSchema>;
683
+ export interface StepContext {
684
+ workspace: string;
685
+ env: Record<string, string>;
686
+ jobId: string;
687
+ stepIndex: number;
688
+ runId: string;
689
+ }
690
+ export interface JobContext {
691
+ workspace: string;
692
+ env: Record<string, string>;
693
+ runId: string;
694
+ jobId: string;
695
+ }
696
+ export interface StepResult {
697
+ exitCode: number;
698
+ stdout: string;
699
+ stderr: string;
700
+ duration: number;
701
+ succeeded: boolean;
702
+ }
703
+ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
704
+ type: z.ZodLiteral<"job_started">;
705
+ jobId: z.ZodString;
706
+ }, "strip", z.ZodTypeAny, {
707
+ type: "job_started";
708
+ jobId: string;
709
+ }, {
710
+ type: "job_started";
711
+ jobId: string;
712
+ }>, z.ZodObject<{
713
+ type: z.ZodLiteral<"step_started">;
714
+ jobId: z.ZodString;
715
+ stepId: z.ZodString;
716
+ }, "strip", z.ZodTypeAny, {
717
+ type: "step_started";
718
+ stepId: string;
719
+ jobId: string;
720
+ }, {
721
+ type: "step_started";
722
+ stepId: string;
723
+ jobId: string;
724
+ }>, z.ZodObject<{
725
+ type: z.ZodLiteral<"log">;
726
+ jobId: z.ZodString;
727
+ stepId: z.ZodString;
728
+ content: z.ZodString;
729
+ stream: z.ZodEnum<["stdout", "stderr"]>;
730
+ }, "strip", z.ZodTypeAny, {
731
+ type: "log";
732
+ stepId: string;
733
+ jobId: string;
734
+ stream: "stdout" | "stderr";
735
+ content: string;
736
+ }, {
737
+ type: "log";
738
+ stepId: string;
739
+ jobId: string;
740
+ stream: "stdout" | "stderr";
741
+ content: string;
742
+ }>, z.ZodObject<{
743
+ type: z.ZodLiteral<"step_finished">;
744
+ jobId: z.ZodString;
745
+ stepId: z.ZodString;
746
+ exitCode: z.ZodNumber;
747
+ duration: z.ZodNumber;
748
+ }, "strip", z.ZodTypeAny, {
749
+ type: "step_finished";
750
+ stepId: string;
751
+ exitCode: number;
752
+ duration: number;
753
+ jobId: string;
754
+ }, {
755
+ type: "step_finished";
756
+ stepId: string;
757
+ exitCode: number;
758
+ duration: number;
759
+ jobId: string;
760
+ }>, z.ZodObject<{
761
+ type: z.ZodLiteral<"job_finished">;
762
+ jobId: z.ZodString;
763
+ status: z.ZodString;
764
+ }, "strip", z.ZodTypeAny, {
765
+ type: "job_finished";
766
+ status: string;
767
+ jobId: string;
768
+ }, {
769
+ type: "job_finished";
770
+ status: string;
771
+ jobId: string;
772
+ }>, z.ZodObject<{
773
+ type: z.ZodLiteral<"workflow_finished">;
774
+ status: z.ZodString;
775
+ }, "strip", z.ZodTypeAny, {
776
+ type: "workflow_finished";
777
+ status: string;
778
+ }, {
779
+ type: "workflow_finished";
780
+ status: string;
781
+ }>]>;
782
+ export type ServerMessage = z.infer<typeof ServerMessageSchema>;
783
+ export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
784
+ type: z.ZodLiteral<"subscribe">;
785
+ runId: z.ZodString;
786
+ }, "strip", z.ZodTypeAny, {
787
+ type: "subscribe";
788
+ runId: string;
789
+ }, {
790
+ type: "subscribe";
791
+ runId: string;
792
+ }>, z.ZodObject<{
793
+ type: z.ZodLiteral<"cancel">;
794
+ }, "strip", z.ZodTypeAny, {
795
+ type: "cancel";
796
+ }, {
797
+ type: "cancel";
798
+ }>]>;
799
+ export type ClientMessage = z.infer<typeof ClientMessageSchema>;
800
+ export type WorkflowEventType = 'workflow:started' | 'workflow:finished' | 'job:started' | 'job:finished' | 'step:started' | 'step:log' | 'step:finished';
801
+ export interface WorkflowEvent {
802
+ type: WorkflowEventType;
803
+ runId: string;
804
+ jobId?: string;
805
+ stepId?: string;
806
+ data?: unknown;
807
+ }
808
+ export interface CreateWorkflowRequest {
809
+ workflow: Workflow;
810
+ }
811
+ export interface TriggerWorkflowRequest {
812
+ trigger?: Trigger;
813
+ env?: Record<string, string>;
814
+ }
815
+ export interface WorkflowListResponse {
816
+ workflows: Workflow[];
817
+ total: number;
818
+ }
819
+ export interface RunListResponse {
820
+ runs: WorkflowRun[];
821
+ total: number;
822
+ }
823
+ //# sourceMappingURL=types.d.ts.map