@superdoc/mcp 1.0.0-next.11 → 1.0.0-next.12

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 +55 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -350269,7 +350269,7 @@ var init_host = __esm(() => {
350269
350269
  });
350270
350270
 
350271
350271
  // ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
350272
- var SDK_VERSION = "2.13.0-next.13";
350272
+ var SDK_VERSION = "2.13.0-next.14";
350273
350273
 
350274
350274
  // ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
350275
350275
  import { chmodSync, existsSync } from "node:fs";
@@ -489964,7 +489964,15 @@ function tryPureDeleteAcrossTokens(input, allTokens, touched, touchedBreaks = []
489964
489964
  function tryRangeReplacementAcrossTokens(input, allTokens, touched) {
489965
489965
  if (input.newText.length === 0 || input.rangeStart >= input.rangeEnd)
489966
489966
  return null;
489967
- const firstSelected = touched.filter((entry) => entry.token.kind === "plain").sort((left, right) => left.index - right.index).find(({ token }) => input.rangeStart >= token.visibleStart && input.rangeStart < token.visibleEnd);
489967
+ const firstSelected = touched.sort((left, right) => left.index - right.index).find(({ token }) => {
489968
+ if (token.kind === "plain") {
489969
+ return input.rangeStart >= token.visibleStart && input.rangeStart < token.visibleEnd;
489970
+ }
489971
+ if (token.kind !== "ins" || input.changeMode !== "tracked")
489972
+ return false;
489973
+ const classification = token._classification;
489974
+ return classification !== "same-user" && input.rangeStart >= token.visibleStart && input.rangeStart < token.visibleEnd && input.rangeEnd > token.visibleEnd;
489975
+ });
489968
489976
  if (!firstSelected)
489969
489977
  return null;
489970
489978
  const touchedInsertions = touched.filter((entry) => entry.token.kind === "ins");
@@ -490145,6 +490153,21 @@ function authorTrackedPureDelete(input, allTokens, touched, touchedBreaks = [])
490145
490153
  }
490146
490154
  const nestedHead = renderPlainRun(head, token.inner.runOpen, token.inner.runClose, token.inner.rPr);
490147
490155
  const nestedTail = renderPlainRun(tail, token.inner.runOpen, token.inner.runClose, token.inner.rPr);
490156
+ const childIns = !replacementInserted && input.newText.length > 0 && input.rangeStart >= token.visibleStart && input.rangeStart < token.visibleEnd && input.rangeEnd > token.visibleEnd ? buildInsWrapperXml({
490157
+ namespaceReferenceOpenTag: token.openTag,
490158
+ nsPrefix: token.nsPrefix,
490159
+ wId: allocWId("insert", input.insRsid),
490160
+ author: currentAuthor,
490161
+ date: input.txTimestamp,
490162
+ rsidR: input.insRsid,
490163
+ inner: {
490164
+ runOpen: token.inner.runOpen,
490165
+ runClose: token.inner.runClose,
490166
+ rPr: token.inner.rPr,
490167
+ text: input.newText
490168
+ }
490169
+ }) : "";
490170
+ const splitTailWId = childIns && head.length > 0 ? String(input.reserveWId ? input.reserveWId() : fallbackWId++) : token.wId;
490148
490171
  const childDel = buildDelWrapperXml({
490149
490172
  nsPrefix: token.nsPrefix,
490150
490173
  wId: allocWId("delete", input.rsid),
@@ -490153,7 +490176,35 @@ function authorTrackedPureDelete(input, allTokens, touched, touchedBreaks = [])
490153
490176
  rsidDel: input.rsid,
490154
490177
  inner: { runOpen: token.inner.runOpen, runClose: token.inner.runClose, rPr: token.inner.rPr, text: removed }
490155
490178
  });
490156
- pieces.push(`${token.openTag}${nestedHead}${childDel}${nestedTail}${token.closeTag}`);
490179
+ if (childIns) {
490180
+ const headIns = head.length > 0 ? buildInsWrapperXml({
490181
+ openTag: token.openTag,
490182
+ namespaceBindings: token.namespaceBindings,
490183
+ nsPrefix: token.nsPrefix,
490184
+ wId: token.wId,
490185
+ author: token.author,
490186
+ date: token.date,
490187
+ rsidR: token.rsidR,
490188
+ inner: { ...token.inner, text: head }
490189
+ }) : "";
490190
+ const tailIns = buildInsWrapperXml({
490191
+ openTag: token.openTag,
490192
+ namespaceBindings: token.namespaceBindings,
490193
+ nsPrefix: token.nsPrefix,
490194
+ wId: splitTailWId,
490195
+ author: token.author,
490196
+ date: token.date,
490197
+ rsidR: token.rsidR,
490198
+ inner: { ...token.inner, text: tail },
490199
+ innerXml: childDel + nestedTail
490200
+ });
490201
+ pieces.push(headIns + childIns + tailIns);
490202
+ replacementInserted = true;
490203
+ if (!emittedRsids.includes(input.insRsid))
490204
+ emittedRsids.push(input.insRsid);
490205
+ } else {
490206
+ pieces.push(`${token.openTag}${nestedHead}${childDel}${nestedTail}${token.closeTag}`);
490207
+ }
490157
490208
  emitDeletionRsid();
490158
490209
  }
490159
490210
  pieces.push(input.paragraphXml.slice(cursor));
@@ -491195,7 +491246,7 @@ function compilePlainOnlyTrackedDeletion(input, touched) {
491195
491246
  }
491196
491247
  function buildInsWrapperXml(params) {
491197
491248
  const inner = params.innerXml ?? renderPlainRun(params.inner.text, params.inner.runOpen, params.inner.runClose, params.inner.rPr);
491198
- const namespace = wordRevisionNamespace(params.inner.runOpen, inner);
491249
+ const namespace = params.namespaceReferenceOpenTag ? wordReplacementRevisionNamespace(params.namespaceReferenceOpenTag, inner) : wordRevisionNamespace(params.inner.runOpen, inner);
491199
491250
  const attrs = buildAttrChain({
491200
491251
  id: params.wId,
491201
491252
  author: params.author.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/mcp",
3
- "version": "1.0.0-next.11",
3
+ "version": "1.0.0-next.12",
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.13",
27
+ "@superdoc/sdk": "2.13.0-next.14",
28
28
  "debug": "^4.4.3",
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "superdoc": "2.16.0-next.11",
33
- "@superdoc/docx-engine": "0.15.0-next.11",
32
+ "superdoc": "2.16.0-next.12",
33
+ "@superdoc/docx-engine": "0.15.0-next.12",
34
34
  "@superdoc/document-api": "0.1.0-alpha.0",
35
35
  "@types/bun": "^1.3.8",
36
36
  "@types/node": "22.19.2",