@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.
@@ -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
  "input_schema": {
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": [
@@ -57,7 +61,7 @@
57
61
  },
58
62
  {
59
63
  "name": "superdoc_edit",
60
- "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.",
64
+ "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.",
61
65
  "input_schema": {
62
66
  "type": "object",
63
67
  "properties": {
@@ -357,7 +361,7 @@
357
361
  },
358
362
  {
359
363
  "name": "superdoc_format",
360
- "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.",
364
+ "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.",
361
365
  "input_schema": {
362
366
  "type": "object",
363
367
  "properties": {
@@ -902,7 +906,7 @@
902
906
  },
903
907
  {
904
908
  "name": "superdoc_create",
905
- "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.",
909
+ "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.",
906
910
  "input_schema": {
907
911
  "type": "object",
908
912
  "properties": {
@@ -1520,7 +1524,7 @@
1520
1524
  },
1521
1525
  {
1522
1526
  "name": "superdoc_search",
1523
- "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.",
1527
+ "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.",
1524
1528
  "input_schema": {
1525
1529
  "type": "object",
1526
1530
  "properties": {
@@ -1675,7 +1679,7 @@
1675
1679
  },
1676
1680
  {
1677
1681
  "name": "superdoc_mutations",
1678
- "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.",
1682
+ "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.",
1679
1683
  "input_schema": {
1680
1684
  "type": "object",
1681
1685
  "properties": {
@@ -2066,6 +2070,36 @@
2066
2070
  "by",
2067
2071
  "target"
2068
2072
  ]
2073
+ },
2074
+ {
2075
+ "type": "object",
2076
+ "properties": {
2077
+ "by": {
2078
+ "const": "block",
2079
+ "type": "string"
2080
+ },
2081
+ "nodeType": {
2082
+ "enum": [
2083
+ "paragraph",
2084
+ "heading",
2085
+ "listItem",
2086
+ "table",
2087
+ "tableRow",
2088
+ "tableCell",
2089
+ "tableOfContents",
2090
+ "image",
2091
+ "sdt"
2092
+ ]
2093
+ },
2094
+ "nodeId": {
2095
+ "type": "string"
2096
+ }
2097
+ },
2098
+ "required": [
2099
+ "by",
2100
+ "nodeType",
2101
+ "nodeId"
2102
+ ]
2069
2103
  }
2070
2104
  ]
2071
2105
  },
@@ -2216,53 +2250,155 @@
2216
2250
  "type": "string"
2217
2251
  },
2218
2252
  "where": {
2219
- "type": "object",
2220
- "properties": {
2221
- "by": {
2222
- "const": "select",
2223
- "type": "string"
2224
- },
2225
- "select": {
2226
- "oneOf": [
2227
- {
2253
+ "oneOf": [
2254
+ {
2255
+ "type": "object",
2256
+ "properties": {
2257
+ "by": {
2258
+ "const": "select",
2259
+ "type": "string"
2260
+ },
2261
+ "select": {
2262
+ "oneOf": [
2263
+ {
2264
+ "type": "object",
2265
+ "properties": {
2266
+ "type": {
2267
+ "const": "text",
2268
+ "description": "Must be 'text' for text pattern search.",
2269
+ "type": "string"
2270
+ },
2271
+ "pattern": {
2272
+ "type": "string",
2273
+ "description": "Text or regex pattern to match."
2274
+ },
2275
+ "mode": {
2276
+ "description": "Match mode: 'contains' (substring) or 'regex'.",
2277
+ "enum": [
2278
+ "contains",
2279
+ "regex"
2280
+ ]
2281
+ },
2282
+ "caseSensitive": {
2283
+ "type": "boolean",
2284
+ "description": "Case-sensitive matching. Default: false."
2285
+ }
2286
+ },
2287
+ "required": [
2288
+ "type",
2289
+ "pattern"
2290
+ ]
2291
+ },
2292
+ {
2293
+ "type": "object",
2294
+ "properties": {
2295
+ "type": {
2296
+ "const": "node",
2297
+ "description": "Must be 'node' for node type search.",
2298
+ "type": "string"
2299
+ },
2300
+ "nodeType": {
2301
+ "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2302
+ "enum": [
2303
+ "paragraph",
2304
+ "heading",
2305
+ "listItem",
2306
+ "table",
2307
+ "tableRow",
2308
+ "tableCell",
2309
+ "tableOfContents",
2310
+ "image",
2311
+ "sdt",
2312
+ "run",
2313
+ "bookmark",
2314
+ "comment",
2315
+ "hyperlink",
2316
+ "footnoteRef",
2317
+ "endnoteRef",
2318
+ "crossRef",
2319
+ "indexEntry",
2320
+ "citation",
2321
+ "authorityEntry",
2322
+ "sequenceField",
2323
+ "tab",
2324
+ "lineBreak"
2325
+ ]
2326
+ },
2327
+ "kind": {
2328
+ "description": "Filter: 'block' or 'inline'.",
2329
+ "enum": [
2330
+ "block",
2331
+ "inline"
2332
+ ]
2333
+ }
2334
+ },
2335
+ "required": [
2336
+ "type"
2337
+ ]
2338
+ }
2339
+ ]
2340
+ },
2341
+ "within": {
2228
2342
  "type": "object",
2229
2343
  "properties": {
2230
- "type": {
2231
- "const": "text",
2232
- "description": "Must be 'text' for text pattern search.",
2344
+ "kind": {
2345
+ "const": "block",
2233
2346
  "type": "string"
2234
2347
  },
2235
- "pattern": {
2236
- "type": "string",
2237
- "description": "Text or regex pattern to match."
2238
- },
2239
- "mode": {
2240
- "description": "Match mode: 'contains' (substring) or 'regex'.",
2348
+ "nodeType": {
2241
2349
  "enum": [
2242
- "contains",
2243
- "regex"
2350
+ "paragraph",
2351
+ "heading",
2352
+ "listItem",
2353
+ "table",
2354
+ "tableRow",
2355
+ "tableCell",
2356
+ "tableOfContents",
2357
+ "image",
2358
+ "sdt"
2244
2359
  ]
2245
2360
  },
2246
- "caseSensitive": {
2247
- "type": "boolean",
2248
- "description": "Case-sensitive matching. Default: false."
2361
+ "nodeId": {
2362
+ "type": "string"
2249
2363
  }
2250
2364
  },
2251
2365
  "required": [
2252
- "type",
2253
- "pattern"
2366
+ "kind",
2367
+ "nodeType",
2368
+ "nodeId"
2254
2369
  ]
2255
2370
  },
2256
- {
2371
+ "require": {
2372
+ "enum": [
2373
+ "first",
2374
+ "exactlyOne"
2375
+ ]
2376
+ }
2377
+ },
2378
+ "required": [
2379
+ "by",
2380
+ "select",
2381
+ "require"
2382
+ ]
2383
+ },
2384
+ {
2385
+ "type": "object",
2386
+ "properties": {
2387
+ "by": {
2388
+ "const": "ref",
2389
+ "type": "string"
2390
+ },
2391
+ "ref": {
2392
+ "type": "string"
2393
+ },
2394
+ "within": {
2257
2395
  "type": "object",
2258
2396
  "properties": {
2259
- "type": {
2260
- "const": "node",
2261
- "description": "Must be 'node' for node type search.",
2397
+ "kind": {
2398
+ "const": "block",
2262
2399
  "type": "string"
2263
2400
  },
2264
2401
  "nodeType": {
2265
- "description": "Block type to match (paragraph, heading, table, listItem, etc.).",
2266
2402
  "enum": [
2267
2403
  "paragraph",
2268
2404
  "heading",
@@ -2272,40 +2408,200 @@
2272
2408
  "tableCell",
2273
2409
  "tableOfContents",
2274
2410
  "image",
2275
- "sdt",
2276
- "run",
2277
- "bookmark",
2278
- "comment",
2279
- "hyperlink",
2280
- "footnoteRef",
2281
- "endnoteRef",
2282
- "crossRef",
2283
- "indexEntry",
2284
- "citation",
2285
- "authorityEntry",
2286
- "sequenceField",
2287
- "tab",
2288
- "lineBreak"
2411
+ "sdt"
2289
2412
  ]
2290
2413
  },
2414
+ "nodeId": {
2415
+ "type": "string"
2416
+ }
2417
+ },
2418
+ "required": [
2419
+ "kind",
2420
+ "nodeType",
2421
+ "nodeId"
2422
+ ]
2423
+ }
2424
+ },
2425
+ "required": [
2426
+ "by",
2427
+ "ref"
2428
+ ]
2429
+ },
2430
+ {
2431
+ "type": "object",
2432
+ "properties": {
2433
+ "by": {
2434
+ "const": "target",
2435
+ "type": "string"
2436
+ },
2437
+ "target": {
2438
+ "type": "object",
2439
+ "properties": {
2291
2440
  "kind": {
2292
- "description": "Filter: 'block' or 'inline'.",
2293
- "enum": [
2294
- "block",
2295
- "inline"
2296
- ]
2441
+ "const": "selection",
2442
+ "type": "string"
2443
+ },
2444
+ "start": {
2445
+ "oneOf": [
2446
+ {
2447
+ "type": "object",
2448
+ "properties": {
2449
+ "kind": {
2450
+ "const": "text",
2451
+ "type": "string"
2452
+ },
2453
+ "blockId": {
2454
+ "type": "string"
2455
+ },
2456
+ "offset": {
2457
+ "type": "number"
2458
+ }
2459
+ },
2460
+ "required": [
2461
+ "kind",
2462
+ "blockId",
2463
+ "offset"
2464
+ ]
2465
+ },
2466
+ {
2467
+ "type": "object",
2468
+ "properties": {
2469
+ "kind": {
2470
+ "const": "nodeEdge",
2471
+ "type": "string"
2472
+ },
2473
+ "node": {
2474
+ "type": "object",
2475
+ "properties": {
2476
+ "kind": {
2477
+ "const": "block",
2478
+ "type": "string"
2479
+ },
2480
+ "nodeType": {
2481
+ "enum": [
2482
+ "paragraph",
2483
+ "heading",
2484
+ "table",
2485
+ "tableOfContents",
2486
+ "sdt",
2487
+ "image"
2488
+ ]
2489
+ },
2490
+ "nodeId": {
2491
+ "type": "string"
2492
+ }
2493
+ },
2494
+ "required": [
2495
+ "kind",
2496
+ "nodeType",
2497
+ "nodeId"
2498
+ ]
2499
+ },
2500
+ "edge": {
2501
+ "enum": [
2502
+ "before",
2503
+ "after"
2504
+ ]
2505
+ }
2506
+ },
2507
+ "required": [
2508
+ "kind",
2509
+ "node",
2510
+ "edge"
2511
+ ]
2512
+ }
2513
+ ],
2514
+ "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."
2515
+ },
2516
+ "end": {
2517
+ "oneOf": [
2518
+ {
2519
+ "type": "object",
2520
+ "properties": {
2521
+ "kind": {
2522
+ "const": "text",
2523
+ "type": "string"
2524
+ },
2525
+ "blockId": {
2526
+ "type": "string"
2527
+ },
2528
+ "offset": {
2529
+ "type": "number"
2530
+ }
2531
+ },
2532
+ "required": [
2533
+ "kind",
2534
+ "blockId",
2535
+ "offset"
2536
+ ]
2537
+ },
2538
+ {
2539
+ "type": "object",
2540
+ "properties": {
2541
+ "kind": {
2542
+ "const": "nodeEdge",
2543
+ "type": "string"
2544
+ },
2545
+ "node": {
2546
+ "type": "object",
2547
+ "properties": {
2548
+ "kind": {
2549
+ "const": "block",
2550
+ "type": "string"
2551
+ },
2552
+ "nodeType": {
2553
+ "enum": [
2554
+ "paragraph",
2555
+ "heading",
2556
+ "table",
2557
+ "tableOfContents",
2558
+ "sdt",
2559
+ "image"
2560
+ ]
2561
+ },
2562
+ "nodeId": {
2563
+ "type": "string"
2564
+ }
2565
+ },
2566
+ "required": [
2567
+ "kind",
2568
+ "nodeType",
2569
+ "nodeId"
2570
+ ]
2571
+ },
2572
+ "edge": {
2573
+ "enum": [
2574
+ "before",
2575
+ "after"
2576
+ ]
2577
+ }
2578
+ },
2579
+ "required": [
2580
+ "kind",
2581
+ "node",
2582
+ "edge"
2583
+ ]
2584
+ }
2585
+ ],
2586
+ "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."
2297
2587
  }
2298
2588
  },
2299
2589
  "required": [
2300
- "type"
2590
+ "kind",
2591
+ "start",
2592
+ "end"
2301
2593
  ]
2302
2594
  }
2595
+ },
2596
+ "required": [
2597
+ "by",
2598
+ "target"
2303
2599
  ]
2304
2600
  },
2305
- "within": {
2601
+ {
2306
2602
  "type": "object",
2307
2603
  "properties": {
2308
- "kind": {
2604
+ "by": {
2309
2605
  "const": "block",
2310
2606
  "type": "string"
2311
2607
  },
@@ -2327,22 +2623,11 @@
2327
2623
  }
2328
2624
  },
2329
2625
  "required": [
2330
- "kind",
2626
+ "by",
2331
2627
  "nodeType",
2332
2628
  "nodeId"
2333
2629
  ]
2334
- },
2335
- "require": {
2336
- "enum": [
2337
- "first",
2338
- "exactlyOne"
2339
- ]
2340
2630
  }
2341
- },
2342
- "required": [
2343
- "by",
2344
- "select",
2345
- "require"
2346
2631
  ]
2347
2632
  },
2348
2633
  "args": {
@@ -2794,6 +3079,36 @@
2794
3079
  "by",
2795
3080
  "target"
2796
3081
  ]
3082
+ },
3083
+ {
3084
+ "type": "object",
3085
+ "properties": {
3086
+ "by": {
3087
+ "const": "block",
3088
+ "type": "string"
3089
+ },
3090
+ "nodeType": {
3091
+ "enum": [
3092
+ "paragraph",
3093
+ "heading",
3094
+ "listItem",
3095
+ "table",
3096
+ "tableRow",
3097
+ "tableCell",
3098
+ "tableOfContents",
3099
+ "image",
3100
+ "sdt"
3101
+ ]
3102
+ },
3103
+ "nodeId": {
3104
+ "type": "string"
3105
+ }
3106
+ },
3107
+ "required": [
3108
+ "by",
3109
+ "nodeType",
3110
+ "nodeId"
3111
+ ]
2797
3112
  }
2798
3113
  ]
2799
3114
  },
@@ -3175,6 +3490,36 @@
3175
3490
  "by",
3176
3491
  "target"
3177
3492
  ]
3493
+ },
3494
+ {
3495
+ "type": "object",
3496
+ "properties": {
3497
+ "by": {
3498
+ "const": "block",
3499
+ "type": "string"
3500
+ },
3501
+ "nodeType": {
3502
+ "enum": [
3503
+ "paragraph",
3504
+ "heading",
3505
+ "listItem",
3506
+ "table",
3507
+ "tableRow",
3508
+ "tableCell",
3509
+ "tableOfContents",
3510
+ "image",
3511
+ "sdt"
3512
+ ]
3513
+ },
3514
+ "nodeId": {
3515
+ "type": "string"
3516
+ }
3517
+ },
3518
+ "required": [
3519
+ "by",
3520
+ "nodeType",
3521
+ "nodeId"
3522
+ ]
3178
3523
  }
3179
3524
  ]
3180
3525
  },
@@ -3440,11 +3785,24 @@
3440
3785
  "type": "boolean"
3441
3786
  }
3442
3787
  }
3788
+ },
3789
+ "alignment": {
3790
+ "description": "Set paragraph alignment on the target block(s). Can be combined with inline formatting in the same step.",
3791
+ "enum": [
3792
+ "left",
3793
+ "center",
3794
+ "right",
3795
+ "justify"
3796
+ ]
3797
+ },
3798
+ "scope": {
3799
+ "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\".",
3800
+ "enum": [
3801
+ "match",
3802
+ "block"
3803
+ ]
3443
3804
  }
3444
- },
3445
- "required": [
3446
- "inline"
3447
- ]
3805
+ }
3448
3806
  }
3449
3807
  },
3450
3808
  "required": [