@superdoc/mcp 1.7.1-next.4 → 1.7.1-next.6
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.js +70 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -31600,7 +31600,7 @@ var init_host = __esm(() => {
|
|
|
31600
31600
|
});
|
|
31601
31601
|
|
|
31602
31602
|
// ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
|
|
31603
|
-
var SDK_VERSION = "2.20.1-next.
|
|
31603
|
+
var SDK_VERSION = "2.20.1-next.6";
|
|
31604
31604
|
|
|
31605
31605
|
// ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
|
|
31606
31606
|
import { accessSync, chmodSync, constants, existsSync, statSync } from "node:fs";
|
|
@@ -138920,6 +138920,9 @@ function validateRunContents(xml, options) {
|
|
|
138920
138920
|
}
|
|
138921
138921
|
if (runs === "")
|
|
138922
138922
|
return { ok: true };
|
|
138923
|
+
if (/^[\t\n\r ]+$/.test(runs)) {
|
|
138924
|
+
return { ok: false, reason: "target runs contain only XML whitespace; clearing this representation is not supported" };
|
|
138925
|
+
}
|
|
138923
138926
|
const replayXml = stripAllowedNoteReferences(runs, options);
|
|
138924
138927
|
const withoutCarriers = replayXml !== null && options.baseRunXml ? stripRetainedCarrier(replayXml, options.baseRunXml, options.allowNamespaceDeclarationDifference === true) : replayXml;
|
|
138925
138928
|
const withoutBookmarks = withoutCarriers !== null && /<(?:[\w.-]+:)?bookmark(?:Start|End)\b/.test(withoutCarriers) ? preservedBookmarkRunTokens(withoutCarriers)?.strippedXml ?? null : withoutCarriers;
|
|
@@ -388423,15 +388426,27 @@ function projectTrackedChanges(context) {
|
|
|
388423
388426
|
});
|
|
388424
388427
|
}
|
|
388425
388428
|
}
|
|
388429
|
+
const capturedFormattingKeys = new Set;
|
|
388426
388430
|
for (const partUri of sortedParts(catalog.formattingByPart)) {
|
|
388427
388431
|
const fragments = catalog.formattingByPart.get(partUri) ?? [];
|
|
388428
388432
|
for (const f of [...fragments].sort((a, b) => a.byteStart - b.byteStart)) {
|
|
388433
|
+
if (capturedFormattingKeys.has(f.entityKey))
|
|
388434
|
+
continue;
|
|
388435
|
+
capturedFormattingKeys.add(f.entityKey);
|
|
388429
388436
|
const author = f.author?.name ?? "";
|
|
388437
|
+
const group = [...catalog.formattingByKey.get(f.entityKey) ?? [f]].sort((a, b) => a.partUri.localeCompare(b.partUri) || a.byteStart - b.byteStart);
|
|
388438
|
+
const contentSignature = group.length === 1 ? digest3(`subtype:${f.subtype}#author:${author}#date:${f.date}#before:${f.beforeInnerXml}#after:${f.afterInnerXml}`) : digest3(JSON.stringify(group.map((member) => [
|
|
388439
|
+
member.subtype,
|
|
388440
|
+
member.author?.name ?? "",
|
|
388441
|
+
member.date,
|
|
388442
|
+
member.beforeInnerXml,
|
|
388443
|
+
member.afterInnerXml
|
|
388444
|
+
])));
|
|
388430
388445
|
entries.push({
|
|
388431
388446
|
key: f.entityKey,
|
|
388432
388447
|
stableKey: f.entityKey,
|
|
388433
388448
|
semanticKey: `format:${f.subtype}|${author}`,
|
|
388434
|
-
contentSignature
|
|
388449
|
+
contentSignature,
|
|
388435
388450
|
ordinal: ordinal++,
|
|
388436
388451
|
label: `formatting revision ${f.subtype}`
|
|
388437
388452
|
});
|
|
@@ -389244,6 +389259,29 @@ function requiredPartBytes(context, partUri) {
|
|
|
389244
389259
|
throw new SDCompareError("SOURCE_NOT_COMPLETE", `compare capture could not read required part ${partUri}.`);
|
|
389245
389260
|
return bytes;
|
|
389246
389261
|
}
|
|
389262
|
+
function assertInspectableTablePlacement(context) {
|
|
389263
|
+
const partUris = new Set(listSDDocumentSessionInternalStories(context.session).map((story) => story.partUri));
|
|
389264
|
+
for (const partUri of partUris) {
|
|
389265
|
+
const parents = [];
|
|
389266
|
+
let inlineContainer;
|
|
389267
|
+
walkXmlElements(new TextDecoder().decode(requiredPartBytes(context, partUri)), {
|
|
389268
|
+
onOpenTag({ tag }) {
|
|
389269
|
+
const parent = parents.at(-1);
|
|
389270
|
+
if (tag.namespaceUri === WORDPROCESSINGML_NAMESPACE8 && tag.localName === "tbl" && parent?.namespaceUri === WORDPROCESSINGML_NAMESPACE8 && (parent.localName === "p" || parent.localName === "r"))
|
|
389271
|
+
inlineContainer = parent.localName === "p" ? "paragraph" : "run";
|
|
389272
|
+
if (!tag.isSelfClosing)
|
|
389273
|
+
parents.push(tag);
|
|
389274
|
+
},
|
|
389275
|
+
onCloseTag({ tag }) {
|
|
389276
|
+
if (!tag.isSelfClosing)
|
|
389277
|
+
parents.pop();
|
|
389278
|
+
}
|
|
389279
|
+
});
|
|
389280
|
+
if (inlineContainer) {
|
|
389281
|
+
throw new SDCompareError("INVALID_INPUT", `compare capture found an uninspectable WordprocessingML table inside a ${inlineContainer} in ${partUri}. ` + "Tables must be block content; no comparison snapshot was produced.");
|
|
389282
|
+
}
|
|
389283
|
+
}
|
|
389284
|
+
}
|
|
389247
389285
|
function contentTypeRegistrationForPart(context, partUri) {
|
|
389248
389286
|
const registry2 = parseContentTypes(new TextDecoder().decode(requiredPartBytes(context, CONTENT_TYPES_URI)));
|
|
389249
389287
|
if (registry2.parseError)
|
|
@@ -389530,6 +389568,7 @@ function captureCompareSnapshotSync(context, options = {}) {
|
|
|
389530
389568
|
return projectCompareSnapshot(context, "source-complete", options);
|
|
389531
389569
|
}
|
|
389532
389570
|
function projectCompareSnapshot(context, posture, options) {
|
|
389571
|
+
assertInspectableTablePlacement(context);
|
|
389533
389572
|
const body = projectBody(context);
|
|
389534
389573
|
const slots = projectSlots(context);
|
|
389535
389574
|
const { stories, noteParts } = projectStories(context, slots);
|
|
@@ -391527,6 +391566,13 @@ function buildCommentApplyPlan(base3, target) {
|
|
|
391527
391566
|
}
|
|
391528
391567
|
function buildExactCommentApplyPlan(base3, target, baseSource, targetSource) {
|
|
391529
391568
|
const fallback = buildCommentApplyPlan(base3, target);
|
|
391569
|
+
if (fallback.steps.filter((step3) => step3.kind === "create").length > 1) {
|
|
391570
|
+
return {
|
|
391571
|
+
steps: [],
|
|
391572
|
+
partRewrites: [],
|
|
391573
|
+
unsafeReasons: ["multiple comment creations require revision-stable anchor replay"]
|
|
391574
|
+
};
|
|
391575
|
+
}
|
|
391530
391576
|
const baseById = new Map(base3.map((record3) => [record3.commentId, record3]));
|
|
391531
391577
|
const targetById = new Map(target.map((record3) => [record3.commentId, record3]));
|
|
391532
391578
|
const topologyCompatible = base3.length === target.length && base3.every((record3) => {
|
|
@@ -395279,7 +395325,11 @@ class V2DiffAdapter {
|
|
|
395279
395325
|
base: payload.base.definitions,
|
|
395280
395326
|
target: payload.target.definitions
|
|
395281
395327
|
}), canonicalBodyOperations);
|
|
395282
|
-
const
|
|
395328
|
+
const tablePropertyPlan = tablesChanged ? buildTrackedTablePropertyReplayPlan(liveBaseMainDocument, payloadMainDocument.target) : null;
|
|
395329
|
+
if (tablePropertyPlan && this.context.isCollaborativeSession()) {
|
|
395330
|
+
throw diffValidationError("CAPABILITY_UNSUPPORTED", "diff.apply: table property replay is unavailable in a joined collaboration session; use a standalone session for this input. No mutation was performed.", { changedFamilies: ["tables"], unsupportedReason: "collaborative-table-property-replay-unsupported" });
|
|
395331
|
+
}
|
|
395332
|
+
const trackedTablePropertyPlan = reviewMarkup ? tablePropertyPlan : null;
|
|
395283
395333
|
let trackedTablePlan = tablesChanged && reviewMarkup && !trackedTablePropertyPlan ? buildTrackedTableRowReplayPlan({
|
|
395284
395334
|
base: liveBaseMainDocument,
|
|
395285
395335
|
target: payloadMainDocument.target,
|
|
@@ -395750,6 +395800,7 @@ function buildCompareApplyEligibility(context, payload, plans, styleChangeMode)
|
|
|
395750
395800
|
}
|
|
395751
395801
|
const tablesChanged = payload.familyPolicy.some((policy) => policy.family === "tables" && policy.applyRequired);
|
|
395752
395802
|
let wholeMainDirectReplay = false;
|
|
395803
|
+
let tablePropertyReplayRequiresStandalone = false;
|
|
395753
395804
|
if (tablesChanged) {
|
|
395754
395805
|
const bodyDeferredToTableReplay = payload.familyPolicy.some((policy) => policy.family === "body" && policy.applyRequired && policy.disposition === "deferred");
|
|
395755
395806
|
const mainDocument = payload.mainDocument ?? { base: EMPTY_MAIN_DOCUMENT_SOURCE, target: EMPTY_MAIN_DOCUMENT_SOURCE };
|
|
@@ -395781,7 +395832,13 @@ function buildCompareApplyEligibility(context, payload, plans, styleChangeMode)
|
|
|
395781
395832
|
bodyOperations: trackedBodyOperations,
|
|
395782
395833
|
allowTopologyReplacement: true
|
|
395783
395834
|
}) : null;
|
|
395784
|
-
|
|
395835
|
+
const trackedPropertyPlan = buildTrackedTablePropertyReplayPlan(mainDocument.base, mainDocument.target);
|
|
395836
|
+
tablePropertyReplayRequiresStandalone = trackedPropertyPlan !== null && context.isCollaborativeSession();
|
|
395837
|
+
if (trackedPropertyPlan) {
|
|
395838
|
+
tracked.add("tables");
|
|
395839
|
+
if (bodyDeferredToTableReplay)
|
|
395840
|
+
tracked.add("body");
|
|
395841
|
+
} else if (trackedTablePlan.unsafeReasons.length === 0 && trackedTablePlan.steps.length > 0) {
|
|
395785
395842
|
tracked.add("tables");
|
|
395786
395843
|
if (bodyDeferredToTableReplay)
|
|
395787
395844
|
tracked.add("body");
|
|
@@ -395802,6 +395859,15 @@ function buildCompareApplyEligibility(context, payload, plans, styleChangeMode)
|
|
|
395802
395859
|
if (metadataPartPlan.rewrites.length > 0)
|
|
395803
395860
|
direct.add("package-graph");
|
|
395804
395861
|
const hazards = { direct: [], tracked: [] };
|
|
395862
|
+
if (tablePropertyReplayRequiresStandalone) {
|
|
395863
|
+
const hazard = {
|
|
395864
|
+
code: "family-apply-lane-unavailable",
|
|
395865
|
+
message: "Table property replay is unavailable in a joined collaboration session; use a standalone session for this input.",
|
|
395866
|
+
families: ["tables"]
|
|
395867
|
+
};
|
|
395868
|
+
hazards.direct.push(hazard);
|
|
395869
|
+
hazards.tracked.push(hazard);
|
|
395870
|
+
}
|
|
395805
395871
|
if (metadataPartPlan.unsafeReasons.length > 0) {
|
|
395806
395872
|
hazards.direct.push({
|
|
395807
395873
|
code: "family-apply-lane-unavailable",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc/mcp",
|
|
3
|
-
"version": "1.7.1-next.
|
|
3
|
+
"version": "1.7.1-next.6",
|
|
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.20.1-next.
|
|
27
|
+
"@superdoc/sdk": "2.20.1-next.6",
|
|
28
28
|
"debug": "^4.4.3",
|
|
29
29
|
"zod": "^4.3.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"superdoc": "2.23.1-next.
|
|
33
|
-
"@superdoc/docx-engine": "0.22.1-next.
|
|
32
|
+
"superdoc": "2.23.1-next.6",
|
|
33
|
+
"@superdoc/docx-engine": "0.22.1-next.6",
|
|
34
34
|
"@superdoc/document-api": "0.1.0-alpha.0",
|
|
35
35
|
"@types/bun": "^1.3.8",
|
|
36
36
|
"@types/node": "22.19.2",
|