@superdoc-dev/sdk 1.6.0-next.5 → 1.6.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.
@@ -2056,7 +2056,7 @@ const CONTRACT = {
2056
2056
  },
2057
2057
  "type": {
2058
2058
  "type": "string",
2059
- "description": "Block type: paragraph, heading, listItem, table, image, etc."
2059
+ "description": "Block type: paragraph, heading, listItem, image, tableOfContents."
2060
2060
  },
2061
2061
  "text": {
2062
2062
  "type": "string",
@@ -2065,6 +2065,51 @@ const CONTRACT = {
2065
2065
  "headingLevel": {
2066
2066
  "type": "integer",
2067
2067
  "description": "Heading level (1–6). Only present for headings."
2068
+ },
2069
+ "tableContext": {
2070
+ "type": "object",
2071
+ "properties": {
2072
+ "tableOrdinal": {
2073
+ "type": "integer",
2074
+ "description": "0-based table ordinal, unique within one extract() result."
2075
+ },
2076
+ "parentTableOrdinal": {
2077
+ "type": "integer",
2078
+ "description": "Ordinal of the parent table when the containing table is nested."
2079
+ },
2080
+ "parentRowIndex": {
2081
+ "type": "integer",
2082
+ "description": "Row index in the parent table. Set with parentTableOrdinal."
2083
+ },
2084
+ "parentColumnIndex": {
2085
+ "type": "integer",
2086
+ "description": "Column index in the parent table. Set with parentTableOrdinal."
2087
+ },
2088
+ "rowIndex": {
2089
+ "type": "integer",
2090
+ "description": "0-based row index of the containing cell."
2091
+ },
2092
+ "columnIndex": {
2093
+ "type": "integer",
2094
+ "description": "0-based logical grid column, not the row child order."
2095
+ },
2096
+ "rowspan": {
2097
+ "type": "integer",
2098
+ "description": "Number of rows the cell spans."
2099
+ },
2100
+ "colspan": {
2101
+ "type": "integer",
2102
+ "description": "Number of columns the cell spans."
2103
+ }
2104
+ },
2105
+ "additionalProperties": false,
2106
+ "required": [
2107
+ "tableOrdinal",
2108
+ "rowIndex",
2109
+ "columnIndex",
2110
+ "rowspan",
2111
+ "colspan"
2112
+ ]
2068
2113
  }
2069
2114
  },
2070
2115
  "additionalProperties": false,
@@ -5142,7 +5187,7 @@ const CONTRACT = {
5142
5187
  "list"
5143
5188
  ],
5144
5189
  "category": "core",
5145
- "description": "List top-level blocks in document order with IDs, types, and text previews. Supports pagination via offset/limit and optional nodeType filtering.",
5190
+ "description": "List top-level blocks in document order with IDs, types, text previews, and optional full text when includeText:true. Supports pagination via offset/limit and optional nodeType filtering.",
5146
5191
  "requiresDocumentContext": true,
5147
5192
  "docRequirement": "optional",
5148
5193
  "responseEnvelopeKey": "result",
@@ -5213,6 +5258,13 @@ const CONTRACT = {
5213
5258
  "description": "Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types."
5214
5259
  },
5215
5260
  "description": "Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types."
5261
+ },
5262
+ {
5263
+ "name": "includeText",
5264
+ "kind": "flag",
5265
+ "type": "boolean",
5266
+ "flag": "include-text",
5267
+ "description": "When true, includes the full flattened block text in each block entry."
5216
5268
  }
5217
5269
  ],
5218
5270
  "constraints": null,
@@ -5249,6 +5301,10 @@ const CONTRACT = {
5249
5301
  ]
5250
5302
  },
5251
5303
  "description": "Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types."
5304
+ },
5305
+ "includeText": {
5306
+ "type": "boolean",
5307
+ "description": "When true, includes the full flattened block text in each block entry."
5252
5308
  }
5253
5309
  },
5254
5310
  "additionalProperties": false
@@ -5294,6 +5350,17 @@ const CONTRACT = {
5294
5350
  }
5295
5351
  ]
5296
5352
  },
5353
+ "text": {
5354
+ "oneOf": [
5355
+ {
5356
+ "type": "string"
5357
+ },
5358
+ {
5359
+ "type": "null"
5360
+ }
5361
+ ],
5362
+ "description": "Full flattened block text when requested with includeText."
5363
+ },
5297
5364
  "isEmpty": {
5298
5365
  "type": "boolean"
5299
5366
  },
@@ -60049,6 +60116,178 @@ const CONTRACT = {
60049
60116
  "description": "Filter by change type: 'insert', 'delete', or 'format'."
60050
60117
  },
60051
60118
  "description": "Filter by change type: 'insert', 'delete', or 'format'."
60119
+ },
60120
+ {
60121
+ "name": "in",
60122
+ "kind": "jsonFlag",
60123
+ "type": "json",
60124
+ "flag": "in-json",
60125
+ "schema": {
60126
+ "oneOf": [
60127
+ {
60128
+ "oneOf": [
60129
+ {
60130
+ "type": "object",
60131
+ "properties": {
60132
+ "kind": {
60133
+ "const": "story"
60134
+ },
60135
+ "storyType": {
60136
+ "const": "body"
60137
+ }
60138
+ },
60139
+ "required": [
60140
+ "kind",
60141
+ "storyType"
60142
+ ]
60143
+ },
60144
+ {
60145
+ "type": "object",
60146
+ "properties": {
60147
+ "kind": {
60148
+ "const": "story"
60149
+ },
60150
+ "storyType": {
60151
+ "const": "headerFooterSlot"
60152
+ },
60153
+ "section": {
60154
+ "type": "object",
60155
+ "properties": {
60156
+ "kind": {
60157
+ "const": "section"
60158
+ },
60159
+ "sectionId": {
60160
+ "type": "string"
60161
+ }
60162
+ },
60163
+ "required": [
60164
+ "kind",
60165
+ "sectionId"
60166
+ ]
60167
+ },
60168
+ "headerFooterKind": {
60169
+ "oneOf": [
60170
+ {
60171
+ "const": "header"
60172
+ },
60173
+ {
60174
+ "const": "footer"
60175
+ }
60176
+ ]
60177
+ },
60178
+ "variant": {
60179
+ "oneOf": [
60180
+ {
60181
+ "const": "default"
60182
+ },
60183
+ {
60184
+ "const": "first"
60185
+ },
60186
+ {
60187
+ "const": "even"
60188
+ }
60189
+ ]
60190
+ },
60191
+ "resolution": {
60192
+ "oneOf": [
60193
+ {
60194
+ "const": "effective"
60195
+ },
60196
+ {
60197
+ "const": "explicit"
60198
+ }
60199
+ ]
60200
+ },
60201
+ "onWrite": {
60202
+ "oneOf": [
60203
+ {
60204
+ "const": "materializeIfInherited"
60205
+ },
60206
+ {
60207
+ "const": "editResolvedPart"
60208
+ },
60209
+ {
60210
+ "const": "error"
60211
+ }
60212
+ ]
60213
+ }
60214
+ },
60215
+ "required": [
60216
+ "kind",
60217
+ "storyType",
60218
+ "section",
60219
+ "headerFooterKind",
60220
+ "variant"
60221
+ ]
60222
+ },
60223
+ {
60224
+ "type": "object",
60225
+ "properties": {
60226
+ "kind": {
60227
+ "const": "story"
60228
+ },
60229
+ "storyType": {
60230
+ "const": "headerFooterPart"
60231
+ },
60232
+ "refId": {
60233
+ "type": "string"
60234
+ }
60235
+ },
60236
+ "required": [
60237
+ "kind",
60238
+ "storyType",
60239
+ "refId"
60240
+ ]
60241
+ },
60242
+ {
60243
+ "type": "object",
60244
+ "properties": {
60245
+ "kind": {
60246
+ "const": "story"
60247
+ },
60248
+ "storyType": {
60249
+ "const": "footnote"
60250
+ },
60251
+ "noteId": {
60252
+ "type": "string"
60253
+ }
60254
+ },
60255
+ "required": [
60256
+ "kind",
60257
+ "storyType",
60258
+ "noteId"
60259
+ ]
60260
+ },
60261
+ {
60262
+ "type": "object",
60263
+ "properties": {
60264
+ "kind": {
60265
+ "const": "story"
60266
+ },
60267
+ "storyType": {
60268
+ "const": "endnote"
60269
+ },
60270
+ "noteId": {
60271
+ "type": "string"
60272
+ }
60273
+ },
60274
+ "required": [
60275
+ "kind",
60276
+ "storyType",
60277
+ "noteId"
60278
+ ]
60279
+ }
60280
+ ],
60281
+ "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."
60282
+ },
60283
+ {
60284
+ "const": "all"
60285
+ }
60286
+ ],
60287
+ "description": "Story scope. Omit for body only, pass a StoryLocator for a single story, or 'all' for body + every revision-capable non-body story."
60288
+ },
60289
+ "description": "Story scope. Omit for body only, pass a StoryLocator for a single story, or 'all' for body + every revision-capable non-body story.",
60290
+ "agentVisible": false
60052
60291
  }
60053
60292
  ],
60054
60293
  "constraints": null,
@@ -60074,6 +60313,17 @@ const CONTRACT = {
60074
60313
  "format"
60075
60314
  ],
60076
60315
  "description": "Filter by change type: 'insert', 'delete', or 'format'."
60316
+ },
60317
+ "in": {
60318
+ "oneOf": [
60319
+ {
60320
+ "$ref": "#/$defs/StoryLocator"
60321
+ },
60322
+ {
60323
+ "const": "all"
60324
+ }
60325
+ ],
60326
+ "description": "Story scope. Omit for body only, pass a StoryLocator for a single story, or 'all' for body + every revision-capable non-body story."
60077
60327
  }
60078
60328
  },
60079
60329
  "additionalProperties": false
