@sanity/workflow-engine 0.7.0 → 0.9.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.ts CHANGED
@@ -1955,7 +1955,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1955
1955
  [
1956
1956
  v.StrictObjectSchema<
1957
1957
  {
1958
- readonly type: v.PicklistSchema<
1958
+ type: v.PicklistSchema<
1959
1959
  readonly [
1960
1960
  "doc.ref",
1961
1961
  "doc.refs",
@@ -1973,21 +1973,65 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1973
1973
  ],
1974
1974
  `Invalid option: expected one of ${string}`
1975
1975
  >;
1976
- readonly name: v.SchemaWithPipe<
1976
+ name: v.SchemaWithPipe<
1977
1977
  readonly [
1978
1978
  v.StringSchema<undefined>,
1979
1979
  v.RegexAction<string, string>,
1980
1980
  ]
1981
1981
  >;
1982
- readonly title: v.OptionalSchema<
1982
+ title: v.OptionalSchema<
1983
1983
  v.StringSchema<undefined>,
1984
1984
  undefined
1985
1985
  >;
1986
- readonly description: v.OptionalSchema<
1986
+ description: v.OptionalSchema<
1987
1987
  v.StringSchema<undefined>,
1988
1988
  undefined
1989
1989
  >;
1990
- readonly source: v.GenericSchema<SourceInternal>;
1990
+ /**
1991
+ * When true, the caller MUST supply this entry at start (via
1992
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
1993
+ * missing required entry throws rather than silently defaulting to
1994
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
1995
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
1996
+ */
1997
+ required: v.OptionalSchema<
1998
+ v.BooleanSchema<undefined>,
1999
+ undefined
2000
+ >;
2001
+ source: v.GenericSchema<SourceInternal>;
2002
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2003
+ editable: v.OptionalSchema<
2004
+ v.UnionSchema<
2005
+ [
2006
+ v.LiteralSchema<true, undefined>,
2007
+ v.ArraySchema<
2008
+ v.SchemaWithPipe<
2009
+ readonly [
2010
+ v.StringSchema<undefined>,
2011
+ v.MinLengthAction<
2012
+ string,
2013
+ 1,
2014
+ "must be a non-empty string"
2015
+ >,
2016
+ ]
2017
+ >,
2018
+ undefined
2019
+ >,
2020
+ v.SchemaWithPipe<
2021
+ readonly [
2022
+ v.StringSchema<undefined>,
2023
+ v.MinLengthAction<
2024
+ string,
2025
+ 1,
2026
+ "must be a non-empty string"
2027
+ >,
2028
+ ]
2029
+ >,
2030
+ ],
2031
+ undefined
2032
+ >,
2033
+ undefined
2034
+ >;
1991
2035
  },
1992
2036
  undefined
1993
2037
  >,
@@ -2504,7 +2548,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2504
2548
  [
2505
2549
  v.StrictObjectSchema<
2506
2550
  {
2507
- readonly type: v.PicklistSchema<
2551
+ type: v.PicklistSchema<
2508
2552
  readonly [
2509
2553
  "doc.ref",
2510
2554
  "doc.refs",
@@ -2522,21 +2566,62 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2522
2566
  ],
2523
2567
  `Invalid option: expected one of ${string}`
2524
2568
  >;
2525
- readonly name: v.SchemaWithPipe<
2569
+ name: v.SchemaWithPipe<
2526
2570
  readonly [
2527
2571
  v.StringSchema<undefined>,
2528
2572
  v.RegexAction<string, string>,
2529
2573
  ]
2530
2574
  >;
2531
- readonly title: v.OptionalSchema<
2575
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2576
+ description: v.OptionalSchema<
2532
2577
  v.StringSchema<undefined>,
2533
2578
  undefined
2534
2579
  >;
2535
- readonly description: v.OptionalSchema<
2536
- v.StringSchema<undefined>,
2580
+ /**
2581
+ * When true, the caller MUST supply this entry at start (via
2582
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
2583
+ * missing required entry throws rather than silently defaulting to
2584
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
2585
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2586
+ */
2587
+ required: v.OptionalSchema<
2588
+ v.BooleanSchema<undefined>,
2589
+ undefined
2590
+ >;
2591
+ source: v.GenericSchema<SourceInternal>;
2592
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2593
+ editable: v.OptionalSchema<
2594
+ v.UnionSchema<
2595
+ [
2596
+ v.LiteralSchema<true, undefined>,
2597
+ v.ArraySchema<
2598
+ v.SchemaWithPipe<
2599
+ readonly [
2600
+ v.StringSchema<undefined>,
2601
+ v.MinLengthAction<
2602
+ string,
2603
+ 1,
2604
+ "must be a non-empty string"
2605
+ >,
2606
+ ]
2607
+ >,
2608
+ undefined
2609
+ >,
2610
+ v.SchemaWithPipe<
2611
+ readonly [
2612
+ v.StringSchema<undefined>,
2613
+ v.MinLengthAction<
2614
+ string,
2615
+ 1,
2616
+ "must be a non-empty string"
2617
+ >,
2618
+ ]
2619
+ >,
2620
+ ],
2621
+ undefined
2622
+ >,
2537
2623
  undefined
2538
2624
  >;
2539
- readonly source: v.GenericSchema<SourceInternal>;
2540
2625
  },
2541
2626
  undefined
2542
2627
  >,
@@ -2567,6 +2652,43 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2567
2652
  >,
2568
2653
  undefined
2569
2654
  >;
2655
+ /**
2656
+ * Tighten-only editability overrides for the time this stage holds, keyed
2657
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
2658
+ * stage value is ANDed with it at runtime, so an override can only NARROW
2659
+ * (never open a slot the baseline left closed). An unlisted slot inherits
2660
+ * its baseline.
2661
+ */
2662
+ editable: v.OptionalSchema<
2663
+ v.RecordSchema<
2664
+ v.SchemaWithPipe<
2665
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2666
+ >,
2667
+ v.UnionSchema<
2668
+ [
2669
+ v.LiteralSchema<true, undefined>,
2670
+ v.ArraySchema<
2671
+ v.SchemaWithPipe<
2672
+ readonly [
2673
+ v.StringSchema<undefined>,
2674
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2675
+ ]
2676
+ >,
2677
+ undefined
2678
+ >,
2679
+ v.SchemaWithPipe<
2680
+ readonly [
2681
+ v.StringSchema<undefined>,
2682
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2683
+ ]
2684
+ >,
2685
+ ],
2686
+ undefined
2687
+ >,
2688
+ undefined
2689
+ >,
2690
+ undefined
2691
+ >;
2570
2692
  },
2571
2693
  undefined
2572
2694
  >;
@@ -2579,7 +2701,7 @@ declare const AuthoringStateEntrySchema: v.UnionSchema<
2579
2701
  [
2580
2702
  v.StrictObjectSchema<
2581
2703
  {
2582
- readonly type: v.PicklistSchema<
2704
+ type: v.PicklistSchema<
2583
2705
  readonly [
2584
2706
  "doc.ref",
2585
2707
  "doc.refs",
@@ -2597,15 +2719,45 @@ declare const AuthoringStateEntrySchema: v.UnionSchema<
2597
2719
  ],
2598
2720
  `Invalid option: expected one of ${string}`
2599
2721
  >;
2600
- readonly name: v.SchemaWithPipe<
2722
+ name: v.SchemaWithPipe<
2601
2723
  readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2602
2724
  >;
2603
- readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2604
- readonly description: v.OptionalSchema<
2605
- v.StringSchema<undefined>,
2725
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2726
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2727
+ /**
2728
+ * When true, the caller MUST supply this entry at start (via
2729
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
2730
+ * missing required entry throws rather than silently defaulting to
2731
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
2732
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2733
+ */
2734
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2735
+ source: v.GenericSchema<SourceInternal>;
2736
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2737
+ editable: v.OptionalSchema<
2738
+ v.UnionSchema<
2739
+ [
2740
+ v.LiteralSchema<true, undefined>,
2741
+ v.ArraySchema<
2742
+ v.SchemaWithPipe<
2743
+ readonly [
2744
+ v.StringSchema<undefined>,
2745
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2746
+ ]
2747
+ >,
2748
+ undefined
2749
+ >,
2750
+ v.SchemaWithPipe<
2751
+ readonly [
2752
+ v.StringSchema<undefined>,
2753
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2754
+ ]
2755
+ >,
2756
+ ],
2757
+ undefined
2758
+ >,
2606
2759
  undefined
2607
2760
  >;
2608
- readonly source: v.GenericSchema<SourceInternal>;
2609
2761
  },
2610
2762
  undefined
2611
2763
  >,
@@ -3717,7 +3869,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3717
3869
  [
3718
3870
  v.StrictObjectSchema<
3719
3871
  {
3720
- readonly type: v.PicklistSchema<
3872
+ type: v.PicklistSchema<
3721
3873
  readonly [
3722
3874
  "doc.ref",
3723
3875
  "doc.refs",
@@ -3735,21 +3887,62 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3735
3887
  ],
3736
3888
  `Invalid option: expected one of ${string}`
3737
3889
  >;
3738
- readonly name: v.SchemaWithPipe<
3890
+ name: v.SchemaWithPipe<
3739
3891
  readonly [
3740
3892
  v.StringSchema<undefined>,
3741
3893
  v.RegexAction<string, string>,
3742
3894
  ]
3743
3895
  >;
3744
- readonly title: v.OptionalSchema<
3896
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3897
+ description: v.OptionalSchema<
3745
3898
  v.StringSchema<undefined>,
3746
3899
  undefined
3747
3900
  >;
3748
- readonly description: v.OptionalSchema<
3749
- v.StringSchema<undefined>,
3901
+ /**
3902
+ * When true, the caller MUST supply this entry at start (via
3903
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
3904
+ * missing required entry throws rather than silently defaulting to
3905
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
3906
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
3907
+ */
3908
+ required: v.OptionalSchema<
3909
+ v.BooleanSchema<undefined>,
3910
+ undefined
3911
+ >;
3912
+ source: v.GenericSchema<SourceInternal>;
3913
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
3914
+ editable: v.OptionalSchema<
3915
+ v.UnionSchema<
3916
+ [
3917
+ v.LiteralSchema<true, undefined>,
3918
+ v.ArraySchema<
3919
+ v.SchemaWithPipe<
3920
+ readonly [
3921
+ v.StringSchema<undefined>,
3922
+ v.MinLengthAction<
3923
+ string,
3924
+ 1,
3925
+ "must be a non-empty string"
3926
+ >,
3927
+ ]
3928
+ >,
3929
+ undefined
3930
+ >,
3931
+ v.SchemaWithPipe<
3932
+ readonly [
3933
+ v.StringSchema<undefined>,
3934
+ v.MinLengthAction<
3935
+ string,
3936
+ 1,
3937
+ "must be a non-empty string"
3938
+ >,
3939
+ ]
3940
+ >,
3941
+ ],
3942
+ undefined
3943
+ >,
3750
3944
  undefined
3751
3945
  >;
3752
- readonly source: v.GenericSchema<SourceInternal>;
3753
3946
  },
3754
3947
  undefined
3755
3948
  >,
@@ -4111,6 +4304,22 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4111
4304
  ]
4112
4305
  >;
4113
4306
  description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4307
+ /**
4308
+ * Whether a human may start this workflow standalone. `'child'` marks a
4309
+ * spawn-only definition — instantiated by a parent via `task.subworkflows`,
4310
+ * never started cold from a picker. Omitted ⇒ `'workflow'` (startable).
4311
+ * Advisory: consumers filter their start pickers on it (see
4312
+ * {@link isStartableDefinition}); the engine does NOT refuse a
4313
+ * `startInstance` on a `'child'` def — load-bearing `required` state is the
4314
+ * runtime backstop.
4315
+ */
4316
+ role: v.OptionalSchema<
4317
+ v.PicklistSchema<
4318
+ readonly ["workflow", "child"],
4319
+ `Invalid option: expected one of ${string}`
4320
+ >,
4321
+ undefined
4322
+ >;
4114
4323
  /** Reference field: named for the target, holds the stage's `name`. */
4115
4324
  initialStage: v.SchemaWithPipe<
4116
4325
  readonly [
@@ -4125,7 +4334,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4125
4334
  [
4126
4335
  v.StrictObjectSchema<
4127
4336
  {
4128
- readonly type: v.PicklistSchema<
4337
+ type: v.PicklistSchema<
4129
4338
  readonly [
4130
4339
  "doc.ref",
4131
4340
  "doc.refs",
@@ -4143,21 +4352,62 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4143
4352
  ],
4144
4353
  `Invalid option: expected one of ${string}`
4145
4354
  >;
4146
- readonly name: v.SchemaWithPipe<
4355
+ name: v.SchemaWithPipe<
4147
4356
  readonly [
4148
4357
  v.StringSchema<undefined>,
4149
4358
  v.RegexAction<string, string>,
4150
4359
  ]
4151
4360
  >;
4152
- readonly title: v.OptionalSchema<
4361
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4362
+ description: v.OptionalSchema<
4153
4363
  v.StringSchema<undefined>,
4154
4364
  undefined
4155
4365
  >;
4156
- readonly description: v.OptionalSchema<
4157
- v.StringSchema<undefined>,
4366
+ /**
4367
+ * When true, the caller MUST supply this entry at start (via
4368
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
4369
+ * missing required entry throws rather than silently defaulting to
4370
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
4371
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
4372
+ */
4373
+ required: v.OptionalSchema<
4374
+ v.BooleanSchema<undefined>,
4375
+ undefined
4376
+ >;
4377
+ source: v.GenericSchema<SourceInternal>;
4378
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
4379
+ editable: v.OptionalSchema<
4380
+ v.UnionSchema<
4381
+ [
4382
+ v.LiteralSchema<true, undefined>,
4383
+ v.ArraySchema<
4384
+ v.SchemaWithPipe<
4385
+ readonly [
4386
+ v.StringSchema<undefined>,
4387
+ v.MinLengthAction<
4388
+ string,
4389
+ 1,
4390
+ "must be a non-empty string"
4391
+ >,
4392
+ ]
4393
+ >,
4394
+ undefined
4395
+ >,
4396
+ v.SchemaWithPipe<
4397
+ readonly [
4398
+ v.StringSchema<undefined>,
4399
+ v.MinLengthAction<
4400
+ string,
4401
+ 1,
4402
+ "must be a non-empty string"
4403
+ >,
4404
+ ]
4405
+ >,
4406
+ ],
4407
+ undefined
4408
+ >,
4158
4409
  undefined
4159
4410
  >;
4160
- readonly source: v.GenericSchema<SourceInternal>;
4161
4411
  },
4162
4412
  undefined
4163
4413
  >,
@@ -5453,7 +5703,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5453
5703
  [
5454
5704
  v.StrictObjectSchema<
5455
5705
  {
5456
- readonly type: v.PicklistSchema<
5706
+ type: v.PicklistSchema<
5457
5707
  readonly [
5458
5708
  "doc.ref",
5459
5709
  "doc.refs",
@@ -5471,21 +5721,65 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5471
5721
  ],
5472
5722
  `Invalid option: expected one of ${string}`
5473
5723
  >;
5474
- readonly name: v.SchemaWithPipe<
5724
+ name: v.SchemaWithPipe<
5475
5725
  readonly [
5476
5726
  v.StringSchema<undefined>,
5477
5727
  v.RegexAction<string, string>,
5478
5728
  ]
5479
5729
  >;
5480
- readonly title: v.OptionalSchema<
5730
+ title: v.OptionalSchema<
5481
5731
  v.StringSchema<undefined>,
5482
5732
  undefined
5483
5733
  >;
5484
- readonly description: v.OptionalSchema<
5734
+ description: v.OptionalSchema<
5485
5735
  v.StringSchema<undefined>,
5486
5736
  undefined
5487
5737
  >;
5488
- readonly source: v.GenericSchema<SourceInternal>;
5738
+ /**
5739
+ * When true, the caller MUST supply this entry at start (via
5740
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
5741
+ * missing required entry throws rather than silently defaulting to
5742
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
5743
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
5744
+ */
5745
+ required: v.OptionalSchema<
5746
+ v.BooleanSchema<undefined>,
5747
+ undefined
5748
+ >;
5749
+ source: v.GenericSchema<SourceInternal>;
5750
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
5751
+ editable: v.OptionalSchema<
5752
+ v.UnionSchema<
5753
+ [
5754
+ v.LiteralSchema<true, undefined>,
5755
+ v.ArraySchema<
5756
+ v.SchemaWithPipe<
5757
+ readonly [
5758
+ v.StringSchema<undefined>,
5759
+ v.MinLengthAction<
5760
+ string,
5761
+ 1,
5762
+ "must be a non-empty string"
5763
+ >,
5764
+ ]
5765
+ >,
5766
+ undefined
5767
+ >,
5768
+ v.SchemaWithPipe<
5769
+ readonly [
5770
+ v.StringSchema<undefined>,
5771
+ v.MinLengthAction<
5772
+ string,
5773
+ 1,
5774
+ "must be a non-empty string"
5775
+ >,
5776
+ ]
5777
+ >,
5778
+ ],
5779
+ undefined
5780
+ >,
5781
+ undefined
5782
+ >;
5489
5783
  },
5490
5784
  undefined
5491
5785
  >,
@@ -6065,7 +6359,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6065
6359
  [
6066
6360
  v.StrictObjectSchema<
6067
6361
  {
6068
- readonly type: v.PicklistSchema<
6362
+ type: v.PicklistSchema<
6069
6363
  readonly [
6070
6364
  "doc.ref",
6071
6365
  "doc.refs",
@@ -6083,21 +6377,65 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6083
6377
  ],
6084
6378
  `Invalid option: expected one of ${string}`
6085
6379
  >;
6086
- readonly name: v.SchemaWithPipe<
6380
+ name: v.SchemaWithPipe<
6087
6381
  readonly [
6088
6382
  v.StringSchema<undefined>,
6089
6383
  v.RegexAction<string, string>,
6090
6384
  ]
6091
6385
  >;
6092
- readonly title: v.OptionalSchema<
6386
+ title: v.OptionalSchema<
6093
6387
  v.StringSchema<undefined>,
6094
6388
  undefined
6095
6389
  >;
6096
- readonly description: v.OptionalSchema<
6390
+ description: v.OptionalSchema<
6097
6391
  v.StringSchema<undefined>,
6098
6392
  undefined
6099
6393
  >;
6100
- readonly source: v.GenericSchema<SourceInternal>;
6394
+ /**
6395
+ * When true, the caller MUST supply this entry at start (via
6396
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
6397
+ * missing required entry throws rather than silently defaulting to
6398
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
6399
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
6400
+ */
6401
+ required: v.OptionalSchema<
6402
+ v.BooleanSchema<undefined>,
6403
+ undefined
6404
+ >;
6405
+ source: v.GenericSchema<SourceInternal>;
6406
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
6407
+ editable: v.OptionalSchema<
6408
+ v.UnionSchema<
6409
+ [
6410
+ v.LiteralSchema<true, undefined>,
6411
+ v.ArraySchema<
6412
+ v.SchemaWithPipe<
6413
+ readonly [
6414
+ v.StringSchema<undefined>,
6415
+ v.MinLengthAction<
6416
+ string,
6417
+ 1,
6418
+ "must be a non-empty string"
6419
+ >,
6420
+ ]
6421
+ >,
6422
+ undefined
6423
+ >,
6424
+ v.SchemaWithPipe<
6425
+ readonly [
6426
+ v.StringSchema<undefined>,
6427
+ v.MinLengthAction<
6428
+ string,
6429
+ 1,
6430
+ "must be a non-empty string"
6431
+ >,
6432
+ ]
6433
+ >,
6434
+ ],
6435
+ undefined
6436
+ >,
6437
+ undefined
6438
+ >;
6101
6439
  },
6102
6440
  undefined
6103
6441
  >,
@@ -6128,6 +6466,54 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6128
6466
  >,
6129
6467
  undefined
6130
6468
  >;
6469
+ /**
6470
+ * Tighten-only editability overrides for the time this stage holds, keyed
6471
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
6472
+ * stage value is ANDed with it at runtime, so an override can only NARROW
6473
+ * (never open a slot the baseline left closed). An unlisted slot inherits
6474
+ * its baseline.
6475
+ */
6476
+ editable: v.OptionalSchema<
6477
+ v.RecordSchema<
6478
+ v.SchemaWithPipe<
6479
+ readonly [
6480
+ v.StringSchema<undefined>,
6481
+ v.RegexAction<string, string>,
6482
+ ]
6483
+ >,
6484
+ v.UnionSchema<
6485
+ [
6486
+ v.LiteralSchema<true, undefined>,
6487
+ v.ArraySchema<
6488
+ v.SchemaWithPipe<
6489
+ readonly [
6490
+ v.StringSchema<undefined>,
6491
+ v.MinLengthAction<
6492
+ string,
6493
+ 1,
6494
+ "must be a non-empty string"
6495
+ >,
6496
+ ]
6497
+ >,
6498
+ undefined
6499
+ >,
6500
+ v.SchemaWithPipe<
6501
+ readonly [
6502
+ v.StringSchema<undefined>,
6503
+ v.MinLengthAction<
6504
+ string,
6505
+ 1,
6506
+ "must be a non-empty string"
6507
+ >,
6508
+ ]
6509
+ >,
6510
+ ],
6511
+ undefined
6512
+ >,
6513
+ undefined
6514
+ >,
6515
+ undefined
6516
+ >;
6131
6517
  },
6132
6518
  undefined
6133
6519
  >,
@@ -6468,7 +6854,9 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6468
6854
  name: string;
6469
6855
  title?: string | undefined;
6470
6856
  description?: string | undefined;
6857
+ required?: boolean | undefined;
6471
6858
  source: SourceInternal;
6859
+ editable?: string | true | string[] | undefined;
6472
6860
  }
6473
6861
  | {
6474
6862
  type: "claim";
@@ -6609,7 +6997,9 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6609
6997
  name: string;
6610
6998
  title?: string | undefined;
6611
6999
  description?: string | undefined;
7000
+ required?: boolean | undefined;
6612
7001
  source: SourceInternal;
7002
+ editable?: string | true | string[] | undefined;
6613
7003
  }
6614
7004
  | {
6615
7005
  type: "claim";
@@ -6619,6 +7009,11 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6619
7009
  }
6620
7010
  )[]
6621
7011
  | undefined;
7012
+ editable?:
7013
+ | {
7014
+ [x: string]: string | true | string[];
7015
+ }
7016
+ | undefined;
6622
7017
  }[],
6623
7018
  1,
6624
7019
  "must declare at least one stage"
@@ -6645,6 +7040,37 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6645
7040
  >,
6646
7041
  undefined
6647
7042
  >;
7043
+ /** Role aliasing for this definition — see {@link RoleAliasesSchema}. */
7044
+ roleAliases: v.OptionalSchema<
7045
+ v.RecordSchema<
7046
+ v.SchemaWithPipe<
7047
+ readonly [
7048
+ v.StringSchema<undefined>,
7049
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
7050
+ ]
7051
+ >,
7052
+ v.SchemaWithPipe<
7053
+ readonly [
7054
+ v.ArraySchema<
7055
+ v.SchemaWithPipe<
7056
+ readonly [
7057
+ v.StringSchema<undefined>,
7058
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
7059
+ ]
7060
+ >,
7061
+ undefined
7062
+ >,
7063
+ v.MinLengthAction<
7064
+ string[],
7065
+ 1,
7066
+ "a role alias must list at least one fulfilling role"
7067
+ >,
7068
+ ]
7069
+ >,
7070
+ undefined
7071
+ >,
7072
+ undefined
7073
+ >;
6648
7074
  },
6649
7075
  undefined
6650
7076
  >;
@@ -6973,6 +7399,22 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
6973
7399
  ]
