@sanity/workflow-engine 0.0.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,3294 @@
1
+ import { z } from "zod";
2
+
3
+ declare type Action = z.infer<typeof ActionSchema>;
4
+
5
+ declare const ActionSchema: z.ZodObject<
6
+ {
7
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action">>;
8
+ id: z.ZodString;
9
+ title: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ filter: z.ZodOptional<
12
+ z.ZodUnion<
13
+ readonly [
14
+ z.ZodString,
15
+ z.ZodObject<
16
+ {
17
+ ref: z.ZodString;
18
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
19
+ },
20
+ z.core.$strict
21
+ >,
22
+ ]
23
+ >
24
+ >;
25
+ params: z.ZodOptional<
26
+ z.ZodArray<
27
+ z.ZodObject<
28
+ {
29
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action.param">>;
30
+ id: z.ZodString;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ description: z.ZodOptional<z.ZodString>;
33
+ paramType: z.ZodEnum<{
34
+ string: "string";
35
+ number: "number";
36
+ boolean: "boolean";
37
+ url: "url";
38
+ dateTime: "dateTime";
39
+ actor: "actor";
40
+ "doc.ref": "doc.ref";
41
+ "doc.refs": "doc.refs";
42
+ json: "json";
43
+ }>;
44
+ required: z.ZodOptional<z.ZodBoolean>;
45
+ },
46
+ z.core.$strict
47
+ >
48
+ >
49
+ >;
50
+ setStatus: z.ZodOptional<
51
+ z.ZodEnum<{
52
+ done: "done";
53
+ skipped: "skipped";
54
+ failed: "failed";
55
+ }>
56
+ >;
57
+ ops: z.ZodOptional<
58
+ z.ZodArray<
59
+ z.ZodDiscriminatedUnion<
60
+ [
61
+ z.ZodObject<
62
+ {
63
+ type: z.ZodLiteral<"workflow.op.state.set">;
64
+ target: z.ZodObject<
65
+ {
66
+ scope: z.ZodEnum<{
67
+ workflow: "workflow";
68
+ stage: "stage";
69
+ task: "task";
70
+ }>;
71
+ slotId: z.ZodString;
72
+ },
73
+ z.core.$strict
74
+ >;
75
+ value: z.ZodType<
76
+ SourceInternal,
77
+ unknown,
78
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
79
+ >;
80
+ },
81
+ z.core.$strict
82
+ >,
83
+ z.ZodObject<
84
+ {
85
+ type: z.ZodLiteral<"workflow.op.state.append">;
86
+ target: z.ZodObject<
87
+ {
88
+ scope: z.ZodEnum<{
89
+ workflow: "workflow";
90
+ stage: "stage";
91
+ task: "task";
92
+ }>;
93
+ slotId: z.ZodString;
94
+ },
95
+ z.core.$strict
96
+ >;
97
+ item: z.ZodType<
98
+ SourceInternal,
99
+ unknown,
100
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
101
+ >;
102
+ },
103
+ z.core.$strict
104
+ >,
105
+ z.ZodObject<
106
+ {
107
+ type: z.ZodLiteral<"workflow.op.state.updateWhere">;
108
+ target: z.ZodObject<
109
+ {
110
+ scope: z.ZodEnum<{
111
+ workflow: "workflow";
112
+ stage: "stage";
113
+ task: "task";
114
+ }>;
115
+ slotId: z.ZodString;
116
+ },
117
+ z.core.$strict
118
+ >;
119
+ where: z.ZodType<
120
+ OpPredicateInternal,
121
+ unknown,
122
+ z.core.$ZodTypeInternals<OpPredicateInternal, unknown>
123
+ >;
124
+ merge: z.ZodRecord<
125
+ z.ZodString,
126
+ z.ZodType<
127
+ SourceInternal,
128
+ unknown,
129
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
130
+ >
131
+ >;
132
+ },
133
+ z.core.$strict
134
+ >,
135
+ z.ZodObject<
136
+ {
137
+ type: z.ZodLiteral<"workflow.op.state.removeWhere">;
138
+ target: z.ZodObject<
139
+ {
140
+ scope: z.ZodEnum<{
141
+ workflow: "workflow";
142
+ stage: "stage";
143
+ task: "task";
144
+ }>;
145
+ slotId: z.ZodString;
146
+ },
147
+ z.core.$strict
148
+ >;
149
+ where: z.ZodType<
150
+ OpPredicateInternal,
151
+ unknown,
152
+ z.core.$ZodTypeInternals<OpPredicateInternal, unknown>
153
+ >;
154
+ },
155
+ z.core.$strict
156
+ >,
157
+ z.ZodObject<
158
+ {
159
+ type: z.ZodLiteral<"workflow.op.status.set">;
160
+ taskId: z.ZodString;
161
+ status: z.ZodEnum<{
162
+ pending: "pending";
163
+ active: "active";
164
+ done: "done";
165
+ skipped: "skipped";
166
+ failed: "failed";
167
+ }>;
168
+ },
169
+ z.core.$strict
170
+ >,
171
+ ],
172
+ "type"
173
+ >
174
+ >
175
+ >;
176
+ effects: z.ZodOptional<
177
+ z.ZodArray<
178
+ z.ZodObject<
179
+ {
180
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
181
+ id: z.ZodString;
182
+ title: z.ZodOptional<z.ZodString>;
183
+ description: z.ZodOptional<z.ZodString>;
184
+ bindings: z.ZodOptional<
185
+ z.ZodRecord<
186
+ z.ZodString,
187
+ z.ZodType<
188
+ SourceInternal,
189
+ unknown,
190
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
191
+ >
192
+ >
193
+ >;
194
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
195
+ },
196
+ z.core.$strict
197
+ >
198
+ >
199
+ >;
200
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
201
+ requireAssignment: z.ZodOptional<z.ZodBoolean>;
202
+ requiredPermission: z.ZodOptional<
203
+ z.ZodEnum<{
204
+ create: "create";
205
+ read: "read";
206
+ update: "update";
207
+ }>
208
+ >;
209
+ },
210
+ z.core.$strict
211
+ >;
212
+
213
+ declare type Assignee = z.infer<typeof AssigneeSchema>;
214
+
215
+ declare const AssigneeSchema: z.ZodDiscriminatedUnion<
216
+ [
217
+ z.ZodObject<
218
+ {
219
+ kind: z.ZodLiteral<"user">;
220
+ id: z.ZodString;
221
+ },
222
+ z.core.$strict
223
+ >,
224
+ z.ZodObject<
225
+ {
226
+ kind: z.ZodLiteral<"role">;
227
+ role: z.ZodString;
228
+ },
229
+ z.core.$strict
230
+ >,
231
+ ],
232
+ "kind"
233
+ >;
234
+
235
+ /**
236
+ * Validate and return a workflow action. Actions are typically defined
237
+ * inline inside a task; this helper exists for unit testing a single
238
+ * action's shape (especially when it carries gates and effects).
239
+ */
240
+ export declare function defineAction(action: Action): Action;
241
+
242
+ /**
243
+ * Validate and return an assignee. Either a user (`kind: "user"` + id)
244
+ * or a role (`kind: "role"` + role).
245
+ */
246
+ export declare function defineAssignee(assignee: Assignee): Assignee;
247
+
248
+ /**
249
+ * Validate and return an effect declaration — the inline shape that
250
+ * appears on stages / tasks / actions in a workflow definition. Not
251
+ * to be confused with `defineEffectDescriptor` (below), which is for
252
+ * registering a runtime handler.
253
+ */
254
+ export declare function defineEffect(effect: Effect): Effect;
255
+
256
+ export declare function defineEffectDescriptor(
257
+ descriptor: EffectDescriptor,
258
+ ): EffectDescriptor;
259
+
260
+ /**
261
+ * Validate and return a filter. Filters are GROQ strings or references
262
+ * to named predicates; this helper accepts both forms.
263
+ */
264
+ export declare function defineFilter(filter: Filter): Filter;
265
+
266
+ /**
267
+ * Validate and return a predicate. Predicates are the named-library
268
+ * counterpart to inline GROQ filters.
269
+ */
270
+ export declare function definePredicate(predicate: Predicate): Predicate;
271
+
272
+ /**
273
+ * Validate and return a workflow stage. Useful for authoring a stage
274
+ * in isolation (reusable across workflows, unit-testable on its own)
275
+ * and then composing it inside a `defineWorkflow` call.
276
+ */
277
+ export declare function defineStage(stage: Stage): Stage;
278
+
279
+ /**
280
+ * Validate and return a workflow task. Task ids only need to be unique
281
+ * within a stage, so the same task definition can appear in multiple
282
+ * stages of the same workflow.
283
+ */
284
+ export declare function defineTask(task: Task): Task;
285
+
286
+ /**
287
+ * Validate and return a stage transition. Useful when a transition's
288
+ * filter or effects warrant their own test fixture.
289
+ */
290
+ export declare function defineTransition(transition: Transition): Transition;
291
+
292
+ /**
293
+ * Validate and return a workflow definition. Throws with a formatted,
294
+ * path-prefixed error message if validation fails.
295
+ *
296
+ * Example error:
297
+ *
298
+ * ```
299
+ * defineWorkflow("article-review") failed validation (2 issues):
300
+ * - stages[1].transitions[0].to: transition target "ready" is not a declared stage. Known stages: "drafting", "review", "approved"
301
+ * - stages[0].tasks[0].actions[0].filter.ref: Filter references predicate "allTaskDone" which is not declared. Known predicates: "allTasksDone"
302
+ * ```
303
+ */
304
+ export declare function defineWorkflow(
305
+ definition: WorkflowDefinition,
306
+ ): WorkflowDefinition;
307
+
308
+ declare type Effect = z.infer<typeof EffectSchema>;
309
+
310
+ /**
311
+ * Effect handler descriptor, registered by the runtime. The schema only
312
+ * stores the `name` reference (an inline `Effect`); the description and
313
+ * param shape live in the registry, which the SDK snapshots into
314
+ * `pendingEffects[]` at queue time.
315
+ *
316
+ * For now this is metadata-only — actual handler invocation is the
317
+ * runtime's job, not this engine's.
318
+ */
319
+ export declare interface EffectDescriptor {
320
+ name: string;
321
+ description?: string;
322
+ params?: EffectDescriptorParam[];
323
+ }
324
+
325
+ export declare interface EffectDescriptorParam {
326
+ name: string;
327
+ type: "string" | "number" | "boolean" | "object" | "string[]";
328
+ required?: boolean;
329
+ description?: string;
330
+ }
331
+
332
+ declare const EffectSchema: z.ZodObject<
333
+ {
334
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
335
+ id: z.ZodString;
336
+ title: z.ZodOptional<z.ZodString>;
337
+ description: z.ZodOptional<z.ZodString>;
338
+ bindings: z.ZodOptional<
339
+ z.ZodRecord<
340
+ z.ZodString,
341
+ z.ZodType<
342
+ SourceInternal,
343
+ unknown,
344
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
345
+ >
346
+ >
347
+ >;
348
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
349
+ },
350
+ z.core.$strict
351
+ >;
352
+
353
+ declare type Filter = z.infer<typeof FilterSchema>;
354
+
355
+ declare const FilterSchema: z.ZodUnion<
356
+ readonly [
357
+ z.ZodString,
358
+ z.ZodObject<
359
+ {
360
+ ref: z.ZodString;
361
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
362
+ },
363
+ z.core.$strict
364
+ >,
365
+ ]
366
+ >;
367
+
368
+ declare type OpPredicateInternal =
369
+ | {
370
+ field: string;
371
+ equals: Source;
372
+ }
373
+ | {
374
+ all: OpPredicateInternal[];
375
+ }
376
+ | {
377
+ any: OpPredicateInternal[];
378
+ };
379
+
380
+ declare type Predicate = z.infer<typeof PredicateSchema>;
381
+
382
+ declare const PredicateSchema: z.ZodObject<
383
+ {
384
+ type: z.ZodOptional<z.ZodLiteral<"workflow.predicate">>;
385
+ id: z.ZodString;
386
+ title: z.ZodOptional<z.ZodString>;
387
+ description: z.ZodOptional<z.ZodString>;
388
+ groq: z.ZodString;
389
+ params: z.ZodOptional<
390
+ z.ZodArray<
391
+ z.ZodObject<
392
+ {
393
+ id: z.ZodString;
394
+ title: z.ZodOptional<z.ZodString>;
395
+ description: z.ZodOptional<z.ZodString>;
396
+ type: z.ZodEnum<{
397
+ string: "string";
398
+ number: "number";
399
+ boolean: "boolean";
400
+ "string[]": "string[]";
401
+ reference: "reference";
402
+ }>;
403
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
404
+ },
405
+ z.core.$strict
406
+ >
407
+ >
408
+ >;
409
+ },
410
+ z.core.$strict
411
+ >;
412
+
413
+ declare type Source = SourceInternal;
414
+
415
+ declare type SourceInternal =
416
+ | {
417
+ source: "literal";
418
+ value: string | number | boolean | null;
419
+ }
420
+ | {
421
+ source: "param";
422
+ paramId: string;
423
+ }
424
+ | {
425
+ source: "actor";
426
+ }
427
+ | {
428
+ source: "now";
429
+ }
430
+ | {
431
+ source: "self";
432
+ }
433
+ | {
434
+ source: "stageId";
435
+ }
436
+ | {
437
+ source: "stateRead";
438
+ scope: StateScope;
439
+ slotId: string;
440
+ path?: string | undefined;
441
+ }
442
+ | {
443
+ source: "effectOutput";
444
+ contextId: string;
445
+ path?: string | undefined;
446
+ }
447
+ /**
448
+ * Spawn-only sources. Resolved at spawn-time inside `Spawn.forEach.as`
449
+ * projection. `row` reads from the current iteration row (the GROQ
450
+ * result item). `parentState` reads from the spawning parent's
451
+ * resolved workflow-scope state — the slot envelope as on the
452
+ * parent (`{ id, _type, value, ... }`), with an optional path dive.
453
+ */
454
+ | {
455
+ source: "row";
456
+ path?: string | undefined;
457
+ }
458
+ | {
459
+ source: "parentState";
460
+ slotId: string;
461
+ path?: string | undefined;
462
+ }
463
+ | {
464
+ source: "object";
465
+ fields: Record<string, SourceInternal>;
466
+ };
467
+
468
+ declare type Stage = z.infer<typeof StageSchema>;
469
+
470
+ declare const StageSchema: z.ZodObject<
471
+ {
472
+ type: z.ZodOptional<z.ZodLiteral<"workflow.stage">>;
473
+ id: z.ZodString;
474
+ title: z.ZodOptional<z.ZodString>;
475
+ description: z.ZodOptional<z.ZodString>;
476
+ kind: z.ZodOptional<
477
+ z.ZodEnum<{
478
+ initial: "initial";
479
+ intermediate: "intermediate";
480
+ terminal: "terminal";
481
+ waiting: "waiting";
482
+ }>
483
+ >;
484
+ tasks: z.ZodOptional<
485
+ z.ZodArray<
486
+ z.ZodObject<
487
+ {
488
+ type: z.ZodOptional<z.ZodLiteral<"workflow.task">>;
489
+ id: z.ZodString;
490
+ title: z.ZodOptional<z.ZodString>;
491
+ description: z.ZodOptional<z.ZodString>;
492
+ assignees: z.ZodOptional<
493
+ z.ZodArray<
494
+ z.ZodDiscriminatedUnion<
495
+ [
496
+ z.ZodObject<
497
+ {
498
+ kind: z.ZodLiteral<"user">;
499
+ id: z.ZodString;
500
+ },
501
+ z.core.$strict
502
+ >,
503
+ z.ZodObject<
504
+ {
505
+ kind: z.ZodLiteral<"role">;
506
+ role: z.ZodString;
507
+ },
508
+ z.core.$strict
509
+ >,
510
+ ],
511
+ "kind"
512
+ >
513
+ >
514
+ >;
515
+ filter: z.ZodOptional<
516
+ z.ZodUnion<
517
+ readonly [
518
+ z.ZodString,
519
+ z.ZodObject<
520
+ {
521
+ ref: z.ZodString;
522
+ args: z.ZodOptional<
523
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
524
+ >;
525
+ },
526
+ z.core.$strict
527
+ >,
528
+ ]
529
+ >
530
+ >;
531
+ invokeOn: z.ZodOptional<
532
+ z.ZodEnum<{
533
+ stageEnter: "stageEnter";
534
+ manual: "manual";
535
+ }>
536
+ >;
537
+ completeWhen: z.ZodOptional<
538
+ z.ZodUnion<
539
+ readonly [
540
+ z.ZodString,
541
+ z.ZodObject<
542
+ {
543
+ ref: z.ZodString;
544
+ args: z.ZodOptional<
545
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
546
+ >;
547
+ },
548
+ z.core.$strict
549
+ >,
550
+ ]
551
+ >
552
+ >;
553
+ failWhen: z.ZodOptional<
554
+ z.ZodUnion<
555
+ readonly [
556
+ z.ZodString,
557
+ z.ZodObject<
558
+ {
559
+ ref: z.ZodString;
560
+ args: z.ZodOptional<
561
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
562
+ >;
563
+ },
564
+ z.core.$strict
565
+ >,
566
+ ]
567
+ >
568
+ >;
569
+ effects: z.ZodOptional<
570
+ z.ZodArray<
571
+ z.ZodObject<
572
+ {
573
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
574
+ id: z.ZodString;
575
+ title: z.ZodOptional<z.ZodString>;
576
+ description: z.ZodOptional<z.ZodString>;
577
+ bindings: z.ZodOptional<
578
+ z.ZodRecord<
579
+ z.ZodString,
580
+ z.ZodType<
581
+ SourceInternal,
582
+ unknown,
583
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
584
+ >
585
+ >
586
+ >;
587
+ input: z.ZodOptional<
588
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
589
+ >;
590
+ },
591
+ z.core.$strict
592
+ >
593
+ >
594
+ >;
595
+ actions: z.ZodOptional<
596
+ z.ZodArray<
597
+ z.ZodObject<
598
+ {
599
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action">>;
600
+ id: z.ZodString;
601
+ title: z.ZodOptional<z.ZodString>;
602
+ description: z.ZodOptional<z.ZodString>;
603
+ filter: z.ZodOptional<
604
+ z.ZodUnion<
605
+ readonly [
606
+ z.ZodString,
607
+ z.ZodObject<
608
+ {
609
+ ref: z.ZodString;
610
+ args: z.ZodOptional<
611
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
612
+ >;
613
+ },
614
+ z.core.$strict
615
+ >,
616
+ ]
617
+ >
618
+ >;
619
+ params: z.ZodOptional<
620
+ z.ZodArray<
621
+ z.ZodObject<
622
+ {
623
+ type: z.ZodOptional<
624
+ z.ZodLiteral<"workflow.action.param">
625
+ >;
626
+ id: z.ZodString;
627
+ title: z.ZodOptional<z.ZodString>;
628
+ description: z.ZodOptional<z.ZodString>;
629
+ paramType: z.ZodEnum<{
630
+ string: "string";
631
+ number: "number";
632
+ boolean: "boolean";
633
+ url: "url";
634
+ dateTime: "dateTime";
635
+ actor: "actor";
636
+ "doc.ref": "doc.ref";
637
+ "doc.refs": "doc.refs";
638
+ json: "json";
639
+ }>;
640
+ required: z.ZodOptional<z.ZodBoolean>;
641
+ },
642
+ z.core.$strict
643
+ >
644
+ >
645
+ >;
646
+ setStatus: z.ZodOptional<
647
+ z.ZodEnum<{
648
+ done: "done";
649
+ skipped: "skipped";
650
+ failed: "failed";
651
+ }>
652
+ >;
653
+ ops: z.ZodOptional<
654
+ z.ZodArray<
655
+ z.ZodDiscriminatedUnion<
656
+ [
657
+ z.ZodObject<
658
+ {
659
+ type: z.ZodLiteral<"workflow.op.state.set">;
660
+ target: z.ZodObject<
661
+ {
662
+ scope: z.ZodEnum<{
663
+ workflow: "workflow";
664
+ stage: "stage";
665
+ task: "task";
666
+ }>;
667
+ slotId: z.ZodString;
668
+ },
669
+ z.core.$strict
670
+ >;
671
+ value: z.ZodType<
672
+ SourceInternal,
673
+ unknown,
674
+ z.core.$ZodTypeInternals<
675
+ SourceInternal,
676
+ unknown
677
+ >
678
+ >;
679
+ },
680
+ z.core.$strict
681
+ >,
682
+ z.ZodObject<
683
+ {
684
+ type: z.ZodLiteral<"workflow.op.state.append">;
685
+ target: z.ZodObject<
686
+ {
687
+ scope: z.ZodEnum<{
688
+ workflow: "workflow";
689
+ stage: "stage";
690
+ task: "task";
691
+ }>;
692
+ slotId: z.ZodString;
693
+ },
694
+ z.core.$strict
695
+ >;
696
+ item: z.ZodType<
697
+ SourceInternal,
698
+ unknown,
699
+ z.core.$ZodTypeInternals<
700
+ SourceInternal,
701
+ unknown
702
+ >
703
+ >;
704
+ },
705
+ z.core.$strict
706
+ >,
707
+ z.ZodObject<
708
+ {
709
+ type: z.ZodLiteral<"workflow.op.state.updateWhere">;
710
+ target: z.ZodObject<
711
+ {
712
+ scope: z.ZodEnum<{
713
+ workflow: "workflow";
714
+ stage: "stage";
715
+ task: "task";
716
+ }>;
717
+ slotId: z.ZodString;
718
+ },
719
+ z.core.$strict
720
+ >;
721
+ where: z.ZodType<
722
+ OpPredicateInternal,
723
+ unknown,
724
+ z.core.$ZodTypeInternals<
725
+ OpPredicateInternal,
726
+ unknown
727
+ >
728
+ >;
729
+ merge: z.ZodRecord<
730
+ z.ZodString,
731
+ z.ZodType<
732
+ SourceInternal,
733
+ unknown,
734
+ z.core.$ZodTypeInternals<
735
+ SourceInternal,
736
+ unknown
737
+ >
738
+ >
739
+ >;
740
+ },
741
+ z.core.$strict
742
+ >,
743
+ z.ZodObject<
744
+ {
745
+ type: z.ZodLiteral<"workflow.op.state.removeWhere">;
746
+ target: z.ZodObject<
747
+ {
748
+ scope: z.ZodEnum<{
749
+ workflow: "workflow";
750
+ stage: "stage";
751
+ task: "task";
752
+ }>;
753
+ slotId: z.ZodString;
754
+ },
755
+ z.core.$strict
756
+ >;
757
+ where: z.ZodType<
758
+ OpPredicateInternal,
759
+ unknown,
760
+ z.core.$ZodTypeInternals<
761
+ OpPredicateInternal,
762
+ unknown
763
+ >
764
+ >;
765
+ },
766
+ z.core.$strict
767
+ >,
768
+ z.ZodObject<
769
+ {
770
+ type: z.ZodLiteral<"workflow.op.status.set">;
771
+ taskId: z.ZodString;
772
+ status: z.ZodEnum<{
773
+ pending: "pending";
774
+ active: "active";
775
+ done: "done";
776
+ skipped: "skipped";
777
+ failed: "failed";
778
+ }>;
779
+ },
780
+ z.core.$strict
781
+ >,
782
+ ],
783
+ "type"
784
+ >
785
+ >
786
+ >;
787
+ effects: z.ZodOptional<
788
+ z.ZodArray<
789
+ z.ZodObject<
790
+ {
791
+ type: z.ZodOptional<
792
+ z.ZodLiteral<"workflow.effect">
793
+ >;
794
+ id: z.ZodString;
795
+ title: z.ZodOptional<z.ZodString>;
796
+ description: z.ZodOptional<z.ZodString>;
797
+ bindings: z.ZodOptional<
798
+ z.ZodRecord<
799
+ z.ZodString,
800
+ z.ZodType<
801
+ SourceInternal,
802
+ unknown,
803
+ z.core.$ZodTypeInternals<
804
+ SourceInternal,
805
+ unknown
806
+ >
807
+ >
808
+ >
809
+ >;
810
+ input: z.ZodOptional<
811
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
812
+ >;
813
+ },
814
+ z.core.$strict
815
+ >
816
+ >
817
+ >;
818
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
819
+ requireAssignment: z.ZodOptional<z.ZodBoolean>;
820
+ requiredPermission: z.ZodOptional<
821
+ z.ZodEnum<{
822
+ create: "create";
823
+ read: "read";
824
+ update: "update";
825
+ }>
826
+ >;
827
+ },
828
+ z.core.$strict
829
+ >
830
+ >
831
+ >;
832
+ spawns: z.ZodOptional<
833
+ z.ZodObject<
834
+ {
835
+ type: z.ZodOptional<z.ZodLiteral<"workflow.spawn">>;
836
+ id: z.ZodOptional<z.ZodString>;
837
+ title: z.ZodOptional<z.ZodString>;
838
+ description: z.ZodOptional<z.ZodString>;
839
+ definitionRef: z.ZodObject<
840
+ {
841
+ workflowId: z.ZodString;
842
+ version: z.ZodOptional<
843
+ z.ZodUnion<
844
+ readonly [z.ZodNumber, z.ZodLiteral<"latest">]
845
+ >
846
+ >;
847
+ },
848
+ z.core.$strict
849
+ >;
850
+ forEach: z.ZodObject<
851
+ {
852
+ groq: z.ZodString;
853
+ as: z.ZodObject<
854
+ {
855
+ initialState: z.ZodOptional<
856
+ z.ZodArray<
857
+ z.ZodObject<
858
+ {
859
+ type: z.ZodEnum<{
860
+ "workflow.state.doc.ref": "workflow.state.doc.ref";
861
+ "workflow.state.doc.refs": "workflow.state.doc.refs";
862
+ "workflow.state.release.ref": "workflow.state.release.ref";
863
+ "workflow.state.query": "workflow.state.query";
864
+ "workflow.state.value.string": "workflow.state.value.string";
865
+ "workflow.state.value.url": "workflow.state.value.url";
866
+ "workflow.state.value.number": "workflow.state.value.number";
867
+ "workflow.state.value.boolean": "workflow.state.value.boolean";
868
+ "workflow.state.value.dateTime": "workflow.state.value.dateTime";
869
+ "workflow.state.value.actor": "workflow.state.value.actor";
870
+ "workflow.state.checklist": "workflow.state.checklist";
871
+ "workflow.state.notes": "workflow.state.notes";
872
+ "workflow.state.assignees": "workflow.state.assignees";
873
+ }>;
874
+ id: z.ZodString;
875
+ value: z.ZodType<
876
+ SourceInternal,
877
+ unknown,
878
+ z.core.$ZodTypeInternals<
879
+ SourceInternal,
880
+ unknown
881
+ >
882
+ >;
883
+ },
884
+ z.core.$strict
885
+ >
886
+ >
887
+ >;
888
+ effectsContext: z.ZodOptional<
889
+ z.ZodRecord<
890
+ z.ZodString,
891
+ z.ZodType<
892
+ SourceInternal,
893
+ unknown,
894
+ z.core.$ZodTypeInternals<
895
+ SourceInternal,
896
+ unknown
897
+ >
898
+ >
899
+ >
900
+ >;
901
+ },
902
+ z.core.$strict
903
+ >;
904
+ },
905
+ z.core.$strict
906
+ >;
907
+ completionPolicy: z.ZodOptional<
908
+ z.ZodUnion<
909
+ readonly [
910
+ z.ZodObject<
911
+ {
912
+ kind: z.ZodLiteral<"all">;
913
+ },
914
+ z.core.$strict
915
+ >,
916
+ z.ZodObject<
917
+ {
918
+ kind: z.ZodLiteral<"any">;
919
+ },
920
+ z.core.$strict
921
+ >,
922
+ z.ZodObject<
923
+ {
924
+ kind: z.ZodLiteral<"count">;
925
+ n: z.ZodNumber;
926
+ },
927
+ z.core.$strict
928
+ >,
929
+ ]
930
+ >
931
+ >;
932
+ },
933
+ z.core.$strict
934
+ >
935
+ >;
936
+ contentRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
937
+ state: z.ZodOptional<
938
+ z.ZodArray<
939
+ z.ZodDiscriminatedUnion<
940
+ [
941
+ z.ZodObject<
942
+ {
943
+ type: z.ZodLiteral<StateSlotKind>;
944
+ } & {
945
+ id: z.ZodString;
946
+ title: z.ZodOptional<z.ZodString>;
947
+ description: z.ZodOptional<z.ZodString>;
948
+ source: z.ZodUnion<
949
+ readonly [
950
+ z.ZodObject<
951
+ {
952
+ kind: z.ZodLiteral<"init">;
953
+ },
954
+ z.core.$strict
955
+ >,
956
+ z.ZodObject<
957
+ {
958
+ kind: z.ZodLiteral<"query">;
959
+ query: z.ZodString;
960
+ resource: z.ZodOptional<
961
+ z.ZodUnion<
962
+ readonly [
963
+ z.ZodLiteral<"workflow">,
964
+ z.ZodLiteral<"subject">,
965
+ z.ZodObject<
966
+ {
967
+ id: z.ZodString;
968
+ type: z.ZodString;
969
+ },
970
+ z.core.$strict
971
+ >,
972
+ ]
973
+ >
974
+ >;
975
+ },
976
+ z.core.$strict
977
+ >,
978
+ z.ZodObject<
979
+ {
980
+ kind: z.ZodLiteral<"write">;
981
+ },
982
+ z.core.$strict
983
+ >,
984
+ z.ZodObject<
985
+ {
986
+ kind: z.ZodLiteral<"computed">;
987
+ compute: z.ZodString;
988
+ },
989
+ z.core.$strict
990
+ >,
991
+ z.ZodObject<
992
+ {
993
+ kind: z.ZodLiteral<"literal">;
994
+ value: z.ZodUnknown;
995
+ },
996
+ z.core.$strict
997
+ >,
998
+ z.ZodObject<
999
+ {
1000
+ kind: z.ZodLiteral<"stateRead">;
1001
+ scope: z.ZodUnion<
1002
+ readonly [
1003
+ z.ZodLiteral<"workflow">,
1004
+ z.ZodLiteral<"stage">,
1005
+ ]
1006
+ >;
1007
+ slotId: z.ZodString;
1008
+ path: z.ZodOptional<z.ZodString>;
1009
+ },
1010
+ z.core.$strict
1011
+ >,
1012
+ ]
1013
+ >;
1014
+ },
1015
+ z.core.$strip
1016
+ >,
1017
+ ...z.ZodObject<
1018
+ {
1019
+ type: z.ZodLiteral<StateSlotKind>;
1020
+ } & {
1021
+ id: z.ZodString;
1022
+ title: z.ZodOptional<z.ZodString>;
1023
+ description: z.ZodOptional<z.ZodString>;
1024
+ source: z.ZodUnion<
1025
+ readonly [
1026
+ z.ZodObject<
1027
+ {
1028
+ kind: z.ZodLiteral<"init">;
1029
+ },
1030
+ z.core.$strict
1031
+ >,
1032
+ z.ZodObject<
1033
+ {
1034
+ kind: z.ZodLiteral<"query">;
1035
+ query: z.ZodString;
1036
+ resource: z.ZodOptional<
1037
+ z.ZodUnion<
1038
+ readonly [
1039
+ z.ZodLiteral<"workflow">,
1040
+ z.ZodLiteral<"subject">,
1041
+ z.ZodObject<
1042
+ {
1043
+ id: z.ZodString;
1044
+ type: z.ZodString;
1045
+ },
1046
+ z.core.$strict
1047
+ >,
1048
+ ]
1049
+ >
1050
+ >;
1051
+ },
1052
+ z.core.$strict
1053
+ >,
1054
+ z.ZodObject<
1055
+ {
1056
+ kind: z.ZodLiteral<"write">;
1057
+ },
1058
+ z.core.$strict
1059
+ >,
1060
+ z.ZodObject<
1061
+ {
1062
+ kind: z.ZodLiteral<"computed">;
1063
+ compute: z.ZodString;
1064
+ },
1065
+ z.core.$strict
1066
+ >,
1067
+ z.ZodObject<
1068
+ {
1069
+ kind: z.ZodLiteral<"literal">;
1070
+ value: z.ZodUnknown;
1071
+ },
1072
+ z.core.$strict
1073
+ >,
1074
+ z.ZodObject<
1075
+ {
1076
+ kind: z.ZodLiteral<"stateRead">;
1077
+ scope: z.ZodUnion<
1078
+ readonly [
1079
+ z.ZodLiteral<"workflow">,
1080
+ z.ZodLiteral<"stage">,
1081
+ ]
1082
+ >;
1083
+ slotId: z.ZodString;
1084
+ path: z.ZodOptional<z.ZodString>;
1085
+ },
1086
+ z.core.$strict
1087
+ >,
1088
+ ]
1089
+ >;
1090
+ },
1091
+ z.core.$strip
1092
+ >[],
1093
+ ],
1094
+ "type"
1095
+ >
1096
+ >
1097
+ >;
1098
+ },
1099
+ z.core.$strict
1100
+ >
1101
+ >
1102
+ >;
1103
+ transitions: z.ZodOptional<
1104
+ z.ZodArray<
1105
+ z.ZodObject<
1106
+ {
1107
+ type: z.ZodOptional<z.ZodLiteral<"workflow.transition">>;
1108
+ id: z.ZodString;
1109
+ title: z.ZodOptional<z.ZodString>;
1110
+ description: z.ZodOptional<z.ZodString>;
1111
+ to: z.ZodString;
1112
+ on: z.ZodOptional<z.ZodString>;
1113
+ filter: z.ZodOptional<
1114
+ z.ZodUnion<
1115
+ readonly [
1116
+ z.ZodString,
1117
+ z.ZodObject<
1118
+ {
1119
+ ref: z.ZodString;
1120
+ args: z.ZodOptional<
1121
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
1122
+ >;
1123
+ },
1124
+ z.core.$strict
1125
+ >,
1126
+ ]
1127
+ >
1128
+ >;
1129
+ effects: z.ZodOptional<
1130
+ z.ZodArray<
1131
+ z.ZodObject<
1132
+ {
1133
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
1134
+ id: z.ZodString;
1135
+ title: z.ZodOptional<z.ZodString>;
1136
+ description: z.ZodOptional<z.ZodString>;
1137
+ bindings: z.ZodOptional<
1138
+ z.ZodRecord<
1139
+ z.ZodString,
1140
+ z.ZodType<
1141
+ SourceInternal,
1142
+ unknown,
1143
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1144
+ >
1145
+ >
1146
+ >;
1147
+ input: z.ZodOptional<
1148
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
1149
+ >;
1150
+ },
1151
+ z.core.$strict
1152
+ >
1153
+ >
1154
+ >;
1155
+ },
1156
+ z.core.$strict
1157
+ >
1158
+ >
1159
+ >;
1160
+ completion: z.ZodOptional<
1161
+ z.ZodUnion<
1162
+ readonly [
1163
+ z.ZodString,
1164
+ z.ZodObject<
1165
+ {
1166
+ ref: z.ZodString;
1167
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1168
+ },
1169
+ z.core.$strict
1170
+ >,
1171
+ ]
1172
+ >
1173
+ >;
1174
+ onEnter: z.ZodOptional<
1175
+ z.ZodArray<
1176
+ z.ZodObject<
1177
+ {
1178
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
1179
+ id: z.ZodString;
1180
+ title: z.ZodOptional<z.ZodString>;
1181
+ description: z.ZodOptional<z.ZodString>;
1182
+ bindings: z.ZodOptional<
1183
+ z.ZodRecord<
1184
+ z.ZodString,
1185
+ z.ZodType<
1186
+ SourceInternal,
1187
+ unknown,
1188
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1189
+ >
1190
+ >
1191
+ >;
1192
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1193
+ },
1194
+ z.core.$strict
1195
+ >
1196
+ >
1197
+ >;
1198
+ onExit: z.ZodOptional<
1199
+ z.ZodArray<
1200
+ z.ZodObject<
1201
+ {
1202
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
1203
+ id: z.ZodString;
1204
+ title: z.ZodOptional<z.ZodString>;
1205
+ description: z.ZodOptional<z.ZodString>;
1206
+ bindings: z.ZodOptional<
1207
+ z.ZodRecord<
1208
+ z.ZodString,
1209
+ z.ZodType<
1210
+ SourceInternal,
1211
+ unknown,
1212
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1213
+ >
1214
+ >
1215
+ >;
1216
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1217
+ },
1218
+ z.core.$strict
1219
+ >
1220
+ >
1221
+ >;
1222
+ guards: z.ZodOptional<
1223
+ z.ZodArray<
1224
+ z.ZodObject<
1225
+ {
1226
+ name: z.ZodOptional<z.ZodString>;
1227
+ description: z.ZodOptional<z.ZodString>;
1228
+ match: z.ZodObject<
1229
+ {
1230
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
1231
+ idRefs: z.ZodOptional<
1232
+ z.ZodArray<
1233
+ z.ZodType<
1234
+ SourceInternal,
1235
+ unknown,
1236
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1237
+ >
1238
+ >
1239
+ >;
1240
+ idPatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1241
+ actions: z.ZodArray<
1242
+ z.ZodEnum<{
1243
+ create: "create";
1244
+ update: "update";
1245
+ delete: "delete";
1246
+ publish: "publish";
1247
+ unpublish: "unpublish";
1248
+ }>
1249
+ >;
1250
+ },
1251
+ z.core.$strict
1252
+ >;
1253
+ predicate: z.ZodOptional<z.ZodString>;
1254
+ metadata: z.ZodOptional<
1255
+ z.ZodRecord<
1256
+ z.ZodString,
1257
+ z.ZodType<
1258
+ SourceInternal,
1259
+ unknown,
1260
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1261
+ >
1262
+ >
1263
+ >;
1264
+ },
1265
+ z.core.$strict
1266
+ >
1267
+ >
1268
+ >;
1269
+ contentRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1270
+ state: z.ZodOptional<
1271
+ z.ZodArray<
1272
+ z.ZodDiscriminatedUnion<
1273
+ [
1274
+ z.ZodObject<
1275
+ {
1276
+ type: z.ZodLiteral<StateSlotKind>;
1277
+ } & {
1278
+ id: z.ZodString;
1279
+ title: z.ZodOptional<z.ZodString>;
1280
+ description: z.ZodOptional<z.ZodString>;
1281
+ source: z.ZodUnion<
1282
+ readonly [
1283
+ z.ZodObject<
1284
+ {
1285
+ kind: z.ZodLiteral<"init">;
1286
+ },
1287
+ z.core.$strict
1288
+ >,
1289
+ z.ZodObject<
1290
+ {
1291
+ kind: z.ZodLiteral<"query">;
1292
+ query: z.ZodString;
1293
+ resource: z.ZodOptional<
1294
+ z.ZodUnion<
1295
+ readonly [
1296
+ z.ZodLiteral<"workflow">,
1297
+ z.ZodLiteral<"subject">,
1298
+ z.ZodObject<
1299
+ {
1300
+ id: z.ZodString;
1301
+ type: z.ZodString;
1302
+ },
1303
+ z.core.$strict
1304
+ >,
1305
+ ]
1306
+ >
1307
+ >;
1308
+ },
1309
+ z.core.$strict
1310
+ >,
1311
+ z.ZodObject<
1312
+ {
1313
+ kind: z.ZodLiteral<"write">;
1314
+ },
1315
+ z.core.$strict
1316
+ >,
1317
+ z.ZodObject<
1318
+ {
1319
+ kind: z.ZodLiteral<"computed">;
1320
+ compute: z.ZodString;
1321
+ },
1322
+ z.core.$strict
1323
+ >,
1324
+ z.ZodObject<
1325
+ {
1326
+ kind: z.ZodLiteral<"literal">;
1327
+ value: z.ZodUnknown;
1328
+ },
1329
+ z.core.$strict
1330
+ >,
1331
+ z.ZodObject<
1332
+ {
1333
+ kind: z.ZodLiteral<"stateRead">;
1334
+ scope: z.ZodUnion<
1335
+ readonly [
1336
+ z.ZodLiteral<"workflow">,
1337
+ z.ZodLiteral<"stage">,
1338
+ ]
1339
+ >;
1340
+ slotId: z.ZodString;
1341
+ path: z.ZodOptional<z.ZodString>;
1342
+ },
1343
+ z.core.$strict
1344
+ >,
1345
+ ]
1346
+ >;
1347
+ },
1348
+ z.core.$strip
1349
+ >,
1350
+ ...z.ZodObject<
1351
+ {
1352
+ type: z.ZodLiteral<StateSlotKind>;
1353
+ } & {
1354
+ id: z.ZodString;
1355
+ title: z.ZodOptional<z.ZodString>;
1356
+ description: z.ZodOptional<z.ZodString>;
1357
+ source: z.ZodUnion<
1358
+ readonly [
1359
+ z.ZodObject<
1360
+ {
1361
+ kind: z.ZodLiteral<"init">;
1362
+ },
1363
+ z.core.$strict
1364
+ >,
1365
+ z.ZodObject<
1366
+ {
1367
+ kind: z.ZodLiteral<"query">;
1368
+ query: z.ZodString;
1369
+ resource: z.ZodOptional<
1370
+ z.ZodUnion<
1371
+ readonly [
1372
+ z.ZodLiteral<"workflow">,
1373
+ z.ZodLiteral<"subject">,
1374
+ z.ZodObject<
1375
+ {
1376
+ id: z.ZodString;
1377
+ type: z.ZodString;
1378
+ },
1379
+ z.core.$strict
1380
+ >,
1381
+ ]
1382
+ >
1383
+ >;
1384
+ },
1385
+ z.core.$strict
1386
+ >,
1387
+ z.ZodObject<
1388
+ {
1389
+ kind: z.ZodLiteral<"write">;
1390
+ },
1391
+ z.core.$strict
1392
+ >,
1393
+ z.ZodObject<
1394
+ {
1395
+ kind: z.ZodLiteral<"computed">;
1396
+ compute: z.ZodString;
1397
+ },
1398
+ z.core.$strict
1399
+ >,
1400
+ z.ZodObject<
1401
+ {
1402
+ kind: z.ZodLiteral<"literal">;
1403
+ value: z.ZodUnknown;
1404
+ },
1405
+ z.core.$strict
1406
+ >,
1407
+ z.ZodObject<
1408
+ {
1409
+ kind: z.ZodLiteral<"stateRead">;
1410
+ scope: z.ZodUnion<
1411
+ readonly [
1412
+ z.ZodLiteral<"workflow">,
1413
+ z.ZodLiteral<"stage">,
1414
+ ]
1415
+ >;
1416
+ slotId: z.ZodString;
1417
+ path: z.ZodOptional<z.ZodString>;
1418
+ },
1419
+ z.core.$strict
1420
+ >,
1421
+ ]
1422
+ >;
1423
+ },
1424
+ z.core.$strip
1425
+ >[],
1426
+ ],
1427
+ "type"
1428
+ >
1429
+ >
1430
+ >;
1431
+ },
1432
+ z.core.$strict
1433
+ >;
1434
+
1435
+ declare const STATE_SCOPES: readonly ["workflow", "stage", "task"];
1436
+
1437
+ declare type StateScope = (typeof STATE_SCOPES)[number];
1438
+
1439
+ declare type StateSlotKind = z.infer<typeof StateSlotKindSchema>;
1440
+
1441
+ /**
1442
+ * Canonical set of state-slot kinds — the discriminator for both
1443
+ * authored {@link StateSlot}s and runtime `StateSlotValueMap`. Spawn
1444
+ * projections reuse it so a typo'd slot type is rejected at deploy
1445
+ * rather than silently dropped at projection time.
1446
+ */
1447
+ declare const StateSlotKindSchema: z.ZodEnum<{
1448
+ "workflow.state.doc.ref": "workflow.state.doc.ref";
1449
+ "workflow.state.doc.refs": "workflow.state.doc.refs";
1450
+ "workflow.state.release.ref": "workflow.state.release.ref";
1451
+ "workflow.state.query": "workflow.state.query";
1452
+ "workflow.state.value.string": "workflow.state.value.string";
1453
+ "workflow.state.value.url": "workflow.state.value.url";
1454
+ "workflow.state.value.number": "workflow.state.value.number";
1455
+ "workflow.state.value.boolean": "workflow.state.value.boolean";
1456
+ "workflow.state.value.dateTime": "workflow.state.value.dateTime";
1457
+ "workflow.state.value.actor": "workflow.state.value.actor";
1458
+ "workflow.state.checklist": "workflow.state.checklist";
1459
+ "workflow.state.notes": "workflow.state.notes";
1460
+ "workflow.state.assignees": "workflow.state.assignees";
1461
+ }>;
1462
+
1463
+ declare type Task = z.infer<typeof TaskSchema>;
1464
+
1465
+ declare const TaskSchema: z.ZodObject<
1466
+ {
1467
+ type: z.ZodOptional<z.ZodLiteral<"workflow.task">>;
1468
+ id: z.ZodString;
1469
+ title: z.ZodOptional<z.ZodString>;
1470
+ description: z.ZodOptional<z.ZodString>;
1471
+ assignees: z.ZodOptional<
1472
+ z.ZodArray<
1473
+ z.ZodDiscriminatedUnion<
1474
+ [
1475
+ z.ZodObject<
1476
+ {
1477
+ kind: z.ZodLiteral<"user">;
1478
+ id: z.ZodString;
1479
+ },
1480
+ z.core.$strict
1481
+ >,
1482
+ z.ZodObject<
1483
+ {
1484
+ kind: z.ZodLiteral<"role">;
1485
+ role: z.ZodString;
1486
+ },
1487
+ z.core.$strict
1488
+ >,
1489
+ ],
1490
+ "kind"
1491
+ >
1492
+ >
1493
+ >;
1494
+ filter: z.ZodOptional<
1495
+ z.ZodUnion<
1496
+ readonly [
1497
+ z.ZodString,
1498
+ z.ZodObject<
1499
+ {
1500
+ ref: z.ZodString;
1501
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1502
+ },
1503
+ z.core.$strict
1504
+ >,
1505
+ ]
1506
+ >
1507
+ >;
1508
+ invokeOn: z.ZodOptional<
1509
+ z.ZodEnum<{
1510
+ stageEnter: "stageEnter";
1511
+ manual: "manual";
1512
+ }>
1513
+ >;
1514
+ completeWhen: z.ZodOptional<
1515
+ z.ZodUnion<
1516
+ readonly [
1517
+ z.ZodString,
1518
+ z.ZodObject<
1519
+ {
1520
+ ref: z.ZodString;
1521
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1522
+ },
1523
+ z.core.$strict
1524
+ >,
1525
+ ]
1526
+ >
1527
+ >;
1528
+ failWhen: z.ZodOptional<
1529
+ z.ZodUnion<
1530
+ readonly [
1531
+ z.ZodString,
1532
+ z.ZodObject<
1533
+ {
1534
+ ref: z.ZodString;
1535
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1536
+ },
1537
+ z.core.$strict
1538
+ >,
1539
+ ]
1540
+ >
1541
+ >;
1542
+ effects: z.ZodOptional<
1543
+ z.ZodArray<
1544
+ z.ZodObject<
1545
+ {
1546
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
1547
+ id: z.ZodString;
1548
+ title: z.ZodOptional<z.ZodString>;
1549
+ description: z.ZodOptional<z.ZodString>;
1550
+ bindings: z.ZodOptional<
1551
+ z.ZodRecord<
1552
+ z.ZodString,
1553
+ z.ZodType<
1554
+ SourceInternal,
1555
+ unknown,
1556
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1557
+ >
1558
+ >
1559
+ >;
1560
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1561
+ },
1562
+ z.core.$strict
1563
+ >
1564
+ >
1565
+ >;
1566
+ actions: z.ZodOptional<
1567
+ z.ZodArray<
1568
+ z.ZodObject<
1569
+ {
1570
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action">>;
1571
+ id: z.ZodString;
1572
+ title: z.ZodOptional<z.ZodString>;
1573
+ description: z.ZodOptional<z.ZodString>;
1574
+ filter: z.ZodOptional<
1575
+ z.ZodUnion<
1576
+ readonly [
1577
+ z.ZodString,
1578
+ z.ZodObject<
1579
+ {
1580
+ ref: z.ZodString;
1581
+ args: z.ZodOptional<
1582
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
1583
+ >;
1584
+ },
1585
+ z.core.$strict
1586
+ >,
1587
+ ]
1588
+ >
1589
+ >;
1590
+ params: z.ZodOptional<
1591
+ z.ZodArray<
1592
+ z.ZodObject<
1593
+ {
1594
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action.param">>;
1595
+ id: z.ZodString;
1596
+ title: z.ZodOptional<z.ZodString>;
1597
+ description: z.ZodOptional<z.ZodString>;
1598
+ paramType: z.ZodEnum<{
1599
+ string: "string";
1600
+ number: "number";
1601
+ boolean: "boolean";
1602
+ url: "url";
1603
+ dateTime: "dateTime";
1604
+ actor: "actor";
1605
+ "doc.ref": "doc.ref";
1606
+ "doc.refs": "doc.refs";
1607
+ json: "json";
1608
+ }>;
1609
+ required: z.ZodOptional<z.ZodBoolean>;
1610
+ },
1611
+ z.core.$strict
1612
+ >
1613
+ >
1614
+ >;
1615
+ setStatus: z.ZodOptional<
1616
+ z.ZodEnum<{
1617
+ done: "done";
1618
+ skipped: "skipped";
1619
+ failed: "failed";
1620
+ }>
1621
+ >;
1622
+ ops: z.ZodOptional<
1623
+ z.ZodArray<
1624
+ z.ZodDiscriminatedUnion<
1625
+ [
1626
+ z.ZodObject<
1627
+ {
1628
+ type: z.ZodLiteral<"workflow.op.state.set">;
1629
+ target: z.ZodObject<
1630
+ {
1631
+ scope: z.ZodEnum<{
1632
+ workflow: "workflow";
1633
+ stage: "stage";
1634
+ task: "task";
1635
+ }>;
1636
+ slotId: z.ZodString;
1637
+ },
1638
+ z.core.$strict
1639
+ >;
1640
+ value: z.ZodType<
1641
+ SourceInternal,
1642
+ unknown,
1643
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1644
+ >;
1645
+ },
1646
+ z.core.$strict
1647
+ >,
1648
+ z.ZodObject<
1649
+ {
1650
+ type: z.ZodLiteral<"workflow.op.state.append">;
1651
+ target: z.ZodObject<
1652
+ {
1653
+ scope: z.ZodEnum<{
1654
+ workflow: "workflow";
1655
+ stage: "stage";
1656
+ task: "task";
1657
+ }>;
1658
+ slotId: z.ZodString;
1659
+ },
1660
+ z.core.$strict
1661
+ >;
1662
+ item: z.ZodType<
1663
+ SourceInternal,
1664
+ unknown,
1665
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1666
+ >;
1667
+ },
1668
+ z.core.$strict
1669
+ >,
1670
+ z.ZodObject<
1671
+ {
1672
+ type: z.ZodLiteral<"workflow.op.state.updateWhere">;
1673
+ target: z.ZodObject<
1674
+ {
1675
+ scope: z.ZodEnum<{
1676
+ workflow: "workflow";
1677
+ stage: "stage";
1678
+ task: "task";
1679
+ }>;
1680
+ slotId: z.ZodString;
1681
+ },
1682
+ z.core.$strict
1683
+ >;
1684
+ where: z.ZodType<
1685
+ OpPredicateInternal,
1686
+ unknown,
1687
+ z.core.$ZodTypeInternals<OpPredicateInternal, unknown>
1688
+ >;
1689
+ merge: z.ZodRecord<
1690
+ z.ZodString,
1691
+ z.ZodType<
1692
+ SourceInternal,
1693
+ unknown,
1694
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1695
+ >
1696
+ >;
1697
+ },
1698
+ z.core.$strict
1699
+ >,
1700
+ z.ZodObject<
1701
+ {
1702
+ type: z.ZodLiteral<"workflow.op.state.removeWhere">;
1703
+ target: z.ZodObject<
1704
+ {
1705
+ scope: z.ZodEnum<{
1706
+ workflow: "workflow";
1707
+ stage: "stage";
1708
+ task: "task";
1709
+ }>;
1710
+ slotId: z.ZodString;
1711
+ },
1712
+ z.core.$strict
1713
+ >;
1714
+ where: z.ZodType<
1715
+ OpPredicateInternal,
1716
+ unknown,
1717
+ z.core.$ZodTypeInternals<OpPredicateInternal, unknown>
1718
+ >;
1719
+ },
1720
+ z.core.$strict
1721
+ >,
1722
+ z.ZodObject<
1723
+ {
1724
+ type: z.ZodLiteral<"workflow.op.status.set">;
1725
+ taskId: z.ZodString;
1726
+ status: z.ZodEnum<{
1727
+ pending: "pending";
1728
+ active: "active";
1729
+ done: "done";
1730
+ skipped: "skipped";
1731
+ failed: "failed";
1732
+ }>;
1733
+ },
1734
+ z.core.$strict
1735
+ >,
1736
+ ],
1737
+ "type"
1738
+ >
1739
+ >
1740
+ >;
1741
+ effects: z.ZodOptional<
1742
+ z.ZodArray<
1743
+ z.ZodObject<
1744
+ {
1745
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
1746
+ id: z.ZodString;
1747
+ title: z.ZodOptional<z.ZodString>;
1748
+ description: z.ZodOptional<z.ZodString>;
1749
+ bindings: z.ZodOptional<
1750
+ z.ZodRecord<
1751
+ z.ZodString,
1752
+ z.ZodType<
1753
+ SourceInternal,
1754
+ unknown,
1755
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1756
+ >
1757
+ >
1758
+ >;
1759
+ input: z.ZodOptional<
1760
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
1761
+ >;
1762
+ },
1763
+ z.core.$strict
1764
+ >
1765
+ >
1766
+ >;
1767
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1768
+ requireAssignment: z.ZodOptional<z.ZodBoolean>;
1769
+ requiredPermission: z.ZodOptional<
1770
+ z.ZodEnum<{
1771
+ create: "create";
1772
+ read: "read";
1773
+ update: "update";
1774
+ }>
1775
+ >;
1776
+ },
1777
+ z.core.$strict
1778
+ >
1779
+ >
1780
+ >;
1781
+ spawns: z.ZodOptional<
1782
+ z.ZodObject<
1783
+ {
1784
+ type: z.ZodOptional<z.ZodLiteral<"workflow.spawn">>;
1785
+ id: z.ZodOptional<z.ZodString>;
1786
+ title: z.ZodOptional<z.ZodString>;
1787
+ description: z.ZodOptional<z.ZodString>;
1788
+ definitionRef: z.ZodObject<
1789
+ {
1790
+ workflowId: z.ZodString;
1791
+ version: z.ZodOptional<
1792
+ z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"latest">]>
1793
+ >;
1794
+ },
1795
+ z.core.$strict
1796
+ >;
1797
+ forEach: z.ZodObject<
1798
+ {
1799
+ groq: z.ZodString;
1800
+ as: z.ZodObject<
1801
+ {
1802
+ initialState: z.ZodOptional<
1803
+ z.ZodArray<
1804
+ z.ZodObject<
1805
+ {
1806
+ type: z.ZodEnum<{
1807
+ "workflow.state.doc.ref": "workflow.state.doc.ref";
1808
+ "workflow.state.doc.refs": "workflow.state.doc.refs";
1809
+ "workflow.state.release.ref": "workflow.state.release.ref";
1810
+ "workflow.state.query": "workflow.state.query";
1811
+ "workflow.state.value.string": "workflow.state.value.string";
1812
+ "workflow.state.value.url": "workflow.state.value.url";
1813
+ "workflow.state.value.number": "workflow.state.value.number";
1814
+ "workflow.state.value.boolean": "workflow.state.value.boolean";
1815
+ "workflow.state.value.dateTime": "workflow.state.value.dateTime";
1816
+ "workflow.state.value.actor": "workflow.state.value.actor";
1817
+ "workflow.state.checklist": "workflow.state.checklist";
1818
+ "workflow.state.notes": "workflow.state.notes";
1819
+ "workflow.state.assignees": "workflow.state.assignees";
1820
+ }>;
1821
+ id: z.ZodString;
1822
+ value: z.ZodType<
1823
+ SourceInternal,
1824
+ unknown,
1825
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1826
+ >;
1827
+ },
1828
+ z.core.$strict
1829
+ >
1830
+ >
1831
+ >;
1832
+ effectsContext: z.ZodOptional<
1833
+ z.ZodRecord<
1834
+ z.ZodString,
1835
+ z.ZodType<
1836
+ SourceInternal,
1837
+ unknown,
1838
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
1839
+ >
1840
+ >
1841
+ >;
1842
+ },
1843
+ z.core.$strict
1844
+ >;
1845
+ },
1846
+ z.core.$strict
1847
+ >;
1848
+ completionPolicy: z.ZodOptional<
1849
+ z.ZodUnion<
1850
+ readonly [
1851
+ z.ZodObject<
1852
+ {
1853
+ kind: z.ZodLiteral<"all">;
1854
+ },
1855
+ z.core.$strict
1856
+ >,
1857
+ z.ZodObject<
1858
+ {
1859
+ kind: z.ZodLiteral<"any">;
1860
+ },
1861
+ z.core.$strict
1862
+ >,
1863
+ z.ZodObject<
1864
+ {
1865
+ kind: z.ZodLiteral<"count">;
1866
+ n: z.ZodNumber;
1867
+ },
1868
+ z.core.$strict
1869
+ >,
1870
+ ]
1871
+ >
1872
+ >;
1873
+ },
1874
+ z.core.$strict
1875
+ >
1876
+ >;
1877
+ contentRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1878
+ state: z.ZodOptional<
1879
+ z.ZodArray<
1880
+ z.ZodDiscriminatedUnion<
1881
+ [
1882
+ z.ZodObject<
1883
+ {
1884
+ type: z.ZodLiteral<StateSlotKind>;
1885
+ } & {
1886
+ id: z.ZodString;
1887
+ title: z.ZodOptional<z.ZodString>;
1888
+ description: z.ZodOptional<z.ZodString>;
1889
+ source: z.ZodUnion<
1890
+ readonly [
1891
+ z.ZodObject<
1892
+ {
1893
+ kind: z.ZodLiteral<"init">;
1894
+ },
1895
+ z.core.$strict
1896
+ >,
1897
+ z.ZodObject<
1898
+ {
1899
+ kind: z.ZodLiteral<"query">;
1900
+ query: z.ZodString;
1901
+ resource: z.ZodOptional<
1902
+ z.ZodUnion<
1903
+ readonly [
1904
+ z.ZodLiteral<"workflow">,
1905
+ z.ZodLiteral<"subject">,
1906
+ z.ZodObject<
1907
+ {
1908
+ id: z.ZodString;
1909
+ type: z.ZodString;
1910
+ },
1911
+ z.core.$strict
1912
+ >,
1913
+ ]
1914
+ >
1915
+ >;
1916
+ },
1917
+ z.core.$strict
1918
+ >,
1919
+ z.ZodObject<
1920
+ {
1921
+ kind: z.ZodLiteral<"write">;
1922
+ },
1923
+ z.core.$strict
1924
+ >,
1925
+ z.ZodObject<
1926
+ {
1927
+ kind: z.ZodLiteral<"computed">;
1928
+ compute: z.ZodString;
1929
+ },
1930
+ z.core.$strict
1931
+ >,
1932
+ z.ZodObject<
1933
+ {
1934
+ kind: z.ZodLiteral<"literal">;
1935
+ value: z.ZodUnknown;
1936
+ },
1937
+ z.core.$strict
1938
+ >,
1939
+ z.ZodObject<
1940
+ {
1941
+ kind: z.ZodLiteral<"stateRead">;
1942
+ scope: z.ZodUnion<
1943
+ readonly [
1944
+ z.ZodLiteral<"workflow">,
1945
+ z.ZodLiteral<"stage">,
1946
+ ]
1947
+ >;
1948
+ slotId: z.ZodString;
1949
+ path: z.ZodOptional<z.ZodString>;
1950
+ },
1951
+ z.core.$strict
1952
+ >,
1953
+ ]
1954
+ >;
1955
+ },
1956
+ z.core.$strip
1957
+ >,
1958
+ ...z.ZodObject<
1959
+ {
1960
+ type: z.ZodLiteral<StateSlotKind>;
1961
+ } & {
1962
+ id: z.ZodString;
1963
+ title: z.ZodOptional<z.ZodString>;
1964
+ description: z.ZodOptional<z.ZodString>;
1965
+ source: z.ZodUnion<
1966
+ readonly [
1967
+ z.ZodObject<
1968
+ {
1969
+ kind: z.ZodLiteral<"init">;
1970
+ },
1971
+ z.core.$strict
1972
+ >,
1973
+ z.ZodObject<
1974
+ {
1975
+ kind: z.ZodLiteral<"query">;
1976
+ query: z.ZodString;
1977
+ resource: z.ZodOptional<
1978
+ z.ZodUnion<
1979
+ readonly [
1980
+ z.ZodLiteral<"workflow">,
1981
+ z.ZodLiteral<"subject">,
1982
+ z.ZodObject<
1983
+ {
1984
+ id: z.ZodString;
1985
+ type: z.ZodString;
1986
+ },
1987
+ z.core.$strict
1988
+ >,
1989
+ ]
1990
+ >
1991
+ >;
1992
+ },
1993
+ z.core.$strict
1994
+ >,
1995
+ z.ZodObject<
1996
+ {
1997
+ kind: z.ZodLiteral<"write">;
1998
+ },
1999
+ z.core.$strict
2000
+ >,
2001
+ z.ZodObject<
2002
+ {
2003
+ kind: z.ZodLiteral<"computed">;
2004
+ compute: z.ZodString;
2005
+ },
2006
+ z.core.$strict
2007
+ >,
2008
+ z.ZodObject<
2009
+ {
2010
+ kind: z.ZodLiteral<"literal">;
2011
+ value: z.ZodUnknown;
2012
+ },
2013
+ z.core.$strict
2014
+ >,
2015
+ z.ZodObject<
2016
+ {
2017
+ kind: z.ZodLiteral<"stateRead">;
2018
+ scope: z.ZodUnion<
2019
+ readonly [
2020
+ z.ZodLiteral<"workflow">,
2021
+ z.ZodLiteral<"stage">,
2022
+ ]
2023
+ >;
2024
+ slotId: z.ZodString;
2025
+ path: z.ZodOptional<z.ZodString>;
2026
+ },
2027
+ z.core.$strict
2028
+ >,
2029
+ ]
2030
+ >;
2031
+ },
2032
+ z.core.$strip
2033
+ >[],
2034
+ ],
2035
+ "type"
2036
+ >
2037
+ >
2038
+ >;
2039
+ },
2040
+ z.core.$strict
2041
+ >;
2042
+
2043
+ declare type Transition = z.infer<typeof TransitionSchema>;
2044
+
2045
+ declare const TransitionSchema: z.ZodObject<
2046
+ {
2047
+ type: z.ZodOptional<z.ZodLiteral<"workflow.transition">>;
2048
+ id: z.ZodString;
2049
+ title: z.ZodOptional<z.ZodString>;
2050
+ description: z.ZodOptional<z.ZodString>;
2051
+ to: z.ZodString;
2052
+ on: z.ZodOptional<z.ZodString>;
2053
+ filter: z.ZodOptional<
2054
+ z.ZodUnion<
2055
+ readonly [
2056
+ z.ZodString,
2057
+ z.ZodObject<
2058
+ {
2059
+ ref: z.ZodString;
2060
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2061
+ },
2062
+ z.core.$strict
2063
+ >,
2064
+ ]
2065
+ >
2066
+ >;
2067
+ effects: z.ZodOptional<
2068
+ z.ZodArray<
2069
+ z.ZodObject<
2070
+ {
2071
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
2072
+ id: z.ZodString;
2073
+ title: z.ZodOptional<z.ZodString>;
2074
+ description: z.ZodOptional<z.ZodString>;
2075
+ bindings: z.ZodOptional<
2076
+ z.ZodRecord<
2077
+ z.ZodString,
2078
+ z.ZodType<
2079
+ SourceInternal,
2080
+ unknown,
2081
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
2082
+ >
2083
+ >
2084
+ >;
2085
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2086
+ },
2087
+ z.core.$strict
2088
+ >
2089
+ >
2090
+ >;
2091
+ },
2092
+ z.core.$strict
2093
+ >;
2094
+
2095
+ /**
2096
+ * Workflow definition — inferred from the Zod schema so authoring types
2097
+ * and runtime validation share one source of truth.
2098
+ */
2099
+ declare type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
2100
+
2101
+ /**
2102
+ * The full schema, with cross-field invariants enforced via `.superRefine`
2103
+ * so the error path lands exactly on the offending field.
2104
+ *
2105
+ * Invariants checked:
2106
+ * - Every stage id is unique
2107
+ * - `initialStageId` references a declared stage
2108
+ * - Within each stage, task ids are unique
2109
+ * - Every `transition.to` references a declared stage
2110
+ * - Every `predicate.id` is unique
2111
+ * - Every `Filter.ref` resolves to a declared predicate id
2112
+ * - At most one terminal-style stage per `kind: terminal` is fine,
2113
+ * but terminal stages must not declare transitions (a transition
2114
+ * out of a terminal is nonsense — caught here, not at runtime).
2115
+ */
2116
+ declare const WorkflowDefinitionSchema: z.ZodObject<
2117
+ {
2118
+ workflowId: z.ZodString;
2119
+ version: z.ZodNumber;
2120
+ title: z.ZodString;
2121
+ description: z.ZodOptional<z.ZodString>;
2122
+ initialStageId: z.ZodString;
2123
+ state: z.ZodOptional<
2124
+ z.ZodArray<
2125
+ z.ZodDiscriminatedUnion<
2126
+ [
2127
+ z.ZodObject<
2128
+ {
2129
+ type: z.ZodLiteral<StateSlotKind>;
2130
+ } & {
2131
+ id: z.ZodString;
2132
+ title: z.ZodOptional<z.ZodString>;
2133
+ description: z.ZodOptional<z.ZodString>;
2134
+ source: z.ZodUnion<
2135
+ readonly [
2136
+ z.ZodObject<
2137
+ {
2138
+ kind: z.ZodLiteral<"init">;
2139
+ },
2140
+ z.core.$strict
2141
+ >,
2142
+ z.ZodObject<
2143
+ {
2144
+ kind: z.ZodLiteral<"query">;
2145
+ query: z.ZodString;
2146
+ resource: z.ZodOptional<
2147
+ z.ZodUnion<
2148
+ readonly [
2149
+ z.ZodLiteral<"workflow">,
2150
+ z.ZodLiteral<"subject">,
2151
+ z.ZodObject<
2152
+ {
2153
+ id: z.ZodString;
2154
+ type: z.ZodString;
2155
+ },
2156
+ z.core.$strict
2157
+ >,
2158
+ ]
2159
+ >
2160
+ >;
2161
+ },
2162
+ z.core.$strict
2163
+ >,
2164
+ z.ZodObject<
2165
+ {
2166
+ kind: z.ZodLiteral<"write">;
2167
+ },
2168
+ z.core.$strict
2169
+ >,
2170
+ z.ZodObject<
2171
+ {
2172
+ kind: z.ZodLiteral<"computed">;
2173
+ compute: z.ZodString;
2174
+ },
2175
+ z.core.$strict
2176
+ >,
2177
+ z.ZodObject<
2178
+ {
2179
+ kind: z.ZodLiteral<"literal">;
2180
+ value: z.ZodUnknown;
2181
+ },
2182
+ z.core.$strict
2183
+ >,
2184
+ z.ZodObject<
2185
+ {
2186
+ kind: z.ZodLiteral<"stateRead">;
2187
+ scope: z.ZodUnion<
2188
+ readonly [
2189
+ z.ZodLiteral<"workflow">,
2190
+ z.ZodLiteral<"stage">,
2191
+ ]
2192
+ >;
2193
+ slotId: z.ZodString;
2194
+ path: z.ZodOptional<z.ZodString>;
2195
+ },
2196
+ z.core.$strict
2197
+ >,
2198
+ ]
2199
+ >;
2200
+ },
2201
+ z.core.$strip
2202
+ >,
2203
+ ...z.ZodObject<
2204
+ {
2205
+ type: z.ZodLiteral<StateSlotKind>;
2206
+ } & {
2207
+ id: z.ZodString;
2208
+ title: z.ZodOptional<z.ZodString>;
2209
+ description: z.ZodOptional<z.ZodString>;
2210
+ source: z.ZodUnion<
2211
+ readonly [
2212
+ z.ZodObject<
2213
+ {
2214
+ kind: z.ZodLiteral<"init">;
2215
+ },
2216
+ z.core.$strict
2217
+ >,
2218
+ z.ZodObject<
2219
+ {
2220
+ kind: z.ZodLiteral<"query">;
2221
+ query: z.ZodString;
2222
+ resource: z.ZodOptional<
2223
+ z.ZodUnion<
2224
+ readonly [
2225
+ z.ZodLiteral<"workflow">,
2226
+ z.ZodLiteral<"subject">,
2227
+ z.ZodObject<
2228
+ {
2229
+ id: z.ZodString;
2230
+ type: z.ZodString;
2231
+ },
2232
+ z.core.$strict
2233
+ >,
2234
+ ]
2235
+ >
2236
+ >;
2237
+ },
2238
+ z.core.$strict
2239
+ >,
2240
+ z.ZodObject<
2241
+ {
2242
+ kind: z.ZodLiteral<"write">;
2243
+ },
2244
+ z.core.$strict
2245
+ >,
2246
+ z.ZodObject<
2247
+ {
2248
+ kind: z.ZodLiteral<"computed">;
2249
+ compute: z.ZodString;
2250
+ },
2251
+ z.core.$strict
2252
+ >,
2253
+ z.ZodObject<
2254
+ {
2255
+ kind: z.ZodLiteral<"literal">;
2256
+ value: z.ZodUnknown;
2257
+ },
2258
+ z.core.$strict
2259
+ >,
2260
+ z.ZodObject<
2261
+ {
2262
+ kind: z.ZodLiteral<"stateRead">;
2263
+ scope: z.ZodUnion<
2264
+ readonly [
2265
+ z.ZodLiteral<"workflow">,
2266
+ z.ZodLiteral<"stage">,
2267
+ ]
2268
+ >;
2269
+ slotId: z.ZodString;
2270
+ path: z.ZodOptional<z.ZodString>;
2271
+ },
2272
+ z.core.$strict
2273
+ >,
2274
+ ]
2275
+ >;
2276
+ },
2277
+ z.core.$strip
2278
+ >[],
2279
+ ],
2280
+ "type"
2281
+ >
2282
+ >
2283
+ >;
2284
+ stages: z.ZodArray<
2285
+ z.ZodObject<
2286
+ {
2287
+ type: z.ZodOptional<z.ZodLiteral<"workflow.stage">>;
2288
+ id: z.ZodString;
2289
+ title: z.ZodOptional<z.ZodString>;
2290
+ description: z.ZodOptional<z.ZodString>;
2291
+ kind: z.ZodOptional<
2292
+ z.ZodEnum<{
2293
+ initial: "initial";
2294
+ intermediate: "intermediate";
2295
+ terminal: "terminal";
2296
+ waiting: "waiting";
2297
+ }>
2298
+ >;
2299
+ tasks: z.ZodOptional<
2300
+ z.ZodArray<
2301
+ z.ZodObject<
2302
+ {
2303
+ type: z.ZodOptional<z.ZodLiteral<"workflow.task">>;
2304
+ id: z.ZodString;
2305
+ title: z.ZodOptional<z.ZodString>;
2306
+ description: z.ZodOptional<z.ZodString>;
2307
+ assignees: z.ZodOptional<
2308
+ z.ZodArray<
2309
+ z.ZodDiscriminatedUnion<
2310
+ [
2311
+ z.ZodObject<
2312
+ {
2313
+ kind: z.ZodLiteral<"user">;
2314
+ id: z.ZodString;
2315
+ },
2316
+ z.core.$strict
2317
+ >,
2318
+ z.ZodObject<
2319
+ {
2320
+ kind: z.ZodLiteral<"role">;
2321
+ role: z.ZodString;
2322
+ },
2323
+ z.core.$strict
2324
+ >,
2325
+ ],
2326
+ "kind"
2327
+ >
2328
+ >
2329
+ >;
2330
+ filter: z.ZodOptional<
2331
+ z.ZodUnion<
2332
+ readonly [
2333
+ z.ZodString,
2334
+ z.ZodObject<
2335
+ {
2336
+ ref: z.ZodString;
2337
+ args: z.ZodOptional<
2338
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2339
+ >;
2340
+ },
2341
+ z.core.$strict
2342
+ >,
2343
+ ]
2344
+ >
2345
+ >;
2346
+ invokeOn: z.ZodOptional<
2347
+ z.ZodEnum<{
2348
+ stageEnter: "stageEnter";
2349
+ manual: "manual";
2350
+ }>
2351
+ >;
2352
+ completeWhen: z.ZodOptional<
2353
+ z.ZodUnion<
2354
+ readonly [
2355
+ z.ZodString,
2356
+ z.ZodObject<
2357
+ {
2358
+ ref: z.ZodString;
2359
+ args: z.ZodOptional<
2360
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2361
+ >;
2362
+ },
2363
+ z.core.$strict
2364
+ >,
2365
+ ]
2366
+ >
2367
+ >;
2368
+ failWhen: z.ZodOptional<
2369
+ z.ZodUnion<
2370
+ readonly [
2371
+ z.ZodString,
2372
+ z.ZodObject<
2373
+ {
2374
+ ref: z.ZodString;
2375
+ args: z.ZodOptional<
2376
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2377
+ >;
2378
+ },
2379
+ z.core.$strict
2380
+ >,
2381
+ ]
2382
+ >
2383
+ >;
2384
+ effects: z.ZodOptional<
2385
+ z.ZodArray<
2386
+ z.ZodObject<
2387
+ {
2388
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
2389
+ id: z.ZodString;
2390
+ title: z.ZodOptional<z.ZodString>;
2391
+ description: z.ZodOptional<z.ZodString>;
2392
+ bindings: z.ZodOptional<
2393
+ z.ZodRecord<
2394
+ z.ZodString,
2395
+ z.ZodType<
2396
+ SourceInternal,
2397
+ unknown,
2398
+ z.core.$ZodTypeInternals<
2399
+ SourceInternal,
2400
+ unknown
2401
+ >
2402
+ >
2403
+ >
2404
+ >;
2405
+ input: z.ZodOptional<
2406
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2407
+ >;
2408
+ },
2409
+ z.core.$strict
2410
+ >
2411
+ >
2412
+ >;
2413
+ actions: z.ZodOptional<
2414
+ z.ZodArray<
2415
+ z.ZodObject<
2416
+ {
2417
+ type: z.ZodOptional<z.ZodLiteral<"workflow.action">>;
2418
+ id: z.ZodString;
2419
+ title: z.ZodOptional<z.ZodString>;
2420
+ description: z.ZodOptional<z.ZodString>;
2421
+ filter: z.ZodOptional<
2422
+ z.ZodUnion<
2423
+ readonly [
2424
+ z.ZodString,
2425
+ z.ZodObject<
2426
+ {
2427
+ ref: z.ZodString;
2428
+ args: z.ZodOptional<
2429
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2430
+ >;
2431
+ },
2432
+ z.core.$strict
2433
+ >,
2434
+ ]
2435
+ >
2436
+ >;
2437
+ params: z.ZodOptional<
2438
+ z.ZodArray<
2439
+ z.ZodObject<
2440
+ {
2441
+ type: z.ZodOptional<
2442
+ z.ZodLiteral<"workflow.action.param">
2443
+ >;
2444
+ id: z.ZodString;
2445
+ title: z.ZodOptional<z.ZodString>;
2446
+ description: z.ZodOptional<z.ZodString>;
2447
+ paramType: z.ZodEnum<{
2448
+ string: "string";
2449
+ number: "number";
2450
+ boolean: "boolean";
2451
+ url: "url";
2452
+ dateTime: "dateTime";
2453
+ actor: "actor";
2454
+ "doc.ref": "doc.ref";
2455
+ "doc.refs": "doc.refs";
2456
+ json: "json";
2457
+ }>;
2458
+ required: z.ZodOptional<z.ZodBoolean>;
2459
+ },
2460
+ z.core.$strict
2461
+ >
2462
+ >
2463
+ >;
2464
+ setStatus: z.ZodOptional<
2465
+ z.ZodEnum<{
2466
+ done: "done";
2467
+ skipped: "skipped";
2468
+ failed: "failed";
2469
+ }>
2470
+ >;
2471
+ ops: z.ZodOptional<
2472
+ z.ZodArray<
2473
+ z.ZodDiscriminatedUnion<
2474
+ [
2475
+ z.ZodObject<
2476
+ {
2477
+ type: z.ZodLiteral<"workflow.op.state.set">;
2478
+ target: z.ZodObject<
2479
+ {
2480
+ scope: z.ZodEnum<{
2481
+ workflow: "workflow";
2482
+ stage: "stage";
2483
+ task: "task";
2484
+ }>;
2485
+ slotId: z.ZodString;
2486
+ },
2487
+ z.core.$strict
2488
+ >;
2489
+ value: z.ZodType<
2490
+ SourceInternal,
2491
+ unknown,
2492
+ z.core.$ZodTypeInternals<
2493
+ SourceInternal,
2494
+ unknown
2495
+ >
2496
+ >;
2497
+ },
2498
+ z.core.$strict
2499
+ >,
2500
+ z.ZodObject<
2501
+ {
2502
+ type: z.ZodLiteral<"workflow.op.state.append">;
2503
+ target: z.ZodObject<
2504
+ {
2505
+ scope: z.ZodEnum<{
2506
+ workflow: "workflow";
2507
+ stage: "stage";
2508
+ task: "task";
2509
+ }>;
2510
+ slotId: z.ZodString;
2511
+ },
2512
+ z.core.$strict
2513
+ >;
2514
+ item: z.ZodType<
2515
+ SourceInternal,
2516
+ unknown,
2517
+ z.core.$ZodTypeInternals<
2518
+ SourceInternal,
2519
+ unknown
2520
+ >
2521
+ >;
2522
+ },
2523
+ z.core.$strict
2524
+ >,
2525
+ z.ZodObject<
2526
+ {
2527
+ type: z.ZodLiteral<"workflow.op.state.updateWhere">;
2528
+ target: z.ZodObject<
2529
+ {
2530
+ scope: z.ZodEnum<{
2531
+ workflow: "workflow";
2532
+ stage: "stage";
2533
+ task: "task";
2534
+ }>;
2535
+ slotId: z.ZodString;
2536
+ },
2537
+ z.core.$strict
2538
+ >;
2539
+ where: z.ZodType<
2540
+ OpPredicateInternal,
2541
+ unknown,
2542
+ z.core.$ZodTypeInternals<
2543
+ OpPredicateInternal,
2544
+ unknown
2545
+ >
2546
+ >;
2547
+ merge: z.ZodRecord<
2548
+ z.ZodString,
2549
+ z.ZodType<
2550
+ SourceInternal,
2551
+ unknown,
2552
+ z.core.$ZodTypeInternals<
2553
+ SourceInternal,
2554
+ unknown
2555
+ >
2556
+ >
2557
+ >;
2558
+ },
2559
+ z.core.$strict
2560
+ >,
2561
+ z.ZodObject<
2562
+ {
2563
+ type: z.ZodLiteral<"workflow.op.state.removeWhere">;
2564
+ target: z.ZodObject<
2565
+ {
2566
+ scope: z.ZodEnum<{
2567
+ workflow: "workflow";
2568
+ stage: "stage";
2569
+ task: "task";
2570
+ }>;
2571
+ slotId: z.ZodString;
2572
+ },
2573
+ z.core.$strict
2574
+ >;
2575
+ where: z.ZodType<
2576
+ OpPredicateInternal,
2577
+ unknown,
2578
+ z.core.$ZodTypeInternals<
2579
+ OpPredicateInternal,
2580
+ unknown
2581
+ >
2582
+ >;
2583
+ },
2584
+ z.core.$strict
2585
+ >,
2586
+ z.ZodObject<
2587
+ {
2588
+ type: z.ZodLiteral<"workflow.op.status.set">;
2589
+ taskId: z.ZodString;
2590
+ status: z.ZodEnum<{
2591
+ pending: "pending";
2592
+ active: "active";
2593
+ done: "done";
2594
+ skipped: "skipped";
2595
+ failed: "failed";
2596
+ }>;
2597
+ },
2598
+ z.core.$strict
2599
+ >,
2600
+ ],
2601
+ "type"
2602
+ >
2603
+ >
2604
+ >;
2605
+ effects: z.ZodOptional<
2606
+ z.ZodArray<
2607
+ z.ZodObject<
2608
+ {
2609
+ type: z.ZodOptional<
2610
+ z.ZodLiteral<"workflow.effect">
2611
+ >;
2612
+ id: z.ZodString;
2613
+ title: z.ZodOptional<z.ZodString>;
2614
+ description: z.ZodOptional<z.ZodString>;
2615
+ bindings: z.ZodOptional<
2616
+ z.ZodRecord<
2617
+ z.ZodString,
2618
+ z.ZodType<
2619
+ SourceInternal,
2620
+ unknown,
2621
+ z.core.$ZodTypeInternals<
2622
+ SourceInternal,
2623
+ unknown
2624
+ >
2625
+ >
2626
+ >
2627
+ >;
2628
+ input: z.ZodOptional<
2629
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2630
+ >;
2631
+ },
2632
+ z.core.$strict
2633
+ >
2634
+ >
2635
+ >;
2636
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
2637
+ requireAssignment: z.ZodOptional<z.ZodBoolean>;
2638
+ requiredPermission: z.ZodOptional<
2639
+ z.ZodEnum<{
2640
+ create: "create";
2641
+ read: "read";
2642
+ update: "update";
2643
+ }>
2644
+ >;
2645
+ },
2646
+ z.core.$strict
2647
+ >
2648
+ >
2649
+ >;
2650
+ spawns: z.ZodOptional<
2651
+ z.ZodObject<
2652
+ {
2653
+ type: z.ZodOptional<z.ZodLiteral<"workflow.spawn">>;
2654
+ id: z.ZodOptional<z.ZodString>;
2655
+ title: z.ZodOptional<z.ZodString>;
2656
+ description: z.ZodOptional<z.ZodString>;
2657
+ definitionRef: z.ZodObject<
2658
+ {
2659
+ workflowId: z.ZodString;
2660
+ version: z.ZodOptional<
2661
+ z.ZodUnion<
2662
+ readonly [z.ZodNumber, z.ZodLiteral<"latest">]
2663
+ >
2664
+ >;
2665
+ },
2666
+ z.core.$strict
2667
+ >;
2668
+ forEach: z.ZodObject<
2669
+ {
2670
+ groq: z.ZodString;
2671
+ as: z.ZodObject<
2672
+ {
2673
+ initialState: z.ZodOptional<
2674
+ z.ZodArray<
2675
+ z.ZodObject<
2676
+ {
2677
+ type: z.ZodEnum<{
2678
+ "workflow.state.doc.ref": "workflow.state.doc.ref";
2679
+ "workflow.state.doc.refs": "workflow.state.doc.refs";
2680
+ "workflow.state.release.ref": "workflow.state.release.ref";
2681
+ "workflow.state.query": "workflow.state.query";
2682
+ "workflow.state.value.string": "workflow.state.value.string";
2683
+ "workflow.state.value.url": "workflow.state.value.url";
2684
+ "workflow.state.value.number": "workflow.state.value.number";
2685
+ "workflow.state.value.boolean": "workflow.state.value.boolean";
2686
+ "workflow.state.value.dateTime": "workflow.state.value.dateTime";
2687
+ "workflow.state.value.actor": "workflow.state.value.actor";
2688
+ "workflow.state.checklist": "workflow.state.checklist";
2689
+ "workflow.state.notes": "workflow.state.notes";
2690
+ "workflow.state.assignees": "workflow.state.assignees";
2691
+ }>;
2692
+ id: z.ZodString;
2693
+ value: z.ZodType<
2694
+ SourceInternal,
2695
+ unknown,
2696
+ z.core.$ZodTypeInternals<
2697
+ SourceInternal,
2698
+ unknown
2699
+ >
2700
+ >;
2701
+ },
2702
+ z.core.$strict
2703
+ >
2704
+ >
2705
+ >;
2706
+ effectsContext: z.ZodOptional<
2707
+ z.ZodRecord<
2708
+ z.ZodString,
2709
+ z.ZodType<
2710
+ SourceInternal,
2711
+ unknown,
2712
+ z.core.$ZodTypeInternals<
2713
+ SourceInternal,
2714
+ unknown
2715
+ >
2716
+ >
2717
+ >
2718
+ >;
2719
+ },
2720
+ z.core.$strict
2721
+ >;
2722
+ },
2723
+ z.core.$strict
2724
+ >;
2725
+ completionPolicy: z.ZodOptional<
2726
+ z.ZodUnion<
2727
+ readonly [
2728
+ z.ZodObject<
2729
+ {
2730
+ kind: z.ZodLiteral<"all">;
2731
+ },
2732
+ z.core.$strict
2733
+ >,
2734
+ z.ZodObject<
2735
+ {
2736
+ kind: z.ZodLiteral<"any">;
2737
+ },
2738
+ z.core.$strict
2739
+ >,
2740
+ z.ZodObject<
2741
+ {
2742
+ kind: z.ZodLiteral<"count">;
2743
+ n: z.ZodNumber;
2744
+ },
2745
+ z.core.$strict
2746
+ >,
2747
+ ]
2748
+ >
2749
+ >;
2750
+ },
2751
+ z.core.$strict
2752
+ >
2753
+ >;
2754
+ contentRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2755
+ state: z.ZodOptional<
2756
+ z.ZodArray<
2757
+ z.ZodDiscriminatedUnion<
2758
+ [
2759
+ z.ZodObject<
2760
+ {
2761
+ type: z.ZodLiteral<StateSlotKind>;
2762
+ } & {
2763
+ id: z.ZodString;
2764
+ title: z.ZodOptional<z.ZodString>;
2765
+ description: z.ZodOptional<z.ZodString>;
2766
+ source: z.ZodUnion<
2767
+ readonly [
2768
+ z.ZodObject<
2769
+ {
2770
+ kind: z.ZodLiteral<"init">;
2771
+ },
2772
+ z.core.$strict
2773
+ >,
2774
+ z.ZodObject<
2775
+ {
2776
+ kind: z.ZodLiteral<"query">;
2777
+ query: z.ZodString;
2778
+ resource: z.ZodOptional<
2779
+ z.ZodUnion<
2780
+ readonly [
2781
+ z.ZodLiteral<"workflow">,
2782
+ z.ZodLiteral<"subject">,
2783
+ z.ZodObject<
2784
+ {
2785
+ id: z.ZodString;
2786
+ type: z.ZodString;
2787
+ },
2788
+ z.core.$strict
2789
+ >,
2790
+ ]
2791
+ >
2792
+ >;
2793
+ },
2794
+ z.core.$strict
2795
+ >,
2796
+ z.ZodObject<
2797
+ {
2798
+ kind: z.ZodLiteral<"write">;
2799
+ },
2800
+ z.core.$strict
2801
+ >,
2802
+ z.ZodObject<
2803
+ {
2804
+ kind: z.ZodLiteral<"computed">;
2805
+ compute: z.ZodString;
2806
+ },
2807
+ z.core.$strict
2808
+ >,
2809
+ z.ZodObject<
2810
+ {
2811
+ kind: z.ZodLiteral<"literal">;
2812
+ value: z.ZodUnknown;
2813
+ },
2814
+ z.core.$strict
2815
+ >,
2816
+ z.ZodObject<
2817
+ {
2818
+ kind: z.ZodLiteral<"stateRead">;
2819
+ scope: z.ZodUnion<
2820
+ readonly [
2821
+ z.ZodLiteral<"workflow">,
2822
+ z.ZodLiteral<"stage">,
2823
+ ]
2824
+ >;
2825
+ slotId: z.ZodString;
2826
+ path: z.ZodOptional<z.ZodString>;
2827
+ },
2828
+ z.core.$strict
2829
+ >,
2830
+ ]
2831
+ >;
2832
+ },
2833
+ z.core.$strip
2834
+ >,
2835
+ ...z.ZodObject<
2836
+ {
2837
+ type: z.ZodLiteral<StateSlotKind>;
2838
+ } & {
2839
+ id: z.ZodString;
2840
+ title: z.ZodOptional<z.ZodString>;
2841
+ description: z.ZodOptional<z.ZodString>;
2842
+ source: z.ZodUnion<
2843
+ readonly [
2844
+ z.ZodObject<
2845
+ {
2846
+ kind: z.ZodLiteral<"init">;
2847
+ },
2848
+ z.core.$strict
2849
+ >,
2850
+ z.ZodObject<
2851
+ {
2852
+ kind: z.ZodLiteral<"query">;
2853
+ query: z.ZodString;
2854
+ resource: z.ZodOptional<
2855
+ z.ZodUnion<
2856
+ readonly [
2857
+ z.ZodLiteral<"workflow">,
2858
+ z.ZodLiteral<"subject">,
2859
+ z.ZodObject<
2860
+ {
2861
+ id: z.ZodString;
2862
+ type: z.ZodString;
2863
+ },
2864
+ z.core.$strict
2865
+ >,
2866
+ ]
2867
+ >
2868
+ >;
2869
+ },
2870
+ z.core.$strict
2871
+ >,
2872
+ z.ZodObject<
2873
+ {
2874
+ kind: z.ZodLiteral<"write">;
2875
+ },
2876
+ z.core.$strict
2877
+ >,
2878
+ z.ZodObject<
2879
+ {
2880
+ kind: z.ZodLiteral<"computed">;
2881
+ compute: z.ZodString;
2882
+ },
2883
+ z.core.$strict
2884
+ >,
2885
+ z.ZodObject<
2886
+ {
2887
+ kind: z.ZodLiteral<"literal">;
2888
+ value: z.ZodUnknown;
2889
+ },
2890
+ z.core.$strict
2891
+ >,
2892
+ z.ZodObject<
2893
+ {
2894
+ kind: z.ZodLiteral<"stateRead">;
2895
+ scope: z.ZodUnion<
2896
+ readonly [
2897
+ z.ZodLiteral<"workflow">,
2898
+ z.ZodLiteral<"stage">,
2899
+ ]
2900
+ >;
2901
+ slotId: z.ZodString;
2902
+ path: z.ZodOptional<z.ZodString>;
2903
+ },
2904
+ z.core.$strict
2905
+ >,
2906
+ ]
2907
+ >;
2908
+ },
2909
+ z.core.$strip
2910
+ >[],
2911
+ ],
2912
+ "type"
2913
+ >
2914
+ >
2915
+ >;
2916
+ },
2917
+ z.core.$strict
2918
+ >
2919
+ >
2920
+ >;
2921
+ transitions: z.ZodOptional<
2922
+ z.ZodArray<
2923
+ z.ZodObject<
2924
+ {
2925
+ type: z.ZodOptional<z.ZodLiteral<"workflow.transition">>;
2926
+ id: z.ZodString;
2927
+ title: z.ZodOptional<z.ZodString>;
2928
+ description: z.ZodOptional<z.ZodString>;
2929
+ to: z.ZodString;
2930
+ on: z.ZodOptional<z.ZodString>;
2931
+ filter: z.ZodOptional<
2932
+ z.ZodUnion<
2933
+ readonly [
2934
+ z.ZodString,
2935
+ z.ZodObject<
2936
+ {
2937
+ ref: z.ZodString;
2938
+ args: z.ZodOptional<
2939
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2940
+ >;
2941
+ },
2942
+ z.core.$strict
2943
+ >,
2944
+ ]
2945
+ >
2946
+ >;
2947
+ effects: z.ZodOptional<
2948
+ z.ZodArray<
2949
+ z.ZodObject<
2950
+ {
2951
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
2952
+ id: z.ZodString;
2953
+ title: z.ZodOptional<z.ZodString>;
2954
+ description: z.ZodOptional<z.ZodString>;
2955
+ bindings: z.ZodOptional<
2956
+ z.ZodRecord<
2957
+ z.ZodString,
2958
+ z.ZodType<
2959
+ SourceInternal,
2960
+ unknown,
2961
+ z.core.$ZodTypeInternals<
2962
+ SourceInternal,
2963
+ unknown
2964
+ >
2965
+ >
2966
+ >
2967
+ >;
2968
+ input: z.ZodOptional<
2969
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
2970
+ >;
2971
+ },
2972
+ z.core.$strict
2973
+ >
2974
+ >
2975
+ >;
2976
+ },
2977
+ z.core.$strict
2978
+ >
2979
+ >
2980
+ >;
2981
+ completion: z.ZodOptional<
2982
+ z.ZodUnion<
2983
+ readonly [
2984
+ z.ZodString,
2985
+ z.ZodObject<
2986
+ {
2987
+ ref: z.ZodString;
2988
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2989
+ },
2990
+ z.core.$strict
2991
+ >,
2992
+ ]
2993
+ >
2994
+ >;
2995
+ onEnter: z.ZodOptional<
2996
+ z.ZodArray<
2997
+ z.ZodObject<
2998
+ {
2999
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
3000
+ id: z.ZodString;
3001
+ title: z.ZodOptional<z.ZodString>;
3002
+ description: z.ZodOptional<z.ZodString>;
3003
+ bindings: z.ZodOptional<
3004
+ z.ZodRecord<
3005
+ z.ZodString,
3006
+ z.ZodType<
3007
+ SourceInternal,
3008
+ unknown,
3009
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
3010
+ >
3011
+ >
3012
+ >;
3013
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3014
+ },
3015
+ z.core.$strict
3016
+ >
3017
+ >
3018
+ >;
3019
+ onExit: z.ZodOptional<
3020
+ z.ZodArray<
3021
+ z.ZodObject<
3022
+ {
3023
+ type: z.ZodOptional<z.ZodLiteral<"workflow.effect">>;
3024
+ id: z.ZodString;
3025
+ title: z.ZodOptional<z.ZodString>;
3026
+ description: z.ZodOptional<z.ZodString>;
3027
+ bindings: z.ZodOptional<
3028
+ z.ZodRecord<
3029
+ z.ZodString,
3030
+ z.ZodType<
3031
+ SourceInternal,
3032
+ unknown,
3033
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
3034
+ >
3035
+ >
3036
+ >;
3037
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3038
+ },
3039
+ z.core.$strict
3040
+ >
3041
+ >
3042
+ >;
3043
+ guards: z.ZodOptional<
3044
+ z.ZodArray<
3045
+ z.ZodObject<
3046
+ {
3047
+ name: z.ZodOptional<z.ZodString>;
3048
+ description: z.ZodOptional<z.ZodString>;
3049
+ match: z.ZodObject<
3050
+ {
3051
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
3052
+ idRefs: z.ZodOptional<
3053
+ z.ZodArray<
3054
+ z.ZodType<
3055
+ SourceInternal,
3056
+ unknown,
3057
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
3058
+ >
3059
+ >
3060
+ >;
3061
+ idPatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
3062
+ actions: z.ZodArray<
3063
+ z.ZodEnum<{
3064
+ create: "create";
3065
+ update: "update";
3066
+ delete: "delete";
3067
+ publish: "publish";
3068
+ unpublish: "unpublish";
3069
+ }>
3070
+ >;
3071
+ },
3072
+ z.core.$strict
3073
+ >;
3074
+ predicate: z.ZodOptional<z.ZodString>;
3075
+ metadata: z.ZodOptional<
3076
+ z.ZodRecord<
3077
+ z.ZodString,
3078
+ z.ZodType<
3079
+ SourceInternal,
3080
+ unknown,
3081
+ z.core.$ZodTypeInternals<SourceInternal, unknown>
3082
+ >
3083
+ >
3084
+ >;
3085
+ },
3086
+ z.core.$strict
3087
+ >
3088
+ >
3089
+ >;
3090
+ contentRefs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
3091
+ state: z.ZodOptional<
3092
+ z.ZodArray<
3093
+ z.ZodDiscriminatedUnion<
3094
+ [
3095
+ z.ZodObject<
3096
+ {
3097
+ type: z.ZodLiteral<StateSlotKind>;
3098
+ } & {
3099
+ id: z.ZodString;
3100
+ title: z.ZodOptional<z.ZodString>;
3101
+ description: z.ZodOptional<z.ZodString>;
3102
+ source: z.ZodUnion<
3103
+ readonly [
3104
+ z.ZodObject<
3105
+ {
3106
+ kind: z.ZodLiteral<"init">;
3107
+ },
3108
+ z.core.$strict
3109
+ >,
3110
+ z.ZodObject<
3111
+ {
3112
+ kind: z.ZodLiteral<"query">;
3113
+ query: z.ZodString;
3114
+ resource: z.ZodOptional<
3115
+ z.ZodUnion<
3116
+ readonly [
3117
+ z.ZodLiteral<"workflow">,
3118
+ z.ZodLiteral<"subject">,
3119
+ z.ZodObject<
3120
+ {
3121
+ id: z.ZodString;
3122
+ type: z.ZodString;
3123
+ },
3124
+ z.core.$strict
3125
+ >,
3126
+ ]
3127
+ >
3128
+ >;
3129
+ },
3130
+ z.core.$strict
3131
+ >,
3132
+ z.ZodObject<
3133
+ {
3134
+ kind: z.ZodLiteral<"write">;
3135
+ },
3136
+ z.core.$strict
3137
+ >,
3138
+ z.ZodObject<
3139
+ {
3140
+ kind: z.ZodLiteral<"computed">;
3141
+ compute: z.ZodString;
3142
+ },
3143
+ z.core.$strict
3144
+ >,
3145
+ z.ZodObject<
3146
+ {
3147
+ kind: z.ZodLiteral<"literal">;
3148
+ value: z.ZodUnknown;
3149
+ },
3150
+ z.core.$strict
3151
+ >,
3152
+ z.ZodObject<
3153
+ {
3154
+ kind: z.ZodLiteral<"stateRead">;
3155
+ scope: z.ZodUnion<
3156
+ readonly [
3157
+ z.ZodLiteral<"workflow">,
3158
+ z.ZodLiteral<"stage">,
3159
+ ]
3160
+ >;
3161
+ slotId: z.ZodString;
3162
+ path: z.ZodOptional<z.ZodString>;
3163
+ },
3164
+ z.core.$strict
3165
+ >,
3166
+ ]
3167
+ >;
3168
+ },
3169
+ z.core.$strip
3170
+ >,
3171
+ ...z.ZodObject<
3172
+ {
3173
+ type: z.ZodLiteral<StateSlotKind>;
3174
+ } & {
3175
+ id: z.ZodString;
3176
+ title: z.ZodOptional<z.ZodString>;
3177
+ description: z.ZodOptional<z.ZodString>;
3178
+ source: z.ZodUnion<
3179
+ readonly [
3180
+ z.ZodObject<
3181
+ {
3182
+ kind: z.ZodLiteral<"init">;
3183
+ },
3184
+ z.core.$strict
3185
+ >,
3186
+ z.ZodObject<
3187
+ {
3188
+ kind: z.ZodLiteral<"query">;
3189
+ query: z.ZodString;
3190
+ resource: z.ZodOptional<
3191
+ z.ZodUnion<
3192
+ readonly [
3193
+ z.ZodLiteral<"workflow">,
3194
+ z.ZodLiteral<"subject">,
3195
+ z.ZodObject<
3196
+ {
3197
+ id: z.ZodString;
3198
+ type: z.ZodString;
3199
+ },
3200
+ z.core.$strict
3201
+ >,
3202
+ ]
3203
+ >
3204
+ >;
3205
+ },
3206
+ z.core.$strict
3207
+ >,
3208
+ z.ZodObject<
3209
+ {
3210
+ kind: z.ZodLiteral<"write">;
3211
+ },
3212
+ z.core.$strict
3213
+ >,
3214
+ z.ZodObject<
3215
+ {
3216
+ kind: z.ZodLiteral<"computed">;
3217
+ compute: z.ZodString;
3218
+ },
3219
+ z.core.$strict
3220
+ >,
3221
+ z.ZodObject<
3222
+ {
3223
+ kind: z.ZodLiteral<"literal">;
3224
+ value: z.ZodUnknown;
3225
+ },
3226
+ z.core.$strict
3227
+ >,
3228
+ z.ZodObject<
3229
+ {
3230
+ kind: z.ZodLiteral<"stateRead">;
3231
+ scope: z.ZodUnion<
3232
+ readonly [
3233
+ z.ZodLiteral<"workflow">,
3234
+ z.ZodLiteral<"stage">,
3235
+ ]
3236
+ >;
3237
+ slotId: z.ZodString;
3238
+ path: z.ZodOptional<z.ZodString>;
3239
+ },
3240
+ z.core.$strict
3241
+ >,
3242
+ ]
3243
+ >;
3244
+ },
3245
+ z.core.$strip
3246
+ >[],
3247
+ ],
3248
+ "type"
3249
+ >
3250
+ >
3251
+ >;
3252
+ },
3253
+ z.core.$strict
3254
+ >
3255
+ >;
3256
+ predicates: z.ZodOptional<
3257
+ z.ZodArray<
3258
+ z.ZodObject<
3259
+ {
3260
+ type: z.ZodOptional<z.ZodLiteral<"workflow.predicate">>;
3261
+ id: z.ZodString;
3262
+ title: z.ZodOptional<z.ZodString>;
3263
+ description: z.ZodOptional<z.ZodString>;
3264
+ groq: z.ZodString;
3265
+ params: z.ZodOptional<
3266
+ z.ZodArray<
3267
+ z.ZodObject<
3268
+ {
3269
+ id: z.ZodString;
3270
+ title: z.ZodOptional<z.ZodString>;
3271
+ description: z.ZodOptional<z.ZodString>;
3272
+ type: z.ZodEnum<{
3273
+ string: "string";
3274
+ number: "number";
3275
+ boolean: "boolean";
3276
+ "string[]": "string[]";
3277
+ reference: "reference";
3278
+ }>;
3279
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
3280
+ },
3281
+ z.core.$strict
3282
+ >
3283
+ >
3284
+ >;
3285
+ },
3286
+ z.core.$strict
3287
+ >
3288
+ >
3289
+ >;
3290
+ },
3291
+ z.core.$strict
3292
+ >;
3293
+
3294
+ export {};