@@ -60200,6 +60450,169 @@ const CONTRACT = {
60200
60450
  "kind": "flag",
60201
60451
  "type": "string",
60202
60452
  "required": true
60453
+ },
60454
+ {
60455
+ "name": "story",
60456
+ "kind": "jsonFlag",
60457
+ "type": "json",
60458
+ "flag": "story-json",
60459
+ "schema": {
60460
+ "oneOf": [
60461
+ {
60462
+ "type": "object",
60463
+ "properties": {
60464
+ "kind": {
60465
+ "const": "story"
60466
+ },
60467
+ "storyType": {
60468
+ "const": "body"
60469
+ }
60470
+ },
60471
+ "required": [
60472
+ "kind",
60473
+ "storyType"
60474
+ ]
60475
+ },
60476
+ {
60477
+ "type": "object",
60478
+ "properties": {
60479
+ "kind": {
60480
+ "const": "story"
60481
+ },
60482
+ "storyType": {
60483
+ "const": "headerFooterSlot"
60484
+ },
60485
+ "section": {
60486
+ "type": "object",
60487
+ "properties": {
60488
+ "kind": {
60489
+ "const": "section"
60490
+ },
60491
+ "sectionId": {
60492
+ "type": "string"
60493
+ }
60494
+ },
60495
+ "required": [
60496
+ "kind",
60497
+ "sectionId"
60498
+ ]
60499
+ },
60500
+ "headerFooterKind": {
60501
+ "oneOf": [
60502
+ {
60503
+ "const": "header"
60504
+ },
60505
+ {
60506
+ "const": "footer"
60507
+ }
60508
+ ]
60509
+ },
60510
+ "variant": {
60511
+ "oneOf": [
60512
+ {
60513
+ "const": "default"
60514
+ },
60515
+ {
60516
+ "const": "first"
60517
+ },
60518
+ {
60519
+ "const": "even"
60520
+ }
60521
+ ]
60522
+ },
60523
+ "resolution": {
60524
+ "oneOf": [
60525
+ {
60526
+ "const": "effective"
60527
+ },
60528
+ {
60529
+ "const": "explicit"
60530
+ }
60531
+ ]
60532
+ },
60533
+ "onWrite": {
60534
+ "oneOf": [
60535
+ {
60536
+ "const": "materializeIfInherited"
60537
+ },
60538
+ {
60539
+ "const": "editResolvedPart"
60540
+ },
60541
+ {
60542
+ "const": "error"
60543
+ }
60544
+ ]
60545
+ }
60546
+ },
60547
+ "required": [
60548
+ "kind",
60549
+ "storyType",
60550
+ "section",
60551
+ "headerFooterKind",
60552
+ "variant"
60553
+ ]
60554
+ },
60555
+ {
60556
+ "type": "object",
60557
+ "properties": {
60558
+ "kind": {
60559
+ "const": "story"
60560
+ },
60561
+ "storyType": {
60562
+ "const": "headerFooterPart"
60563
+ },
60564
+ "refId": {
60565
+ "type": "string"
60566
+ }
60567
+ },
60568
+ "required": [
60569
+ "kind",
60570
+ "storyType",
60571
+ "refId"
60572
+ ]
60573
+ },
60574
+ {
60575
+ "type": "object",
60576
+ "properties": {
60577
+ "kind": {
60578
+ "const": "story"
60579
+ },
60580
+ "storyType": {
60581
+ "const": "footnote"
60582
+ },
60583
+ "noteId": {
60584
+ "type": "string"
60585
+ }
60586
+ },
60587
+ "required": [
60588
+ "kind",
60589
+ "storyType",
60590
+ "noteId"
60591
+ ]
60592
+ },
60593
+ {
60594
+ "type": "object",
60595
+ "properties": {
60596
+ "kind": {
60597
+ "const": "story"
60598
+ },
60599
+ "storyType": {
60600
+ "const": "endnote"
60601
+ },
60602
+ "noteId": {
60603
+ "type": "string"
60604
+ }
60605
+ },
60606
+ "required": [
60607
+ "kind",
60608
+ "storyType",
60609
+ "noteId"
60610
+ ]
60611
+ }
60612
+ ],
60613
+ "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."
60614
+ },
60615
+ "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."
60203
60616
  }
60204
60617
  ],
60205
60618
  "constraints": null,
