@superdoc-dev/sdk 1.16.0-next.5 → 1.16.0-next.50

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.
@@ -19,6 +19,10 @@
19
19
  ],
20
20
  "description": "The action to perform. One of: blocks, extract, html, info, markdown, text."
21
21
  },
22
+ "in": {
23
+ "$ref": "#/$defs/StoryLocator",
24
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
25
+ },
22
26
  "unflattenLists": {
23
27
  "type": "boolean",
24
28
  "description": "When true, flattens nested list structures in output. Default: false. Only for action 'html'. Omit for other actions."
@@ -125,6 +129,174 @@
125
129
  },
126
130
  "offset": {
127
131
  "type": "number"
132
+ },
133
+ "story": {
134
+ "oneOf": [
135
+ {
136
+ "type": "object",
137
+ "properties": {
138
+ "kind": {
139
+ "const": "story",
140
+ "type": "string"
141
+ },
142
+ "storyType": {
143
+ "const": "body",
144
+ "type": "string"
145
+ }
146
+ },
147
+ "required": [
148
+ "kind",
149
+ "storyType"
150
+ ]
151
+ },
152
+ {
153
+ "type": "object",
154
+ "properties": {
155
+ "kind": {
156
+ "const": "story",
157
+ "type": "string"
158
+ },
159
+ "storyType": {
160
+ "const": "headerFooterSlot",
161
+ "type": "string"
162
+ },
163
+ "section": {
164
+ "type": "object",
165
+ "properties": {
166
+ "kind": {
167
+ "const": "section",
168
+ "type": "string"
169
+ },
170
+ "sectionId": {
171
+ "type": "string"
172
+ }
173
+ },
174
+ "required": [
175
+ "kind",
176
+ "sectionId"
177
+ ]
178
+ },
179
+ "headerFooterKind": {
180
+ "enum": [
181
+ "header",
182
+ "footer"
183
+ ]
184
+ },
185
+ "variant": {
186
+ "enum": [
187
+ "default",
188
+ "first",
189
+ "even"
190
+ ]
191
+ },
192
+ "resolution": {
193
+ "enum": [
194
+ "effective",
195
+ "explicit"
196
+ ]
197
+ },
198
+ "onWrite": {
199
+ "enum": [
200
+ "materializeIfInherited",
201
+ "editResolvedPart",
202
+ "error"
203
+ ]
204
+ }
205
+ },
206
+ "required": [
207
+ "kind",
208
+ "storyType",
209
+ "section",
210
+ "headerFooterKind",
211
+ "variant"
212
+ ]
213
+ },
214
+ {
215
+ "type": "object",
216
+ "properties": {
217
+ "kind": {
218
+ "const": "story",
219
+ "type": "string"
220
+ },
221
+ "storyType": {
222
+ "const": "headerFooterPart",
223
+ "type": "string"
224
+ },
225
+ "refId": {
226
+ "type": "string"
227
+ }
228
+ },
229
+ "required": [
230
+ "kind",
231
+ "storyType",
232
+ "refId"
233
+ ]
234
+ },
235
+ {
236
+ "type": "object",
237
+ "properties": {
238
+ "kind": {
239
+ "const": "story",
240
+ "type": "string"
241
+ },
242
+ "storyType": {
243
+ "const": "footnote",
244
+ "type": "string"
245
+ },
246
+ "noteId": {
247
+ "type": "string"
248
+ }
249
+ },
250
+ "required": [
251
+ "kind",
252
+ "storyType",
253
+ "noteId"
254
+ ]
255
+ },
256
+ {
257
+ "type": "object",
258
+ "properties": {
259
+ "kind": {
260
+ "const": "story",
261
+ "type": "string"
262
+ },
263
+ "storyType": {
264
+ "const": "endnote",
265
+ "type": "string"
266
+ },
267
+ "noteId": {
268
+ "type": "string"
269
+ }
270
+ },
271
+ "required": [
272
+ "kind",
273
+ "storyType",
274
+ "noteId"
275
+ ]
276
+ },
277
+ {
278
+ "type": "object",
279
+ "properties": {
280
+ "kind": {
281
+ "const": "story",
282
+ "type": "string"
283
+ },
284
+ "storyType": {
285
+ "const": "textbox",
286
+ "type": "string"
287
+ },
288
+ "textboxId": {
289
+ "type": "string"
290
+ }
291
+ },
292
+ "required": [
293
+ "kind",
294
+ "storyType",
295
+ "textboxId"
296
+ ]
297
+ }
298
+ ],
299
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
128
300
  }
129
301
  },
130
302
  "required": [
@@ -159,6 +331,174 @@
159
331
  },
160
332
  "nodeId": {
161
333
  "type": "string"
334
+ },
335
+ "story": {
336
+ "oneOf": [
337
+ {
338
+ "type": "object",
339
+ "properties": {
340
+ "kind": {
341
+ "const": "story",
342
+ "type": "string"
343
+ },
344
+ "storyType": {
345
+ "const": "body",
346
+ "type": "string"
347
+ }
348
+ },
349
+ "required": [
350
+ "kind",
351
+ "storyType"
352
+ ]
353
+ },
354
+ {
355
+ "type": "object",
356
+ "properties": {
357
+ "kind": {
358
+ "const": "story",
359
+ "type": "string"
360
+ },
361
+ "storyType": {
362
+ "const": "headerFooterSlot",
363
+ "type": "string"
364
+ },
365
+ "section": {
366
+ "type": "object",
367
+ "properties": {
368
+ "kind": {
369
+ "const": "section",
370
+ "type": "string"
371
+ },
372
+ "sectionId": {
373
+ "type": "string"
374
+ }
375
+ },
376
+ "required": [
377
+ "kind",
378
+ "sectionId"
379
+ ]
380
+ },
381
+ "headerFooterKind": {
382
+ "enum": [
383
+ "header",
384
+ "footer"
385
+ ]
386
+ },
387
+ "variant": {
388
+ "enum": [
389
+ "default",
390
+ "first",
391
+ "even"
392
+ ]
393
+ },
394
+ "resolution": {
395
+ "enum": [
396
+ "effective",
397
+ "explicit"
398
+ ]
399
+ },
400
+ "onWrite": {
401
+ "enum": [
402
+ "materializeIfInherited",
403
+ "editResolvedPart",
404
+ "error"
405
+ ]
406
+ }
407
+ },
408
+ "required": [
409
+ "kind",
410
+ "storyType",
411
+ "section",
412
+ "headerFooterKind",
413
+ "variant"
414
+ ]
415
+ },
416
+ {
417
+ "type": "object",
418
+ "properties": {
419
+ "kind": {
420
+ "const": "story",
421
+ "type": "string"
422
+ },
423
+ "storyType": {
424
+ "const": "headerFooterPart",
425
+ "type": "string"
426
+ },
427
+ "refId": {
428
+ "type": "string"
429
+ }
430
+ },
431
+ "required": [
432
+ "kind",
433
+ "storyType",
434
+ "refId"
435
+ ]
436
+ },
437
+ {
438
+ "type": "object",
439
+ "properties": {
440
+ "kind": {
441
+ "const": "story",
442
+ "type": "string"
443
+ },
444
+ "storyType": {
445
+ "const": "footnote",
446
+ "type": "string"
447
+ },
448
+ "noteId": {
449
+ "type": "string"
450
+ }
451
+ },
452
+ "required": [
453
+ "kind",
454
+ "storyType",
455
+ "noteId"
456
+ ]
457
+ },
458
+ {
459
+ "type": "object",
460
+ "properties": {
461
+ "kind": {
462
+ "const": "story",
463
+ "type": "string"
464
+ },
465
+ "storyType": {
466
+ "const": "endnote",
467
+ "type": "string"
468
+ },
469
+ "noteId": {
470
+ "type": "string"
471
+ }
472
+ },
473
+ "required": [
474
+ "kind",
475
+ "storyType",
476
+ "noteId"
477
+ ]
478
+ },
479
+ {
480
+ "type": "object",
481
+ "properties": {
482
+ "kind": {
483
+ "const": "story",
484
+ "type": "string"
485
+ },
486
+ "storyType": {
487
+ "const": "textbox",
488
+ "type": "string"
489
+ },
490
+ "textboxId": {
491
+ "type": "string"
492
+ }
493
+ },
494
+ "required": [
495
+ "kind",
496
+ "storyType",
497
+ "textboxId"
498
+ ]
499
+ }
500
+ ],
501
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
162
502
  }
163
503
  },
164
504
  "required": [
@@ -197,6 +537,174 @@
197
537
  },
198
538
  "offset": {
199
539
  "type": "number"
540
+ },
541
+ "story": {
542
+ "oneOf": [
543
+ {
544
+ "type": "object",
545
+ "properties": {
546
+ "kind": {
547
+ "const": "story",
548
+ "type": "string"
549
+ },
550
+ "storyType": {
551
+ "const": "body",
552
+ "type": "string"
553
+ }
554
+ },
555
+ "required": [
556
+ "kind",
557
+ "storyType"
558
+ ]
559
+ },
560
+ {
561
+ "type": "object",
562
+ "properties": {
563
+ "kind": {
564
+ "const": "story",
565
+ "type": "string"
566
+ },
567
+ "storyType": {
568
+ "const": "headerFooterSlot",
569
+ "type": "string"
570
+ },
571
+ "section": {
572
+ "type": "object",
573
+ "properties": {
574
+ "kind": {
575
+ "const": "section",
576
+ "type": "string"
577
+ },
578
+ "sectionId": {
579
+ "type": "string"
580
+ }
581
+ },
582
+ "required": [
583
+ "kind",
584
+ "sectionId"
585
+ ]
586
+ },
587
+ "headerFooterKind": {
588
+ "enum": [
589
+ "header",
590
+ "footer"
591
+ ]
592
+ },
593
+ "variant": {
594
+ "enum": [
595
+ "default",
596
+ "first",
597
+ "even"
598
+ ]
599
+ },
600
+ "resolution": {
601
+ "enum": [
602
+ "effective",
603
+ "explicit"
604
+ ]
605
+ },
606
+ "onWrite": {
607
+ "enum": [
608
+ "materializeIfInherited",
609
+ "editResolvedPart",
610
+ "error"
611
+ ]
612
+ }
613
+ },
614
+ "required": [
615
+ "kind",
616
+ "storyType",
617
+ "section",
618
+ "headerFooterKind",
619
+ "variant"
620
+ ]
621
+ },
622
+ {
623
+ "type": "object",
624
+ "properties": {
625
+ "kind": {
626
+ "const": "story",
627
+ "type": "string"
628
+ },
629
+ "storyType": {
630
+ "const": "headerFooterPart",
631
+ "type": "string"
632
+ },
633
+ "refId": {
634
+ "type": "string"
635
+ }
636
+ },
637
+ "required": [
638
+ "kind",
639
+ "storyType",
640
+ "refId"
641
+ ]
642
+ },
643
+ {
644
+ "type": "object",
645
+ "properties": {
646
+ "kind": {
647
+ "const": "story",
648
+ "type": "string"
649
+ },
650
+ "storyType": {
651
+ "const": "footnote",
652
+ "type": "string"
653
+ },
654
+ "noteId": {
655
+ "type": "string"
656
+ }
657
+ },
658
+ "required": [
659
+ "kind",
660
+ "storyType",
661
+ "noteId"
662
+ ]
663
+ },
664
+ {
665
+ "type": "object",
666
+ "properties": {
667
+ "kind": {
668
+ "const": "story",
669
+ "type": "string"
670
+ },
671
+ "storyType": {
672
+ "const": "endnote",
673
+ "type": "string"
674
+ },
675
+ "noteId": {
676
+ "type": "string"
677
+ }
678
+ },
679
+ "required": [
680
+ "kind",
681
+ "storyType",
682
+ "noteId"
683
+ ]
684
+ },
685
+ {
686
+ "type": "object",
687
+ "properties": {
688
+ "kind": {
689
+ "const": "story",
690
+ "type": "string"
691
+ },
692
+ "storyType": {
693
+ "const": "textbox",
694
+ "type": "string"
695
+ },
696
+ "textboxId": {
697
+ "type": "string"
698
+ }
699
+ },
700
+ "required": [
701
+ "kind",
702
+ "storyType",
703
+ "textboxId"
704
+ ]
705
+ }
706
+ ],
707
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
200
708
  }
