@superdoc-dev/sdk 1.13.0 → 1.14.0-next.2

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.
package/dist/index.cjs CHANGED
@@ -79,6 +79,13 @@ class SuperDocDocumentCore {
79
79
  markClosed() {
80
80
  this.boundRuntime.markClosed();
81
81
  }
82
+ async formatRange(params, options = {}) {
83
+ const { properties, ...rest } = params;
84
+ return this.boundRuntime.invoke(contract.CONTRACT.operations['doc.format.apply'], {
85
+ ...rest,
86
+ inline: properties,
87
+ }, options);
88
+ }
82
89
  }
83
90
  function attachBoundDocApi(target, api) {
84
91
  const { save: _save, close: _close, ...boundMethods } = api;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type BoundDocApi, type DocCloseBoundParams, type DocCloseResult, type DocOpenParams as GeneratedDocOpenParams, type DocOpenResult, type DocSaveBoundParams, type DocSaveResult } from './generated/client.js';
1
+ import { type BoundDocApi, type DocCloseBoundParams, type DocCloseResult, type DocFormatApplyBoundParams, type DocFormatApplyResult, type DocOpenParams as GeneratedDocOpenParams, type DocOpenResult, type DocSaveBoundParams, type DocSaveResult } from './generated/client.js';
2
2
  import { SuperDocRuntime, type SuperDocClientOptions, type InvokeOptions, type OperationSpec, type RuntimeInvoker } from './runtime/process.js';
3
3
  /**
4
4
  * Wraps a raw runtime and injects a fixed sessionId into every invoke call.
@@ -14,6 +14,9 @@ declare class BoundRuntime implements RuntimeInvoker {
14
14
  invoke<TData = unknown>(operation: OperationSpec, params?: Record<string, unknown>, options?: InvokeOptions): Promise<TData>;
15
15
  markClosed(): void;
16
16
  }
17
+ export interface DocFormatRangeBoundParams extends Omit<DocFormatApplyBoundParams, 'inline'> {
18
+ properties: NonNullable<DocFormatApplyBoundParams['inline']>;
19
+ }
17
20
  /**
18
21
  * Bound document handle. All document operations are available as typed methods.
19
22
  * The handle injects its session id automatically — callers never pass
@@ -33,6 +36,7 @@ declare class SuperDocDocumentCore {
33
36
  close(params?: DocCloseBoundParams, options?: InvokeOptions): Promise<DocCloseResult>;
34
37
  /** @internal */
35
38
  markClosed(): void;
39
+ formatRange(params: DocFormatRangeBoundParams, options?: InvokeOptions): Promise<DocFormatApplyResult>;
36
40
  }
37
41
  type SuperDocDocumentInstance = SuperDocDocumentCore & BoundDocApi;
38
42
  export declare const SuperDocDocument: new (boundRuntime: BoundRuntime, sessionId: string, openResult: DocOpenResult, client: SuperDocClient) => SuperDocDocumentInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,aAAa,IAAI,sBAAsB,EAC5C,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAO9B;;;;;GAKG;AACH,cAAM,YAAa,YAAW,cAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM;IAKjD,MAAM,CAAC,KAAK,GAAG,OAAO,EAC1B,SAAS,EAAE,aAAa,EACxB,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,KAAK,CAAC;IAUjB,UAAU,IAAI,IAAI;CAGnB;AAMD;;;;GAIG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;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,CAAC,MAAM,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5F,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B,gBAAgB;IAChB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAGtC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,cAAc,CAExF;AAED,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -73,6 +73,13 @@ class SuperDocDocumentCore {
73
73
  markClosed() {
74
74
  this.boundRuntime.markClosed();
75
75
  }
76
+ async formatRange(params, options = {}) {
77
+ const { properties, ...rest } = params;
78
+ return this.boundRuntime.invoke(CONTRACT.operations['doc.format.apply'], {
79
+ ...rest,
80
+ inline: properties,
81
+ }, options);
82
+ }
76
83
  }