@@ -60212,6 +60625,9 @@ const CONTRACT = {
60212
60625
  "properties": {
60213
60626
  "id": {
60214
60627
  "type": "string"
60628
+ },
60629
+ "story": {
60630
+ "$ref": "#/$defs/StoryLocator"
60215
60631
  }
60216
60632
  },
60217
60633
  "additionalProperties": false,
@@ -60366,6 +60782,162 @@ const CONTRACT = {
60366
60782
  "properties": {
60367
60783
  "id": {
60368
60784
  "type": "string"
60785
+ },
60786
+ "story": {
60787
+ "oneOf": [
60788
+ {
60789
+ "type": "object",
60790
+ "properties": {
60791
+ "kind": {
60792
+ "const": "story"
60793
+ },
60794
+ "storyType": {
60795
+ "const": "body"
60796
+ }
60797
+ },
60798
+ "required": [
60799
+ "kind",
60800
+ "storyType"
60801
+ ]
60802
+ },
60803
+ {
60804
+ "type": "object",
60805
+ "properties": {
60806
+ "kind": {
60807
+ "const": "story"
60808
+ },
60809
+ "storyType": {
60810
+ "const": "headerFooterSlot"
60811
+ },
60812
+ "section": {
60813
+ "type": "object",
60814
+ "properties": {
60815
+ "kind": {
60816
+ "const": "section"
60817
+ },
60818
+ "sectionId": {
60819
+ "type": "string"
60820
+ }
60821
+ },
60822
+ "required": [
60823
+ "kind",
60824
+ "sectionId"
60825
+ ]
60826
+ },
60827
+ "headerFooterKind": {
60828
+ "oneOf": [
60829
+ {
60830
+ "const": "header"
60831
+ },
60832
+ {
60833
+ "const": "footer"
60834
+ }
60835
+ ]
60836
+ },
60837
+ "variant": {
60838
+ "oneOf": [
60839
+ {
60840
+ "const": "default"
60841
+ },
60842
+ {
60843
+ "const": "first"
60844
+ },
60845
+ {
60846
+ "const": "even"
60847
+ }
60848
+ ]
60849
+ },
60850
+ "resolution": {
60851
+ "oneOf": [
60852
+ {
60853
+ "const": "effective"
60854
+ },
60855
+ {
60856
+ "const": "explicit"
60857
+ }
60858
+ ]
60859
+ },
60860
+ "onWrite": {
60861
+ "oneOf": [
60862
+ {
60863
+ "const": "materializeIfInherited"
60864
+ },
60865
+ {
60866
+ "const": "editResolvedPart"
60867
+ },
60868
+ {
60869
+ "const": "error"
60870
+ }
60871
+ ]
60872
+ }
60873
+ },
60874
+ "required": [
60875
+ "kind",
60876
+ "storyType",
60877
+ "section",
60878
+ "headerFooterKind",
60879
+ "variant"
60880
+ ]
60881
+ },
60882
+ {
60883
+ "type": "object",
60884
+ "properties": {
60885
+ "kind": {
60886
+ "const": "story"
60887
+ },
60888
+ "storyType": {
60889
+ "const": "headerFooterPart"
60890
+ },
60891
+ "refId": {
60892
+ "type": "string"
60893
+ }
60894
+ },
60895
+ "required": [
60896
+ "kind",
60897
+ "storyType",
60898
+ "refId"
60899
+ ]
60900
+ },
60901
+ {
60902
+ "type": "object",
60903
+ "properties": {
60904
+ "kind": {
60905
+ "const": "story"
60906
+ },
60907
+ "storyType": {
60908
+ "const": "footnote"
60909
+ },
60910
+ "noteId": {
60911
+ "type": "string"
60912
+ }
60913
+ },
60914
+ "required": [
60915
+ "kind",
60916
+ "storyType",
60917
+ "noteId"
60918
+ ]
60919
+ },
60920
+ {
60921
+ "type": "object",
60922
+ "properties": {
60923
+ "kind": {
60924
+ "const": "story"
60925
+ },
60926
+ "storyType": {
60927
+ "const": "endnote"
60928
+ },
60929
+ "noteId": {
60930
+ "type": "string"
60931
+ }
60932
+ },
60933
+ "required": [
60934
+ "kind",
60935
+ "storyType",
60936
+ "noteId"
60937
+ ]
60938
+ }
60939
+ ],
60940
+ "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."
60369
60941
  }
60370
60942
  },
60371
60943
  "required": [
@@ -60412,6 +60984,9 @@ const CONTRACT = {
60412
60984
  "properties": {
60413
60985
  "id": {
60414
60986
  "type": "string"
60987
+ },
60988
+ "story": {
60989
+ "$ref": "#/$defs/StoryLocator"
60415
60990
  }
60416
60991
  },
60417
60992
  "additionalProperties": false,
@@ -62506,6 +63081,53 @@ const CONTRACT = {
62506
63081
  "by",
62507
63082
  "target"
62508
63083
  ]
63084
+ },
63085
+ {
63086
+ "type": "object",
63087
+ "properties": {
63088
+ "by": {
63089
+ "const": "block"
63090
+ },
63091
+ "nodeType": {
63092
+ "oneOf": [
63093
+ {
63094
+ "const": "paragraph"
63095
+ },
63096
+ {
63097
+ "const": "heading"
63098
+ },
63099
+ {
63100
+ "const": "listItem"
63101
+ },
63102
+ {
63103
+ "const": "table"
63104
+ },
63105
+ {
63106
+ "const": "tableRow"
63107
+ },
63108
+ {
63109
+ "const": "tableCell"
63110
+ },
63111
+ {
63112
+ "const": "tableOfContents"
63113
+ },
63114
+ {
63115
+ "const": "image"
63116
+ },
63117
+ {
63118
+ "const": "sdt"
63119
+ }
63120
+ ]
63121
+ },
63122
+ "nodeId": {
63123
+ "type": "string"
63124
+ }
63125
+ },
63126
+ "required": [
63127
+ "by",
63128
+ "nodeType",
63129
+ "nodeId"
63130
+ ]
62509
63131
  }
62510
63132
  ]
62511
63133
  },
@@ -62701,51 +63323,148 @@ const CONTRACT = {
62701
63323
  "const": "text.insert"
62702
63324
  },
62703
63325
  "where": {
62704
- "type": "object",
62705
- "properties": {
62706
- "by": {
62707
- "const": "select"
62708
- },
62709
- "select": {
62710
- "oneOf": [
62711
- {
62712
- "type": "object",
62713
- "properties": {
62714
- "type": {
62715
- "const": "text",
62716
- "description": "Must be 'text' for text pattern search."
62717
- },
62718
- "pattern": {
62719
- "type": "string",
62720
- "description": "Text or regex pattern to match."
62721
- },
62722
- "mode": {
62723
- "oneOf": [
62724
- {
62725
- "const": "contains"
63326
+ "oneOf": [
63327
+ {
63328
+ "type": "object",
63329
+ "properties": {
63330
+ "by": {
63331
+ "const": "select"
63332
+ },
63333
+ "select": {
63334
+ "oneOf": [
63335
+ {
63336
+ "type": "object",
63337
+ "properties": {
63338
+ "type": {
63339
+ "const": "text",
63340
+ "description": "Must be 'text' for text pattern search."
62726
63341
  },
62727
- {
62728
- "const": "regex"
63342
+ "pattern": {
63343
+ "type": "string",
63344
+ "description": "Text or regex pattern to match."
63345
+ },
63346
+ "mode": {
63347
+ "oneOf": [
63348
+ {
63349
+ "const": "contains"
63350
+ },
63351
+ {
63352
+ "const": "regex"
63353
+ }
63354
+ ],
63355
+ "description": "Match mode: 'contains' (substring) or 'regex'."
63356
+ },
63357
+ "caseSensitive": {
63358
+ "type": "boolean",
63359
+ "description": "Case-sensitive matching. Default: false."
62729
63360
  }
62730
- ],
62731
- "description": "Match mode: 'contains' (substring) or 'regex'."
63361
+ },
63362
+ "required": [
63363
+ "type",
63364
+ "pattern"
63365
+ ]
62732
63366
  },
62733
- "caseSensitive": {
62734
- "type": "boolean",
62735
- "description": "Case-sensitive matching. Default: false."
63367
+ {
63368
+ "type": "object",
63369
+ "properties": {
63370
+ "type": {
63371
+ "const": "node",
63372
+ "description": "Must be 'node' for node type search."
63373
+ },
63374
+ "nodeType": {
63375
+ "oneOf": [
63376
+ {
63377
+ "const": "paragraph"
63378
+ },
63379
+ {
63380
+ "const": "heading"
63381
+ },
63382
+ {
63383
+ "const": "listItem"
63384
+ },
63385
+ {
63386
+ "const": "table"
63387
+ },
63388
+ {
63389
+ "const": "tableRow"
63390
+ },
63391
+ {
63392
+ "const": "tableCell"
63393
+ },
63394
+ {
63395
+ "const": "tableOfContents"
63396
+ },
63397
+ {
63398
+ "const": "image"
63399
+ },
63400
+ {
63401
+ "const": "sdt"
63402
+ },
63403
+ {
63404
+ "const": "run"
63405
+ },
63406
+ {
63407
+ "const": "bookmark"
63408
+ },
63409
+ {
63410
+ "const": "comment"
63411
+ },
63412
+ {
63413
+ "const": "hyperlink"
63414
+ },
63415
+ {
63416
+ "const": "footnoteRef"
63417
+ },
63418
+ {
63419
+ "const": "endnoteRef"
63420
+ },
63421
+ {
63422
+ "const": "crossRef"
63423
+ },
63424
+ {
63425
+ "const": "indexEntry"
63426
+ },
63427
+ {
63428
+ "const": "citation"
63429
+ },
63430
+ {
63431
+ "const": "authorityEntry"
63432
+ },
63433
+ {
63434
+ "const": "sequenceField"
63435
+ },
63436
+ {
63437
+ "const": "tab"
63438
+ },
63439
+ {
63440
+ "const": "lineBreak"
63441
+ }
63442
+ ],
63443
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
63444
+ },
63445
+ "kind": {
63446
+ "oneOf": [
63447
+ {
63448
+ "const": "block"
63449
+ },
63450
+ {
63451
+ "const": "inline"
63452
+ }
63453
+ ],
63454
+ "description": "Filter: 'block' or 'inline'."
63455
+ }
63456
+ },
63457
+ "required": [
63458
+ "type"
63459
+ ]
62736
63460
  }
62737
- },
62738
- "required": [
62739
- "type",
62740
- "pattern"
62741
63461
  ]
62742
63462
  },
62743
- {
63463
+ "within": {
62744
63464
  "type": "object",
62745
63465
  "properties": {
62746
- "type": {
62747
- "const": "node",
62748
- "description": "Must be 'node' for node type search."
63466
+ "kind": {
63467
+ "const": "block"
62749
63468
  },
62750
63469
  "nodeType": {
62751
63470
  "oneOf": [
@@ -62775,71 +63494,297 @@ const CONTRACT = {
62775
63494
  },
62776
63495
  {
62777
63496
  "const": "sdt"
62778
- },
62779
- {
62780
- "const": "run"
62781
- },
62782
- {
62783
- "const": "bookmark"
62784
- },
63497
+ }
63498
+ ]
63499
+ },
63500
+ "nodeId": {
63501
+ "type": "string"
63502
+ }
63503
+ },
63504
+ "required": [
63505
+ "kind",
63506
+ "nodeType",
63507
+ "nodeId"
63508
+ ]
63509
+ },
63510
+ "require": {
63511
+ "oneOf": [
63512
+ {
63513
+ "const": "first"
63514
+ },
63515
+ {
63516
+ "const": "exactlyOne"
63517
+ }
63518
+ ]
63519
+ }
63520
+ },
63521
+ "required": [
63522
+ "by",
63523
+ "select",
63524
+ "require"
63525
+ ]
63526
+ },
63527
+ {
63528
+ "type": "object",
63529
+ "properties": {
63530
+ "by": {
63531
+ "const": "ref"
63532
+ },
63533
+ "ref": {
63534
+ "type": "string"
63535
+ },
63536
+ "within": {
63537
+ "type": "object",
63538
+ "properties": {
63539
+ "kind": {
63540
+ "const": "block"
63541
+ },
63542
+ "nodeType": {
63543
+ "oneOf": [
62785
63544
  {
62786
- "const": "comment"
63545
+ "const": "paragraph"
62787
63546
  },
62788
63547
  {
62789
- "const": "hyperlink"
63548
+ "const": "heading"
62790
63549
  },
62791
63550
  {
62792
- "const": "footnoteRef"
63551
+ "const": "listItem"
62793
63552
  },
62794
63553
  {
62795
- "const": "endnoteRef"
63554
+ "const": "table"
62796
63555
  },
62797
63556
  {
62798
- "const": "crossRef"
63557
+ "const": "tableRow"
62799
63558
  },
62800
63559
  {
62801
- "const": "indexEntry"
63560
+ "const": "tableCell"
62802
63561
  },
62803
63562
  {
62804
- "const": "citation"
63563
+ "const": "tableOfContents"
62805
63564
  },
62806
63565
  {
62807
- "const": "authorityEntry"
63566
+ "const": "image"
62808
63567
  },
62809
63568
  {
62810
- "const": "sequenceField"
62811
- },
63569
+ "const": "sdt"
63570
+ }
63571
+ ]
63572
+ },
63573
+ "nodeId": {
63574
+ "type": "string"
63575
+ }
63576
+ },
63577
+ "required": [
63578
+ "kind",
63579
+ "nodeType",
63580
+ "nodeId"
63581
+ ]
63582
+ }
63583
+ },
63584
+ "required": [
63585
+ "by",
63586
+ "ref"
63587
+ ]
63588
+ },
63589
+ {
63590
+ "type": "object",
63591
+ "properties": {
63592
+ "by": {
63593
+ "const": "target"
63594
+ },
63595
+ "target": {
63596
+ "type": "object",
63597
+ "properties": {
63598
+ "kind": {
63599
+ "const": "selection"
63600
+ },
63601
+ "start": {
63602
+ "oneOf": [
62812
63603
  {
62813
- "const": "tab"
63604
+ "type": "object",
63605
+ "properties": {
63606
+ "kind": {
63607
+ "const": "text"
63608
+ },
63609
+ "blockId": {
63610
+ "type": "string"
63611
+ },
63612
+ "offset": {
63613
+ "type": "number"
63614
+ }
63615
+ },
63616
+ "required": [
63617
+ "kind",
63618
+ "blockId",
63619
+ "offset"
63620
+ ]
62814
63621
  },
62815
63622
  {
62816
- "const": "lineBreak"
63623
+ "type": "object",
63624
+ "properties": {
63625
+ "kind": {
63626
+ "const": "nodeEdge"
63627
+ },
63628
+ "node": {
63629
+ "type": "object",
63630
+ "properties": {
63631
+ "kind": {
63632
+ "const": "block"
63633
+ },
63634
+ "nodeType": {
63635
+ "oneOf": [
63636
+ {
63637
+ "const": "paragraph"
63638
+ },
63639
+ {
63640
+ "const": "heading"
63641
+ },
63642
+ {
63643
+ "const": "table"
63644
+ },
63645
+ {
63646
+ "const": "tableOfContents"
63647
+ },
63648
+ {
63649
+ "const": "sdt"
63650
+ },
63651
+ {
63652
+ "const": "image"
63653
+ }
63654
+ ]
63655
+ },
63656
+ "nodeId": {
63657
+ "type": "string"
63658
+ }
63659
+ },
63660
+ "required": [
63661
+ "kind",
63662
+ "nodeType",
63663
+ "nodeId"
63664
+ ]
63665
+ },
63666
+ "edge": {
63667
+ "oneOf": [
63668
+ {
63669
+ "const": "before"
63670
+ },
63671
+ {
63672
+ "const": "after"
63673
+ }
63674
+ ]
63675
+ }
63676
+ },
63677
+ "required": [
63678
+ "kind",
63679
+ "node",
63680
+ "edge"
63681
+ ]
62817
63682
  }
62818
63683
  ],
62819
- "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
63684
+ "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."
62820
63685
  },
62821
- "kind": {
63686
+ "end": {
62822
63687
  "oneOf": [
62823
63688
  {
62824
- "const": "block"
63689
+ "type": "object",
63690
+ "properties": {
63691
+ "kind": {
63692
+ "const": "text"
63693
+ },
63694
+ "blockId": {
63695
+ "type": "string"
63696
+ },
63697
+ "offset": {
63698
+ "type": "number"
63699
+ }
63700
+ },
63701
+ "required": [
63702
+ "kind",
63703
+ "blockId",
63704
+ "offset"
63705
+ ]
62825
63706
  },
62826
63707
  {
62827
- "const": "inline"
63708
+ "type": "object",
63709
+ "properties": {
63710
+ "kind": {
63711
+ "const": "nodeEdge"
63712
+ },
63713
+ "node": {
63714
+ "type": "object",
63715
+ "properties": {
63716
+ "kind": {
63717
+ "const": "block"
63718
+ },
63719
+ "nodeType": {
63720
+ "oneOf": [
63721
+ {
63722
+ "const": "paragraph"
63723
+ },
63724
+ {
63725
+ "const": "heading"
63726
+ },
63727
+ {
63728
+ "const": "table"
63729
+ },
63730
+ {
63731
+ "const": "tableOfContents"
63732
+ },
63733
+ {
63734
+ "const": "sdt"
63735
+ },
63736
+ {
63737
+ "const": "image"
63738
+ }
63739
+ ]
63740
+ },
63741
+ "nodeId": {
63742
+ "type": "string"
63743
+ }
63744
+ },
63745
+ "required": [
63746
+ "kind",
63747
+ "nodeType",
63748
+ "nodeId"
63749
+ ]
63750
+ },
63751
+ "edge": {
63752
+ "oneOf": [
63753
+ {
63754
+ "const": "before"
63755
+ },
63756
+ {
63757
+ "const": "after"
63758
+ }
63759
+ ]
63760
+ }
63761
+ },
63762
+ "required": [
63763
+ "kind",
63764
+ "node",
63765
+ "edge"
63766
+ ]
62828
63767
  }
62829
63768
  ],
62830
- "description": "Filter: 'block' or 'inline'."
63769
+ "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."
62831
63770
  }
62832
63771
  },
62833
63772
  "required": [
62834
- "type"
63773
+ "kind",
63774
+ "start",
63775
+ "end"
62835
63776
  ]
62836
63777
  }
63778
+ },
63779
+ "required": [
63780
+ "by",
63781
+ "target"
62837
63782
  ]
62838
63783
  },
62839
- "within": {
63784
+ {
62840
63785
  "type": "object",
62841
63786
  "properties": {
62842
- "kind": {
63787
+ "by": {
62843
63788
  "const": "block"
62844
63789
  },
62845
63790
  "nodeType": {
@@ -62878,26 +63823,11 @@ const CONTRACT = {
62878
63823
  }
62879
63824
  },
62880
63825
  "required": [
62881
- "kind",
63826
+ "by",
62882
63827
  "nodeType",
62883
63828
  "nodeId"
62884
63829
  ]
62885
- },
62886
- "require": {
62887
- "oneOf": [
62888
- {
62889
- "const": "first"
62890
- },
62891
- {
62892
- "const": "exactlyOne"
62893
- }
62894
- ]
62895
63830
  }
62896
- },
62897
- "required": [
62898
- "by",
62899
- "select",
62900
- "require"
62901
63831
  ]
62902
63832
  },
62903
63833
  "args": {
@@ -63494,6 +64424,53 @@ const CONTRACT = {
63494
64424
  "by",
63495
64425
  "target"
63496
64426
  ]
64427
+ },
64428
+ {
64429
+ "type": "object",
64430
+ "properties": {
64431
+ "by": {
64432
+ "const": "block"
64433
+ },
64434
+ "nodeType": {
64435
+ "oneOf": [
64436
+ {
64437
+ "const": "paragraph"
64438
+ },
64439
+ {
64440
+ "const": "heading"
64441
+ },
64442
+ {
64443
+ "const": "listItem"
64444
+ },
64445
+ {
64446
+ "const": "table"
64447
+ },
64448
+ {
64449
+ "const": "tableRow"
64450
+ },
64451
+ {
64452
+ "const": "tableCell"
64453
+ },
64454
+ {
64455
+ "const": "tableOfContents"
64456
+ },
64457
+ {
64458
+ "const": "image"
64459
+ },
64460
+ {
64461
+ "const": "sdt"
64462
+ }
64463
+ ]
64464
+ },
64465
+ "nodeId": {
64466
+ "type": "string"
64467
+ }
64468
+ },
64469
+ "required": [
64470
+ "by",
64471
+ "nodeType",
64472
+ "nodeId"
64473
+ ]
63497
64474
  }
63498
64475
  ]
63499
64476
  },
@@ -63990,6 +64967,53 @@ const CONTRACT = {
63990
64967
  "by",
63991
64968
  "target"
63992
64969
  ]
64970
+ },
64971
+ {
64972
+ "type": "object",
64973
+ "properties": {
64974
+ "by": {
64975
+ "const": "block"
64976
+ },
64977
+ "nodeType": {
64978
+ "oneOf": [
64979
+ {
64980
+ "const": "paragraph"
64981
+ },
64982
+ {
64983
+ "const": "heading"
64984
+ },
64985
+ {
64986
+ "const": "listItem"
64987
+ },
64988
+ {
64989
+ "const": "table"
64990
+ },
64991
+ {
64992
+ "const": "tableRow"
64993
+ },
64994
+ {
64995
+ "const": "tableCell"
64996
+ },
64997
+ {
64998
+ "const": "tableOfContents"
64999
+ },
65000
+ {
65001
+ "const": "image"
65002
+ },
65003
+ {
65004
+ "const": "sdt"
65005
+ }
65006
+ ]
65007
+ },
65008
+ "nodeId": {
65009
+ "type": "string"
65010
+ }
65011
+ },
65012
+ "required": [
65013
+ "by",
65014
+ "nodeType",
65015
+ "nodeId"
65016
+ ]
63993
65017
  }
63994
65018
  ]
63995
65019
  },
@@ -64761,11 +65785,36 @@ const CONTRACT = {
64761
65785
  ]
64762
65786
  }
64763
65787
  }
65788
+ },
65789
+ "alignment": {
65790
+ "oneOf": [
65791
+ {
65792
+ "const": "left"
65793
+ },
65794
+ {
65795
+ "const": "center"
65796
+ },
65797
+ {
65798
+ "const": "right"
65799
+ },
65800
+ {
65801
+ "const": "justify"
65802
+ }
65803
+ ],
65804
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step."
65805
+ },
65806
+ "scope": {
65807
+ "oneOf": [
65808
+ {
65809
+ "const": "match"
65810
+ },
65811
+ {
65812
+ "const": "block"
65813
+ }
65814
+ ],
65815
+ "description": "When \"block\", inline formatting expands to cover the entire parent paragraph(s), not just the matched text. Use \"block\" after markdown inserts to format whole paragraphs with a short identifying pattern. Default: \"match\"."
64764
65816
  }
64765
- },
64766
- "required": [
64767
- "inline"
64768
- ]
65817
+ }
64769
65818
  }
64770
65819
  },
64771
65820
  "required": [
@@ -65183,6 +66232,37 @@ const CONTRACT = {
65183
66232
  "by",
65184
66233
  "target"
65185
66234
  ]
66235
+ },
66236
+ {
66237
+ "type": "object",
66238
+ "properties": {
66239
+ "by": {
66240
+ "const": "block",
66241
+ "type": "string"
66242
+ },
66243
+ "nodeType": {
66244
+ "enum": [
66245
+ "paragraph",
66246
+ "heading",
66247
+ "listItem",
66248
+ "table",
66249
+ "tableRow",
66250
+ "tableCell",
66251
+ "tableOfContents",
66252
+ "image",
66253
+ "sdt"
66254
+ ]
66255
+ },
66256
+ "nodeId": {
66257
+ "type": "string"
66258
+ }
66259
+ },
66260
+ "additionalProperties": false,
66261
+ "required": [
66262
+ "by",
66263
+ "nodeType",
66264
+ "nodeId"
66265
+ ]
65186
66266
  }
65187
66267
  ]
65188
66268
  },