201
709
  },
202
710
  "required": [
@@ -231,6 +739,174 @@
231
739
  },
232
740
  "nodeId": {
233
741
  "type": "string"
742
+ },
743
+ "story": {
744
+ "oneOf": [
745
+ {
746
+ "type": "object",
747
+ "properties": {
748
+ "kind": {
749
+ "const": "story",
750
+ "type": "string"
751
+ },
752
+ "storyType": {
753
+ "const": "body",
754
+ "type": "string"
755
+ }
756
+ },
757
+ "required": [
758
+ "kind",
759
+ "storyType"
760
+ ]
761
+ },
762
+ {
763
+ "type": "object",
764
+ "properties": {
765
+ "kind": {
766
+ "const": "story",
767
+ "type": "string"
768
+ },
769
+ "storyType": {
770
+ "const": "headerFooterSlot",
771
+ "type": "string"
772
+ },
773
+ "section": {
774
+ "type": "object",
775
+ "properties": {
776
+ "kind": {
777
+ "const": "section",
778
+ "type": "string"
779
+ },
780
+ "sectionId": {
781
+ "type": "string"
782
+ }
783
+ },
784
+ "required": [
785
+ "kind",
786
+ "sectionId"
787
+ ]
788
+ },
789
+ "headerFooterKind": {
790
+ "enum": [
791
+ "header",
792
+ "footer"
793
+ ]
794
+ },
795
+ "variant": {
796
+ "enum": [
797
+ "default",
798
+ "first",
799
+ "even"
800
+ ]
801
+ },
802
+ "resolution": {
803
+ "enum": [
804
+ "effective",
805
+ "explicit"
806
+ ]
807
+ },
808
+ "onWrite": {
809
+ "enum": [
810
+ "materializeIfInherited",
811
+ "editResolvedPart",
812
+ "error"
813
+ ]
814
+ }
815
+ },
816
+ "required": [
817
+ "kind",
818
+ "storyType",
819
+ "section",
820
+ "headerFooterKind",
821
+ "variant"
822
+ ]
823
+ },
824
+ {
825
+ "type": "object",
826
+ "properties": {
827
+ "kind": {
828
+ "const": "story",
829
+ "type": "string"
830
+ },
831
+ "storyType": {
832
+ "const": "headerFooterPart",
833
+ "type": "string"
834
+ },
835
+ "refId": {
836
+ "type": "string"
837
+ }
838
+ },
839
+ "required": [
840
+ "kind",
841
+ "storyType",
842
+ "refId"
843
+ ]
844
+ },
845
+ {
846
+ "type": "object",
847
+ "properties": {
848
+ "kind": {
849
+ "const": "story",
850
+ "type": "string"
851
+ },
852
+ "storyType": {
853
+ "const": "footnote",
854
+ "type": "string"
855
+ },
856
+ "noteId": {
857
+ "type": "string"
858
+ }
859
+ },
860
+ "required": [
861
+ "kind",
862
+ "storyType",
863
+ "noteId"
864
+ ]
865
+ },
866
+ {
867
+ "type": "object",
868
+ "properties": {
869
+ "kind": {
870
+ "const": "story",
871
+ "type": "string"
872
+ },
873
+ "storyType": {
874
+ "const": "endnote",
875
+ "type": "string"
876
+ },
877
+ "noteId": {
878
+ "type": "string"
879
+ }
880
+ },
881
+ "required": [
882
+ "kind",
883
+ "storyType",
884
+ "noteId"
885
+ ]
886
+ },
887
+ {
888
+ "type": "object",
889
+ "properties": {
890
+ "kind": {
891
+ "const": "story",
892
+ "type": "string"
893
+ },
894
+ "storyType": {
895
+ "const": "textbox",
896
+ "type": "string"
897
+ },
898
+ "textboxId": {
899
+ "type": "string"
900
+ }
901
+ },
902
+ "required": [
903
+ "kind",
904
+ "storyType",
905
+ "textboxId"
906
+ ]
907
+ }
908
+ ],
909
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
234
910
  }
235
911
  },
236
912
  "required": [
@@ -254,65 +930,977 @@
254
930
  }
255
931
  ],
256
932
  "description": "A point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries."
