@cloudhal/core-contracts 0.4.0 → 0.6.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.
@@ -559,6 +559,34 @@ export const SiteSchema = {
559
559
  }
560
560
  }
561
561
  },
562
+ "CollectionExpiry": {
563
+ "type": "object",
564
+ "description": "RFC-0042: a time gate every entry derives from one of its date or datetime fields, checked at render time like Availability.until. A date ends at the start of the next day in the site's time zone.",
565
+ "additionalProperties": false,
566
+ "required": [
567
+ "field",
568
+ "action"
569
+ ],
570
+ "properties": {
571
+ "field": {
572
+ "$ref": "#/$defs/FieldKey"
573
+ },
574
+ "action": {
575
+ "type": "string",
576
+ "description": "unlist: the page stays, the entry leaves listings, feeds, the sitemap and search. hide: every public route answers 404.",
577
+ "enum": [
578
+ "unlist",
579
+ "hide"
580
+ ]
581
+ },
582
+ "afterMinutes": {
583
+ "type": "integer",
584
+ "description": "Grace after the field's instant. Absent: 0.",
585
+ "minimum": 0,
586
+ "maximum": 10080
587
+ }
588
+ }
589
+ },
562
590
  "CollectionLabel": {
563
591
  "type": "object",
564
592
  "additionalProperties": false,
@@ -617,67 +645,644 @@ export const SiteSchema = {
617
645
  "type": "boolean",
618
646
  "description": "RFC-0040: published entries appear in sitemap.xml. Absent: true."
619
647
  },
620
- "sort": {
648
+ "sort": {
649
+ "type": "string",
650
+ "description": "RFC-0040: default order where none is given (Studio's list, entry queries without sort, MCP list_entries). Absent: newest.",
651
+ "enum": [
652
+ "newest",
653
+ "oldest",
654
+ "title"
655
+ ]
656
+ },
657
+ "fields": {
658
+ "type": "array",
659
+ "description": "RFC-0041: the collection's typed custom fields, in form order. Values live in ContentEntry.fields under each key. At most 200 per site and unique keys (checked in code).",
660
+ "minItems": 1,
661
+ "maxItems": 30,
662
+ "items": {
663
+ "$ref": "#/$defs/FieldDefinition"
664
+ }
665
+ },
666
+ "listFields": {
667
+ "type": "array",
668
+ "description": "RFC-0042: fields that listings, queries, Studio columns and MCP may filter and sort by, in column order. Keys of this collection's fields (checked in code).",
669
+ "minItems": 1,
670
+ "maxItems": 4,
671
+ "uniqueItems": true,
672
+ "items": {
673
+ "$ref": "#/$defs/FieldKey"
674
+ }
675
+ },
676
+ "expiry": {
677
+ "$ref": "#/$defs/CollectionExpiry"
678
+ },
679
+ "structuredData": {
680
+ "$ref": "#/$defs/StructuredDataPreset"
681
+ }
682
+ }
683
+ },
684
+ "Consent": {
685
+ "type": "object",
686
+ "additionalProperties": false,
687
+ "required": [
688
+ "mode"
689
+ ],
690
+ "properties": {
691
+ "mode": {
692
+ "type": "string",
693
+ "enum": [
694
+ "none",
695
+ "notice",
696
+ "choices"
697
+ ]
698
+ },
699
+ "policy": {
700
+ "$ref": "#/$defs/Path"
701
+ }
702
+ }
703
+ },
704
+ "Design": {
705
+ "type": "object",
706
+ "description": "The site's design rules for people and agents (RFC-0021): Markdown that agents read with the theme's DESIGN.md before they build. Guidance only: it changes neither rendering nor permissions.",
707
+ "additionalProperties": false,
708
+ "required": [
709
+ "markdown"
710
+ ],
711
+ "properties": {
712
+ "markdown": {
713
+ "type": "string",
714
+ "minLength": 1,
715
+ "maxLength": 24000
716
+ }
717
+ }
718
+ },
719
+ "Domain": {
720
+ "type": "object",
721
+ "additionalProperties": false,
722
+ "required": [
723
+ "hostname",
724
+ "primary"
725
+ ],
726
+ "properties": {
727
+ "hostname": {
728
+ "type": "string",
729
+ "pattern": "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
730
+ "maxLength": 253
731
+ },
732
+ "primary": {
733
+ "type": "boolean"
734
+ }
735
+ }
736
+ },
737
+ "EntryValueProperty": {
738
+ "type": "string",
739
+ "description": "RFC-0042: entry properties a structured-data property may read.",
740
+ "enum": [
741
+ "title",
742
+ "summary",
743
+ "body",
744
+ "coverImage",
745
+ "url",
746
+ "publishedAt",
747
+ "updatedAt"
748
+ ]
749
+ },
750
+ "FieldCondition": {
751
+ "type": "object",
752
+ "description": "RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.",
753
+ "additionalProperties": false,
754
+ "required": [
755
+ "field",
756
+ "op"
757
+ ],
758
+ "properties": {
759
+ "field": {
760
+ "type": "string",
761
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
762
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
763
+ },
764
+ "op": {
765
+ "type": "string",
766
+ "enum": [
767
+ "eq",
768
+ "ne",
769
+ "lt",
770
+ "lte",
771
+ "gt",
772
+ "gte",
773
+ "in",
774
+ "set",
775
+ "unset"
776
+ ]
777
+ },
778
+ "value": {
779
+ "type": "string",
780
+ "minLength": 1,
781
+ "maxLength": 100
782
+ },
783
+ "values": {
784
+ "type": "array",
785
+ "minItems": 1,
786
+ "maxItems": 20,
787
+ "uniqueItems": true,
788
+ "items": {
789
+ "type": "string",
790
+ "minLength": 1,
791
+ "maxLength": 100
792
+ }
793
+ }
794
+ }
795
+ },
796
+ "FieldDefinition": {
797
+ "description": "RFC-0041: one typed custom field of a collection, discriminated by `type`.",
798
+ "oneOf": [
799
+ {
800
+ "title": "TextField",
801
+ "type": "object",
802
+ "description": "Plain text: a string of at most maxLength characters.",
803
+ "additionalProperties": false,
804
+ "required": [
805
+ "key",
806
+ "type",
807
+ "labels",
808
+ "localized"
809
+ ],
810
+ "properties": {
811
+ "key": {
812
+ "$ref": "#/$defs/FieldKey"
813
+ },
814
+ "type": {
815
+ "type": "string",
816
+ "enum": [
817
+ "text"
818
+ ]
819
+ },
820
+ "labels": {
821
+ "$ref": "#/$defs/FieldLabels"
822
+ },
823
+ "localized": {
824
+ "type": "boolean",
825
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
826
+ },
827
+ "requiredToPublish": {
828
+ "type": "boolean",
829
+ "description": "An entry in review or published needs a value. Absent: false."
830
+ },
831
+ "migration": {
832
+ "$ref": "#/$defs/FieldMigration"
833
+ },
834
+ "maxLength": {
835
+ "type": "integer",
836
+ "description": "Absent: 5000.",
837
+ "minimum": 1,
838
+ "maximum": 5000
839
+ },
840
+ "multiline": {
841
+ "type": "boolean",
842
+ "description": "Line breaks allowed. Absent: false."
843
+ },
844
+ "searchable": {
845
+ "type": "boolean",
846
+ "description": "Its words go into site search. Absent: false."
847
+ }
848
+ }
849
+ },
850
+ {
851
+ "title": "RichTextField",
852
+ "type": "object",
853
+ "description": "Cloudhal Markdown v1 (ADR-0028), at most 50 000 characters.",
854
+ "additionalProperties": false,
855
+ "required": [
856
+ "key",
857
+ "type",
858
+ "labels",
859
+ "localized"
860
+ ],
861
+ "properties": {
862
+ "key": {
863
+ "$ref": "#/$defs/FieldKey"
864
+ },
865
+ "type": {
866
+ "type": "string",
867
+ "enum": [
868
+ "richText"
869
+ ]
870
+ },
871
+ "labels": {
872
+ "$ref": "#/$defs/FieldLabels"
873
+ },
874
+ "localized": {
875
+ "type": "boolean",
876
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
877
+ },
878
+ "requiredToPublish": {
879
+ "type": "boolean",
880
+ "description": "An entry in review or published needs a value. Absent: false."
881
+ },
882
+ "migration": {
883
+ "$ref": "#/$defs/FieldMigration"
884
+ },
885
+ "searchable": {
886
+ "type": "boolean",
887
+ "description": "Its words go into site search. Absent: false."
888
+ }
889
+ }
890
+ },
891
+ {
892
+ "title": "NumberField",
893
+ "type": "object",
894
+ "description": "A finite number.",
895
+ "additionalProperties": false,
896
+ "required": [
897
+ "key",
898
+ "type",
899
+ "labels",
900
+ "localized"
901
+ ],
902
+ "properties": {
903
+ "key": {
904
+ "$ref": "#/$defs/FieldKey"
905
+ },
906
+ "type": {
907
+ "type": "string",
908
+ "enum": [
909
+ "number"
910
+ ]
911
+ },
912
+ "labels": {
913
+ "$ref": "#/$defs/FieldLabels"
914
+ },
915
+ "localized": {
916
+ "type": "boolean",
917
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
918
+ },
919
+ "requiredToPublish": {
920
+ "type": "boolean",
921
+ "description": "An entry in review or published needs a value. Absent: false."
922
+ },
923
+ "migration": {
924
+ "$ref": "#/$defs/FieldMigration"
925
+ },
926
+ "integer": {
927
+ "type": "boolean",
928
+ "description": "Whole numbers only. Absent: false."
929
+ },
930
+ "minimum": {
931
+ "type": "number"
932
+ },
933
+ "maximum": {
934
+ "type": "number"
935
+ }
936
+ }
937
+ },
938
+ {
939
+ "title": "BooleanField",
940
+ "type": "object",
941
+ "description": "true or false; absent reads as false, so it cannot be required to publish.",
942
+ "additionalProperties": false,
943
+ "required": [
944
+ "key",
945
+ "type",
946
+ "labels",
947
+ "localized"
948
+ ],
949
+ "properties": {
950
+ "key": {
951
+ "$ref": "#/$defs/FieldKey"
952
+ },
953
+ "type": {
954
+ "type": "string",
955
+ "enum": [
956
+ "boolean"
957
+ ]
958
+ },
959
+ "labels": {
960
+ "$ref": "#/$defs/FieldLabels"
961
+ },
962
+ "localized": {
963
+ "type": "boolean",
964
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
965
+ },
966
+ "migration": {
967
+ "$ref": "#/$defs/FieldMigration"
968
+ }
969
+ }
970
+ },
971
+ {
972
+ "title": "DateField",
973
+ "type": "object",
974
+ "description": "A calendar day without a zone (YYYY-MM-DD).",
975
+ "additionalProperties": false,
976
+ "required": [
977
+ "key",
978
+ "type",
979
+ "labels",
980
+ "localized"
981
+ ],
982
+ "properties": {
983
+ "key": {
984
+ "$ref": "#/$defs/FieldKey"
985
+ },
986
+ "type": {
987
+ "type": "string",
988
+ "enum": [
989
+ "date"
990
+ ]
991
+ },
992
+ "labels": {
993
+ "$ref": "#/$defs/FieldLabels"
994
+ },
995
+ "localized": {
996
+ "type": "boolean",
997
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
998
+ },
999
+ "requiredToPublish": {
1000
+ "type": "boolean",
1001
+ "description": "An entry in review or published needs a value. Absent: false."
1002
+ },
1003
+ "migration": {
1004
+ "$ref": "#/$defs/FieldMigration"
1005
+ }
1006
+ }
1007
+ },
1008
+ {
1009
+ "title": "DateTimeField",
1010
+ "type": "object",
1011
+ "description": "An instant with the zone it was entered in: {at, timeZone} (RFC-0008 §9.1).",
1012
+ "additionalProperties": false,
1013
+ "required": [
1014
+ "key",
1015
+ "type",
1016
+ "labels",
1017
+ "localized"
1018
+ ],
1019
+ "properties": {
1020
+ "key": {
1021
+ "$ref": "#/$defs/FieldKey"
1022
+ },
1023
+ "type": {
1024
+ "type": "string",
1025
+ "enum": [
1026
+ "datetime"
1027
+ ]
1028
+ },
1029
+ "labels": {
1030
+ "$ref": "#/$defs/FieldLabels"
1031
+ },
1032
+ "localized": {
1033
+ "type": "boolean",
1034
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
1035
+ },
1036
+ "requiredToPublish": {
1037
+ "type": "boolean",
1038
+ "description": "An entry in review or published needs a value. Absent: false."
1039
+ },
1040
+ "migration": {
1041
+ "$ref": "#/$defs/FieldMigration"
1042
+ }
1043
+ }
1044
+ },
1045
+ {
1046
+ "title": "UrlField",
1047
+ "type": "object",
1048
+ "description": "A link: https, http, mailto, tel, a site-relative path or a #fragment; at most 2048 characters.",
1049
+ "additionalProperties": false,
1050
+ "required": [
1051
+ "key",
1052
+ "type",
1053
+ "labels",
1054
+ "localized"
1055
+ ],
1056
+ "properties": {
1057
+ "key": {
1058
+ "$ref": "#/$defs/FieldKey"
1059
+ },
1060
+ "type": {
1061
+ "type": "string",
1062
+ "enum": [
1063
+ "url"
1064
+ ]
1065
+ },
1066
+ "labels": {
1067
+ "$ref": "#/$defs/FieldLabels"
1068
+ },
1069
+ "localized": {
1070
+ "type": "boolean",
1071
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
1072
+ },
1073
+ "requiredToPublish": {
1074
+ "type": "boolean",
1075
+ "description": "An entry in review or published needs a value. Absent: false."
1076
+ },
1077
+ "migration": {
1078
+ "$ref": "#/$defs/FieldMigration"
1079
+ }
1080
+ }
1081
+ },
1082
+ {
1083
+ "title": "ImageField",
1084
+ "type": "object",
1085
+ "description": "An image Asset of the same site, by id (asset_…).",
1086
+ "additionalProperties": false,
1087
+ "required": [
1088
+ "key",
1089
+ "type",
1090
+ "labels",
1091
+ "localized"
1092
+ ],
1093
+ "properties": {
1094
+ "key": {
1095
+ "$ref": "#/$defs/FieldKey"
1096
+ },
1097
+ "type": {
1098
+ "type": "string",
1099
+ "enum": [
1100
+ "image"
1101
+ ]
1102
+ },
1103
+ "labels": {
1104
+ "$ref": "#/$defs/FieldLabels"
1105
+ },
1106
+ "localized": {
1107
+ "type": "boolean",
1108
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
1109
+ },
1110
+ "requiredToPublish": {
1111
+ "type": "boolean",
1112
+ "description": "An entry in review or published needs a value. Absent: false."
1113
+ },
1114
+ "migration": {
1115
+ "$ref": "#/$defs/FieldMigration"
1116
+ }
1117
+ }
1118
+ },
1119
+ {
1120
+ "title": "SelectField",
1121
+ "type": "object",
1122
+ "description": "One of a closed list of options, or several when multiple.",
1123
+ "additionalProperties": false,
1124
+ "required": [
1125
+ "key",
1126
+ "type",
1127
+ "labels",
1128
+ "localized",
1129
+ "options"
1130
+ ],
1131
+ "properties": {
1132
+ "key": {
1133
+ "$ref": "#/$defs/FieldKey"
1134
+ },
1135
+ "type": {
1136
+ "type": "string",
1137
+ "enum": [
1138
+ "select"
1139
+ ]
1140
+ },
1141
+ "labels": {
1142
+ "$ref": "#/$defs/FieldLabels"
1143
+ },
1144
+ "localized": {
1145
+ "type": "boolean",
1146
+ "description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
1147
+ },
1148
+ "requiredToPublish": {
1149
+ "type": "boolean",
1150
+ "description": "An entry in review or published needs a value. Absent: false."
1151
+ },
1152
+ "migration": {
1153
+ "$ref": "#/$defs/FieldMigration"
1154
+ },
1155
+ "options": {
1156
+ "type": "array",
1157
+ "minItems": 1,
1158
+ "maxItems": 50,
1159
+ "items": {
1160
+ "$ref": "#/$defs/FieldOption"
1161
+ }
1162
+ },
1163
+ "multiple": {
1164
+ "type": "boolean",
1165
+ "description": "The value is a list of option values. Absent: false."
1166
+ }
1167
+ }
1168
+ }
1169
+ ]
1170
+ },
1171
+ "FieldKey": {
1172
+ "type": "string",
1173
+ "description": "The field's key in ContentEntry.fields: lower camelCase, a JavaScript identifier. Unique in its collection; built-in entry property names are reserved (checked in code).",
1174
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
1175
+ },
1176
+ "FieldLabel": {
1177
+ "type": "object",
1178
+ "additionalProperties": false,
1179
+ "required": [
1180
+ "label"
1181
+ ],
1182
+ "properties": {
1183
+ "label": {
1184
+ "type": "string",
1185
+ "minLength": 1,
1186
+ "maxLength": 100
1187
+ },
1188
+ "help": {
621
1189
  "type": "string",
622
- "description": "RFC-0040: default order where none is given (Studio's list, entry queries without sort, MCP list_entries). Absent: newest.",
623
- "enum": [
624
- "newest",
625
- "oldest",
626
- "title"
627
- ]
1190
+ "maxLength": 300
628
1191
  }
629
1192
  }
630
1193
  },