@@ -65343,217 +66423,289 @@ const CONTRACT = {
65343
66423
  "const": "text.insert",
65344
66424
  "type": "string"
65345
66425
  },
65346
- "where": {
65347
- "type": "object",
65348
- "properties": {
65349
- "by": {
65350
- "const": "select",
65351
- "type": "string"
65352
- },
65353
- "select": {
65354
- "oneOf": [
65355
- {
65356
- "type": "object",
65357
- "properties": {
65358
- "type": {
65359
- "const": "text",
65360
- "description": "Must be 'text' for text pattern search."
65361
- },
65362
- "pattern": {
65363
- "type": "string",
65364
- "description": "Text or regex pattern to match."
65365
- },
65366
- "mode": {
65367
- "enum": [
65368
- "contains",
65369
- "regex"
65370
- ],
65371
- "description": "Match mode: 'contains' (substring) or 'regex'."
65372
- },
65373
- "caseSensitive": {
65374
- "type": "boolean",
65375
- "description": "Case-sensitive matching. Default: false."
65376
- }
65377
- },
65378
- "additionalProperties": false,
65379
- "required": [
65380
- "type",
65381
- "pattern"
65382
- ]
65383
- },
65384
- {
65385
- "type": "object",
65386
- "properties": {
65387
- "type": {
65388
- "const": "node",
65389
- "description": "Must be 'node' for node type search."
65390
- },
65391
- "nodeType": {
65392
- "enum": [
65393
- "paragraph",
65394
- "heading",
65395
- "listItem",
65396
- "table",
65397
- "tableRow",
65398
- "tableCell",
65399
- "tableOfContents",
65400
- "image",
65401
- "sdt",
65402
- "run",
65403
- "bookmark",
65404
- "comment",
65405
- "hyperlink",
65406
- "footnoteRef",
65407
- "endnoteRef",
65408
- "crossRef",
65409
- "indexEntry",
65410
- "citation",
65411
- "authorityEntry",
65412
- "sequenceField",
65413
- "tab",
65414
- "lineBreak"
65415
- ],
65416
- "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
65417
- },
65418
- "kind": {
65419
- "enum": [
65420
- "block",
65421
- "inline"
65422
- ],
65423
- "description": "Filter: 'block' or 'inline'."
65424
- }
65425
- },
65426
- "additionalProperties": false,
65427
- "required": [
65428
- "type"
65429
- ]
65430
- }
65431
- ]
65432
- },
65433
- "within": {
65434
- "$ref": "#/$defs/BlockNodeAddress"
65435
- },
65436
- "require": {
65437
- "enum": [
65438
- "first",
65439
- "exactlyOne"
65440
- ]
65441
- }
65442
- },
65443
- "additionalProperties": false,
65444
- "required": [
65445
- "by",
65446
- "select",
65447
- "require"
65448
- ]
65449
- },
65450
- "args": {
65451
- "type": "object",
65452
- "properties": {
65453
- "position": {
65454
- "enum": [
65455
- "before",
65456
- "after"
65457
- ]
65458
- },
65459
- "content": {
65460
- "type": "object",
65461
- "properties": {
65462
- "text": {
65463
- "type": "string"
65464
- }
65465
- },
65466
- "additionalProperties": false,
65467
- "required": [
65468
- "text"
65469
- ]
65470
- },
65471
- "style": {
65472
- "type": "object",
65473
- "properties": {
65474
- "inline": {
65475
- "type": "object",
65476
- "properties": {
65477
- "mode": {
65478
- "enum": [
65479
- "inherit",
65480
- "set",
65481
- "clear"
65482
- ],
65483
- "type": "string"
65484
- },
65485
- "setMarks": {
65486
- "type": "object",
65487
- "properties": {
65488
- "bold": {
65489
- "enum": [
65490
- "on",
65491
- "off",
65492
- "clear"
65493
- ]
65494
- },
65495
- "italic": {
65496
- "enum": [
65497
- "on",
65498
- "off",
65499
- "clear"
65500
- ]
65501
- },
65502
- "underline": {
65503
- "enum": [
65504
- "on",
65505
- "off",
65506
- "clear"
65507
- ]
65508
- },
65509
- "strike": {
65510
- "enum": [
65511
- "on",
65512
- "off",
65513
- "clear"
65514
- ]
65515
- }
65516
- },
65517
- "additionalProperties": false
65518
- }
65519
- },
65520
- "additionalProperties": false,
65521
- "required": [
65522
- "mode"
65523
- ]
65524
- }
65525
- },
65526
- "additionalProperties": false,
65527
- "required": [
65528
- "inline"
65529
- ]
65530
- }
65531
- },
65532
- "additionalProperties": false,
65533
- "required": [
65534
- "position",
65535
- "content"
65536
- ]
65537
- }
65538
- },
65539
- "additionalProperties": false,
65540
- "required": [
65541
- "id",
65542
- "op",
65543
- "where",
65544
- "args"
65545
- ]
65546
- },
65547
- {
65548
- "type": "object",
65549
- "properties": {
65550
- "id": {
65551
- "type": "string"
65552
- },
65553
- "op": {
65554
- "const": "text.delete",
65555
- "type": "string"
65556
- },
66426
+ "where": {
66427
+ "oneOf": [
66428
+ {
66429
+ "type": "object",
66430
+ "properties": {
66431
+ "by": {
66432
+ "const": "select",
66433
+ "type": "string"
66434
+ },
66435
+ "select": {
66436
+ "oneOf": [
66437
+ {
66438
+ "type": "object",
66439
+ "properties": {
66440
+ "type": {
66441
+ "const": "text",
66442
+ "description": "Must be 'text' for text pattern search."
66443
+ },
66444
+ "pattern": {
66445
+ "type": "string",
66446
+ "description": "Text or regex pattern to match."
66447
+ },
66448
+ "mode": {
66449
+ "enum": [
66450
+ "contains",
66451
+ "regex"
66452
+ ],
66453
+ "description": "Match mode: 'contains' (substring) or 'regex'."
66454
+ },
66455
+ "caseSensitive": {
66456
+ "type": "boolean",
66457
+ "description": "Case-sensitive matching. Default: false."
66458
+ }
66459
+ },
66460
+ "additionalProperties": false,
66461
+ "required": [
66462
+ "type",
66463
+ "pattern"
66464
+ ]
66465
+ },
66466
+ {
66467
+ "type": "object",
66468
+ "properties": {
66469
+ "type": {
66470
+ "const": "node",
66471
+ "description": "Must be 'node' for node type search."
66472
+ },
66473
+ "nodeType": {
66474
+ "enum": [
66475
+ "paragraph",
66476
+ "heading",
66477
+ "listItem",
66478
+ "table",
66479
+ "tableRow",
66480
+ "tableCell",
66481
+ "tableOfContents",
66482
+ "image",
66483
+ "sdt",
66484
+ "run",
66485
+ "bookmark",
66486
+ "comment",
66487
+ "hyperlink",
66488
+ "footnoteRef",
66489
+ "endnoteRef",
66490
+ "crossRef",
66491
+ "indexEntry",
66492
+ "citation",
66493
+ "authorityEntry",
66494
+ "sequenceField",
66495
+ "tab",
66496
+ "lineBreak"
66497
+ ],
66498
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
66499
+ },
66500
+ "kind": {
66501
+ "enum": [
66502
+ "block",
66503
+ "inline"
66504
+ ],
66505
+ "description": "Filter: 'block' or 'inline'."
66506
+ }
66507
+ },
66508
+ "additionalProperties": false,
66509
+ "required": [
66510
+ "type"
66511
+ ]
66512
+ }
66513
+ ]
66514
+ },
66515
+ "within": {
66516
+ "$ref": "#/$defs/BlockNodeAddress"
66517
+ },
66518
+ "require": {
66519
+ "enum": [
66520
+ "first",
66521
+ "exactlyOne"
66522
+ ]
66523
+ }
66524
+ },
66525
+ "additionalProperties": false,
66526
+ "required": [
66527
+ "by",
66528
+ "select",
66529
+ "require"
66530
+ ]
66531
+ },
66532
+ {
66533
+ "type": "object",
66534
+ "properties": {
66535
+ "by": {
66536
+ "const": "ref",
66537
+ "type": "string"
66538
+ },
66539
+ "ref": {
66540
+ "type": "string"
66541
+ },
66542
+ "within": {
66543
+ "$ref": "#/$defs/BlockNodeAddress"
66544
+ }
66545
+ },
66546
+ "additionalProperties": false,
66547
+ "required": [
66548
+ "by",
66549
+ "ref"
66550
+ ]
66551
+ },
66552
+ {
66553
+ "type": "object",
66554
+ "properties": {
66555
+ "by": {
66556
+ "const": "target",
66557
+ "type": "string"
66558
+ },
66559
+ "target": {
66560
+ "$ref": "#/$defs/SelectionTarget"
66561
+ }
66562
+ },
66563
+ "additionalProperties": false,
66564
+ "required": [
66565
+ "by",
66566
+ "target"
66567
+ ]
66568
+ },
66569
+ {
66570
+ "type": "object",
66571
+ "properties": {
66572
+ "by": {
66573
+ "const": "block",
66574
+ "type": "string"
66575
+ },
66576
+ "nodeType": {
66577
+ "enum": [
66578
+ "paragraph",
66579
+ "heading",
66580
+ "listItem",
66581
+ "table",
66582
+ "tableRow",
66583
+ "tableCell",
66584
+ "tableOfContents",
66585
+ "image",
66586
+ "sdt"
66587
+ ]
66588
+ },
66589
+ "nodeId": {
66590
+ "type": "string"
66591
+ }
66592
+ },
66593
+ "additionalProperties": false,
66594
+ "required": [
66595
+ "by",
66596
+ "nodeType",
66597
+ "nodeId"
66598
+ ]
66599
+ }
66600
+ ]
66601
+ },
66602
+ "args": {
66603
+ "type": "object",
66604
+ "properties": {
66605
+ "position": {
66606
+ "enum": [
66607
+ "before",
66608
+ "after"
66609
+ ]
66610
+ },
66611
+ "content": {
66612
+ "type": "object",
66613
+ "properties": {
66614
+ "text": {
66615
+ "type": "string"
66616
+ }
66617
+ },
66618
+ "additionalProperties": false,
66619
+ "required": [
66620
+ "text"
66621
+ ]
66622
+ },
66623
+ "style": {
66624
+ "type": "object",
66625
+ "properties": {
66626
+ "inline": {
66627
+ "type": "object",
66628
+ "properties": {
66629
+ "mode": {
66630
+ "enum": [
66631
+ "inherit",
66632
+ "set",
66633
+ "clear"
66634
+ ],
66635
+ "type": "string"
66636
+ },
66637
+ "setMarks": {
66638
+ "type": "object",
66639
+ "properties": {
66640
+ "bold": {
66641
+ "enum": [
66642
+ "on",
66643
+ "off",
66644
+ "clear"
66645
+ ]
66646
+ },
66647
+ "italic": {
66648
+ "enum": [
66649
+ "on",
66650
+ "off",
66651
+ "clear"
66652
+ ]
66653
+ },
66654
+ "underline": {
66655
+ "enum": [
66656
+ "on",
66657
+ "off",
66658
+ "clear"
66659
+ ]
66660
+ },
66661
+ "strike": {
66662
+ "enum": [
66663
+ "on",
66664
+ "off",
66665
+ "clear"
66666
+ ]
66667
+ }
66668
+ },
66669
+ "additionalProperties": false
66670
+ }
66671
+ },
66672
+ "additionalProperties": false,
66673
+ "required": [
66674
+ "mode"
66675
+ ]
66676
+ }
66677
+ },
66678
+ "additionalProperties": false,
66679
+ "required": [
66680
+ "inline"
66681
+ ]
66682
+ }
66683
+ },
66684
+ "additionalProperties": false,
66685
+ "required": [
66686
+ "position",
66687
+ "content"
66688
+ ]
66689
+ }
66690
+ },
66691
+ "additionalProperties": false,
66692
+ "required": [
66693
+ "id",
66694
+ "op",
66695
+ "where",
66696
+ "args"
66697
+ ]
66698
+ },
66699
+ {
66700
+ "type": "object",
66701
+ "properties": {
66702
+ "id": {
66703
+ "type": "string"
66704
+ },
66705
+ "op": {
66706
+ "const": "text.delete",
66707
+ "type": "string"
66708
+ },
65557
66709
  "where": {
65558
66710
  "oneOf": [
65559
66711
  {
@@ -65697,6 +66849,37 @@ const CONTRACT = {
65697
66849
  "by",
65698
66850
  "target"
65699
66851
  ]
66852
+ },
66853
+ {
66854
+ "type": "object",
66855
+ "properties": {
66856
+ "by": {
66857
+ "const": "block",
66858
+ "type": "string"
66859
+ },
66860
+ "nodeType": {
66861
+ "enum": [
66862
+ "paragraph",
66863
+ "heading",
66864
+ "listItem",
66865
+ "table",
66866
+ "tableRow",
66867
+ "tableCell",
66868
+ "tableOfContents",
66869
+ "image",
66870
+ "sdt"
66871
+ ]
66872
+ },
66873
+ "nodeId": {
66874
+ "type": "string"
66875
+ }
66876
+ },
66877
+ "additionalProperties": false,
66878
+ "required": [
66879
+ "by",
66880
+ "nodeType",
66881
+ "nodeId"
66882
+ ]
65700
66883
  }
65701
66884
  ]
65702
66885
  },
@@ -65871,6 +67054,37 @@ const CONTRACT = {
65871
67054
  "by",
65872
67055
  "target"
65873
67056
  ]
67057
+ },
67058
+ {
67059
+ "type": "object",
67060
+ "properties": {
67061
+ "by": {
67062
+ "const": "block",
67063
+ "type": "string"
67064
+ },
67065
+ "nodeType": {
67066
+ "enum": [
67067
+ "paragraph",
67068
+ "heading",
67069
+ "listItem",
67070
+ "table",
67071
+ "tableRow",
67072
+ "tableCell",
67073
+ "tableOfContents",
67074
+ "image",
67075
+ "sdt"
67076
+ ]
67077
+ },
67078
+ "nodeId": {
67079
+ "type": "string"
67080
+ }
67081
+ },
67082
+ "additionalProperties": false,
67083
+ "required": [
67084
+ "by",
67085
+ "nodeType",
67086
+ "nodeId"
67087
+ ]
65874
67088
  }
65875
67089
  ]
