@superdoc-dev/sdk 1.6.0-next.5 → 1.6.0-next.51

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.
@@ -3,7 +3,7 @@
3
3
  "tools": [
4
4
  {
5
5
  "name": "superdoc_get_content",
6
- "description": "Read document content in various formats. Call this first in any workflow to understand document structure before making edits. Action \"blocks\" returns structured block data with nodeId, nodeType, textPreview, formatting properties (fontFamily, fontSize, color, bold, underline, alignment), and ref handles for immediate use with superdoc_edit or superdoc_format. Action \"text\" and \"markdown\" return the full document as plain text or Markdown. Action \"html\" returns HTML. Action \"info\" returns document metadata: word count, paragraph count, page count, outline, available styles, and capability flags. The \"blocks\" action supports pagination via \"offset\" and \"limit\", and filtering via \"nodeTypes\". Other actions ignore these parameters. This tool never modifies the document. Do NOT call superdoc_edit or superdoc_format without first reading blocks to get valid refs and formatting reference values.",
6
+ "description": "Read document content in various formats. Call this first in any workflow to understand document structure before making edits. Action \"blocks\" returns structured block data with nodeId, nodeType, textPreview, optional full text when includeText:true, formatting properties (fontFamily, fontSize, color, bold, underline, alignment), and ref handles for immediate use with superdoc_edit or superdoc_format. When you need to evaluate or rewrite existing paragraphs or clauses, prefer action \"blocks\" with includeText:true so you can identify the correct block and then target it by nodeId. Action \"text\" and \"markdown\" return the full document as plain text or Markdown. Action \"html\" returns HTML. Action \"info\" returns document metadata: word count, paragraph count, page count, outline, available styles, and capability flags. The \"blocks\" action supports pagination via \"offset\" and \"limit\", and filtering via \"nodeTypes\". Other actions ignore these parameters. This tool never modifies the document. Do NOT call superdoc_edit or superdoc_format without first reading blocks to get valid refs and formatting reference values.",
7
7
  "parameters": {
8
8
  "type": "object",
9
9
  "properties": {
@@ -47,6 +47,10 @@
47
47
  ]
48
48
  },
49
49
  "description": "Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types. Only for action 'blocks'. Omit for other actions."
50
+ },
51
+ "includeText": {
52
+ "type": "boolean",
53
+ "description": "When true, includes the full flattened block text in each block entry. Only for action 'blocks'. Omit for other actions."
50
54
  }
51
55
  },
52
56
  "required": [
@@ -78,7 +82,7 @@
78
82
  },