631
- "Consent": {
1194
+ "FieldLabels": {
632
1195
  "type": "object",
1196
+ "description": "The field's label and help per locale. Missing a locale: the default locale's, then the key.",
1197
+ "propertyNames": {
1198
+ "$ref": "#/$defs/Locale"
1199
+ },
1200
+ "minProperties": 1,
1201
+ "additionalProperties": {
1202
+ "$ref": "#/$defs/FieldLabel"
1203
+ }
1204
+ },
1205
+ "FieldMigration": {
1206
+ "type": "object",
1207
+ "description": "RFC-0041 §6: present only while a field operation rewrites entries.",
633
1208
  "additionalProperties": false,
634
1209
  "required": [
635
- "mode"
1210
+ "id"
636
1211
  ],
637
1212
  "properties": {
638
- "mode": {
1213
+ "id": {
1214
+ "$ref": "#/$defs/Id",
1215
+ "description": "The operation's \"before\" snapshot."
1216
+ },
1217
+ "fromKey": {
1218
+ "$ref": "#/$defs/FieldKey"
1219
+ },
1220
+ "fromType": {
639
1221
  "type": "string",
640
1222
  "enum": [
641
- "none",
642
- "notice",
643
- "choices"
1223
+ "text",
1224
+ "richText",
1225
+ "number",
1226
+ "boolean",
1227
+ "date",
1228
+ "datetime",
1229
+ "url",
1230
+ "image",
1231
+ "select"
644
1232
  ]
645
1233
  },
646
- "policy": {
647
- "$ref": "#/$defs/Path"
1234
+ "fromLocalized": {
1235
+ "type": "boolean"
648
1236
  }
649
1237
  }
650
1238
  },
651
- "Design": {
1239
+ "FieldOption": {
652
1240
  "type": "object",
653
- "description": "The site's design rules for people and agents (RFC-0021): Markdown that agents read with the theme's DESIGN.md before they build. Guidance only: it changes neither rendering nor permissions.",
1241
+ "description": "One option of a select field. Values are unique in the field (checked in code).",
654
1242
  "additionalProperties": false,
655
1243
  "required": [
656
- "markdown"
1244
+ "value",
1245
+ "labels"
657
1246
  ],
658
1247
  "properties": {
659
- "markdown": {
660
- "type": "string",
661
- "minLength": 1,
662
- "maxLength": 24000
1248
+ "value": {
1249
+ "$ref": "#/$defs/Slug",
1250
+ "description": "Stored in entries, never shown."
1251
+ },
1252
+ "labels": {
1253
+ "type": "object",
1254
+ "propertyNames": {
1255
+ "$ref": "#/$defs/Locale"
1256
+ },
1257
+ "minProperties": 1,
1258
+ "additionalProperties": {
1259
+ "type": "string",
1260
+ "minLength": 1,
1261
+ "maxLength": 100
1262
+ }
663
1263
  }
664
1264
  }
665
1265
  },
666
- "Domain": {
1266
+ "FieldOrder": {
667
1267
  "type": "object",
1268
+ "description": "RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.",
668
1269
  "additionalProperties": false,
669
1270
  "required": [
670
- "hostname",
671
- "primary"
1271
+ "field",
1272
+ "direction"
672
1273
  ],
673
1274
  "properties": {
674
- "hostname": {
1275
+ "field": {
675
1276
  "type": "string",
676
- "pattern": "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
677
- "maxLength": 253
1277
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
1278
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
678
1279
  },
679
- "primary": {
680
- "type": "boolean"
1280
+ "direction": {
1281
+ "type": "string",
1282
+ "enum": [
1283
+ "asc",
1284
+ "desc"
1285
+ ]
681
1286
  }
682
1287
  }
683
1288
  },
@@ -1037,6 +1642,18 @@ export const SiteSchema = {
1037
1642
  "description": "Filter expression over term assignments (RFC-0002), e.g. 'category:news+tag:ai' or 'category:news>*'.",
1038
1643
  "minLength": 1,
1039
1644
  "maxLength": 512
1645
+ },
1646
+ "where": {
1647
+ "type": "array",
1648
+ "description": "RFC-0042: conditions on the collection's list fields, ANDed.",
1649
+ "minItems": 1,
1650
+ "maxItems": 4,
1651
+ "items": {
1652
+ "$ref": "#/$defs/FieldCondition"
1653
+ }
1654
+ },
1655
+ "orderBy": {
1656
+ "$ref": "#/$defs/FieldOrder"
1040
1657
  }
1041
1658
  }
1042
1659
  },
@@ -1115,6 +1732,15 @@ export const SiteSchema = {
1115
1732
  }
1116
1733
  ]
1117
1734
  },
1735
+ "SiteValueProperty": {
1736
+ "type": "string",
1737
+ "description": "RFC-0042: site properties a structured-data property may read.",
1738
+ "enum": [
1739
+ "name",
1740
+ "url",
1741
+ "logo"
1742
+ ]
1743
+ },
1118
1744
  "Slug": {
1119
1745
  "type": "string",
1120
1746
  "description": "Lower-case URL segment.",
@@ -1154,6 +1780,131 @@ export const SiteSchema = {
1154
1780
  }
1155
1781
  }
1156
1782
  },
1783
+ "StructuredDataPreset": {
1784
+ "type": "object",
1785
+ "description": "RFC-0042: the JSON-LD type an entry page emits in place of BlogPosting, with its properties mapped to value sources. Paths, fitting field types and required properties are a closed table in code (@cloudhal/core-ts/structured-data).",
1786
+ "additionalProperties": false,
1787
+ "required": [
1788
+ "type",
1789
+ "properties"
1790
+ ],
1791
+ "properties": {
1792
+ "type": {
1793
+ "type": "string",
1794
+ "enum": [
1795
+ "Event",
1796
+ "JobPosting",
1797
+ "Product",
1798
+ "Recipe"
1799
+ ]
1800
+ },
1801
+ "properties": {
1802
+ "type": "object",
1803
+ "description": "Keyed by property path, e.g. startDate or location.address.addressLocality.",
1804
+ "propertyNames": {
1805
+ "type": "string",
1806
+ "pattern": "^[a-z][A-Za-z]{0,39}(\\.[a-z][A-Za-z]{0,39}){0,2}$"
1807
+ },
1808
+ "minProperties": 1,
1809
+ "maxProperties": 40,
1810
+ "additionalProperties": {
1811
+ "$ref": "#/$defs/StructuredDataSource"
1812
+ }
1813
+ }
1814
+ }
1815
+ },
1816
+ "StructuredDataSource": {
1817
+ "description": "RFC-0042: where one JSON-LD property's value comes from, discriminated by `kind`.",
1818
+ "oneOf": [
1819
+ {
1820
+ "title": "FieldValueSource",
1821
+ "type": "object",
1822
+ "description": "A typed field of this collection, converted by its type.",
1823
+ "additionalProperties": false,
1824
+ "required": [
1825
+ "kind",
1826
+ "field"
1827
+ ],
1828
+ "properties": {
1829
+ "kind": {
1830
+ "type": "string",
1831
+ "enum": [
1832
+ "field"
1833
+ ]
1834
+ },
1835
+ "field": {
1836
+ "$ref": "#/$defs/FieldKey"
1837
+ }
1838
+ }
1839
+ },
1840
+ {
1841
+ "title": "EntryValueSource",
1842
+ "type": "object",
1843
+ "description": "A built-in property of the entry.",
1844
+ "additionalProperties": false,
1845
+ "required": [
1846
+ "kind",
1847
+ "property"
1848
+ ],
1849
+ "properties": {
1850
+ "kind": {
1851
+ "type": "string",
1852
+ "enum": [
1853
+ "entry"
1854
+ ]
1855
+ },
1856
+ "property": {
1857
+ "$ref": "#/$defs/EntryValueProperty"
1858
+ }
1859
+ }
1860
+ },
1861
+ {
1862
+ "title": "SiteValueSource",
1863
+ "type": "object",
1864
+ "description": "A property of the site.",
1865
+ "additionalProperties": false,
1866
+ "required": [
1867
+ "kind",
1868
+ "property"
1869
+ ],
1870
+ "properties": {
1871
+ "kind": {
1872
+ "type": "string",
1873
+ "enum": [
1874
+ "site"
1875
+ ]
1876
+ },
1877
+ "property": {
1878
+ "$ref": "#/$defs/SiteValueProperty"
1879
+ }
1880
+ }
1881
+ },
1882
+ {
1883
+ "title": "ConstantValueSource",
1884
+ "type": "object",
1885
+ "description": "A plain-text constant: no control characters, no markup meaning; vocabulary-checked on enum paths (in code).",
1886
+ "additionalProperties": false,
1887
+ "required": [
1888
+ "kind",
1889
+ "value"
1890
+ ],
1891
+ "properties": {
1892
+ "kind": {
1893
+ "type": "string",
1894
+ "enum": [
1895
+ "constant"
1896
+ ]
1897
+ },
1898
+ "value": {
1899
+ "type": "string",
1900
+ "minLength": 1,
1901
+ "maxLength": 200,
1902
+ "pattern": "^[^\\x00-\\x1F\\x7F]+$"
1903
+ }
1904
+ }
1905
+ }
1906
+ ]
1907
+ },
1157
1908
  "SurfaceComponent": {
1158
1909
  "type": "object",
1159
1910
  "description": "One element of a generative UI surface (RFC-0020 §1), in a flat list: `component` names a catalog entry (a PascalCase built-in primitive such as `Stack`, or a registry block type such as `callout`), `children` refer to other ids of the same surface, and `props` follow the entry's schema, which the store checks. Field names follow A2UI v0.9.",
@@ -1434,6 +2185,75 @@ export const PageSchema = {
1434
2185
  ],
1435
2186
  "description": "The markdown dialect a body follows (RFC-0014 §1): 1 = Cloudhal Markdown v1 (CommonMark + GFM + `asset:` + directives; raw HTML escaped). Set by the store on markdown bodies."
1436
2187
  },
2188
+ "FieldCondition": {
2189
+ "type": "object",
2190
+ "description": "RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.",
2191
+ "additionalProperties": false,
2192
+ "required": [
2193
+ "field",
2194
+ "op"
2195
+ ],
2196
+ "properties": {
2197
+ "field": {
2198
+ "type": "string",
2199
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
2200
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
2201
+ },
2202
+ "op": {
2203
+ "type": "string",
2204
+ "enum": [
2205
+ "eq",
2206
+ "ne",
2207
+ "lt",
2208
+ "lte",
2209
+ "gt",
2210
+ "gte",
2211
+ "in",
2212
+ "set",
2213
+ "unset"
2214
+ ]
2215
+ },
2216
+ "value": {
2217
+ "type": "string",
2218
+ "minLength": 1,
2219
+ "maxLength": 100
2220
+ },
2221
+ "values": {
2222
+ "type": "array",
2223
+ "minItems": 1,
2224
+ "maxItems": 20,
2225
+ "uniqueItems": true,
2226
+ "items": {
2227
+ "type": "string",
2228
+ "minLength": 1,
2229
+ "maxLength": 100
2230
+ }
2231
+ }
2232
+ }
2233
+ },
2234
+ "FieldOrder": {
2235
+ "type": "object",
2236
+ "description": "RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.",
2237
+ "additionalProperties": false,
2238
+ "required": [
2239
+ "field",
2240
+ "direction"
2241
+ ],
2242
+ "properties": {
2243
+ "field": {
2244
+ "type": "string",
2245
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
2246
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
2247
+ },
2248
+ "direction": {
2249
+ "type": "string",
2250
+ "enum": [
2251
+ "asc",
2252
+ "desc"
2253
+ ]
2254
+ }
2255
+ }
2256
+ },
1437
2257
  "Id": {
1438
2258
  "type": "string",
1439
2259
  "description": "Prefixed, URL-safe identifier, e.g. site_01HZX8K3Q9. The prefix names the entity kind; agents and the MCP server pass these as opaque handles.",
@@ -1690,6 +2510,18 @@ export const PageSchema = {
1690
2510
  "description": "Filter expression over term assignments (RFC-0002), e.g. 'category:news+tag:ai' or 'category:news>*'.",
1691
2511
  "minLength": 1,
1692
2512
  "maxLength": 512
2513
+ },
2514
+ "where": {
2515
+ "type": "array",
2516
+ "description": "RFC-0042: conditions on the collection's list fields, ANDed.",
2517
+ "minItems": 1,
2518
+ "maxItems": 4,
2519
+ "items": {
2520
+ "$ref": "#/$defs/FieldCondition"
2521
+ }
2522
+ },
2523
+ "orderBy": {
2524
+ "$ref": "#/$defs/FieldOrder"
1693
2525
  }
1694
2526
  }
1695
2527
  },
@@ -2125,6 +2957,18 @@ export const SectionSchema = {
2125
2957
  "description": "Filter expression over term assignments (RFC-0002), e.g. 'category:news+tag:ai' or 'category:news>*'.",
2126
2958
  "minLength": 1,
2127
2959
  "maxLength": 512
2960
+ },
2961
+ "where": {
2962
+ "type": "array",
2963
+ "description": "RFC-0042: conditions on the collection's list fields, ANDed.",
2964
+ "minItems": 1,
2965
+ "maxItems": 4,
2966
+ "items": {
2967
+ "$ref": "#/$defs/FieldCondition"
2968
+ }
2969
+ },
2970
+ "orderBy": {
2971
+ "$ref": "#/$defs/FieldOrder"
2128
2972
  }
2129
2973
  }
2130
2974
  },