77
84
  function attachBoundDocApi(target, api) {
78
85
  const { save: _save, close: _close, ...boundMethods } = api;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/sdk",
3
- "version": "1.13.0",
3
+ "version": "1.14.0-next.2",
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.13.0",
30
- "@superdoc-dev/sdk-darwin-x64": "1.13.0",
31
- "@superdoc-dev/sdk-linux-x64": "1.13.0",
32
- "@superdoc-dev/sdk-windows-x64": "1.13.0",
33
- "@superdoc-dev/sdk-linux-arm64": "1.13.0"
29
+ "@superdoc-dev/sdk-darwin-arm64": "1.14.0-next.2",
30
+ "@superdoc-dev/sdk-linux-x64": "1.14.0-next.2",
31
+ "@superdoc-dev/sdk-darwin-x64": "1.14.0-next.2",
32
+ "@superdoc-dev/sdk-linux-arm64": "1.14.0-next.2",
33
+ "@superdoc-dev/sdk-windows-x64": "1.14.0-next.2"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
@@ -2600,15 +2600,34 @@
2600
2600
  },
2601
2601
  {
2602
2602
  "$ref": "#/$defs/TextTarget"
2603
+ },
2604
+ {
2605
+ "$ref": "#/$defs/SelectionTarget"
2606
+ },
2607
+ {
2608
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2603
2609
  }
2604
2610
  ],
2605
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks."
2611
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content."
2606
2612
  },
2607
2613
  {
2608
- "$ref": "#/$defs/TextAddress"
2614
+ "oneOf": [
2615
+ {
2616
+ "$ref": "#/$defs/TextAddress"
2617
+ },
2618
+ {
2619
+ "$ref": "#/$defs/TextTarget"
2620
+ },
2621
+ {
2622
+ "$ref": "#/$defs/SelectionTarget"
2623
+ },
2624
+ {
2625
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2626
+ }
2627
+ ]
2609
2628
  }
2610
2629
  ],
2611
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks. Only for actions 'create', 'update'. Omit for other actions."
2630
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content. Only for actions 'create', 'update'. Omit for other actions."
2612
2631
  },
2613
2632
  "parentId": {
2614
2633
  "type": "string",
@@ -2682,7 +2701,7 @@
2682
2701
  },
2683
2702
  {
2684
2703
  "toolName": "superdoc_track_changes",
2685
- "description": "Review and resolve tracked changes (insertions, deletions, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"} or all changes at once with {scope:\"all\"}. Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"insert\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2704
+ "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2686
2705
  "inputSchema": {
2687
2706
  "type": "object",
2688
2707
  "properties": {
@@ -2706,9 +2725,10 @@
2706
2725
  "enum": [
2707
2726
  "insert",
2708
2727
  "delete",
2728
+ "replacement",
2709
2729
  "format"
2710
2730
  ],
2711
- "description": "Filter by change type: 'insert', 'delete', or 'format'. Only for action 'list'. Omit for other actions."
2731
+ "description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
2712
2732
  },
2713
2733
  "force": {
2714
2734
  "type": "boolean",
@@ -2746,6 +2766,30 @@
2746
2766
  "id"
2747
2767
  ]
2748
2768
  },
2769
+ {
2770
+ "type": "object",
2771
+ "properties": {
2772
+ "kind": {
2773
+ "const": "range",
2774
+ "type": "string"
2775
+ },
2776
+ "range": {
2777
+ "$ref": "#/$defs/TextTarget"
2778
+ },
2779
+ "story": {
2780
+ "$ref": "#/$defs/StoryLocator"
2781
+ },
2782
+ "part": {
2783
+ "type": "string",
2784
+ "description": "Optional part discriminator for the range target."
2785
+ }
2786
+ },
2787
+ "additionalProperties": false,
2788
+ "required": [
2789
+ "kind",
2790
+ "range"
2791
+ ]
2792
+ },
2749
2793
  {
2750
2794
  "type": "object",
2751
2795
  "properties": {
@@ -2753,6 +2797,18 @@
2753
2797
  "enum": [
2754
2798
  "all"
2755
2799
  ]
2800
+ },
2801
+ "story": {
2802
+ "oneOf": [
2803
+ {
2804
+ "$ref": "#/$defs/StoryLocator"
2805
+ },
2806
+ {
2807
+ "const": "all",
2808
+ "type": "string"
2809
+ }
2810
+ ],
2811
+ "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story."
2756
2812
  }
2757
2813
  },
2758
2814
  "additionalProperties": false,
@@ -43,5 +43,5 @@
43
43
  "mutates": true
44
44
  }
