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

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": {
@@ -1660,7 +1664,7 @@
1660
1664
  },
1661
1665
  {
1662
1666
  "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.",
1667
+ "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
1668
  "parameters": {
1665
1669
  "type": "object",
1666
1670
  "properties": {
@@ -1831,7 +1835,7 @@
1831
1835
  },
1832
1836
  {
1833
1837
  "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.",
1838
+ "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
1839
  "parameters": {
1836
1840
  "type": "object",
1837
1841
  "properties": {
@@ -2222,6 +2226,36 @@
2222
2226
  "by",
2223
2227
  "target"
2224
2228
  ]
2229
+ },
2230
+ {
2231
+ "type": "object",
2232
+ "properties": {
2233
+ "by": {
2234
+ "const": "block",
2235
+ "type": "string"
2236
+ },
2237
+ "nodeType": {
2238
+ "enum": [
2239
+ "paragraph",
2240
+ "heading",
2241
+ "listItem",
2242
+ "table",
2243
+ "tableRow",
2244
+ "tableCell",
2245
+ "tableOfContents",
2246
+ "image",
2247
+ "sdt"
2248
+ ]
2249
+ },
2250
+ "nodeId": {
2251
+ "type": "string"
2252
+ }
2253
+ },
2254
+ "required": [
2255
+ "by",
2256
+ "nodeType",
2257
+ "nodeId"
2258
+ ]
2225
2259
  }
2226
2260
  ]
2227
2261
  },
@@ -2372,53 +2406,155 @@
2372
2406
  "type": "string"
2373
2407
  },