65876
67090
  },
@@ -66685,12 +67899,28 @@ const CONTRACT = {
66685
67899
  },
66686
67900
  "additionalProperties": false,
66687
67901
  "minProperties": 1
67902
+ },
67903
+ "alignment": {
67904
+ "type": "string",
67905
+ "enum": [
67906
+ "left",
67907
+ "center",
67908
+ "right",
67909
+ "justify"
67910
+ ],
67911
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step."
67912
+ },
67913
+ "scope": {
67914
+ "type": "string",
67915
+ "enum": [
67916
+ "match",
67917
+ "block"
67918
+ ],
67919
+ "description": "When \"block\", inline formatting expands to cover the entire parent paragraph(s), not just the matched text. Use \"block\" after markdown inserts to format whole paragraphs with a short identifying pattern. Default: \"match\"."
66688
67920
  }
66689
67921
  },
66690
67922
  "additionalProperties": false,
66691
- "required": [
66692
- "inline"
66693
- ]
67923
+ "minProperties": 1
66694
67924
  }
66695
67925
  },
66696
67926
  "additionalProperties": false,
@@ -67583,6 +68813,53 @@ const CONTRACT = {
67583
68813
  "by",
67584
68814
  "target"
67585
68815
  ]
68816
+ },
68817
+ {
68818
+ "type": "object",
68819
+ "properties": {
68820
+ "by": {
68821
+ "const": "block"
68822
+ },
68823
+ "nodeType": {
68824
+ "oneOf": [
68825
+ {
68826
+ "const": "paragraph"
68827
+ },
68828
+ {
68829
+ "const": "heading"
68830
+ },
68831
+ {
68832
+ "const": "listItem"
68833
+ },
68834
+ {
68835
+ "const": "table"
68836
+ },
68837
+ {
68838
+ "const": "tableRow"
68839
+ },
68840
+ {
68841
+ "const": "tableCell"
68842
+ },
68843
+ {
68844
+ "const": "tableOfContents"
68845
+ },
68846
+ {
68847
+ "const": "image"
68848
+ },
68849
+ {
68850
+ "const": "sdt"
68851
+ }
68852
+ ]
68853
+ },
68854
+ "nodeId": {
68855
+ "type": "string"
68856
+ }
68857
+ },
68858
+ "required": [
68859
+ "by",
68860
+ "nodeType",
68861
+ "nodeId"
68862
+ ]
67586
68863
  }
67587
68864
  ]
67588
68865
  },
@@ -67778,51 +69055,221 @@ const CONTRACT = {
67778
69055
  "const": "text.insert"
67779
69056
  },