6974
7400
  >;
6975
7401
  description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7402
+ /**
7403
+ * Whether a human may start this workflow standalone. `'child'` marks a
7404
+ * spawn-only definition — instantiated by a parent via `task.subworkflows`,
7405
+ * never started cold from a picker. Omitted ⇒ `'workflow'` (startable).
7406
+ * Advisory: consumers filter their start pickers on it (see
7407
+ * {@link isStartableDefinition}); the engine does NOT refuse a
7408
+ * `startInstance` on a `'child'` def — load-bearing `required` state is the
7409
+ * runtime backstop.
7410
+ */
7411
+ role: v.OptionalSchema<
7412
+ v.PicklistSchema<
7413
+ readonly ["workflow", "child"],
7414
+ `Invalid option: expected one of ${string}`
7415
+ >,
7416
+ undefined
7417
+ >;
6976
7418
  /** Reference field: named for the target, holds the stage's `name`. */
6977
7419
  initialStage: v.SchemaWithPipe<
6978
7420
  readonly [
@@ -6985,7 +7427,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
6985
7427
  v.ArraySchema<
6986
7428
  v.StrictObjectSchema<
6987
7429
  {
6988
- readonly type: v.PicklistSchema<
7430
+ type: v.PicklistSchema<
6989
7431
  readonly [
6990
7432
  "doc.ref",
6991
7433
  "doc.refs",
@@ -7003,21 +7445,43 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7003
7445
  ],
7004
7446
  `Invalid option: expected one of ${string}`
7005
7447
  >;
7006
- readonly name: v.SchemaWithPipe<
7448
+ name: v.SchemaWithPipe<
7007
7449
  readonly [
7008
7450
  v.StringSchema<undefined>,
7009
7451
  v.RegexAction<string, string>,
7010
7452
  ]
7011
7453
  >;
7012
- readonly title: v.OptionalSchema<
7013
- v.StringSchema<undefined>,
7014
- undefined
7015
- >;
7016
- readonly description: v.OptionalSchema<
7017
- v.StringSchema<undefined>,
7454
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7455
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7456
+ /**
7457
+ * When true, the caller MUST supply this entry at start (via
7458
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
7459
+ * missing required entry throws rather than silently defaulting to
7460
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
7461
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
7462
+ */
7463
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
7464
+ source: v.GenericSchema<SourceInternal>;
7465
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
7466
+ editable: v.OptionalSchema<
7467
+ v.UnionSchema<
7468
+ [
7469
+ v.LiteralSchema<true, undefined>,
7470
+ v.SchemaWithPipe<
7471
+ readonly [
7472
+ v.StringSchema<undefined>,
7473
+ v.MinLengthAction<
7474
+ string,
7475
+ 1,
7476
+ "must be a non-empty string"
7477
+ >,
7478
+ ]
7479
+ >,
7480
+ ],
7481
+ undefined
7482
+ >,
7018
7483
  undefined
7019
7484
  >;
7020
- readonly source: v.GenericSchema<SourceInternal>;
7021
7485
  },
7022
7486
  undefined
7023
7487
  >,
@@ -7869,7 +8333,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7869
8333
  v.ArraySchema<
7870
8334
  v.StrictObjectSchema<
7871
8335
  {
7872
- readonly type: v.PicklistSchema<
8336
+ type: v.PicklistSchema<
7873
8337
  readonly [
7874
8338
  "doc.ref",
7875
8339
  "doc.refs",
@@ -7887,21 +8351,52 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7887
8351
  ],
7888
8352
  `Invalid option: expected one of ${string}`
7889
8353
  >;
7890
- readonly name: v.SchemaWithPipe<
8354
+ name: v.SchemaWithPipe<
7891
8355
  readonly [
7892
8356
  v.StringSchema<undefined>,
7893
8357
  v.RegexAction<string, string>,
7894
8358
  ]
7895
8359
  >;
7896
- readonly title: v.OptionalSchema<
8360
+ title: v.OptionalSchema<
7897
8361
  v.StringSchema<undefined>,
7898
8362
  undefined
7899
8363
  >;
7900
- readonly description: v.OptionalSchema<
8364
+ description: v.OptionalSchema<
7901
8365
  v.StringSchema<undefined>,
7902
8366
  undefined
7903
8367
  >;
7904
- readonly source: v.GenericSchema<SourceInternal>;
8368
+ /**
8369
+ * When true, the caller MUST supply this entry at start (via
8370
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
8371
+ * missing required entry throws rather than silently defaulting to
8372
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
8373
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
8374
+ */
8375
+ required: v.OptionalSchema<
8376
+ v.BooleanSchema<undefined>,
8377
+ undefined
8378
+ >;
8379
+ source: v.GenericSchema<SourceInternal>;
8380
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
8381
+ editable: v.OptionalSchema<
8382
+ v.UnionSchema<
8383
+ [
8384
+ v.LiteralSchema<true, undefined>,
8385
+ v.SchemaWithPipe<
8386
+ readonly [
8387
+ v.StringSchema<undefined>,
8388
+ v.MinLengthAction<
8389
+ string,
8390
+ 1,
8391
+ "must be a non-empty string"
8392
+ >,
8393
+ ]
8394
+ >,
8395
+ ],
8396
+ undefined
8397
+ >,
8398
+ undefined
8399
+ >;
7905
8400
  },
7906
8401
  undefined
7907
8402
  >,
@@ -8345,7 +8840,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8345
8840
  v.ArraySchema<
8346
8841
  v.StrictObjectSchema<
8347
8842
  {
8348
- readonly type: v.PicklistSchema<
8843
+ type: v.PicklistSchema<
8349
8844
  readonly [
8350
8845
  "doc.ref",
8351
8846
  "doc.refs",
@@ -8363,21 +8858,52 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8363
8858
  ],
8364
8859
  `Invalid option: expected one of ${string}`
8365
8860
  >;
8366
- readonly name: v.SchemaWithPipe<
8861
+ name: v.SchemaWithPipe<
8367
8862
  readonly [
8368
8863
  v.StringSchema<undefined>,
8369
8864
  v.RegexAction<string, string>,
8370
8865
  ]
8371
8866
  >;
8372
- readonly title: v.OptionalSchema<
8867
+ title: v.OptionalSchema<
8373
8868
  v.StringSchema<undefined>,
8374
8869
  undefined
8375
8870
  >;
8376
- readonly description: v.OptionalSchema<
8871
+ description: v.OptionalSchema<
8377
8872
  v.StringSchema<undefined>,
8378
8873
  undefined
8379
8874
  >;
8380
- readonly source: v.GenericSchema<SourceInternal>;
8875
+ /**
8876
+ * When true, the caller MUST supply this entry at start (via
8877
+ * `initialState`) or spawn (via the parent's `subworkflows.with`). A
8878
+ * missing required entry throws rather than silently defaulting to
8879
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
8880
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
8881
+ */
8882
+ required: v.OptionalSchema<
8883
+ v.BooleanSchema<undefined>,
8884
+ undefined
8885
+ >;
8886
+ source: v.GenericSchema<SourceInternal>;
8887
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
8888
+ editable: v.OptionalSchema<
8889
+ v.UnionSchema<
8890
+ [
8891
+ v.LiteralSchema<true, undefined>,
8892
+ v.SchemaWithPipe<
8893
+ readonly [
8894
+ v.StringSchema<undefined>,
8895
+ v.MinLengthAction<
8896
+ string,
8897
+ 1,
8898
+ "must be a non-empty string"
8899
+ >,
8900
+ ]
8901
+ >,
8902
+ ],
8903
+ undefined
8904
+ >,
8905
+ undefined
8906
+ >;
8381
8907
  },
8382
8908
  undefined
8383
8909
  >,
@@ -8385,6 +8911,41 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8385
8911
  >,
8386
8912
  undefined
8387
8913
  >;
8914
+ /**
8915
+ * Tighten-only editability overrides for the time this stage holds, keyed
8916
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
8917
+ * stage value is ANDed with it at runtime, so an override can only NARROW
8918
+ * (never open a slot the baseline left closed). An unlisted slot inherits
8919
+ * its baseline.
8920
+ */
8921
+ editable: v.OptionalSchema<
8922
+ v.RecordSchema<
8923
+ v.SchemaWithPipe<
8924
+ readonly [
8925
+ v.StringSchema<undefined>,
8926
+ v.RegexAction<string, string>,
8927
+ ]
8928
+ >,
8929
+ v.UnionSchema<
8930
+ [
8931
+ v.LiteralSchema<true, undefined>,
8932
+ v.SchemaWithPipe<
8933
+ readonly [
8934
+ v.StringSchema<undefined>,
8935
+ v.MinLengthAction<
8936
+ string,
8937
+ 1,
8938
+ "must be a non-empty string"
8939
+ >,
8940
+ ]
8941
+ >,
8942
+ ],
8943
+ undefined
8944
+ >,
8945
+ undefined
8946
+ >,
8947
+ undefined
8948
+ >;
8388
8949
  },
