@superdoc/cli 0.35.2-next.1 → 0.36.0-next.10

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.
@@ -121,7 +121,7 @@
121
121
  "type": "function",
122
122
  "function": {
123
123
  "name": "superdoc_edit",
124
- "description": "The primary tool for inserting content into documents. ALWAYS use action \"insert\" with type \"markdown\" to create headings, paragraphs, or any block content: this is faster and creates proper document structure in one call. Do NOT use superdoc_create for headings or paragraphs. The markdown parser creates headings from # markers (# = Heading1, ## = Heading2), bold from **text**, italic from *text*, and numbered/bullet lists. Position markdown inserts with \"target\" (a BlockNodeAddress like {kind:\"block\", nodeType, nodeId}) and \"placement\" (before, after, insideStart, insideEnd). Without a target, content appends at the end of the document. IMPORTANT: After a markdown insert, analyze the document context (what kind of document, how titles and body text are styled) and follow up with ONE superdoc_mutations call to format inserted blocks so they look like they belong. Each format.apply step accepts \"inline\" (fontFamily, fontSize, bold, underline, color), \"alignment\", and \"scope\" in the same step. Use scope: \"block\" so formatting covers the entire paragraph. Copy the exact property values from the existing get_content blocks (fontFamily, fontSize, color, alignment, bold, underline). Do NOT invent values: use what the blocks show. Also supports replace, delete, and undo/redo. For ordinary replace and delete, pass a \"ref\" from superdoc_search or superdoc_get_content blocks. A search ref covers only the matched substring; a block ref covers the entire block text, so use block refs when rewriting or shortening whole paragraphs. To replace every block in the main body, use action \"replace\" with target:{kind:\"story\",storyType:\"body\"}, one text/value/content payload, and changeMode:\"direct\". This replaces body content, not the DOCX package, and does not require a search first. Tracked whole-body replacement is unsupported. For multi-step redlines or whole-clause rewrites, prefer superdoc_mutations with where:{by:\"block\", nodeType, nodeId} from superdoc_get_content action \"blocks\" includeText:true rather than relying on text selectors. Refs expire after any mutation; always re-search before the next edit. For 2+ edits that must succeed or fail atomically, use superdoc_mutations instead. Before an exact HTML or Markdown insert/replace that must be fidelity-checked, use action \"check_support\", review its outcome and diagnostics, then pass its guard back as \"supportCheck\" on the unchanged write. Supports \"dryRun\" to preview changes and \"changeMode: tracked\" to record edits as tracked changes. Do NOT build \"target\" objects manually when a ref is available; prefer \"ref\" for simpler, more reliable targeting.\n\nEXAMPLES:\n 1. {\"action\":\"insert\",\"type\":\"markdown\",\"target\":{\"kind\":\"block\",\"nodeType\":\"paragraph\",\"nodeId\":\"<nodeId>\"},\"placement\":\"before\",\"value\":\"# Executive Summary\\n\\nThis agreement sets forth the principal terms...\",\"changeMode\":\"direct\"}\n 2. {\"action\":\"insert\",\"type\":\"html\",\"value\":\"<h2>Review heading</h2><p>Tracked rich content.</p>\",\"changeMode\":\"tracked\"}\n 3. {\"action\":\"insert\",\"type\":\"markdown\",\"value\":\"# Section Title\\n\\nParagraph content here.\\n\\n# Another Section\\n\\nMore content with **bold** and *italic*.\"}\n 4. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"text\":\"new text here\"}\n 5. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"value\":\"**Direct rich replacement**\",\"type\":\"markdown\",\"changeMode\":\"direct\"}\n 6. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"value\":\"<strong>Tracked rich replacement</strong>\",\"type\":\"html\",\"changeMode\":\"tracked\"}\n 7. {\"action\":\"check_support\",\"operation\":\"insert\",\"input\":{\"type\":\"markdown\",\"value\":\"# Checked section\"},\"options\":{\"changeMode\":\"direct\"}}\n 8. {\"action\":\"replace\",\"target\":{\"kind\":\"story\",\"storyType\":\"body\"},\"value\":\"# Replacement\\n\\nComplete new body.\",\"type\":\"markdown\",\"changeMode\":\"direct\"}\n 9. {\"action\":\"delete\",\"ref\":\"<handle.ref>\"}\n 10. {\"action\":\"undo\"}",
124
+ "description": "The primary tool for inserting content into documents. ALWAYS use action \"insert\" with type \"markdown\" to create headings, paragraphs, or any block content: this is faster and creates proper document structure in one call. Do NOT use superdoc_create for headings or paragraphs. The markdown parser creates headings from # markers (# = Heading1, ## = Heading2), bold from **text**, italic from *text*, and numbered/bullet lists. Position markdown inserts with \"target\" (a BlockNodeAddress like {kind:\"block\", nodeType, nodeId}) and \"placement\" (before, after, insideStart, insideEnd). Without a target, content appends at the end of the document. IMPORTANT: After a markdown insert, analyze the document context (what kind of document, how titles and body text are styled) and follow up with ONE superdoc_mutations call to format inserted blocks so they look like they belong. Each format.apply step accepts \"inline\" (fontFamily, fontSize, bold, underline, color), \"alignment\", and \"scope\" in the same step. Use scope: \"block\" so formatting covers the entire paragraph. Copy the exact property values from the existing get_content blocks (fontFamily, fontSize, color, alignment, bold, underline). Do NOT invent values: use what the blocks show. Also supports replace, delete, and undo/redo. For ordinary replace and delete, pass a \"ref\" from superdoc_search or superdoc_get_content blocks. Action \"delete\" removes a text range and leaves the block container in place. To remove a whole paragraph, heading, list item, or table, use action \"delete_block\" with target:{kind:\"block\", nodeType, nodeId} from superdoc_get_content action \"blocks\", or action \"delete_block_range\" with \"start\" and \"end\" block addresses to remove a contiguous span of top-level blocks (inclusive). A search ref covers only the matched substring; a block ref covers the entire block text, so use block refs when rewriting or shortening whole paragraphs. To replace every block in the main body, use action \"replace\" with target:{kind:\"story\",storyType:\"body\"}, one text/value/content payload, and changeMode:\"direct\". This replaces body content, not the DOCX package, and does not require a search first. Tracked whole-body replacement is unsupported. For multi-step redlines or whole-clause rewrites, prefer superdoc_mutations with where:{by:\"block\", nodeType, nodeId} from superdoc_get_content action \"blocks\" includeText:true rather than relying on text selectors. Refs expire after any mutation; always re-search before the next edit. For 2+ edits that must succeed or fail atomically, use superdoc_mutations instead. Before an exact HTML or Markdown insert/replace that must be fidelity-checked, use action \"check_support\", review its outcome and diagnostics, then pass its guard back as \"supportCheck\" on the unchanged write. Supports \"dryRun\" to preview changes and \"changeMode: tracked\" to record edits as tracked changes. Do NOT build \"target\" objects manually when a ref is available; prefer \"ref\" for simpler, more reliable targeting.\n\nEXAMPLES:\n 1. {\"action\":\"insert\",\"type\":\"markdown\",\"target\":{\"kind\":\"block\",\"nodeType\":\"paragraph\",\"nodeId\":\"<nodeId>\"},\"placement\":\"before\",\"value\":\"# Executive Summary\\n\\nThis agreement sets forth the principal terms...\",\"changeMode\":\"direct\"}\n 2. {\"action\":\"insert\",\"type\":\"html\",\"value\":\"<h2>Review heading</h2><p>Tracked rich content.</p>\",\"changeMode\":\"tracked\"}\n 3. {\"action\":\"insert\",\"type\":\"markdown\",\"value\":\"# Section Title\\n\\nParagraph content here.\\n\\n# Another Section\\n\\nMore content with **bold** and *italic*.\"}\n 4. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"text\":\"new text here\"}\n 5. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"value\":\"**Direct rich replacement**\",\"type\":\"markdown\",\"changeMode\":\"direct\"}\n 6. {\"action\":\"replace\",\"ref\":\"<handle.ref>\",\"value\":\"<strong>Tracked rich replacement</strong>\",\"type\":\"html\",\"changeMode\":\"tracked\"}\n 7. {\"action\":\"check_support\",\"operation\":\"insert\",\"input\":{\"type\":\"markdown\",\"value\":\"# Checked section\"},\"options\":{\"changeMode\":\"direct\"}}\n 8. {\"action\":\"replace\",\"target\":{\"kind\":\"story\",\"storyType\":\"body\"},\"value\":\"# Replacement\\n\\nComplete new body.\",\"type\":\"markdown\",\"changeMode\":\"direct\"}\n 9. {\"action\":\"delete\",\"ref\":\"<handle.ref>\"}\n 10. {\"action\":\"delete_block\",\"target\":{\"kind\":\"block\",\"nodeType\":\"heading\",\"nodeId\":\"<nodeId>\"}}\n 11. {\"action\":\"undo\"}",
125
125
  "parameters": {
126
126
  "type": "object",
127
127
  "properties": {
@@ -130,12 +130,14 @@
130
130
  "enum": [
131
131
  "check_support",
132
132
  "delete",
133
+ "delete_block",
134
+ "delete_block_range",
133
135
  "insert",
134
136
  "redo",
135
137
  "replace",
136
138
  "undo"
137
139
  ],
138
- "description": "The action to perform. One of: check_support, delete, insert, redo, replace, undo."
140
+ "description": "The action to perform. One of: check_support, delete, delete_block, delete_block_range, insert, redo, replace, undo."
139
141
  },
140
142
  "force": {
141
143
  "type": "boolean",
@@ -147,7 +149,7 @@
147
149
  },
148
150
  "dryRun": {
149
151
  "type": "boolean",
150
- "description": "Preview the result without applying changes. Only for actions 'insert', 'replace', 'delete'. Omit for other actions."
152
+ "description": "Preview the result without applying changes."
151
153
  },
152
154
  "supportCheck": {
153
155
  "type": "object",
@@ -183,45 +185,53 @@
183
185
  "description": "Guard returned by capabilities check for this exact HTML or Markdown write. Only for actions 'insert', 'replace'. Omit for other actions."
184
186
  },
185
187
  "target": {
186
- "oneOf": [
188
+ "anyOf": [
187
189
  {
188
- "oneOf": [
190
+ "anyOf": [
189
191
  {
190
- "$ref": "#/$defs/BlockNodeAddress",
192
+ "anyOf": [
193
+ {
194
+ "$ref": "#/$defs/BlockNodeAddress",
195
+ "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}."
196
+ },
197
+ {
198
+ "type": "object",
199
+ "properties": {
200
+ "kind": {
201
+ "const": "story",
202
+ "type": "string"
203
+ },
204
+ "storyType": {
205
+ "const": "body",
206
+ "type": "string"
207
+ }
208
+ },
209
+ "additionalProperties": false,
210
+ "required": [
211
+ "kind",
212
+ "storyType"
213
+ ]
214
+ }
215
+ ],
191
216
  "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}."
192
217
  },
193
218
  {
194
- "type": "object",
195
- "properties": {
196
- "kind": {
197
- "const": "story",
198
- "type": "string"
199
- },
200
- "storyType": {
201
- "const": "body",
202
- "type": "string"
203
- }
204
- },
205
- "additionalProperties": false,
206
- "required": [
207
- "kind",
208
- "storyType"
209
- ]
219
+ "$ref": "#/$defs/SelectionTarget",
220
+ "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."
210
221
  }
211
222
  ],
212
223
  "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}."
213
224
  },
214
225
  {
215
- "$ref": "#/$defs/SelectionTarget",
216
- "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."
226
+ "$ref": "#/$defs/DeletableBlockNodeAddress"
217
227
  }
218
228
  ],
219
- "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}. Only for actions 'insert', 'replace', 'delete'. Omit for other actions."
229
+ "description": "Block address for structural insertion: {kind:'block', nodeType:'...', nodeId:'...'}. Required for action 'delete_block'."
220
230
  },
221
231
  "in": {
222
- "oneOf": [
232
+ "anyOf": [
223
233
  {
224
- "oneOf": [
234
+ "anyOf": [
225
235
  {
226
236
  "$ref": "#/$defs/StoryLocator",
227
237
  "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."
@@ -405,7 +415,7 @@
405
415
  "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 actions 'insert', 'replace', 'delete'. Omit for other actions."
406
416
  },
407
417
  "value": {
408
- "oneOf": [
418
+ "anyOf": [
409
419
  {
410
420
  "type": "string",
411
421
  "description": "HTML or Markdown content to convert and insert."
@@ -418,7 +428,7 @@
418
428
  "description": "HTML or Markdown content to convert and insert. Only for actions 'insert', 'replace'. Omit for other actions."
419
429
  },
420
430
  "type": {
421
- "oneOf": [
431
+ "anyOf": [
422
432
  {
423
433
  "type": "string",
424
434
  "oneOf": [
@@ -446,9 +456,9 @@
446
456
  "description": "Only for actions 'insert', 'replace'. Omit for other actions."
447
457
  },
448
458
  "ref": {
449
- "oneOf": [
459
+ "anyOf": [
450
460
  {
451
- "oneOf": [
461
+ "anyOf": [
452
462
  {
453
463
  "type": "string",
454
464
  "description": "Handle ref from superdoc_search result (pass handle.ref value directly). Preferred over building a target object."
@@ -477,7 +487,7 @@
477
487
  "description": "Where to place content relative to target: 'before', 'after', 'insideStart', or 'insideEnd'. Only for action 'insert'. Omit for other actions."
478
488
  },
479
489
  "content": {
480
- "oneOf": [
490
+ "anyOf": [
481
491
  {
482
492
  "oneOf": [
483
493
  {
@@ -511,7 +521,7 @@
511
521
  "description": "Document fragment to insert (structured content). Only for actions 'insert', 'replace'. Omit for other actions."
512
522
  },
513
523
  "nestingPolicy": {
514
- "oneOf": [
524
+ "anyOf": [
515
525
  {
516
526
  "type": "object",
517
527
  "properties": {
@@ -548,14 +558,28 @@
548
558
  "$ref": "#/$defs/DeleteBehavior",
549
559
  "description": "Delete behavior: 'selection' (default) or 'exact'. Only for action 'delete'. Omit for other actions."
550
560
  },
561
+ "start": {
562
+ "$ref": "#/$defs/BlockNodeAddress",
563
+ "description": "Required for action 'delete_block_range'."
564
+ },
565
+ "end": {
566
+ "$ref": "#/$defs/BlockNodeAddress",
567
+ "description": "Required for action 'delete_block_range'."
568
+ },
551
569
  "operation": {
552
- "oneOf": [
570
+ "anyOf": [
553
571
  {
554
- "oneOf": [
572
+ "anyOf": [
555
573
  {
556
- "enum": [
557
- "insert",
558
- "replace"
574
+ "anyOf": [
575
+ {
576
+ "const": "insert",
577
+ "type": "string"
578
+ },
579
+ {
580
+ "const": "replace",
581
+ "type": "string"
582
+ }
559
583
  ]
560
584
  },
561
585
  {
@@ -572,11 +596,11 @@
572
596
  "description": "Required for action 'check_support'."
573
597
  },
574
598
  "input": {
575
- "oneOf": [
599
+ "anyOf": [
576
600
  {
577
- "oneOf": [
601
+ "anyOf": [
578
602
  {
579
- "oneOf": [
603
+ "anyOf": [
580
604
  {
581
605
  "oneOf": [
582
606
  {
@@ -876,19 +900,19 @@
876
900
  "description": "Preview the result without applying changes."
877
901
  },
878
902
  "target": {
879
- "oneOf": [
903
+ "anyOf": [
880
904
  {
881
- "oneOf": [
905
+ "anyOf": [
882
906
  {
883
- "oneOf": [
907
+ "anyOf": [
884
908
  {
885
- "oneOf": [
909
+ "anyOf": [
886
910
  {
887
- "oneOf": [
911
+ "anyOf": [
888
912
  {
889
- "oneOf": [
913
+ "anyOf": [
890
914
  {
891
- "oneOf": [
915
+ "anyOf": [
892
916
  {
893
917
  "$ref": "#/$defs/SelectionTarget",
894
918
  "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."
@@ -1824,7 +1848,7 @@
1824
1848
  "description": "Handle ref string from a superdoc_search result. Pass the handle.ref value directly (e.g. 'text:eyJ...'). Preferred over 'target' for inline formatting. Only for action 'inline'. Omit for other actions."
1825
1849
  },
1826
1850
  "styleId": {
1827
- "oneOf": [
1851
+ "anyOf": [
1828
1852
  {
1829
1853
  "type": "string",
1830
1854
  "minLength": 1,
@@ -2037,7 +2061,7 @@
2037
2061
  "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."
2038
2062
  },
2039
2063
  "at": {
2040
- "oneOf": [
2064
+ "anyOf": [
2041
2065
  {
2042
2066
  "description": "Position: {kind:'documentEnd'} to append, {kind:'documentStart'} to prepend, or {kind:'before'|'after', target:{kind:'block', nodeType:'...', nodeId:'...'}} for relative placement.",
2043
2067
  "oneOf": [
@@ -2233,7 +2257,7 @@
2233
2257
  "description": "Position: {kind:'documentEnd'} to append, {kind:'documentStart'} to prepend, or {kind:'before'|'after', target:{kind:'block', nodeType:'...', nodeId:'...'}} for relative placement."
2234
2258
  },
2235
2259
  "text": {
2236
- "oneOf": [
2260
+ "anyOf": [
2237
2261
  {
2238
2262
  "type": "string",
2239
2263
  "description": "Paragraph text content. Each call creates ONE paragraph. For multiple items (e.g. list items), call superdoc_create separately for each item: do NOT use newlines to put multiple items in one paragraph."
@@ -2246,7 +2270,7 @@
2246
2270
  "description": "Paragraph text content. Each call creates ONE paragraph. For multiple items (e.g. list items), call superdoc_create separately for each item: do NOT use newlines to put multiple items in one paragraph."
2247
2271
  },
2248
2272
  "input": {
2249
- "oneOf": [
2273
+ "anyOf": [
2250
2274
  {
2251
2275
  "type": "object",
2252
2276
  "description": "Full paragraph input as JSON (alternative to individual text/at params)."
@@ -2322,29 +2346,29 @@
2322
2346
  "description": "Preview the result without applying changes."
2323
2347
  },
2324
2348
  "target": {
2325
- "oneOf": [
2349
+ "anyOf": [
2326
2350
  {
2327
- "oneOf": [
2351
+ "anyOf": [
2328
2352
  {
2329
- "oneOf": [
2353
+ "anyOf": [
2330
2354
  {
2331
- "oneOf": [
2355
+ "anyOf": [
2332
2356
  {
2333
- "oneOf": [
2357
+ "anyOf": [
2334
2358
  {
2335
- "oneOf": [
2359
+ "anyOf": [
2336
2360
  {
2337
- "oneOf": [
2361
+ "anyOf": [
2338
2362
  {
2339
- "oneOf": [
2363
+ "anyOf": [
2340
2364
  {
2341
- "oneOf": [
2365
+ "anyOf": [
2342
2366
  {
2343
- "oneOf": [
2367
+ "anyOf": [
2344
2368
  {
2345
- "oneOf": [
2369
+ "anyOf": [
2346
2370
  {
2347
- "oneOf": [
2371
+ "anyOf": [
2348
2372
  {
2349
2373
  "$ref": "#/$defs/ListItemAddress",
2350
2374
  "description": "The target list item. For 'insert': the item to insert relative to. For 'create' with mode 'fromParagraphs': use nodeType 'paragraph' instead. Format: {kind:'block', nodeType:'listItem', nodeId:'<id>'}."
@@ -2460,9 +2484,9 @@
2460
2484
  "description": "List type: 'bullet' for bullet points, 'ordered' for numbered lists. Required for action 'set_type'."
2461
2485
  },
2462
2486
  "level": {
2463
- "oneOf": [
2487
+ "anyOf": [
2464
2488
  {
2465
- "oneOf": [
2489
+ "anyOf": [
2466
2490
  {
2467
2491
  "type": "integer",
2468
2492
  "minimum": 0,
@@ -2684,7 +2708,7 @@
2684
2708
  "description": "Edit mode: \"direct\" applies changes immediately, \"tracked\" records as suggestions."
2685
2709
  },
2686
2710
  "text": {
2687
- "oneOf": [
2711
+ "anyOf": [
2688
2712
  {
2689
2713
  "type": "string",
2690
2714
  "description": "Comment text content."
@@ -2697,7 +2721,7 @@
2697
2721
  "description": "Comment text content. Required for action 'create'."
2698
2722
  },
2699
2723
  "target": {
2700
- "oneOf": [
2724
+ "anyOf": [
2701
2725
  {
2702
2726
  "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 .",
2703
2727
  "oneOf": [
@@ -5577,46 +5601,46 @@
5577
5601
  "description": "Preview the result without applying changes."
5578
5602
  },
5579
5603
  "target": {
5580
- "oneOf": [
5604
+ "anyOf": [
5581
5605
  {
5582
- "oneOf": [
5606
+ "anyOf": [
5583
5607
  {
5584
- "oneOf": [
5608
+ "anyOf": [
5585
5609
  {
5586
- "oneOf": [
5610
+ "anyOf": [
5587
5611
  {
5588
- "oneOf": [
5612
+ "anyOf": [
5589
5613
  {
5590
- "oneOf": [
5614
+ "anyOf": [
5591
5615
  {
5592
- "oneOf": [
5616
+ "anyOf": [
5593
5617
  {
5594
- "oneOf": [
5618
+ "anyOf": [
5595
5619
  {
5596
- "oneOf": [
5620
+ "anyOf": [
5597
5621
  {
5598
- "oneOf": [
5622
+ "anyOf": [
5599
5623
  {
5600
- "oneOf": [
5624
+ "anyOf": [
5601
5625
  {
5602
- "oneOf": [
5626
+ "anyOf": [
5603
5627
  {
5604
- "oneOf": [
5628
+ "anyOf": [
5605
5629
  {
5606
- "oneOf": [
5630
+ "anyOf": [
5607
5631
  {
5608
- "oneOf": [
5632
+ "anyOf": [
5609
5633
  {
5610
- "oneOf": [
5634
+ "anyOf": [
5611
5635
  {
5612
- "oneOf": [
5636
+ "anyOf": [
5613
5637
  {
5614
5638
  "$ref": "#/$defs/TableAddress"
5615
5639
  },
5616
5640
  {
5617
- "oneOf": [
5641
+ "anyOf": [
5618
5642
  {
5619
- "oneOf": [
5643
+ "anyOf": [
5620
5644
  {
5621
5645
  "$ref": "#/$defs/TableRowAddress"
5622
5646
  },
@@ -5633,7 +5657,7 @@
5633
5657
  ]
5634
5658
  },
5635
5659
  {
5636
- "oneOf": [
5660
+ "anyOf": [
5637
5661
  {
5638
5662
  "$ref": "#/$defs/TableRowAddress"
5639
5663
  },
@@ -5645,7 +5669,7 @@
5645
5669
  ]
5646
5670
  },
5647
5671
  {
5648
- "oneOf": [
5672
+ "anyOf": [
5649
5673
  {
5650
5674
  "$ref": "#/$defs/TableRowAddress"
5651
5675
  },
@@ -5657,7 +5681,7 @@
5657
5681
  ]
5658
5682
  },
5659
5683
  {
5660
- "oneOf": [
5684
+ "anyOf": [
5661
5685
  {
5662
5686
  "$ref": "#/$defs/TableRowAddress"
5663
5687
  },
@@ -5669,7 +5693,7 @@
5669
5693
  ]
5670
5694
  },
5671
5695
  {
5672
- "oneOf": [
5696
+ "anyOf": [
5673
5697
  {
5674
5698
  "$ref": "#/$defs/TableRowAddress"
5675
5699
  },
@@ -5706,7 +5730,7 @@
5706
5730
  ]
5707
5731
  },
5708
5732
  {
5709
- "oneOf": [
5733
+ "anyOf": [
5710
5734
  {
5711
5735
  "$ref": "#/$defs/TableCellAddress"
5712
5736
  },
@@ -5723,7 +5747,7 @@
5723
5747
  ]
5724
5748
  },
5725
5749
  {
5726
- "oneOf": [
5750
+ "anyOf": [
5727
5751
  {
5728
5752
  "$ref": "#/$defs/TableCellAddress"
5729
5753
  },
@@ -5819,7 +5843,7 @@
5819
5843
  "description": "Only for actions 'insert_row', 'delete_row', 'move_row', 'set_row', 'set_row_options', 'unmerge_cells', 'set_cell_text'. Omit for other actions."
5820
5844
  },
5821
5845
  "destination": {
5822
- "oneOf": [
5846
+ "anyOf": [
5823
5847
  {
5824
5848
  "oneOf": [
5825
5849
  {
@@ -6217,9 +6241,15 @@
6217
6241
  "description": "Only for action 'set_style_options'. Omit for other actions."
6218
6242
  },
6219
6243
  "mode": {
6220
- "enum": [
6221
- "applyTo",
6222
- "edges"
6244
+ "anyOf": [
6245
+ {
6246
+ "const": "applyTo",
6247
+ "type": "string"
6248
+ },
6249
+ {
6250
+ "const": "edges",
6251
+ "type": "string"
6252
+ }
6223
6253
  ],
6224
6254
  "description": "Required for action 'set_borders'."
6225
6255
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/cli",
3
- "version": "0.35.2-next.1",
3
+ "version": "0.36.0-next.10",
4
4
  "description": "Command-line interface for SuperDoc: inspect, convert, and edit .docx files from a terminal or a script.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -29,15 +29,15 @@
29
29
  "fast-glob": "^3.3.3",
30
30
  "happy-dom": "^20.3.4",
31
31
  "ws": "^8.18.0",
32
- "superdoc": "2.15.2-next.1",
32
+ "superdoc": "2.16.0-next.8",
33
33
  "y-websocket": "^3.0.0",
34
34
  "yjs": "13.6.31"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@hocuspocus/server": "^2.13.6",
38
- "@superdoc/sdk": "2.12.1-next.1",
38
+ "@superdoc/sdk": "2.13.0-next.10",
39
39
  "@superdoc/document-api": "0.1.0-alpha.0",
40
- "@superdoc/docx-engine": "0.14.2-next.1",
40
+ "@superdoc/docx-engine": "0.15.0-next.8",
41
41
  "@types/bun": "^1.3.8",
42
42
  "@types/node": "22.19.2",
43
43
  "@types/ws": "^8.5.13",
@@ -51,11 +51,11 @@
51
51
  "access": "public"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@superdoc/cli-darwin-arm64": "0.35.2-next.1",
55
- "@superdoc/cli-darwin-x64": "0.35.2-next.1",
56
- "@superdoc/cli-linux-x64": "0.35.2-next.1",
57
- "@superdoc/cli-linux-arm64": "0.35.2-next.1",
58
- "@superdoc/cli-windows-x64": "0.35.2-next.1"
54
+ "@superdoc/cli-darwin-arm64": "0.36.0-next.10",
55
+ "@superdoc/cli-darwin-x64": "0.36.0-next.10",
56
+ "@superdoc/cli-linux-x64": "0.36.0-next.10",
57
+ "@superdoc/cli-linux-arm64": "0.36.0-next.10",
58
+ "@superdoc/cli-windows-x64": "0.36.0-next.10"
59
59
  },
60
60
  "scripts": {
61
61
  "predev": "node scripts/ensure-superdoc-build.js",
@@ -78,6 +78,7 @@
78
78
  "test:docx-reference-integrity": "node --test scripts/docx-reference-integrity.mjs",
79
79
  "test:sdk-collaborative-close": "NODE_ENV=test bun test src/__tests__/sdk-collaborative-close.e2e.test.ts",
80
80
  "test:sdk-replace-file": "NODE_ENV=test bun test src/__tests__/sdk-replace-file.e2e.test.ts",
81
+ "eval:discovery": "bun run scripts/evaluate-discovery.ts",
81
82
  "lint": "pnpm -w exec vp lint apps/cli",
82
83
  "lint:fix": "pnpm -w exec vp lint --fix apps/cli",
83
84
  "format": "pnpm -w exec vp fmt apps/cli",
package/skill/SKILL.md CHANGED
@@ -10,17 +10,25 @@ Do not default to legacy commands unless explicitly needed for v0-style bulk wor
10
10
 
11
11
  Use `superdoc` if installed, or `npx @superdoc/cli@latest` as a fallback.
12
12
 
13
- ## First Step: Discover Exact Params
13
+ ## First Step: Discover the Operation
14
14
 
15
- For unknown commands or flags, inspect runtime metadata first:
15
+ When the operation is not already known, search by the user's exact intent:
16
16
 
17
17
  ```bash
18
- superdoc describe
19
- superdoc describe command find
20
- superdoc describe command "comments add"
18
+ superdoc discover "create a footnote"
19
+ superdoc discover "add an sdt"
20
+ superdoc discover "change table cell padding"
21
21
  ```
22
22
 
23
- Use `describe command` for per-command args and constraints.
23
+ Discovery returns an adaptive set of relevant operations, capped at ten. A clear intent may return one result. An ambiguous or broad intent may return more. The leading result includes its compact input shape and a command template.
24
+
25
+ Use the returned `schemaCommand` when the compact shape is not enough:
26
+
27
+ ```bash
28
+ superdoc describe command doc.footnotes.insert
29
+ ```
30
+
31
+ Do not run the full `superdoc describe` catalogue to discover an operation. Use it only when an exhaustive inventory is explicitly needed.
24
32
 
25
33
  ## Preferred Workflows
26
34