@kilnci/shared 0.20.0 → 0.22.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,1217 @@
1
+ /**
2
+ * Pipeline configuration schema and parsing
3
+ *
4
+ * This module provides the canonical schema for .kiln.yml files,
5
+ * used by both master (for trigger matching) and worker (for execution).
6
+ */
7
+ import { z } from 'zod';
8
+ export declare const EnvValueSchema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, string, string | number | boolean>;
9
+ export declare const CommandSchema: z.ZodEffects<z.ZodString, string, string>;
10
+ export declare const WhenConditionObjectSchema: z.ZodObject<{
11
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
+ tag: z.ZodOptional<z.ZodBoolean>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ branch?: string | string[] | undefined;
15
+ tag?: boolean | undefined;
16
+ }, {
17
+ branch?: string | string[] | undefined;
18
+ tag?: boolean | undefined;
19
+ }>;
20
+ export type WhenConditionObject = z.infer<typeof WhenConditionObjectSchema>;
21
+ export declare const WhenConditionSchema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
22
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
23
+ tag: z.ZodOptional<z.ZodBoolean>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ branch?: string | string[] | undefined;
26
+ tag?: boolean | undefined;
27
+ }, {
28
+ branch?: string | string[] | undefined;
29
+ tag?: boolean | undefined;
30
+ }>, z.ZodArray<z.ZodObject<{
31
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
32
+ tag: z.ZodOptional<z.ZodBoolean>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ branch?: string | string[] | undefined;
35
+ tag?: boolean | undefined;
36
+ }, {
37
+ branch?: string | string[] | undefined;
38
+ tag?: boolean | undefined;
39
+ }>, "many">]>>;
40
+ export type WhenCondition = z.infer<typeof WhenConditionSchema>;
41
+ export declare const OverrideConditionSchema: z.ZodObject<{
42
+ ref_type: z.ZodOptional<z.ZodEnum<["branch", "tag", "pull_request"]>>;
43
+ branch: z.ZodOptional<z.ZodString>;
44
+ tag: z.ZodOptional<z.ZodString>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ branch?: string | undefined;
47
+ tag?: string | undefined;
48
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
49
+ }, {
50
+ branch?: string | undefined;
51
+ tag?: string | undefined;
52
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
53
+ }>;
54
+ export type OverrideCondition = z.infer<typeof OverrideConditionSchema>;
55
+ export declare const OverrideSchema: z.ZodObject<{
56
+ when: z.ZodObject<{
57
+ ref_type: z.ZodOptional<z.ZodEnum<["branch", "tag", "pull_request"]>>;
58
+ branch: z.ZodOptional<z.ZodString>;
59
+ tag: z.ZodOptional<z.ZodString>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ branch?: string | undefined;
62
+ tag?: string | undefined;
63
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
64
+ }, {
65
+ branch?: string | undefined;
66
+ tag?: string | undefined;
67
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
68
+ }>;
69
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, string, string | number | boolean>>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ when: {
72
+ branch?: string | undefined;
73
+ tag?: string | undefined;
74
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
75
+ };
76
+ env?: Record<string, string> | undefined;
77
+ }, {
78
+ when: {
79
+ branch?: string | undefined;
80
+ tag?: string | undefined;
81
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
82
+ };
83
+ env?: Record<string, string | number | boolean> | undefined;
84
+ }>;
85
+ export type Override = z.infer<typeof OverrideSchema>;
86
+ export declare const ArtifactWhenSchema: z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>;
87
+ export type ArtifactWhen = z.infer<typeof ArtifactWhenSchema>;
88
+ export declare const StageArtifactSchema: z.ZodObject<{
89
+ name: z.ZodString;
90
+ globs: z.ZodArray<z.ZodString, "many">;
91
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ name: string;
94
+ globs: string[];
95
+ when?: "on_success" | "always" | "on_failure" | undefined;
96
+ }, {
97
+ name: string;
98
+ globs: string[];
99
+ when?: "on_success" | "always" | "on_failure" | undefined;
100
+ }>;
101
+ export type StageArtifact = z.infer<typeof StageArtifactSchema>;
102
+ export declare const StageSchema: z.ZodObject<{
103
+ name: z.ZodString;
104
+ commands: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
105
+ when: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
106
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
107
+ tag: z.ZodOptional<z.ZodBoolean>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ branch?: string | string[] | undefined;
110
+ tag?: boolean | undefined;
111
+ }, {
112
+ branch?: string | string[] | undefined;
113
+ tag?: boolean | undefined;
114
+ }>, z.ZodArray<z.ZodObject<{
115
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
116
+ tag: z.ZodOptional<z.ZodBoolean>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ branch?: string | string[] | undefined;
119
+ tag?: boolean | undefined;
120
+ }, {
121
+ branch?: string | string[] | undefined;
122
+ tag?: boolean | undefined;
123
+ }>, "many">]>>;
124
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
+ name: z.ZodString;
126
+ globs: z.ZodArray<z.ZodString, "many">;
127
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ name: string;
130
+ globs: string[];
131
+ when?: "on_success" | "always" | "on_failure" | undefined;
132
+ }, {
133
+ name: string;
134
+ globs: string[];
135
+ when?: "on_success" | "always" | "on_failure" | undefined;
136
+ }>, "many">>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ name: string;
139
+ commands: string[];
140
+ artifacts?: {
141
+ name: string;
142
+ globs: string[];
143
+ when?: "on_success" | "always" | "on_failure" | undefined;
144
+ }[] | undefined;
145
+ when?: {
146
+ branch?: string | string[] | undefined;
147
+ tag?: boolean | undefined;
148
+ } | {
149
+ branch?: string | string[] | undefined;
150
+ tag?: boolean | undefined;
151
+ }[] | undefined;
152
+ }, {
153
+ name: string;
154
+ commands: string[];
155
+ artifacts?: {
156
+ name: string;
157
+ globs: string[];
158
+ when?: "on_success" | "always" | "on_failure" | undefined;
159
+ }[] | undefined;
160
+ when?: {
161
+ branch?: string | string[] | undefined;
162
+ tag?: boolean | undefined;
163
+ } | {
164
+ branch?: string | string[] | undefined;
165
+ tag?: boolean | undefined;
166
+ }[] | undefined;
167
+ }>;
168
+ export type Stage = z.infer<typeof StageSchema>;
169
+ /**
170
+ * Branch filter for push and pull_request triggers
171
+ *
172
+ * Supports:
173
+ * - branches: array of patterns to include
174
+ * - branches-ignore: array of patterns to exclude
175
+ */
176
+ export declare const BranchFilterSchema: z.ZodObject<{
177
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ branches?: string[] | undefined;
181
+ 'branches-ignore'?: string[] | undefined;
182
+ }, {
183
+ branches?: string[] | undefined;
184
+ 'branches-ignore'?: string[] | undefined;
185
+ }>;
186
+ export type BranchFilter = z.infer<typeof BranchFilterSchema>;
187
+ /**
188
+ * Tag filter for tag triggers
189
+ *
190
+ * Supports:
191
+ * - tags: array of patterns to include
192
+ * - tags-ignore: array of patterns to exclude
193
+ */
194
+ export declare const TagFilterSchema: z.ZodObject<{
195
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
196
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ tags?: string[] | undefined;
199
+ 'tags-ignore'?: string[] | undefined;
200
+ }, {
201
+ tags?: string[] | undefined;
202
+ 'tags-ignore'?: string[] | undefined;
203
+ }>;
204
+ export type TagFilter = z.infer<typeof TagFilterSchema>;
205
+ /**
206
+ * Push trigger schema
207
+ *
208
+ * Can be:
209
+ * - true or null: trigger on all branches
210
+ * - object with filters: trigger on matching branches
211
+ */
212
+ export declare const PushTriggerSchema: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
213
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
214
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
215
+ }, "strip", z.ZodTypeAny, {
216
+ branches?: string[] | undefined;
217
+ 'branches-ignore'?: string[] | undefined;
218
+ }, {
219
+ branches?: string[] | undefined;
220
+ 'branches-ignore'?: string[] | undefined;
221
+ }>]>>;
222
+ export type PushTrigger = z.infer<typeof PushTriggerSchema>;
223
+ /**
224
+ * Pull request trigger schema
225
+ *
226
+ * Can be:
227
+ * - true or null: trigger on all PRs
228
+ * - object with filters: trigger on PRs targeting matching branches
229
+ */
230
+ export declare const PullRequestTriggerSchema: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
231
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
232
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ branches?: string[] | undefined;
235
+ 'branches-ignore'?: string[] | undefined;
236
+ }, {
237
+ branches?: string[] | undefined;
238
+ 'branches-ignore'?: string[] | undefined;
239
+ }>]>>;
240
+ export type PullRequestTrigger = z.infer<typeof PullRequestTriggerSchema>;
241
+ /**
242
+ * Tag trigger schema
243
+ *
244
+ * Can be:
245
+ * - true or null: trigger on all tags
246
+ * - object with filters: trigger on matching tags
247
+ */
248
+ export declare const TagTriggerSchema: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
249
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
250
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
251
+ }, "strip", z.ZodTypeAny, {
252
+ tags?: string[] | undefined;
253
+ 'tags-ignore'?: string[] | undefined;
254
+ }, {
255
+ tags?: string[] | undefined;
256
+ 'tags-ignore'?: string[] | undefined;
257
+ }>]>>;
258
+ export type TagTrigger = z.infer<typeof TagTriggerSchema>;
259
+ /**
260
+ * Single pipeline trigger configuration object
261
+ *
262
+ * All fields are optional - omitting a trigger type means it won't fire for that event.
263
+ * Multiple trigger types in the same object are OR logic - the pipeline runs
264
+ * if any trigger matches the event.
265
+ */
266
+ export declare const PipelineTriggerObjectSchema: z.ZodObject<{
267
+ push: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
268
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
269
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ branches?: string[] | undefined;
272
+ 'branches-ignore'?: string[] | undefined;
273
+ }, {
274
+ branches?: string[] | undefined;
275
+ 'branches-ignore'?: string[] | undefined;
276
+ }>]>>>;
277
+ pull_request: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
278
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
279
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
280
+ }, "strip", z.ZodTypeAny, {
281
+ branches?: string[] | undefined;
282
+ 'branches-ignore'?: string[] | undefined;
283
+ }, {
284
+ branches?: string[] | undefined;
285
+ 'branches-ignore'?: string[] | undefined;
286
+ }>]>>>;
287
+ tag: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
288
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
289
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ tags?: string[] | undefined;
292
+ 'tags-ignore'?: string[] | undefined;
293
+ }, {
294
+ tags?: string[] | undefined;
295
+ 'tags-ignore'?: string[] | undefined;
296
+ }>]>>>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ push?: true | {
299
+ branches?: string[] | undefined;
300
+ 'branches-ignore'?: string[] | undefined;
301
+ } | null | undefined;
302
+ pull_request?: true | {
303
+ branches?: string[] | undefined;
304
+ 'branches-ignore'?: string[] | undefined;
305
+ } | null | undefined;
306
+ tag?: true | {
307
+ tags?: string[] | undefined;
308
+ 'tags-ignore'?: string[] | undefined;
309
+ } | null | undefined;
310
+ }, {
311
+ push?: true | {
312
+ branches?: string[] | undefined;
313
+ 'branches-ignore'?: string[] | undefined;
314
+ } | null | undefined;
315
+ pull_request?: true | {
316
+ branches?: string[] | undefined;
317
+ 'branches-ignore'?: string[] | undefined;
318
+ } | null | undefined;
319
+ tag?: true | {
320
+ tags?: string[] | undefined;
321
+ 'tags-ignore'?: string[] | undefined;
322
+ } | null | undefined;
323
+ }>;
324
+ export type PipelineTriggerObject = z.infer<typeof PipelineTriggerObjectSchema>;
325
+ /**
326
+ * Pipeline trigger configuration
327
+ *
328
+ * Uses object syntax where multiple trigger types are OR logic - the pipeline runs
329
+ * if any trigger matches the event.
330
+ *
331
+ * Example: `on: { push: { branches: [main] }, tag: true }`
332
+ * This runs on pushes to main OR on any tag.
333
+ */
334
+ export declare const PipelineOnSchema: z.ZodOptional<z.ZodObject<{
335
+ push: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
336
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
337
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
338
+ }, "strip", z.ZodTypeAny, {
339
+ branches?: string[] | undefined;
340
+ 'branches-ignore'?: string[] | undefined;
341
+ }, {
342
+ branches?: string[] | undefined;
343
+ 'branches-ignore'?: string[] | undefined;
344
+ }>]>>>;
345
+ pull_request: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
346
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
347
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ branches?: string[] | undefined;
350
+ 'branches-ignore'?: string[] | undefined;
351
+ }, {
352
+ branches?: string[] | undefined;
353
+ 'branches-ignore'?: string[] | undefined;
354
+ }>]>>>;
355
+ tag: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
356
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
357
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
358
+ }, "strip", z.ZodTypeAny, {
359
+ tags?: string[] | undefined;
360
+ 'tags-ignore'?: string[] | undefined;
361
+ }, {
362
+ tags?: string[] | undefined;
363
+ 'tags-ignore'?: string[] | undefined;
364
+ }>]>>>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ push?: true | {
367
+ branches?: string[] | undefined;
368
+ 'branches-ignore'?: string[] | undefined;
369
+ } | null | undefined;
370
+ pull_request?: true | {
371
+ branches?: string[] | undefined;
372
+ 'branches-ignore'?: string[] | undefined;
373
+ } | null | undefined;
374
+ tag?: true | {
375
+ tags?: string[] | undefined;
376
+ 'tags-ignore'?: string[] | undefined;
377
+ } | null | undefined;
378
+ }, {
379
+ push?: true | {
380
+ branches?: string[] | undefined;
381
+ 'branches-ignore'?: string[] | undefined;
382
+ } | null | undefined;
383
+ pull_request?: true | {
384
+ branches?: string[] | undefined;
385
+ 'branches-ignore'?: string[] | undefined;
386
+ } | null | undefined;
387
+ tag?: true | {
388
+ tags?: string[] | undefined;
389
+ 'tags-ignore'?: string[] | undefined;
390
+ } | null | undefined;
391
+ }>>;
392
+ export type PipelineOn = z.infer<typeof PipelineOnSchema>;
393
+ /**
394
+ * Pipeline schema
395
+ *
396
+ * A pipeline defines:
397
+ * - name: unique identifier
398
+ * - on: trigger configuration (when to run)
399
+ * - stages: ordered list of stages to execute
400
+ * - finally: stages that always run (even on failure)
401
+ */
402
+ export declare const PipelineSchema: z.ZodObject<{
403
+ name: z.ZodString;
404
+ on: z.ZodOptional<z.ZodObject<{
405
+ push: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
406
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
407
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
408
+ }, "strip", z.ZodTypeAny, {
409
+ branches?: string[] | undefined;
410
+ 'branches-ignore'?: string[] | undefined;
411
+ }, {
412
+ branches?: string[] | undefined;
413
+ 'branches-ignore'?: string[] | undefined;
414
+ }>]>>>;
415
+ pull_request: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
416
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
417
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ branches?: string[] | undefined;
420
+ 'branches-ignore'?: string[] | undefined;
421
+ }, {
422
+ branches?: string[] | undefined;
423
+ 'branches-ignore'?: string[] | undefined;
424
+ }>]>>>;
425
+ tag: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
426
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
427
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
428
+ }, "strip", z.ZodTypeAny, {
429
+ tags?: string[] | undefined;
430
+ 'tags-ignore'?: string[] | undefined;
431
+ }, {
432
+ tags?: string[] | undefined;
433
+ 'tags-ignore'?: string[] | undefined;
434
+ }>]>>>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ push?: true | {
437
+ branches?: string[] | undefined;
438
+ 'branches-ignore'?: string[] | undefined;
439
+ } | null | undefined;
440
+ pull_request?: true | {
441
+ branches?: string[] | undefined;
442
+ 'branches-ignore'?: string[] | undefined;
443
+ } | null | undefined;
444
+ tag?: true | {
445
+ tags?: string[] | undefined;
446
+ 'tags-ignore'?: string[] | undefined;
447
+ } | null | undefined;
448
+ }, {
449
+ push?: true | {
450
+ branches?: string[] | undefined;
451
+ 'branches-ignore'?: string[] | undefined;
452
+ } | null | undefined;
453
+ pull_request?: true | {
454
+ branches?: string[] | undefined;
455
+ 'branches-ignore'?: string[] | undefined;
456
+ } | null | undefined;
457
+ tag?: true | {
458
+ tags?: string[] | undefined;
459
+ 'tags-ignore'?: string[] | undefined;
460
+ } | null | undefined;
461
+ }>>;
462
+ stages: z.ZodArray<z.ZodObject<{
463
+ name: z.ZodString;
464
+ commands: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
465
+ when: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
466
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
467
+ tag: z.ZodOptional<z.ZodBoolean>;
468
+ }, "strip", z.ZodTypeAny, {
469
+ branch?: string | string[] | undefined;
470
+ tag?: boolean | undefined;
471
+ }, {
472
+ branch?: string | string[] | undefined;
473
+ tag?: boolean | undefined;
474
+ }>, z.ZodArray<z.ZodObject<{
475
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
476
+ tag: z.ZodOptional<z.ZodBoolean>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ branch?: string | string[] | undefined;
479
+ tag?: boolean | undefined;
480
+ }, {
481
+ branch?: string | string[] | undefined;
482
+ tag?: boolean | undefined;
483
+ }>, "many">]>>;
484
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
485
+ name: z.ZodString;
486
+ globs: z.ZodArray<z.ZodString, "many">;
487
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ name: string;
490
+ globs: string[];
491
+ when?: "on_success" | "always" | "on_failure" | undefined;
492
+ }, {
493
+ name: string;
494
+ globs: string[];
495
+ when?: "on_success" | "always" | "on_failure" | undefined;
496
+ }>, "many">>;
497
+ }, "strip", z.ZodTypeAny, {
498
+ name: string;
499
+ commands: string[];
500
+ artifacts?: {
501
+ name: string;
502
+ globs: string[];
503
+ when?: "on_success" | "always" | "on_failure" | undefined;
504
+ }[] | undefined;
505
+ when?: {
506
+ branch?: string | string[] | undefined;
507
+ tag?: boolean | undefined;
508
+ } | {
509
+ branch?: string | string[] | undefined;
510
+ tag?: boolean | undefined;
511
+ }[] | undefined;
512
+ }, {
513
+ name: string;
514
+ commands: string[];
515
+ artifacts?: {
516
+ name: string;
517
+ globs: string[];
518
+ when?: "on_success" | "always" | "on_failure" | undefined;
519
+ }[] | undefined;
520
+ when?: {
521
+ branch?: string | string[] | undefined;
522
+ tag?: boolean | undefined;
523
+ } | {
524
+ branch?: string | string[] | undefined;
525
+ tag?: boolean | undefined;
526
+ }[] | undefined;
527
+ }>, "many">;
528
+ finally: z.ZodOptional<z.ZodArray<z.ZodObject<{
529
+ name: z.ZodString;
530
+ commands: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
531
+ when: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
532
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
533
+ tag: z.ZodOptional<z.ZodBoolean>;
534
+ }, "strip", z.ZodTypeAny, {
535
+ branch?: string | string[] | undefined;
536
+ tag?: boolean | undefined;
537
+ }, {
538
+ branch?: string | string[] | undefined;
539
+ tag?: boolean | undefined;
540
+ }>, z.ZodArray<z.ZodObject<{
541
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
542
+ tag: z.ZodOptional<z.ZodBoolean>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ branch?: string | string[] | undefined;
545
+ tag?: boolean | undefined;
546
+ }, {
547
+ branch?: string | string[] | undefined;
548
+ tag?: boolean | undefined;
549
+ }>, "many">]>>;
550
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
551
+ name: z.ZodString;
552
+ globs: z.ZodArray<z.ZodString, "many">;
553
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
554
+ }, "strip", z.ZodTypeAny, {
555
+ name: string;
556
+ globs: string[];
557
+ when?: "on_success" | "always" | "on_failure" | undefined;
558
+ }, {
559
+ name: string;
560
+ globs: string[];
561
+ when?: "on_success" | "always" | "on_failure" | undefined;
562
+ }>, "many">>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ name: string;
565
+ commands: string[];
566
+ artifacts?: {
567
+ name: string;
568
+ globs: string[];
569
+ when?: "on_success" | "always" | "on_failure" | undefined;
570
+ }[] | undefined;
571
+ when?: {
572
+ branch?: string | string[] | undefined;
573
+ tag?: boolean | undefined;
574
+ } | {
575
+ branch?: string | string[] | undefined;
576
+ tag?: boolean | undefined;
577
+ }[] | undefined;
578
+ }, {
579
+ name: string;
580
+ commands: string[];
581
+ artifacts?: {
582
+ name: string;
583
+ globs: string[];
584
+ when?: "on_success" | "always" | "on_failure" | undefined;
585
+ }[] | undefined;
586
+ when?: {
587
+ branch?: string | string[] | undefined;
588
+ tag?: boolean | undefined;
589
+ } | {
590
+ branch?: string | string[] | undefined;
591
+ tag?: boolean | undefined;
592
+ }[] | undefined;
593
+ }>, "many">>;
594
+ }, "strip", z.ZodTypeAny, {
595
+ name: string;
596
+ stages: {
597
+ name: string;
598
+ commands: string[];
599
+ artifacts?: {
600
+ name: string;
601
+ globs: string[];
602
+ when?: "on_success" | "always" | "on_failure" | undefined;
603
+ }[] | undefined;
604
+ when?: {
605
+ branch?: string | string[] | undefined;
606
+ tag?: boolean | undefined;
607
+ } | {
608
+ branch?: string | string[] | undefined;
609
+ tag?: boolean | undefined;
610
+ }[] | undefined;
611
+ }[];
612
+ on?: {
613
+ push?: true | {
614
+ branches?: string[] | undefined;
615
+ 'branches-ignore'?: string[] | undefined;
616
+ } | null | undefined;
617
+ pull_request?: true | {
618
+ branches?: string[] | undefined;
619
+ 'branches-ignore'?: string[] | undefined;
620
+ } | null | undefined;
621
+ tag?: true | {
622
+ tags?: string[] | undefined;
623
+ 'tags-ignore'?: string[] | undefined;
624
+ } | null | undefined;
625
+ } | undefined;
626
+ finally?: {
627
+ name: string;
628
+ commands: string[];
629
+ artifacts?: {
630
+ name: string;
631
+ globs: string[];
632
+ when?: "on_success" | "always" | "on_failure" | undefined;
633
+ }[] | undefined;
634
+ when?: {
635
+ branch?: string | string[] | undefined;
636
+ tag?: boolean | undefined;
637
+ } | {
638
+ branch?: string | string[] | undefined;
639
+ tag?: boolean | undefined;
640
+ }[] | undefined;
641
+ }[] | undefined;
642
+ }, {
643
+ name: string;
644
+ stages: {
645
+ name: string;
646
+ commands: string[];
647
+ artifacts?: {
648
+ name: string;
649
+ globs: string[];
650
+ when?: "on_success" | "always" | "on_failure" | undefined;
651
+ }[] | undefined;
652
+ when?: {
653
+ branch?: string | string[] | undefined;
654
+ tag?: boolean | undefined;
655
+ } | {
656
+ branch?: string | string[] | undefined;
657
+ tag?: boolean | undefined;
658
+ }[] | undefined;
659
+ }[];
660
+ on?: {
661
+ push?: true | {
662
+ branches?: string[] | undefined;
663
+ 'branches-ignore'?: string[] | undefined;
664
+ } | null | undefined;
665
+ pull_request?: true | {
666
+ branches?: string[] | undefined;
667
+ 'branches-ignore'?: string[] | undefined;
668
+ } | null | undefined;
669
+ tag?: true | {
670
+ tags?: string[] | undefined;
671
+ 'tags-ignore'?: string[] | undefined;
672
+ } | null | undefined;
673
+ } | undefined;
674
+ finally?: {
675
+ name: string;
676
+ commands: string[];
677
+ artifacts?: {
678
+ name: string;
679
+ globs: string[];
680
+ when?: "on_success" | "always" | "on_failure" | undefined;
681
+ }[] | undefined;
682
+ when?: {
683
+ branch?: string | string[] | undefined;
684
+ tag?: boolean | undefined;
685
+ } | {
686
+ branch?: string | string[] | undefined;
687
+ tag?: boolean | undefined;
688
+ }[] | undefined;
689
+ }[] | undefined;
690
+ }>;
691
+ export type Pipeline = z.infer<typeof PipelineSchema>;
692
+ /**
693
+ * Complete .kiln.yml configuration schema
694
+ */
695
+ export declare const PipelineConfigSchema: z.ZodObject<{
696
+ version: z.ZodLiteral<1>;
697
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, string, string | number | boolean>>>;
698
+ overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
699
+ when: z.ZodObject<{
700
+ ref_type: z.ZodOptional<z.ZodEnum<["branch", "tag", "pull_request"]>>;
701
+ branch: z.ZodOptional<z.ZodString>;
702
+ tag: z.ZodOptional<z.ZodString>;
703
+ }, "strip", z.ZodTypeAny, {
704
+ branch?: string | undefined;
705
+ tag?: string | undefined;
706
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
707
+ }, {
708
+ branch?: string | undefined;
709
+ tag?: string | undefined;
710
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
711
+ }>;
712
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, string, string | number | boolean>>>;
713
+ }, "strip", z.ZodTypeAny, {
714
+ when: {
715
+ branch?: string | undefined;
716
+ tag?: string | undefined;
717
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
718
+ };
719
+ env?: Record<string, string> | undefined;
720
+ }, {
721
+ when: {
722
+ branch?: string | undefined;
723
+ tag?: string | undefined;
724
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
725
+ };
726
+ env?: Record<string, string | number | boolean> | undefined;
727
+ }>, "many">>;
728
+ pipelines: z.ZodArray<z.ZodObject<{
729
+ name: z.ZodString;
730
+ on: z.ZodOptional<z.ZodObject<{
731
+ push: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
732
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
733
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
734
+ }, "strip", z.ZodTypeAny, {
735
+ branches?: string[] | undefined;
736
+ 'branches-ignore'?: string[] | undefined;
737
+ }, {
738
+ branches?: string[] | undefined;
739
+ 'branches-ignore'?: string[] | undefined;
740
+ }>]>>>;
741
+ pull_request: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
742
+ branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
743
+ 'branches-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
744
+ }, "strip", z.ZodTypeAny, {
745
+ branches?: string[] | undefined;
746
+ 'branches-ignore'?: string[] | undefined;
747
+ }, {
748
+ branches?: string[] | undefined;
749
+ 'branches-ignore'?: string[] | undefined;
750
+ }>]>>>;
751
+ tag: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodNull, z.ZodObject<{
752
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
753
+ 'tags-ignore': z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
754
+ }, "strip", z.ZodTypeAny, {
755
+ tags?: string[] | undefined;
756
+ 'tags-ignore'?: string[] | undefined;
757
+ }, {
758
+ tags?: string[] | undefined;
759
+ 'tags-ignore'?: string[] | undefined;
760
+ }>]>>>;
761
+ }, "strip", z.ZodTypeAny, {
762
+ push?: true | {
763
+ branches?: string[] | undefined;
764
+ 'branches-ignore'?: string[] | undefined;
765
+ } | null | undefined;
766
+ pull_request?: true | {
767
+ branches?: string[] | undefined;
768
+ 'branches-ignore'?: string[] | undefined;
769
+ } | null | undefined;
770
+ tag?: true | {
771
+ tags?: string[] | undefined;
772
+ 'tags-ignore'?: string[] | undefined;
773
+ } | null | undefined;
774
+ }, {
775
+ push?: true | {
776
+ branches?: string[] | undefined;
777
+ 'branches-ignore'?: string[] | undefined;
778
+ } | null | undefined;
779
+ pull_request?: true | {
780
+ branches?: string[] | undefined;
781
+ 'branches-ignore'?: string[] | undefined;
782
+ } | null | undefined;
783
+ tag?: true | {
784
+ tags?: string[] | undefined;
785
+ 'tags-ignore'?: string[] | undefined;
786
+ } | null | undefined;
787
+ }>>;
788
+ stages: z.ZodArray<z.ZodObject<{
789
+ name: z.ZodString;
790
+ commands: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
791
+ when: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
792
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
793
+ tag: z.ZodOptional<z.ZodBoolean>;
794
+ }, "strip", z.ZodTypeAny, {
795
+ branch?: string | string[] | undefined;
796
+ tag?: boolean | undefined;
797
+ }, {
798
+ branch?: string | string[] | undefined;
799
+ tag?: boolean | undefined;
800
+ }>, z.ZodArray<z.ZodObject<{
801
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
802
+ tag: z.ZodOptional<z.ZodBoolean>;
803
+ }, "strip", z.ZodTypeAny, {
804
+ branch?: string | string[] | undefined;
805
+ tag?: boolean | undefined;
806
+ }, {
807
+ branch?: string | string[] | undefined;
808
+ tag?: boolean | undefined;
809
+ }>, "many">]>>;
810
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
811
+ name: z.ZodString;
812
+ globs: z.ZodArray<z.ZodString, "many">;
813
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
814
+ }, "strip", z.ZodTypeAny, {
815
+ name: string;
816
+ globs: string[];
817
+ when?: "on_success" | "always" | "on_failure" | undefined;
818
+ }, {
819
+ name: string;
820
+ globs: string[];
821
+ when?: "on_success" | "always" | "on_failure" | undefined;
822
+ }>, "many">>;
823
+ }, "strip", z.ZodTypeAny, {
824
+ name: string;
825
+ commands: string[];
826
+ artifacts?: {
827
+ name: string;
828
+ globs: string[];
829
+ when?: "on_success" | "always" | "on_failure" | undefined;
830
+ }[] | undefined;
831
+ when?: {
832
+ branch?: string | string[] | undefined;
833
+ tag?: boolean | undefined;
834
+ } | {
835
+ branch?: string | string[] | undefined;
836
+ tag?: boolean | undefined;
837
+ }[] | undefined;
838
+ }, {
839
+ name: string;
840
+ commands: string[];
841
+ artifacts?: {
842
+ name: string;
843
+ globs: string[];
844
+ when?: "on_success" | "always" | "on_failure" | undefined;
845
+ }[] | undefined;
846
+ when?: {
847
+ branch?: string | string[] | undefined;
848
+ tag?: boolean | undefined;
849
+ } | {
850
+ branch?: string | string[] | undefined;
851
+ tag?: boolean | undefined;
852
+ }[] | undefined;
853
+ }>, "many">;
854
+ finally: z.ZodOptional<z.ZodArray<z.ZodObject<{
855
+ name: z.ZodString;
856
+ commands: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
857
+ when: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
858
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
859
+ tag: z.ZodOptional<z.ZodBoolean>;
860
+ }, "strip", z.ZodTypeAny, {
861
+ branch?: string | string[] | undefined;
862
+ tag?: boolean | undefined;
863
+ }, {
864
+ branch?: string | string[] | undefined;
865
+ tag?: boolean | undefined;
866
+ }>, z.ZodArray<z.ZodObject<{
867
+ branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
868
+ tag: z.ZodOptional<z.ZodBoolean>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ branch?: string | string[] | undefined;
871
+ tag?: boolean | undefined;
872
+ }, {
873
+ branch?: string | string[] | undefined;
874
+ tag?: boolean | undefined;
875
+ }>, "many">]>>;
876
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
877
+ name: z.ZodString;
878
+ globs: z.ZodArray<z.ZodString, "many">;
879
+ when: z.ZodOptional<z.ZodDefault<z.ZodEnum<["on_success", "always", "on_failure"]>>>;
880
+ }, "strip", z.ZodTypeAny, {
881
+ name: string;
882
+ globs: string[];
883
+ when?: "on_success" | "always" | "on_failure" | undefined;
884
+ }, {
885
+ name: string;
886
+ globs: string[];
887
+ when?: "on_success" | "always" | "on_failure" | undefined;
888
+ }>, "many">>;
889
+ }, "strip", z.ZodTypeAny, {
890
+ name: string;
891
+ commands: string[];
892
+ artifacts?: {
893
+ name: string;
894
+ globs: string[];
895
+ when?: "on_success" | "always" | "on_failure" | undefined;
896
+ }[] | undefined;
897
+ when?: {
898
+ branch?: string | string[] | undefined;
899
+ tag?: boolean | undefined;
900
+ } | {
901
+ branch?: string | string[] | undefined;
902
+ tag?: boolean | undefined;
903
+ }[] | undefined;
904
+ }, {
905
+ name: string;
906
+ commands: string[];
907
+ artifacts?: {
908
+ name: string;
909
+ globs: string[];
910
+ when?: "on_success" | "always" | "on_failure" | undefined;
911
+ }[] | undefined;
912
+ when?: {
913
+ branch?: string | string[] | undefined;
914
+ tag?: boolean | undefined;
915
+ } | {
916
+ branch?: string | string[] | undefined;
917
+ tag?: boolean | undefined;
918
+ }[] | undefined;
919
+ }>, "many">>;
920
+ }, "strip", z.ZodTypeAny, {
921
+ name: string;
922
+ stages: {
923
+ name: string;
924
+ commands: string[];
925
+ artifacts?: {
926
+ name: string;
927
+ globs: string[];
928
+ when?: "on_success" | "always" | "on_failure" | undefined;
929
+ }[] | undefined;
930
+ when?: {
931
+ branch?: string | string[] | undefined;
932
+ tag?: boolean | undefined;
933
+ } | {
934
+ branch?: string | string[] | undefined;
935
+ tag?: boolean | undefined;
936
+ }[] | undefined;
937
+ }[];
938
+ on?: {
939
+ push?: true | {
940
+ branches?: string[] | undefined;
941
+ 'branches-ignore'?: string[] | undefined;
942
+ } | null | undefined;
943
+ pull_request?: true | {
944
+ branches?: string[] | undefined;
945
+ 'branches-ignore'?: string[] | undefined;
946
+ } | null | undefined;
947
+ tag?: true | {
948
+ tags?: string[] | undefined;
949
+ 'tags-ignore'?: string[] | undefined;
950
+ } | null | undefined;
951
+ } | undefined;
952
+ finally?: {
953
+ name: string;
954
+ commands: string[];
955
+ artifacts?: {
956
+ name: string;
957
+ globs: string[];
958
+ when?: "on_success" | "always" | "on_failure" | undefined;
959
+ }[] | undefined;
960
+ when?: {
961
+ branch?: string | string[] | undefined;
962
+ tag?: boolean | undefined;
963
+ } | {
964
+ branch?: string | string[] | undefined;
965
+ tag?: boolean | undefined;
966
+ }[] | undefined;
967
+ }[] | undefined;
968
+ }, {
969
+ name: string;
970
+ stages: {
971
+ name: string;
972
+ commands: string[];
973
+ artifacts?: {
974
+ name: string;
975
+ globs: string[];
976
+ when?: "on_success" | "always" | "on_failure" | undefined;
977
+ }[] | undefined;
978
+ when?: {
979
+ branch?: string | string[] | undefined;
980
+ tag?: boolean | undefined;
981
+ } | {
982
+ branch?: string | string[] | undefined;
983
+ tag?: boolean | undefined;
984
+ }[] | undefined;
985
+ }[];
986
+ on?: {
987
+ push?: true | {
988
+ branches?: string[] | undefined;
989
+ 'branches-ignore'?: string[] | undefined;
990
+ } | null | undefined;
991
+ pull_request?: true | {
992
+ branches?: string[] | undefined;
993
+ 'branches-ignore'?: string[] | undefined;
994
+ } | null | undefined;
995
+ tag?: true | {
996
+ tags?: string[] | undefined;
997
+ 'tags-ignore'?: string[] | undefined;
998
+ } | null | undefined;
999
+ } | undefined;
1000
+ finally?: {
1001
+ name: string;
1002
+ commands: string[];
1003
+ artifacts?: {
1004
+ name: string;
1005
+ globs: string[];
1006
+ when?: "on_success" | "always" | "on_failure" | undefined;
1007
+ }[] | undefined;
1008
+ when?: {
1009
+ branch?: string | string[] | undefined;
1010
+ tag?: boolean | undefined;
1011
+ } | {
1012
+ branch?: string | string[] | undefined;
1013
+ tag?: boolean | undefined;
1014
+ }[] | undefined;
1015
+ }[] | undefined;
1016
+ }>, "many">;
1017
+ }, "strip", z.ZodTypeAny, {
1018
+ pipelines: {
1019
+ name: string;
1020
+ stages: {
1021
+ name: string;
1022
+ commands: string[];
1023
+ artifacts?: {
1024
+ name: string;
1025
+ globs: string[];
1026
+ when?: "on_success" | "always" | "on_failure" | undefined;
1027
+ }[] | undefined;
1028
+ when?: {
1029
+ branch?: string | string[] | undefined;
1030
+ tag?: boolean | undefined;
1031
+ } | {
1032
+ branch?: string | string[] | undefined;
1033
+ tag?: boolean | undefined;
1034
+ }[] | undefined;
1035
+ }[];
1036
+ on?: {
1037
+ push?: true | {
1038
+ branches?: string[] | undefined;
1039
+ 'branches-ignore'?: string[] | undefined;
1040
+ } | null | undefined;
1041
+ pull_request?: true | {
1042
+ branches?: string[] | undefined;
1043
+ 'branches-ignore'?: string[] | undefined;
1044
+ } | null | undefined;
1045
+ tag?: true | {
1046
+ tags?: string[] | undefined;
1047
+ 'tags-ignore'?: string[] | undefined;
1048
+ } | null | undefined;
1049
+ } | undefined;
1050
+ finally?: {
1051
+ name: string;
1052
+ commands: string[];
1053
+ artifacts?: {
1054
+ name: string;
1055
+ globs: string[];
1056
+ when?: "on_success" | "always" | "on_failure" | undefined;
1057
+ }[] | undefined;
1058
+ when?: {
1059
+ branch?: string | string[] | undefined;
1060
+ tag?: boolean | undefined;
1061
+ } | {
1062
+ branch?: string | string[] | undefined;
1063
+ tag?: boolean | undefined;
1064
+ }[] | undefined;
1065
+ }[] | undefined;
1066
+ }[];
1067
+ version: 1;
1068
+ env?: Record<string, string> | undefined;
1069
+ overrides?: {
1070
+ when: {
1071
+ branch?: string | undefined;
1072
+ tag?: string | undefined;
1073
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
1074
+ };
1075
+ env?: Record<string, string> | undefined;
1076
+ }[] | undefined;
1077
+ }, {
1078
+ pipelines: {
1079
+ name: string;
1080
+ stages: {
1081
+ name: string;
1082
+ commands: string[];
1083
+ artifacts?: {
1084
+ name: string;
1085
+ globs: string[];
1086
+ when?: "on_success" | "always" | "on_failure" | undefined;
1087
+ }[] | undefined;
1088
+ when?: {
1089
+ branch?: string | string[] | undefined;
1090
+ tag?: boolean | undefined;
1091
+ } | {
1092
+ branch?: string | string[] | undefined;
1093
+ tag?: boolean | undefined;
1094
+ }[] | undefined;
1095
+ }[];
1096
+ on?: {
1097
+ push?: true | {
1098
+ branches?: string[] | undefined;
1099
+ 'branches-ignore'?: string[] | undefined;
1100
+ } | null | undefined;
1101
+ pull_request?: true | {
1102
+ branches?: string[] | undefined;
1103
+ 'branches-ignore'?: string[] | undefined;
1104
+ } | null | undefined;
1105
+ tag?: true | {
1106
+ tags?: string[] | undefined;
1107
+ 'tags-ignore'?: string[] | undefined;
1108
+ } | null | undefined;
1109
+ } | undefined;
1110
+ finally?: {
1111
+ name: string;
1112
+ commands: string[];
1113
+ artifacts?: {
1114
+ name: string;
1115
+ globs: string[];
1116
+ when?: "on_success" | "always" | "on_failure" | undefined;
1117
+ }[] | undefined;
1118
+ when?: {
1119
+ branch?: string | string[] | undefined;
1120
+ tag?: boolean | undefined;
1121
+ } | {
1122
+ branch?: string | string[] | undefined;
1123
+ tag?: boolean | undefined;
1124
+ }[] | undefined;
1125
+ }[] | undefined;
1126
+ }[];
1127
+ version: 1;
1128
+ env?: Record<string, string | number | boolean> | undefined;
1129
+ overrides?: {
1130
+ when: {
1131
+ branch?: string | undefined;
1132
+ tag?: string | undefined;
1133
+ ref_type?: "branch" | "pull_request" | "tag" | undefined;
1134
+ };
1135
+ env?: Record<string, string | number | boolean> | undefined;
1136
+ }[] | undefined;
1137
+ }>;
1138
+ export type PipelineConfig = z.infer<typeof PipelineConfigSchema>;
1139
+ /**
1140
+ * Parsed pipeline config with pipelines array
1141
+ */
1142
+ export interface ParsedPipelineConfig {
1143
+ version: 1;
1144
+ env?: Record<string, string>;
1145
+ overrides?: Override[];
1146
+ pipelines: Pipeline[];
1147
+ }
1148
+ export type ParseResult = {
1149
+ success: true;
1150
+ config: ParsedPipelineConfig;
1151
+ } | {
1152
+ success: false;
1153
+ error: string;
1154
+ };
1155
+ /**
1156
+ * Parse and validate a .kiln.yml configuration
1157
+ *
1158
+ * This is the canonical parser - use this in both master and worker
1159
+ * to ensure consistent validation.
1160
+ */
1161
+ export declare function parsePipelineConfig(content: string): ParseResult;
1162
+ /**
1163
+ * Build context for evaluating stage conditions
1164
+ */
1165
+ export interface BuildContext {
1166
+ branch: string;
1167
+ isTag: boolean;
1168
+ }
1169
+ /**
1170
+ * Extended build context for evaluating overrides
1171
+ * Includes all the information needed to evaluate override conditions
1172
+ */
1173
+ export interface OverrideBuildContext extends BuildContext {
1174
+ pullRequestId?: string;
1175
+ }
1176
+ /**
1177
+ * Simple glob-like pattern matching
1178
+ * Supports * for any characters and ** for any path segments
1179
+ */
1180
+ export declare function matchesPattern(value: string, pattern: string): boolean;
1181
+ /**
1182
+ * Evaluate whether an override condition matches the build context
1183
+ */
1184
+ export declare function matchesOverrideCondition(condition: OverrideCondition, context: OverrideBuildContext): boolean;
1185
+ /**
1186
+ * Interpolate environment variable references in a string
1187
+ * Supports ${VAR_NAME} syntax
1188
+ */
1189
+ export declare function interpolateEnvValue(value: string, env: Record<string, string>): string;
1190
+ /**
1191
+ * Apply overrides to the base environment based on build context
1192
+ * Overrides are applied in order, later overrides take precedence
1193
+ *
1194
+ * @param baseEnv - The base environment variables (from .kiln.yml env section)
1195
+ * @param overrides - The override definitions from .kiln.yml
1196
+ * @param context - The build context for evaluating conditions
1197
+ * @param systemEnv - System environment variables (KILN_*) for interpolation
1198
+ * @param log - Optional logging function for debugging
1199
+ * @returns Merged environment with applicable overrides applied
1200
+ */
1201
+ export declare function applyOverrides(baseEnv: Record<string, string>, overrides: Override[] | undefined, context: OverrideBuildContext, systemEnv: Record<string, string>, log?: (message: string) => void): Record<string, string>;
1202
+ /**
1203
+ * Check if a ref looks like a tag (semantic version pattern)
1204
+ * Matches: v1.0.0, 1.0.0, v1.0, release-1.0, etc.
1205
+ */
1206
+ export declare function looksLikeTag(ref: string): boolean;
1207
+ /**
1208
+ * Evaluate whether a stage should run based on its `when` condition
1209
+ *
1210
+ * Supports two syntaxes:
1211
+ * - Object: { branch: 'main', tag: false } - AND logic, all conditions must match
1212
+ * - Array: [{ branch: 'main' }, { tag: true }] - OR logic, any condition matches = run
1213
+ */
1214
+ export declare function shouldRunStage(stage: Stage, context: BuildContext): boolean;
1215
+ export declare const PIPELINE_FILENAME = ".kiln.yml";
1216
+ export declare function getPipelineFilename(): string;
1217
+ //# sourceMappingURL=index.d.ts.map