@sanity/workflow-engine 0.19.0 → 0.21.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.
package/dist/define.d.cts CHANGED
@@ -49,7 +49,7 @@ declare const ActionParamSchema: v.SchemaWithPipe<
49
49
  "doc.refs",
50
50
  "json",
51
51
  ],
52
- `Invalid option: expected one of ${string}`
52
+ string
53
53
  >;
54
54
  readonly name: v.SchemaWithPipe<
55
55
  readonly [
@@ -178,7 +178,7 @@ declare type ActivityFields<TField, TAction, TTarget, TGroup> = {
178
178
  group?: TGroup | undefined;
179
179
  target?: TTarget | undefined;
180
180
  filter?: string | undefined;
181
- requirements?: Record<string, string> | undefined;
181
+ requirements?: GroqRequirement[] | undefined;
182
182
  actions?: TAction[] | undefined;
183
183
  fields?: TField[] | undefined;
184
184
  };
@@ -233,10 +233,7 @@ declare type AuthoringFieldRef = v.InferOutput<typeof AuthoringFieldRefSchema>;
233
233
  declare const AuthoringFieldRefSchema: v.StrictObjectSchema<
234
234
  {
235
235
  readonly scope: v.OptionalSchema<
236
- v.PicklistSchema<
237
- readonly ["workflow", "stage", "activity"],
238
- `Invalid option: expected one of ${string}`
239
- >,
236
+ v.PicklistSchema<readonly ["workflow", "stage", "activity"], string>,
240
237
  undefined
241
238
  >;
242
239
  readonly field: v.SchemaWithPipe<
@@ -402,7 +399,7 @@ declare const AuthoringGuardSchema: v.StrictObjectSchema<
402
399
  v.ArraySchema<
403
400
  v.PicklistSchema<
404
401
  readonly ["create", "update", "delete", "publish", "unpublish"],
405
- `Invalid option: expected one of ${string}`
402
+ string
406
403
  >,
407
404
  undefined
408
405
  >,
@@ -577,7 +574,7 @@ declare const AuthoringManualTargetSchema: v.VariantSchema<
577
574
  readonly scope: v.OptionalSchema<
578
575
  v.PicklistSchema<
579
576
  readonly ["workflow", "stage", "activity"],
580
- `Invalid option: expected one of ${string}`
577
+ string
581
578
  >,
582
579
  undefined
583
580
  >;
@@ -613,7 +610,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
613
610
  readonly scope: v.OptionalSchema<
614
611
  v.PicklistSchema<
615
612
  readonly ["workflow", "stage", "activity"],
616
- `Invalid option: expected one of ${string}`
613
+ string
617
614
  >,
618
615
  undefined
619
616
  >;
@@ -638,7 +635,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
638
635
  readonly scope: v.OptionalSchema<
639
636
  v.PicklistSchema<
640
637
  readonly ["workflow", "stage", "activity"],
641
- `Invalid option: expected one of ${string}`
638
+ string
642
639
  >,
643
640
  undefined
644
641
  >;
@@ -662,7 +659,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
662
659
  readonly scope: v.OptionalSchema<
663
660
  v.PicklistSchema<
664
661
  readonly ["workflow", "stage", "activity"],
665
- `Invalid option: expected one of ${string}`
662
+ string
666
663
  >,
667
664
  undefined
668
665
  >;
@@ -687,7 +684,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
687
684
  readonly scope: v.OptionalSchema<
688
685
  v.PicklistSchema<
689
686
  readonly ["workflow", "stage", "activity"],
690
- `Invalid option: expected one of ${string}`
687
+ string
691
688
  >,
692
689
  undefined
693
690
  >;
@@ -718,7 +715,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
718
715
  readonly scope: v.OptionalSchema<
719
716
  v.PicklistSchema<
720
717
  readonly ["workflow", "stage", "activity"],
721
- `Invalid option: expected one of ${string}`
718
+ string
722
719
  >,
723
720
  undefined
724
721
  >;
@@ -754,7 +751,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
754
751
  >;
755
752
  readonly status: v.PicklistSchema<
756
753
  readonly ["active", "done", "skipped", "failed"],
757
- `Invalid option: expected one of ${string}`
754
+ string
758
755
  >;
759
756
  },
760
757
  undefined
@@ -767,7 +764,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
767
764
  readonly scope: v.OptionalSchema<
768
765
  v.PicklistSchema<
769
766
  readonly ["workflow", "stage", "activity"],
770
- `Invalid option: expected one of ${string}`
767
+ string
771
768
  >,
772
769
  undefined
773
770
  >;
@@ -959,14 +956,15 @@ export declare interface ConditionVar {
959
956
  * the rest evaluate to `undefined` — and deploy rejects them at these
960
957
  * sites; a cascade-fired action's per-token gate is `roles`, never its
961
958
  * conditions.
962
- * 3. **The start contexts** — a definition's `start.filter` and
963
- * `start.allowed` evaluate against a CANDIDATE (no instance exists yet):
964
- * `*[...]` reads the WORKFLOW resource's dataset and none of the rendered
959
+ * 3. **The start contexts** — a definition's `start.filter` and start GROQ
960
+ * requirements evaluate against a CANDIDATE (no instance exists yet):
961
+ * `*[...]` reads the engine-owned `{definition, subject, completedAt}`
962
+ * projection of the tag's instances and none of the rendered
965
963
  * condition vars exist. The two split on what a surface can know:
966
964
  * `filter` is browse-time-pure (candidate document as root,
967
965
  * {@link START_FILTER_VARS} — no `$fields`, which cannot exist before
968
- * inputs do), `allowed` is the start-time permission predicate
969
- * ({@link START_ALLOWED_VARS} — `$fields` bound, never a root).
966
+ * inputs do), a `groq` requirement is the start-time readiness predicate
967
+ * ({@link START_REQUIREMENT_VARS} — `$fields` bound, never a root).
970
968
  * 4. **Guard predicates** — NOT conditions. A lake mutation guard's
971
969
  * `predicate` is groq-js **delta-mode** GROQ over a document mutation:
972
970
  * `before()`/`after()`/`identity()` are dialect natives, and the wire
@@ -992,7 +990,7 @@ export declare type ConditionVarBinding = "always" | "caller" | "spawn";
992
990
  * carry a lower floor. Raising this maximum is a declared, DATAMODEL.md-logged
993
991
  * decision that requires readers-first fleet sequencing.
994
992
  */
995
- declare const DATA_MODEL_MIN_READER = 2;
993
+ declare const DATA_MODEL_MIN_READER = 4;
996
994
 
997
995
  export declare function defineAction(action: AuthoringAction): AuthoringAction;
998
996
 
@@ -1256,6 +1254,11 @@ export declare function groq(
1256
1254
  ...values: unknown[]
1257
1255
  ): string;
1258
1256
 
1257
+ declare type GroqRequirement = RequirementBase & {
1258
+ type: "groq";
1259
+ query: string;
1260
+ };
1261
+
1259
1262
  /** Type-mirror of {@link GroupSchema} — one declared group. */
1260
1263
  declare type Group = {
1261
1264
  name: string;
@@ -1356,7 +1359,7 @@ declare const GuardSchema: v.StrictObjectSchema<
1356
1359
  v.ArraySchema<
1357
1360
  v.PicklistSchema<
1358
1361
  readonly ["create", "update", "delete", "publish", "unpublish"],
1359
- `Invalid option: expected one of ${string}`
1362
+ string
1360
1363
  >,
1361
1364
  undefined
1362
1365
  >,
@@ -1431,6 +1434,18 @@ declare type ParsedWorkflowConfig = v.InferOutput<typeof WorkflowConfigSchema>;
1431
1434
  declare type ParsedWorkflowDeployment =
1432
1435
  ParsedWorkflowConfig["deployments"][number];
1433
1436
 
1437
+ declare type RequirementBase = {
1438
+ name: string;
1439
+ title?: string | undefined;
1440
+ description?: string | undefined;
1441
+ };
1442
+
1443
+ /**
1444
+ * Names an author's predicate may not use — engine-owned and author names
1445
+ * share one namespace, so a predicate redefining a binding would silently
1446
+ * shadow engine behaviour. Rejected at deploy; derived from the condition
1447
+ * inventory.
1448
+ */
1434
1449
  export declare const RESERVED_CONDITION_VARS: readonly string[];
1435
1450
 
1436
1451
  declare type RoleAliases = v.InferOutput<typeof RoleAliasesSchema>;
@@ -1497,6 +1512,10 @@ declare interface ScalarValidation {
1497
1512
  max?: number | undefined;
1498
1513
  }
1499
1514
 
1515
+ declare type SingleSubjectRequirement = RequirementBase & {
1516
+ type: "singleSubject";
1517
+ };
1518
+
1500
1519
  declare type Stage = StageFields<
1501
1520
  FieldEntry,
1502
1521
  Activity,
@@ -1529,7 +1548,7 @@ declare type StartBlock = StartFields & {
1529
1548
  * authoring may omit it — so each variant declares it. */
1530
1549
  declare type StartFields = {
1531
1550
  filter?: string | undefined;
1532
- allowed?: string | undefined;
1551
+ requirements?: StartRequirement[] | undefined;
1533
1552
  };
1534
1553
 
1535
1554
  /**
@@ -1543,6 +1562,8 @@ declare type StartFields = {
1543
1562
  */
1544
1563
  declare type StartKind = (typeof START_KINDS)[number];
1545
1564
 
1565
+ declare type StartRequirement = GroqRequirement | SingleSubjectRequirement;
1566
+
1546
1567
  /**
1547
1568
  * Declared editability of a field — the generic edit seam's gate. Default
1548
1569
  * (absent) is NOT editable: a field is op-only engine working memory unless the
@@ -1588,7 +1609,7 @@ declare const StoredManualTargetSchema: v.VariantSchema<
1588
1609
  {
1589
1610
  readonly scope: v.PicklistSchema<
1590
1611
  readonly ["workflow", "stage", "activity"],
1591
- `Invalid option: expected one of ${string}`
1612
+ string
1592
1613
  >;
1593
1614
  readonly field: v.SchemaWithPipe<
1594
1615
  readonly [
@@ -1616,7 +1637,7 @@ declare const StoredOpSchema: v.VariantSchema<
1616
1637
  {
1617
1638
  readonly scope: v.PicklistSchema<
1618
1639
  readonly ["workflow", "stage", "activity"],
1619
- `Invalid option: expected one of ${string}`
1640
+ string
1620
1641
  >;
1621
1642
  readonly field: v.SchemaWithPipe<
1622
1643
  readonly [
@@ -1638,7 +1659,7 @@ declare const StoredOpSchema: v.VariantSchema<
1638
1659
  {
1639
1660
  readonly scope: v.PicklistSchema<
1640
1661
  readonly ["workflow", "stage", "activity"],
1641
- `Invalid option: expected one of ${string}`
1662
+ string
1642
1663
  >;
1643
1664
  readonly field: v.SchemaWithPipe<
1644
1665
  readonly [
@@ -1659,7 +1680,7 @@ declare const StoredOpSchema: v.VariantSchema<
1659
1680
  {
1660
1681
  readonly scope: v.PicklistSchema<
1661
1682
  readonly ["workflow", "stage", "activity"],
1662
- `Invalid option: expected one of ${string}`
1683
+ string
1663
1684
  >;
1664
1685
  readonly field: v.SchemaWithPipe<
1665
1686
  readonly [
@@ -1681,7 +1702,7 @@ declare const StoredOpSchema: v.VariantSchema<
1681
1702
  {
1682
1703
  readonly scope: v.PicklistSchema<
1683
1704
  readonly ["workflow", "stage", "activity"],
1684
- `Invalid option: expected one of ${string}`
1705
+ string
1685
1706
  >;
1686
1707
  readonly field: v.SchemaWithPipe<
1687
1708
  readonly [
@@ -1709,7 +1730,7 @@ declare const StoredOpSchema: v.VariantSchema<
1709
1730
  {
1710
1731
  readonly scope: v.PicklistSchema<
1711
1732
  readonly ["workflow", "stage", "activity"],
1712
- `Invalid option: expected one of ${string}`
1733
+ string
1713
1734
  >;
1714
1735
  readonly field: v.SchemaWithPipe<
1715
1736
  readonly [
@@ -1740,7 +1761,7 @@ declare const StoredOpSchema: v.VariantSchema<
1740
1761
  >;
1741
1762
  readonly status: v.PicklistSchema<
1742
1763
  readonly ["active", "done", "skipped", "failed"],
1743
- `Invalid option: expected one of ${string}`
1764
+ string
1744
1765
  >;
1745
1766
  },
1746
1767
  undefined
@@ -1847,10 +1868,7 @@ declare const SubworkflowsSchema: v.StrictObjectSchema<
1847
1868
  * `$subworkflows`) decide.
1848
1869
  */
1849
1870
  readonly onExit: v.OptionalSchema<
1850
- v.PicklistSchema<
1851
- readonly ["detach", "abort"],
1852
- `Invalid option: expected one of ${string}`
1853
- >,
1871
+ v.PicklistSchema<readonly ["detach", "abort"], string>,
1854
1872
  undefined
1855
1873
  >;
1856
1874
  },
@@ -1936,7 +1954,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
1936
1954
  ]
1937
1955
  >;
1938
1956
  readonly expectedMinReaderModel: v.OptionalSchema<
1939
- v.CustomSchema<2, undefined>,
1957
+ v.CustomSchema<4, undefined>,
1940
1958
  undefined
1941
1959
  >;
1942
1960
  readonly tag: v.SchemaWithPipe<
@@ -2223,7 +2241,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2223
2241
  v.MinLengthAction<
2224
2242
  {
2225
2243
  name: string;
2226
- expectedMinReaderModel?: 2 | undefined;
2244
+ expectedMinReaderModel?: 4 | undefined;
2227
2245
  tag: string;
2228
2246
  workflowResource:
2229
2247
  | {
@@ -2284,7 +2302,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2284
2302
  v.CheckAction<
2285
2303
  {
2286
2304
  name: string;
2287
- expectedMinReaderModel?: 2 | undefined;
2305
+ expectedMinReaderModel?: 4 | undefined;
2288
2306
  tag: string;
2289
2307
  workflowResource:
2290
2308
  | {
@@ -2343,7 +2361,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2343
2361
  issue: v.CheckIssue<
2344
2362
  {
2345
2363
  name: string;
2346
- expectedMinReaderModel?: 2 | undefined;
2364
+ expectedMinReaderModel?: 4 | undefined;
2347
2365
  tag: string;
2348
2366
  workflowResource:
2349
2367
  | {
@@ -2404,7 +2422,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2404
2422
  v.CheckAction<
2405
2423
  {
2406
2424
  name: string;
2407
- expectedMinReaderModel?: 2 | undefined;
2425
+ expectedMinReaderModel?: 4 | undefined;
2408
2426
  tag: string;
2409
2427
  workflowResource:
2410
2428
  | {
@@ -2463,7 +2481,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2463
2481
  issue: v.CheckIssue<
2464
2482
  {
2465
2483
  name: string;
2466
- expectedMinReaderModel?: 2 | undefined;
2484
+ expectedMinReaderModel?: 4 | undefined;
2467
2485
  tag: string;
2468
2486
  workflowResource:
2469
2487
  | {
package/dist/define.d.ts CHANGED
@@ -49,7 +49,7 @@ declare const ActionParamSchema: v.SchemaWithPipe<
49
49
  "doc.refs",
50
50
  "json",
51
51
  ],
52
- `Invalid option: expected one of ${string}`
52
+ string
53
53
  >;
54
54
  readonly name: v.SchemaWithPipe<
55
55
  readonly [
@@ -178,7 +178,7 @@ declare type ActivityFields<TField, TAction, TTarget, TGroup> = {
178
178
  group?: TGroup | undefined;
179
179
  target?: TTarget | undefined;
180
180
  filter?: string | undefined;
181
- requirements?: Record<string, string> | undefined;
181
+ requirements?: GroqRequirement[] | undefined;
182
182
  actions?: TAction[] | undefined;
183
183
  fields?: TField[] | undefined;
184
184
  };
@@ -233,10 +233,7 @@ declare type AuthoringFieldRef = v.InferOutput<typeof AuthoringFieldRefSchema>;
233
233
  declare const AuthoringFieldRefSchema: v.StrictObjectSchema<
234
234
  {
235
235
  readonly scope: v.OptionalSchema<
236
- v.PicklistSchema<
237
- readonly ["workflow", "stage", "activity"],
238
- `Invalid option: expected one of ${string}`
239
- >,
236
+ v.PicklistSchema<readonly ["workflow", "stage", "activity"], string>,
240
237
  undefined
241
238
  >;
242
239
  readonly field: v.SchemaWithPipe<
@@ -402,7 +399,7 @@ declare const AuthoringGuardSchema: v.StrictObjectSchema<
402
399
  v.ArraySchema<
403
400
  v.PicklistSchema<
404
401
  readonly ["create", "update", "delete", "publish", "unpublish"],
405
- `Invalid option: expected one of ${string}`
402
+ string
406
403
  >,
407
404
  undefined
408
405
  >,
@@ -577,7 +574,7 @@ declare const AuthoringManualTargetSchema: v.VariantSchema<
577
574
  readonly scope: v.OptionalSchema<
578
575
  v.PicklistSchema<
579
576
  readonly ["workflow", "stage", "activity"],
580
- `Invalid option: expected one of ${string}`
577
+ string
581
578
  >,
582
579
  undefined
583
580
  >;
@@ -613,7 +610,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
613
610
  readonly scope: v.OptionalSchema<
614
611
  v.PicklistSchema<
615
612
  readonly ["workflow", "stage", "activity"],
616
- `Invalid option: expected one of ${string}`
613
+ string
617
614
  >,
618
615
  undefined
619
616
  >;
@@ -638,7 +635,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
638
635
  readonly scope: v.OptionalSchema<
639
636
  v.PicklistSchema<
640
637
  readonly ["workflow", "stage", "activity"],
641
- `Invalid option: expected one of ${string}`
638
+ string
642
639
  >,
643
640
  undefined
644
641
  >;
@@ -662,7 +659,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
662
659
  readonly scope: v.OptionalSchema<
663
660
  v.PicklistSchema<
664
661
  readonly ["workflow", "stage", "activity"],
665
- `Invalid option: expected one of ${string}`
662
+ string
666
663
  >,
667
664
  undefined
668
665
  >;
@@ -687,7 +684,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
687
684
  readonly scope: v.OptionalSchema<
688
685
  v.PicklistSchema<
689
686
  readonly ["workflow", "stage", "activity"],
690
- `Invalid option: expected one of ${string}`
687
+ string
691
688
  >,
692
689
  undefined
693
690
  >;
@@ -718,7 +715,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
718
715
  readonly scope: v.OptionalSchema<
719
716
  v.PicklistSchema<
720
717
  readonly ["workflow", "stage", "activity"],
721
- `Invalid option: expected one of ${string}`
718
+ string
722
719
  >,
723
720
  undefined
724
721
  >;
@@ -754,7 +751,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
754
751
  >;
755
752
  readonly status: v.PicklistSchema<
756
753
  readonly ["active", "done", "skipped", "failed"],
757
- `Invalid option: expected one of ${string}`
754
+ string
758
755
  >;
759
756
  },
760
757
  undefined
@@ -767,7 +764,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
767
764
  readonly scope: v.OptionalSchema<
768
765
  v.PicklistSchema<
769
766
  readonly ["workflow", "stage", "activity"],
770
- `Invalid option: expected one of ${string}`
767
+ string
771
768
  >,
772
769
  undefined
773
770
  >;
@@ -959,14 +956,15 @@ export declare interface ConditionVar {
959
956
  * the rest evaluate to `undefined` — and deploy rejects them at these
960
957
  * sites; a cascade-fired action's per-token gate is `roles`, never its
961
958
  * conditions.
962
- * 3. **The start contexts** — a definition's `start.filter` and
963
- * `start.allowed` evaluate against a CANDIDATE (no instance exists yet):
964
- * `*[...]` reads the WORKFLOW resource's dataset and none of the rendered
959
+ * 3. **The start contexts** — a definition's `start.filter` and start GROQ
960
+ * requirements evaluate against a CANDIDATE (no instance exists yet):
961
+ * `*[...]` reads the engine-owned `{definition, subject, completedAt}`
962
+ * projection of the tag's instances and none of the rendered
965
963
  * condition vars exist. The two split on what a surface can know:
966
964
  * `filter` is browse-time-pure (candidate document as root,
967
965
  * {@link START_FILTER_VARS} — no `$fields`, which cannot exist before
968
- * inputs do), `allowed` is the start-time permission predicate
969
- * ({@link START_ALLOWED_VARS} — `$fields` bound, never a root).
966
+ * inputs do), a `groq` requirement is the start-time readiness predicate
967
+ * ({@link START_REQUIREMENT_VARS} — `$fields` bound, never a root).
970
968
  * 4. **Guard predicates** — NOT conditions. A lake mutation guard's
971
969
  * `predicate` is groq-js **delta-mode** GROQ over a document mutation:
972
970
  * `before()`/`after()`/`identity()` are dialect natives, and the wire
@@ -992,7 +990,7 @@ export declare type ConditionVarBinding = "always" | "caller" | "spawn";
992
990
  * carry a lower floor. Raising this maximum is a declared, DATAMODEL.md-logged
993
991
  * decision that requires readers-first fleet sequencing.
994
992
  */
995
- declare const DATA_MODEL_MIN_READER = 2;
993
+ declare const DATA_MODEL_MIN_READER = 4;
996
994
 
997
995
  export declare function defineAction(action: AuthoringAction): AuthoringAction;
998
996
 
@@ -1256,6 +1254,11 @@ export declare function groq(
1256
1254
  ...values: unknown[]
1257
1255
  ): string;
1258
1256
 
1257
+ declare type GroqRequirement = RequirementBase & {
1258
+ type: "groq";
1259
+ query: string;
1260
+ };
1261
+
1259
1262
  /** Type-mirror of {@link GroupSchema} — one declared group. */
1260
1263
  declare type Group = {
1261
1264
  name: string;
@@ -1356,7 +1359,7 @@ declare const GuardSchema: v.StrictObjectSchema<
1356
1359
  v.ArraySchema<
1357
1360
  v.PicklistSchema<
1358
1361
  readonly ["create", "update", "delete", "publish", "unpublish"],
1359
- `Invalid option: expected one of ${string}`
1362
+ string
1360
1363
  >,
1361
1364
  undefined
1362
1365
  >,
@@ -1431,6 +1434,18 @@ declare type ParsedWorkflowConfig = v.InferOutput<typeof WorkflowConfigSchema>;
1431
1434
  declare type ParsedWorkflowDeployment =
1432
1435
  ParsedWorkflowConfig["deployments"][number];
1433
1436
 
1437
+ declare type RequirementBase = {
1438
+ name: string;
1439
+ title?: string | undefined;
1440
+ description?: string | undefined;
1441
+ };
1442
+
1443
+ /**
1444
+ * Names an author's predicate may not use — engine-owned and author names
1445
+ * share one namespace, so a predicate redefining a binding would silently
1446
+ * shadow engine behaviour. Rejected at deploy; derived from the condition
1447
+ * inventory.
1448
+ */
1434
1449
  export declare const RESERVED_CONDITION_VARS: readonly string[];
1435
1450
 
1436
1451
  declare type RoleAliases = v.InferOutput<typeof RoleAliasesSchema>;
@@ -1497,6 +1512,10 @@ declare interface ScalarValidation {
1497
1512
  max?: number | undefined;
1498
1513
  }
1499
1514
 
1515
+ declare type SingleSubjectRequirement = RequirementBase & {
1516
+ type: "singleSubject";
1517
+ };
1518
+
1500
1519
  declare type Stage = StageFields<
1501
1520
  FieldEntry,
1502
1521
  Activity,
@@ -1529,7 +1548,7 @@ declare type StartBlock = StartFields & {
1529
1548
  * authoring may omit it — so each variant declares it. */
1530
1549
  declare type StartFields = {
1531
1550
  filter?: string | undefined;
1532
- allowed?: string | undefined;
1551
+ requirements?: StartRequirement[] | undefined;
1533
1552
  };
1534
1553
 
1535
1554
  /**
@@ -1543,6 +1562,8 @@ declare type StartFields = {
1543
1562
  */
1544
1563
  declare type StartKind = (typeof START_KINDS)[number];
1545
1564
 
1565
+ declare type StartRequirement = GroqRequirement | SingleSubjectRequirement;
1566
+
1546
1567
  /**
1547
1568
  * Declared editability of a field — the generic edit seam's gate. Default
1548
1569
  * (absent) is NOT editable: a field is op-only engine working memory unless the
@@ -1588,7 +1609,7 @@ declare const StoredManualTargetSchema: v.VariantSchema<
1588
1609
  {
1589
1610
  readonly scope: v.PicklistSchema<
1590
1611
  readonly ["workflow", "stage", "activity"],
1591
- `Invalid option: expected one of ${string}`
1612
+ string
1592
1613
  >;
1593
1614
  readonly field: v.SchemaWithPipe<
1594
1615
  readonly [
@@ -1616,7 +1637,7 @@ declare const StoredOpSchema: v.VariantSchema<
1616
1637
  {
1617
1638
  readonly scope: v.PicklistSchema<
1618
1639
  readonly ["workflow", "stage", "activity"],
1619
- `Invalid option: expected one of ${string}`
1640
+ string
1620
1641
  >;
1621
1642
  readonly field: v.SchemaWithPipe<
1622
1643
  readonly [
@@ -1638,7 +1659,7 @@ declare const StoredOpSchema: v.VariantSchema<
1638
1659
  {
1639
1660
  readonly scope: v.PicklistSchema<
1640
1661
  readonly ["workflow", "stage", "activity"],
1641
- `Invalid option: expected one of ${string}`
1662
+ string
1642
1663
  >;
1643
1664
  readonly field: v.SchemaWithPipe<
1644
1665
  readonly [
@@ -1659,7 +1680,7 @@ declare const StoredOpSchema: v.VariantSchema<
1659
1680
  {
1660
1681
  readonly scope: v.PicklistSchema<
1661
1682
  readonly ["workflow", "stage", "activity"],
1662
- `Invalid option: expected one of ${string}`
1683
+ string
1663
1684
  >;
1664
1685
  readonly field: v.SchemaWithPipe<
1665
1686
  readonly [
@@ -1681,7 +1702,7 @@ declare const StoredOpSchema: v.VariantSchema<
1681
1702
  {
1682
1703
  readonly scope: v.PicklistSchema<
1683
1704
  readonly ["workflow", "stage", "activity"],
1684
- `Invalid option: expected one of ${string}`
1705
+ string
1685
1706
  >;
1686
1707
  readonly field: v.SchemaWithPipe<
1687
1708
  readonly [
@@ -1709,7 +1730,7 @@ declare const StoredOpSchema: v.VariantSchema<
1709
1730
  {
1710
1731
  readonly scope: v.PicklistSchema<
1711
1732
  readonly ["workflow", "stage", "activity"],
1712
- `Invalid option: expected one of ${string}`
1733
+ string
1713
1734
  >;
1714
1735
  readonly field: v.SchemaWithPipe<
1715
1736
  readonly [
@@ -1740,7 +1761,7 @@ declare const StoredOpSchema: v.VariantSchema<
1740
1761
  >;
1741
1762
  readonly status: v.PicklistSchema<
1742
1763
  readonly ["active", "done", "skipped", "failed"],
1743
- `Invalid option: expected one of ${string}`
1764
+ string
1744
1765
  >;
1745
1766
  },
1746
1767
  undefined
@@ -1847,10 +1868,7 @@ declare const SubworkflowsSchema: v.StrictObjectSchema<
1847
1868
  * `$subworkflows`) decide.
1848
1869
  */
1849
1870
  readonly onExit: v.OptionalSchema<
1850
- v.PicklistSchema<
1851
- readonly ["detach", "abort"],
1852
- `Invalid option: expected one of ${string}`
1853
- >,
1871
+ v.PicklistSchema<readonly ["detach", "abort"], string>,
1854
1872
  undefined
1855
1873
  >;
1856
1874
  },
@@ -1936,7 +1954,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
1936
1954
  ]
1937
1955
  >;
1938
1956
  readonly expectedMinReaderModel: v.OptionalSchema<
1939
- v.CustomSchema<2, undefined>,
1957
+ v.CustomSchema<4, undefined>,
1940
1958
  undefined
1941
1959
  >;
1942
1960
  readonly tag: v.SchemaWithPipe<
@@ -2223,7 +2241,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2223
2241
  v.MinLengthAction<
2224
2242
  {
2225
2243
  name: string;
2226
- expectedMinReaderModel?: 2 | undefined;
2244
+ expectedMinReaderModel?: 4 | undefined;
2227
2245
  tag: string;
2228
2246
  workflowResource:
2229
2247
  | {
@@ -2284,7 +2302,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2284
2302
  v.CheckAction<
2285
2303
  {
2286
2304
  name: string;
2287
- expectedMinReaderModel?: 2 | undefined;
2305
+ expectedMinReaderModel?: 4 | undefined;
2288
2306
  tag: string;
2289
2307
  workflowResource:
2290
2308
  | {
@@ -2343,7 +2361,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2343
2361
  issue: v.CheckIssue<
2344
2362
  {
2345
2363
  name: string;
2346
- expectedMinReaderModel?: 2 | undefined;
2364
+ expectedMinReaderModel?: 4 | undefined;
2347
2365
  tag: string;
2348
2366
  workflowResource:
2349
2367
  | {
@@ -2404,7 +2422,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2404
2422
  v.CheckAction<
2405
2423
  {
2406
2424
  name: string;
2407
- expectedMinReaderModel?: 2 | undefined;
2425
+ expectedMinReaderModel?: 4 | undefined;
2408
2426
  tag: string;
2409
2427
  workflowResource:
2410
2428
  | {
@@ -2463,7 +2481,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
2463
2481
  issue: v.CheckIssue<
2464
2482
  {
2465
2483
  name: string;
2466
- expectedMinReaderModel?: 2 | undefined;
2484
+ expectedMinReaderModel?: 4 | undefined;
2467
2485
  tag: string;
2468
2486
  workflowResource:
2469
2487
  | {