@superdoc/mcp 1.0.0-next.13 → 1.0.0-next.14

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -2
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -351254,7 +351254,7 @@ var init_host = __esm(() => {
351254
351254
  });
351255
351255
 
351256
351256
  // ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
351257
- var SDK_VERSION = "2.13.0-next.15";
351257
+ var SDK_VERSION = "2.13.0-next.16";
351258
351258
 
351259
351259
  // ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
351260
351260
  import { chmodSync, existsSync } from "node:fs";
@@ -727015,7 +727015,18 @@ function applyPreflightedTrackedTextDecisionsToStory(input) {
727015
727015
  return { ok: true, applied: true, alreadyDecided: false };
727016
727016
  }
727017
727017
  function findPreparedLiveTrackedTextSpans(doc2, target) {
727018
- return collectLiveTrackedTextSpans(doc2, target.rsid, target.trackedKind, [target.blockId]).filter((span) => span.blockId === target.blockId && span.startOffset === target.startOffset && span.endOffset === target.endOffset);
727018
+ return collectLiveTrackedTextSpans(doc2, target.rsid, target.trackedKind, [target.blockId]).filter((span) => span.blockId === target.blockId && span.sourceStartOffset === target.startOffset && span.sourceEndOffset === target.endOffset);
727019
+ }
727020
+ function collapsedSourceVisibleLengthBefore(atoms, boundaryIndex) {
727021
+ let length3 = 0;
727022
+ for (const atom of atoms) {
727023
+ if (atom.index >= boundaryIndex || atom.atomKind !== INLINE_ATOM_KIND.sdt)
727024
+ continue;
727025
+ try {
727026
+ length3 += parseParagraphInlineMap(`<w:p>${atom.xml}</w:p>`).visibleLength;
727027
+ } catch {}
727028
+ }
727029
+ return length3;
727019
727030
  }
727020
727031
  function collectLiveTrackedTextSpans(doc2, rsid, trackedKind, targetBlockIds2) {
727021
727032
  const targetSet = new Set(targetBlockIds2.map(String));
@@ -727080,11 +727091,15 @@ function collectLiveTrackedTextSpansInBlock(block, rsid, trackedKind) {
727080
727091
  const deletedSegments = preservedWithSegments.flatMap(({ segments }) => segments);
727081
727092
  const deletedRuns = deletedSegments.filter((segment) => segment.kind === "run");
727082
727093
  const deletedTextLength2 = deletedRuns.reduce((length3, run) => length3 + run.text.length, 0);
727094
+ const sourceStartOffset = start.offset + collapsedSourceVisibleLengthBefore(atoms, start.index);
727095
+ const sourceEndOffset = trackedKind === "ins" ? end.offset + collapsedSourceVisibleLengthBefore(atoms, end.index) : sourceStartOffset + deletedTextLength2;
727083
727096
  spans.push({
727084
727097
  trackedKind,
727085
727098
  blockId,
727086
727099
  startOffset: start.offset,
727087
727100
  endOffset: trackedKind === "del" ? start.offset + deletedTextLength2 : end.offset,
727101
+ sourceStartOffset,
727102
+ sourceEndOffset,
727088
727103
  startAtomIndex: start.index,
727089
727104
  startAtomId: start.id,
727090
727105
  endAtomId: end.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/mcp",
3
- "version": "1.0.0-next.13",
3
+ "version": "1.0.0-next.14",
4
4
  "description": "Model Context Protocol server for SuperDoc, giving an AI agent tools to read and edit .docx files.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -24,13 +24,13 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@modelcontextprotocol/sdk": "^1.26.0",
27
- "@superdoc/sdk": "2.13.0-next.15",
27
+ "@superdoc/sdk": "2.13.0-next.16",
28
28
  "debug": "^4.4.3",
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "superdoc": "2.16.0-next.13",
33
- "@superdoc/docx-engine": "0.15.0-next.13",
32
+ "superdoc": "2.16.0-next.14",
33
+ "@superdoc/docx-engine": "0.15.0-next.14",
34
34
  "@superdoc/document-api": "0.1.0-alpha.0",
35
35
  "@types/bun": "^1.3.8",
36
36
  "@types/node": "22.19.2",