@@ -2286,6 +3130,75 @@ export const SectionSchema = {
2286
3130
  ],
2287
3131
  "description": "The markdown dialect a body follows (RFC-0014 §1): 1 = Cloudhal Markdown v1 (CommonMark + GFM + `asset:` + directives; raw HTML escaped). Set by the store on markdown bodies."
2288
3132
  },
3133
+ "FieldCondition": {
3134
+ "type": "object",
3135
+ "description": "RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.",
3136
+ "additionalProperties": false,
3137
+ "required": [
3138
+ "field",
3139
+ "op"
3140
+ ],
3141
+ "properties": {
3142
+ "field": {
3143
+ "type": "string",
3144
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
3145
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
3146
+ },
3147
+ "op": {
3148
+ "type": "string",
3149
+ "enum": [
3150
+ "eq",
3151
+ "ne",
3152
+ "lt",
3153
+ "lte",
3154
+ "gt",
3155
+ "gte",
3156
+ "in",
3157
+ "set",
3158
+ "unset"
3159
+ ]
3160
+ },
3161
+ "value": {
3162
+ "type": "string",
3163
+ "minLength": 1,
3164
+ "maxLength": 100
3165
+ },
3166
+ "values": {
3167
+ "type": "array",
3168
+ "minItems": 1,
3169
+ "maxItems": 20,
3170
+ "uniqueItems": true,
3171
+ "items": {
3172
+ "type": "string",
3173
+ "minLength": 1,
3174
+ "maxLength": 100
3175
+ }
3176
+ }
3177
+ }
3178
+ },
3179
+ "FieldOrder": {
3180
+ "type": "object",
3181
+ "description": "RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.",
3182
+ "additionalProperties": false,
3183
+ "required": [
3184
+ "field",
3185
+ "direction"
3186
+ ],
3187
+ "properties": {
3188
+ "field": {
3189
+ "type": "string",
3190
+ "description": "A field key (site.schema.json FieldKey's pattern, repeated).",
3191
+ "pattern": "^[a-z][A-Za-z0-9]{0,39}$"
3192
+ },
3193
+ "direction": {
3194
+ "type": "string",
3195
+ "enum": [
3196
+ "asc",
3197
+ "desc"
3198
+ ]
3199
+ }
3200
+ }
3201
+ },
2289
3202
  "Id": {
2290
3203
  "type": "string",
2291
3204
  "description": "Prefixed, URL-safe identifier, e.g. site_01HZX8K3Q9. The prefix names the entity kind; agents and the MCP server pass these as opaque handles.",
@@ -2468,7 +3381,7 @@ export const ContentEntrySchema = {
2468
3381
  },
2469
3382
  "fields": {
2470
3383
  "type": "object",
2471
- "description": "Collection-specific values; any JSON.",
3384
+ "description": "Collection-specific values, keyed by field. A collection with typed fields (RFC-0041, Site.collections.<key>.fields) checks each value against its definition on write; otherwise any JSON. An absent key means no value.",
2472
3385
  "additionalProperties": true
2473
3386
  },
2474
3387
  "tags": {