257
- }
258
- },
259
- "required": [
260
- "kind",
261
- "start",
262
- "end"
263
- ]
264
- },
265
- {
266
- "type": "object",
267
- "properties": {
268
- "kind": {
269
- "const": "block",
270
- "type": "string"
271
- },
272
- "nodeType": {
273
- "enum": [
274
- "paragraph",
275
- "heading",
276
- "listItem",
277
- "table",
278
- "tableRow",
279
- "tableCell",
280
- "tableOfContents",
281
- "image",
282
- "sdt"
283
- ]
284
- },
285
- "nodeId": {
286
- "type": "string"
287
- }
288
- },
289
- "required": [
290
- "kind",
291
- "nodeType",
292
- "nodeId"
293
- ]
294
- },
295
- {
296
- "type": "object",
297
- "properties": {
298
- "kind": {
299
- "const": "selection",
300
- "type": "string"
301
933
  },
302
- "start": {
934
+ "story": {
303
935
  "oneOf": [
304
936
  {
305
937
  "type": "object",
306
938
  "properties": {
307
939
  "kind": {
308
- "const": "text",
940
+ "const": "story",
309
941
  "type": "string"
310
942
  },
311
- "blockId": {
943
+ "storyType": {
944
+ "const": "body",
945
+ "type": "string"
946
+ }
947
+ },
948
+ "required": [
949
+ "kind",
950
+ "storyType"
951
+ ]
952
+ },
953
+ {
954
+ "type": "object",
955
+ "properties": {
956
+ "kind": {
957
+ "const": "story",
958
+ "type": "string"
959
+ },
960
+ "storyType": {
961
+ "const": "headerFooterSlot",
962
+ "type": "string"
963
+ },
964
+ "section": {
965
+ "type": "object",
966
+ "properties": {
967
+ "kind": {
968
+ "const": "section",
969
+ "type": "string"
970
+ },
971
+ "sectionId": {
972
+ "type": "string"
973
+ }
974
+ },
975
+ "required": [
976
+ "kind",
977
+ "sectionId"
978
+ ]
979
+ },
980
+ "headerFooterKind": {
981
+ "enum": [
982
+ "header",
983
+ "footer"
984
+ ]
985
+ },
986
+ "variant": {
987
+ "enum": [
988
+ "default",
989
+ "first",
990
+ "even"
991
+ ]
992
+ },
993
+ "resolution": {
994
+ "enum": [
995
+ "effective",
996
+ "explicit"
997
+ ]
998
+ },
999
+ "onWrite": {
1000
+ "enum": [
1001
+ "materializeIfInherited",
1002
+ "editResolvedPart",
1003
+ "error"
1004
+ ]
1005
+ }
1006
+ },
1007
+ "required": [
1008
+ "kind",
1009
+ "storyType",
1010
+ "section",
1011
+ "headerFooterKind",
1012
+ "variant"
1013
+ ]
1014
+ },
1015
+ {
1016
+ "type": "object",
1017
+ "properties": {
1018
+ "kind": {
1019
+ "const": "story",
1020
+ "type": "string"
1021
+ },
1022
+ "storyType": {
1023
+ "const": "headerFooterPart",
1024
+ "type": "string"
1025
+ },
1026
+ "refId": {
1027
+ "type": "string"
1028
+ }
1029
+ },
1030
+ "required": [
1031
+ "kind",
1032
+ "storyType",
1033
+ "refId"
1034
+ ]
1035
+ },
1036
+ {
1037
+ "type": "object",
1038
+ "properties": {
1039
+ "kind": {
1040
+ "const": "story",
1041
+ "type": "string"
1042
+ },
1043
+ "storyType": {
1044
+ "const": "footnote",
1045
+ "type": "string"
1046
+ },
1047
+ "noteId": {
1048
+ "type": "string"
1049
+ }
1050
+ },
1051
+ "required": [
1052
+ "kind",
1053
+ "storyType",
1054
+ "noteId"
1055
+ ]
1056
+ },
1057
+ {
1058
+ "type": "object",
1059
+ "properties": {
1060
+ "kind": {
1061
+ "const": "story",
1062
+ "type": "string"
1063
+ },
1064
+ "storyType": {
1065
+ "const": "endnote",
1066
+ "type": "string"
1067
+ },
1068
+ "noteId": {
1069
+ "type": "string"
1070
+ }
1071
+ },
1072
+ "required": [
1073
+ "kind",
1074
+ "storyType",
1075
+ "noteId"
1076
+ ]
1077
+ },
1078
+ {
1079
+ "type": "object",
1080
+ "properties": {
1081
+ "kind": {
1082
+ "const": "story",
1083
+ "type": "string"
1084
+ },
1085
+ "storyType": {
1086
+ "const": "textbox",
1087
+ "type": "string"
1088
+ },
1089
+ "textboxId": {
1090
+ "type": "string"
1091
+ }
1092
+ },
1093
+ "required": [
1094
+ "kind",
1095
+ "storyType",
1096
+ "textboxId"
1097
+ ]
1098
+ }
1099
+ ],
1100
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
1101
+ }
1102
+ },
1103
+ "required": [
1104
+ "kind",
1105
+ "start",
1106
+ "end"
1107
+ ]
1108
+ },
1109
+ {
1110
+ "type": "object",
1111
+ "properties": {
1112
+ "kind": {
1113
+ "const": "block",
1114
+ "type": "string"
1115
+ },
1116
+ "nodeType": {
1117
+ "enum": [
1118
+ "paragraph",
1119
+ "heading",
1120
+ "listItem",
1121
+ "table",
1122
+ "tableRow",
1123
+ "tableCell",
1124
+ "tableOfContents",
1125
+ "image",
1126
+ "sdt"
1127
+ ]
1128
+ },
1129
+ "nodeId": {
1130
+ "type": "string"
1131
+ },
1132
+ "story": {
1133
+ "oneOf": [
1134
+ {
1135
+ "type": "object",
1136
+ "properties": {
1137
+ "kind": {
1138
+ "const": "story",
1139
+ "type": "string"
1140
+ },
1141
+ "storyType": {
1142
+ "const": "body",
1143
+ "type": "string"
1144
+ }
1145
+ },
1146
+ "required": [
1147
+ "kind",
1148
+ "storyType"
1149
+ ]
1150
+ },
1151
+ {
1152
+ "type": "object",
1153
+ "properties": {
1154
+ "kind": {
1155
+ "const": "story",
1156
+ "type": "string"
1157
+ },
1158
+ "storyType": {
1159
+ "const": "headerFooterSlot",
1160
+ "type": "string"
1161
+ },
1162
+ "section": {
1163
+ "type": "object",
1164
+ "properties": {
1165
+ "kind": {
1166
+ "const": "section",
1167
+ "type": "string"
1168
+ },
1169
+ "sectionId": {
1170
+ "type": "string"
1171
+ }
1172
+ },
1173
+ "required": [
1174
+ "kind",
1175
+ "sectionId"
1176
+ ]
1177
+ },
1178
+ "headerFooterKind": {
1179
+ "enum": [
1180
+ "header",
1181
+ "footer"
1182
+ ]
1183
+ },
1184
+ "variant": {
1185
+ "enum": [
1186
+ "default",
1187
+ "first",
1188
+ "even"
1189
+ ]
1190
+ },
1191
+ "resolution": {
1192
+ "enum": [
1193
+ "effective",
1194
+ "explicit"
1195
+ ]
1196
+ },
1197
+ "onWrite": {
1198
+ "enum": [
1199
+ "materializeIfInherited",
1200
+ "editResolvedPart",
1201
+ "error"
1202
+ ]
1203
+ }
1204
+ },
1205
+ "required": [
1206
+ "kind",
1207
+ "storyType",
1208
+ "section",
1209
+ "headerFooterKind",
1210
+ "variant"
1211
+ ]
1212
+ },
1213
+ {
1214
+ "type": "object",
1215
+ "properties": {
1216
+ "kind": {
1217
+ "const": "story",
1218
+ "type": "string"
1219
+ },
1220
+ "storyType": {
1221
+ "const": "headerFooterPart",
1222
+ "type": "string"
1223
+ },
1224
+ "refId": {
1225
+ "type": "string"
1226
+ }
1227
+ },
1228
+ "required": [
1229
+ "kind",
1230
+ "storyType",
1231
+ "refId"
1232
+ ]
1233
+ },
1234
+ {
1235
+ "type": "object",
1236
+ "properties": {
1237
+ "kind": {
1238
+ "const": "story",
1239
+ "type": "string"
1240
+ },
1241
+ "storyType": {
1242
+ "const": "footnote",
1243
+ "type": "string"
1244
+ },
1245
+ "noteId": {
1246
+ "type": "string"
1247
+ }
1248
+ },
1249
+ "required": [
1250
+ "kind",
1251
+ "storyType",
1252
+ "noteId"
1253
+ ]
1254
+ },
1255
+ {
1256
+ "type": "object",
1257
+ "properties": {
1258
+ "kind": {
1259
+ "const": "story",
1260
+ "type": "string"
1261
+ },
1262
+ "storyType": {
1263
+ "const": "endnote",
1264
+ "type": "string"
1265
+ },
1266
+ "noteId": {
1267
+ "type": "string"
1268
+ }
1269
+ },
1270
+ "required": [
1271
+ "kind",
1272
+ "storyType",
1273
+ "noteId"
1274
+ ]
1275
+ },
1276
+ {
1277
+ "type": "object",
1278
+ "properties": {
1279
+ "kind": {
1280
+ "const": "story",
1281
+ "type": "string"
1282
+ },
1283
+ "storyType": {
1284
+ "const": "textbox",
1285
+ "type": "string"
1286
+ },
1287
+ "textboxId": {
1288
+ "type": "string"
1289
+ }
1290
+ },
1291
+ "required": [
1292
+ "kind",
1293
+ "storyType",
1294
+ "textboxId"
1295
+ ]
1296
+ }
1297
+ ],
1298
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
1299
+ }
1300
+ },
1301
+ "required": [
1302
+ "kind",
1303
+ "nodeType",
1304
+ "nodeId"
1305
+ ]
1306
+ },
1307
+ {
1308
+ "type": "object",
1309
+ "properties": {
1310
+ "kind": {
1311
+ "const": "selection",
1312
+ "type": "string"
1313
+ },
1314
+ "start": {
1315
+ "oneOf": [
1316
+ {
1317
+ "type": "object",
1318
+ "properties": {
1319
+ "kind": {
1320
+ "const": "text",
1321
+ "type": "string"
1322
+ },
1323
+ "blockId": {
1324
+ "type": "string"
1325
+ },
1326
+ "offset": {
1327
+ "type": "number"
1328
+ },
1329
+ "story": {
1330
+ "oneOf": [
1331
+ {
1332
+ "type": "object",
1333
+ "properties": {
1334
+ "kind": {
1335
+ "const": "story",
1336
+ "type": "string"
1337
+ },
1338
+ "storyType": {
1339
+ "const": "body",
1340
+ "type": "string"
1341
+ }
1342
+ },
1343
+ "required": [
1344
+ "kind",
1345
+ "storyType"
1346
+ ]
1347
+ },
1348
+ {
1349
+ "type": "object",
1350
+ "properties": {
1351
+ "kind": {
1352
+ "const": "story",
1353
+ "type": "string"
1354
+ },
1355
+ "storyType": {
1356
+ "const": "headerFooterSlot",
1357
+ "type": "string"
1358
+ },
1359
+ "section": {
1360
+ "type": "object",
1361
+ "properties": {
1362
+ "kind": {
1363
+ "const": "section",
1364
+ "type": "string"
1365
+ },
1366
+ "sectionId": {
1367
+ "type": "string"
1368
+ }
1369
+ },
1370
+ "required": [
1371
+ "kind",
1372
+ "sectionId"
1373
+ ]
1374
+ },
1375
+ "headerFooterKind": {
1376
+ "enum": [
1377
+ "header",
1378
+ "footer"
1379
+ ]
1380
+ },
1381
+ "variant": {
1382
+ "enum": [
1383
+ "default",
1384
+ "first",
1385
+ "even"
1386
+ ]
1387
+ },
1388
+ "resolution": {
1389
+ "enum": [
1390
+ "effective",
1391
+ "explicit"
1392
+ ]
1393
+ },
1394
+ "onWrite": {
1395
+ "enum": [
1396
+ "materializeIfInherited",
1397
+ "editResolvedPart",
1398
+ "error"
1399
+ ]
1400
+ }
1401
+ },
1402
+ "required": [
1403
+ "kind",
1404
+ "storyType",
1405
+ "section",
1406
+ "headerFooterKind",
1407
+ "variant"
1408
+ ]
1409
+ },
1410
+ {
1411
+ "type": "object",
1412
+ "properties": {
1413
+ "kind": {
1414
+ "const": "story",
1415
+ "type": "string"
1416
+ },
1417
+ "storyType": {
1418
+ "const": "headerFooterPart",
1419
+ "type": "string"
1420
+ },
1421
+ "refId": {
1422
+ "type": "string"
1423
+ }
1424
+ },
1425
+ "required": [
1426
+ "kind",
1427
+ "storyType",
1428
+ "refId"
1429
+ ]
1430
+ },
1431
+ {
1432
+ "type": "object",
1433
+ "properties": {
1434
+ "kind": {
1435
+ "const": "story",
1436
+ "type": "string"
1437
+ },
1438
+ "storyType": {
1439
+ "const": "footnote",
1440
+ "type": "string"
1441
+ },
1442
+ "noteId": {
1443
+ "type": "string"
1444
+ }
1445
+ },
1446
+ "required": [
1447
+ "kind",
1448
+ "storyType",
1449
+ "noteId"
1450
+ ]
1451
+ },
1452
+ {
1453
+ "type": "object",
1454
+ "properties": {
1455
+ "kind": {
1456
+ "const": "story",
1457
+ "type": "string"
1458
+ },
1459
+ "storyType": {
1460
+ "const": "endnote",
1461
+ "type": "string"
1462
+ },
1463
+ "noteId": {
1464
+ "type": "string"
1465
+ }
1466
+ },
1467
+ "required": [
1468
+ "kind",
1469
+ "storyType",
1470
+ "noteId"
1471
+ ]
1472
+ },
1473
+ {
1474
+ "type": "object",
1475
+ "properties": {
1476
+ "kind": {
1477
+ "const": "story",
1478
+ "type": "string"
1479
+ },
1480
+ "storyType": {
1481
+ "const": "textbox",
1482
+ "type": "string"
1483
+ },
1484
+ "textboxId": {
1485
+ "type": "string"
1486
+ }
1487
+ },
1488
+ "required": [
1489
+ "kind",
1490
+ "storyType",
1491
+ "textboxId"
1492
+ ]
1493
+ }
1494
+ ],
1495
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
1496
+ }
1497
+ },
1498
+ "required": [
1499
+ "kind",
1500
+ "blockId",
1501
+ "offset"
1502
+ ]
1503
+ },
1504
+ {
1505
+ "type": "object",
1506
+ "properties": {
1507
+ "kind": {
1508
+ "const": "nodeEdge",
1509
+ "type": "string"
1510
+ },
1511
+ "node": {
1512
+ "type": "object",
1513
+ "properties": {
1514
+ "kind": {
1515
+ "const": "block",
1516
+ "type": "string"
1517
+ },
1518
+ "nodeType": {
1519
+ "enum": [
1520
+ "paragraph",
1521
+ "heading",
1522
+ "table",
1523
+ "tableOfContents",
1524
+ "sdt",
1525
+ "image"
1526
+ ]
1527
+ },
1528
+ "nodeId": {
1529
+ "type": "string"
1530
+ },
1531
+ "story": {
1532
+ "oneOf": [
1533
+ {
1534
+ "type": "object",
1535
+ "properties": {
1536
+ "kind": {
1537
+ "const": "story",
1538
+ "type": "string"
1539
+ },
1540
+ "storyType": {
1541
+ "const": "body",
1542
+ "type": "string"
1543
+ }
1544
+ },
1545
+ "required": [
1546
+ "kind",
1547
+ "storyType"
1548
+ ]
1549
+ },
1550
+ {
1551
+ "type": "object",
1552
+ "properties": {
1553
+ "kind": {
1554
+ "const": "story",
1555
+ "type": "string"
1556
+ },
1557
+ "storyType": {
1558
+ "const": "headerFooterSlot",
1559
+ "type": "string"
1560
+ },
1561
+ "section": {
1562
+ "type": "object",
1563
+ "properties": {
1564
+ "kind": {
1565
+ "const": "section",
1566
+ "type": "string"
1567
+ },
1568
+ "sectionId": {
1569
+ "type": "string"
1570
+ }
1571
+ },
1572
+ "required": [
1573
+ "kind",
1574
+ "sectionId"
1575
+ ]
1576
+ },
1577
+ "headerFooterKind": {
1578
+ "enum": [
1579
+ "header",
1580
+ "footer"
1581
+ ]
1582
+ },
1583
+ "variant": {
1584
+ "enum": [
1585
+ "default",
1586
+ "first",
1587
+ "even"
1588
+ ]
1589
+ },
1590
+ "resolution": {
1591
+ "enum": [
1592
+ "effective",
1593
+ "explicit"
1594
+ ]
1595
+ },
1596
+ "onWrite": {
1597
+ "enum": [
1598
+ "materializeIfInherited",
1599
+ "editResolvedPart",
1600
+ "error"
1601
+ ]
1602
+ }
1603
+ },
1604
+ "required": [
1605
+ "kind",
1606
+ "storyType",
1607
+ "section",
1608
+ "headerFooterKind",
1609
+ "variant"
1610
+ ]
1611
+ },
1612
+ {
1613
+ "type": "object",
1614
+ "properties": {
1615
+ "kind": {
1616
+ "const": "story",
1617
+ "type": "string"
1618
+ },
1619
+ "storyType": {
1620
+ "const": "headerFooterPart",
1621
+ "type": "string"
1622
+ },
1623
+ "refId": {
1624
+ "type": "string"
1625
+ }
1626
+ },
1627
+ "required": [
1628
+ "kind",
1629
+ "storyType",
1630
+ "refId"
1631
+ ]
1632
+ },
1633
+ {
1634
+ "type": "object",
1635
+ "properties": {
1636
+ "kind": {
1637
+ "const": "story",
1638
+ "type": "string"
1639
+ },
1640
+ "storyType": {
1641
+ "const": "footnote",
1642
+ "type": "string"
1643
+ },
1644
+ "noteId": {
1645
+ "type": "string"
1646
+ }
1647
+ },
1648
+ "required": [
1649
+ "kind",
1650
+ "storyType",
1651
+ "noteId"
1652
+ ]
1653
+ },
1654
+ {
1655
+ "type": "object",
1656
+ "properties": {
1657
+ "kind": {
1658
+ "const": "story",
1659
+ "type": "string"
1660
+ },
1661
+ "storyType": {
1662
+ "const": "endnote",
1663
+ "type": "string"
1664
+ },
1665
+ "noteId": {
1666
+ "type": "string"
1667
+ }
1668
+ },
1669
+ "required": [
1670
+ "kind",
1671
+ "storyType",
1672
+ "noteId"
1673
+ ]
1674
+ },
1675
+ {
1676
+ "type": "object",
1677
+ "properties": {
1678
+ "kind": {
1679
+ "const": "story",
1680
+ "type": "string"
1681
+ },
1682
+ "storyType": {
1683
+ "const": "textbox",
1684
+ "type": "string"
1685
+ },
1686
+ "textboxId": {
1687
+ "type": "string"
1688
+ }
1689
+ },
1690
+ "required": [
1691
+ "kind",
1692
+ "storyType",
1693
+ "textboxId"
1694
+ ]
1695
+ }
1696
+ ],
1697
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
1698
+ }
1699
+ },
1700
+ "required": [
1701
+ "kind",
1702
+ "nodeType",
1703
+ "nodeId"
1704
+ ]
1705
+ },
1706
+ "edge": {
1707
+ "enum": [
1708
+ "before",
1709
+ "after"
1710
+ ]
1711
+ }
1712
+ },
1713
+ "required": [
1714
+ "kind",
1715
+ "node",
1716
+ "edge"
1717
+ ]
1718
+ }
1719
+ ],
1720
+ "description": "A point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries."
1721
+ },
1722
+ "end": {
1723
+ "oneOf": [
1724
+ {
1725
+ "type": "object",
1726
+ "properties": {
1727
+ "kind": {
1728
+ "const": "text",
1729
+ "type": "string"
1730
+ },
1731
+ "blockId": {
312
1732
  "type": "string"
313
1733
  },
314
1734
  "offset": {
315
1735
  "type": "number"
1736
+ },
1737
+ "story": {
1738
+ "oneOf": [
1739
+ {
1740
+ "type": "object",
1741
+ "properties": {
1742
+ "kind": {
1743
+ "const": "story",
1744
+ "type": "string"
1745
+ },
1746
+ "storyType": {
1747
+ "const": "body",
1748
+ "type": "string"
1749
+ }
1750
+ },
1751
+ "required": [
1752
+ "kind",
1753
+ "storyType"
1754
+ ]
1755
+ },
1756
+ {
1757
+ "type": "object",
1758
+ "properties": {
1759
+ "kind": {
1760
+ "const": "story",
1761
+ "type": "string"
1762
+ },
1763
+ "storyType": {
1764
+ "const": "headerFooterSlot",
1765
+ "type": "string"
1766
+ },
1767
+ "section": {
1768
+ "type": "object",
1769
+ "properties": {
1770
+ "kind": {
1771
+ "const": "section",
1772
+ "type": "string"
1773
+ },
1774
+ "sectionId": {
1775
+ "type": "string"
1776
+ }
1777
+ },
1778
+ "required": [
1779
+ "kind",
1780
+ "sectionId"
1781
+ ]
1782
+ },
1783
+ "headerFooterKind": {
1784
+ "enum": [
1785
+ "header",
1786
+ "footer"
1787
+ ]
1788
+ },
1789
+ "variant": {
1790
+ "enum": [
1791
+ "default",
1792
+ "first",
1793
+ "even"
1794
+ ]
1795
+ },
1796
+ "resolution": {
1797
+ "enum": [
1798
+ "effective",
1799
+ "explicit"
1800
+ ]
1801
+ },
1802
+ "onWrite": {
1803
+ "enum": [
1804
+ "materializeIfInherited",
1805
+ "editResolvedPart",
1806
+ "error"
1807
+ ]
1808
+ }
1809
+ },
1810
+ "required": [
1811
+ "kind",
1812
+ "storyType",
1813
+ "section",
1814
+ "headerFooterKind",
1815
+ "variant"
1816
+ ]
1817
+ },
1818
+ {
1819
+ "type": "object",
1820
+ "properties": {
1821
+ "kind": {
1822
+ "const": "story",
1823
+ "type": "string"
1824
+ },
1825
+ "storyType": {
1826
+ "const": "headerFooterPart",
1827
+ "type": "string"
1828
+ },
1829
+ "refId": {
1830
+ "type": "string"
1831
+ }
1832
+ },
1833
+ "required": [
1834
+ "kind",
1835
+ "storyType",
1836
+ "refId"
1837
+ ]
1838
+ },
1839
+ {
1840
+ "type": "object",
1841
+ "properties": {
1842
+ "kind": {
1843
+ "const": "story",
1844
+ "type": "string"
1845
+ },
1846
+ "storyType": {
1847
+ "const": "footnote",
1848
+ "type": "string"
1849
+ },
1850
+ "noteId": {
1851
+ "type": "string"
1852
+ }
1853
+ },
1854
+ "required": [
1855
+ "kind",
1856
+ "storyType",
1857
+ "noteId"
1858
+ ]
1859
+ },
1860
+ {
1861
+ "type": "object",
1862
+ "properties": {
1863
+ "kind": {
1864
+ "const": "story",
1865
+ "type": "string"
1866
+ },
1867
+ "storyType": {
1868
+ "const": "endnote",
1869
+ "type": "string"
1870
+ },
1871
+ "noteId": {
1872
+ "type": "string"
1873
+ }
1874
+ },
1875
+ "required": [
1876
+ "kind",
1877
+ "storyType",
1878
+ "noteId"
1879
+ ]
1880
+ },
1881
+ {
1882
+ "type": "object",
1883
+ "properties": {
1884
+ "kind": {
1885
+ "const": "story",
1886
+ "type": "string"
1887
+ },
1888
+ "storyType": {
1889
+ "const": "textbox",
1890
+ "type": "string"
1891
+ },
1892
+ "textboxId": {
1893
+ "type": "string"
1894
+ }
1895
+ },
1896
+ "required": [
1897
+ "kind",
1898
+ "storyType",
1899
+ "textboxId"
1900
+ ]
1901
+ }
1902
+ ],
1903
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
316
1904
  }
317
1905
  },
318
1906
  "required": [
@@ -347,6 +1935,174 @@
347
1935
  },
348
1936
  "nodeId": {
349
1937
  "type": "string"
1938
+ },
1939
+ "story": {
1940
+ "oneOf": [
1941
+ {
1942
+ "type": "object",
1943
+ "properties": {
1944
+ "kind": {
1945
+ "const": "story",
1946
+ "type": "string"
1947
+ },
1948
+ "storyType": {
1949
+ "const": "body",
1950
+ "type": "string"
1951
+ }
1952
+ },
1953
+ "required": [
1954
+ "kind",
1955
+ "storyType"
1956
+ ]
1957
+ },
1958
+ {
1959
+ "type": "object",
1960
+ "properties": {
1961
+ "kind": {
1962
+ "const": "story",
1963
+ "type": "string"
1964
+ },
1965
+ "storyType": {
1966
+ "const": "headerFooterSlot",
1967
+ "type": "string"
1968
+ },
1969
+ "section": {
1970
+ "type": "object",
1971
+ "properties": {
1972
+ "kind": {
1973
+ "const": "section",
1974
+ "type": "string"
1975
+ },
1976
+ "sectionId": {
1977
+ "type": "string"
1978
+ }
1979
+ },
1980
+ "required": [
1981
+ "kind",
1982
+ "sectionId"
1983
+ ]
1984
+ },
1985
+ "headerFooterKind": {
1986
+ "enum": [
1987
+ "header",
1988
+ "footer"
1989
+ ]
1990
+ },
1991
+ "variant": {
1992
+ "enum": [
1993
+ "default",
1994
+ "first",
1995
+ "even"
1996
+ ]
1997
+ },
1998
+ "resolution": {
1999
+ "enum": [
2000
+ "effective",
2001
+ "explicit"
2002
+ ]
2003
+ },
2004
+ "onWrite": {
2005
+ "enum": [
2006
+ "materializeIfInherited",
2007
+ "editResolvedPart",
2008
+ "error"
2009
+ ]
2010
+ }
2011
+ },
2012
+ "required": [
2013
+ "kind",
2014
+ "storyType",
2015
+ "section",
2016
+ "headerFooterKind",
2017
+ "variant"
2018
+ ]
2019
+ },
2020
+ {
2021
+ "type": "object",
2022
+ "properties": {
2023
+ "kind": {
2024
+ "const": "story",
2025
+ "type": "string"
2026
+ },
2027
+ "storyType": {
2028
+ "const": "headerFooterPart",
2029
+ "type": "string"
2030
+ },
2031
+ "refId": {
2032
+ "type": "string"
2033
+ }
2034
+ },
2035
+ "required": [
2036
+ "kind",
2037
+ "storyType",
2038
+ "refId"
2039
+ ]
2040
+ },
2041
+ {
2042
+ "type": "object",
2043
+ "properties": {
2044
+ "kind": {
2045
+ "const": "story",
2046
+ "type": "string"
2047
+ },
2048
+ "storyType": {
2049
+ "const": "footnote",
2050
+ "type": "string"
2051
+ },
2052
+ "noteId": {
2053
+ "type": "string"
2054
+ }
2055
+ },
2056
+ "required": [
2057
+ "kind",
2058
+ "storyType",
2059
+ "noteId"
2060
+ ]
2061
+ },
2062
+ {
2063
+ "type": "object",
2064
+ "properties": {
2065
+ "kind": {
2066
+ "const": "story",
2067
+ "type": "string"
2068
+ },
2069
+ "storyType": {
2070
+ "const": "endnote",
2071
+ "type": "string"
2072
+ },
2073
+ "noteId": {
2074
+ "type": "string"
2075
+ }
2076
+ },
2077
+ "required": [
2078
+ "kind",
2079
+ "storyType",
2080
+ "noteId"
2081
+ ]
2082
+ },
2083
+ {
2084
+ "type": "object",
2085
+ "properties": {
2086
+ "kind": {
2087
+ "const": "story",
2088
+ "type": "string"
2089
+ },
2090
+ "storyType": {
2091
+ "const": "textbox",
2092
+ "type": "string"
2093
+ },
2094
+ "textboxId": {
2095
+ "type": "string"
2096
+ }
2097
+ },
2098
+ "required": [
2099
+ "kind",
2100
+ "storyType",
2101
+ "textboxId"
2102
+ ]
2103
+ }
2104
+ ],
2105
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
350
2106
  }
351
2107
  },
352
2108
  "required": [
@@ -371,77 +2127,173 @@
371
2127
  ],
372
2128
  "description": "A point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries."
373
2129
  },
374
- "end": {
2130
+ "story": {
375
2131
  "oneOf": [
376
2132
  {
377
2133
  "type": "object",
378
2134
  "properties": {
379
2135
  "kind": {
380
- "const": "text",
2136
+ "const": "story",
381
2137
  "type": "string"
382
2138
  },
383
- "blockId": {
2139
+ "storyType": {
2140
+ "const": "body",
384
2141
  "type": "string"
385
- },
386
- "offset": {
387
- "type": "number"
388
2142
  }
389
2143
  },
390
2144
  "required": [
391
2145
  "kind",
392
- "blockId",
393
- "offset"
2146
+ "storyType"
394
2147
  ]
395
2148
  },
396
2149
  {
397
2150
  "type": "object",
398
2151
  "properties": {
399
2152
  "kind": {
400
- "const": "nodeEdge",
2153
+ "const": "story",
401
2154
  "type": "string"
402
2155
  },
403
- "node": {
2156
+ "storyType": {
2157
+ "const": "headerFooterSlot",
2158
+ "type": "string"
2159
+ },
2160
+ "section": {
404
2161
  "type": "object",
405
2162
  "properties": {
406
2163
  "kind": {
407
- "const": "block",
2164
+ "const": "section",
408
2165
  "type": "string"
409
2166
  },
410
- "nodeType": {
411
- "enum": [
412
- "paragraph",
413
- "heading",
414
- "table",
415
- "tableOfContents",
416
- "sdt",
417
- "image"
418
- ]
419
- },
420
- "nodeId": {
2167
+ "sectionId": {
421
2168
  "type": "string"
422
2169
  }
423
2170
  },
424
2171
  "required": [
425
2172
  "kind",
426
- "nodeType",
427
- "nodeId"
2173
+ "sectionId"
428
2174
  ]
429
2175
  },
430
- "edge": {
2176
+ "headerFooterKind": {
431
2177
  "enum": [
432
- "before",
433
- "after"
2178
+ "header",
2179
+ "footer"
2180
+ ]
2181
+ },
2182
+ "variant": {
2183
+ "enum": [
2184
+ "default",
2185
+ "first",
2186
+ "even"
2187
+ ]
2188
+ },
2189
+ "resolution": {
2190
+ "enum": [
2191
+ "effective",
2192
+ "explicit"
2193
+ ]
2194
+ },
2195
+ "onWrite": {
2196
+ "enum": [
2197
+ "materializeIfInherited",
2198
+ "editResolvedPart",
2199
+ "error"
434
2200
  ]
435
2201
  }
436
2202
  },
437
2203
  "required": [
438
2204
  "kind",
439
- "node",
440
- "edge"
2205
+ "storyType",
2206
+ "section",
2207
+ "headerFooterKind",
2208
+ "variant"
2209
+ ]
2210
+ },
2211
+ {
2212
+ "type": "object",
2213
+ "properties": {
2214
+ "kind": {
2215
+ "const": "story",
2216
+ "type": "string"
2217
+ },
2218
+ "storyType": {
2219
+ "const": "headerFooterPart",
2220
+ "type": "string"
2221
+ },
2222
+ "refId": {
2223
+ "type": "string"
2224
+ }
2225
+ },
2226
+ "required": [
2227
+ "kind",
2228
+ "storyType",
2229
+ "refId"
2230
+ ]
2231
+ },
2232
+ {
2233
+ "type": "object",
2234
+ "properties": {
2235
+ "kind": {
2236
+ "const": "story",
2237
+ "type": "string"
2238
+ },
2239
+ "storyType": {
2240
+ "const": "footnote",
2241
+ "type": "string"
2242
+ },
2243
+ "noteId": {
2244
+ "type": "string"
2245
+ }
2246
+ },
2247
+ "required": [
2248
+ "kind",
2249
+ "storyType",
2250
+ "noteId"
2251
+ ]
2252
+ },
2253
+ {
2254
+ "type": "object",
2255
+ "properties": {
2256
+ "kind": {
2257
+ "const": "story",
2258
+ "type": "string"
2259
+ },
2260
+ "storyType": {
2261
+ "const": "endnote",
2262
+ "type": "string"
2263
+ },
2264
+ "noteId": {
2265
+ "type": "string"
2266
+ }
2267
+ },
2268
+ "required": [
2269
+ "kind",
2270
+ "storyType",
2271
+ "noteId"
2272
+ ]
2273
+ },
2274
+ {
2275
+ "type": "object",
2276
+ "properties": {
2277
+ "kind": {
2278
+ "const": "story",
2279
+ "type": "string"
2280
+ },
2281
+ "storyType": {
2282
+ "const": "textbox",
2283
+ "type": "string"
2284
+ },
2285
+ "textboxId": {
2286
+ "type": "string"
2287
+ }
2288
+ },
2289
+ "required": [
2290
+ "kind",
2291
+ "storyType",
2292
+ "textboxId"
441
2293
  ]
442
2294
  }
443
2295
  ],
444
- "description": "A point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries."
2296
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
445
2297
  }
446
2298
  },
447
2299
  "required": [
@@ -462,6 +2314,192 @@
462
2314
  ],
463
2315
  "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}."
464
2316
  },
2317
+ "in": {
2318
+ "oneOf": [
2319
+ {
2320
+ "oneOf": [
2321
+ {
2322
+ "$ref": "#/$defs/StoryLocator",
2323
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
2324
+ },
2325
+ {
2326
+ "oneOf": [
2327
+ {
2328
+ "type": "object",
2329
+ "properties": {
2330
+ "kind": {
2331
+ "const": "story",
2332
+ "type": "string"
2333
+ },
2334
+ "storyType": {
2335
+ "const": "body",
2336
+ "type": "string"
2337
+ }
2338
+ },
2339
+ "required": [
2340
+ "kind",
2341
+ "storyType"
2342
+ ]
2343
+ },
2344
+ {
2345
+ "type": "object",
2346
+ "properties": {
2347
+ "kind": {
2348
+ "const": "story",
2349
+ "type": "string"
2350
+ },
2351
+ "storyType": {
2352
+ "const": "headerFooterSlot",
2353
+ "type": "string"
2354
+ },
2355
+ "section": {
2356
+ "type": "object",
2357
+ "properties": {
2358
+ "kind": {
2359
+ "const": "section",
2360
+ "type": "string"
2361
+ },
2362
+ "sectionId": {
2363
+ "type": "string"
2364
+ }
2365
+ },
2366
+ "required": [
2367
+ "kind",
2368
+ "sectionId"
2369
+ ]
2370
+ },
2371
+ "headerFooterKind": {
2372
+ "enum": [
2373
+ "header",
2374
+ "footer"
2375
+ ]
2376
+ },
2377
+ "variant": {
2378
+ "enum": [
2379
+ "default",
2380
+ "first",
2381
+ "even"
2382
+ ]
2383
+ },
2384
+ "resolution": {
2385
+ "enum": [
2386
+ "effective",
2387
+ "explicit"
2388
+ ]
2389
+ },
2390
+ "onWrite": {
2391
+ "enum": [
2392
+ "materializeIfInherited",
2393
+ "editResolvedPart",
2394
+ "error"
2395
+ ]
2396
+ }
2397
+ },
2398
+ "required": [
2399
+ "kind",
2400
+ "storyType",
2401
+ "section",
2402
+ "headerFooterKind",
2403
+ "variant"
2404
+ ]
2405
+ },
2406
+ {
2407
+ "type": "object",
2408
+ "properties": {
2409
+ "kind": {
2410
+ "const": "story",
2411
+ "type": "string"
2412
+ },
2413
+ "storyType": {
2414
+ "const": "headerFooterPart",
2415
+ "type": "string"
2416
+ },
2417
+ "refId": {
2418
+ "type": "string"
2419
+ }
2420
+ },
2421
+ "required": [
2422
+ "kind",
2423
+ "storyType",
2424
+ "refId"
2425
+ ]
2426
+ },
2427
+ {
2428
+ "type": "object",
2429
+ "properties": {
2430
+ "kind": {
2431
+ "const": "story",
2432
+ "type": "string"
2433
+ },
2434
+ "storyType": {
2435
+ "const": "footnote",
2436
+ "type": "string"
2437
+ },
2438
+ "noteId": {
2439
+ "type": "string"
2440
+ }
2441
+ },
2442
+ "required": [
2443
+ "kind",
2444
+ "storyType",
2445
+ "noteId"
2446
+ ]
2447
+ },
2448
+ {
2449
+ "type": "object",
2450
+ "properties": {
2451
+ "kind": {
2452
+ "const": "story",
2453
+ "type": "string"
2454
+ },
2455
+ "storyType": {
2456
+ "const": "endnote",
2457
+ "type": "string"
2458
+ },
2459
+ "noteId": {
2460
+ "type": "string"
2461
+ }
2462
+ },
2463
+ "required": [
2464
+ "kind",
2465
+ "storyType",
2466
+ "noteId"
2467
+ ]
2468
+ },
2469
+ {
2470
+ "type": "object",
2471
+ "properties": {
2472
+ "kind": {
2473
+ "const": "story",
2474
+ "type": "string"
2475
+ },
2476
+ "storyType": {
2477
+ "const": "textbox",
2478
+ "type": "string"
2479
+ },
2480
+ "textboxId": {
2481
+ "type": "string"
2482
+ }
2483
+ },
2484
+ "required": [
2485
+ "kind",
2486
+ "storyType",
2487
+ "textboxId"
2488
+ ]
2489
+ }
2490
+ ],
2491
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
2492
+ }
2493
+ ],
2494
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
2495
+ },
2496
+ {
2497
+ "$ref": "#/$defs/StoryLocator",
2498
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
2499
+ }
2500
+ ],
2501
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
2502
+ },
465
2503
  "value": {
466
2504
  "type": "string",
467
2505
  "description": "Text content to insert. Only for action 'insert'. Omit for other actions."
@@ -733,6 +2771,10 @@
733
2771
  ],
734
2772
  "description": "Selection target: {kind:'selection', start:{kind:'text', blockId, offset}, end:{kind:'text', blockId, offset}}. Use 'ref' instead when you have a search result handle. Required for actions 'set_style', 'set_alignment', 'set_indentation', 'set_spacing', 'set_flow_options', 'set_direction'."
735
2773
  },
2774
+ "in": {
2775
+ "$ref": "#/$defs/StoryLocator",
2776
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes. Only for action 'inline'. Omit for other actions."
2777
+ },
736
2778
  "inline": {
737
2779
  "type": "object",
738
2780
  "properties": {
@@ -1563,12 +3605,10 @@
1563
3605
  },
1564
3606
  "left": {
1565
3607
  "type": "integer",
1566
- "minimum": 0,
1567
3608
  "description": "Left indentation in twips (1440 = 1 inch). Only for action 'set_indentation'. Omit for other actions."
1568
3609
  },
1569
3610
  "right": {
1570
3611
  "type": "integer",
1571
- "minimum": 0,
1572
3612
  "description": "Right indentation in twips (1440 = 1 inch). Only for action 'set_indentation'. Omit for other actions."
1573
3613
  },
1574
3614
  "firstLine": {
@@ -1616,6 +3656,22 @@
1616
3656
  "type": "boolean",
1617
3657
  "description": "Only for action 'set_flow_options'. Omit for other actions."
1618
3658
  },
3659
+ "autoSpaceDE": {
3660
+ "type": "boolean",
3661
+ "description": "Only for action 'set_flow_options'. Omit for other actions."
3662
+ },
3663
+ "autoSpaceDN": {
3664
+ "type": "boolean",
3665
+ "description": "Only for action 'set_flow_options'. Omit for other actions."
3666
+ },
3667
+ "adjustRightInd": {
3668
+ "type": "boolean",
3669
+ "description": "Only for action 'set_flow_options'. Omit for other actions."
3670
+ },
3671
+ "snapToGrid": {
3672
+ "type": "boolean",
3673
+ "description": "Only for action 'set_flow_options'. Omit for other actions."
3674
+ },
1619
3675
  "direction": {
1620
3676
  "type": "string",
1621
3677
  "enum": [
@@ -1670,6 +3726,10 @@
1670
3726
  "type": "boolean",
1671
3727
  "description": "Preview the result without applying changes."
1672
3728
  },
3729
+ "in": {
3730
+ "$ref": "#/$defs/StoryLocator",
3731
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
3732
+ },
1673
3733
  "at": {
1674
3734
  "oneOf": [
1675
3735
  {
@@ -2262,7 +4322,7 @@
2262
4322
  },
2263
4323
  {
2264
4324
  "name": "superdoc_comment",
2265
- "description": "Manage document comment threads: create, read, update, and delete. To create a comment, first use superdoc_search to find the target text, then pass action \"create\" with the comment text and a target built from items[0].blocks. For a single-block match use {kind:\"text\", blockId: items[0].blocks[0].blockId, range: items[0].blocks[0].range}. For a cross-block match use {kind:\"text\", segments: items[0].blocks.map(b => ({blockId: b.blockId, range: b.range}))}. Do NOT use items[0].highlightRange (snippet-relative, not block-relative) or items[0].target (a SelectionTarget, not accepted by comments.create). For threaded replies, pass \"parentId\" with the parent comment ID. Action \"list\" returns all comments with optional pagination (limit, offset) and filtering (includeResolved:true to include resolved). Action \"get\" retrieves a single comment by ID. Action \"update\" changes status to \"resolved\" or marks as internal. Action \"delete\" removes a comment or reply by ID. Do NOT pass \"ref\", \"id\", or \"parentId\" when creating a new top-level comment; only \"action\", \"text\", and \"target\" are needed.\n\nEXAMPLES:\n 1. {\"action\":\"create\",\"text\":\"Please review this section.\",\"target\":{\"kind\":\"text\",\"blockId\":\"<blockId>\",\"range\":{\"start\":5,\"end\":25}}}\n 2. {\"action\":\"list\",\"limit\":20,\"offset\":0}\n 3. {\"action\":\"update\",\"id\":\"<commentId>\",\"status\":\"resolved\"}\n 4. {\"action\":\"delete\",\"id\":\"<commentId>\"}",
4325
+ "description": "Manage document comment threads: create, read, update, and delete. To create a comment, first use superdoc_search to find the target text, then pass action \"create\" with the comment text and a target built from items[0].blocks. For a single-block match use {kind:\"text\", blockId: items[0].blocks[0].blockId, range: items[0].blocks[0].range}. For a cross-block match use {kind:\"text\", segments: items[0].blocks.map(b => ({blockId: b.blockId, range: b.range}))}. Do NOT use items[0].highlightRange (snippet-relative, not block-relative) or items[0].target (a SelectionTarget, not accepted by comments.create). For threaded replies, pass \"parentId\" with the parent comment ID. Action \"list\" returns all comments with optional pagination (limit, offset) and filtering (includeResolved:true to include resolved). Action \"get\" retrieves a single comment by ID. Action \"update\" changes comment text, re-anchors the thread, or changes status to \"resolved\". The legacy `isInternal` field remains in schema for v1 compatibility but is not supported for new comment patch behavior. Action \"delete\" removes a comment or reply by ID. Do NOT pass \"ref\", \"id\", or \"parentId\" when creating a new top-level comment; only \"action\", \"text\", and \"target\" are needed.\n\nEXAMPLES:\n 1. {\"action\":\"create\",\"text\":\"Please review this section.\",\"target\":{\"kind\":\"text\",\"blockId\":\"<blockId>\",\"range\":{\"start\":5,\"end\":25}}}\n 2. {\"action\":\"list\",\"limit\":20,\"offset\":0}\n 3. {\"action\":\"update\",\"id\":\"<commentId>\",\"status\":\"resolved\"}\n 4. {\"action\":\"delete\",\"id\":\"<commentId>\"}",
2266
4326
  "input_schema": {
2267
4327
  "type": "object",
2268
4328
  "properties": {
@@ -2305,6 +4365,7 @@
2305
4365
  "target": {
2306
4366
  "oneOf": [
2307
4367
  {
4368
+ "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range}, a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks, a SelectionTarget {kind:'selection', start, end} returned by query.match, a TextSearchCommentTarget {text, story?}, or a TrackedChangeCommentTarget ({kind:'trackedChange', trackedChangeId, side?} or {trackedChangeId, side?}) that names a logical tracked-change id as a convenience anchor .",
2308
4369
  "oneOf": [
2309
4370
  {
2310
4371
  "$ref": "#/$defs/TextAddress"
@@ -2317,28 +4378,74 @@
2317
4378
  },
2318
4379
  {
2319
4380
  "$ref": "#/$defs/CommentTrackedChangeTarget"
4381
+ },
4382
+ {
4383
+ "type": "object",
4384
+ "properties": {
4385
+ "text": {
4386
+ "type": "string",
4387
+ "description": "Text to find and anchor the comment to. The adapter resolves the first body/story match."
4388
+ },
4389
+ "story": {
4390
+ "$ref": "#/$defs/StoryLocator"
4391
+ }
4392
+ },
4393
+ "additionalProperties": false,
4394
+ "required": [
4395
+ "text"
4396
+ ]
2320
4397
  }
2321
- ],
2322
- "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content."
4398
+ ]
2323
4399
  },
2324
4400
  {
2325
4401
  "oneOf": [
2326
4402
  {
2327
4403
  "$ref": "#/$defs/TextAddress"
2328
4404
  },
2329
- {
2330
- "$ref": "#/$defs/TextTarget"
2331
- },
2332
4405
  {
2333
4406
  "$ref": "#/$defs/SelectionTarget"
2334
4407
  },
2335
4408
  {
2336
4409
  "$ref": "#/$defs/CommentTrackedChangeTarget"
4410
+ },
4411
+ {
4412
+ "type": "object",
4413
+ "properties": {
4414
+ "text": {
4415
+ "type": "string",
4416
+ "description": "Text to find and anchor the comment to. The adapter resolves the first body/story match."
4417
+ },
4418
+ "story": {
4419
+ "$ref": "#/$defs/StoryLocator"
4420
+ }
4421
+ },
4422
+ "additionalProperties": false,
4423
+ "required": [
4424
+ "text"
4425
+ ]
2337
4426
  }
2338
- ]
4427
+ ],
4428
+ "description": "New anchor for the comment. Accepts a plain TextAddress, a SelectionTarget {kind:'selection', start, end}, a TextSearchCommentTarget {text, story?}, or a TrackedChangeCommentTarget, with or without kind, that names a logical tracked-change id as a convenience re-anchor target ."
2339
4429
  }
2340
4430
  ],
2341
- "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content. Only for actions 'create', 'update'. Omit for other actions."
4431
+ "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range}, a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks, a SelectionTarget {kind:'selection', start, end} returned by query.match, a TextSearchCommentTarget {text, story?}, or a TrackedChangeCommentTarget ({kind:'trackedChange', trackedChangeId, side?} or {trackedChangeId, side?}) that names a logical tracked-change id as a convenience anchor . Only for actions 'create', 'update'. Omit for other actions."
4432
+ },
4433
+ "trackedChangeId": {
4434
+ "type": "string",
4435
+ "description": "Compatibility shorthand for target: { trackedChangeId }. Used only when target is omitted. Only for action 'create'. Omit for other actions."
4436
+ },
4437
+ "side": {
4438
+ "enum": [
4439
+ "inserted",
4440
+ "deleted",
4441
+ "source",
4442
+ "destination"
4443
+ ],
4444
+ "description": "Optional side for the top-level trackedChangeId shorthand. Only for action 'create'. Omit for other actions."
4445
+ },
4446
+ "story": {
4447
+ "$ref": "#/$defs/StoryLocator",
4448
+ "description": "Optional story for the top-level trackedChangeId shorthand. Only for action 'create'. Omit for other actions."
2342
4449
  },
2343
4450
  "parentId": {
2344
4451
  "type": "string",
@@ -2357,7 +4464,7 @@
2357
4464
  },
2358
4465
  "isInternal": {
2359
4466
  "type": "boolean",
2360
- "description": "When true, marks the comment as internal (hidden from external collaborators). Only for action 'update'. Omit for other actions."
4467
+ "description": "Legacy v1/document-api compatibility field. Not supported for new comment patch behavior. A `comments.patch` request containing `isInternal` fails with `CAPABILITY_UNAVAILABLE` (kernel reason `internal-comments-unsupported`). The field is preserved in the schema only so v1 callers keep their input shape (`comments-spec.md` §7, §14.6). Only for action 'update'. Omit for other actions."
2361
4468
  },
2362
4469
  "includeResolved": {
2363
4470
  "type": "boolean",
@@ -2380,7 +4487,7 @@
2380
4487
  },
2381
4488
  {
2382
4489
  "name": "superdoc_track_changes",
2383
- "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
4490
+ "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"insertion\",\"limit\":10}\n 3. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 4. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 6. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2384
4491
  "input_schema": {
2385
4492
  "type": "object",
2386
4493
  "properties": {
@@ -2402,12 +4509,29 @@
2402
4509
  },
2403
4510
  "type": {
2404
4511
  "enum": [
4512
+ "insertion",
4513
+ "deletion",
4514
+ "replacement",
4515
+ "formatting",
4516
+ "move",
4517
+ "structural",
2405
4518
  "insert",
2406
4519
  "delete",
2407
- "replacement",
2408
4520
  "format"
2409
4521
  ],
2410
- "description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
4522
+ "description": "Filter by change type. Canonical values: 'insertion', 'deletion', 'replacement', 'formatting', 'move', 'structural'. Legacy aliases 'insert', 'delete', and 'format' remain accepted during migration. Only for action 'list'. Omit for other actions."
4523
+ },
4524
+ "in": {
4525
+ "oneOf": [
4526
+ {
4527
+ "$ref": "#/$defs/StoryLocator"
4528
+ },
4529
+ {
4530
+ "const": "all",
4531
+ "type": "string"
4532
+ }
4533
+ ],
4534
+ "description": "Story scope. Omit for body only, pass a StoryLocator for a single story, or 'all' for body + every revision-capable non-body story. Only for action 'list'. Omit for other actions."
2411
4535
  },
2412
4536
  "force": {
2413
4537
  "type": "boolean",
@@ -2428,24 +4552,45 @@
2428
4552
  ],
2429
4553
  "description": "Required for action 'decide'."
2430
4554
  },
4555
+ "expectedRevision": {
4556
+ "type": "string",
4557
+ "description": "Backward-compatible alias for options.expectedRevision. Explicit mutation options take precedence when both are supplied. Only for action 'decide'. Omit for other actions."
4558
+ },
2431
4559
  "target": {
4560
+ "description": "Decision target. Canonical shapes: { kind: 'id', id, story? } (whole logical tracked change), { kind: 'range', range: TextTarget, overlap?, side?, story?, part? } or { kind: 'range', range: { anchor, relativeStart, relativeEnd }, overlap?, side?, story?, part? } (resolves only the selected overlap; may split fragments), { kind: 'all' } (every active tracked change). Legacy { id, story? } / { id, range: { kind: 'partial', start, end } } / { scope: 'all' } shapes are accepted and transparently promoted to canonical targets. Required for action 'decide'.",
2432
4561
  "oneOf": [
2433
4562
  {
2434
4563
  "type": "object",
2435
4564
  "properties": {
4565
+ "kind": {
4566
+ "const": "id",
4567
+ "type": "string"
4568
+ },
2436
4569
  "id": {
2437
4570
  "type": "string"
2438
4571
  },
2439
4572
  "story": {
2440
4573
  "$ref": "#/$defs/StoryLocator"
2441
4574
  },
2442
- "range": {
2443
- "type": "object",
2444
- "description": "Partial-range qualifier on an id target. Rejected with INVALID_INPUT for indivisible (e.g. structural) revisions."
4575
+ "moveRole": {
4576
+ "enum": [
4577
+ "pair",
4578
+ "source",
4579
+ "destination"
4580
+ ],
4581
+ "description": "Optional move pairing assertion. 'pair' requires the resolved tracked change to be a paired move; 'source' / 'destination' further narrow to a specific half. When the assertion does not hold the decide adapter fails closed."
4582
+ },
4583
+ "side": {
4584
+ "enum": [
4585
+ "inserted",
4586
+ "deleted"
4587
+ ],
4588
+ "description": "Optional replacement side. When the id resolves to a paired replacement, decides only the 'inserted' or 'deleted' half, leaving the other half as a standalone pending change."
2445
4589
  }
2446
4590
  },
2447
4591
  "additionalProperties": false,
2448
4592
  "required": [
4593
+ "kind",
2449
4594
  "id"
2450
4595
  ]
2451
4596
  },
@@ -2459,17 +4604,236 @@
2459
4604
  "range": {
2460
4605
  "$ref": "#/$defs/TextTarget"
2461
4606
  },
4607
+ "overlap": {
4608
+ "type": "string",
4609
+ "description": "Optional logical overlap selector for callers that already resolved an ambiguous overlap surface. Adapter-owned interpretation."
4610
+ },
4611
+ "side": {
4612
+ "enum": [
4613
+ "insert",
4614
+ "inserted",
4615
+ "delete",
4616
+ "deleted",
4617
+ "source",
4618
+ "destination"
4619
+ ],
4620
+ "description": "Optional revision side for paired replacement or move targets."
4621
+ },
2462
4622
  "story": {
2463
- "$ref": "#/$defs/StoryLocator"
4623
+ "$ref": "#/$defs/StoryLocator",
4624
+ "description": "Optional story containing the range target."
4625
+ },
4626
+ "part": {
4627
+ "type": "string",
4628
+ "description": "Compatibility alias used by older range callers; interpretation is adapter-owned."
4629
+ }
4630
+ },
4631
+ "additionalProperties": false,
4632
+ "required": [
4633
+ "kind",
4634
+ "range"
4635
+ ]
4636
+ },
4637
+ {
4638
+ "type": "object",
4639
+ "properties": {
4640
+ "kind": {
4641
+ "const": "range",
4642
+ "type": "string"
4643
+ },
4644
+ "range": {
4645
+ "type": "object",
4646
+ "properties": {
4647
+ "anchor": {
4648
+ "type": "string"
4649
+ },
4650
+ "relativeStart": {
4651
+ "type": "integer",
4652
+ "minimum": 0
4653
+ },
4654
+ "relativeEnd": {
4655
+ "type": "integer",
4656
+ "minimum": 0
4657
+ }
4658
+ },
4659
+ "additionalProperties": false,
4660
+ "required": [
4661
+ "anchor",
4662
+ "relativeStart",
4663
+ "relativeEnd"
4664
+ ]
4665
+ },
4666
+ "overlap": {
4667
+ "type": "string",
4668
+ "description": "Optional logical overlap selector for callers that already resolved an ambiguous overlap surface. Adapter-owned interpretation."
4669
+ },
4670
+ "side": {
4671
+ "enum": [
4672
+ "insert",
4673
+ "inserted",
4674
+ "delete",
4675
+ "deleted",
4676
+ "source",
4677
+ "destination"
4678
+ ],
4679
+ "description": "Optional revision side for paired replacement or move targets."
4680
+ },
4681
+ "story": {
4682
+ "$ref": "#/$defs/StoryLocator",
4683
+ "description": "Optional story containing the range target."
4684
+ },
4685
+ "part": {
4686
+ "type": "string",
4687
+ "description": "Compatibility alias used by older range callers; interpretation is adapter-owned."
4688
+ }
4689
+ },
4690
+ "additionalProperties": false,
4691
+ "required": [
4692
+ "kind",
4693
+ "range"
4694
+ ]
4695
+ },
4696
+ {
4697
+ "type": "object",
4698
+ "properties": {
4699
+ "kind": {
4700
+ "const": "range",
4701
+ "type": "string"
4702
+ },
4703
+ "anchor": {
4704
+ "type": "string"
4705
+ },
4706
+ "relativeStart": {
4707
+ "type": "integer",
4708
+ "minimum": 0
4709
+ },
4710
+ "relativeEnd": {
4711
+ "type": "integer",
4712
+ "minimum": 0
4713
+ },
4714
+ "overlap": {
4715
+ "type": "string",
4716
+ "description": "Optional logical overlap selector for callers that already resolved an ambiguous overlap surface. Adapter-owned interpretation."
4717
+ },
4718
+ "side": {
4719
+ "enum": [
4720
+ "insert",
4721
+ "inserted",
4722
+ "delete",
4723
+ "deleted",
4724
+ "source",
4725
+ "destination"
4726
+ ],
4727
+ "description": "Optional revision side for paired replacement or move targets."
4728
+ },
4729
+ "story": {
4730
+ "$ref": "#/$defs/StoryLocator",
4731
+ "description": "Optional story containing the range target."
2464
4732
  },
2465
4733
  "part": {
2466
4734
  "type": "string",
2467
- "description": "Optional part discriminator for the range target."
4735
+ "description": "Compatibility alias used by older range callers; interpretation is adapter-owned."
2468
4736
  }
2469
4737
  },
2470
4738
  "additionalProperties": false,
2471
4739
  "required": [
2472
4740
  "kind",
4741
+ "anchor",
4742
+ "relativeStart",
4743
+ "relativeEnd"
4744
+ ]
4745
+ },
4746
+ {
4747
+ "type": "object",
4748
+ "properties": {
4749
+ "kind": {
4750
+ "const": "all",
4751
+ "type": "string"
4752
+ },
4753
+ "story": {
4754
+ "oneOf": [
4755
+ {
4756
+ "$ref": "#/$defs/StoryLocator"
4757
+ },
4758
+ {
4759
+ "const": "all",
4760
+ "type": "string"
4761
+ }
4762
+ ],
4763
+ "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story."
4764
+ }
4765
+ },
4766
+ "additionalProperties": false,
4767
+ "required": [
4768
+ "kind"
4769
+ ]
4770
+ },
4771
+ {
4772
+ "type": "object",
4773
+ "properties": {
4774
+ "id": {
4775
+ "type": "string"
4776
+ },
4777
+ "story": {
4778
+ "$ref": "#/$defs/StoryLocator"
4779
+ },
4780
+ "moveRole": {
4781
+ "enum": [
4782
+ "pair",
4783
+ "source",
4784
+ "destination"
4785
+ ],
4786
+ "description": "Optional move pairing assertion. 'pair' requires the resolved tracked change to be a paired move; 'source' / 'destination' further narrow to a specific half. When the assertion does not hold the decide adapter fails closed."
4787
+ },
4788
+ "side": {
4789
+ "enum": [
4790
+ "inserted",
4791
+ "deleted"
4792
+ ],
4793
+ "description": "Optional replacement side. When the id resolves to a paired replacement, decides only the 'inserted' or 'deleted' half."
4794
+ }
4795
+ },
4796
+ "additionalProperties": false,
4797
+ "required": [
4798
+ "id"
4799
+ ]
4800
+ },
4801
+ {
4802
+ "type": "object",
4803
+ "properties": {
4804
+ "id": {
4805
+ "type": "string"
4806
+ },
4807
+ "range": {
4808
+ "type": "object",
4809
+ "properties": {
4810
+ "kind": {
4811
+ "const": "partial",
4812
+ "type": "string"
4813
+ },
4814
+ "start": {
4815
+ "type": "integer",
4816
+ "minimum": 0
4817
+ },
4818
+ "end": {
4819
+ "type": "integer",
4820
+ "minimum": 0
4821
+ }
4822
+ },
4823
+ "additionalProperties": false,
4824
+ "required": [
4825
+ "kind",
4826
+ "start",
4827
+ "end"
4828
+ ]
4829
+ },
4830
+ "story": {
4831
+ "$ref": "#/$defs/StoryLocator"
4832
+ }
4833
+ },
4834
+ "additionalProperties": false,
4835
+ "required": [
4836
+ "id",
2473
4837
  "range"
2474
4838
  ]
2475
4839
  },
@@ -2499,8 +4863,7 @@
2499
4863
  "scope"
2500
4864
  ]
2501
4865
  }
2502
- ],
2503
- "description": "Required for action 'decide'."
4866
+ ]
2504
4867
  }
2505
4868
  },
2506
4869
  "required": [
@@ -2515,6 +4878,10 @@
2515
4878
  "input_schema": {
2516
4879
  "type": "object",
2517
4880
  "properties": {
4881
+ "in": {
4882
+ "$ref": "#/$defs/StoryLocator",
4883
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
4884
+ },
2518
4885
  "select": {
2519
4886
  "description": "Search selector. Use {type:'text', pattern:'...'} for text search or {type:'node', nodeType:'paragraph'|'heading'|...} for node search.",
2520
4887
  "oneOf": [
@@ -2528,18 +4895,22 @@
2528
4895
  },
2529
4896
  "pattern": {
2530
4897
  "type": "string",
2531
- "description": "Text or regex pattern to match."
4898
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
2532
4899
  },
2533
4900
  "mode": {
2534
4901
  "enum": [
2535
4902
  "contains",
2536
4903
  "regex"
2537
4904
  ],
2538
- "description": "Match mode: 'contains' (substring) or 'regex'."
4905
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
2539
4906
  },
2540
4907
  "caseSensitive": {
2541
4908
  "type": "boolean",
2542
4909
  "description": "Case-sensitive matching. Default: false."
4910
+ },
4911
+ "wholeWord": {
4912
+ "type": "boolean",
4913
+ "description": "Require word-boundary matches. Default: false."
2543
4914
  }
2544
4915
  },
2545
4916
  "additionalProperties": false,
@@ -2653,6 +5024,10 @@
2653
5024
  ],
2654
5025
  "description": "The action to perform. One of: apply, preview."
2655
5026
  },
5027
+ "in": {
5028
+ "$ref": "#/$defs/StoryLocator",
5029
+ "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes."
5030
+ },
2656
5031
  "expectedRevision": {
2657
5032
  "type": "string",
2658
5033
  "description": "Document revision for optimistic concurrency. Mutation fails if document was modified since this revision. Only for action 'preview'. Omit for other actions."
@@ -2704,18 +5079,22 @@
2704
5079
  },
2705
5080
  "pattern": {
2706
5081
  "type": "string",
2707
- "description": "Text or regex pattern to match."
5082
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
2708
5083
  },
2709
5084
  "mode": {
2710
5085
  "enum": [
2711
5086
  "contains",
2712
5087
  "regex"
2713
5088
  ],
2714
- "description": "Match mode: 'contains' (substring) or 'regex'."
5089
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
2715
5090
  },
2716
5091
  "caseSensitive": {
2717
5092
  "type": "boolean",
2718
5093
  "description": "Case-sensitive matching. Default: false."
5094
+ },
5095
+ "wholeWord": {
5096
+ "type": "boolean",
5097
+ "description": "Require word-boundary matches. Default: false."
2719
5098
  }
2720
5099
  },
2721
5100
  "additionalProperties": false,
@@ -3040,18 +5419,22 @@
3040
5419
  },
3041
5420
  "pattern": {
3042
5421
  "type": "string",
3043
- "description": "Text or regex pattern to match."
5422
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
3044
5423
  },
3045
5424
  "mode": {
3046
5425
  "enum": [
3047
5426
  "contains",
3048
5427
  "regex"
3049
5428
  ],
3050
- "description": "Match mode: 'contains' (substring) or 'regex'."
5429
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
3051
5430
  },
3052
5431
  "caseSensitive": {
3053
5432
  "type": "boolean",
3054
5433
  "description": "Case-sensitive matching. Default: false."
5434
+ },
5435
+ "wholeWord": {
5436
+ "type": "boolean",
5437
+ "description": "Require word-boundary matches. Default: false."
3055
5438
  }
3056
5439
  },
3057
5440
  "additionalProperties": false,
@@ -3325,18 +5708,22 @@
3325
5708
  },
3326
5709
  "pattern": {
3327
5710
  "type": "string",
3328
- "description": "Text or regex pattern to match."
5711
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
3329
5712
  },
3330
5713
  "mode": {
3331
5714
  "enum": [
3332
5715
  "contains",
3333
5716
  "regex"
3334
5717
  ],
3335
- "description": "Match mode: 'contains' (substring) or 'regex'."
5718
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
3336
5719
  },
3337
5720
  "caseSensitive": {
3338
5721
  "type": "boolean",
3339
5722
  "description": "Case-sensitive matching. Default: false."
5723
+ },
5724
+ "wholeWord": {
5725
+ "type": "boolean",
5726
+ "description": "Require word-boundary matches. Default: false."
3340
5727
  }
3341
5728
  },
3342
5729
  "additionalProperties": false,
@@ -3532,18 +5919,22 @@
3532
5919
  },
3533
5920
  "pattern": {
3534
5921
  "type": "string",
3535
- "description": "Text or regex pattern to match."
5922
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
3536
5923
  },
3537
5924
  "mode": {
3538
5925
  "enum": [
3539
5926
  "contains",
3540
5927
  "regex"
3541
5928
  ],
3542
- "description": "Match mode: 'contains' (substring) or 'regex'."
5929
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
3543
5930
  },
3544
5931
  "caseSensitive": {
3545
5932
  "type": "boolean",
3546
5933
  "description": "Case-sensitive matching. Default: false."
5934
+ },
5935
+ "wholeWord": {
5936
+ "type": "boolean",
5937
+ "description": "Require word-boundary matches. Default: false."
3547
5938
  }
3548
5939
  },
3549
5940
  "additionalProperties": false,
@@ -4562,18 +6953,22 @@
4562
6953
  },
4563
6954
  "pattern": {
4564
6955
  "type": "string",
4565
- "description": "Text or regex pattern to match."
6956
+ "description": "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
4566
6957
  },
4567
6958
  "mode": {
4568
6959
  "enum": [
4569
6960
  "contains",
4570
6961
  "regex"
4571
6962
  ],
4572
- "description": "Match mode: 'contains' (substring) or 'regex'."
6963
+ "description": "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
4573
6964
  },
4574
6965
  "caseSensitive": {
4575
6966
  "type": "boolean",
4576
6967
  "description": "Case-sensitive matching. Default: false."
6968
+ },
6969
+ "wholeWord": {
6970
+ "type": "boolean",
6971
+ "description": "Require word-boundary matches. Default: false."
4577
6972
  }
4578
6973
  },