45
45
  ],
46
- "contractHash": "266b6bb8fa042ebd94c3da6e11652471f49c40a061960f3df9055cf64c4bcbbe"
46
+ "contractHash": "5f439c4117bbb2e55f227e7711df415c1173f8c476954c6e412a4b8b45edd1a3"
47
47
  }
@@ -2311,15 +2311,34 @@
2311
2311
  },
2312
2312
  {
2313
2313
  "$ref": "#/$defs/TextTarget"
2314
+ },
2315
+ {
2316
+ "$ref": "#/$defs/SelectionTarget"
2317
+ },
2318
+ {
2319
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2314
2320
  }
2315
2321
  ],
2316
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks."
2322
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content."
2317
2323
  },
2318
2324
  {
2319
- "$ref": "#/$defs/TextAddress"
2325
+ "oneOf": [
2326
+ {
2327
+ "$ref": "#/$defs/TextAddress"
2328
+ },
2329
+ {
2330
+ "$ref": "#/$defs/TextTarget"
2331
+ },
2332
+ {
2333
+ "$ref": "#/$defs/SelectionTarget"
2334
+ },
2335
+ {
2336
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2337
+ }
2338
+ ]
2320
2339
  }
2321
2340
  ],
2322
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks. Only for actions 'create', 'update'. Omit for other actions."
2341
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content. Only for actions 'create', 'update'. Omit for other actions."
2323
2342
  },
2324
2343
  "parentId": {
2325
2344
  "type": "string",
@@ -2361,7 +2380,7 @@
2361
2380
  },
2362
2381
  {
2363
2382
  "name": "superdoc_track_changes",
2364
- "description": "Review and resolve tracked changes (insertions, deletions, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"} or all changes at once with {scope:\"all\"}. Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"insert\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2383
+ "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2365
2384
  "input_schema": {
2366
2385
  "type": "object",
2367
2386
  "properties": {
@@ -2385,9 +2404,10 @@
2385
2404
  "enum": [
2386
2405
  "insert",
2387
2406
  "delete",
2407
+ "replacement",
2388
2408
  "format"
2389
2409
  ],
2390
- "description": "Filter by change type: 'insert', 'delete', or 'format'. Only for action 'list'. Omit for other actions."
2410
+ "description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
2391
2411
  },
2392
2412
  "force": {
2393
2413
  "type": "boolean",
@@ -2425,6 +2445,30 @@
2425
2445
  "id"
2426
2446
  ]
2427
2447
  },
2448
+ {
2449
+ "type": "object",
2450
+ "properties": {
2451
+ "kind": {
2452
+ "const": "range",
2453
+ "type": "string"
2454
+ },
2455
+ "range": {
2456
+ "$ref": "#/$defs/TextTarget"
2457
+ },
2458
+ "story": {
2459
+ "$ref": "#/$defs/StoryLocator"
2460
+ },
2461
+ "part": {
2462
+ "type": "string",
2463
+ "description": "Optional part discriminator for the range target."
2464
+ }
2465
+ },
2466
+ "additionalProperties": false,
2467
+ "required": [
2468
+ "kind",
2469
+ "range"
2470
+ ]
2471
+ },
2428
2472
  {
2429
2473
  "type": "object",
2430
2474
  "properties": {
@@ -2432,6 +2476,18 @@
2432
2476
  "enum": [
2433
2477
  "all"
2434
2478
  ]
2479
+ },
2480
+ "story": {
2481
+ "oneOf": [
2482
+ {
2483
+ "$ref": "#/$defs/StoryLocator"
2484
+ },
2485
+ {
2486
+ "const": "all",
2487
+ "type": "string"
2488
+ }
2489
+ ],
2490
+ "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story."
2435
2491
  }
2436
2492
  },
2437
2493
  "additionalProperties": false,
@@ -2420,15 +2420,34 @@
2420
2420
  },
2421
2421
  {
2422
2422
  "$ref": "#/$defs/TextTarget"
2423
+ },
2424
+ {
2425
+ "$ref": "#/$defs/SelectionTarget"
2426
+ },
2427
+ {
2428
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2423
2429
  }
2424
2430
  ],