2374
2408
  "where": {
2375
- "type": "object",
2376
- "properties": {
2377
- "by": {
2378
- "const": "select",
2379
- "type": "string"
2380
- },
2381
- "select": {
2382
- "oneOf": [
2383
- {
2409
+ "oneOf": [
2410
+ {
2411
+ "type": "object",
2412
+ "properties": {
2413
+ "by": {
2414
+ "const": "select",
2415
+ "type": "string"
2416
+ },
2417
+ "select": {
2418
+ "oneOf": [
2419
+ {
2420
+ "type": "object",
2421
+ "properties": {
2422
+ "type": {
2423
+ "const": "text",
2424
+ "description": "Must be 'text' for text pattern search.",
2425
+ "type": "string"
2426
+ },
2427
+ "pattern": {
2428
+ "type": "string",
2429
+ "description": "Text or regex pattern to match."
2430
+ },
2431
+ "mode": {
2432
+ "description": "Match mode: 'contains' (substring) or 'regex'.",
2433
+ "enum": [
2434
+ "contains",
2435
+ "regex"
2436
+ ]
2437
+ },
2438
+ "caseSensitive": {
2439
+ "type": "boolean",
2440
+ "description": "Case-sensitive matching. Default: false."
2441
+ }
2442
+ },
2443
+ "required": [
2444
+ "type",
2445
+ "pattern"
2446
+ ]
2447
+ },
2448
+ {
2449
+ "type": "object",
2450
+ "properties": {
2451
+ "type": {
2452
+ "const": "node",
2453
+ "description": "Must be 'node' for node type search.",
2454
+ "type": "string"
2455
+ },
2456
+ "nodeType": {
2457
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2458
+ "enum": [
2459
+ "paragraph",
2460
+ "heading",
2461
+ "listItem",
2462
+ "table",
2463
+ "tableRow",
2464
+ "tableCell",
2465
+ "tableOfContents",
2466
+ "image",
2467
+ "sdt",
2468
+ "run",
2469
+ "bookmark",
2470
+ "comment",
2471
+ "hyperlink",
2472
+ "footnoteRef",
2473
+ "endnoteRef",
2474
+ "crossRef",
2475
+ "indexEntry",
2476
+ "citation",
2477
+ "authorityEntry",
2478
+ "sequenceField",
2479
+ "tab",
2480
+ "lineBreak"
2481
+ ]
2482
+ },
2483
+ "kind": {
2484
+ "description": "Filter: 'block' or 'inline'.",
2485
+ "enum": [
2486
+ "block",
2487
+ "inline"
2488
+ ]
2489
+ }
2490
+ },
2491
+ "required": [
2492
+ "type"
2493
+ ]
2494
+ }
2495
+ ]
2496
+ },
2497
+ "within": {
2384
2498
  "type": "object",
2385
2499
  "properties": {
2386
- "type": {
2387
- "const": "text",
2388
- "description": "Must be 'text' for text pattern search.",
2500
+ "kind": {
2501
+ "const": "block",
2389
2502
  "type": "string"
2390
2503
  },
2391
- "pattern": {
2392
- "type": "string",
2393
- "description": "Text or regex pattern to match."
2394
- },
2395
- "mode": {
2396
- "description": "Match mode: 'contains' (substring) or 'regex'.",
2504
+ "nodeType": {
2397
2505
  "enum": [
2398
- "contains",
2399
- "regex"
2506
+ "paragraph",
2507
+ "heading",
2508
+ "listItem",
2509
+ "table",
2510
+ "tableRow",
2511
+ "tableCell",
2512
+ "tableOfContents",
2513
+ "image",
2514
+ "sdt"
2400
2515
  ]
2401
2516
  },
2402
- "caseSensitive": {
2403
- "type": "boolean",
2404
- "description": "Case-sensitive matching. Default: false."
2517
+ "nodeId": {
2518
+ "type": "string"
2405
2519
  }
2406
2520
  },
2407
2521
  "required": [
2408
- "type",
2409
- "pattern"
2522
+ "kind",
2523
+ "nodeType",
2524
+ "nodeId"
2410
2525
  ]
2411
2526
  },
2412
- {
2527
+ "require": {
2528
+ "enum": [
2529
+ "first",
2530
+ "exactlyOne"
2531
+ ]
2532
+ }
2533
+ },
2534
+ "required": [
2535
+ "by",
2536
+ "select",
2537
+ "require"
2538
+ ]
2539
+ },
2540
+ {
2541
+ "type": "object",
2542
+ "properties": {
2543
+ "by": {
2544
+ "const": "ref",
2545
+ "type": "string"
2546
+ },
2547
+ "ref": {
2548
+ "type": "string"
2549
+ },
2550
+ "within": {
2413
2551
  "type": "object",
2414
2552
  "properties": {
2415
- "type": {
2416
- "const": "node",
2417
- "description": "Must be 'node' for node type search.",
2553
+ "kind": {
2554
+ "const": "block",
2418
2555
  "type": "string"
2419
2556
  },
2420
2557
  "nodeType": {
2421
- "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2422
2558
  "enum": [
2423
2559
  "paragraph",
2424
2560
  "heading",
@@ -2428,40 +2564,200 @@
2428
2564
  "tableCell",
2429
2565
  "tableOfContents",
2430
2566
  "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"
2567
+ "sdt"
2445
2568
  ]
2446
2569
  },
2570
+ "nodeId": {
2571
+ "type": "string"
2572
+ }
2573
+ },
2574
+ "required": [
2575
+ "kind",
2576
+ "nodeType",
2577
+ "nodeId"
2578
+ ]
2579
+ }
2580
+ },
2581
+ "required": [
2582
+ "by",
2583
+ "ref"
2584
+ ]
2585
+ },
2586
+ {
2587
+ "type": "object",
2588
+ "properties": {
2589
+ "by": {
2590
+ "const": "target",
2591
+ "type": "string"
2592
+ },
2593
+ "target": {
2594
+ "type": "object",
2595
+ "properties": {
2447
2596
  "kind": {
2448
- "description": "Filter: 'block' or 'inline'.",
2449
- "enum": [
2450
- "block",
2451
- "inline"
2452
- ]
2597
+ "const": "selection",
2598
+ "type": "string"
2599
+ },
2600
+ "start": {
2601
+ "oneOf": [
2602
+ {
2603
+ "type": "object",
2604
+ "properties": {
2605
+ "kind": {
2606
+ "const": "text",
2607
+ "type": "string"
2608
+ },
2609
+ "blockId": {
2610
+ "type": "string"
2611
+ },
2612
+ "offset": {
2613
+ "type": "number"
2614
+ }
2615
+ },
2616
+ "required": [
2617
+ "kind",
2618
+ "blockId",
2619
+ "offset"
2620
+ ]
2621
+ },
2622
+ {
2623
+ "type": "object",
2624
+ "properties": {
2625
+ "kind": {
2626
+ "const": "nodeEdge",
2627
+ "type": "string"
2628
+ },
2629
+ "node": {
2630
+ "type": "object",
2631
+ "properties": {
2632
+ "kind": {
2633
+ "const": "block",
2634
+ "type": "string"
2635
+ },
2636
+ "nodeType": {
2637
+ "enum": [
2638
+ "paragraph",
2639
+ "heading",
2640
+ "table",
2641
+ "tableOfContents",
2642
+ "sdt",
2643
+ "image"
2644
+ ]
2645
+ },
2646
+ "nodeId": {
2647
+ "type": "string"
2648
+ }
2649
+ },
2650
+ "required": [
2651
+ "kind",
2652
+ "nodeType",
2653
+ "nodeId"
2654
+ ]
2655
+ },
2656
+ "edge": {
2657
+ "enum": [
2658
+ "before",
2659
+ "after"
2660
+ ]
2661
+ }
2662
+ },
2663
+ "required": [
2664
+ "kind",
2665
+ "node",
2666
+ "edge"
2667
+ ]
2668
+ }
2669
+ ],
2670
+ "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."
2671
+ },
2672
+ "end": {
2673
+ "oneOf": [
2674
+ {
2675
+ "type": "object",
2676
+ "properties": {
2677
+ "kind": {
2678
+ "const": "text",
2679
+ "type": "string"
2680
+ },
2681
+ "blockId": {
2682
+ "type": "string"
2683
+ },
2684
+ "offset": {
2685
+ "type": "number"
2686
+ }
2687
+ },
2688
+ "required": [
2689
+ "kind",
2690
+ "blockId",
2691
+ "offset"
2692
+ ]
2693
+ },
2694
+ {
2695
+ "type": "object",
2696
+ "properties": {
2697
+ "kind": {
2698
+ "const": "nodeEdge",
2699
+ "type": "string"
2700
+ },
2701
+ "node": {
2702
+ "type": "object",
2703
+ "properties": {
2704
+ "kind": {
2705
+ "const": "block",
2706
+ "type": "string"
2707
+ },
2708
+ "nodeType": {
2709
+ "enum": [
2710
+ "paragraph",
2711
+ "heading",
2712
+ "table",
2713
+ "tableOfContents",
2714
+ "sdt",
2715
+ "image"
2716
+ ]
2717
+ },
2718
+ "nodeId": {
2719
+ "type": "string"
2720
+ }
2721
+ },
2722
+ "required": [
2723
+ "kind",
2724
+ "nodeType",
2725
+ "nodeId"
2726
+ ]
2727
+ },
2728
+ "edge": {
2729
+ "enum": [
2730
+ "before",
2731
+ "after"
2732
+ ]
2733
+ }
2734
+ },
2735
+ "required": [
2736
+ "kind",
2737
+ "node",
2738
+ "edge"
2739
+ ]
2740
+ }
2741
+ ],
2742
+ "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."
2453
2743
  }
2454
2744
  },
2455
2745
  "required": [
2456
- "type"
2746
+ "kind",
2747
+ "start",
2748
+ "end"
2457
2749
  ]
2458
2750
  }
2751
+ },
2752
+ "required": [
2753
+ "by",
2754
+ "target"
2459
2755
  ]
2460
2756
  },
2461
- "within": {
2757
+ {
2462
2758
  "type": "object",
2463
2759
  "properties": {
2464
- "kind": {
2760
+ "by": {
2465
2761
  "const": "block",
2466
2762
  "type": "string"
2467
2763
  },
@@ -2483,22 +2779,11 @@
2483
2779
  }
2484
2780
  },
2485
2781
  "required": [
2486
- "kind",
2782
+ "by",
2487
2783
  "nodeType",
2488
2784
  "nodeId"
2489
2785
  ]
2490
- },
2491
- "require": {
2492
- "enum": [
2493
- "first",
2494
- "exactlyOne"
2495
- ]
2496
2786
  }
2497
- },
2498
- "required": [
2499
- "by",
2500
- "select",
2501
- "require"
2502
2787
  ]
2503
2788
  },
2504
2789
  "args": {
@@ -2950,6 +3235,36 @@
2950
3235
  "by",
2951
3236
  "target"
2952
3237
  ]
3238
+ },
3239
+ {
3240
+ "type": "object",
3241
+ "properties": {
3242
+ "by": {
3243
+ "const": "block",
3244
+ "type": "string"
3245
+ },
3246
+ "nodeType": {
3247
+ "enum": [
3248
+ "paragraph",
3249
+ "heading",
3250
+ "listItem",
3251
+ "table",
3252
+ "tableRow",
3253
+ "tableCell",
3254
+ "tableOfContents",
3255
+ "image",
3256
+ "sdt"
3257
+ ]
3258
+ },
3259
+ "nodeId": {
3260
+ "type": "string"
3261
+ }
3262
+ },
3263
+ "required": [
3264
+ "by",
3265
+ "nodeType",
3266
+ "nodeId"
3267
+ ]
2953
3268
  }
2954
3269
  ]
2955
3270
  },
@@ -3331,6 +3646,36 @@
3331
3646
  "by",
3332
3647
  "target"
3333
3648
  ]
3649
+ },
3650
+ {
3651
+ "type": "object",
3652
+ "properties": {
3653
+ "by": {
3654
+ "const": "block",
3655
+ "type": "string"
3656
+ },
3657
+ "nodeType": {
3658
+ "enum": [
3659
+ "paragraph",
3660
+ "heading",
3661
+ "listItem",
3662
+ "table",
3663
+ "tableRow",
3664
+ "tableCell",
3665
+ "tableOfContents",
3666
+ "image",
3667
+ "sdt"
3668
+ ]
3669
+ },
3670
+ "nodeId": {
3671
+ "type": "string"
3672
+ }
3673
+ },
3674
+ "required": [
3675
+ "by",
3676
+ "nodeType",
3677
+ "nodeId"
3678
+ ]
3334
3679
  }
3335
3680
  ]
3336
3681
  },
@@ -3596,11 +3941,24 @@
3596
3941
  "type": "boolean"
3597
3942
  }
3598
3943
  }
3944
+ },
3945
+ "alignment": {
3946
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step.",
3947
+ "enum": [
3948
+ "left",
3949
+ "center",
3950
+ "right",
3951
+ "justify"
3952
+ ]
3953
+ },
3954
+ "scope": {
3955
+ "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\".",
3956
+ "enum": [
3957
+ "match",
3958
+ "block"
3959
+ ]
3599
3960
  }
3600
- },
3601
- "required": [
3602
- "inline"
3603
- ]
3961
+ }
3604
3962
  }
3605
3963
  },
3606
3964
  "required": [