4579
6974
  "additionalProperties": false,
@@ -4891,6 +7286,14 @@
4891
7286
  "type": "number",
4892
7287
  "description": "Only for action 'set_layout'. Omit for other actions."
4893
7288
  },
7289
+ "preferredWidthType": {
7290
+ "enum": [
7291
+ "dxa",
7292
+ "auto",
7293
+ "pct"
7294
+ ],
7295
+ "description": "Only for action 'set_layout'. Omit for other actions."
7296
+ },
4894
7297
  "alignment": {
4895
7298
  "enum": [
4896
7299
  "left",
@@ -4950,7 +7353,7 @@
4950
7353
  "exact",
4951
7354
  "auto"
4952
7355
  ],
4953
- "description": "Required for action 'set_row'."
7356
+ "description": "Only for action 'set_row'. Omit for other actions."
4954
7357
  },
4955
7358
  "allowBreakAcrossPages": {
4956
7359
  "type": "boolean",
@@ -4960,6 +7363,62 @@
4960
7363
  "type": "boolean",
4961
7364
  "description": "Only for action 'set_row_options'. Omit for other actions."
4962
7365
  },
7366
+ "gridBefore": {
7367
+ "type": "integer",
7368
+ "minimum": 0,
7369
+ "description": "Only for action 'set_row_options'. Omit for other actions."
7370
+ },
7371
+ "gridAfter": {
7372
+ "type": "integer",
7373
+ "minimum": 0,
7374
+ "description": "Only for action 'set_row_options'. Omit for other actions."
7375
+ },
7376
+ "wBefore": {
7377
+ "type": "object",
7378
+ "properties": {
7379
+ "value": {
7380
+ "type": "integer",
7381
+ "minimum": 0
7382
+ },
7383
+ "type": {
7384
+ "enum": [
7385
+ "auto",
7386
+ "dxa",
7387
+ "nil",
7388
+ "pct"
7389
+ ]
7390
+ }
7391
+ },
7392
+ "additionalProperties": false,
7393
+ "required": [
7394
+ "value",
7395
+ "type"
7396
+ ],
7397
+ "description": "Only for action 'set_row_options'. Omit for other actions."
7398
+ },
7399
+ "wAfter": {
7400
+ "type": "object",
7401
+ "properties": {
7402
+ "value": {
7403
+ "type": "integer",
7404
+ "minimum": 0
7405
+ },
7406
+ "type": {
7407
+ "enum": [
7408
+ "auto",
7409
+ "dxa",
7410
+ "nil",
7411
+ "pct"
7412
+ ]
7413
+ }
7414
+ },
7415
+ "additionalProperties": false,
7416
+ "required": [
7417
+ "value",
7418
+ "type"
7419
+ ],
7420
+ "description": "Only for action 'set_row_options'. Omit for other actions."
7421
+ },
4963
7422
  "columnIndex": {
4964
7423
  "type": "integer",
4965
7424
  "minimum": 0,