@superdoc/mcp 1.0.1-next.7 → 1.0.1-next.8
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 +24 -19
- 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.13.1-next.
|
|
31317
|
+
var SDK_VERSION = "2.13.1-next.8";
|
|
31318
31318
|
|
|
31319
31319
|
// ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
|
|
31320
31320
|
import { chmodSync, existsSync } from "node:fs";
|
|
@@ -193399,9 +193399,10 @@ function runInsertInlineControlCommit(input) {
|
|
|
193399
193399
|
preconditions,
|
|
193400
193400
|
patchMaps,
|
|
193401
193401
|
textRangeShifts: shifts,
|
|
193402
|
-
...changeMode === "direct" && op.control === "lineBreak" && "runPropertiesXml" in rewritten ? {
|
|
193403
|
-
|
|
193404
|
-
kind: "
|
|
193402
|
+
...changeMode === "direct" && (op.control === "tab" || op.control === "lineBreak") && "runPropertiesXml" in rewritten ? {
|
|
193403
|
+
directInlineControl: {
|
|
193404
|
+
kind: "directInlineControl",
|
|
193405
|
+
control: op.control,
|
|
193405
193406
|
afterParagraphTail: "afterParagraphTail" in rewritten && rewritten.afterParagraphTail === true,
|
|
193406
193407
|
blockId: op.on.startBlockId,
|
|
193407
193408
|
startOffset: op.on.startOffset,
|
|
@@ -193708,7 +193709,7 @@ function finalizeInlineControlCommit(args) {
|
|
|
193708
193709
|
changeMode: op.changeMode ?? "direct",
|
|
193709
193710
|
targetBlockIds: [op.on.startBlockId],
|
|
193710
193711
|
atomCarrierContract: SD_DEFAULT_ATOM_CARRIER_CONTRACT,
|
|
193711
|
-
...args.
|
|
193712
|
+
...args.directInlineControl ? { directInlineControl: args.directInlineControl } : {},
|
|
193712
193713
|
...args.trackedTextInsert ? { trackedTextInsert: args.trackedTextInsert } : {},
|
|
193713
193714
|
...args.trackedTextEdit ? { trackedTextEdit: args.trackedTextEdit } : {}
|
|
193714
193715
|
};
|
|
@@ -424349,8 +424350,12 @@ function tryMirrorStoryText(prepared, extension2, options, admitted) {
|
|
|
424349
424350
|
const validation = admitted ?? validateDirectStoryText(prepared, extension2, options);
|
|
424350
424351
|
if (!validation.ok)
|
|
424351
424352
|
return { mirrored: false, failureReason: validation.failureReason };
|
|
424352
|
-
const source = validation.source.kind === "insertInlineControl" ? {
|
|
424353
|
-
|
|
424353
|
+
const source = validation.source.kind === "insertInlineControl" ? {
|
|
424354
|
+
changeMode: "direct",
|
|
424355
|
+
on: validation.source.on,
|
|
424356
|
+
newText: validation.inlineControl?.control === "tab" ? "\t" : `
|
|
424357
|
+
`
|
|
424358
|
+
} : validation.source;
|
|
424354
424359
|
const target = validation.target;
|
|
424355
424360
|
try {
|
|
424356
424361
|
target.scope.doc.transact(() => {
|
|
@@ -424419,7 +424424,7 @@ function tryMirrorStoryText(prepared, extension2, options, admitted) {
|
|
|
424419
424424
|
});
|
|
424420
424425
|
}
|
|
424421
424426
|
if (source.newText.length > 0) {
|
|
424422
|
-
if (deleteLength === 0 || validation.
|
|
424427
|
+
if (deleteLength === 0 || validation.inlineControl) {
|
|
424423
424428
|
if (!validation.directInsert) {
|
|
424424
424429
|
throw new Error("direct storyText mirror missing typed insert metadata");
|
|
424425
424430
|
}
|
|
@@ -424429,7 +424434,7 @@ function tryMirrorStoryText(prepared, extension2, options, admitted) {
|
|
|
424429
424434
|
text: source.newText,
|
|
424430
424435
|
txId: prepared.txId,
|
|
424431
424436
|
directInsert: validation.directInsert,
|
|
424432
|
-
preserveZeroLengthAtOffset: validation.
|
|
424437
|
+
preserveZeroLengthAtOffset: validation.inlineControl?.afterParagraphTail,
|
|
424433
424438
|
acceptedTextInsertionSplit: validation.acceptedTextInsertionSplit
|
|
424434
424439
|
});
|
|
424435
424440
|
} else {
|
|
@@ -424549,10 +424554,10 @@ function cloneTrackedWrapperAtom(source, id2, visibleOffset) {
|
|
|
424549
424554
|
}
|
|
424550
424555
|
function validateDirectStoryText(prepared, extension2, options) {
|
|
424551
424556
|
const source = prepared.source;
|
|
424552
|
-
const
|
|
424557
|
+
const inlineControl = source.kind === "insertInlineControl" ? extension2.directInlineControl : undefined;
|
|
424553
424558
|
if (source.kind === "insertInlineControl") {
|
|
424554
|
-
if (source.control !== "lineBreak" || (source.changeMode ?? "direct") !== "direct" || !
|
|
424555
|
-
return { ok: false, failureReason: "storyText requires matching direct
|
|
424559
|
+
if (source.control !== "tab" && source.control !== "lineBreak" || (source.changeMode ?? "direct") !== "direct" || !inlineControl || inlineControl.kind !== "directInlineControl" || inlineControl.control !== source.control || typeof inlineControl.afterParagraphTail !== "boolean" || inlineControl.blockId !== source.on.startBlockId || inlineControl.startOffset !== source.on.startOffset || inlineControl.endOffset !== source.on.endOffset || parsePreparedRunAttributes(inlineControl.runPropertiesXml) === null) {
|
|
424560
|
+
return { ok: false, failureReason: "storyText requires matching direct inline-control metadata" };
|
|
424556
424561
|
}
|
|
424557
424562
|
}
|
|
424558
424563
|
if (source.kind !== "editText" && source.kind !== "insertInlineControl") {
|
|
@@ -424600,15 +424605,15 @@ function validateDirectStoryText(prepared, extension2, options) {
|
|
|
424600
424605
|
if (trackedEdit && !trackedEdit.ok) {
|
|
424601
424606
|
return { ok: false, failureReason: trackedEdit.failureReason };
|
|
424602
424607
|
}
|
|
424603
|
-
const directInsert =
|
|
424608
|
+
const directInsert = inlineControl ? {
|
|
424604
424609
|
ok: true,
|
|
424605
424610
|
directInsert: {
|
|
424606
424611
|
kind: "directTextInsert",
|
|
424607
|
-
blockId:
|
|
424608
|
-
startOffset:
|
|
424609
|
-
text: `
|
|
424612
|
+
blockId: inlineControl.blockId,
|
|
424613
|
+
startOffset: inlineControl.startOffset,
|
|
424614
|
+
text: inlineControl.control === "tab" ? "\t" : `
|
|
424610
424615
|
`,
|
|
424611
|
-
runPropertiesXml:
|
|
424616
|
+
runPropertiesXml: inlineControl.runPropertiesXml
|
|
424612
424617
|
}
|
|
424613
424618
|
} : source.kind === "editText" && source.changeMode === "direct" && isPureDirectTextInsert(source) ? validateDirectTextInsert(source, extension2) : null;
|
|
424614
424619
|
if (directInsert && !directInsert.ok) {
|
|
@@ -424646,7 +424651,7 @@ function validateDirectStoryText(prepared, extension2, options) {
|
|
|
424646
424651
|
};
|
|
424647
424652
|
}
|
|
424648
424653
|
const target = resolveStoryTextMutationTarget(doc2, source.on.startBlockId);
|
|
424649
|
-
if (lineBreak && !
|
|
424654
|
+
if (inlineControl?.control === "lineBreak" && !inlineControl.afterParagraphTail && hasStoryTextBoundaryInRange(target, source.on.startOffset, source.on.endOffset)) {
|
|
424650
424655
|
return { ok: false, failureReason: "line-break boundary placement requires typed collaboration support" };
|
|
424651
424656
|
}
|
|
424652
424657
|
let validatedTrackedRefinement;
|
|
@@ -424679,7 +424684,7 @@ function validateDirectStoryText(prepared, extension2, options) {
|
|
|
424679
424684
|
target,
|
|
424680
424685
|
...acceptedTextInsertionSplit ? { acceptedTextInsertionSplit } : {},
|
|
424681
424686
|
...directInsert?.ok ? { directInsert: directInsert.directInsert } : {},
|
|
424682
|
-
...
|
|
424687
|
+
...inlineControl ? { inlineControl: { control: inlineControl.control, afterParagraphTail: inlineControl.afterParagraphTail } } : {},
|
|
424683
424688
|
...trackedInsert?.ok ? { trackedInsert: trackedInsert.trackedInsert } : {},
|
|
424684
424689
|
...trackedInsertContinuation ? { trackedInsertContinuation: true } : {},
|
|
424685
424690
|
...validatedTrackedRefinement ? { trackedRefinement: validatedTrackedRefinement } : {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc/mcp",
|
|
3
|
-
"version": "1.0.1-next.
|
|
3
|
+
"version": "1.0.1-next.8",
|
|
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.1-next.
|
|
27
|
+
"@superdoc/sdk": "2.13.1-next.8",
|
|
28
28
|
"debug": "^4.4.3",
|
|
29
29
|
"zod": "^4.3.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"superdoc": "2.16.1-next.
|
|
33
|
-
"@superdoc/docx-engine": "0.15.1-next.
|
|
32
|
+
"superdoc": "2.16.1-next.8",
|
|
33
|
+
"@superdoc/docx-engine": "0.15.1-next.8",
|
|
34
34
|
"@superdoc/document-api": "0.1.0-alpha.0",
|
|
35
35
|
"@types/bun": "^1.3.8",
|
|
36
36
|
"@types/node": "22.19.2",
|