@superdoc/mcp 1.1.1-next.3 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +34 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -31314,7 +31314,7 @@ var init_host = __esm(() => {
31314
31314
  });
31315
31315
 
31316
31316
  // ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
31317
- var SDK_VERSION = "2.14.1-next.3";
31317
+ var SDK_VERSION = "2.15.0-next.2";
31318
31318
 
31319
31319
  // ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
31320
31320
  import { chmodSync, existsSync } from "node:fs";
@@ -212431,10 +212431,16 @@ function prepareParagraphDelete(state, op) {
212431
212431
  return { ok: true, noOp: true, target, bytes, xml, paraXml, successor };
212432
212432
  }
212433
212433
  const structural = classifyParagraphStructural(paraXml, {
212434
- allowRelationshipBearing: true
212434
+ allowRelationshipBearing: true,
212435
+ allowInlineSdtDeletion: changeMode === "direct"
212435
212436
  });
212436
212437
  if (!structural.ok)
212437
212438
  return { ok: false, reason: structural.reason };
212439
+ if (changeMode === "direct") {
212440
+ const sdtFailure = validateDirectParagraphInlineSdtDeletion(bytes, target.entry.byteStart, paraXml);
212441
+ if (sdtFailure)
212442
+ return { ok: false, reason: sdtFailure };
212443
+ }
212438
212444
  const namespaces = /(?:drawing|pict)/.test(paraXml) ? namespaceBindingsAtPosition(bytes, target.entry.byteStart, matchParagraphOpenTag(paraXml) ?? "") : undefined;
212439
212445
  const hasDrawing = namespaces && collectXmlElementRanges(paraXml, {
212440
212446
  fragment: true,
@@ -214170,6 +214176,30 @@ function tableOrdinalAtOrBeforeByte(catalog, byteOffset) {
214170
214176
  }
214171
214177
  return low - 1;
214172
214178
  }
214179
+ function validateDirectParagraphInlineSdtDeletion(bytes, paragraphStartByte, paraXml) {
214180
+ const sdtTags = paraXml.match(/<\s*(?:[\w.-]+:)?sdt\b/g);
214181
+ if (!sdtTags)
214182
+ return null;
214183
+ const namespaces = namespaceBindingsAtPosition(bytes, paragraphStartByte, matchParagraphOpenTag(paraXml) ?? "");
214184
+ const pieces = parseParagraphInlineMap(paraXml, namespaces).pieces;
214185
+ let sdtCount = 0;
214186
+ for (const piece of pieces) {
214187
+ if (piece.kind !== "container" || piece.containerKind !== "sdt")
214188
+ continue;
214189
+ sdtCount += 1;
214190
+ const policy = classifySdtMutationPolicy(piece);
214191
+ if (!policy.ok)
214192
+ return policy.reason;
214193
+ if (!policy.wrapperDeletable)
214194
+ return "text-range-in-sdt";
214195
+ const blocked = findBlockingSdtChild(piece.children);
214196
+ if (blocked)
214197
+ return blocked;
214198
+ }
214199
+ if (sdtCount !== sdtTags.length)
214200
+ return "text-range-in-sdt";
214201
+ return null;
214202
+ }
214173
214203
  function classifyParagraphStructural(paraXml, options = {}) {
214174
214204
  if (/<[\w.-]+:moveFrom\b/.test(paraXml) || /<[\w.-]+:moveTo\b/.test(paraXml)) {
214175
214205
  return { ok: false, reason: "paragraph-tracked-wrapper-unsupported" };
@@ -214177,7 +214207,7 @@ function classifyParagraphStructural(paraXml, options = {}) {
214177
214207
  if (!options.fieldsVerified && (/<[\w.-]+:fldChar\b/.test(paraXml) || /<[\w.-]+:instrText\b/.test(paraXml) || /<[\w.-]+:fldSimple\b/.test(paraXml))) {
214178
214208
  return { ok: false, reason: "paragraph-tracked-wrapper-unsupported" };
214179
214209
  }
214180
- if (/<[\w.-]+:sdt\b/.test(paraXml)) {
214210
+ if (!options.allowInlineSdtDeletion && /<[\w.-]+:sdt\b/.test(paraXml)) {
214181
214211
  return { ok: false, reason: "paragraph-tracked-wrapper-unsupported" };
214182
214212
  }
214183
214213
  let relationshipBearing = false;
@@ -214964,6 +214994,7 @@ var init_compile_paragraph_ops = __esm(() => {
214964
214994
  init_sd_document_state();
214965
214995
  init_text_offset_mapping();
214966
214996
  init_paragraph_inline_model();
214997
+ init_compile_edit_text_inline_plan();
214967
214998
  init_structural_boundary_map();
214968
214999
  init_paragraph_section_collapse();
214969
215000
  init_paragraph_delete_cell_boundary();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/mcp",
3
- "version": "1.1.1-next.3",
3
+ "version": "1.2.0-next.2",
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.14.1-next.3",
27
+ "@superdoc/sdk": "2.15.0-next.2",
28
28
  "debug": "^4.4.3",
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "superdoc": "2.17.1-next.2",
33
- "@superdoc/docx-engine": "0.16.1-next.2",
32
+ "superdoc": "2.18.0-next.2",
33
+ "@superdoc/docx-engine": "0.17.0-next.2",
34
34
  "@superdoc/document-api": "0.1.0-alpha.0",
35
35
  "@types/bun": "^1.3.8",
36
36
  "@types/node": "22.19.2",