@superdoc-dev/sdk 1.6.0-next.4 → 1.6.0-next.41

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.
@@ -5,7 +5,7 @@
5
5
  "tools": [
6
6
  {
7
7
  "toolName": "superdoc_get_content",
8
- "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.",
8
+ "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.",
9
9
  "inputSchema": {
10
10
  "type": "object",
11
11
  "properties": {
@@ -49,6 +49,10 @@
49
49
  ]
50
50
  },
51
51
  "description": "Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types. Only for action 'blocks'. Omit for other actions."
52
+ },
53
+ "includeText": {
54
+ "type": "boolean",
55
+ "description": "When true, includes the full flattened block text in each block entry. Only for action 'blocks'. Omit for other actions."
52
56
  }
53
57
  },
54
58
  "required": [
@@ -86,7 +90,7 @@
86
90
  },
87
91
  {
88
92
  "toolName": "superdoc_edit",
89
- "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.",
93
+ "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.",
90
94
  "inputSchema": {
91
95
  "type": "object",
92
96
  "properties": {
@@ -451,7 +455,7 @@
451
455
  },
452
456
  {
453
457
  "toolName": "superdoc_format",
454
- "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.",
458
+ "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.",
455
459
  "inputSchema": {
456
460
  "type": "object",
457
461
  "properties": {
@@ -1069,7 +1073,7 @@
1069
1073
  },
1070
1074
  {
1071
1075
  "toolName": "superdoc_create",
1072
- "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.",
1076
+ "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.",
1073
1077
  "inputSchema": {
1074
1078
  "type": "object",
1075
1079
  "properties": {
@@ -1811,7 +1815,7 @@
1811
1815
  },
1812
1816
  {
1813
1817
  "toolName": "superdoc_search",
1814
- "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.",
1818
+ "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.",
1815
1819
  "inputSchema": {
1816
1820
  "type": "object",
1817
1821
  "properties": {
@@ -1976,7 +1980,7 @@
1976
1980
  },
1977
1981
  {
1978
1982
  "toolName": "superdoc_mutations",
1979
- "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.",
1983
+ "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.",
1980
1984
  "inputSchema": {
1981
1985
  "type": "object",
1982
1986
  "properties": {
@@ -2367,6 +2371,36 @@
2367
2371
  "by",
2368
2372
  "target"
2369
2373
  ]
2374
+ },
2375
+ {
2376
+ "type": "object",
2377
+ "properties": {
2378
+ "by": {
2379
+ "const": "block",
2380
+ "type": "string"
2381
+ },
2382
+ "nodeType": {
2383
+ "enum": [
2384
+ "paragraph",
2385
+ "heading",
2386
+ "listItem",
2387
+ "table",
2388
+ "tableRow",
2389
+ "tableCell",
2390
+ "tableOfContents",
2391
+ "image",
2392
+ "sdt"
2393
+ ]
2394
+ },
2395
+ "nodeId": {
2396
+ "type": "string"
2397
+ }
2398
+ },
2399
+ "required": [
2400
+ "by",
2401
+ "nodeType",
2402
+ "nodeId"
2403
+ ]
2370
2404
  }
2371
2405
  ]
2372
2406
  },
@@ -2517,53 +2551,155 @@
2517
2551
  "type": "string"
2518
2552
  },
2519
2553
  "where": {
2520
- "type": "object",
2521
- "properties": {
2522
- "by": {
2523
- "const": "select",
2524
- "type": "string"
2525
- },
2526
- "select": {
2527
- "oneOf": [
2528
- {
2554
+ "oneOf": [
2555
+ {
2556
+ "type": "object",
2557
+ "properties": {
2558
+ "by": {
2559
+ "const": "select",
2560
+ "type": "string"
2561
+ },
2562
+ "select": {
2563
+ "oneOf": [
2564
+ {
2565
+ "type": "object",
2566
+ "properties": {
2567
+ "type": {
2568
+ "const": "text",
2569
+ "description": "Must be 'text' for text pattern search.",
2570
+ "type": "string"
2571
+ },
2572
+ "pattern": {
2573
+ "type": "string",
2574
+ "description": "Text or regex pattern to match."
2575
+ },
2576
+ "mode": {
2577
+ "description": "Match mode: 'contains' (substring) or 'regex'.",
2578
+ "enum": [
2579
+ "contains",
2580
+ "regex"
2581
+ ]
2582
+ },
2583
+ "caseSensitive": {
2584
+ "type": "boolean",
2585
+ "description": "Case-sensitive matching. Default: false."
2586
+ }
2587
+ },
2588
+ "required": [
2589
+ "type",
2590
+ "pattern"
2591
+ ]
2592
+ },
2593
+ {
2594
+ "type": "object",
2595
+ "properties": {
2596
+ "type": {
2597
+ "const": "node",
2598
+ "description": "Must be 'node' for node type search.",
2599
+ "type": "string"
2600
+ },
2601
+ "nodeType": {
2602
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2603
+ "enum": [
2604
+ "paragraph",
2605
+ "heading",
2606
+ "listItem",
2607
+ "table",
2608
+ "tableRow",
2609
+ "tableCell",
2610
+ "tableOfContents",
2611
+ "image",
2612
+ "sdt",
2613
+ "run",
2614
+ "bookmark",
2615
+ "comment",
2616
+ "hyperlink",
2617
+ "footnoteRef",
2618
+ "endnoteRef",
2619
+ "crossRef",
2620
+ "indexEntry",
2621
+ "citation",
2622
+ "authorityEntry",
2623
+ "sequenceField",
2624
+ "tab",
2625
+ "lineBreak"
2626
+ ]
2627
+ },
2628
+ "kind": {
2629
+ "description": "Filter: 'block' or 'inline'.",
2630
+ "enum": [
2631
+ "block",
2632
+ "inline"
2633
+ ]
2634
+ }
2635
+ },
2636
+ "required": [
2637
+ "type"
2638
+ ]
2639
+ }
2640
+ ]
2641
+ },
2642
+ "within": {
2529
2643
  "type": "object",
2530
2644
  "properties": {
2531
- "type": {
2532
- "const": "text",
2533
- "description": "Must be 'text' for text pattern search.",
2645
+ "kind": {
2646
+ "const": "block",
2534
2647
  "type": "string"
2535
2648
  },
2536
- "pattern": {
2537
- "type": "string",
2538
- "description": "Text or regex pattern to match."
2539
- },
2540
- "mode": {
2541
- "description": "Match mode: 'contains' (substring) or 'regex'.",
2649
+ "nodeType": {
2542
2650
  "enum": [
2543
- "contains",
2544
- "regex"
2651
+ "paragraph",
2652
+ "heading",
2653
+ "listItem",
2654
+ "table",
2655
+ "tableRow",
2656
+ "tableCell",
2657
+ "tableOfContents",
2658
+ "image",
2659
+ "sdt"
2545
2660
  ]
2546
2661
  },
2547
- "caseSensitive": {
2548
- "type": "boolean",
2549
- "description": "Case-sensitive matching. Default: false."
2662
+ "nodeId": {
2663
+ "type": "string"
2550
2664
  }
2551
2665
  },
2552
2666
  "required": [
2553
- "type",
2554
- "pattern"
2667
+ "kind",
2668
+ "nodeType",
2669
+ "nodeId"
2555
2670
  ]
2556
2671
  },
2557
- {
2672
+ "require": {
2673
+ "enum": [
2674
+ "first",
2675
+ "exactlyOne"
2676
+ ]
2677
+ }
2678
+ },
2679
+ "required": [
2680
+ "by",
2681
+ "select",
2682
+ "require"
2683
+ ]
2684
+ },
2685
+ {
2686
+ "type": "object",
2687
+ "properties": {
2688
+ "by": {
2689
+ "const": "ref",
2690
+ "type": "string"
2691
+ },
2692
+ "ref": {
2693
+ "type": "string"
2694
+ },
2695
+ "within": {
2558
2696
  "type": "object",
2559
2697
  "properties": {
2560
- "type": {
2561
- "const": "node",
2562
- "description": "Must be 'node' for node type search.",
2698
+ "kind": {
2699
+ "const": "block",
2563
2700
  "type": "string"
2564
2701
  },
2565
2702
  "nodeType": {
2566
- "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2567
2703
  "enum": [
2568
2704
  "paragraph",
2569
2705
  "heading",
@@ -2573,40 +2709,200 @@
2573
2709
  "tableCell",
2574
2710
  "tableOfContents",
2575
2711
  "image",
2576
- "sdt",
2577
- "run",
2578
- "bookmark",
2579
- "comment",
2580
- "hyperlink",
2581
- "footnoteRef",
2582
- "endnoteRef",
2583
- "crossRef",
2584
- "indexEntry",
2585
- "citation",
2586
- "authorityEntry",
2587
- "sequenceField",
2588
- "tab",
2589
- "lineBreak"
2712
+ "sdt"
2590
2713
  ]
2591
2714
  },
2715
+ "nodeId": {
2716
+ "type": "string"
2717
+ }
2718
+ },
2719
+ "required": [
2720
+ "kind",
2721
+ "nodeType",
2722
+ "nodeId"
2723
+ ]
2724
+ }
2725
+ },
2726
+ "required": [
2727
+ "by",
2728
+ "ref"
2729
+ ]
2730
+ },
2731
+ {
2732
+ "type": "object",
2733
+ "properties": {
2734
+ "by": {
2735
+ "const": "target",
2736
+ "type": "string"
2737
+ },
2738
+ "target": {
2739
+ "type": "object",
2740
+ "properties": {
2592
2741
  "kind": {
2593
- "description": "Filter: 'block' or 'inline'.",
2594
- "enum": [
2595
- "block",
2596
- "inline"
2597
- ]
2742
+ "const": "selection",
2743
+ "type": "string"
2744
+ },
2745
+ "start": {
2746
+ "oneOf": [
2747
+ {
2748
+ "type": "object",
2749
+ "properties": {
2750
+ "kind": {
2751
+ "const": "text",
2752
+ "type": "string"
2753
+ },
2754
+ "blockId": {
2755
+ "type": "string"
2756
+ },
2757
+ "offset": {
2758
+ "type": "number"
2759
+ }
2760
+ },
2761
+ "required": [
2762
+ "kind",
2763
+ "blockId",
2764
+ "offset"
2765
+ ]
2766
+ },
2767
+ {
2768
+ "type": "object",
2769
+ "properties": {
2770
+ "kind": {
2771
+ "const": "nodeEdge",
2772
+ "type": "string"
2773
+ },
2774
+ "node": {
2775
+ "type": "object",
2776
+ "properties": {
2777
+ "kind": {
2778
+ "const": "block",
2779
+ "type": "string"
2780
+ },
2781
+ "nodeType": {
2782
+ "enum": [
2783
+ "paragraph",
2784
+ "heading",
2785
+ "table",
2786
+ "tableOfContents",
2787
+ "sdt",
2788
+ "image"
2789
+ ]
2790
+ },
2791
+ "nodeId": {
2792
+ "type": "string"
2793
+ }
2794
+ },
2795
+ "required": [
2796
+ "kind",
2797
+ "nodeType",
2798
+ "nodeId"
2799
+ ]
2800
+ },
2801
+ "edge": {
2802
+ "enum": [
2803
+ "before",
2804
+ "after"
2805
+ ]
2806
+ }
2807
+ },
2808
+ "required": [
2809
+ "kind",
2810
+ "node",
2811
+ "edge"
2812
+ ]
2813
+ }
2814
+ ],
2815
+ "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."
2816
+ },
2817
+ "end": {
2818
+ "oneOf": [
2819
+ {
2820
+ "type": "object",
2821
+ "properties": {
2822
+ "kind": {
2823
+ "const": "text",
2824
+ "type": "string"
2825
+ },
2826
+ "blockId": {
2827
+ "type": "string"
2828
+ },
2829
+ "offset": {
2830
+ "type": "number"
2831
+ }
2832
+ },
2833
+ "required": [
2834
+ "kind",
2835
+ "blockId",
2836
+ "offset"
2837
+ ]
2838
+ },
2839
+ {
2840
+ "type": "object",
2841
+ "properties": {
2842
+ "kind": {
2843
+ "const": "nodeEdge",
2844
+ "type": "string"
2845
+ },
2846
+ "node": {
2847
+ "type": "object",
2848
+ "properties": {
2849
+ "kind": {
2850
+ "const": "block",
2851
+ "type": "string"
2852
+ },
2853
+ "nodeType": {
2854
+ "enum": [
2855
+ "paragraph",
2856
+ "heading",
2857
+ "table",
2858
+ "tableOfContents",
2859
+ "sdt",
2860
+ "image"
2861
+ ]
2862
+ },
2863
+ "nodeId": {
2864
+ "type": "string"
2865
+ }
2866
+ },
2867
+ "required": [
2868
+ "kind",
2869
+ "nodeType",
2870
+ "nodeId"
2871
+ ]
2872
+ },
2873
+ "edge": {
2874
+ "enum": [
2875
+ "before",
2876
+ "after"
2877
+ ]
2878
+ }
2879
+ },
2880
+ "required": [
2881
+ "kind",
2882
+ "node",
2883
+ "edge"
2884
+ ]
2885
+ }
2886
+ ],
2887
+ "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."
2598
2888
  }
2599
2889
  },
2600
2890
  "required": [
2601
- "type"
2891
+ "kind",
2892
+ "start",
2893
+ "end"
2602
2894
  ]
2603
2895
  }
2896
+ },
2897
+ "required": [
2898
+ "by",
2899
+ "target"
2604
2900
  ]
2605
2901
  },
2606
- "within": {
2902
+ {
2607
2903
  "type": "object",
2608
2904
  "properties": {
2609
- "kind": {
2905
+ "by": {
2610
2906
  "const": "block",
2611
2907
  "type": "string"
2612
2908
  },
@@ -2628,22 +2924,11 @@
2628
2924
  }
2629
2925
  },
2630
2926
  "required": [
2631
- "kind",
2927
+ "by",
2632
2928
  "nodeType",
2633
2929
  "nodeId"
2634
2930
  ]
2635
- },
2636
- "require": {
2637
- "enum": [
2638
- "first",
2639
- "exactlyOne"
2640
- ]
2641
2931
  }
2642
- },
2643
- "required": [
2644
- "by",
2645
- "select",
2646
- "require"
2647
2932
  ]
2648
2933
  },
2649
2934
  "args": {
@@ -3095,6 +3380,36 @@
3095
3380
  "by",
3096
3381
  "target"
3097
3382
  ]
3383
+ },
3384
+ {
3385
+ "type": "object",
3386
+ "properties": {
3387
+ "by": {
3388
+ "const": "block",
3389
+ "type": "string"
3390
+ },
3391
+ "nodeType": {
3392
+ "enum": [
3393
+ "paragraph",
3394
+ "heading",
3395
+ "listItem",
3396
+ "table",
3397
+ "tableRow",
3398
+ "tableCell",
3399
+ "tableOfContents",
3400
+ "image",
3401
+ "sdt"
3402
+ ]
3403
+ },
3404
+ "nodeId": {
3405
+ "type": "string"
3406
+ }
3407
+ },
3408
+ "required": [
3409
+ "by",
3410
+ "nodeType",
3411
+ "nodeId"
3412
+ ]
3098
3413
  }
3099
3414
  ]
3100
3415
  },
@@ -3476,6 +3791,36 @@
3476
3791
  "by",
3477
3792
  "target"
3478
3793
  ]
3794
+ },
3795
+ {
3796
+ "type": "object",
3797
+ "properties": {
3798
+ "by": {
3799
+ "const": "block",
3800
+ "type": "string"
3801
+ },
3802
+ "nodeType": {
3803
+ "enum": [
3804
+ "paragraph",
3805
+ "heading",
3806
+ "listItem",
3807
+ "table",
3808
+ "tableRow",
3809
+ "tableCell",
3810
+ "tableOfContents",
3811
+ "image",
3812
+ "sdt"
3813
+ ]
3814
+ },
3815
+ "nodeId": {
3816
+ "type": "string"
3817
+ }
3818
+ },
3819
+ "required": [
3820
+ "by",
3821
+ "nodeType",
3822
+ "nodeId"
3823
+ ]
3479
3824
  }
3480
3825
  ]
3481
3826
  },
@@ -3741,11 +4086,24 @@
3741
4086
  "type": "boolean"
3742
4087
  }
3743
4088
  }
4089
+ },
4090
+ "alignment": {
4091
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step.",
4092
+ "enum": [
4093
+ "left",
4094
+ "center",
4095
+ "right",
4096
+ "justify"
4097
+ ]
4098
+ },
4099
+ "scope": {
4100
+ "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\".",
4101
+ "enum": [
4102
+ "match",
4103
+ "block"
4104
+ ]
3744
4105
  }
3745
- },
3746
- "required": [
3747
- "inline"
3748
- ]
4106
+ }
3749
4107
  }
3750
4108
  },
3751
4109
  "required": [