@sanity/workflow-engine 0.8.0 → 0.10.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
@@ -95,7 +95,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
95
95
  [
96
96
  v.StrictObjectSchema<
97
97
  {
98
- readonly type: v.LiteralSchema<"state.set", undefined>;
98
+ readonly type: v.LiteralSchema<"field.set", undefined>;
99
99
  readonly target: v.StrictObjectSchema<
100
100
  {
101
101
  readonly scope: v.OptionalSchema<
@@ -105,7 +105,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
105
105
  >,
106
106
  undefined
107
107
  >;
108
- readonly state: v.SchemaWithPipe<
108
+ readonly field: v.SchemaWithPipe<
109
109
  readonly [
110
110
  v.StringSchema<undefined>,
111
111
  v.MinLengthAction<
@@ -124,7 +124,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
124
124
  >,
125
125
  v.StrictObjectSchema<
126
126
  {
127
- readonly type: v.LiteralSchema<"state.unset", undefined>;
127
+ readonly type: v.LiteralSchema<"field.unset", undefined>;
128
128
  readonly target: v.StrictObjectSchema<
129
129
  {
130
130
  readonly scope: v.OptionalSchema<
@@ -134,7 +134,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
134
134
  >,
135
135
  undefined
136
136
  >;
137
- readonly state: v.SchemaWithPipe<
137
+ readonly field: v.SchemaWithPipe<
138
138
  readonly [
139
139
  v.StringSchema<undefined>,
140
140
  v.MinLengthAction<
@@ -152,7 +152,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
152
152
  >,
153
153
  v.StrictObjectSchema<
154
154
  {
155
- readonly type: v.LiteralSchema<"state.append", undefined>;
155
+ readonly type: v.LiteralSchema<"field.append", undefined>;
156
156
  readonly target: v.StrictObjectSchema<
157
157
  {
158
158
  readonly scope: v.OptionalSchema<
@@ -162,7 +162,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
162
162
  >,
163
163
  undefined
164
164
  >;
165
- readonly state: v.SchemaWithPipe<
165
+ readonly field: v.SchemaWithPipe<
166
166
  readonly [
167
167
  v.StringSchema<undefined>,
168
168
  v.MinLengthAction<
@@ -182,7 +182,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
182
182
  v.StrictObjectSchema<
183
183
  {
184
184
  readonly type: v.LiteralSchema<
185
- "state.updateWhere",
185
+ "field.updateWhere",
186
186
  undefined
187
187
  >;
188
188
  readonly target: v.StrictObjectSchema<
@@ -194,7 +194,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
194
194
  >,
195
195
  undefined
196
196
  >;
197
- readonly state: v.SchemaWithPipe<
197
+ readonly field: v.SchemaWithPipe<
198
198
  readonly [
199
199
  v.StringSchema<undefined>,
200
200
  v.MinLengthAction<
@@ -215,7 +215,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
215
215
  v.StrictObjectSchema<
216
216
  {
217
217
  readonly type: v.LiteralSchema<
218
- "state.removeWhere",
218
+ "field.removeWhere",
219
219
  undefined
220
220
  >;
221
221
  readonly target: v.StrictObjectSchema<
@@ -227,7 +227,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
227
227
  >,
228
228
  undefined
229
229
  >;
230
- readonly state: v.SchemaWithPipe<
230
+ readonly field: v.SchemaWithPipe<
231
231
  readonly [
232
232
  v.StringSchema<undefined>,
233
233
  v.MinLengthAction<
@@ -285,7 +285,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
285
285
  >,
286
286
  undefined
287
287
  >;
288
- readonly state: v.SchemaWithPipe<
288
+ readonly field: v.SchemaWithPipe<
289
289
  readonly [
290
290
  v.StringSchema<undefined>,
291
291
  v.MinLengthAction<
@@ -412,7 +412,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
412
412
  v.StringSchema<undefined>,
413
413
  undefined
414
414
  >;
415
- readonly state: v.UnionSchema<
415
+ readonly field: v.UnionSchema<
416
416
  [
417
417
  v.SchemaWithPipe<
418
418
  readonly [
@@ -429,7 +429,7 @@ declare const AuthoringActionSchema: v.UnionSchema<
429
429
  >,
430
430
  undefined
431
431
  >;
432
- readonly state: v.SchemaWithPipe<
432
+ readonly field: v.SchemaWithPipe<
433
433
  readonly [
434
434
  v.StringSchema<undefined>,
435
435
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -564,6 +564,92 @@ declare const AuthoringActionSchema: v.UnionSchema<
564
564
  undefined
565
565
  >;
566
566
 
567
+ declare type AuthoringFieldEntry = v.InferOutput<
568
+ typeof AuthoringFieldEntrySchema
569
+ >;
570
+
571
+ declare const AuthoringFieldEntrySchema: v.UnionSchema<
572
+ [
573
+ v.StrictObjectSchema<
574
+ {
575
+ type: v.PicklistSchema<
576
+ readonly [
577
+ "doc.ref",
578
+ "doc.refs",
579
+ "release.ref",
580
+ "query",
581
+ "value.string",
582
+ "value.url",
583
+ "value.number",
584
+ "value.boolean",
585
+ "value.dateTime",
586
+ "value.actor",
587
+ "checklist",
588
+ "notes",
589
+ "assignees",
590
+ ],
591
+ `Invalid option: expected one of ${string}`
592
+ >;
593
+ name: v.SchemaWithPipe<
594
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
595
+ >;
596
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
597
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
598
+ /**
599
+ * When true, the caller MUST supply this entry at start (via
600
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
601
+ * missing required entry throws rather than silently defaulting to
602
+ * `null`/`[]` — the same fail-fast an action's `required` param gets.
603
+ * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
604
+ */
605
+ required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
606
+ source: v.GenericSchema<SourceInternal>;
607
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
608
+ editable: v.OptionalSchema<
609
+ v.UnionSchema<
610
+ [
611
+ v.LiteralSchema<true, undefined>,
612
+ v.ArraySchema<
613
+ v.SchemaWithPipe<
614
+ readonly [
615
+ v.StringSchema<undefined>,
616
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
617
+ ]
618
+ >,
619
+ undefined
620
+ >,
621
+ v.SchemaWithPipe<
622
+ readonly [
623
+ v.StringSchema<undefined>,
624
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
625
+ ]
626
+ >,
627
+ ],
628
+ undefined
629
+ >,
630
+ undefined
631
+ >;
632
+ },
633
+ undefined
634
+ >,
635
+ v.StrictObjectSchema<
636
+ {
637
+ readonly type: v.LiteralSchema<"claim", undefined>;
638
+ readonly name: v.SchemaWithPipe<
639
+ readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
640
+ >;
641
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
642
+ readonly description: v.OptionalSchema<
643
+ v.StringSchema<undefined>,
644
+ undefined
645
+ >;
646
+ },
647
+ undefined
648
+ >,
649
+ ],
650
+ undefined
651
+ >;
652
+
567
653
  declare type AuthoringOp = v.InferOutput<typeof AuthoringOpSchema>;
568
654
 
569
655
  declare const AuthoringOpSchema: v.VariantSchema<
@@ -571,7 +657,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
571
657
  [
572
658
  v.StrictObjectSchema<
573
659
  {
574
- readonly type: v.LiteralSchema<"state.set", undefined>;
660
+ readonly type: v.LiteralSchema<"field.set", undefined>;
575
661
  readonly target: v.StrictObjectSchema<
576
662
  {
577
663
  readonly scope: v.OptionalSchema<
@@ -581,7 +667,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
581
667
  >,
582
668
  undefined
583
669
  >;
584
- readonly state: v.SchemaWithPipe<
670
+ readonly field: v.SchemaWithPipe<
585
671
  readonly [
586
672
  v.StringSchema<undefined>,
587
673
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -596,7 +682,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
596
682
  >,
597
683
  v.StrictObjectSchema<
598
684
  {
599
- readonly type: v.LiteralSchema<"state.unset", undefined>;
685
+ readonly type: v.LiteralSchema<"field.unset", undefined>;
600
686
  readonly target: v.StrictObjectSchema<
601
687
  {
602
688
  readonly scope: v.OptionalSchema<
@@ -606,7 +692,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
606
692
  >,
607
693
  undefined
608
694
  >;
609
- readonly state: v.SchemaWithPipe<
695
+ readonly field: v.SchemaWithPipe<
610
696
  readonly [
611
697
  v.StringSchema<undefined>,
612
698
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -620,7 +706,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
620
706
  >,
621
707
  v.StrictObjectSchema<
622
708
  {
623
- readonly type: v.LiteralSchema<"state.append", undefined>;
709
+ readonly type: v.LiteralSchema<"field.append", undefined>;
624
710
  readonly target: v.StrictObjectSchema<
625
711
  {
626
712
  readonly scope: v.OptionalSchema<
@@ -630,7 +716,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
630
716
  >,
631
717
  undefined
632
718
  >;
633
- readonly state: v.SchemaWithPipe<
719
+ readonly field: v.SchemaWithPipe<
634
720
  readonly [
635
721
  v.StringSchema<undefined>,
636
722
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -645,7 +731,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
645
731
  >,
646
732
  v.StrictObjectSchema<
647
733
  {
648
- readonly type: v.LiteralSchema<"state.updateWhere", undefined>;
734
+ readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
649
735
  readonly target: v.StrictObjectSchema<
650
736
  {
651
737
  readonly scope: v.OptionalSchema<
@@ -655,7 +741,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
655
741
  >,
656
742
  undefined
657
743
  >;
658
- readonly state: v.SchemaWithPipe<
744
+ readonly field: v.SchemaWithPipe<
659
745
  readonly [
660
746
  v.StringSchema<undefined>,
661
747
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -671,7 +757,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
671
757
  >,
672
758
  v.StrictObjectSchema<
673
759
  {
674
- readonly type: v.LiteralSchema<"state.removeWhere", undefined>;
760
+ readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
675
761
  readonly target: v.StrictObjectSchema<
676
762
  {
677
763
  readonly scope: v.OptionalSchema<
@@ -681,7 +767,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
681
767
  >,
682
768
  undefined
683
769
  >;
684
- readonly state: v.SchemaWithPipe<
770
+ readonly field: v.SchemaWithPipe<
685
771
  readonly [
686
772
  v.StringSchema<undefined>,
687
773
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -725,7 +811,7 @@ declare const AuthoringOpSchema: v.VariantSchema<
725
811
  >,
726
812
  undefined
727
813
  >;
728
- readonly state: v.SchemaWithPipe<
814
+ readonly field: v.SchemaWithPipe<
729
815
  readonly [
730
816
  v.StringSchema<undefined>,
731
817
  v.MinLengthAction<string, 1, "must be a non-empty string">,
@@ -870,7 +956,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
870
956
  [
871
957
  v.StrictObjectSchema<
872
958
  {
873
- readonly type: v.LiteralSchema<"state.set", undefined>;
959
+ readonly type: v.LiteralSchema<"field.set", undefined>;
874
960
  readonly target: v.StrictObjectSchema<
875
961
  {
876
962
  readonly scope: v.OptionalSchema<
@@ -880,7 +966,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
880
966
  >,
881
967
  undefined
882
968
  >;
883
- readonly state: v.SchemaWithPipe<
969
+ readonly field: v.SchemaWithPipe<
884
970
  readonly [
885
971
  v.StringSchema<undefined>,
886
972
  v.MinLengthAction<
@@ -900,7 +986,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
900
986
  v.StrictObjectSchema<
901
987
  {
902
988
  readonly type: v.LiteralSchema<
903
- "state.unset",
989
+ "field.unset",
904
990
  undefined
905
991
  >;
906
992
  readonly target: v.StrictObjectSchema<
@@ -912,7 +998,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
912
998
  >,
913
999
  undefined
914
1000
  >;
915
- readonly state: v.SchemaWithPipe<
1001
+ readonly field: v.SchemaWithPipe<
916
1002
  readonly [
917
1003
  v.StringSchema<undefined>,
918
1004
  v.MinLengthAction<
@@ -931,7 +1017,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
931
1017
  v.StrictObjectSchema<
932
1018
  {
933
1019
  readonly type: v.LiteralSchema<
934
- "state.append",
1020
+ "field.append",
935
1021
  undefined
936
1022
  >;
937
1023
  readonly target: v.StrictObjectSchema<
@@ -943,7 +1029,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
943
1029
  >,
944
1030
  undefined
945
1031
  >;
946
- readonly state: v.SchemaWithPipe<
1032
+ readonly field: v.SchemaWithPipe<
947
1033
  readonly [
948
1034
  v.StringSchema<undefined>,
949
1035
  v.MinLengthAction<
@@ -963,7 +1049,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
963
1049
  v.StrictObjectSchema<
964
1050
  {
965
1051
  readonly type: v.LiteralSchema<
966
- "state.updateWhere",
1052
+ "field.updateWhere",
967
1053
  undefined
968
1054
  >;
969
1055
  readonly target: v.StrictObjectSchema<
@@ -975,7 +1061,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
975
1061
  >,
976
1062
  undefined
977
1063
  >;
978
- readonly state: v.SchemaWithPipe<
1064
+ readonly field: v.SchemaWithPipe<
979
1065
  readonly [
980
1066
  v.StringSchema<undefined>,
981
1067
  v.MinLengthAction<
@@ -996,7 +1082,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
996
1082
  v.StrictObjectSchema<
997
1083
  {
998
1084
  readonly type: v.LiteralSchema<
999
- "state.removeWhere",
1085
+ "field.removeWhere",
1000
1086
  undefined
1001
1087
  >;
1002
1088
  readonly target: v.StrictObjectSchema<
@@ -1008,7 +1094,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1008
1094
  >,
1009
1095
  undefined
1010
1096
  >;
1011
- readonly state: v.SchemaWithPipe<
1097
+ readonly field: v.SchemaWithPipe<
1012
1098
  readonly [
1013
1099
  v.StringSchema<undefined>,
1014
1100
  v.MinLengthAction<
@@ -1066,7 +1152,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1066
1152
  >,
1067
1153
  undefined
1068
1154
  >;
1069
- readonly state: v.SchemaWithPipe<
1155
+ readonly field: v.SchemaWithPipe<
1070
1156
  readonly [
1071
1157
  v.StringSchema<undefined>,
1072
1158
  v.MinLengthAction<
@@ -1295,7 +1381,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1295
1381
  v.StrictObjectSchema<
1296
1382
  {
1297
1383
  readonly type: v.LiteralSchema<
1298
- "state.set",
1384
+ "field.set",
1299
1385
  undefined
1300
1386
  >;
1301
1387
  readonly target: v.StrictObjectSchema<
@@ -1311,7 +1397,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1311
1397
  >,
1312
1398
  undefined
1313
1399
  >;
1314
- readonly state: v.SchemaWithPipe<
1400
+ readonly field: v.SchemaWithPipe<
1315
1401
  readonly [
1316
1402
  v.StringSchema<undefined>,
1317
1403
  v.MinLengthAction<
@@ -1331,7 +1417,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1331
1417
  v.StrictObjectSchema<
1332
1418
  {
1333
1419
  readonly type: v.LiteralSchema<
1334
- "state.unset",
1420
+ "field.unset",
1335
1421
  undefined
1336
1422
  >;
1337
1423
  readonly target: v.StrictObjectSchema<
@@ -1347,7 +1433,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1347
1433
  >,
1348
1434
  undefined
1349
1435
  >;
1350
- readonly state: v.SchemaWithPipe<
1436
+ readonly field: v.SchemaWithPipe<
1351
1437
  readonly [
1352
1438
  v.StringSchema<undefined>,
1353
1439
  v.MinLengthAction<
@@ -1366,7 +1452,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1366
1452
  v.StrictObjectSchema<
1367
1453
  {
1368
1454
  readonly type: v.LiteralSchema<
1369
- "state.append",
1455
+ "field.append",
1370
1456
  undefined
1371
1457
  >;
1372
1458
  readonly target: v.StrictObjectSchema<
@@ -1382,7 +1468,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1382
1468
  >,
1383
1469
  undefined
1384
1470
  >;
1385
- readonly state: v.SchemaWithPipe<
1471
+ readonly field: v.SchemaWithPipe<
1386
1472
  readonly [
1387
1473
  v.StringSchema<undefined>,
1388
1474
  v.MinLengthAction<
@@ -1402,7 +1488,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1402
1488
  v.StrictObjectSchema<
1403
1489
  {
1404
1490
  readonly type: v.LiteralSchema<
1405
- "state.updateWhere",
1491
+ "field.updateWhere",
1406
1492
  undefined
1407
1493
  >;
1408
1494
  readonly target: v.StrictObjectSchema<
@@ -1418,7 +1504,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1418
1504
  >,
1419
1505
  undefined
1420
1506
  >;
1421
- readonly state: v.SchemaWithPipe<
1507
+ readonly field: v.SchemaWithPipe<
1422
1508
  readonly [
1423
1509
  v.StringSchema<undefined>,
1424
1510
  v.MinLengthAction<
@@ -1439,7 +1525,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1439
1525
  v.StrictObjectSchema<
1440
1526
  {
1441
1527
  readonly type: v.LiteralSchema<
1442
- "state.removeWhere",
1528
+ "field.removeWhere",
1443
1529
  undefined
1444
1530
  >;
1445
1531
  readonly target: v.StrictObjectSchema<
@@ -1455,7 +1541,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1455
1541
  >,
1456
1542
  undefined
1457
1543
  >;
1458
- readonly state: v.SchemaWithPipe<
1544
+ readonly field: v.SchemaWithPipe<
1459
1545
  readonly [
1460
1546
  v.StringSchema<undefined>,
1461
1547
  v.MinLengthAction<
@@ -1523,7 +1609,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1523
1609
  >,
1524
1610
  undefined
1525
1611
  >;
1526
- readonly state: v.SchemaWithPipe<
1612
+ readonly field: v.SchemaWithPipe<
1527
1613
  readonly [
1528
1614
  v.StringSchema<undefined>,
1529
1615
  v.MinLengthAction<
@@ -1661,7 +1747,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1661
1747
  v.StringSchema<undefined>,
1662
1748
  undefined
1663
1749
  >;
1664
- readonly state: v.UnionSchema<
1750
+ readonly field: v.UnionSchema<
1665
1751
  [
1666
1752
  v.SchemaWithPipe<
1667
1753
  readonly [
@@ -1682,7 +1768,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1682
1768
  >,
1683
1769
  undefined
1684
1770
  >;
1685
- readonly state: v.SchemaWithPipe<
1771
+ readonly field: v.SchemaWithPipe<
1686
1772
  readonly [
1687
1773
  v.StringSchema<undefined>,
1688
1774
  v.MinLengthAction<
@@ -1885,7 +1971,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1885
1971
  },
1886
1972
  undefined
1887
1973
  >;
1888
- /** Initial state for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
1974
+ /** Initial fields for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
1889
1975
  readonly with: v.OptionalSchema<
1890
1976
  v.RecordSchema<
1891
1977
  v.SchemaWithPipe<
@@ -1948,14 +2034,14 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1948
2034
  >,
1949
2035
  undefined
1950
2036
  >;
1951
- /** Task-scoped state entries. Resolved at task activation time. */
1952
- state: v.OptionalSchema<
2037
+ /** Task-scoped field entries. Resolved at task activation time. */
2038
+ fields: v.OptionalSchema<
1953
2039
  v.ArraySchema<
1954
2040
  v.UnionSchema<
1955
2041
  [
1956
2042
  v.StrictObjectSchema<
1957
2043
  {
1958
- readonly type: v.PicklistSchema<
2044
+ type: v.PicklistSchema<
1959
2045
  readonly [
1960
2046
  "doc.ref",
1961
2047
  "doc.refs",
@@ -1973,32 +2059,65 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
1973
2059
  ],
1974
2060
  `Invalid option: expected one of ${string}`
1975
2061
  >;
1976
- readonly name: v.SchemaWithPipe<
2062
+ name: v.SchemaWithPipe<
1977
2063
  readonly [
1978
2064
  v.StringSchema<undefined>,
1979
2065
  v.RegexAction<string, string>,
1980
2066
  ]
1981
2067
  >;
1982
- readonly title: v.OptionalSchema<
2068
+ title: v.OptionalSchema<
1983
2069
  v.StringSchema<undefined>,
1984
2070
  undefined
1985
2071
  >;
1986
- readonly description: v.OptionalSchema<
2072
+ description: v.OptionalSchema<
1987
2073
  v.StringSchema<undefined>,
1988
2074
  undefined
1989
2075
  >;
1990
2076
  /**
1991
2077
  * When true, the caller MUST supply this entry at start (via
1992
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
2078
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
1993
2079
  * missing required entry throws rather than silently defaulting to
1994
2080
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
1995
2081
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
1996
2082
  */
1997
- readonly required: v.OptionalSchema<
2083
+ required: v.OptionalSchema<
1998
2084
  v.BooleanSchema<undefined>,
1999
2085
  undefined
2000
2086
  >;
2001
- readonly source: v.GenericSchema<SourceInternal>;
2087
+ source: v.GenericSchema<SourceInternal>;
2088
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2089
+ editable: v.OptionalSchema<
2090
+ v.UnionSchema<
2091
+ [
2092
+ v.LiteralSchema<true, undefined>,
2093
+ v.ArraySchema<
2094
+ v.SchemaWithPipe<
2095
+ readonly [
2096
+ v.StringSchema<undefined>,
2097
+ v.MinLengthAction<
2098
+ string,
2099
+ 1,
2100
+ "must be a non-empty string"
2101
+ >,
2102
+ ]
2103
+ >,
2104
+ undefined
2105
+ >,
2106
+ v.SchemaWithPipe<
2107
+ readonly [
2108
+ v.StringSchema<undefined>,
2109
+ v.MinLengthAction<
2110
+ string,
2111
+ 1,
2112
+ "must be a non-empty string"
2113
+ >,
2114
+ ]
2115
+ >,
2116
+ ],
2117
+ undefined
2118
+ >,
2119
+ undefined
2120
+ >;
2002
2121
  },
2003
2122
  undefined
2004
2123
  >,
@@ -2063,7 +2182,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2063
2182
  >,
2064
2183
  undefined
2065
2184
  >;
2066
- /** The `state.*` subset — state-write-on-move, the stage's EXIT/ARRIVAL payload. */
2185
+ /** The `field.*` subset — field-write-on-move, the stage's EXIT/ARRIVAL payload. */
2067
2186
  ops: v.OptionalSchema<
2068
2187
  v.ArraySchema<
2069
2188
  v.VariantSchema<
@@ -2071,7 +2190,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2071
2190
  [
2072
2191
  v.StrictObjectSchema<
2073
2192
  {
2074
- readonly type: v.LiteralSchema<"state.set", undefined>;
2193
+ readonly type: v.LiteralSchema<"field.set", undefined>;
2075
2194
  readonly target: v.StrictObjectSchema<
2076
2195
  {
2077
2196
  readonly scope: v.OptionalSchema<
@@ -2081,7 +2200,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2081
2200
  >,
2082
2201
  undefined
2083
2202
  >;
2084
- readonly state: v.SchemaWithPipe<
2203
+ readonly field: v.SchemaWithPipe<
2085
2204
  readonly [
2086
2205
  v.StringSchema<undefined>,
2087
2206
  v.MinLengthAction<
@@ -2101,7 +2220,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2101
2220
  v.StrictObjectSchema<
2102
2221
  {
2103
2222
  readonly type: v.LiteralSchema<
2104
- "state.unset",
2223
+ "field.unset",
2105
2224
  undefined
2106
2225
  >;
2107
2226
  readonly target: v.StrictObjectSchema<
@@ -2113,7 +2232,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2113
2232
  >,
2114
2233
  undefined
2115
2234
  >;
2116
- readonly state: v.SchemaWithPipe<
2235
+ readonly field: v.SchemaWithPipe<
2117
2236
  readonly [
2118
2237
  v.StringSchema<undefined>,
2119
2238
  v.MinLengthAction<
@@ -2132,7 +2251,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2132
2251
  v.StrictObjectSchema<
2133
2252
  {
2134
2253
  readonly type: v.LiteralSchema<
2135
- "state.append",
2254
+ "field.append",
2136
2255
  undefined
2137
2256
  >;
2138
2257
  readonly target: v.StrictObjectSchema<
@@ -2144,7 +2263,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2144
2263
  >,
2145
2264
  undefined
2146
2265
  >;
2147
- readonly state: v.SchemaWithPipe<
2266
+ readonly field: v.SchemaWithPipe<
2148
2267
  readonly [
2149
2268
  v.StringSchema<undefined>,
2150
2269
  v.MinLengthAction<
@@ -2164,7 +2283,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2164
2283
  v.StrictObjectSchema<
2165
2284
  {
2166
2285
  readonly type: v.LiteralSchema<
2167
- "state.updateWhere",
2286
+ "field.updateWhere",
2168
2287
  undefined
2169
2288
  >;
2170
2289
  readonly target: v.StrictObjectSchema<
@@ -2176,7 +2295,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2176
2295
  >,
2177
2296
  undefined
2178
2297
  >;
2179
- readonly state: v.SchemaWithPipe<
2298
+ readonly field: v.SchemaWithPipe<
2180
2299
  readonly [
2181
2300
  v.StringSchema<undefined>,
2182
2301
  v.MinLengthAction<
@@ -2197,7 +2316,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2197
2316
  v.StrictObjectSchema<
2198
2317
  {
2199
2318
  readonly type: v.LiteralSchema<
2200
- "state.removeWhere",
2319
+ "field.removeWhere",
2201
2320
  undefined
2202
2321
  >;
2203
2322
  readonly target: v.StrictObjectSchema<
@@ -2209,7 +2328,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2209
2328
  >,
2210
2329
  undefined
2211
2330
  >;
2212
- readonly state: v.SchemaWithPipe<
2331
+ readonly field: v.SchemaWithPipe<
2213
2332
  readonly [
2214
2333
  v.StringSchema<undefined>,
2215
2334
  v.MinLengthAction<
@@ -2238,7 +2357,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2238
2357
  >,
2239
2358
  undefined
2240
2359
  >;
2241
- readonly state: v.SchemaWithPipe<
2360
+ readonly field: v.SchemaWithPipe<
2242
2361
  readonly [
2243
2362
  v.StringSchema<undefined>,
2244
2363
  v.MinLengthAction<
@@ -2400,7 +2519,7 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2400
2519
  >,
2401
2520
  undefined
2402
2521
  >;
2403
- /** Target docs as `$state` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
2522
+ /** Target docs as `$fields` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
2404
2523
  readonly idRefs: v.OptionalSchema<
2405
2524
  v.ArraySchema<
2406
2525
  v.SchemaWithPipe<
@@ -2476,12 +2595,12 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2476
2595
  undefined
2477
2596
  >;
2478
2597
  /**
2479
- * Projected workflow state the predicate reads as `guard.metadata.*` —
2480
- * the only bridge from the lake eval context (which cannot see `$state`)
2481
- * to workflow state. Values are NOT GROQ: each is a deploy-time read in
2598
+ * Projected workflow fields the predicate reads as `guard.metadata.*` —
2599
+ * the only bridge from the lake eval context (which cannot see `$fields`)
2600
+ * to workflow fields. Values are NOT GROQ: each is a deploy-time read in
2482
2601
  * the guard mini-language — `"$self"`, `"$now"`, or
2483
- * `"$state.<name>[.path]"` — resolved into a bare value at deploy and
2484
- * re-synced by the post-state-op guard refresh.
2602
+ * `"$fields.<name>[.path]"` — resolved into a bare value at deploy and
2603
+ * re-synced by the post-field-op guard refresh.
2485
2604
  */
2486
2605
  readonly metadata: v.OptionalSchema<
2487
2606
  v.RecordSchema<
@@ -2508,14 +2627,14 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2508
2627
  >,
2509
2628
  undefined
2510
2629
  >;
2511
- /** Stage-scoped state entries. Resolved at stage entry. */
2512
- state: v.OptionalSchema<
2630
+ /** Stage-scoped field entries. Resolved at stage entry. */
2631
+ fields: v.OptionalSchema<
2513
2632
  v.ArraySchema<
2514
2633
  v.UnionSchema<
2515
2634
  [
2516
2635
  v.StrictObjectSchema<
2517
2636
  {
2518
- readonly type: v.PicklistSchema<
2637
+ type: v.PicklistSchema<
2519
2638
  readonly [
2520
2639
  "doc.ref",
2521
2640
  "doc.refs",
@@ -2533,32 +2652,62 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2533
2652
  ],
2534
2653
  `Invalid option: expected one of ${string}`
2535
2654
  >;
2536
- readonly name: v.SchemaWithPipe<
2655
+ name: v.SchemaWithPipe<
2537
2656
  readonly [
2538
2657
  v.StringSchema<undefined>,
2539
2658
  v.RegexAction<string, string>,
2540
2659
  ]
2541
2660
  >;
2542
- readonly title: v.OptionalSchema<
2543
- v.StringSchema<undefined>,
2544
- undefined
2545
- >;
2546
- readonly description: v.OptionalSchema<
2661
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2662
+ description: v.OptionalSchema<
2547
2663
  v.StringSchema<undefined>,
2548
2664
  undefined
2549
2665
  >;
2550
2666
  /**
2551
2667
  * When true, the caller MUST supply this entry at start (via
2552
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
2668
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
2553
2669
  * missing required entry throws rather than silently defaulting to
2554
2670
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
2555
2671
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2556
2672
  */
2557
- readonly required: v.OptionalSchema<
2673
+ required: v.OptionalSchema<
2558
2674
  v.BooleanSchema<undefined>,
2559
2675
  undefined
2560
2676
  >;
2561
- readonly source: v.GenericSchema<SourceInternal>;
2677
+ source: v.GenericSchema<SourceInternal>;
2678
+ /** Who-may-edit this slot via the edit seam — see {@link StoredEditableSchema}. */
2679
+ editable: v.OptionalSchema<
2680
+ v.UnionSchema<
2681
+ [
2682
+ v.LiteralSchema<true, undefined>,
2683
+ v.ArraySchema<
2684
+ v.SchemaWithPipe<
2685
+ readonly [
2686
+ v.StringSchema<undefined>,
2687
+ v.MinLengthAction<
2688
+ string,
2689
+ 1,
2690
+ "must be a non-empty string"
2691
+ >,
2692
+ ]
2693
+ >,
2694
+ undefined
2695
+ >,
2696
+ v.SchemaWithPipe<
2697
+ readonly [
2698
+ v.StringSchema<undefined>,
2699
+ v.MinLengthAction<
2700
+ string,
2701
+ 1,
2702
+ "must be a non-empty string"
2703
+ >,
2704
+ ]
2705
+ >,
2706
+ ],
2707
+ undefined
2708
+ >,
2709
+ undefined
2710
+ >;
2562
2711
  },
2563
2712
  undefined
2564
2713
  >,
@@ -2589,74 +2738,44 @@ declare const AuthoringStageSchema: v.StrictObjectSchema<
2589
2738
  >,
2590
2739
  undefined
2591
2740
  >;
2592
- },
2593
- undefined
2594
- >;
2595
-
2596
- declare type AuthoringStateEntry = v.InferOutput<
2597
- typeof AuthoringStateEntrySchema
2598
- >;
2599
-
2600
- declare const AuthoringStateEntrySchema: v.UnionSchema<
2601
- [
2602
- v.StrictObjectSchema<
2603
- {
2604
- readonly type: v.PicklistSchema<
2605
- readonly [
2606
- "doc.ref",
2607
- "doc.refs",
2608
- "release.ref",
2609
- "query",
2610
- "value.string",
2611
- "value.url",
2612
- "value.number",
2613
- "value.boolean",
2614
- "value.dateTime",
2615
- "value.actor",
2616
- "checklist",
2617
- "notes",
2618
- "assignees",
2619
- ],
2620
- `Invalid option: expected one of ${string}`
2621
- >;
2622
- readonly name: v.SchemaWithPipe<
2623
- readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2624
- >;
2625
- readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2626
- readonly description: v.OptionalSchema<
2627
- v.StringSchema<undefined>,
2628
- undefined
2629
- >;
2630
- /**
2631
- * When true, the caller MUST supply this entry at start (via
2632
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
2633
- * missing required entry throws rather than silently defaulting to
2634
- * `null`/`[]` — the same fail-fast an action's `required` param gets.
2635
- * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
2636
- */
2637
- readonly required: v.OptionalSchema<
2638
- v.BooleanSchema<undefined>,
2639
- undefined
2640
- >;
2641
- readonly source: v.GenericSchema<SourceInternal>;
2642
- },
2643
- undefined
2644
- >,
2645
- v.StrictObjectSchema<
2646
- {
2647
- readonly type: v.LiteralSchema<"claim", undefined>;
2648
- readonly name: v.SchemaWithPipe<
2741
+ /**
2742
+ * Tighten-only editability overrides for the time this stage holds, keyed
2743
+ * by an in-scope slot name. The slot's own `editable` is the ceiling; a
2744
+ * stage value is ANDed with it at runtime, so an override can only NARROW
2745
+ * (never open a slot the baseline left closed). An unlisted slot inherits
2746
+ * its baseline.
2747
+ */
2748
+ editable: v.OptionalSchema<
2749
+ v.RecordSchema<
2750
+ v.SchemaWithPipe<
2649
2751
  readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
2650
- >;
2651
- readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2652
- readonly description: v.OptionalSchema<
2653
- v.StringSchema<undefined>,
2752
+ >,
2753
+ v.UnionSchema<
2754
+ [
2755
+ v.LiteralSchema<true, undefined>,
2756
+ v.ArraySchema<
2757
+ v.SchemaWithPipe<
2758
+ readonly [
2759
+ v.StringSchema<undefined>,
2760
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2761
+ ]
2762
+ >,
2763
+ undefined
2764
+ >,
2765
+ v.SchemaWithPipe<
2766
+ readonly [
2767
+ v.StringSchema<undefined>,
2768
+ v.MinLengthAction<string, 1, "must be a non-empty string">,
2769
+ ]
2770
+ >,
2771
+ ],
2654
2772
  undefined
2655
- >;
2656
- },
2773
+ >,
2774
+ undefined
2775
+ >,
2657
2776
  undefined
2658
- >,
2659
- ],
2777
+ >;
2778
+ },
2660
2779
  undefined
2661
2780
  >;
2662
2781
 
@@ -2750,7 +2869,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2750
2869
  [
2751
2870
  v.StrictObjectSchema<
2752
2871
  {
2753
- readonly type: v.LiteralSchema<"state.set", undefined>;
2872
+ readonly type: v.LiteralSchema<"field.set", undefined>;
2754
2873
  readonly target: v.StrictObjectSchema<
2755
2874
  {
2756
2875
  readonly scope: v.OptionalSchema<
@@ -2760,7 +2879,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2760
2879
  >,
2761
2880
  undefined
2762
2881
  >;
2763
- readonly state: v.SchemaWithPipe<
2882
+ readonly field: v.SchemaWithPipe<
2764
2883
  readonly [
2765
2884
  v.StringSchema<undefined>,
2766
2885
  v.MinLengthAction<
@@ -2779,7 +2898,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2779
2898
  >,
2780
2899
  v.StrictObjectSchema<
2781
2900
  {
2782
- readonly type: v.LiteralSchema<"state.unset", undefined>;
2901
+ readonly type: v.LiteralSchema<"field.unset", undefined>;
2783
2902
  readonly target: v.StrictObjectSchema<
2784
2903
  {
2785
2904
  readonly scope: v.OptionalSchema<
@@ -2789,7 +2908,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2789
2908
  >,
2790
2909
  undefined
2791
2910
  >;
2792
- readonly state: v.SchemaWithPipe<
2911
+ readonly field: v.SchemaWithPipe<
2793
2912
  readonly [
2794
2913
  v.StringSchema<undefined>,
2795
2914
  v.MinLengthAction<
@@ -2807,7 +2926,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2807
2926
  >,
2808
2927
  v.StrictObjectSchema<
2809
2928
  {
2810
- readonly type: v.LiteralSchema<"state.append", undefined>;
2929
+ readonly type: v.LiteralSchema<"field.append", undefined>;
2811
2930
  readonly target: v.StrictObjectSchema<
2812
2931
  {
2813
2932
  readonly scope: v.OptionalSchema<
@@ -2817,7 +2936,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2817
2936
  >,
2818
2937
  undefined
2819
2938
  >;
2820
- readonly state: v.SchemaWithPipe<
2939
+ readonly field: v.SchemaWithPipe<
2821
2940
  readonly [
2822
2941
  v.StringSchema<undefined>,
2823
2942
  v.MinLengthAction<
@@ -2836,7 +2955,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2836
2955
  >,
2837
2956
  v.StrictObjectSchema<
2838
2957
  {
2839
- readonly type: v.LiteralSchema<"state.updateWhere", undefined>;
2958
+ readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
2840
2959
  readonly target: v.StrictObjectSchema<
2841
2960
  {
2842
2961
  readonly scope: v.OptionalSchema<
@@ -2846,7 +2965,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2846
2965
  >,
2847
2966
  undefined
2848
2967
  >;
2849
- readonly state: v.SchemaWithPipe<
2968
+ readonly field: v.SchemaWithPipe<
2850
2969
  readonly [
2851
2970
  v.StringSchema<undefined>,
2852
2971
  v.MinLengthAction<
@@ -2866,7 +2985,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2866
2985
  >,
2867
2986
  v.StrictObjectSchema<
2868
2987
  {
2869
- readonly type: v.LiteralSchema<"state.removeWhere", undefined>;
2988
+ readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
2870
2989
  readonly target: v.StrictObjectSchema<
2871
2990
  {
2872
2991
  readonly scope: v.OptionalSchema<
@@ -2876,7 +2995,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2876
2995
  >,
2877
2996
  undefined
2878
2997
  >;
2879
- readonly state: v.SchemaWithPipe<
2998
+ readonly field: v.SchemaWithPipe<
2880
2999
  readonly [
2881
3000
  v.StringSchema<undefined>,
2882
3001
  v.MinLengthAction<
@@ -2928,7 +3047,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
2928
3047
  >,
2929
3048
  undefined
2930
3049
  >;
2931
- readonly state: v.SchemaWithPipe<
3050
+ readonly field: v.SchemaWithPipe<
2932
3051
  readonly [
2933
3052
  v.StringSchema<undefined>,
2934
3053
  v.MinLengthAction<
@@ -3145,7 +3264,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3145
3264
  v.StrictObjectSchema<
3146
3265
  {
3147
3266
  readonly type: v.LiteralSchema<
3148
- "state.set",
3267
+ "field.set",
3149
3268
  undefined
3150
3269
  >;
3151
3270
  readonly target: v.StrictObjectSchema<
@@ -3157,7 +3276,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3157
3276
  >,
3158
3277
  undefined
3159
3278
  >;
3160
- readonly state: v.SchemaWithPipe<
3279
+ readonly field: v.SchemaWithPipe<
3161
3280
  readonly [
3162
3281
  v.StringSchema<undefined>,
3163
3282
  v.MinLengthAction<
@@ -3177,7 +3296,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3177
3296
  v.StrictObjectSchema<
3178
3297
  {
3179
3298
  readonly type: v.LiteralSchema<
3180
- "state.unset",
3299
+ "field.unset",
3181
3300
  undefined
3182
3301
  >;
3183
3302
  readonly target: v.StrictObjectSchema<
@@ -3189,7 +3308,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3189
3308
  >,
3190
3309
  undefined
3191
3310
  >;
3192
- readonly state: v.SchemaWithPipe<
3311
+ readonly field: v.SchemaWithPipe<
3193
3312
  readonly [
3194
3313
  v.StringSchema<undefined>,
3195
3314
  v.MinLengthAction<
@@ -3208,7 +3327,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3208
3327
  v.StrictObjectSchema<
3209
3328
  {
3210
3329
  readonly type: v.LiteralSchema<
3211
- "state.append",
3330
+ "field.append",
3212
3331
  undefined
3213
3332
  >;
3214
3333
  readonly target: v.StrictObjectSchema<
@@ -3220,7 +3339,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3220
3339
  >,
3221
3340
  undefined
3222
3341
  >;
3223
- readonly state: v.SchemaWithPipe<
3342
+ readonly field: v.SchemaWithPipe<
3224
3343
  readonly [
3225
3344
  v.StringSchema<undefined>,
3226
3345
  v.MinLengthAction<
@@ -3240,7 +3359,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3240
3359
  v.StrictObjectSchema<
3241
3360
  {
3242
3361
  readonly type: v.LiteralSchema<
3243
- "state.updateWhere",
3362
+ "field.updateWhere",
3244
3363
  undefined
3245
3364
  >;
3246
3365
  readonly target: v.StrictObjectSchema<
@@ -3252,7 +3371,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3252
3371
  >,
3253
3372
  undefined
3254
3373
  >;
3255
- readonly state: v.SchemaWithPipe<
3374
+ readonly field: v.SchemaWithPipe<
3256
3375
  readonly [
3257
3376
  v.StringSchema<undefined>,
3258
3377
  v.MinLengthAction<
@@ -3273,7 +3392,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3273
3392
  v.StrictObjectSchema<
3274
3393
  {
3275
3394
  readonly type: v.LiteralSchema<
3276
- "state.removeWhere",
3395
+ "field.removeWhere",
3277
3396
  undefined
3278
3397
  >;
3279
3398
  readonly target: v.StrictObjectSchema<
@@ -3285,7 +3404,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3285
3404
  >,
3286
3405
  undefined
3287
3406
  >;
3288
- readonly state: v.SchemaWithPipe<
3407
+ readonly field: v.SchemaWithPipe<
3289
3408
  readonly [
3290
3409
  v.StringSchema<undefined>,
3291
3410
  v.MinLengthAction<
@@ -3346,7 +3465,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3346
3465
  >,
3347
3466
  undefined
3348
3467
  >;
3349
- readonly state: v.SchemaWithPipe<
3468
+ readonly field: v.SchemaWithPipe<
3350
3469
  readonly [
3351
3470
  v.StringSchema<undefined>,
3352
3471
  v.MinLengthAction<
@@ -3480,7 +3599,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3480
3599
  v.StringSchema<undefined>,
3481
3600
  undefined
3482
3601
  >;
3483
- readonly state: v.UnionSchema<
3602
+ readonly field: v.UnionSchema<
3484
3603
  [
3485
3604
  v.SchemaWithPipe<
3486
3605
  readonly [
@@ -3501,7 +3620,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3501
3620
  >,
3502
3621
  undefined
3503
3622
  >;
3504
- readonly state: v.SchemaWithPipe<
3623
+ readonly field: v.SchemaWithPipe<
3505
3624
  readonly [
3506
3625
  v.StringSchema<undefined>,
3507
3626
  v.MinLengthAction<
@@ -3696,7 +3815,7 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3696
3815
  },
3697
3816
  undefined
3698
3817
  >;
3699
- /** Initial state for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
3818
+ /** Initial fields for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
3700
3819
  readonly with: v.OptionalSchema<
3701
3820
  v.RecordSchema<
3702
3821
  v.SchemaWithPipe<
@@ -3743,14 +3862,14 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3743
3862
  >,
3744
3863
  undefined
3745
3864
  >;
3746
- /** Task-scoped state entries. Resolved at task activation time. */
3747
- state: v.OptionalSchema<
3865
+ /** Task-scoped field entries. Resolved at task activation time. */
3866
+ fields: v.OptionalSchema<
3748
3867
  v.ArraySchema<
3749
3868
  v.UnionSchema<
3750
3869
  [
3751
3870
  v.StrictObjectSchema<
3752
3871
  {
3753
- readonly type: v.PicklistSchema<
3872
+ type: v.PicklistSchema<
3754
3873
  readonly [
3755
3874
  "doc.ref",
3756
3875
  "doc.refs",
@@ -3768,32 +3887,62 @@ declare const AuthoringTaskSchema: v.StrictObjectSchema<
3768
3887
  ],
3769
3888
  `Invalid option: expected one of ${string}`
3770
3889
  >;
3771
- readonly name: v.SchemaWithPipe<
3890
+ name: v.SchemaWithPipe<
3772
3891
  readonly [
3773
3892
  v.StringSchema<undefined>,
3774
3893
  v.RegexAction<string, string>,
3775
3894
  ]
3776
3895
  >;
3777
- readonly title: v.OptionalSchema<
3778
- v.StringSchema<undefined>,
3779
- undefined
3780
- >;
3781
- readonly description: v.OptionalSchema<
3896
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3897
+ description: v.OptionalSchema<
3782
3898
  v.StringSchema<undefined>,
3783
3899
  undefined
3784
3900
  >;
3785
3901
  /**
3786
3902
  * When true, the caller MUST supply this entry at start (via
3787
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
3903
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
3788
3904
  * missing required entry throws rather than silently defaulting to
3789
3905
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
3790
3906
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
3791
3907
  */
3792
- readonly required: v.OptionalSchema<
3908
+ required: v.OptionalSchema<
3793
3909
  v.BooleanSchema<undefined>,
3794
3910
  undefined
3795
3911
  >;
3796
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >,
3944
+ undefined
3945
+ >;
3797
3946
  },
3798
3947
  undefined
3799
3948
  >,
@@ -3857,7 +4006,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3857
4006
  >,
3858
4007
  undefined
3859
4008
  >;
3860
- /** The `state.*` subset — state-write-on-move, the stage's EXIT/ARRIVAL payload. */
4009
+ /** The `field.*` subset — field-write-on-move, the stage's EXIT/ARRIVAL payload. */
3861
4010
  ops: v.OptionalSchema<
3862
4011
  v.ArraySchema<
3863
4012
  v.VariantSchema<
@@ -3865,7 +4014,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3865
4014
  [
3866
4015
  v.StrictObjectSchema<
3867
4016
  {
3868
- readonly type: v.LiteralSchema<"state.set", undefined>;
4017
+ readonly type: v.LiteralSchema<"field.set", undefined>;
3869
4018
  readonly target: v.StrictObjectSchema<
3870
4019
  {
3871
4020
  readonly scope: v.OptionalSchema<
@@ -3875,7 +4024,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3875
4024
  >,
3876
4025
  undefined
3877
4026
  >;
3878
- readonly state: v.SchemaWithPipe<
4027
+ readonly field: v.SchemaWithPipe<
3879
4028
  readonly [
3880
4029
  v.StringSchema<undefined>,
3881
4030
  v.MinLengthAction<
@@ -3894,7 +4043,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3894
4043
  >,
3895
4044
  v.StrictObjectSchema<
3896
4045
  {
3897
- readonly type: v.LiteralSchema<"state.unset", undefined>;
4046
+ readonly type: v.LiteralSchema<"field.unset", undefined>;
3898
4047
  readonly target: v.StrictObjectSchema<
3899
4048
  {
3900
4049
  readonly scope: v.OptionalSchema<
@@ -3904,7 +4053,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3904
4053
  >,
3905
4054
  undefined
3906
4055
  >;
3907
- readonly state: v.SchemaWithPipe<
4056
+ readonly field: v.SchemaWithPipe<
3908
4057
  readonly [
3909
4058
  v.StringSchema<undefined>,
3910
4059
  v.MinLengthAction<
@@ -3922,7 +4071,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3922
4071
  >,
3923
4072
  v.StrictObjectSchema<
3924
4073
  {
3925
- readonly type: v.LiteralSchema<"state.append", undefined>;
4074
+ readonly type: v.LiteralSchema<"field.append", undefined>;
3926
4075
  readonly target: v.StrictObjectSchema<
3927
4076
  {
3928
4077
  readonly scope: v.OptionalSchema<
@@ -3932,7 +4081,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3932
4081
  >,
3933
4082
  undefined
3934
4083
  >;
3935
- readonly state: v.SchemaWithPipe<
4084
+ readonly field: v.SchemaWithPipe<
3936
4085
  readonly [
3937
4086
  v.StringSchema<undefined>,
3938
4087
  v.MinLengthAction<
@@ -3951,7 +4100,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3951
4100
  >,
3952
4101
  v.StrictObjectSchema<
3953
4102
  {
3954
- readonly type: v.LiteralSchema<"state.updateWhere", undefined>;
4103
+ readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
3955
4104
  readonly target: v.StrictObjectSchema<
3956
4105
  {
3957
4106
  readonly scope: v.OptionalSchema<
@@ -3961,7 +4110,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3961
4110
  >,
3962
4111
  undefined
3963
4112
  >;
3964
- readonly state: v.SchemaWithPipe<
4113
+ readonly field: v.SchemaWithPipe<
3965
4114
  readonly [
3966
4115
  v.StringSchema<undefined>,
3967
4116
  v.MinLengthAction<
@@ -3981,7 +4130,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3981
4130
  >,
3982
4131
  v.StrictObjectSchema<
3983
4132
  {
3984
- readonly type: v.LiteralSchema<"state.removeWhere", undefined>;
4133
+ readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
3985
4134
  readonly target: v.StrictObjectSchema<
3986
4135
  {
3987
4136
  readonly scope: v.OptionalSchema<
@@ -3991,7 +4140,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
3991
4140
  >,
3992
4141
  undefined
3993
4142
  >;
3994
- readonly state: v.SchemaWithPipe<
4143
+ readonly field: v.SchemaWithPipe<
3995
4144
  readonly [
3996
4145
  v.StringSchema<undefined>,
3997
4146
  v.MinLengthAction<
@@ -4020,7 +4169,7 @@ declare const AuthoringTransitionSchema: v.StrictObjectSchema<
4020
4169
  >,
4021
4170
  undefined
4022
4171
  >;
4023
- readonly state: v.SchemaWithPipe<
4172
+ readonly field: v.SchemaWithPipe<
4024
4173
  readonly [
4025
4174
  v.StringSchema<undefined>,
4026
4175
  v.MinLengthAction<
@@ -4161,7 +4310,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4161
4310
  * never started cold from a picker. Omitted ⇒ `'workflow'` (startable).
4162
4311
  * Advisory: consumers filter their start pickers on it (see
4163
4312
  * {@link isStartableDefinition}); the engine does NOT refuse a
4164
- * `startInstance` on a `'child'` def — load-bearing `required` state is the
4313
+ * `startInstance` on a `'child'` def — load-bearing `required` field is the
4165
4314
  * runtime backstop.
4166
4315
  */
4167
4316
  role: v.OptionalSchema<
@@ -4178,14 +4327,14 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4178
4327
  v.MinLengthAction<string, 1, "must be a non-empty string">,
4179
4328
  ]
4180
4329
  >;
4181
- /** Workflow-scope state entries. Persist for the instance lifetime. */
4182
- state: v.OptionalSchema<
4330
+ /** Workflow-scope field entries. Persist for the instance lifetime. */
4331
+ fields: v.OptionalSchema<
4183
4332
  v.ArraySchema<
4184
4333
  v.UnionSchema<
4185
4334
  [
4186
4335
  v.StrictObjectSchema<
4187
4336
  {
4188
- readonly type: v.PicklistSchema<
4337
+ type: v.PicklistSchema<
4189
4338
  readonly [
4190
4339
  "doc.ref",
4191
4340
  "doc.refs",
@@ -4203,32 +4352,62 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4203
4352
  ],
4204
4353
  `Invalid option: expected one of ${string}`
4205
4354
  >;
4206
- readonly name: v.SchemaWithPipe<
4355
+ name: v.SchemaWithPipe<
4207
4356
  readonly [
4208
4357
  v.StringSchema<undefined>,
4209
4358
  v.RegexAction<string, string>,
4210
4359
  ]
4211
4360
  >;
4212
- readonly title: v.OptionalSchema<
4213
- v.StringSchema<undefined>,
4214
- undefined
4215
- >;
4216
- readonly description: v.OptionalSchema<
4361
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4362
+ description: v.OptionalSchema<
4217
4363
  v.StringSchema<undefined>,
4218
4364
  undefined
4219
4365
  >;
4220
4366
  /**
4221
4367
  * When true, the caller MUST supply this entry at start (via
4222
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
4368
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
4223
4369
  * missing required entry throws rather than silently defaulting to
4224
4370
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
4225
4371
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
4226
4372
  */
4227
- readonly required: v.OptionalSchema<
4373
+ required: v.OptionalSchema<
4228
4374
  v.BooleanSchema<undefined>,
4229
4375
  undefined
4230
4376
  >;
4231
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >,
4409
+ undefined
4410
+ >;
4232
4411
  },
4233
4412
  undefined
4234
4413
  >,
@@ -4396,7 +4575,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4396
4575
  v.StrictObjectSchema<
4397
4576
  {
4398
4577
  readonly type: v.LiteralSchema<
4399
- "state.set",
4578
+ "field.set",
4400
4579
  undefined
4401
4580
  >;
4402
4581
  readonly target: v.StrictObjectSchema<
@@ -4412,7 +4591,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4412
4591
  >,
4413
4592
  undefined
4414
4593
  >;
4415
- readonly state: v.SchemaWithPipe<
4594
+ readonly field: v.SchemaWithPipe<
4416
4595
  readonly [
4417
4596
  v.StringSchema<undefined>,
4418
4597
  v.MinLengthAction<
@@ -4432,7 +4611,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4432
4611
  v.StrictObjectSchema<
4433
4612
  {
4434
4613
  readonly type: v.LiteralSchema<
4435
- "state.unset",
4614
+ "field.unset",
4436
4615
  undefined
4437
4616
  >;
4438
4617
  readonly target: v.StrictObjectSchema<
@@ -4448,7 +4627,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4448
4627
  >,
4449
4628
  undefined
4450
4629
  >;
4451
- readonly state: v.SchemaWithPipe<
4630
+ readonly field: v.SchemaWithPipe<
4452
4631
  readonly [
4453
4632
  v.StringSchema<undefined>,
4454
4633
  v.MinLengthAction<
@@ -4467,7 +4646,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4467
4646
  v.StrictObjectSchema<
4468
4647
  {
4469
4648
  readonly type: v.LiteralSchema<
4470
- "state.append",
4649
+ "field.append",
4471
4650
  undefined
4472
4651
  >;
4473
4652
  readonly target: v.StrictObjectSchema<
@@ -4483,7 +4662,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4483
4662
  >,
4484
4663
  undefined
4485
4664
  >;
4486
- readonly state: v.SchemaWithPipe<
4665
+ readonly field: v.SchemaWithPipe<
4487
4666
  readonly [
4488
4667
  v.StringSchema<undefined>,
4489
4668
  v.MinLengthAction<
@@ -4503,7 +4682,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4503
4682
  v.StrictObjectSchema<
4504
4683
  {
4505
4684
  readonly type: v.LiteralSchema<
4506
- "state.updateWhere",
4685
+ "field.updateWhere",
4507
4686
  undefined
4508
4687
  >;
4509
4688
  readonly target: v.StrictObjectSchema<
@@ -4519,7 +4698,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4519
4698
  >,
4520
4699
  undefined
4521
4700
  >;
4522
- readonly state: v.SchemaWithPipe<
4701
+ readonly field: v.SchemaWithPipe<
4523
4702
  readonly [
4524
4703
  v.StringSchema<undefined>,
4525
4704
  v.MinLengthAction<
@@ -4540,7 +4719,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4540
4719
  v.StrictObjectSchema<
4541
4720
  {
4542
4721
  readonly type: v.LiteralSchema<
4543
- "state.removeWhere",
4722
+ "field.removeWhere",
4544
4723
  undefined
4545
4724
  >;
4546
4725
  readonly target: v.StrictObjectSchema<
@@ -4556,7 +4735,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4556
4735
  >,
4557
4736
  undefined
4558
4737
  >;
4559
- readonly state: v.SchemaWithPipe<
4738
+ readonly field: v.SchemaWithPipe<
4560
4739
  readonly [
4561
4740
  v.StringSchema<undefined>,
4562
4741
  v.MinLengthAction<
@@ -4624,7 +4803,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4624
4803
  >,
4625
4804
  undefined
4626
4805
  >;
4627
- readonly state: v.SchemaWithPipe<
4806
+ readonly field: v.SchemaWithPipe<
4628
4807
  readonly [
4629
4808
  v.StringSchema<undefined>,
4630
4809
  v.MinLengthAction<
@@ -4853,7 +5032,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4853
5032
  v.StrictObjectSchema<
4854
5033
  {
4855
5034
  readonly type: v.LiteralSchema<
4856
- "state.set",
5035
+ "field.set",
4857
5036
  undefined
4858
5037
  >;
4859
5038
  readonly target: v.StrictObjectSchema<
@@ -4869,7 +5048,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4869
5048
  >,
4870
5049
  undefined
4871
5050
  >;
4872
- readonly state: v.SchemaWithPipe<
5051
+ readonly field: v.SchemaWithPipe<
4873
5052
  readonly [
4874
5053
  v.StringSchema<undefined>,
4875
5054
  v.MinLengthAction<
@@ -4889,7 +5068,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4889
5068
  v.StrictObjectSchema<
4890
5069
  {
4891
5070
  readonly type: v.LiteralSchema<
4892
- "state.unset",
5071
+ "field.unset",
4893
5072
  undefined
4894
5073
  >;
4895
5074
  readonly target: v.StrictObjectSchema<
@@ -4905,7 +5084,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4905
5084
  >,
4906
5085
  undefined
4907
5086
  >;
4908
- readonly state: v.SchemaWithPipe<
5087
+ readonly field: v.SchemaWithPipe<
4909
5088
  readonly [
4910
5089
  v.StringSchema<undefined>,
4911
5090
  v.MinLengthAction<
@@ -4924,7 +5103,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4924
5103
  v.StrictObjectSchema<
4925
5104
  {
4926
5105
  readonly type: v.LiteralSchema<
4927
- "state.append",
5106
+ "field.append",
4928
5107
  undefined
4929
5108
  >;
4930
5109
  readonly target: v.StrictObjectSchema<
@@ -4940,7 +5119,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4940
5119
  >,
4941
5120
  undefined
4942
5121
  >;
4943
- readonly state: v.SchemaWithPipe<
5122
+ readonly field: v.SchemaWithPipe<
4944
5123
  readonly [
4945
5124
  v.StringSchema<undefined>,
4946
5125
  v.MinLengthAction<
@@ -4960,7 +5139,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4960
5139
  v.StrictObjectSchema<
4961
5140
  {
4962
5141
  readonly type: v.LiteralSchema<
4963
- "state.updateWhere",
5142
+ "field.updateWhere",
4964
5143
  undefined
4965
5144
  >;
4966
5145
  readonly target: v.StrictObjectSchema<
@@ -4976,7 +5155,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4976
5155
  >,
4977
5156
  undefined
4978
5157
  >;
4979
- readonly state: v.SchemaWithPipe<
5158
+ readonly field: v.SchemaWithPipe<
4980
5159
  readonly [
4981
5160
  v.StringSchema<undefined>,
4982
5161
  v.MinLengthAction<
@@ -4997,7 +5176,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
4997
5176
  v.StrictObjectSchema<
4998
5177
  {
4999
5178
  readonly type: v.LiteralSchema<
5000
- "state.removeWhere",
5179
+ "field.removeWhere",
5001
5180
  undefined
5002
5181
  >;
5003
5182
  readonly target: v.StrictObjectSchema<
@@ -5013,7 +5192,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5013
5192
  >,
5014
5193
  undefined
5015
5194
  >;
5016
- readonly state: v.SchemaWithPipe<
5195
+ readonly field: v.SchemaWithPipe<
5017
5196
  readonly [
5018
5197
  v.StringSchema<undefined>,
5019
5198
  v.MinLengthAction<
@@ -5081,7 +5260,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5081
5260
  >,
5082
5261
  undefined
5083
5262
  >;
5084
- readonly state: v.SchemaWithPipe<
5263
+ readonly field: v.SchemaWithPipe<
5085
5264
  readonly [
5086
5265
  v.StringSchema<undefined>,
5087
5266
  v.MinLengthAction<
@@ -5222,7 +5401,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5222
5401
  v.StringSchema<undefined>,
5223
5402
  undefined
5224
5403
  >;
5225
- readonly state: v.UnionSchema<
5404
+ readonly field: v.UnionSchema<
5226
5405
  [
5227
5406
  v.SchemaWithPipe<
5228
5407
  readonly [
@@ -5247,7 +5426,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5247
5426
  >,
5248
5427
  undefined
5249
5428
  >;
5250
- readonly state: v.SchemaWithPipe<
5429
+ readonly field: v.SchemaWithPipe<
5251
5430
  readonly [
5252
5431
  v.StringSchema<undefined>,
5253
5432
  v.MinLengthAction<
@@ -5454,7 +5633,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5454
5633
  },
5455
5634
  undefined
5456
5635
  >;
5457
- /** Initial state for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
5636
+ /** Initial fields for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
5458
5637
  readonly with: v.OptionalSchema<
5459
5638
  v.RecordSchema<
5460
5639
  v.SchemaWithPipe<
@@ -5517,14 +5696,14 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5517
5696
  >,
5518
5697
  undefined
5519
5698
  >;
5520
- /** Task-scoped state entries. Resolved at task activation time. */
5521
- state: v.OptionalSchema<
5699
+ /** Task-scoped field entries. Resolved at task activation time. */
5700
+ fields: v.OptionalSchema<
5522
5701
  v.ArraySchema<
5523
5702
  v.UnionSchema<
5524
5703
  [
5525
5704
  v.StrictObjectSchema<
5526
5705
  {
5527
- readonly type: v.PicklistSchema<
5706
+ type: v.PicklistSchema<
5528
5707
  readonly [
5529
5708
  "doc.ref",
5530
5709
  "doc.refs",
@@ -5542,32 +5721,65 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5542
5721
  ],
5543
5722
  `Invalid option: expected one of ${string}`
5544
5723
  >;
5545
- readonly name: v.SchemaWithPipe<
5724
+ name: v.SchemaWithPipe<
5546
5725
  readonly [
5547
5726
  v.StringSchema<undefined>,
5548
5727
  v.RegexAction<string, string>,
5549
5728
  ]
5550
5729
  >;
5551
- readonly title: v.OptionalSchema<
5730
+ title: v.OptionalSchema<
5552
5731
  v.StringSchema<undefined>,
5553
5732
  undefined
5554
5733
  >;
5555
- readonly description: v.OptionalSchema<
5734
+ description: v.OptionalSchema<
5556
5735
  v.StringSchema<undefined>,
5557
5736
  undefined
5558
5737
  >;
5559
5738
  /**
5560
5739
  * When true, the caller MUST supply this entry at start (via
5561
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
5740
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
5562
5741
  * missing required entry throws rather than silently defaulting to
5563
5742
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
5564
5743
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
5565
5744
  */
5566
- readonly required: v.OptionalSchema<
5745
+ required: v.OptionalSchema<
5567
5746
  v.BooleanSchema<undefined>,
5568
5747
  undefined
5569
5748
  >;
5570
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >;
5571
5783
  },
5572
5784
  undefined
5573
5785
  >,
@@ -5653,7 +5865,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5653
5865
  >,
5654
5866
  undefined
5655
5867
  >;
5656
- /** The `state.*` subset — state-write-on-move, the stage's EXIT/ARRIVAL payload. */
5868
+ /** The `field.*` subset — field-write-on-move, the stage's EXIT/ARRIVAL payload. */
5657
5869
  ops: v.OptionalSchema<
5658
5870
  v.ArraySchema<
5659
5871
  v.VariantSchema<
@@ -5662,7 +5874,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5662
5874
  v.StrictObjectSchema<
5663
5875
  {
5664
5876
  readonly type: v.LiteralSchema<
5665
- "state.set",
5877
+ "field.set",
5666
5878
  undefined
5667
5879
  >;
5668
5880
  readonly target: v.StrictObjectSchema<
@@ -5678,7 +5890,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5678
5890
  >,
5679
5891
  undefined
5680
5892
  >;
5681
- readonly state: v.SchemaWithPipe<
5893
+ readonly field: v.SchemaWithPipe<
5682
5894
  readonly [
5683
5895
  v.StringSchema<undefined>,
5684
5896
  v.MinLengthAction<
@@ -5698,7 +5910,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5698
5910
  v.StrictObjectSchema<
5699
5911
  {
5700
5912
  readonly type: v.LiteralSchema<
5701
- "state.unset",
5913
+ "field.unset",
5702
5914
  undefined
5703
5915
  >;
5704
5916
  readonly target: v.StrictObjectSchema<
@@ -5714,7 +5926,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5714
5926
  >,
5715
5927
  undefined
5716
5928
  >;
5717
- readonly state: v.SchemaWithPipe<
5929
+ readonly field: v.SchemaWithPipe<
5718
5930
  readonly [
5719
5931
  v.StringSchema<undefined>,
5720
5932
  v.MinLengthAction<
@@ -5733,7 +5945,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5733
5945
  v.StrictObjectSchema<
5734
5946
  {
5735
5947
  readonly type: v.LiteralSchema<
5736
- "state.append",
5948
+ "field.append",
5737
5949
  undefined
5738
5950
  >;
5739
5951
  readonly target: v.StrictObjectSchema<
@@ -5749,7 +5961,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5749
5961
  >,
5750
5962
  undefined
5751
5963
  >;
5752
- readonly state: v.SchemaWithPipe<
5964
+ readonly field: v.SchemaWithPipe<
5753
5965
  readonly [
5754
5966
  v.StringSchema<undefined>,
5755
5967
  v.MinLengthAction<
@@ -5769,7 +5981,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5769
5981
  v.StrictObjectSchema<
5770
5982
  {
5771
5983
  readonly type: v.LiteralSchema<
5772
- "state.updateWhere",
5984
+ "field.updateWhere",
5773
5985
  undefined
5774
5986
  >;
5775
5987
  readonly target: v.StrictObjectSchema<
@@ -5785,7 +5997,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5785
5997
  >,
5786
5998
  undefined
5787
5999
  >;
5788
- readonly state: v.SchemaWithPipe<
6000
+ readonly field: v.SchemaWithPipe<
5789
6001
  readonly [
5790
6002
  v.StringSchema<undefined>,
5791
6003
  v.MinLengthAction<
@@ -5806,7 +6018,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5806
6018
  v.StrictObjectSchema<
5807
6019
  {
5808
6020
  readonly type: v.LiteralSchema<
5809
- "state.removeWhere",
6021
+ "field.removeWhere",
5810
6022
  undefined
5811
6023
  >;
5812
6024
  readonly target: v.StrictObjectSchema<
@@ -5822,7 +6034,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5822
6034
  >,
5823
6035
  undefined
5824
6036
  >;
5825
- readonly state: v.SchemaWithPipe<
6037
+ readonly field: v.SchemaWithPipe<
5826
6038
  readonly [
5827
6039
  v.StringSchema<undefined>,
5828
6040
  v.MinLengthAction<
@@ -5858,7 +6070,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
5858
6070
  >,
5859
6071
  undefined
5860
6072
  >;
5861
- readonly state: v.SchemaWithPipe<
6073
+ readonly field: v.SchemaWithPipe<
5862
6074
  readonly [
5863
6075
  v.StringSchema<undefined>,
5864
6076
  v.MinLengthAction<
@@ -6024,7 +6236,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6024
6236
  >,
6025
6237
  undefined
6026
6238
  >;
6027
- /** Target docs as `$state` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
6239
+ /** Target docs as `$fields` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
6028
6240
  readonly idRefs: v.OptionalSchema<
6029
6241
  v.ArraySchema<
6030
6242
  v.SchemaWithPipe<
@@ -6100,12 +6312,12 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6100
6312
  undefined
6101
6313
  >;
6102
6314
  /**
6103
- * Projected workflow state the predicate reads as `guard.metadata.*` —
6104
- * the only bridge from the lake eval context (which cannot see `$state`)
6105
- * to workflow state. Values are NOT GROQ: each is a deploy-time read in
6315
+ * Projected workflow fields the predicate reads as `guard.metadata.*` —
6316
+ * the only bridge from the lake eval context (which cannot see `$fields`)
6317
+ * to workflow fields. Values are NOT GROQ: each is a deploy-time read in
6106
6318
  * the guard mini-language — `"$self"`, `"$now"`, or
6107
- * `"$state.<name>[.path]"` — resolved into a bare value at deploy and
6108
- * re-synced by the post-state-op guard refresh.
6319
+ * `"$fields.<name>[.path]"` — resolved into a bare value at deploy and
6320
+ * re-synced by the post-field-op guard refresh.
6109
6321
  */
6110
6322
  readonly metadata: v.OptionalSchema<
6111
6323
  v.RecordSchema<
@@ -6140,14 +6352,14 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6140
6352
  >,
6141
6353
  undefined
6142
6354
  >;
6143
- /** Stage-scoped state entries. Resolved at stage entry. */
6144
- state: v.OptionalSchema<
6355
+ /** Stage-scoped field entries. Resolved at stage entry. */
6356
+ fields: v.OptionalSchema<
6145
6357
  v.ArraySchema<
6146
6358
  v.UnionSchema<
6147
6359
  [
6148
6360
  v.StrictObjectSchema<
6149
6361
  {
6150
- readonly type: v.PicklistSchema<
6362
+ type: v.PicklistSchema<
6151
6363
  readonly [
6152
6364
  "doc.ref",
6153
6365
  "doc.refs",
@@ -6165,32 +6377,65 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6165
6377
  ],
6166
6378
  `Invalid option: expected one of ${string}`
6167
6379
  >;
6168
- readonly name: v.SchemaWithPipe<
6380
+ name: v.SchemaWithPipe<
6169
6381
  readonly [
6170
6382
  v.StringSchema<undefined>,
6171
6383
  v.RegexAction<string, string>,
6172
6384
  ]
6173
6385
  >;
6174
- readonly title: v.OptionalSchema<
6386
+ title: v.OptionalSchema<
6175
6387
  v.StringSchema<undefined>,
6176
6388
  undefined
6177
6389
  >;
6178
- readonly description: v.OptionalSchema<
6390
+ description: v.OptionalSchema<
6179
6391
  v.StringSchema<undefined>,
6180
6392
  undefined
6181
6393
  >;
6182
6394
  /**
6183
6395
  * When true, the caller MUST supply this entry at start (via
6184
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
6396
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
6185
6397
  * missing required entry throws rather than silently defaulting to
6186
6398
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
6187
6399
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
6188
6400
  */
6189
- readonly required: v.OptionalSchema<
6401
+ required: v.OptionalSchema<
6190
6402
  v.BooleanSchema<undefined>,
6191
6403
  undefined
6192
6404
  >;
6193
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >;
6194
6439
  },
6195
6440
  undefined
6196
6441
  >,
@@ -6221,6 +6466,54 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6221
6466
  >,
6222
6467
  undefined
6223
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
+ >;
6224
6517
  },
6225
6518
  undefined
6226
6519
  >,
@@ -6261,7 +6554,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6261
6554
  type: "audit";
6262
6555
  target: {
6263
6556
  scope?: "workflow" | "stage" | "task" | undefined;
6264
- state: string;
6557
+ field: string;
6265
6558
  };
6266
6559
  value: SourceInternal;
6267
6560
  stampFields?:
@@ -6272,42 +6565,42 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6272
6565
  | undefined;
6273
6566
  }
6274
6567
  | {
6275
- type: "state.set";
6568
+ type: "field.set";
6276
6569
  target: {
6277
6570
  scope?: "workflow" | "stage" | "task" | undefined;
6278
- state: string;
6571
+ field: string;
6279
6572
  };
6280
6573
  value: SourceInternal;
6281
6574
  }
6282
6575
  | {
6283
- type: "state.unset";
6576
+ type: "field.unset";
6284
6577
  target: {
6285
6578
  scope?: "workflow" | "stage" | "task" | undefined;
6286
- state: string;
6579
+ field: string;
6287
6580
  };
6288
6581
  }
6289
6582
  | {
6290
- type: "state.append";
6583
+ type: "field.append";
6291
6584
  target: {
6292
6585
  scope?: "workflow" | "stage" | "task" | undefined;
6293
- state: string;
6586
+ field: string;
6294
6587
  };
6295
6588
  value: SourceInternal;
6296
6589
  }
6297
6590
  | {
6298
- type: "state.updateWhere";
6591
+ type: "field.updateWhere";
6299
6592
  target: {
6300
6593
  scope?: "workflow" | "stage" | "task" | undefined;
6301
- state: string;
6594
+ field: string;
6302
6595
  };
6303
6596
  where: OpPredicateInternal;
6304
6597
  value: SourceInternal;
6305
6598
  }
6306
6599
  | {
6307
- type: "state.removeWhere";
6600
+ type: "field.removeWhere";
6308
6601
  target: {
6309
6602
  scope?: "workflow" | "stage" | "task" | undefined;
6310
- state: string;
6603
+ field: string;
6311
6604
  };
6312
6605
  where: OpPredicateInternal;
6313
6606
  }
@@ -6377,7 +6670,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6377
6670
  | "stage"
6378
6671
  | "task"
6379
6672
  | undefined;
6380
- state: string;
6673
+ field: string;
6381
6674
  };
6382
6675
  value: SourceInternal;
6383
6676
  stampFields?:
@@ -6388,62 +6681,62 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6388
6681
  | undefined;
6389
6682
  }
6390
6683
  | {
6391
- type: "state.set";
6684
+ type: "field.set";
6392
6685
  target: {
6393
6686
  scope?:
6394
6687
  | "workflow"
6395
6688
  | "stage"
6396
6689
  | "task"
6397
6690
  | undefined;
6398
- state: string;
6691
+ field: string;
6399
6692
  };
6400
6693
  value: SourceInternal;
6401
6694
  }
6402
6695
  | {
6403
- type: "state.unset";
6696
+ type: "field.unset";
6404
6697
  target: {
6405
6698
  scope?:
6406
6699
  | "workflow"
6407
6700
  | "stage"
6408
6701
  | "task"
6409
6702
  | undefined;
6410
- state: string;
6703
+ field: string;
6411
6704
  };
6412
6705
  }
6413
6706
  | {
6414
- type: "state.append";
6707
+ type: "field.append";
6415
6708
  target: {
6416
6709
  scope?:
6417
6710
  | "workflow"
6418
6711
  | "stage"
6419
6712
  | "task"
6420
6713
  | undefined;
6421
- state: string;
6714
+ field: string;
6422
6715
  };
6423
6716
  value: SourceInternal;
6424
6717
  }
6425
6718
  | {
6426
- type: "state.updateWhere";
6719
+ type: "field.updateWhere";
6427
6720
  target: {
6428
6721
  scope?:
6429
6722
  | "workflow"
6430
6723
  | "stage"
6431
6724
  | "task"
6432
6725
  | undefined;
6433
- state: string;
6726
+ field: string;
6434
6727
  };
6435
6728
  where: OpPredicateInternal;
6436
6729
  value: SourceInternal;
6437
6730
  }
6438
6731
  | {
6439
- type: "state.removeWhere";
6732
+ type: "field.removeWhere";
6440
6733
  target: {
6441
6734
  scope?:
6442
6735
  | "workflow"
6443
6736
  | "stage"
6444
6737
  | "task"
6445
6738
  | undefined;
6446
- state: string;
6739
+ field: string;
6447
6740
  };
6448
6741
  where: OpPredicateInternal;
6449
6742
  }
@@ -6472,7 +6765,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6472
6765
  name: string;
6473
6766
  title?: string | undefined;
6474
6767
  description?: string | undefined;
6475
- state:
6768
+ field:
6476
6769
  | string
6477
6770
  | {
6478
6771
  scope?:
@@ -6480,7 +6773,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6480
6773
  | "stage"
6481
6774
  | "task"
6482
6775
  | undefined;
6483
- state: string;
6776
+ field: string;
6484
6777
  };
6485
6778
  roles?: string[] | undefined;
6486
6779
  filter?: string | undefined;
@@ -6541,7 +6834,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6541
6834
  | undefined;
6542
6835
  }
6543
6836
  | undefined;
6544
- state?:
6837
+ fields?:
6545
6838
  | (
6546
6839
  | {
6547
6840
  type:
@@ -6563,6 +6856,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6563
6856
  description?: string | undefined;
6564
6857
  required?: boolean | undefined;
6565
6858
  source: SourceInternal;
6859
+ editable?: string | true | string[] | undefined;
6566
6860
  }
6567
6861
  | {
6568
6862
  type: "claim";
@@ -6587,7 +6881,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6587
6881
  type: "audit";
6588
6882
  target: {
6589
6883
  scope?: "workflow" | "stage" | "task" | undefined;
6590
- state: string;
6884
+ field: string;
6591
6885
  };
6592
6886
  value: SourceInternal;
6593
6887
  stampFields?:
@@ -6598,42 +6892,42 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6598
6892
  | undefined;
6599
6893
  }
6600
6894
  | {
6601
- type: "state.set";
6895
+ type: "field.set";
6602
6896
  target: {
6603
6897
  scope?: "workflow" | "stage" | "task" | undefined;
6604
- state: string;
6898
+ field: string;
6605
6899
  };
6606
6900
  value: SourceInternal;
6607
6901
  }
6608
6902
  | {
6609
- type: "state.unset";
6903
+ type: "field.unset";
6610
6904
  target: {
6611
6905
  scope?: "workflow" | "stage" | "task" | undefined;
6612
- state: string;
6906
+ field: string;
6613
6907
  };
6614
6908
  }
6615
6909
  | {
6616
- type: "state.append";
6910
+ type: "field.append";
6617
6911
  target: {
6618
6912
  scope?: "workflow" | "stage" | "task" | undefined;
6619
- state: string;
6913
+ field: string;
6620
6914
  };
6621
6915
  value: SourceInternal;
6622
6916
  }
6623
6917
  | {
6624
- type: "state.updateWhere";
6918
+ type: "field.updateWhere";
6625
6919
  target: {
6626
6920
  scope?: "workflow" | "stage" | "task" | undefined;
6627
- state: string;
6921
+ field: string;
6628
6922
  };
6629
6923
  where: OpPredicateInternal;
6630
6924
  value: SourceInternal;
6631
6925
  }
6632
6926
  | {
6633
- type: "state.removeWhere";
6927
+ type: "field.removeWhere";
6634
6928
  target: {
6635
6929
  scope?: "workflow" | "stage" | "task" | undefined;
6636
- state: string;
6930
+ field: string;
6637
6931
  };
6638
6932
  where: OpPredicateInternal;
6639
6933
  }
@@ -6683,7 +6977,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6683
6977
  | undefined;
6684
6978
  }[]
6685
6979
  | undefined;
6686
- state?:
6980
+ fields?:
6687
6981
  | (
6688
6982
  | {
6689
6983
  type:
@@ -6705,6 +6999,7 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6705
6999
  description?: string | undefined;
6706
7000
  required?: boolean | undefined;
6707
7001
  source: SourceInternal;
7002
+ editable?: string | true | string[] | undefined;
6708
7003
  }
6709
7004
  | {
6710
7005
  type: "claim";
@@ -6714,6 +7009,11 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6714
7009
  }
6715
7010
  )[]
6716
7011
  | undefined;
7012
+ editable?:
7013
+ | {
7014
+ [x: string]: string | true | string[];
7015
+ }
7016
+ | undefined;
6717
7017
  }[],
6718
7018
  1,
6719
7019
  "must declare at least one stage"
@@ -6740,6 +7040,37 @@ declare const AuthoringWorkflowSchema: v.StrictObjectSchema<
6740
7040
  >,
6741
7041
  undefined
6742
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
+ >;
6743
7074
  },
6744
7075
  undefined
6745
7076
  >;
@@ -6756,16 +7087,16 @@ export declare function defineEffectDescriptor(
6756
7087
  descriptor: EffectDescriptor,
6757
7088
  ): EffectDescriptor;
6758
7089
 
7090
+ export declare function defineField(
7091
+ entry: AuthoringFieldEntry,
7092
+ ): AuthoringFieldEntry;
7093
+
6759
7094
  export declare function defineGuard(guard: Guard): Guard;
6760
7095
 
6761
7096
  export declare function defineOp(op: AuthoringOp): AuthoringOp;
6762
7097
 
6763
7098
  export declare function defineStage(stage: AuthoringStage): AuthoringStage;
6764
7099
 
6765
- export declare function defineState(
6766
- entry: AuthoringStateEntry,
6767
- ): AuthoringStateEntry;
6768
-
6769
7100
  export declare function defineTask(task: AuthoringTask): AuthoringTask;
6770
7101
 
6771
7102
  export declare function defineTransition(
@@ -6856,7 +7187,7 @@ declare const EffectSchema: v.StrictObjectSchema<
6856
7187
  * deploy like any other.
6857
7188
  *
6858
7189
  * ```ts
6859
- * const regulated = (kinds: string[]) => groq`$state.subject.category in ${kinds}`
7190
+ * const regulated = (kinds: string[]) => groq`$fields.subject.category in ${kinds}`
6860
7191
  * defineTask({ name: "legal", filter: regulated(["finance", "health"]), … })
6861
7192
  * ```
6862
7193
  */
@@ -6895,7 +7226,7 @@ declare const GuardSchema: v.StrictObjectSchema<
6895
7226
  >,
6896
7227
  undefined
6897
7228
  >;
6898
- /** Target docs as `$state` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
7229
+ /** Target docs as `$fields` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
6899
7230
  readonly idRefs: v.OptionalSchema<
6900
7231
  v.ArraySchema<
6901
7232
  v.SchemaWithPipe<
@@ -6948,12 +7279,12 @@ declare const GuardSchema: v.StrictObjectSchema<
6948
7279
  */
6949
7280
  readonly predicate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6950
7281
  /**
6951
- * Projected workflow state the predicate reads as `guard.metadata.*` —
6952
- * the only bridge from the lake eval context (which cannot see `$state`)
6953
- * to workflow state. Values are NOT GROQ: each is a deploy-time read in
7282
+ * Projected workflow fields the predicate reads as `guard.metadata.*` —
7283
+ * the only bridge from the lake eval context (which cannot see `$fields`)
7284
+ * to workflow fields. Values are NOT GROQ: each is a deploy-time read in
6954
7285
  * the guard mini-language — `"$self"`, `"$now"`, or
6955
- * `"$state.<name>[.path]"` — resolved into a bare value at deploy and
6956
- * re-synced by the post-state-op guard refresh.
7286
+ * `"$fields.<name>[.path]"` — resolved into a bare value at deploy and
7287
+ * re-synced by the post-field-op guard refresh.
6957
7288
  */
6958
7289
  readonly metadata: v.OptionalSchema<
6959
7290
  v.RecordSchema<
@@ -7026,9 +7357,9 @@ declare type SourceInternal =
7026
7357
  type: "stage";
7027
7358
  }
7028
7359
  | {
7029
- type: "stateRead";
7360
+ type: "fieldRead";
7030
7361
  scope?: "workflow" | "stage" | undefined;
7031
- state: string;
7362
+ field: string;
7032
7363
  path?: string | undefined;
7033
7364
  }
7034
7365
  | {
@@ -7074,7 +7405,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7074
7405
  * never started cold from a picker. Omitted ⇒ `'workflow'` (startable).
7075
7406
  * Advisory: consumers filter their start pickers on it (see
7076
7407
  * {@link isStartableDefinition}); the engine does NOT refuse a
7077
- * `startInstance` on a `'child'` def — load-bearing `required` state is the
7408
+ * `startInstance` on a `'child'` def — load-bearing `required` field is the
7078
7409
  * runtime backstop.
7079
7410
  */
7080
7411
  role: v.OptionalSchema<
@@ -7091,12 +7422,12 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7091
7422
  v.MinLengthAction<string, 1, "must be a non-empty string">,
7092
7423
  ]
7093
7424
  >;
7094
- /** Workflow-scope state entries. Persist for the instance lifetime. */
7095
- state: v.OptionalSchema<
7425
+ /** Workflow-scope field entries. Persist for the instance lifetime. */
7426
+ fields: v.OptionalSchema<
7096
7427
  v.ArraySchema<
7097
7428
  v.StrictObjectSchema<
7098
7429
  {
7099
- readonly type: v.PicklistSchema<
7430
+ type: v.PicklistSchema<
7100
7431
  readonly [
7101
7432
  "doc.ref",
7102
7433
  "doc.refs",
@@ -7114,32 +7445,43 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7114
7445
  ],
7115
7446
  `Invalid option: expected one of ${string}`
7116
7447
  >;
7117
- readonly name: v.SchemaWithPipe<
7448
+ name: v.SchemaWithPipe<
7118
7449
  readonly [
7119
7450
  v.StringSchema<undefined>,
7120
7451
  v.RegexAction<string, string>,
7121
7452
  ]
7122
7453
  >;
7123
- readonly title: v.OptionalSchema<
7124
- v.StringSchema<undefined>,
7125
- undefined
7126
- >;
7127
- readonly description: v.OptionalSchema<
7128
- v.StringSchema<undefined>,
7129
- undefined
7130
- >;
7454
+ title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7455
+ description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7131
7456
  /**
7132
7457
  * When true, the caller MUST supply this entry at start (via
7133
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
7458
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
7134
7459
  * missing required entry throws rather than silently defaulting to
7135
7460
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
7136
7461
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
7137
7462
  */
7138
- readonly required: v.OptionalSchema<
7139
- v.BooleanSchema<undefined>,
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
+ >,
7140
7483
  undefined
7141
7484
  >;
7142
- readonly source: v.GenericSchema<SourceInternal>;
7143
7485
  },
7144
7486
  undefined
7145
7487
  >,
@@ -7284,7 +7626,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7284
7626
  v.StrictObjectSchema<
7285
7627
  {
7286
7628
  readonly type: v.LiteralSchema<
7287
- "state.set",
7629
+ "field.set",
7288
7630
  undefined
7289
7631
  >;
7290
7632
  readonly target: v.StrictObjectSchema<
@@ -7293,7 +7635,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7293
7635
  readonly ["workflow", "stage", "task"],
7294
7636
  `Invalid option: expected one of ${string}`
7295
7637
  >;
7296
- readonly state: v.SchemaWithPipe<
7638
+ readonly field: v.SchemaWithPipe<
7297
7639
  readonly [
7298
7640
  v.StringSchema<undefined>,
7299
7641
  v.MinLengthAction<
@@ -7313,7 +7655,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7313
7655
  v.StrictObjectSchema<
7314
7656
  {
7315
7657
  readonly type: v.LiteralSchema<
7316
- "state.unset",
7658
+ "field.unset",
7317
7659
  undefined
7318
7660
  >;
7319
7661
  readonly target: v.StrictObjectSchema<
@@ -7322,7 +7664,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7322
7664
  readonly ["workflow", "stage", "task"],
7323
7665
  `Invalid option: expected one of ${string}`
7324
7666
  >;
7325
- readonly state: v.SchemaWithPipe<
7667
+ readonly field: v.SchemaWithPipe<
7326
7668
  readonly [
7327
7669
  v.StringSchema<undefined>,
7328
7670
  v.MinLengthAction<
@@ -7341,7 +7683,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7341
7683
  v.StrictObjectSchema<
7342
7684
  {
7343
7685
  readonly type: v.LiteralSchema<
7344
- "state.append",
7686
+ "field.append",
7345
7687
  undefined
7346
7688
  >;
7347
7689
  readonly target: v.StrictObjectSchema<
@@ -7350,7 +7692,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7350
7692
  readonly ["workflow", "stage", "task"],
7351
7693
  `Invalid option: expected one of ${string}`
7352
7694
  >;
7353
- readonly state: v.SchemaWithPipe<
7695
+ readonly field: v.SchemaWithPipe<
7354
7696
  readonly [
7355
7697
  v.StringSchema<undefined>,
7356
7698
  v.MinLengthAction<
@@ -7370,7 +7712,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7370
7712
  v.StrictObjectSchema<
7371
7713
  {
7372
7714
  readonly type: v.LiteralSchema<
7373
- "state.updateWhere",
7715
+ "field.updateWhere",
7374
7716
  undefined
7375
7717
  >;
7376
7718
  readonly target: v.StrictObjectSchema<
@@ -7379,7 +7721,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7379
7721
  readonly ["workflow", "stage", "task"],
7380
7722
  `Invalid option: expected one of ${string}`
7381
7723
  >;
7382
- readonly state: v.SchemaWithPipe<
7724
+ readonly field: v.SchemaWithPipe<
7383
7725
  readonly [
7384
7726
  v.StringSchema<undefined>,
7385
7727
  v.MinLengthAction<
@@ -7400,7 +7742,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7400
7742
  v.StrictObjectSchema<
7401
7743
  {
7402
7744
  readonly type: v.LiteralSchema<
7403
- "state.removeWhere",
7745
+ "field.removeWhere",
7404
7746
  undefined
7405
7747
  >;
7406
7748
  readonly target: v.StrictObjectSchema<
@@ -7409,7 +7751,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7409
7751
  readonly ["workflow", "stage", "task"],
7410
7752
  `Invalid option: expected one of ${string}`
7411
7753
  >;
7412
- readonly state: v.SchemaWithPipe<
7754
+ readonly field: v.SchemaWithPipe<
7413
7755
  readonly [
7414
7756
  v.StringSchema<undefined>,
7415
7757
  v.MinLengthAction<
@@ -7613,7 +7955,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7613
7955
  v.StrictObjectSchema<
7614
7956
  {
7615
7957
  readonly type: v.LiteralSchema<
7616
- "state.set",
7958
+ "field.set",
7617
7959
  undefined
7618
7960
  >;
7619
7961
  readonly target: v.StrictObjectSchema<
@@ -7626,7 +7968,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7626
7968
  ],
7627
7969
  `Invalid option: expected one of ${string}`
7628
7970
  >;
7629
- readonly state: v.SchemaWithPipe<
7971
+ readonly field: v.SchemaWithPipe<
7630
7972
  readonly [
7631
7973
  v.StringSchema<undefined>,
7632
7974
  v.MinLengthAction<
@@ -7646,7 +7988,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7646
7988
  v.StrictObjectSchema<
7647
7989
  {
7648
7990
  readonly type: v.LiteralSchema<
7649
- "state.unset",
7991
+ "field.unset",
7650
7992
  undefined
7651
7993
  >;
7652
7994
  readonly target: v.StrictObjectSchema<
@@ -7659,7 +8001,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7659
8001
  ],
7660
8002
  `Invalid option: expected one of ${string}`
7661
8003
  >;
7662
- readonly state: v.SchemaWithPipe<
8004
+ readonly field: v.SchemaWithPipe<
7663
8005
  readonly [
7664
8006
  v.StringSchema<undefined>,
7665
8007
  v.MinLengthAction<
@@ -7678,7 +8020,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7678
8020
  v.StrictObjectSchema<
7679
8021
  {
7680
8022
  readonly type: v.LiteralSchema<
7681
- "state.append",
8023
+ "field.append",
7682
8024
  undefined
7683
8025
  >;
7684
8026
  readonly target: v.StrictObjectSchema<
@@ -7691,7 +8033,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7691
8033
  ],
7692
8034
  `Invalid option: expected one of ${string}`
7693
8035
  >;
7694
- readonly state: v.SchemaWithPipe<
8036
+ readonly field: v.SchemaWithPipe<
7695
8037
  readonly [
7696
8038
  v.StringSchema<undefined>,
7697
8039
  v.MinLengthAction<
@@ -7711,7 +8053,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7711
8053
  v.StrictObjectSchema<
7712
8054
  {
7713
8055
  readonly type: v.LiteralSchema<
7714
- "state.updateWhere",
8056
+ "field.updateWhere",
7715
8057
  undefined
7716
8058
  >;
7717
8059
  readonly target: v.StrictObjectSchema<
@@ -7724,7 +8066,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7724
8066
  ],
7725
8067
  `Invalid option: expected one of ${string}`
7726
8068
  >;
7727
- readonly state: v.SchemaWithPipe<
8069
+ readonly field: v.SchemaWithPipe<
7728
8070
  readonly [
7729
8071
  v.StringSchema<undefined>,
7730
8072
  v.MinLengthAction<
@@ -7745,7 +8087,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7745
8087
  v.StrictObjectSchema<
7746
8088
  {
7747
8089
  readonly type: v.LiteralSchema<
7748
- "state.removeWhere",
8090
+ "field.removeWhere",
7749
8091
  undefined
7750
8092
  >;
7751
8093
  readonly target: v.StrictObjectSchema<
@@ -7758,7 +8100,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7758
8100
  ],
7759
8101
  `Invalid option: expected one of ${string}`
7760
8102
  >;
7761
- readonly state: v.SchemaWithPipe<
8103
+ readonly field: v.SchemaWithPipe<
7762
8104
  readonly [
7763
8105
  v.StringSchema<undefined>,
7764
8106
  v.MinLengthAction<
@@ -7923,7 +8265,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7923
8265
  },
7924
8266
  undefined
7925
8267
  >;
7926
- /** Initial state for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
8268
+ /** Initial fields for each subworkflow — entry name → GROQ over `$row` + the parent scope. */
7927
8269
  readonly with: v.OptionalSchema<
7928
8270
  v.RecordSchema<
7929
8271
  v.SchemaWithPipe<
@@ -7986,12 +8328,12 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
7986
8328
  >,
7987
8329
  undefined
7988
8330
  >;
7989
- /** Task-scoped state entries. Resolved at task activation time. */
7990
- state: v.OptionalSchema<
8331
+ /** Task-scoped field entries. Resolved at task activation time. */
8332
+ fields: v.OptionalSchema<
7991
8333
  v.ArraySchema<
7992
8334
  v.StrictObjectSchema<
7993
8335
  {
7994
- readonly type: v.PicklistSchema<
8336
+ type: v.PicklistSchema<
7995
8337
  readonly [
7996
8338
  "doc.ref",
7997
8339
  "doc.refs",
@@ -8009,32 +8351,52 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8009
8351
  ],
8010
8352
  `Invalid option: expected one of ${string}`
8011
8353
  >;
8012
- readonly name: v.SchemaWithPipe<
8354
+ name: v.SchemaWithPipe<
8013
8355
  readonly [
8014
8356
  v.StringSchema<undefined>,
8015
8357
  v.RegexAction<string, string>,
8016
8358
  ]
8017
8359
  >;
8018
- readonly title: v.OptionalSchema<
8360
+ title: v.OptionalSchema<
8019
8361
  v.StringSchema<undefined>,
8020
8362
  undefined
8021
8363
  >;
8022
- readonly description: v.OptionalSchema<
8364
+ description: v.OptionalSchema<
8023
8365
  v.StringSchema<undefined>,
8024
8366
  undefined
8025
8367
  >;
8026
8368
  /**
8027
8369
  * When true, the caller MUST supply this entry at start (via
8028
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
8370
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
8029
8371
  * missing required entry throws rather than silently defaulting to
8030
8372
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
8031
8373
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
8032
8374
  */
8033
- readonly required: v.OptionalSchema<
8375
+ required: v.OptionalSchema<
8034
8376
  v.BooleanSchema<undefined>,
8035
8377
  undefined
8036
8378
  >;
8037
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >;
8038
8400
  },
8039
8401
  undefined
8040
8402
  >,
@@ -8091,7 +8453,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8091
8453
  >,
8092
8454
  ]
8093
8455
  >;
8094
- /** The `state.*` subset — state-write-on-move, the stage's EXIT/ARRIVAL payload. */
8456
+ /** The `field.*` subset — field-write-on-move, the stage's EXIT/ARRIVAL payload. */
8095
8457
  ops: v.OptionalSchema<
8096
8458
  v.ArraySchema<
8097
8459
  v.VariantSchema<
@@ -8100,7 +8462,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8100
8462
  v.StrictObjectSchema<
8101
8463
  {
8102
8464
  readonly type: v.LiteralSchema<
8103
- "state.set",
8465
+ "field.set",
8104
8466
  undefined
8105
8467
  >;
8106
8468
  readonly target: v.StrictObjectSchema<
@@ -8109,7 +8471,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8109
8471
  readonly ["workflow", "stage", "task"],
8110
8472
  `Invalid option: expected one of ${string}`
8111
8473
  >;
8112
- readonly state: v.SchemaWithPipe<
8474
+ readonly field: v.SchemaWithPipe<
8113
8475
  readonly [
8114
8476
  v.StringSchema<undefined>,
8115
8477
  v.MinLengthAction<
@@ -8129,7 +8491,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8129
8491
  v.StrictObjectSchema<
8130
8492
  {
8131
8493
  readonly type: v.LiteralSchema<
8132
- "state.unset",
8494
+ "field.unset",
8133
8495
  undefined
8134
8496
  >;
8135
8497
  readonly target: v.StrictObjectSchema<
@@ -8138,7 +8500,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8138
8500
  readonly ["workflow", "stage", "task"],
8139
8501
  `Invalid option: expected one of ${string}`
8140
8502
  >;
8141
- readonly state: v.SchemaWithPipe<
8503
+ readonly field: v.SchemaWithPipe<
8142
8504
  readonly [
8143
8505
  v.StringSchema<undefined>,
8144
8506
  v.MinLengthAction<
@@ -8157,7 +8519,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8157
8519
  v.StrictObjectSchema<
8158
8520
  {
8159
8521
  readonly type: v.LiteralSchema<
8160
- "state.append",
8522
+ "field.append",
8161
8523
  undefined
8162
8524
  >;
8163
8525
  readonly target: v.StrictObjectSchema<
@@ -8166,7 +8528,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8166
8528
  readonly ["workflow", "stage", "task"],
8167
8529
  `Invalid option: expected one of ${string}`
8168
8530
  >;
8169
- readonly state: v.SchemaWithPipe<
8531
+ readonly field: v.SchemaWithPipe<
8170
8532
  readonly [
8171
8533
  v.StringSchema<undefined>,
8172
8534
  v.MinLengthAction<
@@ -8186,7 +8548,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8186
8548
  v.StrictObjectSchema<
8187
8549
  {
8188
8550
  readonly type: v.LiteralSchema<
8189
- "state.updateWhere",
8551
+ "field.updateWhere",
8190
8552
  undefined
8191
8553
  >;
8192
8554
  readonly target: v.StrictObjectSchema<
@@ -8195,7 +8557,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8195
8557
  readonly ["workflow", "stage", "task"],
8196
8558
  `Invalid option: expected one of ${string}`
8197
8559
  >;
8198
- readonly state: v.SchemaWithPipe<
8560
+ readonly field: v.SchemaWithPipe<
8199
8561
  readonly [
8200
8562
  v.StringSchema<undefined>,
8201
8563
  v.MinLengthAction<
@@ -8216,7 +8578,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8216
8578
  v.StrictObjectSchema<
8217
8579
  {
8218
8580
  readonly type: v.LiteralSchema<
8219
- "state.removeWhere",
8581
+ "field.removeWhere",
8220
8582
  undefined
8221
8583
  >;
8222
8584
  readonly target: v.StrictObjectSchema<
@@ -8225,7 +8587,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8225
8587
  readonly ["workflow", "stage", "task"],
8226
8588
  `Invalid option: expected one of ${string}`
8227
8589
  >;
8228
- readonly state: v.SchemaWithPipe<
8590
+ readonly field: v.SchemaWithPipe<
8229
8591
  readonly [
8230
8592
  v.StringSchema<undefined>,
8231
8593
  v.MinLengthAction<
@@ -8357,7 +8719,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8357
8719
  >,
8358
8720
  undefined
8359
8721
  >;
8360
- /** Target docs as `$state` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
8722
+ /** Target docs as `$fields` reads (or `"$self"`), resolved at deploy to bare ids + the resource. */
8361
8723
  readonly idRefs: v.OptionalSchema<
8362
8724
  v.ArraySchema<
8363
8725
  v.SchemaWithPipe<
@@ -8433,12 +8795,12 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8433
8795
  undefined
8434
8796
  >;
8435
8797
  /**
8436
- * Projected workflow state the predicate reads as `guard.metadata.*` —
8437
- * the only bridge from the lake eval context (which cannot see `$state`)
8438
- * to workflow state. Values are NOT GROQ: each is a deploy-time read in
8798
+ * Projected workflow fields the predicate reads as `guard.metadata.*` —
8799
+ * the only bridge from the lake eval context (which cannot see `$fields`)
8800
+ * to workflow fields. Values are NOT GROQ: each is a deploy-time read in
8439
8801
  * the guard mini-language — `"$self"`, `"$now"`, or
8440
- * `"$state.<name>[.path]"` — resolved into a bare value at deploy and
8441
- * re-synced by the post-state-op guard refresh.
8802
+ * `"$fields.<name>[.path]"` — resolved into a bare value at deploy and
8803
+ * re-synced by the post-field-op guard refresh.
8442
8804
  */
8443
8805
  readonly metadata: v.OptionalSchema<
8444
8806
  v.RecordSchema<
@@ -8473,12 +8835,12 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8473
8835
  >,
8474
8836
  undefined
8475
8837
  >;
8476
- /** Stage-scoped state entries. Resolved at stage entry. */
8477
- state: v.OptionalSchema<
8838
+ /** Stage-scoped field entries. Resolved at stage entry. */
8839
+ fields: v.OptionalSchema<
8478
8840
  v.ArraySchema<
8479
8841
  v.StrictObjectSchema<
8480
8842
  {
8481
- readonly type: v.PicklistSchema<
8843
+ type: v.PicklistSchema<
8482
8844
  readonly [
8483
8845
  "doc.ref",
8484
8846
  "doc.refs",
@@ -8496,32 +8858,52 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8496
8858
  ],
8497
8859
  `Invalid option: expected one of ${string}`
8498
8860
  >;
8499
- readonly name: v.SchemaWithPipe<
8861
+ name: v.SchemaWithPipe<
8500
8862
  readonly [
8501
8863
  v.StringSchema<undefined>,
8502
8864
  v.RegexAction<string, string>,
8503
8865
  ]
8504
8866
  >;
8505
- readonly title: v.OptionalSchema<
8867
+ title: v.OptionalSchema<
8506
8868
  v.StringSchema<undefined>,
8507
8869
  undefined
8508
8870
  >;
8509
- readonly description: v.OptionalSchema<
8871
+ description: v.OptionalSchema<
8510
8872
  v.StringSchema<undefined>,
8511
8873
  undefined
8512
8874
  >;
8513
8875
  /**
8514
8876
  * When true, the caller MUST supply this entry at start (via
8515
- * `initialState`) or spawn (via the parent's `subworkflows.with`). A
8877
+ * `initialFields`) or spawn (via the parent's `subworkflows.with`). A
8516
8878
  * missing required entry throws rather than silently defaulting to
8517
8879
  * `null`/`[]` — the same fail-fast an action's `required` param gets.
8518
8880
  * Valid only on a workflow-scope `init`-sourced entry (deploy invariant).
8519
8881
  */
8520
- readonly required: v.OptionalSchema<
8882
+ required: v.OptionalSchema<
8521
8883
  v.BooleanSchema<undefined>,
8522
8884
  undefined
8523
8885
  >;
8524
- readonly source: v.GenericSchema<SourceInternal>;
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
+ >;
8525
8907
  },
8526
8908
  undefined
8527
8909
  >,
@@ -8529,6 +8911,41 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8529
8911
  >,
8530
8912
  undefined
8531
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
+ >;
8532
8949
  },
8533
8950
  undefined
8534
8951
  >,
@@ -8566,42 +8983,42 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8566
8983
  | "failed";
8567
8984
  }
8568
8985
  | {
8569
- type: "state.set";
8986
+ type: "field.set";
8570
8987
  target: {
8571
8988
  scope: "workflow" | "stage" | "task";
8572
- state: string;
8989
+ field: string;
8573
8990
  };
8574
8991
  value: SourceInternal;
8575
8992
  }
8576
8993
  | {
8577
- type: "state.unset";
8994
+ type: "field.unset";
8578
8995
  target: {
8579
8996
  scope: "workflow" | "stage" | "task";
8580
- state: string;
8997
+ field: string;
8581
8998
  };
8582
8999
  }
8583
9000
  | {
8584
- type: "state.append";
9001
+ type: "field.append";
8585
9002
  target: {
8586
9003
  scope: "workflow" | "stage" | "task";
8587
- state: string;
9004
+ field: string;
8588
9005
  };
8589
9006
  value: SourceInternal;
8590
9007
  }
8591
9008
  | {
8592
- type: "state.updateWhere";
9009
+ type: "field.updateWhere";
8593
9010
  target: {
8594
9011
  scope: "workflow" | "stage" | "task";
8595
- state: string;
9012
+ field: string;
8596
9013
  };
8597
9014
  where: OpPredicateInternal;
8598
9015
  value: SourceInternal;
8599
9016
  }
8600
9017
  | {
8601
- type: "state.removeWhere";
9018
+ type: "field.removeWhere";
8602
9019
  target: {
8603
9020
  scope: "workflow" | "stage" | "task";
8604
- state: string;
9021
+ field: string;
8605
9022
  };
8606
9023
  where: OpPredicateInternal;
8607
9024
  }
@@ -8661,42 +9078,42 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8661
9078
  | "failed";
8662
9079
  }
8663
9080
  | {
8664
- type: "state.set";
9081
+ type: "field.set";
8665
9082
  target: {
8666
9083
  scope: "workflow" | "stage" | "task";
8667
- state: string;
9084
+ field: string;
8668
9085
  };
8669
9086
  value: SourceInternal;
8670
9087
  }
8671
9088
  | {
8672
- type: "state.unset";
9089
+ type: "field.unset";
8673
9090
  target: {
8674
9091
  scope: "workflow" | "stage" | "task";
8675
- state: string;
9092
+ field: string;
8676
9093
  };
8677
9094
  }
8678
9095
  | {
8679
- type: "state.append";
9096
+ type: "field.append";
8680
9097
  target: {
8681
9098
  scope: "workflow" | "stage" | "task";
8682
- state: string;
9099
+ field: string;
8683
9100
  };
8684
9101
  value: SourceInternal;
8685
9102
  }
8686
9103
  | {
8687
- type: "state.updateWhere";
9104
+ type: "field.updateWhere";
8688
9105
  target: {
8689
9106
  scope: "workflow" | "stage" | "task";
8690
- state: string;
9107
+ field: string;
8691
9108
  };
8692
9109
  where: OpPredicateInternal;
8693
9110
  value: SourceInternal;
8694
9111
  }
8695
9112
  | {
8696
- type: "state.removeWhere";
9113
+ type: "field.removeWhere";
8697
9114
  target: {
8698
9115
  scope: "workflow" | "stage" | "task";
8699
- state: string;
9116
+ field: string;
8700
9117
  };
8701
9118
  where: OpPredicateInternal;
8702
9119
  }
@@ -8740,7 +9157,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8740
9157
  | undefined;
8741
9158
  }
8742
9159
  | undefined;
8743
- state?:
9160
+ fields?:
8744
9161
  | {
8745
9162
  type:
8746
9163
  | "doc.ref"
@@ -8761,6 +9178,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8761
9178
  description?: string | undefined;
8762
9179
  required?: boolean | undefined;
8763
9180
  source: SourceInternal;
9181
+ editable?: string | true | undefined;
8764
9182
  }[]
8765
9183
  | undefined;
8766
9184
  }[]
@@ -8775,42 +9193,42 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8775
9193
  ops?:
8776
9194
  | (
8777
9195
  | {
8778
- type: "state.set";
9196
+ type: "field.set";
8779
9197
  target: {
8780
9198
  scope: "workflow" | "stage" | "task";
8781
- state: string;
9199
+ field: string;
8782
9200
  };
8783
9201
  value: SourceInternal;
8784
9202
  }
8785
9203
  | {
8786
- type: "state.unset";
9204
+ type: "field.unset";
8787
9205
  target: {
8788
9206
  scope: "workflow" | "stage" | "task";
8789
- state: string;
9207
+ field: string;
8790
9208
  };
8791
9209
  }
8792
9210
  | {
8793
- type: "state.append";
9211
+ type: "field.append";
8794
9212
  target: {
8795
9213
  scope: "workflow" | "stage" | "task";
8796
- state: string;
9214
+ field: string;
8797
9215
  };
8798
9216
  value: SourceInternal;
8799
9217
  }
8800
9218
  | {
8801
- type: "state.updateWhere";
9219
+ type: "field.updateWhere";
8802
9220
  target: {
8803
9221
  scope: "workflow" | "stage" | "task";
8804
- state: string;
9222
+ field: string;
8805
9223
  };
8806
9224
  where: OpPredicateInternal;
8807
9225
  value: SourceInternal;
8808
9226
  }
8809
9227
  | {
8810
- type: "state.removeWhere";
9228
+ type: "field.removeWhere";
8811
9229
  target: {
8812
9230
  scope: "workflow" | "stage" | "task";
8813
- state: string;
9231
+ field: string;
8814
9232
  };
8815
9233
  where: OpPredicateInternal;
8816
9234
  }
@@ -8860,7 +9278,7 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8860
9278
  | undefined;
8861
9279
  }[]
8862
9280
  | undefined;
8863
- state?:
9281
+ fields?:
8864
9282
  | {
8865
9283
  type:
8866
9284
  | "doc.ref"
@@ -8881,8 +9299,14 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8881
9299
  description?: string | undefined;
8882
9300
  required?: boolean | undefined;
8883
9301
  source: SourceInternal;
9302
+ editable?: string | true | undefined;
8884
9303
  }[]
8885
9304
  | undefined;
9305
+ editable?:
9306
+ | {
9307
+ [x: string]: string | true;
9308
+ }
9309
+ | undefined;
8886
9310
  }[],
8887
9311
  1,
8888
9312
  "must declare at least one stage"
@@ -8909,6 +9333,37 @@ declare const WorkflowDefinitionSchema: v.StrictObjectSchema<
8909
9333
  >,
8910
9334
  undefined
8911
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
+ >;
8912
9367
  },
8913
9368
  undefined
8914
9369
  >;