67780
69057
  "where": {
67781
- "type": "object",
67782
- "properties": {
67783
- "by": {
67784
- "const": "select"
67785
- },
67786
- "select": {
67787
- "oneOf": [
67788
- {
69058
+ "oneOf": [
69059
+ {
69060
+ "type": "object",
69061
+ "properties": {
69062
+ "by": {
69063
+ "const": "select"
69064
+ },
69065
+ "select": {
69066
+ "oneOf": [
69067
+ {
69068
+ "type": "object",
69069
+ "properties": {
69070
+ "type": {
69071
+ "const": "text",
69072
+ "description": "Must be 'text' for text pattern search."
69073
+ },
69074
+ "pattern": {
69075
+ "type": "string",
69076
+ "description": "Text or regex pattern to match."
69077
+ },
69078
+ "mode": {
69079
+ "oneOf": [
69080
+ {
69081
+ "const": "contains"
69082
+ },
69083
+ {
69084
+ "const": "regex"
69085
+ }
69086
+ ],
69087
+ "description": "Match mode: 'contains' (substring) or 'regex'."
69088
+ },
69089
+ "caseSensitive": {
69090
+ "type": "boolean",
69091
+ "description": "Case-sensitive matching. Default: false."
69092
+ }
69093
+ },
69094
+ "required": [
69095
+ "type",
69096
+ "pattern"
69097
+ ]
69098
+ },
69099
+ {
69100
+ "type": "object",
69101
+ "properties": {
69102
+ "type": {
69103
+ "const": "node",
69104
+ "description": "Must be 'node' for node type search."
69105
+ },
69106
+ "nodeType": {
69107
+ "oneOf": [
69108
+ {
69109
+ "const": "paragraph"
69110
+ },
69111
+ {
69112
+ "const": "heading"
69113
+ },
69114
+ {
69115
+ "const": "listItem"
69116
+ },
69117
+ {
69118
+ "const": "table"
69119
+ },
69120
+ {
69121
+ "const": "tableRow"
69122
+ },
69123
+ {
69124
+ "const": "tableCell"
69125
+ },
69126
+ {
69127
+ "const": "tableOfContents"
69128
+ },
69129
+ {
69130
+ "const": "image"
69131
+ },
69132
+ {
69133
+ "const": "sdt"
69134
+ },
69135
+ {
69136
+ "const": "run"
69137
+ },
69138
+ {
69139
+ "const": "bookmark"
69140
+ },
69141
+ {
69142
+ "const": "comment"
69143
+ },
69144
+ {
69145
+ "const": "hyperlink"
69146
+ },
69147
+ {
69148
+ "const": "footnoteRef"
69149
+ },
69150
+ {
69151
+ "const": "endnoteRef"
69152
+ },
69153
+ {
69154
+ "const": "crossRef"
69155
+ },
69156
+ {
69157
+ "const": "indexEntry"
69158
+ },
69159
+ {
69160
+ "const": "citation"
69161
+ },
69162
+ {
69163
+ "const": "authorityEntry"
69164
+ },
69165
+ {
69166
+ "const": "sequenceField"
69167
+ },
69168
+ {
69169
+ "const": "tab"
69170
+ },
69171
+ {
69172
+ "const": "lineBreak"
69173
+ }
69174
+ ],
69175
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
69176
+ },
69177
+ "kind": {
69178
+ "oneOf": [
69179
+ {
69180
+ "const": "block"
69181
+ },
69182
+ {
69183
+ "const": "inline"
69184
+ }
69185
+ ],
69186
+ "description": "Filter: 'block' or 'inline'."
69187
+ }
69188
+ },
69189
+ "required": [
69190
+ "type"
69191
+ ]
69192
+ }
69193
+ ]
69194
+ },
69195
+ "within": {
67789
69196
  "type": "object",
67790
69197
  "properties": {
67791
- "type": {
67792
- "const": "text",
67793
- "description": "Must be 'text' for text pattern search."
67794
- },
67795
- "pattern": {
67796
- "type": "string",
67797
- "description": "Text or regex pattern to match."
69198
+ "kind": {
69199
+ "const": "block"
67798
69200
  },
67799
- "mode": {
69201
+ "nodeType": {
67800
69202
  "oneOf": [
67801
69203
  {
67802
- "const": "contains"
69204
+ "const": "paragraph"
67803
69205
  },
67804
69206
  {
67805
- "const": "regex"
69207
+ "const": "heading"
69208
+ },
69209
+ {
69210
+ "const": "listItem"
69211
+ },
69212
+ {
69213
+ "const": "table"
69214
+ },
69215
+ {
69216
+ "const": "tableRow"
69217
+ },
69218
+ {
69219
+ "const": "tableCell"
69220
+ },
69221
+ {
69222
+ "const": "tableOfContents"
69223
+ },
69224
+ {
69225
+ "const": "image"
69226
+ },
69227
+ {
69228
+ "const": "sdt"
67806
69229
  }
67807
- ],
67808
- "description": "Match mode: 'contains' (substring) or 'regex'."
69230
+ ]
67809
69231
  },
67810
- "caseSensitive": {
67811
- "type": "boolean",
67812
- "description": "Case-sensitive matching. Default: false."
69232
+ "nodeId": {
69233
+ "type": "string"
67813
69234
  }
67814
69235
  },
67815
69236
  "required": [
67816
- "type",
67817
- "pattern"
69237
+ "kind",
69238
+ "nodeType",
69239
+ "nodeId"
67818
69240
  ]
67819
69241
  },
67820
- {
69242
+ "require": {
69243
+ "oneOf": [
69244
+ {
69245
+ "const": "first"
69246
+ },
69247
+ {
69248
+ "const": "exactlyOne"
69249
+ }
69250
+ ]
69251
+ }
69252
+ },
69253
+ "required": [
69254
+ "by",
69255
+ "select",
69256
+ "require"
69257
+ ]
69258
+ },
69259
+ {
69260
+ "type": "object",
69261
+ "properties": {
69262
+ "by": {
69263
+ "const": "ref"
69264
+ },
69265
+ "ref": {
69266
+ "type": "string"
69267
+ },
69268
+ "within": {
67821
69269
  "type": "object",
67822
69270
  "properties": {
67823
- "type": {
67824
- "const": "node",
67825
- "description": "Must be 'node' for node type search."
69271
+ "kind": {
69272
+ "const": "block"
67826
69273
  },
67827
69274
  "nodeType": {
67828
69275
  "oneOf": [
@@ -67852,71 +69299,224 @@ const CONTRACT = {
67852
69299
  },
67853
69300
  {
67854
69301
  "const": "sdt"
67855
- },
67856
- {
67857
- "const": "run"
67858
- },
67859
- {
67860
- "const": "bookmark"
67861
- },
67862
- {
67863
- "const": "comment"
67864
- },
67865
- {
67866
- "const": "hyperlink"
67867
- },
67868
- {
67869
- "const": "footnoteRef"
67870
- },
67871
- {
67872
- "const": "endnoteRef"
67873
- },
67874
- {
67875
- "const": "crossRef"
67876
- },
67877
- {
67878
- "const": "indexEntry"
67879
- },
67880
- {
67881
- "const": "citation"
67882
- },
67883
- {
67884
- "const": "authorityEntry"
67885
- },
67886
- {
67887
- "const": "sequenceField"
67888
- },
69302
+ }
69303
+ ]
69304
+ },
69305
+ "nodeId": {
69306
+ "type": "string"
69307
+ }
69308
+ },
69309
+ "required": [
69310
+ "kind",
69311
+ "nodeType",
69312
+ "nodeId"
69313
+ ]
69314
+ }
69315
+ },
69316
+ "required": [
69317
+ "by",
69318
+ "ref"
69319
+ ]
69320
+ },
69321
+ {
69322
+ "type": "object",
69323
+ "properties": {
69324
+ "by": {
69325
+ "const": "target"
69326
+ },
69327
+ "target": {
69328
+ "type": "object",
69329
+ "properties": {
69330
+ "kind": {
69331
+ "const": "selection"
69332
+ },
69333
+ "start": {
69334
+ "oneOf": [
67889
69335
  {
67890
- "const": "tab"
69336
+ "type": "object",
69337
+ "properties": {
69338
+ "kind": {
69339
+ "const": "text"
69340
+ },
69341
+ "blockId": {
69342
+ "type": "string"
69343
+ },
69344
+ "offset": {
69345
+ "type": "number"
69346
+ }
69347
+ },
69348
+ "required": [
69349
+ "kind",
69350
+ "blockId",
69351
+ "offset"
69352
+ ]
67891
69353
  },
67892
69354
  {
67893
- "const": "lineBreak"
69355
+ "type": "object",
69356
+ "properties": {
69357
+ "kind": {
69358
+ "const": "nodeEdge"
69359
+ },
69360
+ "node": {
69361
+ "type": "object",
69362
+ "properties": {
69363
+ "kind": {
69364
+ "const": "block"
69365
+ },
69366
+ "nodeType": {
69367
+ "oneOf": [
69368
+ {
69369
+ "const": "paragraph"
69370
+ },
69371
+ {
69372
+ "const": "heading"
69373
+ },
69374
+ {
69375
+ "const": "table"
69376
+ },
69377
+ {
69378
+ "const": "tableOfContents"
69379
+ },
69380
+ {
69381
+ "const": "sdt"
69382
+ },
69383
+ {
69384
+ "const": "image"
69385
+ }
69386
+ ]
69387
+ },
69388
+ "nodeId": {
69389
+ "type": "string"
69390
+ }
69391
+ },
69392
+ "required": [
69393
+ "kind",
69394
+ "nodeType",
69395
+ "nodeId"
69396
+ ]
69397
+ },
69398
+ "edge": {
69399
+ "oneOf": [
69400
+ {
69401
+ "const": "before"
69402
+ },
69403
+ {
69404
+ "const": "after"
69405
+ }
69406
+ ]
69407
+ }
69408
+ },
69409
+ "required": [
69410
+ "kind",
69411
+ "node",
69412
+ "edge"
69413
+ ]
67894
69414
  }
67895
69415
  ],
67896
- "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
69416
+ "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."
67897
69417
  },
67898
- "kind": {
69418
+ "end": {
67899
69419
  "oneOf": [
67900
69420
  {
67901
- "const": "block"
69421
+ "type": "object",
69422
+ "properties": {
69423
+ "kind": {
69424
+ "const": "text"
69425
+ },
69426
+ "blockId": {
69427
+ "type": "string"
69428
+ },
69429
+ "offset": {
69430
+ "type": "number"
69431
+ }
69432
+ },
69433
+ "required": [
69434
+ "kind",
69435
+ "blockId",
69436
+ "offset"
69437
+ ]
67902
69438
  },
67903
69439
  {
67904
- "const": "inline"
69440
+ "type": "object",
69441
+ "properties": {
69442
+ "kind": {
69443
+ "const": "nodeEdge"
69444
+ },
69445
+ "node": {
69446
+ "type": "object",
69447
+ "properties": {
69448
+ "kind": {
69449
+ "const": "block"
69450
+ },
69451
+ "nodeType": {
69452
+ "oneOf": [
69453
+ {
69454
+ "const": "paragraph"
69455
+ },
69456
+ {
69457
+ "const": "heading"
69458
+ },
69459
+ {
69460
+ "const": "table"
69461
+ },
69462
+ {
69463
+ "const": "tableOfContents"
69464
+ },
69465
+ {
69466
+ "const": "sdt"
69467
+ },
69468
+ {
69469
+ "const": "image"
69470
+ }
69471
+ ]
69472
+ },
69473
+ "nodeId": {
69474
+ "type": "string"
69475
+ }
69476
+ },
69477
+ "required": [
69478
+ "kind",
69479
+ "nodeType",
69480
+ "nodeId"
69481
+ ]
69482
+ },
69483
+ "edge": {
69484
+ "oneOf": [
69485
+ {
69486
+ "const": "before"
69487
+ },
69488
+ {
69489
+ "const": "after"
69490
+ }
69491
+ ]
69492
+ }
69493
+ },
69494
+ "required": [
69495
+ "kind",
69496
+ "node",
69497
+ "edge"
69498
+ ]
67905
69499
  }
67906
69500
  ],
67907
- "description": "Filter: 'block' or 'inline'."
69501
+ "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."
67908
69502
  }
67909
69503
  },
67910
69504
  "required": [
67911
- "type"
69505
+ "kind",
69506
+ "start",
69507
+ "end"
67912
69508
  ]
67913
69509
  }
69510
+ },
69511
+ "required": [
69512
+ "by",
69513
+ "target"
67914
69514
  ]
67915
69515
  },
67916
- "within": {
69516
+ {
67917
69517
  "type": "object",
67918
69518
  "properties": {
67919
- "kind": {
69519
+ "by": {
67920
69520
  "const": "block"
67921
69521
  },
67922
69522
  "nodeType": {
@@ -67955,26 +69555,11 @@ const CONTRACT = {
67955
69555
  }
67956
69556
  },
67957
69557
  "required": [
67958
- "kind",
69558
+ "by",
67959
69559
  "nodeType",
67960
69560
  "nodeId"
67961
69561
  ]
67962
- },
67963
- "require": {
67964
- "oneOf": [
67965
- {
67966
- "const": "first"
67967
- },
67968
- {
67969
- "const": "exactlyOne"
67970
- }
67971
- ]
67972
69562
  }
67973
- },
67974
- "required": [
67975
- "by",
67976
- "select",
67977
- "require"
67978
69563
  ]
67979
69564
  },
67980
69565
  "args": {
@@ -68571,6 +70156,53 @@ const CONTRACT = {
68571
70156
  "by",
68572
70157
  "target"
68573
70158
  ]
70159
+ },
70160
+ {
70161
+ "type": "object",
70162
+ "properties": {
70163
+ "by": {
70164
+ "const": "block"
70165
+ },
70166
+ "nodeType": {
70167
+ "oneOf": [
70168
+ {
70169
+ "const": "paragraph"
70170
+ },
70171
+ {
70172
+ "const": "heading"
70173
+ },
70174
+ {
70175
+ "const": "listItem"
70176
+ },
70177
+ {
70178
+ "const": "table"
70179
+ },
70180
+ {
70181
+ "const": "tableRow"
70182
+ },
70183
+ {
70184
+ "const": "tableCell"
70185
+ },
70186
+ {
70187
+ "const": "tableOfContents"
70188
+ },
70189
+ {
70190
+ "const": "image"
70191
+ },
70192
+ {
70193
+ "const": "sdt"
70194
+ }
70195
+ ]
70196
+ },
70197
+ "nodeId": {
70198
+ "type": "string"
70199
+ }
70200
+ },
70201
+ "required": [
70202
+ "by",
70203
+ "nodeType",
70204
+ "nodeId"
70205
+ ]
68574
70206
  }
68575
70207
  ]
68576
70208
  },
@@ -69067,6 +70699,53 @@ const CONTRACT = {
69067
70699
  "by",
69068
70700
  "target"
69069
70701
  ]
70702
+ },
70703
+ {
70704
+ "type": "object",
70705
+ "properties": {
70706
+ "by": {
70707
+ "const": "block"
70708
+ },
70709
+ "nodeType": {
70710
+ "oneOf": [
70711
+ {
70712
+ "const": "paragraph"
70713
+ },
70714
+ {
70715
+ "const": "heading"
70716
+ },
70717
+ {
70718
+ "const": "listItem"
70719
+ },
70720
+ {
70721
+ "const": "table"
70722
+ },
70723
+ {
70724
+ "const": "tableRow"
70725
+ },
70726
+ {
70727
+ "const": "tableCell"
70728
+ },
70729
+ {
70730
+ "const": "tableOfContents"
70731
+ },
70732
+ {
70733
+ "const": "image"
70734
+ },
70735
+ {
70736
+ "const": "sdt"
70737
+ }
70738
+ ]
70739
+ },
70740
+ "nodeId": {
70741
+ "type": "string"
70742
+ }
70743
+ },
70744
+ "required": [
70745
+ "by",
70746
+ "nodeType",
70747
+ "nodeId"
70748
+ ]
69070
70749
  }
69071
70750
  ]
69072
70751
  },
@@ -69838,11 +71517,36 @@ const CONTRACT = {
69838
71517
  ]
69839
71518
  }
69840
71519
  }
71520
+ },
71521
+ "alignment": {
71522
+ "oneOf": [
71523
+ {
71524
+ "const": "left"
71525
+ },
71526
+ {
71527
+ "const": "center"
71528
+ },
71529
+ {
71530
+ "const": "right"
71531
+ },
71532
+ {
71533
+ "const": "justify"
71534
+ }
71535
+ ],
71536
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step."
71537
+ },
71538
+ "scope": {
71539
+ "oneOf": [
71540
+ {
71541
+ "const": "match"
71542
+ },
71543
+ {
71544
+ "const": "block"
71545
+ }
71546
+ ],
71547
+ "description": "When \"block\", inline formatting expands to cover the entire parent paragraph(s), not just the matched text. Use \"block\" after markdown inserts to format whole paragraphs with a short identifying pattern. Default: \"match\"."
69841
71548
  }
69842
- },
69843
- "required": [
69844
- "inline"
69845
- ]
71549
+ }
69846
71550
  }
