@superdoc/mcp 1.5.0-next.3 → 1.5.0-next.5

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 +46 -8
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -31443,7 +31443,7 @@ var init_host = __esm(() => {
31443
31443
  });
31444
31444
 
31445
31445
  // ../../packages/sdk/langs/node/src/runtime/sdk-version.generated.ts
31446
- var SDK_VERSION = "2.18.0-next.3";
31446
+ var SDK_VERSION = "2.18.0-next.5";
31447
31447
 
31448
31448
  // ../../packages/sdk/langs/node/src/runtime/embedded-platform.ts
31449
31449
  import { accessSync, chmodSync, constants, existsSync, statSync } from "node:fs";
@@ -285967,8 +285967,10 @@ function toCssFontFamily(fontName, options = {}) {
285967
285967
  if (trimmed.includes(";")) {
285968
285968
  trimmed = splitOutsideQuotes(trimmed, ";").join(", ");
285969
285969
  }
285970
- const { fallback, wordFamily } = options;
285971
- const fallbackValue = fallback ?? (wordFamily ? mapWordFamilyFallback(wordFamily) : undefined) ?? inferGenericFallbackFromFontName(trimmed);
285970
+ const { fallback, wordFamily, pitch } = options;
285971
+ const family = typeof wordFamily === "string" ? wordFamily.trim().toLowerCase() : "";
285972
+ const fixedPitch = typeof pitch === "string" && pitch.trim().toLowerCase() === "fixed";
285973
+ const fallbackValue = fallback ?? (fixedPitch ? "monospace" : undefined) ?? (family !== "auto" && Object.hasOwn(FONT_FAMILY_FALLBACKS, family) ? mapWordFamilyFallback(family) : undefined) ?? inferGenericFallbackFromFontName(trimmed);
285972
285974
  const fallbackParts = normalizeParts(fallbackValue);
285973
285975
  if (fallbackParts.length === 0) {
285974
285976
  return trimmed;
@@ -285984,7 +285986,12 @@ var FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", INHERITED_FO
285984
285986
  if (!fontName || typeof fontName !== "string")
285985
285987
  return "";
285986
285988
  return fontName.trim().replace(/^["']|["']$/g, "").toLowerCase();
285987
- }, inferGenericFallbackFromFontName = (fontName) => SERIF_LIKE_FONTS.has(normalizeFontNameForLookup(fontName)) ? "serif" : DEFAULT_GENERIC_FALLBACK, normalizeParts = (value) => (value || "").split(",").map((part) => part.trim()).filter(Boolean), splitOutsideQuotes = (str, delimiter) => {
285989
+ }, MONOSPACE_FONTS, inferGenericFallbackFromFontName = (fontName) => {
285990
+ const name = normalizeFontNameForLookup(fontName);
285991
+ if (MONOSPACE_FONTS.has(name))
285992
+ return "monospace";
285993
+ return SERIF_LIKE_FONTS.has(name) ? "serif" : DEFAULT_GENERIC_FALLBACK;
285994
+ }, normalizeParts = (value) => (value || "").split(",").map((part) => part.trim()).filter(Boolean), splitOutsideQuotes = (str, delimiter) => {
285988
285995
  if (!str.includes('"') && !str.includes("'")) {
285989
285996
  return str.split(delimiter).map((p) => p.trim()).filter(Boolean);
285990
285997
  }
@@ -286041,6 +286048,17 @@ var init_font_utils = __esm(() => {
286041
286048
  "bodoni mt",
286042
286049
  "constantia"
286043
286050
  ]);
286051
+ MONOSPACE_FONTS = new Set([
286052
+ "courier",
286053
+ "courier new",
286054
+ "consolas",
286055
+ "menlo",
286056
+ "monaco",
286057
+ "lucida console",
286058
+ "liberation mono",
286059
+ "dejavu sans mono",
286060
+ "source code pro"
286061
+ ]);
286044
286062
  });
286045
286063
 
286046
286064
  // ../../../v2/node_modules/.pnpm/@superdoc+style-engine@file+..+public+packages+layout-engine+style-engine/node_modules/@superdoc/style-engine/src/normalize/run-attrs.ts
@@ -286064,7 +286082,9 @@ function normalizeRunAttrsFromOoxml(props, context = {}) {
286064
286082
  if (props.smallCaps != null)
286065
286083
  out.smallCaps = props.smallCaps === true;
286066
286084
  const fontFamily = resolveFontFamily(props, context.themeFontScheme);
286067
- const cssFontFamily = toCssFontFamily(fontFamily);
286085
+ const fontKey = fontFamily?.trim().replace(/^["']|["']$/g, "");
286086
+ const metadata2 = fontKey ? context.fontTable?.[fontKey] ?? context.fontTable?.[fontKey.toLowerCase()] : undefined;
286087
+ const cssFontFamily = toCssFontFamily(fontFamily, { wordFamily: metadata2?.family, pitch: metadata2?.pitch });
286068
286088
  if (cssFontFamily)
286069
286089
  out.fontFamily = cssFontFamily;
286070
286090
  const fontSize = resolveFontSize(props.fontSize);
@@ -422668,6 +422688,15 @@ function nextSeededBlockId(shardId, paragraphIndex, reason) {
422668
422688
  return `sd-${shardToken}-${reason}-${ordinal}`;
422669
422689
  }
422670
422690
  function seedStoryShard(input) {
422691
+ const target = input.doc;
422692
+ const doc2 = "rootDoc" in target ? target.rootDoc : ("doc" in target) ? target.doc : target;
422693
+ let result;
422694
+ doc2.transact(() => {
422695
+ result = seedStoryShardInTransaction(input);
422696
+ }, "story-shard:seed");
422697
+ return result;
422698
+ }
422699
+ function seedStoryShardInTransaction(input) {
422671
422700
  const { shardId, storyId, storyKind, sourcePartUri, paragraphs } = input;
422672
422701
  const editable = input.editable ?? STORY_EDITABLE.get(storyKind) ?? false;
422673
422702
  const scope = resolveStoryShardScope(input.doc);
@@ -435732,6 +435761,7 @@ function normalizeLiveTrackedWrapperOverlap(atoms) {
435732
435761
  return [...atoms];
435733
435762
  let nextSequence = atoms.reduce((max5, atom) => Math.max(max5, atom.sequence), -1) + 1;
435734
435763
  const syntheticAtoms = [];
435764
+ const coveredParentEdges = new Set;
435735
435765
  for (const [parentKey, children2] of foreignChildrenByParent) {
435736
435766
  const parent = spansByKey.get(parentKey);
435737
435767
  if (!parent)
@@ -435746,6 +435776,8 @@ function normalizeLiveTrackedWrapperOverlap(atoms) {
435746
435776
  const firstChild = orderedChildren[0];
435747
435777
  if (firstChild.startOffset > parent.startOffset) {
435748
435778
  syntheticAtoms.push(makeSyntheticTrackedWrapperAtom(parent.closeAtom, firstChild.startOffset, 90, nextSequence++));
435779
+ } else {
435780
+ coveredParentEdges.add(parent.openAtom);
435749
435781
  }
435750
435782
  for (let index2 = 0;index2 < orderedChildren.length - 1; index2 += 1) {
435751
435783
  const current = orderedChildren[index2];
@@ -435758,11 +435790,11 @@ function normalizeLiveTrackedWrapperOverlap(atoms) {
435758
435790
  const lastChild = orderedChildren[orderedChildren.length - 1];
435759
435791
  if (lastChild.endOffset < parent.endOffset) {
435760
435792
  syntheticAtoms.push(makeSyntheticTrackedWrapperAtom(parent.openAtom, lastChild.endOffset, 110, nextSequence++));
435793
+ } else {
435794
+ coveredParentEdges.add(parent.closeAtom);
435761
435795
  }
435762
435796
  }
435763
- if (syntheticAtoms.length === 0)
435764
- return [...atoms];
435765
- return sortProjectedAtoms([...atoms, ...syntheticAtoms]);
435797
+ return sortProjectedAtoms([...atoms.filter((atom) => !coveredParentEdges.has(atom)), ...syntheticAtoms]);
435766
435798
  }
435767
435799
  function collectLiveTrackedWrapperSpans(atoms) {
435768
435800
  const spans = [];
@@ -448983,6 +449015,12 @@ async function openV2CollaborativeDocumentSession(options) {
448983
449015
  contentUnitIds: Array.from(canonical.contentUnitIds)
448984
449016
  });
448985
449017
  if (!finalized.committed) {
449018
+ if (finalized.classification === ROOM_CLASSIFICATION.v2Committed && options.runtime.validateLateJoin({
449019
+ compatibility: { supports: COLLAB_V2_ROOM_SCHEMA_VERSION },
449020
+ readiness: READINESS_CLASS.bodyEditable
449021
+ }).ok) {
449022
+ throw new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_ROOM_ALREADY_EXISTS, "another creator committed this v2 collaboration room during open; reopen with join", { rootId: options.runtime.rootId });
449023
+ }
448986
449024
  if (finalized.diagnostics.some((diagnostic2) => diagnostic2.code === COLLAB_V2_DIAGNOSTICS.COLLAB_V2_BOOTSTRAP_CLAIM_LOST)) {
448987
449025
  throw new CollabV2DiagnosticError(COLLAB_V2_DIAGNOSTICS.COLLAB_V2_ROOM_INITIALIZING, "another creator is initializing this v2 collaboration room", { rootId: options.runtime.rootId });
448988
449026
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/mcp",
3
- "version": "1.5.0-next.3",
3
+ "version": "1.5.0-next.5",
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.18.0-next.3",
27
+ "@superdoc/sdk": "2.18.0-next.5",
28
28
  "debug": "^4.4.3",
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "superdoc": "2.21.0-next.3",
33
- "@superdoc/docx-engine": "0.20.0-next.3",
32
+ "superdoc": "2.21.0-next.5",
33
+ "@superdoc/docx-engine": "0.20.0-next.5",
34
34
  "@superdoc/document-api": "0.1.0-alpha.0",
35
35
  "@types/bun": "^1.3.8",
36
36
  "@types/node": "22.19.2",