@sanity/workflow-engine 0.8.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/index.d.ts CHANGED
@@ -112,10 +112,15 @@ export declare interface Actor {
112
112
  /**
113
113
  * Free-form role names — typically a copy of Sanity's `user.roles[].name`
114
114
  * for the token behind the call. The engine treats these as opaque
115
- * strings; `Action.roles` does OR-match against this list. `"*"` is the
116
- * conventional wildcard (matches any declared required role) and is used
117
- * by the bench's all-access default production code shouldn't rely on
118
- * it.
115
+ * strings, matched by literal membership: `Action.roles` and `assignees`
116
+ * roles OR-match against this list. There is no actor-side wildcard — a
117
+ * `"*"` here is just a literal string and matches nothing on its own.
118
+ *
119
+ * To let one role satisfy a gate it doesn't literally name — e.g. an
120
+ * `administrator` satisfying a narrower gate, or one deployment's role
121
+ * standing in for another's — declare the definition's `roleAliases`
122
+ * "can be fulfilled by" map; it widens the REQUIRED side, never the
123
+ * actor's roles.
119
124
  */
120
125
  roles?: string[];
121
126
  onBehalfOf?: string;
@@ -724,6 +729,38 @@ declare const AuthoringActionSchema: v.UnionSchema<
724
729
  undefined
725
730
  >;
726
731
 
732
+ export declare type AuthoringEditable = v.InferOutput<
733
+ typeof AuthoringEditableSchema
734
+ >;
735
+
736
+ /**
737
+ * Authoring editability adds the `role[]` convenience: a non-empty role list
738
+ * desugars to the same `count($actor.roles[@ in [...]]) > 0` membership
739
+ * predicate `action.roles` produces. `true` opens the slot to anyone in its
740
+ * window; a bare string is a raw predicate.
741
+ */
742
+ declare const AuthoringEditableSchema: v.UnionSchema<
743
+ [
744
+ v.LiteralSchema<true, undefined>,
745
+ v.ArraySchema<
746
+ v.SchemaWithPipe<
747
+ readonly [
748
+ v.StringSchema<undefined>,
749
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
750
+ ]
751
+ >,
752
+ undefined
753
+ >,
754
+ v.SchemaWithPipe<
755
+ readonly [
756
+ v.StringSchema<undefined>,
757
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
758
+ ]
759
+ >,
760
+ ],
761
+ undefined
762
+ >;
763
+
727
764
  export declare type AuthoringStage = v.InferOutput<typeof AuthoringStageSchema>;
728
765
 
729
766
  declare const AuthoringStageSchema: v.StrictObjectSchema<
@@ -1911,7 +1948,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1911
1948
  [
1912
1949
  v.StrictObjectSchema<
1913
1950
  {
1914
- readonly type: v.PicklistSchema<
1951
+ type: v.PicklistSchema<
1915
1952
  readonly [
1916
1953
  "doc.ref",
1917
1954
  "doc.refs",
@@ -1929,17 +1966,17 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1929
1966
  ],
1930
1967
  `Invalid option: expected one of ${string}`
1931
1968
  >;
1932
- readonly name: v.SchemaWithPipe<
1969
+ name: v.SchemaWithPipe<
1933
1970
  readonly [
1934
1971
  v.StringSchema<undefined>,
1935
1972
  v.RegexAction<string, string>,
1936
1973
  ]
1937
1974
  >;
1938
- readonly title: v.OptionalSchema<
1975
+ title: v.OptionalSchema<
1939
1976
  v.StringSchema<undefined>,
1940
1977
  undefined
1941
1978
  >;
1942
- readonly description: v.OptionalSchema<
1979
+ description: v.OptionalSchema<
1943
1980
  v.StringSchema<undefined>,
1944
1981
  undefined
1945
1982
  >;
@@ -1950,11 +1987,44 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1950
1987
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
1951
1988
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
1952
1989
  */
1953
- readonly required: v.OptionalSchema<
1990
+ required: v.OptionalSchema<
1954
1991
  v.BooleanSchema<undefined>,
1955
1992
  undefined
1956
1993
  >;
1957
- readonly source: v.GenericSchema<SourceInternal>;
1994
+ source: v.GenericSchema<SourceInternal>;
1995
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
1996
+ editable: v.OptionalSchema<
1997
+ v.UnionSchema<
1998
+ [
1999
+ v.LiteralSchema<true, undefined>,
2000
+ v.ArraySchema<
2001
+ v.SchemaWithPipe<
2002
+ readonly [
2003
+ v.StringSchema<undefined>,
2004
+ v.MinLengthAction<
2005
+ string,
2006
+ 1,
2007
+ "must be a non-empty string"
2008
+ >,
2009
+ ]
2010
+ >,
2011
+ undefined
2012
+ >,
2013
+ v.SchemaWithPipe<
2014
+ readonly [
2015
+ v.StringSchema<undefined>,
2016
+ v.MinLengthAction<
2017
+ string,
2018
+ 1,
2019
+ "must be a non-empty string"
2020
+ >,
2021
+ ]
2022
+ >,
2023
+ ],
2024
+ undefined
2025
+ >,
2026
+ undefined
2027
+ >;
1958
2028
  },
1959
2029
  undefined
1960
2030
  >,
@@ -2471,7 +2541,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2471
2541
  [
2472
2542
  v.StrictObjectSchema<
2473
2543
  {
2474
- readonly type: v.PicklistSchema<
2544
+ type: v.PicklistSchema<
2475
2545
  readonly [
2476
2546
  "doc.ref",
2477
2547
  "doc.refs",
@@ -2489,17 +2559,14 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2489
2559
  ],
2490
2560
  `Invalid option: expected one of ${string}`
2491
2561
  >;
2492
- readonly name: v.SchemaWithPipe<
2562
+ name: v.SchemaWithPipe<
2493
2563
  readonly [
2494
2564
  v.StringSchema<undefined>,
2495
2565
  v.RegexAction<string, string>,
2496
2566
  ]
2497
2567
  >;
2498
- readonly title: v.OptionalSchema<
2499
- v.StringSchema<undefined>,
2500
- undefined
2501
- >;
2502
- readonly description: v.OptionalSchema<
2568
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2569
+ description: v.OptionalSchema<
2503
2570
  v.StringSchema<undefined>,
2504
2571
  undefined
2505
2572
  >;
@@ -2510,11 +2577,44 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2510
2577
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
2511
2578
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2512
2579
  */
2513
- readonly required: v.OptionalSchema<
2580
+ required: v.OptionalSchema<
2514
2581
  v.BooleanSchema<undefined>,
2515
2582
  undefined
2516
2583
  >;
2517
- readonly source: v.GenericSchema<SourceInternal>;
2584
+ source: v.GenericSchema<SourceInternal>;
2585
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2586
+ editable: v.OptionalSchema<
2587
+ v.UnionSchema<
2588
+ [
2589
+ v.LiteralSchema<true, undefined>,
2590
+ v.ArraySchema<
2591
+ v.SchemaWithPipe<
2592
+ readonly [
2593
+ v.StringSchema<undefined>,
2594
+ v.MinLengthAction<
2595
+ string,
2596
+ 1,
2597
+ "must be a non-empty string"
2598
+ >,
2599
+ ]
2600
+ >,
2601
+ undefined
2602
+ >,
2603
+ v.SchemaWithPipe<
2604
+ readonly [
2605
+ v.StringSchema<undefined>,
2606
+ v.MinLengthAction<
2607
+ string,
2608
+ 1,
2609
+ "must be a non-empty string"
2610
+ >,
2611
+ ]
2612
+ >,
2613
+ ],
2614
+ undefined
2615
+ >,
2616
+ undefined
2617
+ >;
2518
2618
  },
2519
2619
  undefined
2520
2620
  >,
@@ -2545,6 +2645,43 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2545
2645
  >,
2546
2646
  undefined
2547
2647
  >;
2648
+ /**
2649
+ * Tighten-only editability overrides for the time this stage holds, keyed
2650
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
2651
+ * stage value is ANDed with it at runtime, so an override can only NARROW
2652
+ * (never open a slot the baseline left closed). An unlisted slot inherits
2653
+ * its baseline.
2654
+ */
2655
+ editable: v.OptionalSchema<
2656
+ v.RecordSchema<
2657
+ v.SchemaWithPipe<
2658
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2659
+ >,
2660
+ v.UnionSchema<
2661
+ [
2662
+ v.LiteralSchema<true, undefined>,
2663
+ v.ArraySchema<
2664
+ v.SchemaWithPipe<
2665
+ readonly [
2666
+ v.StringSchema<undefined>,
2667
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2668
+ ]
2669
+ >,
2670
+ undefined
2671
+ >,
2672
+ v.SchemaWithPipe<
2673
+ readonly [
2674
+ v.StringSchema<undefined>,
2675
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2676
+ ]
2677
+ >,
2678
+ ],
2679
+ undefined
2680
+ >,
2681
+ undefined
2682
+ >,
2683
+ undefined
2684
+ >;
2548
2685
  },
2549
2686
  undefined
2550
2687
  >;
@@ -2557,7 +2694,7 @@ declare const AuthoringStateEntrySchema: v.UnionSchema<
2557
2694
  [
2558
2695
  v.StrictObjectSchema<
2559
2696
  {
2560
- readonly type: v.PicklistSchema<
2697
+ type: v.PicklistSchema<
2561
2698
  readonly [
2562
2699
  "doc.ref",
2563
2700
  "doc.refs",
@@ -2575,14 +2712,11 @@ declare const AuthoringStateEntrySchema: v.UnionSchema<
2575
2712
  ],
2576
2713
  `Invalid option: expected one of ${string}`
2577
2714
  >;
2578
- readonly name: v.SchemaWithPipe<
2715
+ name: v.SchemaWithPipe<
2579
2716
  readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2580
2717
  >;
2581
- readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2582
- readonly description: v.OptionalSchema<
2583
- v.StringSchema<undefined>,
2584
- undefined
2585
- >;
2718
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2719
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2586
2720
  /**
2587
2721
  * When true, the caller MUST supply this entry at start (via
2588
2722
  * `initialState`) or spawn (via the parent's `subworkflows.with`). A
@@ -2590,11 +2724,33 @@ declare const AuthoringStateEntrySchema: v.UnionSchema<
2590
2724
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
2591
2725
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2592
2726
  */
2593
- readonly required: v.OptionalSchema<
2594
- v.BooleanSchema<undefined>,
2727
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2728
+ source: v.GenericSchema<SourceInternal>;
2729
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2730
+ editable: v.OptionalSchema<
2731
+ v.UnionSchema<
2732
+ [
2733
+ v.LiteralSchema<true, undefined>,
2734
+ v.ArraySchema<
2735
+ v.SchemaWithPipe<
2736
+ readonly [
2737
+ v.StringSchema<undefined>,
2738
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2739
+ ]
2740
+ >,
2741
+ undefined
2742
+ >,
2743
+ v.SchemaWithPipe<
2744
+ readonly [
2745
+ v.StringSchema<undefined>,
2746
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2747
+ ]
2748
+ >,
2749
+ ],
2750
+ undefined
2751
+ >,
2595
2752
  undefined
2596
2753
  >;
2597
- readonly source: v.GenericSchema<SourceInternal>;
2598
2754
  },
2599
2755
  undefined
2600
2756
  >,
@@ -3706,7 +3862,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3706
3862
  [
3707
3863
  v.StrictObjectSchema<
3708
3864
  {
3709
- readonly type: v.PicklistSchema<
3865
+ type: v.PicklistSchema<
3710
3866
  readonly [
3711
3867
  "doc.ref",
3712
3868
  "doc.refs",
@@ -3724,17 +3880,14 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3724
3880
  ],
3725
3881
  `Invalid option: expected one of ${string}`
3726
3882
  >;
3727
- readonly name: v.SchemaWithPipe<
3883
+ name: v.SchemaWithPipe<
3728
3884
  readonly [
3729
3885
  v.StringSchema<undefined>,
3730
3886
  v.RegexAction<string, string>,
3731
3887
  ]
3732
3888
  >;
3733
- readonly title: v.OptionalSchema<
3734
- v.StringSchema<undefined>,
3735
- undefined
3736
- >;
3737
- readonly description: v.OptionalSchema<
3889
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3890
+ description: v.OptionalSchema<
3738
3891
  v.StringSchema<undefined>,
3739
3892
  undefined
3740
3893
  >;
@@ -3745,11 +3898,44 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3745
3898
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
3746
3899
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
3747
3900
  */
3748
- readonly required: v.OptionalSchema<
3901
+ required: v.OptionalSchema<
3749
3902
  v.BooleanSchema<undefined>,
3750
3903
  undefined
3751
3904
  >;
3752
- readonly source: v.GenericSchema<SourceInternal>;
3905
+ source: v.GenericSchema<SourceInternal>;
3906
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
3907
+ editable: v.OptionalSchema<
3908
+ v.UnionSchema<
3909
+ [
3910
+ v.LiteralSchema<true, undefined>,
3911
+ v.ArraySchema<
3912
+ v.SchemaWithPipe<
3913
+ readonly [
3914
+ v.StringSchema<undefined>,
3915
+ v.MinLengthAction<
3916
+ string,
3917
+ 1,
3918
+ "must be a non-empty string"
3919
+ >,
3920
+ ]
3921
+ >,
3922
+ undefined
3923
+ >,
3924
+ v.SchemaWithPipe<
3925
+ readonly [
3926
+ v.StringSchema<undefined>,
3927
+ v.MinLengthAction<
3928
+ string,
3929
+ 1,
3930
+ "must be a non-empty string"
3931
+ >,
3932
+ ]
3933
+ >,
3934
+ ],
3935
+ undefined
3936
+ >,
3937
+ undefined
3938
+ >;
3753
3939
  },
3754
3940
  undefined
3755
3941
  >,
@@ -4143,7 +4329,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4143
4329
  [
4144
4330
  v.StrictObjectSchema<
4145
4331
  {
4146
- readonly type: v.PicklistSchema<
4332
+ type: v.PicklistSchema<
4147
4333
  readonly [
4148
4334
  "doc.ref",
4149
4335
  "doc.refs",
@@ -4161,17 +4347,14 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4161
4347
  ],
4162
4348
  `Invalid option: expected one of ${string}`
4163
4349
  >;
4164
- readonly name: v.SchemaWithPipe<
4350
+ name: v.SchemaWithPipe<
4165
4351
  readonly [
4166
4352
  v.StringSchema<undefined>,
4167
4353
  v.RegexAction<string, string>,
4168
4354
  ]
4169
4355
  >;
4170
- readonly title: v.OptionalSchema<
4171
- v.StringSchema<undefined>,
4172
- undefined
4173
- >;
4174
- readonly description: v.OptionalSchema<
4356
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4357
+ description: v.OptionalSchema<
4175
4358
  v.StringSchema<undefined>,
4176
4359
  undefined
4177
4360
  >;
@@ -4182,11 +4365,44 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4182
4365
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
4183
4366
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
4184
4367
  */
4185
- readonly required: v.OptionalSchema<
4368
+ required: v.OptionalSchema<
4186
4369
  v.BooleanSchema<undefined>,
4187
4370
  undefined
4188
4371
  >;
4189
- readonly source: v.GenericSchema<SourceInternal>;
4372
+ source: v.GenericSchema<SourceInternal>;
4373
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
4374
+ editable: v.OptionalSchema<
4375
+ v.UnionSchema<
4376
+ [
4377
+ v.LiteralSchema<true, undefined>,
4378
+ v.ArraySchema<
4379
+ v.SchemaWithPipe<
4380
+ readonly [
4381
+ v.StringSchema<undefined>,
4382
+ v.MinLengthAction<
4383
+ string,
4384
+ 1,
4385
+ "must be a non-empty string"
4386
+ >,
4387
+ ]
4388
+ >,
4389
+ undefined
4390
+ >,
4391
+ v.SchemaWithPipe<
4392
+ readonly [
4393
+ v.StringSchema<undefined>,
4394
+ v.MinLengthAction<
4395
+ string,
4396
+ 1,
4397
+ "must be a non-empty string"
4398
+ >,
4399
+ ]
4400
+ >,
4401
+ ],
4402
+ undefined
4403
+ >,
4404
+ undefined
4405
+ >;
4190
4406
  },
4191
4407
  undefined
4192
4408
  >,
@@ -5482,7 +5698,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5482
5698
  [
5483
5699
  v.StrictObjectSchema<
5484
5700
  {
5485
- readonly type: v.PicklistSchema<
5701
+ type: v.PicklistSchema<
5486
5702
  readonly [
5487
5703
  "doc.ref",
5488
5704
  "doc.refs",
@@ -5500,17 +5716,17 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5500
5716
  ],
5501
5717
  `Invalid option: expected one of ${string}`
5502
5718
  >;
5503
- readonly name: v.SchemaWithPipe<
5719
+ name: v.SchemaWithPipe<
5504
5720
  readonly [
5505
5721
  v.StringSchema<undefined>,
5506
5722
  v.RegexAction<string, string>,
5507
5723
  ]
5508
5724
  >;
5509
- readonly title: v.OptionalSchema<
5725
+ title: v.OptionalSchema<
5510
5726
  v.StringSchema<undefined>,
5511
5727
  undefined
5512
5728
  >;
5513
- readonly description: v.OptionalSchema<
5729
+ description: v.OptionalSchema<
5514
5730
  v.StringSchema<undefined>,
5515
5731
  undefined
5516
5732
  >;
@@ -5521,11 +5737,44 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5521
5737
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
5522
5738
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
5523
5739
  */
5524
- readonly required: v.OptionalSchema<
5740
+ required: v.OptionalSchema<
5525
5741
  v.BooleanSchema<undefined>,
5526
5742
  undefined
5527
5743
  >;
5528
- readonly source: v.GenericSchema<SourceInternal>;
5744
+ source: v.GenericSchema<SourceInternal>;
5745
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
5746
+ editable: v.OptionalSchema<
5747
+ v.UnionSchema<
5748
+ [
5749
+ v.LiteralSchema<true, undefined>,
5750
+ v.ArraySchema<
5751
+ v.SchemaWithPipe<
5752
+ readonly [
5753
+ v.StringSchema<undefined>,
5754
+ v.MinLengthAction<
5755
+ string,
5756
+ 1,
5757
+ "must be a non-empty string"
5758
+ >,
5759
+ ]
5760
+ >,
5761
+ undefined
5762
+ >,
5763
+ v.SchemaWithPipe<
5764
+ readonly [
5765
+ v.StringSchema<undefined>,
5766
+ v.MinLengthAction<
5767
+ string,
5768
+ 1,
5769
+ "must be a non-empty string"
5770
+ >,
5771
+ ]
5772
+ >,
5773
+ ],
5774
+ undefined
5775
+ >,
5776
+ undefined
5777
+ >;
5529
5778
  },
5530
5779
  undefined
5531
5780
  >,
@@ -6105,7 +6354,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6105
6354
  [
6106
6355
  v.StrictObjectSchema<
6107
6356
  {
6108
- readonly type: v.PicklistSchema<
6357
+ type: v.PicklistSchema<
6109
6358
  readonly [
6110
6359
  "doc.ref",
6111
6360
  "doc.refs",
@@ -6123,17 +6372,17 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6123
6372
  ],
6124
6373
  `Invalid option: expected one of ${string}`
6125
6374
  >;
6126
- readonly name: v.SchemaWithPipe<
6375
+ name: v.SchemaWithPipe<
6127
6376
  readonly [
6128
6377
  v.StringSchema<undefined>,
6129
6378
  v.RegexAction<string, string>,
6130
6379
  ]
6131
6380
  >;
6132
- readonly title: v.OptionalSchema<
6381
+ title: v.OptionalSchema<
6133
6382
  v.StringSchema<undefined>,
6134
6383
  undefined
6135
6384
  >;
6136
- readonly description: v.OptionalSchema<
6385
+ description: v.OptionalSchema<
6137
6386
  v.StringSchema<undefined>,
6138
6387
  undefined
6139
6388
  >;
@@ -6144,11 +6393,44 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6144
6393
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
6145
6394
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
6146
6395
  */
6147
- readonly required: v.OptionalSchema<
6396
+ required: v.OptionalSchema<
6148
6397
  v.BooleanSchema<undefined>,
6149
6398
  undefined
6150
6399
  >;
6151
- readonly source: v.GenericSchema<SourceInternal>;
6400
+ source: v.GenericSchema<SourceInternal>;
6401
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
6402
+ editable: v.OptionalSchema<
6403
+ v.UnionSchema<
6404
+ [
6405
+ v.LiteralSchema<true, undefined>,
6406
+ v.ArraySchema<
6407
+ v.SchemaWithPipe<
6408
+ readonly [
6409
+ v.StringSchema<undefined>,
6410
+ v.MinLengthAction<
6411
+ string,
6412
+ 1,
6413
+ "must be a non-empty string"
6414
+ >,
6415
+ ]
6416
+ >,
6417
+ undefined
6418
+ >,
6419
+ v.SchemaWithPipe<
6420
+ readonly [
6421
+ v.StringSchema<undefined>,
6422
+ v.MinLengthAction<
6423
+ string,
6424
+ 1,
6425
+ "must be a non-empty string"
6426
+ >,
6427
+ ]
6428
+ >,
6429
+ ],
6430
+ undefined
6431
+ >,
6432
+ undefined
6433
+ >;
6152
6434
  },
6153
6435
  undefined
6154
6436
  >,
@@ -6179,6 +6461,54 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6179
6461
  >,
6180
6462
  undefined
6181
6463
  >;
6464
+ /**
6465
+ * Tighten-only editability overrides for the time this stage holds, keyed
6466
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
6467
+ * stage value is ANDed with it at runtime, so an override can only NARROW
6468
+ * (never open a slot the baseline left closed). An unlisted slot inherits
6469
+ * its baseline.
6470
+ */
6471
+ editable: v.OptionalSchema<
6472
+ v.RecordSchema<
6473
+ v.SchemaWithPipe<
6474
+ readonly [
6475
+ v.StringSchema<undefined>,
6476
+ v.RegexAction<string, string>,
6477
+ ]
6478
+ >,
6479
+ v.UnionSchema<
6480
+ [
6481
+ v.LiteralSchema<true, undefined>,
6482
+ v.ArraySchema<
6483
+ v.SchemaWithPipe<
6484
+ readonly [
6485
+ v.StringSchema<undefined>,
6486
+ v.MinLengthAction<
6487
+ string,
6488
+ 1,
6489
+ "must be a non-empty string"
6490
+ >,
6491
+ ]
6492
+ >,
6493
+ undefined
6494
+ >,
6495
+ v.SchemaWithPipe<
6496
+ readonly [
6497
+ v.StringSchema<undefined>,
6498
+ v.MinLengthAction<
6499
+ string,
6500
+ 1,
6501
+ "must be a non-empty string"
6502
+ >,
6503
+ ]
6504
+ >,
6505
+ ],
6506
+ undefined
6507
+ >,
6508
+ undefined
6509
+ >,
6510
+ undefined
6511
+ >;
6182
6512
  },
6183
6513
  undefined
6184
6514
  >,
@@ -6521,6 +6851,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6521
6851
  description?: string | undefined;
6522
6852
  required?: boolean | undefined;
6523
6853
  source: SourceInternal;
6854
+ editable?: string | true | string[] | undefined;
6524
6855
  }
6525
6856
  | {
6526
6857
  type: "claim";
@@ -6663,6 +6994,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6663
6994
  description?: string | undefined;
6664
6995
  required?: boolean | undefined;
6665
6996
  source: SourceInternal;
6997
+ editable?: string | true | string[] | undefined;
6666
6998
  }
6667
6999
  | {
6668
7000
  type: "claim";
@@ -6672,6 +7004,11 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6672
7004
  }
6673
7005
  )[]
6674
7006
  | undefined;
7007
+ editable?:
7008
+ | {
7009
+ [x: string]: string | true | string[];
7010
+ }
7011
+ | undefined;
6675
7012
  }[],
6676
7013
  1,
6677
7014
  "must declare at least one stage"
@@ -6698,6 +7035,37 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6698
7035
  >,
6699
7036
  undefined
6700
7037
  >;
7038
+ /** Role aliasing for this definition — see {@link RoleAliasesSchema}. */
7039
+ roleAliases: v.OptionalSchema<
7040
+ v.RecordSchema<
7041
+ v.SchemaWithPipe<
7042
+ readonly [
7043
+ v.StringSchema<undefined>,
7044
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
7045
+ ]
7046
+ >,
7047
+ v.SchemaWithPipe<
7048
+ readonly [
7049
+ v.ArraySchema<
7050
+ v.SchemaWithPipe<
7051
+ readonly [
7052
+ v.StringSchema<undefined>,
7053
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
7054
+ ]
7055
+ >,
7056
+ undefined
7057
+ >,
7058
+ v.MinLengthAction<
7059
+ string[],
7060
+ 1,
7061
+ "a role alias must list at least one fulfilling role"
7062
+ >,
7063
+ ]
7064
+ >,
7065
+ undefined
7066
+ >,
7067
+ undefined
7068
+ >;
6701
7069
  },
6702
7070
  undefined
6703
7071
  >;
@@ -6846,6 +7214,30 @@ export declare function computeDiffEntries(
6846
7214
  target: DeployTarget,
6847
7215
  ): Promise<DiffEntry[]>;
6848
7216
 
7217
+ /**
7218
+ * Edit-seam twin of {@link ConcurrentFireActionError}: an `editState` commit
7219
+ * lost the optimistic-locking race on every attempt. Same contract — re-read
7220
+ * and retry, or investigate a write storm; nothing committed on the final try.
7221
+ */
7222
+ export declare class ConcurrentEditStateError extends Error {
7223
+ readonly instanceId: string;
7224
+ readonly target: {
7225
+ scope: StateScope;
7226
+ state: string;
7227
+ task?: string;
7228
+ };
7229
+ readonly attempts: number;
7230
+ constructor(args: {
7231
+ instanceId: string;
7232
+ target: {
7233
+ scope: StateScope;
7234
+ state: string;
7235
+ task?: string;
7236
+ };
7237
+ attempts: number;
7238
+ });
7239
+ }
7240
+
6849
7241
  /**
6850
7242
  * Thrown when a `fireAction` commit loses the optimistic-locking race on
6851
7243
  * all {@link CONCURRENT_FIRE_ACTION_MAX_ATTEMPTS} attempts — every reload +
@@ -7283,6 +7675,133 @@ export declare interface DrainEffectsResult {
7283
7675
  skipped: PendingEffect[];
7284
7676
  }
7285
7677
 
7678
+ export declare type Editable = v.InferOutput<typeof StoredEditableSchema>;
7679
+
7680
+ /**
7681
+ * One declared-editable slot in the current scope, projected for an actor: its
7682
+ * resolved value, whether this actor may edit it now (advisory), and the
7683
+ * provenance of the current value read off `opApplied` history. The reactive
7684
+ * surface a consumer renders as an inline field (the field widget itself is
7685
+ * out of scope here — see the slot-component work).
7686
+ */
7687
+ export declare interface EditableSlotEvaluation {
7688
+ scope: StateScope;
7689
+ /** Present iff `scope === "task"`. */
7690
+ task?: TaskName;
7691
+ name: string;
7692
+ type: StateKind;
7693
+ title?: string;
7694
+ /** Current resolved value; `undefined` until the slot is first resolved. */
7695
+ value: unknown;
7696
+ /** Whether THIS actor may edit the slot right now (window + predicate + guard). */
7697
+ editable: boolean;
7698
+ /** Present iff `editable === false`. */
7699
+ disabledReason?: EditDisabledReason;
7700
+ /** Actor who last wrote the slot (latest `opApplied`); absent if never written. */
7701
+ setBy?: Actor;
7702
+ /** When the slot was last written (ISO); absent if never written. */
7703
+ setAt?: string;
7704
+ }
7705
+
7706
+ /**
7707
+ * Why an editable slot can't be edited by this actor right now — the edit-seam
7708
+ * twin of {@link DisabledReason}. First failing gate wins: the slot must be
7709
+ * declared editable, its scope window open, no lake guard denying the instance
7710
+ * write, and the who-may-edit predicate satisfied. Reuses the shared
7711
+ * `mutation-guard-denied` shape — an edit is the same instance-doc `update` an
7712
+ * action commit performs, so the same guard pre-flight applies.
7713
+ */
7714
+ export declare type EditDisabledReason =
7715
+ | {
7716
+ kind: "not-editable";
7717
+ }
7718
+ | {
7719
+ kind: "instance-completed";
7720
+ completedAt: string;
7721
+ }
7722
+ | {
7723
+ /** The slot's scope window is closed: a task-scope slot whose task isn't
7724
+ * active, or otherwise out of its editable window. */
7725
+ kind: "edit-window-closed";
7726
+ detail: string;
7727
+ }
7728
+ | {
7729
+ /** The slot's effective `editable` predicate evaluated falsy for this
7730
+ * actor (a role/predicate miss; the stage tighten-override is folded in). */
7731
+ kind: "editor-not-permitted";
7732
+ predicate: string;
7733
+ }
7734
+ | Extract<
7735
+ DisabledReason,
7736
+ {
7737
+ kind: "mutation-guard-denied";
7738
+ }
7739
+ >;
7740
+
7741
+ /**
7742
+ * The generic edit seam (EDEX-1319). `editState` writes a declared-editable
7743
+ * slot directly — reassign, reschedule, claim-by-hand, append to a log —
7744
+ * without a bespoke action per field. It is NOT a raw patch: the edit applies
7745
+ * as a `state.*` op through the shared op path (so it stamps `opApplied`
7746
+ * provenance + history), gates on the slot's declared editability the same way
7747
+ * an action gates on its filter, then refreshes the stage's guards and lets the
7748
+ * caller cascade. Editing a value a transition reads can and should move the
7749
+ * instance — that rippling is intended.
7750
+ *
7751
+ * Gating is ONE mechanism (advisory, like every engine check): the slot's
7752
+ * effective `editable` predicate over the rendered scope. The lake ACL + guards
7753
+ * are the only hard locks.
7754
+ */
7755
+ export declare type EditMode = "set" | "append" | "unset";
7756
+
7757
+ export declare interface EditStateArgs extends OperationArgs {
7758
+ /**
7759
+ * Which declared-editable slot to write. Omit `scope` to resolve lexically
7760
+ * (a `task` implies task scope; otherwise the nearest declaring scope, stage
7761
+ * before workflow). `task` is required to address a task-scope slot.
7762
+ */
7763
+ target: EditStateTarget;
7764
+ /**
7765
+ * How to write: `set` replaces the value (reassign / reschedule), `append`
7766
+ * adds a row to an array slot (a running log / checklist), `unset` clears it.
7767
+ * Default `set`.
7768
+ */
7769
+ mode?: EditMode;
7770
+ /**
7771
+ * The new value (for `set`) or row (for `append`), as plain JSON matching the
7772
+ * slot's kind. Validated against the slot kind in the op path; omit for
7773
+ * `unset`.
7774
+ */
7775
+ value?: unknown;
7776
+ }
7777
+
7778
+ /** Edit-seam twin of {@link ActionDisabledError}: thrown by `editState` when
7779
+ * the slot can't be edited by the caller. Carries the structured reason. */
7780
+ export declare class EditStateDeniedError extends Error {
7781
+ readonly reason: EditDisabledReason;
7782
+ readonly target: {
7783
+ scope: StateScope;
7784
+ state: string;
7785
+ task?: string;
7786
+ };
7787
+ constructor(args: {
7788
+ target: {
7789
+ scope: StateScope;
7790
+ state: string;
7791
+ task?: string;
7792
+ };
7793
+ reason: EditDisabledReason;
7794
+ });
7795
+ }
7796
+
7797
+ export declare interface EditStateTarget {
7798
+ /** Omit to resolve lexically (task slot if `task` set, else stage then workflow). */
7799
+ scope?: StateScope;
7800
+ state: string;
7801
+ /** Required to address a task-scope slot. */
7802
+ task?: string;
7803
+ }
7804
+
7286
7805
  export declare type Effect = v.InferOutput<typeof EffectSchema>;
7287
7806
 
7288
7807
  /**
@@ -7468,6 +7987,9 @@ export declare interface Engine {
7468
7987
  ) => Promise<DeployDefinitionsResult>;
7469
7988
  startInstance: (args: Bound<StartInstanceArgs>) => Promise<WorkflowInstance>;
7470
7989
  fireAction: (args: Bound<FireActionArgs>) => Promise<DispatchResult>;
7990
+ /** Edit a declared-editable state slot directly (the generic edit seam):
7991
+ * reassign / reschedule / claim-by-hand / append-to-log, then cascade. */
7992
+ editState: (args: Bound<EditStateArgs>) => Promise<DispatchResult>;
7471
7993
  completeEffect: (args: Bound<CompleteEffectArgs>) => Promise<DispatchResult>;
7472
7994
  tick: (args: Bound<OperationArgs>) => Promise<DispatchResult>;
7473
7995
  evaluateInstance: (
@@ -8251,10 +8773,16 @@ export declare type HistoryEntry =
8251
8773
  _type: "opApplied";
8252
8774
  at: string;
8253
8775
  stage: StageName;
8254
- /** The boundary that ran the op exactly one of these is set. */
8776
+ /** The boundary that ran the op. For an action/transition/activation,
8777
+ * exactly one of task/action/transition is set; for a direct edit
8778
+ * (the edit seam), `edit` is set and `task` carries the slot's task when
8779
+ * the edited slot is task-scope. */
8255
8780
  task?: TaskName;
8256
8781
  action?: ActionName;
8257
8782
  transition?: string;
8783
+ /** Set when the op was a direct edit through the edit seam (`editState`),
8784
+ * not an action/transition/activation. */
8785
+ edit?: true;
8258
8786
  /** The op's `type` (e.g. `state.set`). */
8259
8787
  opType: string;
8260
8788
  /** State reference the op targeted (omitted for `status.set`). */
@@ -8340,6 +8868,13 @@ export declare interface InstanceSession {
8340
8868
  action: string;
8341
8869
  params?: Record<string, unknown>;
8342
8870
  }): Promise<DispatchResult>;
8871
+ /** Edit a declared-editable slot against the held content (the generic edit
8872
+ * seam), gated on the held projection, then cascade. */
8873
+ editState(args: {
8874
+ target: EditStateTarget;
8875
+ mode?: EditMode;
8876
+ value?: unknown;
8877
+ }): Promise<DispatchResult>;
8343
8878
  }
8344
8879
 
8345
8880
  /**
@@ -8904,6 +9439,60 @@ export declare function resourceFromParsed(parsed: ParsedGdr): WorkflowResource;
8904
9439
  */
8905
9440
  export declare function retractStageGuards(args: StageGuardArgs): Promise<void>;
8906
9441
 
9442
+ export declare type RoleAliases = v.InferOutput<typeof RoleAliasesSchema>;
9443
+
9444
+ /**
9445
+ * Role aliasing — the "can be fulfilled by" map, an authoring convenience.
9446
+ * A `roles` gate (or an `assignees` entry) names the role the author writes;
9447
+ * but the SAME capability is often carried by different role names depending
9448
+ * on how a given project deploys its Content Lake roles, and several roles may
9449
+ * legitimately do the job. Rather than enumerate every equivalent role inline
9450
+ * in each gate — or fork the definition per deployment — declare once here
9451
+ * which other roles also fulfill it.
9452
+ *
9453
+ * Each key is a role a gate/assignee names; its value lists the roles that
9454
+ * also satisfy it. The reserved key `"*"` lists roles that fulfill ANY gate
9455
+ * (e.g. `"*": ["administrator"]` — whatever this deployment's broad role is).
9456
+ *
9457
+ * Applied as an in-place expansion of the REQUIRED side, never the actor's
9458
+ * roles: the `roles` gate bakes the expanded membership into its desugared
9459
+ * GROQ at define time; `$assigned` expands the assignee's role at match time
9460
+ * (see {@link expandRequiredRoles}). Carried into the stored definition for
9461
+ * that runtime half.
9462
+ *
9463
+ * Advisory, like every engine gate — an alias only predicts what the
9464
+ * deployment's Content Lake ACLs already allow, it never grants access. An
9465
+ * alias the lake won't honor makes the gate predict "allowed" for a write the
9466
+ * lake then rejects, so keep it true to what's actually deployed.
9467
+ */
9468
+ declare const RoleAliasesSchema: v.RecordSchema<
9469
+ v.SchemaWithPipe<
9470
+ readonly [
9471
+ v.StringSchema<undefined>,
9472
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
9473
+ ]
9474
+ >,
9475
+ v.SchemaWithPipe<
9476
+ readonly [
9477
+ v.ArraySchema<
9478
+ v.SchemaWithPipe<
9479
+ readonly [
9480
+ v.StringSchema<undefined>,
9481
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
9482
+ ]
9483
+ >,
9484
+ undefined
9485
+ >,
9486
+ v.MinLengthAction<
9487
+ string[],
9488
+ 1,
9489
+ "a role alias must list at least one fulfilling role"
9490
+ >,
9491
+ ]
9492
+ >,
9493
+ undefined
9494
+ >;
9495
+
8907
9496
  export declare interface SetStageArgs extends OperationArgs {
8908
9497
  /** Stage id to force the instance into. */
8909
9498
  targetStage: string;
@@ -9145,7 +9734,7 @@ export declare type StateEntry = v.InferOutput<typeof StateEntrySchema>;
9145
9734
 
9146
9735
  declare const StateEntrySchema: v.StrictObjectSchema<
9147
9736
  {
9148
- readonly type: v.PicklistSchema<
9737
+ type: v.PicklistSchema<
9149
9738
  readonly [
9150
9739
  "doc.ref",
9151
9740
  "doc.refs",
@@ -9163,14 +9752,11 @@ declare const StateEntrySchema: v.StrictObjectSchema<
9163
9752
  ],
9164
9753
  `Invalid option: expected one of ${string}`
9165
9754
  >;
9166
- readonly name: v.SchemaWithPipe<
9167
- readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
9168
- >;
9169
- readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9170
- readonly description: v.OptionalSchema<
9171
- v.StringSchema<undefined>,
9172
- undefined
9755
+ name: v.SchemaWithPipe<
9756
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
9173
9757
  >;
9758
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9759
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9174
9760
  /**
9175
9761
  * When true, the caller MUST supply this entry at start (via
9176
9762
  * `initialState`) or spawn (via the parent's `subworkflows.with`). A
@@ -9178,8 +9764,24 @@ declare const StateEntrySchema: v.StrictObjectSchema<
9178
9764
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
9179
9765
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
9180
9766
  */
9181
- readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
9182
- readonly source: v.GenericSchema<SourceInternal>;
9767
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
9768
+ source: v.GenericSchema<SourceInternal>;
9769
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
9770
+ editable: v.OptionalSchema<
9771
+ v.UnionSchema<
9772
+ [
9773
+ v.LiteralSchema<true, undefined>,
9774
+ v.SchemaWithPipe<
9775
+ readonly [
9776
+ v.StringSchema<undefined>,
9777
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
9778
+ ]
9779
+ >,
9780
+ ],
9781
+ undefined
9782
+ >,
9783
+ undefined
9784
+ >;
9183
9785
  },
9184
9786
  undefined
9185
9787
  >;
@@ -9481,6 +10083,28 @@ declare const StoredActionSchema: v.StrictObjectSchema<
9481
10083
  undefined
9482
10084
  >;
9483
10085
 
10086
+ /**
10087
+ * Declared editability of a state slot — the generic edit seam's gate. Default
10088
+ * (absent) is NOT editable: a slot is op-only engine working memory unless the
10089
+ * modeler opens it. The stored form is `true` (editable by anyone within the
10090
+ * slot's scope window) or a GROQ predicate over the rendered scope (`$actor`,
10091
+ * `$can`, `$state`, `$assigned`), checked like an action filter to decide
10092
+ * who-may-edit. ADVISORY like every engine gate — it disables the inline field
10093
+ * and explains; real immutability needs a lake {@link Guard}.
10094
+ */
10095
+ declare const StoredEditableSchema: v.UnionSchema<
10096
+ [
10097
+ v.LiteralSchema<true, undefined>,
10098
+ v.SchemaWithPipe<
10099
+ readonly [
10100
+ v.StringSchema<undefined>,
10101
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
10102
+ ]
10103
+ >,
10104
+ ],
10105
+ undefined
10106
+ >;
10107
+
9484
10108
  declare const StoredOpSchema: v.VariantSchema<
9485
10109
  "type",
9486
10110
  [
@@ -10392,7 +11016,7 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10392
11016
  v.ArraySchema<
10393
11017
  v.StrictObjectSchema<
10394
11018
  {
10395
- readonly type: v.PicklistSchema<
11019
+ type: v.PicklistSchema<
10396
11020
  readonly [
10397
11021
  "doc.ref",
10398
11022
  "doc.refs",
@@ -10410,17 +11034,17 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10410
11034
  ],
10411
11035
  `Invalid option: expected one of ${string}`
10412
11036
  >;
10413
- readonly name: v.SchemaWithPipe<
11037
+ name: v.SchemaWithPipe<
10414
11038
  readonly [
10415
11039
  v.StringSchema<undefined>,
10416
11040
  v.RegexAction<string, string>,
10417
11041
  ]
10418
11042
  >;
10419
- readonly title: v.OptionalSchema<
11043
+ title: v.OptionalSchema<
10420
11044
  v.StringSchema<undefined>,
10421
11045
  undefined
10422
11046
  >;
10423
- readonly description: v.OptionalSchema<
11047
+ description: v.OptionalSchema<
10424
11048
  v.StringSchema<undefined>,
10425
11049
  undefined
10426
11050
  >;
@@ -10431,11 +11055,31 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10431
11055
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
10432
11056
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
10433
11057
  */
10434
- readonly required: v.OptionalSchema<
11058
+ required: v.OptionalSchema<
10435
11059
  v.BooleanSchema<undefined>,
10436
11060
  undefined
10437
11061
  >;
10438
- readonly source: v.GenericSchema<SourceInternal>;
11062
+ source: v.GenericSchema<SourceInternal>;
11063
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
11064
+ editable: v.OptionalSchema<
11065
+ v.UnionSchema<
11066
+ [
11067
+ v.LiteralSchema<true, undefined>,
11068
+ v.SchemaWithPipe<
11069
+ readonly [
11070
+ v.StringSchema<undefined>,
11071
+ v.MinLengthAction<
11072
+ string,
11073
+ 1,
11074
+ "must be a non-empty string"
11075
+ >,
11076
+ ]
11077
+ >,
11078
+ ],
11079
+ undefined
11080
+ >,
11081
+ undefined
11082
+ >;
10439
11083
  },
10440
11084
  undefined
10441
11085
  >,
@@ -10846,7 +11490,7 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10846
11490
  v.ArraySchema<
10847
11491
  v.StrictObjectSchema<
10848
11492
  {
10849
- readonly type: v.PicklistSchema<
11493
+ type: v.PicklistSchema<
10850
11494
  readonly [
10851
11495
  "doc.ref",
10852
11496
  "doc.refs",
@@ -10864,20 +11508,14 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10864
11508
  ],
10865
11509
  `Invalid option: expected one of ${string}`
10866
11510
  >;
10867
- readonly name: v.SchemaWithPipe<
11511
+ name: v.SchemaWithPipe<
10868
11512
  readonly [
10869
11513
  v.StringSchema<undefined>,
10870
11514
  v.RegexAction<string, string>,
10871
11515
  ]
10872
11516
  >;
10873
- readonly title: v.OptionalSchema<
10874
- v.StringSchema<undefined>,
10875
- undefined
10876
- >;
10877
- readonly description: v.OptionalSchema<
10878
- v.StringSchema<undefined>,
10879
- undefined
10880
- >;
11517
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
11518
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
10881
11519
  /**
10882
11520
  * When true, the caller MUST supply this entry at start (via
10883
11521
  * `initialState`) or spawn (via the parent's `subworkflows.with`). A
@@ -10885,11 +11523,28 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10885
11523
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
10886
11524
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
10887
11525
  */
10888
- readonly required: v.OptionalSchema<
10889
- v.BooleanSchema<undefined>,
11526
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
11527
+ source: v.GenericSchema<SourceInternal>;
11528
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
11529
+ editable: v.OptionalSchema<
11530
+ v.UnionSchema<
11531
+ [
11532
+ v.LiteralSchema<true, undefined>,
11533
+ v.SchemaWithPipe<
11534
+ readonly [
11535
+ v.StringSchema<undefined>,
11536
+ v.MinLengthAction<
11537
+ string,
11538
+ 1,
11539
+ "must be a non-empty string"
11540
+ >,
11541
+ ]
11542
+ >,
11543
+ ],
11544
+ undefined
11545
+ >,
10890
11546
  undefined
10891
11547
  >;
10892
- readonly source: v.GenericSchema<SourceInternal>;
10893
11548
  },
10894
11549
  undefined
10895
11550
  >,
@@ -10897,6 +11552,34 @@ declare const StoredStageSchema: v.StrictObjectSchema<
10897
11552
  >,
10898
11553
  undefined
10899
11554
  >;
11555
+ /**
11556
+ * Tighten-only editability overrides for the time this stage holds, keyed
11557
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
11558
+ * stage value is ANDed with it at runtime, so an override can only NARROW
11559
+ * (never open a slot the baseline left closed). An unlisted slot inherits
11560
+ * its baseline.
11561
+ */
11562
+ editable: v.OptionalSchema<
11563
+ v.RecordSchema<
11564
+ v.SchemaWithPipe<
11565
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
11566
+ >,
11567
+ v.UnionSchema<
11568
+ [
11569
+ v.LiteralSchema<true, undefined>,
11570
+ v.SchemaWithPipe<
11571
+ readonly [
11572
+ v.StringSchema<undefined>,
11573
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
11574
+ ]
11575
+ >,
11576
+ ],
11577
+ undefined
11578
+ >,
11579
+ undefined
11580
+ >,
11581
+ undefined
11582
+ >;
10900
11583
  },
10901
11584
  undefined
10902
11585
  >;
@@ -11611,7 +12294,7 @@ declare const StoredTaskSchema: v.StrictObjectSchema<
11611
12294
  v.ArraySchema<
11612
12295
  v.StrictObjectSchema<
11613
12296
  {
11614
- readonly type: v.PicklistSchema<
12297
+ type: v.PicklistSchema<
11615
12298
  readonly [
11616
12299
  "doc.ref",
11617
12300
  "doc.refs",
@@ -11629,20 +12312,14 @@ declare const StoredTaskSchema: v.StrictObjectSchema<
11629
12312
  ],
11630
12313
  `Invalid option: expected one of ${string}`
11631
12314
  >;
11632
- readonly name: v.SchemaWithPipe<
12315
+ name: v.SchemaWithPipe<
11633
12316
  readonly [
11634
12317
  v.StringSchema<undefined>,
11635
12318
  v.RegexAction<string, string>,
11636
12319
  ]
11637
12320
  >;
11638
- readonly title: v.OptionalSchema<
11639
- v.StringSchema<undefined>,
11640
- undefined
11641
- >;
11642
- readonly description: v.OptionalSchema<
11643
- v.StringSchema<undefined>,
11644
- undefined
11645
- >;
12321
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
12322
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
11646
12323
  /**
11647
12324
  * When true, the caller MUST supply this entry at start (via
11648
12325
  * `initialState`) or spawn (via the parent's `subworkflows.with`). A
@@ -11650,11 +12327,28 @@ declare const StoredTaskSchema: v.StrictObjectSchema<
11650
12327
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
11651
12328
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
11652
12329
  */
11653
- readonly required: v.OptionalSchema<
11654
- v.BooleanSchema<undefined>,
12330
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
12331
+ source: v.GenericSchema<SourceInternal>;
12332
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
12333
+ editable: v.OptionalSchema<
12334
+ v.UnionSchema<
12335
+ [
12336
+ v.LiteralSchema<true, undefined>,
12337
+ v.SchemaWithPipe<
12338
+ readonly [
12339
+ v.StringSchema<undefined>,
12340
+ v.MinLengthAction<
12341
+ string,
12342
+ 1,
12343
+ "must be a non-empty string"
12344
+ >,
12345
+ ]
12346
+ >,
12347
+ ],
12348
+ undefined
12349
+ >,
11655
12350
  undefined
11656
12351
  >;
11657
- readonly source: v.GenericSchema<SourceInternal>;
11658
12352
  },
11659
12353
  undefined
11660
12354
  >,
@@ -12428,6 +13122,22 @@ export declare const workflow: {
12428
13122
  * timer firings. External signals never bypass this.
12429
13123
  */
12430
13124
  fireAction: (args: Clocked<FireActionArgs>) => Promise<DispatchResult>;
13125
+ /**
13126
+ * Edit a declared-editable state slot directly — reassign, reschedule,
13127
+ * claim-by-hand, append to a running log — through the generic edit seam,
13128
+ * instead of a bespoke action per field. Soft-gates on the slot's declared
13129
+ * editability (the same projection a UI renders), applies the edit as a
13130
+ * `state.*` op (so provenance + history are stamped by the op path),
13131
+ * refreshes the stage's guards, then cascades — an edit to a value a
13132
+ * transition reads can and should move the instance. Advisory like every
13133
+ * engine gate; the lake ACL + guards are the only hard locks.
13134
+ *
13135
+ * Each call is a discrete COMMIT (a history entry, a guard refresh, a
13136
+ * cascade, an `ifRevisionId` write), not a draft patch — so an inline-field
13137
+ * UI must bind it to a deliberate boundary (blur / Enter / Save / debounce),
13138
+ * never an `onChange` per keystroke.
13139
+ */
13140
+ editState: (args: Clocked<EditStateArgs>) => Promise<DispatchResult>;
12431
13141
  /**
12432
13142
  * Report a queued effect's outcome. Drains it from `pendingEffects`,
12433
13143
  * appends an `effectHistory` entry, and (if `outputs` are supplied
@@ -12818,7 +13528,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
12818
13528
  v.ArraySchema<
12819
13529
  v.StrictObjectSchema<
12820
13530
  {
12821
- readonly type: v.PicklistSchema<
13531
+ type: v.PicklistSchema<
12822
13532
  readonly [
12823
13533
  "doc.ref",
12824
13534
  "doc.refs",
@@ -12836,20 +13546,14 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
12836
13546
  ],
12837
13547
  `Invalid option: expected one of ${string}`
12838
13548
  >;
12839
- readonly name: v.SchemaWithPipe<
13549
+ name: v.SchemaWithPipe<
12840
13550
  readonly [
12841
13551
  v.StringSchema<undefined>,
12842
13552
  v.RegexAction<string, string>,
12843
13553
  ]
12844
13554
  >;
12845
- readonly title: v.OptionalSchema<
12846
- v.StringSchema<undefined>,
12847
- undefined
12848
- >;
12849
- readonly description: v.OptionalSchema<
12850
- v.StringSchema<undefined>,
12851
- undefined
12852
- >;
13555
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
13556
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
12853
13557
  /**
12854
13558
  * When true, the caller MUST supply this entry at start (via
12855
13559
  * `initialState`) or spawn (via the parent's `subworkflows.with`). A
@@ -12857,11 +13561,28 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
12857
13561
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
12858
13562
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
12859
13563
  */
12860
- readonly required: v.OptionalSchema<
12861
- v.BooleanSchema<undefined>,
13564
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
13565
+ source: v.GenericSchema<SourceInternal>;
13566
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
13567
+ editable: v.OptionalSchema<
13568
+ v.UnionSchema<
13569
+ [
13570
+ v.LiteralSchema<true, undefined>,
13571
+ v.SchemaWithPipe<
13572
+ readonly [
13573
+ v.StringSchema<undefined>,
13574
+ v.MinLengthAction<
13575
+ string,
13576
+ 1,
13577
+ "must be a non-empty string"
13578
+ >,
13579
+ ]
13580
+ >,
13581
+ ],
13582
+ undefined
13583
+ >,
12862
13584
  undefined
12863
13585
  >;
12864
- readonly source: v.GenericSchema<SourceInternal>;
12865
13586
  },
12866
13587
  undefined
12867
13588
  >,
@@ -13713,7 +14434,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
13713
14434
  v.ArraySchema<
13714
14435
  v.StrictObjectSchema<
13715
14436
  {
13716
- readonly type: v.PicklistSchema<
14437
+ type: v.PicklistSchema<
13717
14438
  readonly [
13718
14439
  "doc.ref",
13719
14440
  "doc.refs",
@@ -13731,17 +14452,17 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
13731
14452
  ],
13732
14453
  `Invalid option: expected one of ${string}`
13733
14454
  >;
13734
- readonly name: v.SchemaWithPipe<
14455
+ name: v.SchemaWithPipe<
13735
14456
  readonly [
13736
14457
  v.StringSchema<undefined>,
13737
14458
  v.RegexAction<string, string>,
13738
14459
  ]
13739
14460
  >;
13740
- readonly title: v.OptionalSchema<
14461
+ title: v.OptionalSchema<
13741
14462
  v.StringSchema<undefined>,
13742
14463
  undefined
13743
14464
  >;
13744
- readonly description: v.OptionalSchema<
14465
+ description: v.OptionalSchema<
13745
14466
  v.StringSchema<undefined>,
13746
14467
  undefined
13747
14468
  >;
@@ -13752,11 +14473,31 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
13752
14473
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
13753
14474
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
13754
14475
  */
13755
- readonly required: v.OptionalSchema<
14476
+ required: v.OptionalSchema<
13756
14477
  v.BooleanSchema<undefined>,
13757
14478
  undefined
13758
14479
  >;
13759
- readonly source: v.GenericSchema<SourceInternal>;
14480
+ source: v.GenericSchema<SourceInternal>;
14481
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
14482
+ editable: v.OptionalSchema<
14483
+ v.UnionSchema<
14484
+ [
14485
+ v.LiteralSchema<true, undefined>,
14486
+ v.SchemaWithPipe<
14487
+ readonly [
14488
+ v.StringSchema<undefined>,
14489
+ v.MinLengthAction<
14490
+ string,
14491
+ 1,
14492
+ "must be a non-empty string"
14493
+ >,
14494
+ ]
14495
+ >,
14496
+ ],
14497
+ undefined
14498
+ >,
14499
+ undefined
14500
+ >;
13760
14501
  },
13761
14502
  undefined
13762
14503
  >,
@@ -14200,7 +14941,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14200
14941
  v.ArraySchema<
14201
14942
  v.StrictObjectSchema<
14202
14943
  {
14203
- readonly type: v.PicklistSchema<
14944
+ type: v.PicklistSchema<
14204
14945
  readonly [
14205
14946
  "doc.ref",
14206
14947
  "doc.refs",
@@ -14218,17 +14959,17 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14218
14959
  ],
14219
14960
  `Invalid option: expected one of ${string}`
14220
14961
  >;
14221
- readonly name: v.SchemaWithPipe<
14962
+ name: v.SchemaWithPipe<
14222
14963
  readonly [
14223
14964
  v.StringSchema<undefined>,
14224
14965
  v.RegexAction<string, string>,
14225
14966
  ]
14226
14967
  >;
14227
- readonly title: v.OptionalSchema<
14968
+ title: v.OptionalSchema<
14228
14969
  v.StringSchema<undefined>,
14229
14970
  undefined
14230
14971
  >;
14231
- readonly description: v.OptionalSchema<
14972
+ description: v.OptionalSchema<
14232
14973
  v.StringSchema<undefined>,
14233
14974
  undefined
14234
14975
  >;
@@ -14239,11 +14980,31 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14239
14980
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
14240
14981
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
14241
14982
  */
14242
- readonly required: v.OptionalSchema<
14983
+ required: v.OptionalSchema<
14243
14984
  v.BooleanSchema<undefined>,
14244
14985
  undefined
14245
14986
  >;
14246
- readonly source: v.GenericSchema<SourceInternal>;
14987
+ source: v.GenericSchema<SourceInternal>;
14988
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
14989
+ editable: v.OptionalSchema<
14990
+ v.UnionSchema<
14991
+ [
14992
+ v.LiteralSchema<true, undefined>,
14993
+ v.SchemaWithPipe<
14994
+ readonly [
14995
+ v.StringSchema<undefined>,
14996
+ v.MinLengthAction<
14997
+ string,
14998
+ 1,
14999
+ "must be a non-empty string"
15000
+ >,
15001
+ ]
15002
+ >,
15003
+ ],
15004
+ undefined
15005
+ >,
15006
+ undefined
15007
+ >;
14247
15008
  },
14248
15009
  undefined
14249
15010
  >,
@@ -14251,6 +15012,41 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14251
15012
  >,
14252
15013
  undefined
14253
15014
  >;
15015
+ /**
15016
+ * Tighten-only editability overrides for the time this stage holds, keyed
15017
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
15018
+ * stage value is ANDed with it at runtime, so an override can only NARROW
15019
+ * (never open a slot the baseline left closed). An unlisted slot inherits
15020
+ * its baseline.
15021
+ */
15022
+ editable: v.OptionalSchema<
15023
+ v.RecordSchema<
15024
+ v.SchemaWithPipe<
15025
+ readonly [
15026
+ v.StringSchema<undefined>,
15027
+ v.RegexAction<string, string>,
15028
+ ]
15029
+ >,
15030
+ v.UnionSchema<
15031
+ [
15032
+ v.LiteralSchema<true, undefined>,
15033
+ v.SchemaWithPipe<
15034
+ readonly [
15035
+ v.StringSchema<undefined>,
15036
+ v.MinLengthAction<
15037
+ string,
15038
+ 1,
15039
+ "must be a non-empty string"
15040
+ >,
15041
+ ]
15042
+ >,
15043
+ ],
15044
+ undefined
15045
+ >,
15046
+ undefined
15047
+ >,
15048
+ undefined
15049
+ >;
14254
15050
  },
14255
15051
  undefined
14256
15052
  >,
@@ -14483,6 +15279,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14483
15279
  description?: string | undefined;
14484
15280
  required?: boolean | undefined;
14485
15281
  source: SourceInternal;
15282
+ editable?: string | true | undefined;
14486
15283
  }[]