69847
71551
  },
69848
71552
  "required": [
@@ -70260,6 +71964,37 @@ const CONTRACT = {
70260
71964
  "by",
70261
71965
  "target"
70262
71966
  ]
71967
+ },
71968
+ {
71969
+ "type": "object",
71970
+ "properties": {
71971
+ "by": {
71972
+ "const": "block",
71973
+ "type": "string"
71974
+ },
71975
+ "nodeType": {
71976
+ "enum": [
71977
+ "paragraph",
71978
+ "heading",
71979
+ "listItem",
71980
+ "table",
71981
+ "tableRow",
71982
+ "tableCell",
71983
+ "tableOfContents",
71984
+ "image",
71985
+ "sdt"
71986
+ ]
71987
+ },
71988
+ "nodeId": {
71989
+ "type": "string"
71990
+ }
71991
+ },
71992
+ "additionalProperties": false,
71993
+ "required": [
71994
+ "by",
71995
+ "nodeType",
71996
+ "nodeId"
71997
+ ]
70263
71998
  }
70264
71999
  ]
70265
72000
  },
@@ -70421,107 +72156,179 @@ const CONTRACT = {
70421
72156
  "type": "string"
70422
72157
  },
70423
72158
  "where": {
70424
- "type": "object",
70425
- "properties": {
70426
- "by": {
70427
- "const": "select",
70428
- "type": "string"
70429
- },
70430
- "select": {
70431
- "oneOf": [
70432
- {
70433
- "type": "object",
70434
- "properties": {
70435
- "type": {
70436
- "const": "text",
70437
- "description": "Must be 'text' for text pattern search."
70438
- },
70439
- "pattern": {
70440
- "type": "string",
70441
- "description": "Text or regex pattern to match."
70442
- },
70443
- "mode": {
70444
- "enum": [
70445
- "contains",
70446
- "regex"
70447
- ],
70448
- "description": "Match mode: 'contains' (substring) or 'regex'."
72159
+ "oneOf": [
72160
+ {
72161
+ "type": "object",
72162
+ "properties": {
72163
+ "by": {
72164
+ "const": "select",
72165
+ "type": "string"
72166
+ },
72167
+ "select": {
72168
+ "oneOf": [
72169
+ {
72170
+ "type": "object",
72171
+ "properties": {
72172
+ "type": {
72173
+ "const": "text",
72174
+ "description": "Must be 'text' for text pattern search."
72175
+ },
72176
+ "pattern": {
72177
+ "type": "string",
72178
+ "description": "Text or regex pattern to match."
72179
+ },
72180
+ "mode": {
72181
+ "enum": [
72182
+ "contains",
72183
+ "regex"
72184
+ ],
72185
+ "description": "Match mode: 'contains' (substring) or 'regex'."
72186
+ },
72187
+ "caseSensitive": {
72188
+ "type": "boolean",
72189
+ "description": "Case-sensitive matching. Default: false."
72190
+ }
72191
+ },
72192
+ "additionalProperties": false,
72193
+ "required": [
72194
+ "type",
72195
+ "pattern"
72196
+ ]
70449
72197
  },
70450
- "caseSensitive": {
70451
- "type": "boolean",
70452
- "description": "Case-sensitive matching. Default: false."
72198
+ {
72199
+ "type": "object",
72200
+ "properties": {
72201
+ "type": {
72202
+ "const": "node",
72203
+ "description": "Must be 'node' for node type search."
72204
+ },
72205
+ "nodeType": {
72206
+ "enum": [
72207
+ "paragraph",
72208
+ "heading",
72209
+ "listItem",
72210
+ "table",
72211
+ "tableRow",
72212
+ "tableCell",
72213
+ "tableOfContents",
72214
+ "image",
72215
+ "sdt",
72216
+ "run",
72217
+ "bookmark",
72218
+ "comment",
72219
+ "hyperlink",
72220
+ "footnoteRef",
72221
+ "endnoteRef",
72222
+ "crossRef",
72223
+ "indexEntry",
72224
+ "citation",
72225
+ "authorityEntry",
72226
+ "sequenceField",
72227
+ "tab",
72228
+ "lineBreak"
72229
+ ],
72230
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
72231
+ },
72232
+ "kind": {
72233
+ "enum": [
72234
+ "block",
72235
+ "inline"
72236
+ ],
72237
+ "description": "Filter: 'block' or 'inline'."
72238
+ }
72239
+ },
72240
+ "additionalProperties": false,
72241
+ "required": [
72242
+ "type"
72243
+ ]
70453
72244
  }
70454
- },
70455
- "additionalProperties": false,
70456
- "required": [
70457
- "type",
70458
- "pattern"
70459
72245
  ]
70460
72246
  },
70461
- {
70462
- "type": "object",
70463
- "properties": {
70464
- "type": {
70465
- "const": "node",
70466
- "description": "Must be 'node' for node type search."
70467
- },
70468
- "nodeType": {
70469
- "enum": [
70470
- "paragraph",
70471
- "heading",
70472
- "listItem",
70473
- "table",
70474
- "tableRow",
70475
- "tableCell",
70476
- "tableOfContents",
70477
- "image",
70478
- "sdt",
70479
- "run",
70480
- "bookmark",
70481
- "comment",
70482
- "hyperlink",
70483
- "footnoteRef",
70484
- "endnoteRef",
70485
- "crossRef",
70486
- "indexEntry",
70487
- "citation",
70488
- "authorityEntry",
70489
- "sequenceField",
70490
- "tab",
70491
- "lineBreak"
70492
- ],
70493
- "description": "Block type to match (paragraph, heading, table, listItem, etc.)."
70494
- },
70495
- "kind": {
70496
- "enum": [
70497
- "block",
70498
- "inline"
70499
- ],
70500
- "description": "Filter: 'block' or 'inline'."
70501
- }
70502
- },
70503
- "additionalProperties": false,
70504
- "required": [
70505
- "type"
72247
+ "within": {
72248
+ "$ref": "#/$defs/BlockNodeAddress"
72249
+ },
72250
+ "require": {
72251
+ "enum": [
72252
+ "first",
72253
+ "exactlyOne"
70506
72254
  ]
70507
72255
  }
72256
+ },
72257
+ "additionalProperties": false,
72258
+ "required": [
72259
+ "by",
72260
+ "select",
72261
+ "require"
70508
72262
  ]
70509
72263
  },
70510
- "within": {
70511
- "$ref": "#/$defs/BlockNodeAddress"
72264
+ {
72265
+ "type": "object",
72266
+ "properties": {
72267
+ "by": {
72268
+ "const": "ref",
72269
+ "type": "string"
72270
+ },
72271
+ "ref": {
72272
+ "type": "string"
72273
+ },
72274
+ "within": {
72275
+ "$ref": "#/$defs/BlockNodeAddress"
72276
+ }
72277
+ },
72278
+ "additionalProperties": false,
72279
+ "required": [
72280
+ "by",
72281
+ "ref"
72282
+ ]
70512
72283
  },
70513
- "require": {
70514
- "enum": [
70515
- "first",
70516
- "exactlyOne"
72284
+ {
72285
+ "type": "object",
72286
+ "properties": {
72287
+ "by": {
72288
+ "const": "target",
72289
+ "type": "string"
72290
+ },
72291
+ "target": {
72292
+ "$ref": "#/$defs/SelectionTarget"
72293
+ }
72294
+ },
72295
+ "additionalProperties": false,
72296
+ "required": [
72297
+ "by",
72298
+ "target"
72299
+ ]
72300
+ },
72301
+ {
72302
+ "type": "object",
72303
+ "properties": {
72304
+ "by": {
72305
+ "const": "block",
72306
+ "type": "string"
72307
+ },
72308
+ "nodeType": {
72309
+ "enum": [
72310
+ "paragraph",
72311
+ "heading",
72312
+ "listItem",
72313
+ "table",
72314
+ "tableRow",
72315
+ "tableCell",
72316
+ "tableOfContents",
72317
+ "image",
72318
+ "sdt"
72319
+ ]
72320
+ },
72321
+ "nodeId": {
72322
+ "type": "string"
72323
+ }
72324
+ },
72325
+ "additionalProperties": false,
72326
+ "required": [
72327
+ "by",
72328
+ "nodeType",
72329
+ "nodeId"
70517
72330
  ]
70518
72331
  }
70519
- },
70520
- "additionalProperties": false,
70521
- "required": [
70522
- "by",
70523
- "select",
70524
- "require"
70525
72332
  ]
70526
72333
  },
70527
72334
  "args": {
@@ -70774,6 +72581,37 @@ const CONTRACT = {
70774
72581
  "by",
70775
72582
  "target"
70776
72583
  ]
72584
+ },
72585
+ {
72586
+ "type": "object",
72587
+ "properties": {
72588
+ "by": {
72589
+ "const": "block",
72590
+ "type": "string"
72591
+ },
72592
+ "nodeType": {
72593
+ "enum": [
72594
+ "paragraph",
72595
+ "heading",
72596
+ "listItem",
72597
+ "table",
72598
+ "tableRow",
72599
+ "tableCell",
72600
+ "tableOfContents",
72601
+ "image",
72602
+ "sdt"
72603
+ ]
72604
+ },
72605
+ "nodeId": {
72606
+ "type": "string"
72607
+ }
72608
+ },
72609
+ "additionalProperties": false,
72610
+ "required": [
72611
+ "by",
72612
+ "nodeType",
72613
+ "nodeId"
72614
+ ]
70777
72615
  }
70778
72616
  ]
70779
72617
  },
@@ -70948,6 +72786,37 @@ const CONTRACT = {
70948
72786
  "by",
70949
72787
  "target"
70950
72788
  ]
72789
+ },
72790
+ {
72791
+ "type": "object",
72792
+ "properties": {
72793
+ "by": {
72794
+ "const": "block",
72795
+ "type": "string"
72796
+ },
72797
+ "nodeType": {
72798
+ "enum": [
72799
+ "paragraph",
72800
+ "heading",
72801
+ "listItem",
72802
+ "table",
72803
+ "tableRow",
72804
+ "tableCell",
72805
+ "tableOfContents",
72806
+ "image",
72807
+ "sdt"
72808
+ ]
72809
+ },
72810
+ "nodeId": {
72811
+ "type": "string"
72812
+ }
72813
+ },
72814
+ "additionalProperties": false,
72815
+ "required": [
72816
+ "by",
72817
+ "nodeType",
72818
+ "nodeId"
72819
+ ]
70951
72820
  }
70952
72821
  ]
70953
72822
  },
@@ -71762,12 +73631,28 @@ const CONTRACT = {
71762
73631
  },
71763
73632
  "additionalProperties": false,
71764
73633
  "minProperties": 1
73634
+ },
73635
+ "alignment": {
73636
+ "type": "string",
73637
+ "enum": [
73638
+ "left",
73639
+ "center",
73640
+ "right",
73641
+ "justify"
73642
+ ],
73643
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step."
73644
+ },
73645
+ "scope": {
73646
+ "type": "string",
73647
+ "enum": [
73648
+ "match",
73649
+ "block"
73650
+ ],
73651
+ "description": "When \"block\", inline formatting expands to cover the entire parent paragraph(s), not just the matched text. Use \"block\" after markdown inserts to format whole paragraphs with a short identifying pattern. Default: \"match\"."
71765
73652
  }
71766
73653
  },
71767
73654
  "additionalProperties": false,
71768
- "required": [
71769
- "inline"
71770
- ]
73655
+ "minProperties": 1
71771
73656
  }
71772
73657
  },
71773
73658
  "additionalProperties": false,
@@ -114286,6 +116171,195 @@ const CONTRACT = {
114286
116171
  ]
114287
116172
  }
114288
116173
  },
116174
+ {
116175
+ "name": "at",
116176
+ "kind": "jsonFlag",
116177
+ "type": "json",
116178
+ "flag": "at-json",
116179
+ "schema": {
116180
+ "type": "object",
116181
+ "properties": {
116182
+ "kind": {
116183
+ "const": "selection"
116184
+ },
116185
+ "start": {
116186
+ "oneOf": [
116187
+ {
116188
+ "type": "object",
116189
+ "properties": {
116190
+ "kind": {
116191
+ "const": "text"
116192
+ },
116193
+ "blockId": {
116194
+ "type": "string"
116195
+ },
116196
+ "offset": {
116197
+ "type": "number"
116198
+ }
116199
+ },
116200
+ "required": [
116201
+ "kind",
116202
+ "blockId",
116203
+ "offset"
116204
+ ]
116205
+ },
116206
+ {
116207
+ "type": "object",
116208
+ "properties": {
116209
+ "kind": {
116210
+ "const": "nodeEdge"
116211
+ },
116212
+ "node": {
116213
+ "type": "object",
116214
+ "properties": {
116215
+ "kind": {
116216
+ "const": "block"
116217
+ },
116218
+ "nodeType": {
116219
+ "oneOf": [
116220
+ {
116221
+ "const": "paragraph"
116222
+ },
116223
+ {
116224
+ "const": "heading"
116225
+ },
116226
+ {
116227
+ "const": "table"
116228
+ },
116229
+ {
116230
+ "const": "tableOfContents"
116231
+ },
116232
+ {
116233
+ "const": "sdt"
116234
+ },
116235
+ {
116236
+ "const": "image"
116237
+ }
116238
+ ]
116239
+ },
116240
+ "nodeId": {
116241
+ "type": "string"
116242
+ }
116243
+ },
116244
+ "required": [
116245
+ "kind",
116246
+ "nodeType",
116247
+ "nodeId"
116248
+ ]
116249
+ },
116250
+ "edge": {
116251
+ "oneOf": [
116252
+ {
116253
+ "const": "before"
116254
+ },
116255
+ {
116256
+ "const": "after"
116257
+ }
116258
+ ]
116259
+ }
116260
+ },
116261
+ "required": [
116262
+ "kind",
116263
+ "node",
116264
+ "edge"
116265
+ ]
116266
+ }
116267
+ ],
116268
+ "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."
116269
+ },
116270
+ "end": {
116271
+ "oneOf": [
116272
+ {
116273
+ "type": "object",
116274
+ "properties": {
116275
+ "kind": {
116276
+ "const": "text"
116277
+ },
116278
+ "blockId": {
116279
+ "type": "string"
116280
+ },
116281
+ "offset": {
116282
+ "type": "number"
116283
+ }
116284
+ },
116285
+ "required": [
116286
+ "kind",
116287
+ "blockId",
116288
+ "offset"
116289
+ ]
116290
+ },
116291
+ {
116292
+ "type": "object",
116293
+ "properties": {
116294
+ "kind": {
116295
+ "const": "nodeEdge"
116296
+ },
116297
+ "node": {
116298
+ "type": "object",
116299
+ "properties": {
116300
+ "kind": {
116301
+ "const": "block"
116302
+ },
116303
+ "nodeType": {
116304
+ "oneOf": [
116305
+ {
116306
+ "const": "paragraph"
116307
+ },
116308
+ {
116309
+ "const": "heading"
116310
+ },
116311
+ {
116312
+ "const": "table"
116313
+ },
116314
+ {
116315
+ "const": "tableOfContents"
116316
+ },
116317
+ {
116318
+ "const": "sdt"
116319
+ },
116320
+ {
116321
+ "const": "image"
116322
+ }
116323
+ ]
116324
+ },
116325
+ "nodeId": {
116326
+ "type": "string"
116327
+ }
116328
+ },
116329
+ "required": [
116330
+ "kind",
116331
+ "nodeType",
116332
+ "nodeId"
116333
+ ]
116334
+ },
116335
+ "edge": {
116336
+ "oneOf": [
116337
+ {
116338
+ "const": "before"
116339
+ },
116340
+ {
116341
+ "const": "after"
116342
+ }
116343
+ ]
116344
+ }
116345
+ },
116346
+ "required": [
116347
+ "kind",
116348
+ "node",
116349
+ "edge"
116350
+ ]
116351
+ }
116352
+ ],
116353
+ "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."
116354
+ }
116355
+ },
116356
+ "required": [
116357
+ "kind",
116358
+ "start",
116359
+ "end"
116360
+ ]
116361
+ }
116362
+ },
114289
116363
  {
114290
116364
  "name": "tag",
114291
116365
  "kind": "flag",
@@ -114364,6 +116438,9 @@ const CONTRACT = {
114364
116438
  "nodeId"
114365
116439
  ]
114366
116440
  },
116441
+ "at": {
116442
+ "$ref": "#/$defs/SelectionTarget"
116443
+ },
114367
116444
  "tag": {
114368
116445
  "type": "string"
114369
116446
  },
@@ -145917,6 +147994,13 @@ const CONTRACT = {
145917
147994
  "type": "string",
145918
147995
  "description": "Environment variable name containing the auth token."
145919
147996
  },
147997
+ "params": {
147998
+ "type": "object",
147999
+ "description": "Custom query parameters appended to the WebSocket URL. Values must be strings. Reserved keys: token.",
148000
+ "additionalProperties": {
148001
+ "type": "string"
148002
+ }
148003
+ },
145920
148004
  "syncTimeoutMs": {
145921
148005
  "type": "number",
145922
148006
  "description": "Max time (ms) to wait for initial sync."
@@ -146126,6 +148210,13 @@ const CONTRACT = {
146126
148210
  "type": "string",
146127
148211
  "description": "Environment variable name containing the auth token."
146128
148212
  },
148213
+ "params": {
148214
+ "type": "object",
148215
+ "description": "Custom query parameters appended to the WebSocket URL. Values must be strings. Reserved keys: token.",
148216
+ "additionalProperties": {
148217
+ "type": "string"
148218
+ }
148219
+ },
146129
148220
  "syncTimeoutMs": {
146130
148221
  "type": "number",
146131
148222
  "description": "Max time (ms) to wait for initial sync."