8389
8950
  undefined
8390
8951
  >,
@@ -8615,7 +9176,9 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8615
9176
  name: string;
8616
9177
  title?: string | undefined;
8617
9178
  description?: string | undefined;
9179
+ required?: boolean | undefined;
8618
9180
  source: SourceInternal;
9181
+ editable?: string | true | undefined;
8619
9182
  }[]
8620
9183
  | undefined;
8621
9184
  }[]
@@ -8734,9 +9297,16 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8734
9297
  name: string;
8735
9298
  title?: string | undefined;
8736
9299
  description?: string | undefined;
9300
+ required?: boolean | undefined;
8737
9301
  source: SourceInternal;
9302
+ editable?: string | true | undefined;
8738
9303
  }[]
8739
9304
  | undefined;
9305
+ editable?:
9306
+ | {
9307
+ [x: string]: string | true;
9308
+ }
9309
+ | undefined;
8740
9310
  }[],
8741
9311
  1,
8742
9312
  "must declare at least one stage"
@@ -8763,6 +9333,37 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8763
9333
  >,
8764
9334
  undefined
8765
9335
  >;
9336
+ /** Role aliasing for this definition — see {@link RoleAliasesSchema}. */
9337
+ roleAliases: v.OptionalSchema<
9338
+ v.RecordSchema<
9339
+ v.SchemaWithPipe<
9340
+ readonly [
9341
+ v.StringSchema<undefined>,
9342
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
9343
+ ]
9344
+ >,
9345
+ v.SchemaWithPipe<
9346
+ readonly [
9347
+ v.ArraySchema<
9348
+ v.SchemaWithPipe<
9349
+ readonly [
9350
+ v.StringSchema<undefined>,
9351
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
9352
+ ]
9353
+ >,
9354
+ undefined
9355
+ >,
9356
+ v.MinLengthAction<
9357
+ string[],
9358
+ 1,
9359
+ "a role alias must list at least one fulfilling role"
9360
+ >,
9361
+ ]
9362
+ >,
9363
+ undefined
9364
+ >,
9365
+ undefined
9366
+ >;
8766
9367
  },
8767
9368
  undefined
8768
9369
  >;