2425
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks."
2431
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content."
2426
2432
  },
2427
2433
  {
2428
- "$ref": "#/$defs/TextAddress"
2434
+ "oneOf": [
2435
+ {
2436
+ "$ref": "#/$defs/TextAddress"
2437
+ },
2438
+ {
2439
+ "$ref": "#/$defs/TextTarget"
2440
+ },
2441
+ {
2442
+ "$ref": "#/$defs/SelectionTarget"
2443
+ },
2444
+ {
2445
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2446
+ }
2447
+ ]
2429
2448
  }
2430
2449
  ],
2431
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks. Only for actions 'create', 'update'. Omit for other actions."
2450
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content. Only for actions 'create', 'update'. Omit for other actions."
2432
2451
  },
2433
2452
  "parentId": {
2434
2453
  "type": "string",
@@ -2490,7 +2509,7 @@
2490
2509
  },
2491
2510
  {
2492
2511
  "name": "superdoc_track_changes",
2493
- "description": "Review and resolve tracked changes (insertions, deletions, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"} or all changes at once with {scope:\"all\"}. Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"insert\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2512
+ "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2494
2513
  "parameters": {
2495
2514
  "type": "object",
2496
2515
  "properties": {
@@ -2514,9 +2533,10 @@
2514
2533
  "enum": [
2515
2534
  "insert",
2516
2535
  "delete",
2536
+ "replacement",
2517
2537
  "format"
2518
2538
  ],
2519
- "description": "Filter by change type: 'insert', 'delete', or 'format'. Only for action 'list'. Omit for other actions."
2539
+ "description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
2520
2540
  },
2521
2541
  "force": {
2522
2542
  "type": "boolean",
@@ -2554,6 +2574,30 @@
2554
2574
  "id"
2555
2575
  ]
2556
2576
  },
2577
+ {
2578
+ "type": "object",
2579
+ "properties": {
2580
+ "kind": {
2581
+ "const": "range",
2582
+ "type": "string"
2583
+ },
2584
+ "range": {
2585
+ "$ref": "#/$defs/TextTarget"
2586
+ },
2587
+ "story": {
2588
+ "$ref": "#/$defs/StoryLocator"
2589
+ },
2590
+ "part": {
2591
+ "type": "string",
2592
+ "description": "Optional part discriminator for the range target."
2593
+ }
2594
+ },
2595
+ "additionalProperties": false,
2596
+ "required": [
2597
+ "kind",
2598
+ "range"
2599
+ ]
2600
+ },
2557
2601
  {
2558
2602
  "type": "object",
2559
2603
  "properties": {
@@ -2561,6 +2605,18 @@
2561
2605
  "enum": [
2562
2606
  "all"
2563
2607
  ]
2608
+ },
2609
+ "story": {
2610
+ "oneOf": [
2611
+ {
2612
+ "$ref": "#/$defs/StoryLocator"
2613
+ },
2614
+ {
2615
+ "const": "all",
2616
+ "type": "string"
2617
+ }
2618
+ ],
2619
+ "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story."
2564
2620
  }
2565
2621
  },
2566
2622
  "additionalProperties": false,
@@ -2328,15 +2328,34 @@
2328
2328
  },
2329
2329
  {
2330
2330
  "$ref": "#/$defs/TextTarget"
2331
+ },
2332
+ {
2333
+ "$ref": "#/$defs/SelectionTarget"
2334
+ },
2335
+ {
2336
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2331
2337
  }
2332
2338
  ],
2333
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks."
2339
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content."
2334
2340
  },
2335
2341
  {
2336
- "$ref": "#/$defs/TextAddress"
2342
+ "oneOf": [
2343
+ {
2344
+ "$ref": "#/$defs/TextAddress"
2345
+ },
2346
+ {
2347
+ "$ref": "#/$defs/TextTarget"
2348
+ },
2349
+ {
2350
+ "$ref": "#/$defs/SelectionTarget"
2351
+ },
2352
+ {
2353
+ "$ref": "#/$defs/CommentTrackedChangeTarget"
2354
+ }
2355
+ ]
2337
2356
  }
2338
2357
  ],