79
83
  {
80
84
  "name": "superdoc_edit",
81
- "description": "Refs expire after any mutation; always re-search before the next edit. Modify document text: insert new content, replace existing text, delete a range, or undo/redo. Use this for single text modifications. For 2+ edits that must succeed or fail atomically, use superdoc_mutations instead. For 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. Insert supports plain text (default), markdown, or html via the \"type\" parameter. Use \"placement\" (before, after, insideStart, insideEnd) to control position relative to the target. 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.",
85
+ "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 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. 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. Supports \"dryRun\" to preview changes and \"changeMode: tracked\" to record edits as tracked changes (not supported for markdown/html inserts). Do NOT build \"target\" objects manually when a ref is available; prefer \"ref\" for simpler, more reliable targeting.",
82
86
  "parameters": {
83
87
  "type": "object",
84
88
  "properties": {
@@ -398,7 +402,7 @@
398
402
  },
399
403
  {
400
404
  "name": "superdoc_format",
401
- "description": "Change text and paragraph formatting. Use this after superdoc_create to style new content, or with a search ref to restyle existing text. Action \"inline\" applies character formatting (bold, italic, underline, color, fontSize, fontFamily, highlight, strike, vertAlign) to a text range via \"ref\". Action \"set_style\" applies a named paragraph style by styleId (get available styles from superdoc_get_content info). Actions \"set_alignment\", \"set_indentation\", \"set_spacing\", \"set_direction\", and \"set_flow_options\" change paragraph-level properties and require a block target: {kind:\"block\", nodeType:\"paragraph\", nodeId:\"<nodeId>\"}, NOT a ref. Use \"set_flow_options\" with pageBreakBefore:true to start a paragraph on a new page. Supports \"dryRun\" and \"changeMode: tracked\" for inline formatting. Paragraph-level actions do NOT support tracked changes. Do NOT use a search ref for paragraph-level actions; they require a block target with nodeId. Do NOT use {kind:\"block\", start:{kind:\"nodeEdge\",...}} or selection-like structures for paragraph actions. ONLY {kind:\"block\", nodeType, nodeId} is accepted. Do NOT issue multiple superdoc_format calls in parallel; each call invalidates refs for subsequent calls. Format one block at a time. Do NOT hardcode formatting values; always read them from superdoc_get_content blocks and replicate.",
405
+ "description": "Change text and paragraph formatting. To format multiple items at once, use superdoc_mutations with format.apply steps instead of calling this tool repeatedly. Use require \"all\" with a node selector to format every heading or paragraph in one batch. Use this tool for single-item formatting when you have a valid ref or nodeId. Action \"inline\" applies character formatting (bold, italic, underline, color, fontSize, fontFamily, highlight, strike, vertAlign) to a text range via \"ref\". Action \"set_style\" applies a named paragraph style by styleId (get available styles from superdoc_get_content info). Actions \"set_alignment\", \"set_indentation\", \"set_spacing\", \"set_direction\", and \"set_flow_options\" change paragraph-level properties and require a block target: {kind:\"block\", nodeType:\"paragraph\", nodeId:\"<nodeId>\"}, NOT a ref. Use \"set_flow_options\" with pageBreakBefore:true to start a paragraph on a new page. Supports \"dryRun\" and \"changeMode: tracked\" for inline formatting. Paragraph-level actions do NOT support tracked changes. Do NOT use a search ref for paragraph-level actions; they require a block target with nodeId. Do NOT use {kind:\"block\", start:{kind:\"nodeEdge\",...}} or selection-like structures for paragraph actions. ONLY {kind:\"block\", nodeType, nodeId} is accepted. Do NOT issue multiple superdoc_format calls in parallel; each call invalidates refs for subsequent calls.",
402
406
  "parameters": {
403
407
  "type": "object",
404
408
  "properties": {
@@ -965,7 +969,7 @@
965
969
  },
966
970
  {
967
971
  "name": "superdoc_create",
968
- "description": "You MUST call superdoc_format after this tool to match document styling. Create a single paragraph, heading, or table in the document. Returns a nodeId for chaining subsequent creates and for use as a block target in superdoc_format. When the user asks for a \"heading\", use action \"heading\" with a level (default 1). Use action \"paragraph\" only when the user asks for regular body text. Before creating, call superdoc_get_content blocks to read formatting from regular body text paragraphs (non-empty, non-title blocks with alignment \"justify\" or \"left\"). After creating, re-fetch blocks with superdoc_get_content to get a fresh ref for the new block, then apply TWO format calls: (1) superdoc_format action \"inline\" for character styling, AND (2) superdoc_format action \"set_alignment\" with the block target for paragraph alignment. Both calls are REQUIRED. For body paragraphs: inline {bold:false, underline:false, fontFamily, fontSize, color from body blocks}, alignment \"justify\". Ignore underline:true from blocks data for body text; it is a style artifact. For headings: inline {bold:true, underline:true, fontSize scaled up, fontFamily, color}, alignment \"center\". Position with \"at\": {kind:\"documentEnd\"} (default), {kind:\"documentStart\"}, or {kind:\"after\"/\"before\", target:{kind:\"block\", nodeType, nodeId}} for relative placement. When creating multiple items in sequence, use the previous response nodeId as the next \"at\" target to maintain correct ordering. Do NOT use newlines in \"text\" to create multiple paragraphs; call this tool separately for each one.",
972
+ "description": "IMPORTANT: For headings and paragraphs, use superdoc_edit with type \"markdown\" instead it is faster, creates proper styles, and handles positioning via target + placement. Only use superdoc_create for tables or when markdown cannot express the content. Creates a single paragraph, heading, or table. Returns nodeId and ref for the created block. After creating, the returned ref is valid for ONE immediate superdoc_format call. For subsequent operations, re-fetch blocks with superdoc_get_content to get fresh refs (refs expire after any mutation). When the user asks for a \"heading\", use action \"heading\" with a level (default 1). Use action \"paragraph\" for regular body text. Position with \"at\": {kind:\"documentEnd\"} (default), {kind:\"documentStart\"}, or {kind:\"after\"/\"before\", target:{kind:\"block\", nodeType, nodeId}} for relative placement. When creating multiple items in sequence, use the previous response nodeId as the next \"at\" target to maintain correct ordering. Do NOT use newlines in \"text\" to create multiple paragraphs; call this tool separately for each one.",
969
973
  "parameters": {
970
974
  "type": "object",
971
975
  "properties": {
@@ -1612,6 +1616,153 @@
1612
1616
  "properties": {
1613
1617
  "id": {
1614
1618
  "type": "string"
1619
+ },
1620
+ "story": {
1621
+ "oneOf": [
1622
+ {
1623
+ "type": "object",
1624
+ "properties": {
1625
+ "kind": {
1626
+ "const": "story",
1627
+ "type": "string"
1628
+ },
1629
+ "storyType": {
1630
+ "const": "body",
1631
+ "type": "string"
1632
+ }
1633
+ },
1634
+ "required": [
1635
+ "kind",
1636
+ "storyType"
1637
+ ]
1638
+ },
1639
+ {
1640
+ "type": "object",
1641
+ "properties": {
1642
+ "kind": {
1643
+ "const": "story",
1644
+ "type": "string"
1645
+ },
1646
+ "storyType": {
1647
+ "const": "headerFooterSlot",
1648
+ "type": "string"
1649
+ },
1650
+ "section": {
1651
+ "type": "object",
1652
+ "properties": {
1653
+ "kind": {
1654
+ "const": "section",
1655
+ "type": "string"
1656
+ },
1657
+ "sectionId": {
1658
+ "type": "string"
1659
+ }
1660
+ },
1661
+ "required": [
1662
+ "kind",
1663
+ "sectionId"
1664
+ ]
1665
+ },
1666
+ "headerFooterKind": {
1667
+ "enum": [
1668
+ "header",
1669
+ "footer"
1670
+ ]
1671
+ },
1672
+ "variant": {
1673
+ "enum": [
1674
+ "default",
1675
+ "first",
1676
+ "even"
1677
+ ]
1678
+ },
1679
+ "resolution": {
1680
+ "enum": [
1681
+ "effective",
1682
+ "explicit"
1683
+ ]
1684
+ },
1685
+ "onWrite": {
1686
+ "enum": [
1687
+ "materializeIfInherited",
1688
+ "editResolvedPart",
1689
+ "error"
1690
+ ]
1691
+ }
1692
+ },
1693
+ "required": [
1694
+ "kind",
1695
+ "storyType",
1696
+ "section",
1697
+ "headerFooterKind",
1698
+ "variant"
1699
+ ]
1700
+ },
1701
+ {
1702
+ "type": "object",
1703
+ "properties": {
1704
+ "kind": {
1705
+ "const": "story",
1706
+ "type": "string"
1707
+ },
1708
+ "storyType": {
1709
+ "const": "headerFooterPart",
1710
+ "type": "string"
1711
+ },
1712
+ "refId": {
1713
+ "type": "string"
1714
+ }
1715
+ },
1716
+ "required": [
1717
+ "kind",
1718
+ "storyType",
1719
+ "refId"
1720
+ ]
1721
+ },
1722
+ {
1723
+ "type": "object",
1724
+ "properties": {
1725
+ "kind": {
1726
+ "const": "story",
1727
+ "type": "string"
1728
+ },
1729
+ "storyType": {
1730
+ "const": "footnote",
1731
+ "type": "string"
1732
+ },
1733
+ "noteId": {
1734
+ "type": "string"
1735
+ }
1736
+ },
1737
+ "required": [
1738
+ "kind",
1739
+ "storyType",
1740
+ "noteId"
1741
+ ]
1742
+ },
1743
+ {
1744
+ "type": "object",
1745
+ "properties": {
1746
+ "kind": {
1747
+ "const": "story",
1748
+ "type": "string"
1749
+ },
1750
+ "storyType": {
1751
+ "const": "endnote",
1752
+ "type": "string"
1753
+ },
1754
+ "noteId": {
1755
+ "type": "string"
1756
+ }
1757
+ },
1758
+ "required": [
1759
+ "kind",
1760
+ "storyType",
1761
+ "noteId"
1762
+ ]
1763
+ }
1764
+ ],
1765
+ "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."
1615
1766
  }
1616
1767
  },
1617
1768
  "required": [
@@ -1660,7 +1811,7 @@
1660
1811
  },
1661
1812
  {
1662
1813
  "name": "superdoc_search",
1663
- "description": "Refs expire after any mutation; always re-search before the next edit. Find text patterns or nodes in the document and get ref handles for targeting edits and formatting. Use this to locate content before calling superdoc_edit or superdoc_format. Text search returns handle.ref covering only the matched substring. Node search finds blocks by type (paragraph, heading, table, listItem, etc.). The \"require\" parameter controls match cardinality: \"first\" returns one match, \"all\" returns every match, \"exactlyOne\" fails if not exactly one match. Supports scoping via \"within\" to search inside a single block. Do NOT use regex or markdown formatting markers (#, **, etc.) in search patterns; patterns are plain text only. Do NOT use this tool when you already have a ref from superdoc_get_content blocks or superdoc_create; use that ref directly.",
1814
+ "description": "Find text patterns or nodes in the document and get ref handles for targeting edits and formatting. Refs expire after any mutation that changes the document. Re-search before the next edit when using individual tools (superdoc_edit, superdoc_format). Within a superdoc_mutations batch, selectors in \"where\" clauses resolve automatically at compile time; no manual re-searching needed between steps. Text search returns handle.ref covering only the matched substring. Node search finds blocks by type (paragraph, heading, table, listItem, etc.). The \"require\" parameter controls match cardinality: \"first\" returns one match, \"all\" returns every match, \"exactlyOne\" fails if not exactly one match. Supports scoping via \"within\" to search inside a single block. Do NOT use regex or markdown formatting markers (#, **, etc.) in search patterns; patterns are plain text only. Do NOT use this tool when you already have a ref from superdoc_get_content blocks or superdoc_create; use that ref directly.",
1664
1815
  "parameters": {
1665
1816
  "type": "object",
1666
1817
  "properties": {
@@ -1831,7 +1982,7 @@
1831
1982
  },
1832
1983
  {
1833
1984
  "name": "superdoc_mutations",
1834
- "description": "All steps succeed or all fail; no partial application. Execute multiple text edits atomically in a single batch. Use this INSTEAD OF multiple sequential superdoc_edit calls when you need 2+ text changes that should succeed or fail together. Each step has an id (e.g. \"s1\"), an op (text.rewrite, text.insert, text.delete, format.apply, assert), a \"where\" clause for targeting ({by:\"select\", select:{...}, require:\"first\"|\"exactlyOne\"|\"all\"} or {by:\"ref\", ref:\"...\"}), and \"args\" with operation-specific parameters. Action \"preview\" dry-runs the plan without modifying the document. Action \"apply\" executes it. CRITICAL: split mutations by phase. Text mutations (text.rewrite, text.insert, text.delete) go in one call. Formatting (format.apply) goes in a separate call with fresh refs from a new superdoc_search. Do NOT create two steps that target overlapping text in the same block; combine them into a single text.rewrite step. Overlapping steps fail with PLAN_CONFLICT_OVERLAP. Do NOT use this for single edits; use superdoc_edit instead. Do NOT mix text mutations and formatting in the same call.",
1985
+ "description": "All steps succeed or all fail; no partial application. Execute multiple operations atomically in one batch. Use this for any workflow needing 2+ changes. Supported step types: text (text.rewrite, text.insert, text.delete), format (format.apply), create (create.heading, create.paragraph, create.table), assert. Each step has an id, an op, a \"where\" clause for targeting ({by:\"select\", select:{...}, require:\"first\"|\"exactlyOne\"|\"all\"} or {by:\"ref\", ref:\"...\"} or {by:\"block\", nodeType:\"paragraph\", nodeId:\"...\"}), and \"args\" with operation-specific parameters. Use {by:\"block\", nodeType, nodeId} when you want to rewrite, delete, format, or anchor against a whole known block from superdoc_get_content action \"blocks\" without relying on text matching. For full-paragraph or full-clause rewrites, first call superdoc_get_content with action:\"blocks\" and includeText:true, then rewrite the matching block by nodeId. Use {by:\"select\"} only for substring edits, discovery, or insertion relative to a sentence fragment; do NOT use a shortened text selector to replace an entire known block. For create steps, \"where\" targets an existing anchor block and args.position (\"before\" or \"after\") controls placement. Sequential creates targeting the same anchor maintain correct order via internal position mapping. For format.apply with require \"all\", use a node selector to format every heading or paragraph at once: {by:\"select\", select:{type:\"node\", nodeType:\"heading\"}, require:\"all\"}. Selectors resolve at compile time (before execution). This means format.apply steps CANNOT target content created by earlier create steps in the same batch. Split creates and formatting into separate batches: first a mutations call with creates, then a mutations call with format.apply. Action \"preview\" dry-runs the plan. Action \"apply\" executes it. If a selector matches nothing, the failure reports the step id plus selector details so you can retry with a shorter or more distinctive anchor. Do NOT create two steps that target overlapping text in the same block; combine them into a single text.rewrite step.",
1835
1986
  "parameters": {
1836
1987
  "type": "object",
1837
1988
  "properties": {
@@ -2222,6 +2373,36 @@
2222
2373
  "by",
2223
2374
  "target"
2224
2375
  ]
2376
+ },
2377
+ {
2378
+ "type": "object",
2379
+ "properties": {
2380
+ "by": {
2381
+ "const": "block",
2382
+ "type": "string"
2383
+ },
2384
+ "nodeType": {
2385
+ "enum": [
2386
+ "paragraph",
2387
+ "heading",
2388
+ "listItem",
2389
+ "table",
2390
+ "tableRow",
2391
+ "tableCell",
2392
+ "tableOfContents",
2393
+ "image",
2394
+ "sdt"
2395
+ ]
2396
+ },
2397
+ "nodeId": {
2398
+ "type": "string"
2399
+ }
2400
+ },
2401
+ "required": [
2402
+ "by",
2403
+ "nodeType",
2404
+ "nodeId"
2405
+ ]
2225
2406
  }
2226
2407
  ]
2227
2408
  },
@@ -2372,53 +2553,102 @@
2372
2553
  "type": "string"
2373
2554
  },
2374
2555
  "where": {
2375
- "type": "object",
2376
- "properties": {
2377
- "by": {
2378
- "const": "select",
2379
- "type": "string"
2380
- },
2381
- "select": {
2382
- "oneOf": [
2383
- {
2384
- "type": "object",
2385
- "properties": {
2386
- "type": {
2387
- "const": "text",
2388
- "description": "Must be 'text' for text pattern search.",
2389
- "type": "string"
2390
- },
2391
- "pattern": {
2392
- "type": "string",
2393
- "description": "Text or regex pattern to match."
2394
- },
2395
- "mode": {
2396
- "description": "Match mode: 'contains' (substring) or 'regex'.",
2397
- "enum": [
2398
- "contains",
2399
- "regex"
2556
+ "oneOf": [
2557
+ {
2558
+ "type": "object",
2559
+ "properties": {
2560
+ "by": {
2561
+ "const": "select",
2562
+ "type": "string"
2563
+ },
2564
+ "select": {
2565
+ "oneOf": [
2566
+ {
2567
+ "type": "object",
2568
+ "properties": {
2569
+ "type": {
2570
+ "const": "text",
2571
+ "description": "Must be 'text' for text pattern search.",
2572
+ "type": "string"
2573
+ },
2574
+ "pattern": {
2575
+ "type": "string",
2576
+ "description": "Text or regex pattern to match."
2577
+ },
2578
+ "mode": {
2579
+ "description": "Match mode: 'contains' (substring) or 'regex'.",
2580
+ "enum": [
2581
+ "contains",
2582
+ "regex"
2583
+ ]
2584
+ },
2585
+ "caseSensitive": {
2586
+ "type": "boolean",
2587
+ "description": "Case-sensitive matching. Default: false."
2588
+ }
2589
+ },
2590
+ "required": [
2591
+ "type",
2592
+ "pattern"
2400
2593
  ]
2401
2594
  },
2402
- "caseSensitive": {
2403
- "type": "boolean",
2404
- "description": "Case-sensitive matching. Default: false."
2595
+ {
2596
+ "type": "object",
2597
+ "properties": {
2598
+ "type": {
2599
+ "const": "node",
2600
+ "description": "Must be 'node' for node type search.",
2601
+ "type": "string"
2602
+ },
2603
+ "nodeType": {
2604
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2605
+ "enum": [
2606
+ "paragraph",
2607
+ "heading",
2608
+ "listItem",
2609
+ "table",
2610
+ "tableRow",
2611
+ "tableCell",
2612
+ "tableOfContents",
2613
+ "image",
2614
+ "sdt",
2615
+ "run",
2616
+ "bookmark",
2617
+ "comment",
2618
+ "hyperlink",
2619
+ "footnoteRef",
2620
+ "endnoteRef",
2621
+ "crossRef",
2622
+ "indexEntry",
2623
+ "citation",
2624
+ "authorityEntry",
2625
+ "sequenceField",
2626
+ "tab",
2627
+ "lineBreak"
2628
+ ]
2629
+ },
2630
+ "kind": {
2631
+ "description": "Filter: 'block' or 'inline'.",
2632
+ "enum": [
2633
+ "block",
2634
+ "inline"
2635
+ ]
2636
+ }
2637
+ },
2638
+ "required": [
2639
+ "type"
2640
+ ]
2405
2641
  }
2406
- },
2407
- "required": [
2408
- "type",
2409
- "pattern"
2410
2642
  ]
2411
2643
  },
2412
- {
2644
+ "within": {
2413
2645
  "type": "object",
2414
2646
  "properties": {
2415
- "type": {
2416
- "const": "node",
2417
- "description": "Must be 'node' for node type search.",
2647
+ "kind": {
2648
+ "const": "block",
2418
2649
  "type": "string"
2419
2650
  },
2420
2651
  "nodeType": {
2421
- "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2422
2652
  "enum": [
2423
2653
  "paragraph",
2424
2654
  "heading",
@@ -2428,40 +2658,253 @@
2428
2658
  "tableCell",
2429
2659
  "tableOfContents",
2430
2660
  "image",
2431
- "sdt",
2432
- "run",
2433
- "bookmark",
2434
- "comment",
2435
- "hyperlink",
2436
- "footnoteRef",
2437
- "endnoteRef",
2438
- "crossRef",
2439
- "indexEntry",
2440
- "citation",
2441
- "authorityEntry",
2442
- "sequenceField",
2443
- "tab",
2444
- "lineBreak"
2661
+ "sdt"
2445
2662
  ]
2446
2663
  },
2664
+ "nodeId": {
2665
+ "type": "string"
2666
+ }
2667
+ },
2668
+ "required": [
2669
+ "kind",
2670
+ "nodeType",
2671
+ "nodeId"
2672
+ ]
2673
+ },
2674
+ "require": {
2675
+ "enum": [
2676
+ "first",
2677
+ "exactlyOne"
2678
+ ]
2679
+ }
2680
+ },
2681
+ "required": [
2682
+ "by",
2683
+ "select",
2684
+ "require"
2685
+ ]
2686
+ },
2687
+ {
2688
+ "type": "object",
2689
+ "properties": {
2690
+ "by": {
2691
+ "const": "ref",
2692
+ "type": "string"
2693
+ },
2694
+ "ref": {
2695
+ "type": "string"
2696
+ },
2697
+ "within": {
2698
+ "type": "object",
2699
+ "properties": {
2447
2700
  "kind": {
2448
- "description": "Filter: 'block' or 'inline'.",
2701
+ "const": "block",
2702
+ "type": "string"
2703
+ },
2704
+ "nodeType": {
2449
2705
  "enum": [
2450
- "block",
2451
- "inline"
2706
+ "paragraph",
2707
+ "heading",
2708
+ "listItem",
2709
+ "table",
2710
+ "tableRow",
2711
+ "tableCell",
2712
+ "tableOfContents",
2713
+ "image",
2714
+ "sdt"
2452
2715
  ]
2716
+ },
2717
+ "nodeId": {
2718
+ "type": "string"
2453
2719
  }
2454
2720
  },
2455
2721
  "required": [
2456
- "type"
2722
+ "kind",
2723
+ "nodeType",
2724
+ "nodeId"
2457
2725
  ]
2458
2726
  }
2727
+ },
2728
+ "required": [
2729
+ "by",
2730
+ "ref"
2459
2731
  ]
2460
2732
  },
2461
- "within": {
2733
+ {
2462
2734
  "type": "object",
2463
2735
  "properties": {
2464
- "kind": {
2736
+ "by": {
2737
+ "const": "target",
2738
+ "type": "string"
2739
+ },
2740
+ "target": {
2741
+ "type": "object",
2742
+ "properties": {
2743
+ "kind": {
2744
+ "const": "selection",
2745
+ "type": "string"
2746
+ },
2747
+ "start": {
2748
+ "oneOf": [
2749
+ {
2750
+ "type": "object",
2751
+ "properties": {
2752
+ "kind": {
2753
+ "const": "text",
2754
+ "type": "string"
2755
+ },
2756
+ "blockId": {
2757
+ "type": "string"
2758
+ },
2759
+ "offset": {
2760
+ "type": "number"
2761
+ }
2762
+ },
2763
+ "required": [
2764
+ "kind",
2765
+ "blockId",
2766
+ "offset"
2767
+ ]
2768
+ },
2769
+ {
2770
+ "type": "object",
2771
+ "properties": {
2772
+ "kind": {
2773
+ "const": "nodeEdge",
2774
+ "type": "string"
2775
+ },
2776
+ "node": {
2777
+ "type": "object",
2778
+ "properties": {
2779
+ "kind": {
2780
+ "const": "block",
2781
+ "type": "string"
2782
+ },
2783
+ "nodeType": {
2784
+ "enum": [
2785
+ "paragraph",
2786
+ "heading",
2787
+ "table",
2788
+ "tableOfContents",
2789
+ "sdt",
2790
+ "image"
2791
+ ]
2792
+ },
2793
+ "nodeId": {
2794
+ "type": "string"
2795
+ }
2796
+ },
2797
+ "required": [
2798
+ "kind",
2799
+ "nodeType",
2800
+ "nodeId"
2801
+ ]
2802
+ },
2803
+ "edge": {
2804
+ "enum": [
2805
+ "before",
2806
+ "after"
2807
+ ]
2808
+ }
2809
+ },
2810
+ "required": [
2811
+ "kind",
2812
+ "node",
2813
+ "edge"
2814
+ ]
2815
+ }
2816
+ ],
2817
+ "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."
2818
+ },
2819
+ "end": {
2820
+ "oneOf": [
2821
+ {
2822
+ "type": "object",
2823
+ "properties": {
2824
+ "kind": {
2825
+ "const": "text",
2826
+ "type": "string"
2827
+ },
2828
+ "blockId": {
2829
+ "type": "string"
2830
+ },
2831
+ "offset": {
2832
+ "type": "number"
2833
+ }
2834
+ },
2835
+ "required": [
2836
+ "kind",
2837
+ "blockId",
2838
+ "offset"
2839
+ ]
2840
+ },
2841
+ {
2842
+ "type": "object",
2843
+ "properties": {
2844
+ "kind": {
2845
+ "const": "nodeEdge",
2846
+ "type": "string"
2847
+ },
2848
+ "node": {
2849
+ "type": "object",
2850
+ "properties": {
2851
+ "kind": {
2852
+ "const": "block",
2853
+ "type": "string"
2854
+ },
2855
+ "nodeType": {
2856
+ "enum": [
2857
+ "paragraph",
2858
+ "heading",
2859
+ "table",
2860
+ "tableOfContents",
2861
+ "sdt",
2862
+ "image"
2863
+ ]
2864
+ },
2865
+ "nodeId": {
2866
+ "type": "string"
2867
+ }
2868
+ },
2869
+ "required": [
2870
+ "kind",
2871
+ "nodeType",
2872
+ "nodeId"
2873
+ ]
2874
+ },
2875
+ "edge": {
2876
+ "enum": [
2877
+ "before",
2878
+ "after"
2879
+ ]
2880
+ }
2881
+ },
2882
+ "required": [
2883
+ "kind",
2884
+ "node",
2885
+ "edge"
2886
+ ]
2887
+ }
2888
+ ],
2889
+ "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."
2890
+ }
2891
+ },
2892
+ "required": [
2893
+ "kind",
2894
+ "start",
2895
+ "end"
2896
+ ]
2897
+ }
2898
+ },
2899
+ "required": [
2900
+ "by",
2901
+ "target"
2902
+ ]
2903
+ },
2904
+ {
2905
+ "type": "object",
2906
+ "properties": {
2907
+ "by": {
2465
2908
  "const": "block",
2466
2909
  "type": "string"
2467
2910
  },
@@ -2483,22 +2926,11 @@
2483
2926
  }
2484
2927
  },
2485
2928
  "required": [
2486
- "kind",
2929
+ "by",
2487
2930
  "nodeType",
2488
2931
  "nodeId"
2489
2932
  ]
2490
- },
2491
- "require": {
2492
- "enum": [
2493
- "first",
2494
- "exactlyOne"
2495
- ]
2496
2933
  }
2497
- },
2498
- "required": [
2499
- "by",
2500
- "select",
2501
- "require"
2502
2934
  ]
2503
2935
  },
2504
2936
  "args": {
@@ -2950,6 +3382,36 @@
2950
3382
  "by",
2951
3383
  "target"
2952
3384
  ]
3385
+ },
3386
+ {
3387
+ "type": "object",
3388
+ "properties": {
3389
+ "by": {
3390
+ "const": "block",
3391
+ "type": "string"
3392
+ },
3393
+ "nodeType": {
3394
+ "enum": [
3395
+ "paragraph",
3396
+ "heading",
3397
+ "listItem",
3398
+ "table",
3399
+ "tableRow",
3400
+ "tableCell",
3401
+ "tableOfContents",
3402
+ "image",
3403
+ "sdt"
3404
+ ]
3405
+ },
3406
+ "nodeId": {
3407
+ "type": "string"
3408
+ }
3409
+ },
3410
+ "required": [
3411
+ "by",
3412
+ "nodeType",
3413
+ "nodeId"
3414
+ ]
2953
3415
  }
2954
3416
  ]
2955
3417
  },
@@ -3331,6 +3793,36 @@
3331
3793
  "by",
3332
3794
  "target"
3333
3795
  ]
3796
+ },
3797
+ {
3798
+ "type": "object",
3799
+ "properties": {
3800
+ "by": {
3801
+ "const": "block",
3802
+ "type": "string"
3803
+ },
3804
+ "nodeType": {
3805
+ "enum": [
3806
+ "paragraph",
3807
+ "heading",
3808
+ "listItem",
3809
+ "table",
3810
+ "tableRow",
3811
+ "tableCell",
3812
+ "tableOfContents",
3813
+ "image",
3814
+ "sdt"
3815
+ ]
3816
+ },
3817
+ "nodeId": {
3818
+ "type": "string"
3819
+ }
3820
+ },
3821
+ "required": [
3822
+ "by",
3823
+ "nodeType",
3824
+ "nodeId"
3825
+ ]
3334
3826
  }
3335
3827
  ]
3336
3828
  },
@@ -3596,11 +4088,24 @@
3596
4088
  "type": "boolean"
3597
4089
  }
3598
4090
  }
4091
+ },
4092
+ "alignment": {
4093
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step.",
4094
+ "enum": [
4095
+ "left",
4096
+ "center",
4097
+ "right",
4098
+ "justify"
4099
+ ]
4100
+ },
4101
+ "scope": {
4102
+ "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\".",
4103
+ "enum": [
4104
+ "match",
4105
+ "block"
4106
+ ]
3599
4107
  }
3600
- },
3601
- "required": [
3602
- "inline"
3603
- ]
4108
+ }
3604
4109
  }
3605
4110
  },
3606
4111
  "required": [