14487
15284
  | undefined;
14488
15285
  }[]
@@ -14603,8 +15400,14 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14603
15400
  description?: string | undefined;
14604
15401
  required?: boolean | undefined;
14605
15402
  source: SourceInternal;
15403
+ editable?: string | true | undefined;
14606
15404
  }[]
14607
15405
  | undefined;
15406
+ editable?:
15407
+ | {
15408
+ [x: string]: string | true;
15409
+ }
15410
+ | undefined;
14608
15411
  }[],
14609
15412
  1,
14610
15413
  "must declare at least one stage"
@@ -14631,6 +15434,37 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
14631
15434
  >,
14632
15435
  undefined
14633
15436
  >;
15437
+ /** Role aliasing for this definition — see {@link RoleAliasesSchema}. */
15438
+ roleAliases: v.OptionalSchema<
15439
+ v.RecordSchema<
15440
+ v.SchemaWithPipe<
15441
+ readonly [
15442
+ v.StringSchema<undefined>,
15443
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
15444
+ ]
15445
+ >,
15446
+ v.SchemaWithPipe<
15447
+ readonly [
15448
+ v.ArraySchema<
15449
+ v.SchemaWithPipe<
15450
+ readonly [
15451
+ v.StringSchema<undefined>,
15452
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
15453
+ ]
15454
+ >,
15455
+ undefined
15456
+ >,
15457
+ v.MinLengthAction<
15458
+ string[],
15459
+ 1,
15460
+ "a role alias must list at least one fulfilling role"
15461
+ >,
15462
+ ]
15463
+ >,
15464
+ undefined
15465
+ >,
15466
+ undefined
15467
+ >;
14634
15468
  },
14635
15469
  undefined
14636
15470
  >;
@@ -14644,6 +15478,13 @@ export declare interface WorkflowEvaluation {
14644
15478
  pendingOnYou: TaskEvaluation[];
14645
15479
  /** True if at least one action on any active task is allowed. */
14646
15480
  canInteract: boolean;
15481
+ /**
15482
+ * Declared-editable slots in the current scope (workflow + current stage +
15483
+ * its tasks), each with this actor's edit verdict and the current value's
15484
+ * provenance. The reactive edit-seam surface; empty when the workflow
15485
+ * declares no editable slots.
15486
+ */
15487
+ editableSlots: EditableSlotEvaluation[];
14647
15488
  }
14648
15489
 
14649
15490
  export declare interface WorkflowFetchOptions {