@superdoc-dev/sdk 1.8.0-next.4 → 1.8.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.
@@ -53,10 +53,15 @@ function dispatchIntentTool(toolName, args, execute) {
53
53
  switch (action) {
54
54
  case 'insert': return execute('doc.lists.insert', rest);
55
55
  case 'create': return execute('doc.lists.create', rest);
56
+ case 'attach': return execute('doc.lists.attach', rest);
56
57
  case 'detach': return execute('doc.lists.detach', rest);
57
58
  case 'indent': return execute('doc.lists.indent', rest);
58
59
  case 'outdent': return execute('doc.lists.outdent', rest);
60
+ case 'merge': return execute('doc.lists.merge', rest);
61
+ case 'split': return execute('doc.lists.split', rest);
59
62
  case 'set_level': return execute('doc.lists.setLevel', rest);
63
+ case 'set_value': return execute('doc.lists.setValue', rest);
64
+ case 'continue_previous': return execute('doc.lists.continuePrevious', rest);
60
65
  case 'set_type': return execute('doc.lists.setType', rest);
61
66
  default: throw new Error(`Unknown action for superdoc_list: ${action}`);
62
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"intent-dispatch.generated.d.ts","sourceRoot":"","sources":["../../src/generated/intent-dispatch.generated.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GACxE,OAAO,CA4FT"}
1
+ {"version":3,"file":"intent-dispatch.generated.d.ts","sourceRoot":"","sources":["../../src/generated/intent-dispatch.generated.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GACxE,OAAO,CAiGT"}
@@ -51,10 +51,15 @@ export function dispatchIntentTool(toolName, args, execute) {
51
51
  switch (action) {
52
52
  case 'insert': return execute('doc.lists.insert', rest);
53
53
  case 'create': return execute('doc.lists.create', rest);
54
+ case 'attach': return execute('doc.lists.attach', rest);
54
55
  case 'detach': return execute('doc.lists.detach', rest);
55
56
  case 'indent': return execute('doc.lists.indent', rest);
56
57
  case 'outdent': return execute('doc.lists.outdent', rest);
58
+ case 'merge': return execute('doc.lists.merge', rest);
59
+ case 'split': return execute('doc.lists.split', rest);
57
60
  case 'set_level': return execute('doc.lists.setLevel', rest);
61
+ case 'set_value': return execute('doc.lists.setValue', rest);
62
+ case 'continue_previous': return execute('doc.lists.continuePrevious', rest);
58
63
  case 'set_type': return execute('doc.lists.setType', rest);
59
64
  default: throw new Error(`Unknown action for superdoc_list: ${action}`);
60
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/sdk",
3
- "version": "1.8.0-next.4",
3
+ "version": "1.8.0-next.41",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -26,11 +26,11 @@
26
26
  "typescript": "^5.9.2"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@superdoc-dev/sdk-darwin-arm64": "1.8.0-next.4",
30
- "@superdoc-dev/sdk-linux-x64": "1.8.0-next.4",
31
- "@superdoc-dev/sdk-linux-arm64": "1.8.0-next.4",
32
- "@superdoc-dev/sdk-windows-x64": "1.8.0-next.4",
33
- "@superdoc-dev/sdk-darwin-x64": "1.8.0-next.4"
29
+ "@superdoc-dev/sdk-darwin-x64": "1.8.0-next.41",
30
+ "@superdoc-dev/sdk-linux-arm64": "1.8.0-next.41",
31
+ "@superdoc-dev/sdk-windows-x64": "1.8.0-next.41",
32
+ "@superdoc-dev/sdk-linux-x64": "1.8.0-next.41",
33
+ "@superdoc-dev/sdk-darwin-arm64": "1.8.0-next.41"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
@@ -90,7 +90,7 @@
90
90
  },
91
91
  {
92
92
  "toolName": "superdoc_edit",
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.",
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.",
94
94
  "inputSchema": {
95
95
  "type": "object",
96
96
  "properties": {
@@ -1073,7 +1073,7 @@
1073
1073
  },
1074
1074
  {
1075
1075
  "toolName": "superdoc_create",
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.",
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.",
1077
1077
  "inputSchema": {
1078
1078
  "type": "object",
1079
1079
  "properties": {
@@ -1219,7 +1219,7 @@
1219
1219
  },
1220
1220
  "text": {
1221
1221
  "type": "string",
1222
- "description": "Paragraph text content. Each call creates ONE paragraph. For multiple items (e.g. list items), call superdoc_create separately for each item do NOT use newlines to put multiple items in one paragraph."
1222
+ "description": "Paragraph text content. Each call creates ONE paragraph. For multiple items (e.g. list items), call superdoc_create separately for each item: do NOT use newlines to put multiple items in one paragraph."
1223
1223
  },
1224
1224
  "input": {
1225
1225
  "type": "object",
@@ -1268,22 +1268,27 @@
1268
1268
  },
1269
1269
  {
1270
1270
  "toolName": "superdoc_list",
1271
- "description": "Create and manipulate bullet and numbered lists. To create a list: first create all paragraphs at the SAME location using superdoc_create (chain each using the previous nodeId as the \"at\" target). Then call action \"create\" with mode:\"fromParagraphs\", a preset (\"disc\" for bullet, \"decimal\" for numbered), and a range target: {from:{kind:\"block\", nodeType:\"paragraph\", nodeId:\"<first>\"}, to:{kind:\"block\", nodeType:\"paragraph\", nodeId:\"<last>\"}}. The range converts ALL paragraphs between from and to into list items. Make sure no other content exists between them. Action \"set_type\" converts between bullet and ordered (target any item in the list, kind:\"ordered\" or \"bullet\"). Action \"insert\" adds a new item before/after a target list item. Actions \"indent\" and \"outdent\" change nesting level; \"set_level\" jumps to a specific level (0-8). Action \"detach\" converts a list item back to a plain paragraph. Do NOT target paragraphs with indent/outdent/set_type; these actions require a listItem target.",
1271
+ "description": "Create and manipulate bullet and numbered lists. Most actions require a list-item target: {kind:\"block\", nodeType:\"listItem\", nodeId:\"<id>\"}. Exceptions: \"create\" and \"attach\" operate on paragraph targets (they turn paragraphs into list items). Find nodeIds via superdoc_get_content({action:\"blocks\"}): pick listItem blocks for most actions, paragraph blocks for create/attach.\n\nCREATE & CONVERT:\n• \"create\": make a NEW list from paragraphs. Two modes: mode:\"empty\" with at:{kind:\"block\", nodeType:\"paragraph\", nodeId} converts a single paragraph; mode:\"fromParagraphs\" with target:{from:{...paragraph block address}, to:{...paragraph block address}} converts a range: ALL paragraphs between from and to become items, so make sure no other content sits between them. Pass a preset (\"disc\"|\"circle\"|\"square\"|\"dash\" for bullets; \"decimal\"|\"decimalParenthesis\"|\"lowerLetter\"|\"upperLetter\"|\"lowerRoman\"|\"upperRoman\" for ordered) or a custom style. Use \"create\" to start a fresh list: NOT to extend an existing one (use \"attach\" for that).\n• \"attach\": add paragraphs to an EXISTING list, inheriting its numbering definition. Pass target:{paragraph block address} (or {from, to} range of paragraphs) + attachTo:{kind:\"block\", nodeType:\"listItem\", nodeId:\"<any item in destination list>\"} + optional level:0..8. Use this to extend a list or as the second half of a merge workflow (see \"join\" below).\n• \"set_type\": convert an existing list between ordered and bullet. Pass target:{listItem} + kind:\"ordered\" or \"bullet\". Adjacent compatible sequences are merged automatically to preserve continuous numbering.\n• \"detach\": convert a list item back to a plain paragraph. Pass target:{listItem}.\n\nITEMS & NESTING:\n• \"insert\": add a new list item adjacent to an existing item in the same list. Pass target:{listItem} + position:\"before\"|\"after\" + optional text. Use this (NOT superdoc_create) to add items to an existing list.\n• \"indent\" / \"outdent\": bump the target item's nesting level by one (0-8 range). Pass target:{listItem}.\n• \"set_level\": jump the target item to an explicit level. Pass target:{listItem} + level:0..8.\n\nNUMBERING (ordered lists):\n• \"set_value\": restart numbering at the target. Pass target:{listItem} + value:<number> (e.g. value:1 to start over) or value:null to clear a previous override. Mid-sequence targets are atomically split off into their own sequence.\n• \"continue_previous\": make the target's sequence continue numbering from the nearest compatible previous sequence (same abstract definition). Pass target:{listItem of the sequence you want to renumber}. Fails with NO_COMPATIBLE_PREVIOUS or INCOMPATIBLE_DEFINITIONS if no matching prior sequence exists.\n\nSEQUENCE SHAPE (merge / split):\n• \"merge\": merge the target's sequence with an adjacent one into one continuous list. Pass target:{listItem} + direction:\"withPrevious\" or \"withNext\". Absorbed items adopt the absorbing sequence's numbering definition, and empty paragraphs between the two sequences are removed so numbering flows continuously.\n• \"split\": split the target's sequence at the target item into two independent lists. The target and everything after become a new sequence that restarts numbering at 1. Pass target:{listItem}; add restartNumbering:false to keep the count continuing instead of restarting.",
1272
1272
  "inputSchema": {
1273
1273
  "type": "object",
1274
1274
  "properties": {
1275
1275
  "action": {
1276
1276
  "type": "string",
1277
1277
  "enum": [
1278
+ "attach",
1279
+ "continue_previous",
1278
1280
  "create",
1279
1281
  "detach",
1280
1282
  "indent",
1281
1283
  "insert",
1284
+ "merge",
1282
1285
  "outdent",
1283
1286
  "set_level",
1284
- "set_type"
1287
+ "set_type",
1288
+ "set_value",
1289
+ "split"
1285
1290
  ],
1286
- "description": "The action to perform. One of: create, detach, indent, insert, outdent, set_level, set_type."
1291
+ "description": "The action to perform. One of: attach, continue_previous, create, detach, indent, insert, merge, outdent, set_level, set_type, set_value, split."
1287
1292
  },
1288
1293
  "force": {
1289
1294
  "type": "boolean",
@@ -1321,7 +1326,7 @@
1321
1326
  "nodeType",
1322
1327
  "nodeId"
1323
1328
  ],
1324
- "description": "The target list item. For 'insert': the item to insert relative to. For 'create' with mode 'fromParagraphs': use nodeType 'paragraph' instead. Format: {kind:'block', nodeType:'listItem', nodeId:'<id>'}. Required for actions 'insert', 'detach', 'indent', 'outdent', 'set_level', 'set_type'."
1329
+ "description": "The target list item. For 'insert': the item to insert relative to. For 'create' with mode 'fromParagraphs': use nodeType 'paragraph' instead. Format: {kind:'block', nodeType:'listItem', nodeId:'<id>'}. Required for actions 'insert', 'attach', 'detach', 'indent', 'outdent', 'merge', 'split', 'set_level', 'set_value', 'continue_previous', 'set_type'."
1325
1330
  },
1326
1331
  "position": {
1327
1332
  "type": "string",
@@ -1345,7 +1350,7 @@
1345
1350
  },
1346
1351
  "mode": {
1347
1352
  "type": "string",
1348
- "description": "Required. 'fromParagraphs' converts existing paragraphs into list items each paragraph becomes one item, so create one paragraph per item first. 'empty' creates a new empty list at 'at'. Required for action 'create'.",
1353
+ "description": "Required. 'fromParagraphs' converts existing paragraphs into list items: each paragraph becomes one item, so create one paragraph per item first. 'empty' creates a new empty list at 'at'. Required for action 'create'.",
1349
1354
  "enum": [
1350
1355
  "empty",
1351
1356
  "fromParagraphs"
@@ -1505,6 +1510,44 @@
1505
1510
  ],
1506
1511
  "description": "Only for action 'create'. Omit for other actions."
1507
1512
  },
1513
+ "attachTo": {
1514
+ "type": "object",
1515
+ "properties": {
1516
+ "kind": {
1517
+ "const": "block",
1518
+ "type": "string"
1519
+ },
1520
+ "nodeType": {
1521
+ "const": "listItem",
1522
+ "type": "string"
1523
+ },
1524
+ "nodeId": {
1525
+ "type": "string"
1526
+ }
1527
+ },
1528
+ "required": [
1529
+ "kind",
1530
+ "nodeType",
1531
+ "nodeId"
1532
+ ],
1533
+ "description": "Required for action 'attach'."
1534
+ },
1535
+ "direction": {
1536
+ "type": "string",
1537
+ "enum": [
1538
+ "withPrevious",
1539
+ "withNext"
1540
+ ],
1541
+ "description": "Required for action 'merge'."
1542
+ },
1543
+ "restartNumbering": {
1544
+ "type": "boolean",
1545
+ "description": "Only for action 'split'. Omit for other actions."
1546
+ },
1547
+ "value": {
1548
+ "type": "object",
1549
+ "description": "Required for action 'set_value'."
1550
+ },
1508
1551
  "continuity": {
1509
1552
  "type": "string",
1510
1553
  "description": "Numbering continuity: 'preserve' keeps numbering; 'none' restarts. Only for action 'set_type'. Omit for other actions.",
@@ -1536,6 +1579,14 @@
1536
1579
  "mode"
1537
1580
  ]
1538
1581
  },
1582
+ {
1583
+ "operationId": "doc.lists.attach",
1584
+ "intentAction": "attach",
1585
+ "required": [
1586
+ "target",
1587
+ "attachTo"
1588
+ ]
1589
+ },
1539
1590
  {
1540
1591
  "operationId": "doc.lists.detach",
1541
1592
  "intentAction": "detach",
@@ -1557,6 +1608,21 @@
1557
1608
  "target"
1558
1609
  ]
1559
1610
  },
1611
+ {
1612
+ "operationId": "doc.lists.merge",
1613
+ "intentAction": "merge",
1614
+ "required": [
1615
+ "target",
1616
+ "direction"
1617
+ ]
1618
+ },
1619
+ {
1620
+ "operationId": "doc.lists.split",
1621
+ "intentAction": "split",
1622
+ "required": [
1623
+ "target"
1624
+ ]
1625
+ },
1560
1626
  {
1561
1627
  "operationId": "doc.lists.setLevel",
1562
1628
  "intentAction": "set_level",
@@ -1565,6 +1631,21 @@
1565
1631
  "level"
1566
1632
  ]
1567
1633
  },
1634
+ {
1635
+ "operationId": "doc.lists.setValue",
1636
+ "intentAction": "set_value",
1637
+ "required": [
1638
+ "target",
1639
+ "value"
1640
+ ]
1641
+ },
1642
+ {
1643
+ "operationId": "doc.lists.continuePrevious",
1644
+ "intentAction": "continue_previous",
1645
+ "required": [
1646
+ "target"
1647
+ ]
1648
+ },
1568
1649
  {
1569
1650
  "operationId": "doc.lists.setType",
1570
1651
  "intentAction": "set_type",
@@ -1678,6 +1759,153 @@
1678
1759
  "range"
1679
1760
  ]
1680
1761
  }
1762
+ },
1763
+ "story": {
1764
+ "oneOf": [
1765
+ {
1766
+ "type": "object",
1767
+ "properties": {
1768
+ "kind": {
1769
+ "const": "story",
1770
+ "type": "string"
1771
+ },
1772
+ "storyType": {
1773
+ "const": "body",
1774
+ "type": "string"
1775
+ }
1776
+ },
1777
+ "required": [
1778
+ "kind",
1779
+ "storyType"
1780
+ ]
1781
+ },
1782
+ {
1783
+ "type": "object",
1784
+ "properties": {
1785
+ "kind": {
1786
+ "const": "story",
1787
+ "type": "string"
1788
+ },
1789
+ "storyType": {
1790
+ "const": "headerFooterSlot",
1791
+ "type": "string"
1792
+ },
1793
+ "section": {
1794
+ "type": "object",
1795
+ "properties": {
1796
+ "kind": {
1797
+ "const": "section",
1798
+ "type": "string"
1799
+ },
1800
+ "sectionId": {
1801
+ "type": "string"
1802
+ }
1803
+ },
1804
+ "required": [
1805
+ "kind",
1806
+ "sectionId"
1807
+ ]
1808
+ },
1809
+ "headerFooterKind": {
1810
+ "enum": [
1811
+ "header",
1812
+ "footer"
1813
+ ]
1814
+ },
1815
+ "variant": {
1816
+ "enum": [
1817
+ "default",
1818
+ "first",
1819
+ "even"
1820
+ ]
1821
+ },
1822
+ "resolution": {
1823
+ "enum": [
1824
+ "effective",
1825
+ "explicit"
1826
+ ]
1827
+ },
1828
+ "onWrite": {
1829
+ "enum": [
1830
+ "materializeIfInherited",
1831
+ "editResolvedPart",
1832
+ "error"
1833
+ ]
1834
+ }
1835
+ },
1836
+ "required": [
1837
+ "kind",
1838
+ "storyType",
1839
+ "section",
1840
+ "headerFooterKind",
1841
+ "variant"
1842
+ ]
1843
+ },
1844
+ {
1845
+ "type": "object",
1846
+ "properties": {
1847
+ "kind": {
1848
+ "const": "story",
1849
+ "type": "string"
1850
+ },
1851
+ "storyType": {
1852
+ "const": "headerFooterPart",
1853
+ "type": "string"
1854
+ },
1855
+ "refId": {
1856
+ "type": "string"
1857
+ }
1858
+ },
1859
+ "required": [
1860
+ "kind",
1861
+ "storyType",
1862
+ "refId"
1863
+ ]
1864
+ },
1865
+ {
1866
+ "type": "object",
1867
+ "properties": {
1868
+ "kind": {
1869
+ "const": "story",
1870
+ "type": "string"
1871
+ },
1872
+ "storyType": {
1873
+ "const": "footnote",
1874
+ "type": "string"
1875
+ },
1876
+ "noteId": {
1877
+ "type": "string"
1878
+ }
1879
+ },
1880
+ "required": [
1881
+ "kind",
1882
+ "storyType",
1883
+ "noteId"
1884
+ ]
1885
+ },
1886
+ {
1887
+ "type": "object",
1888
+ "properties": {
1889
+ "kind": {
1890
+ "const": "story",
1891
+ "type": "string"
1892
+ },
1893
+ "storyType": {
1894
+ "const": "endnote",
1895
+ "type": "string"
1896
+ },
1897
+ "noteId": {
1898
+ "type": "string"
1899
+ }
1900
+ },
1901
+ "required": [
1902
+ "kind",
1903
+ "storyType",
1904
+ "noteId"
1905
+ ]
1906
+ }
1907
+ ],
1908
+ "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."
1681
1909
  }
1682
1910
  },
1683
1911
  "required": [
@@ -1698,9 +1926,10 @@
1698
1926
  },
1699
1927
  "status": {
1700
1928
  "type": "string",
1701
- "description": "Set comment status. Use 'resolved' to mark as resolved. Only for action 'update'. Omit for other actions.",
1929
+ "description": "Set comment status. Use 'resolved' to resolve a comment, or 'active' to reopen a previously resolved comment (lifecycle inverse). Only for action 'update'. Omit for other actions.",
1702
1930
  "enum": [
1703
- "resolved"
1931
+ "resolved",
1932
+ "active"
1704
1933
  ]
1705
1934
  },
1706
1935
  "isInternal": {
@@ -79,14 +79,24 @@ def dispatch_intent_tool(
79
79
  return execute('doc.lists.insert', rest)
80
80
  elif action == 'create':
81
81
  return execute('doc.lists.create', rest)
82
+ elif action == 'attach':
83
+ return execute('doc.lists.attach', rest)
82
84
  elif action == 'detach':
83
85
  return execute('doc.lists.detach', rest)
84
86
  elif action == 'indent':
85
87
  return execute('doc.lists.indent', rest)
86
88
  elif action == 'outdent':
87
89
  return execute('doc.lists.outdent', rest)
90
+ elif action == 'merge':
91
+ return execute('doc.lists.merge', rest)
92
+ elif action == 'split':
93
+ return execute('doc.lists.split', rest)
88
94
  elif action == 'set_level':
89
95
  return execute('doc.lists.setLevel', rest)
96
+ elif action == 'set_value':
97
+ return execute('doc.lists.setValue', rest)
98
+ elif action == 'continue_previous':
99
+ return execute('doc.lists.continuePrevious', rest)
90
100
  elif action == 'set_type':
91
101
  return execute('doc.lists.setType', rest)
92
102
  else:
@@ -160,6 +160,94 @@ Use preset "disc" for bullets, "decimal" for numbered. WARNING: the range conver
160
160
 
161
161
  3. To change a bullet list to numbered: `superdoc_list({action: "set_type", target: {kind: "block", nodeType: "listItem", nodeId: "<anyItemId>"}, kind: "ordered"})`
162
162
 
163
+ ### Add items to an existing list
164
+
165
+ To add a new item adjacent to an existing list item, use `superdoc_list({action: "insert"})`, NOT `superdoc_create({action: "paragraph"})` — the latter creates a standalone paragraph that is not part of the list:
166
+
167
+ ```
168
+ superdoc_get_content({action: "blocks"}) // find the listItem nodeId you want to insert next to
169
+ superdoc_list({action: "insert", target: {kind: "block", nodeType: "listItem", nodeId: "<itemId>"}, position: "after", text: "New item text"})
170
+ ```
171
+
172
+ **Level inheritance.** The new item inherits the target's nesting level. Insert after a level-0 item → new item is level 0. Insert after a level-2 item → new item is level 2. To change the level, chain `indent` / `outdent` / `set_level` on the nodeId returned in the insert response.
173
+
174
+ **Use the nodeId from the response directly.** `superdoc_list({action: "insert"})` returns `{item: {nodeId: "<id>"}}` — that id is ready for subsequent `indent`, `outdent`, `set_level`, or text edits. You do NOT need to re-fetch blocks between the insert and the follow-up operation.
175
+
176
+ ### Add a sub-point under an existing item
177
+
178
+ Insert a peer, then indent it one level:
179
+
180
+ ```
181
+ // 1. Insert a peer item after the parent — new item is at the parent's level
182
+ const resp = superdoc_list({action: "insert", target: {kind: "block", nodeType: "listItem", nodeId: "<parentItemId>"}, position: "after", text: "Sub-point"})
183
+
184
+ // 2. Indent using the nodeId from resp.item.nodeId
185
+ superdoc_list({action: "indent", target: {kind: "block", nodeType: "listItem", nodeId: "<resp.item.nodeId>"}})
186
+ ```
187
+
188
+ ### Build a nested list with mixed levels
189
+
190
+ `lists.create` produces a flat list. Add nesting by chaining `insert` + `indent` / `set_level`, using the nodeId returned by each insert to target the next step:
191
+
192
+ ```
193
+ // Starting point: a list item at level 0 ("Parent" with nodeId <parent>)
194
+
195
+ // Sibling at level 0
196
+ const r1 = superdoc_list({action: "insert", target: {kind: "block", nodeType: "listItem", nodeId: "<parent>"}, position: "after", text: "Sibling"})
197
+
198
+ // Child at level 1 (insert after r1, then indent)
199
+ const r2 = superdoc_list({action: "insert", target: {kind: "block", nodeType: "listItem", nodeId: "<r1.item.nodeId>"}, position: "after", text: "Child"})
200
+ superdoc_list({action: "indent", target: {kind: "block", nodeType: "listItem", nodeId: "<r2.item.nodeId>"}})
201
+
202
+ // Grandchild at level 3 (insert after r2, then jump to level 3 directly)
203
+ const r3 = superdoc_list({action: "insert", target: {kind: "block", nodeType: "listItem", nodeId: "<r2.item.nodeId>"}, position: "after", text: "Deep"})
204
+ superdoc_list({action: "set_level", target: {kind: "block", nodeType: "listItem", nodeId: "<r3.item.nodeId>"}, level: 3})
205
+ ```
206
+
207
+ `indent` bumps the level by one (bounded 0–8). `set_level` jumps directly to any level 0–8. Markers update automatically based on the list's definition for each level (e.g. `1.` / `a.` / `i.` for an ordered list).
208
+
209
+ ### Merge two adjacent lists into one
210
+
211
+ Use `merge` — it handles the common case where two ordered or bulleted lists sit next to each other and should become one continuous list. Absorbed items adopt the absorbing sequence's definition, and any empty paragraphs between the two lists are removed so numbering flows continuously.
212
+
213
+ ```
214
+ superdoc_get_content({action: "blocks"}) // find a listItem in either sequence
215
+ // To merge with the previous sequence:
216
+ superdoc_list({action: "merge", target: {kind: "block", nodeType: "listItem", nodeId: "<itemId>"}, direction: "withPrevious"})
217
+ // Or with the next sequence:
218
+ superdoc_list({action: "merge", target: {kind: "block", nodeType: "listItem", nodeId: "<itemId>"}, direction: "withNext"})
219
+ ```
220
+
221
+ ### Split a list into two
222
+
223
+ Use `split` to break one list into two independent lists at a specific item. The target and everything after become a new sequence that restarts numbering at 1:
224
+
225
+ ```
226
+ superdoc_list({action: "split", target: {kind: "block", nodeType: "listItem", nodeId: "<itemId>"}})
227
+ ```
228
+
229
+ Pass `restartNumbering: false` if you want the new half to keep counting from where the original left off.
230
+
231
+ ### Restart numbering at a specific item
232
+
233
+ For ordered lists. To make item N restart from a chosen number (commonly 1):
234
+
235
+ ```
236
+ superdoc_list({action: "set_value", target: {kind: "block", nodeType: "listItem", nodeId: "<itemId>"}, value: 1})
237
+ ```
238
+
239
+ Pass `value: null` to clear a previously-set restart override and let the item resume natural numbering.
240
+
241
+ ### Continue numbering across a break
242
+
243
+ For ordered lists. When two sibling sequences should be numbered as one (e.g. numbering jumps back to 1 and you want it to continue from where the previous list left off), target the FIRST item of the second sequence:
244
+
245
+ ```
246
+ superdoc_list({action: "continue_previous", target: {kind: "block", nodeType: "listItem", nodeId: "<firstItemOfSecondList>"}})
247
+ ```
248
+
249
+ Fails with `NO_COMPATIBLE_PREVIOUS` or `INCOMPATIBLE_DEFINITIONS` if no prior sequence shares the same abstract definition. In that case, use `merge` instead — it handles mismatched definitions, removes empty gap paragraphs, and produces one continuous list.
250
+
163
251
  ### Insert content into a document (new or existing)
164
252
 
165
253
  Markdown insert creates block structure but uses default formatting. You MUST follow up with formatting so inserted content looks like it belongs in the document.