2339
- "description": "Text range to anchor the comment. Accepts either a single-block TextAddress {kind:'text', blockId, range} or a multi-segment TextTarget {kind:'text', segments:[{blockId, range}, ...]} for selections that span blocks. Only for actions 'create', 'update'. Omit for other actions."
2358
+ "description": "Comment target. Accepts a TextAddress, TextTarget, SelectionTarget, or {trackedChangeId, kind?:'trackedChange'} to anchor directly on tracked content. Only for actions 'create', 'update'. Omit for other actions."
2340
2359
  },
2341
2360
  "parentId": {
2342
2361
  "type": "string",
@@ -2381,7 +2400,7 @@
2381
2400
  "type": "function",
2382
2401
  "function": {
2383
2402
  "name": "superdoc_track_changes",
2384
- "description": "Review and resolve tracked changes (insertions, deletions, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"} or all changes at once with {scope:\"all\"}. Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"insert\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2403
+ "description": "Review and resolve tracked changes (insertions, deletions, replacements, format changes) in the document. Action \"list\" returns all tracked changes with optional filtering by type (insert, delete, replacement, format) and pagination (limit, offset). Each change includes an ID, type, author, timestamp, and content preview. Action \"decide\" accepts or rejects changes. Pass decision:\"accept\" to apply the change permanently, or decision:\"reject\" to discard it. Target a single change with {id:\"<changeId>\"}, a partial selection with {kind:\"range\", range:{...}}, or all changes at once with {scope:\"all\"} (optionally plus story). Do NOT use this tool unless the document has tracked changes. Use superdoc_get_content info to check the tracked change count first.\n\nEXAMPLES:\n 1. {\"action\":\"list\"}\n 2. {\"action\":\"list\",\"type\":\"replacement\",\"limit\":10}\n 3. {\"action\":\"decide\",\"decision\":\"accept\",\"target\":{\"id\":\"<changeId>\"}}\n 4. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"kind\":\"range\",\"range\":{\"kind\":\"text\",\"segments\":[{\"blockId\":\"<blockId>\",\"range\":{\"start\":0,\"end\":5}}]}}}\n 5. {\"action\":\"decide\",\"decision\":\"reject\",\"target\":{\"scope\":\"all\"}}",
2385
2404
  "parameters": {
2386
2405
  "type": "object",
2387
2406
  "properties": {
@@ -2405,9 +2424,10 @@
2405
2424
  "enum": [
2406
2425
  "insert",
2407
2426
  "delete",
2427
+ "replacement",
2408
2428
  "format"
2409
2429
  ],
2410
- "description": "Filter by change type: 'insert', 'delete', or 'format'. Only for action 'list'. Omit for other actions."
2430
+ "description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
2411
2431
  },
2412
2432
  "force": {
2413
2433
  "type": "boolean",
@@ -2445,6 +2465,30 @@
2445
2465
  "id"
2446
2466
  ]
2447
2467
  },
2468
+ {
2469
+ "type": "object",
2470
+ "properties": {
2471
+ "kind": {
2472
+ "const": "range",
2473
+ "type": "string"
2474
+ },
2475
+ "range": {
2476
+ "$ref": "#/$defs/TextTarget"
2477
+ },
2478
+ "story": {
2479
+ "$ref": "#/$defs/StoryLocator"
2480
+ },
2481
+ "part": {
2482
+ "type": "string",
2483
+ "description": "Optional part discriminator for the range target."
2484
+ }
2485
+ },
2486
+ "additionalProperties": false,
2487
+ "required": [
2488
+ "kind",
2489
+ "range"
2490
+ ]
2491
+ },
2448
2492
  {
2449
2493
  "type": "object",
2450
2494
  "properties": {
@@ -2452,6 +2496,18 @@
2452
2496
  "enum": [
2453
2497
  "all"
2454
2498
  ]
2499
+ },
2500
+ "story": {
2501
+ "oneOf": [
2502
+ {
2503
+ "$ref": "#/$defs/StoryLocator"
2504
+ },
2505
+ {
2506
+ "const": "all",
2507
+ "type": "string"
2508
+ }
2509
+ ],
2510
+ "description": "Optional explicit bulk filter. Omit or pass 'all' to target every revision-capable story, or pass a StoryLocator to scope the decision to one story."
2455
2511
  }
2456
2512
  },
2457
2513
  "additionalProperties": false,