@superdoc-dev/mcp 0.3.0-next.77 → 0.3.0-next.79

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 +58 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -199842,7 +199842,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
199842
199842
  init_remark_gfm_BhnWr3yf_es();
199843
199843
  });
199844
199844
 
199845
- // ../../packages/superdoc/dist/chunks/src-DLNvZ7Yw.es.js
199845
+ // ../../packages/superdoc/dist/chunks/src-DnSeNxAx.es.js
199846
199846
  function deleteProps(obj, propOrProps) {
199847
199847
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
199848
199848
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -256616,7 +256616,7 @@ function mergeAdjacentRuns(runs2) {
256616
256616
  let current = runs2[0];
256617
256617
  for (let i4 = 1;i4 < runs2.length; i4++) {
256618
256618
  const next2 = runs2[i4];
256619
- if (isTextRun$3(current) && isTextRun$3(next2) && !current.token && !next2.token && current.pmStart != null && current.pmEnd != null && next2.pmStart != null && next2.pmEnd != null && current.pmEnd === next2.pmStart && current.fontFamily === next2.fontFamily && current.fontSize === next2.fontSize && current.bold === next2.bold && current.italic === next2.italic && current.underline === next2.underline && current.strike === next2.strike && current.color === next2.color && current.highlight === next2.highlight && (current.letterSpacing ?? 0) === (next2.letterSpacing ?? 0) && trackedChangesCompatible(current, next2) && dataAttrsCompatible(current, next2) && commentsCompatible(current, next2)) {
256619
+ if (isTextRun$3(current) && isTextRun$3(next2) && !current.token && !next2.token && current.pmStart != null && current.pmEnd != null && next2.pmStart != null && next2.pmEnd != null && current.pmEnd === next2.pmStart && current.fontFamily === next2.fontFamily && current.fontSize === next2.fontSize && current.bold === next2.bold && current.italic === next2.italic && current.underline === next2.underline && current.strike === next2.strike && current.color === next2.color && current.highlight === next2.highlight && (current.letterSpacing ?? 0) === (next2.letterSpacing ?? 0) && trackedChangesCompatible(current, next2) && dataAttrsCompatible(current, next2) && commentsCompatible(current, next2) && bidiCompatible(current, next2)) {
256620
256620
  const currText = current.text ?? "";
256621
256621
  const nextText = next2.text ?? "";
256622
256622
  current = {
@@ -282106,6 +282106,10 @@ menclose::after {
282106
282106
  if (runToken === "totalPageCount")
282107
282107
  return context.totalPages ? String(context.totalPages) : run2.text ?? "";
282108
282108
  return run2.text ?? "";
282109
+ }, RTL_DATE_LIKE_TOKEN_RE, RLM = "‏", normalizeRtlDateTokenForWordParity = (text5) => {
282110
+ if (!RTL_DATE_LIKE_TOKEN_RE.test(text5))
282111
+ return text5;
282112
+ return text5.replace(/[./-]/g, (separator) => `${RLM}${separator}${RLM}`);
282109
282113
  }, createDomPainter = (options) => {
282110
282114
  const painter = new DomPainter(options);
282111
282115
  return {
@@ -282597,7 +282601,8 @@ menclose::after {
282597
282601
  textRun.baselineShift != null ? textRun.baselineShift : "",
282598
282602
  textRun.token ?? "",
282599
282603
  textRun.trackedChange ? 1 : 0,
282600
- textRun.comments?.length ?? 0
282604
+ textRun.comments?.length ?? 0,
282605
+ textRun.bidi ? JSON.stringify(textRun.bidi) : ""
282601
282606
  ].join(",");
282602
282607
  }).join("|");
282603
282608
  const attrs = block.attrs;
@@ -282762,6 +282767,8 @@ menclose::after {
282762
282767
  hash$3 = hashString(hash$3, getRunBooleanProp(run2, "strike") ? "1" : "");
282763
282768
  hash$3 = hashString(hash$3, getRunStringProp(run2, "vertAlign"));
282764
282769
  hash$3 = hashNumber(hash$3, getRunNumberProp(run2, "baselineShift"));
282770
+ const bidi = run2.bidi;
282771
+ hash$3 = hashString(hash$3, bidi ? JSON.stringify(bidi) : "");
282765
282772
  }
282766
282773
  }
282767
282774
  }
@@ -283264,6 +283271,7 @@ menclose::after {
283264
283271
  const fontFamily = "fontFamily" in run2 ? run2.fontFamily : undefined;
283265
283272
  const highlight = "highlight" in run2 ? run2.highlight : undefined;
283266
283273
  const link2 = "link" in run2 ? run2.link : undefined;
283274
+ const bidi = "bidi" in run2 ? run2.bidi : undefined;
283267
283275
  return [
283268
283276
  bold ? "b" : "",
283269
283277
  italic ? "i" : "",
@@ -283273,7 +283281,8 @@ menclose::after {
283273
283281
  fontSize !== undefined ? `fs:${fontSize}` : "",
283274
283282
  fontFamily ? `ff:${fontFamily}` : "",
283275
283283
  highlight ? `hl:${highlight}` : "",
283276
- link2 ? `ln:${JSON.stringify(link2)}` : ""
283284
+ link2 ? `ln:${JSON.stringify(link2)}` : "",
283285
+ bidi ? `bd:${JSON.stringify(bidi)}` : ""
283277
283286
  ].join("");
283278
283287
  }, MAX_CACHE_SIZE$1 = 1e4, BYTES_PER_ENTRY_ESTIMATE = 5000, hashParagraphFrame = (frame) => {
283279
283288
  const parts = [];
@@ -288401,6 +288410,14 @@ menclose::after {
288401
288410
  if (aKeys[i4] !== bKeys[i4])
288402
288411
  return false;
288403
288412
  return true;
288413
+ }, bidiCompatible = (a2, b$1) => {
288414
+ const aBidi = a2.bidi;
288415
+ const bBidi = b$1.bidi;
288416
+ if (!aBidi && !bBidi)
288417
+ return true;
288418
+ if (!aBidi || !bBidi)
288419
+ return false;
288420
+ return aBidi.rtl === bBidi.rtl && aBidi.embedding === bBidi.embedding && aBidi.override === bBidi.override;
288404
288421
  }, toTrackChangeAttrs = (value) => {
288405
288422
  if (!value || typeof value !== "object")
288406
288423
  return;
@@ -293434,7 +293451,7 @@ menclose::after {
293434
293451
  return;
293435
293452
  console.log(...args$1);
293436
293453
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
293437
- var init_src_DLNvZ7Yw_es = __esm(() => {
293454
+ var init_src_DnSeNxAx_es = __esm(() => {
293438
293455
  init_rolldown_runtime_Bg48TavK_es();
293439
293456
  init_SuperConverter_BInxZk0I_es();
293440
293457
  init_jszip_C49i9kUs_es();
@@ -322987,7 +323004,9 @@ function print() { __p += __j.call(arguments, '') }
322987
323004
  const isActiveLink = !!(linkData && !linkData.blocked && linkData.href);
322988
323005
  const elem = isActiveLink ? this.doc.createElement("a") : this.doc.createElement("span");
322989
323006
  const text5 = resolveRunText(run2, context);
322990
- this.setTextContentWithFormattingSpaceMarks(elem, text5);
323007
+ const textRun = run2;
323008
+ const effectiveText = textRun.bidi?.rtl === true && typeof text5 === "string" ? normalizeRtlDateTokenForWordParity(text5) : text5;
323009
+ this.setTextContentWithFormattingSpaceMarks(elem, effectiveText);
322991
323010
  if (linkData?.dataset)
322992
323011
  applyLinkDataset(elem, linkData.dataset);
322993
323012
  if (linkData?.blocked) {
@@ -323002,7 +323021,11 @@ function print() { __p += __j.call(arguments, '') }
323002
323021
  this.pendingTooltips.set(elem, linkData.tooltip);
323003
323022
  }
323004
323023
  applyRunStyles(elem, run2, isActiveLink);
323005
- const commentAnnotations = run2.comments;
323024
+ if (textRun.bidi?.rtl === true)
323025
+ elem.setAttribute("dir", "rtl");
323026
+ else if (typeof textRun.text === "string" && RTL_DATE_LIKE_TOKEN_RE.test(textRun.text))
323027
+ elem.setAttribute("dir", "ltr");
323028
+ const commentAnnotations = textRun.comments;
323006
323029
  if (!!commentAnnotations?.length) {
323007
323030
  elem.dataset.commentIds = commentAnnotations.map((c) => c.commentId).join(",");
323008
323031
  if (commentAnnotations.some((c) => c.internal))
@@ -323464,7 +323487,8 @@ function print() { __p += __j.call(arguments, '') }
323464
323487
  sdt: run2.sdt ?? null,
323465
323488
  link: run2.link ?? null,
323466
323489
  comments: run2.comments ?? null,
323467
- dataAttrs: stableDataAttrs(run2.dataAttrs) ?? null
323490
+ dataAttrs: stableDataAttrs(run2.dataAttrs) ?? null,
323491
+ bidi: run2.bidi ?? null
323468
323492
  });
323469
323493
  const isWhitespaceOnly = (text5) => {
323470
323494
  if (text5.length === 0)
@@ -324112,6 +324136,7 @@ function print() { __p += __j.call(arguments, '') }
324112
324136
  "path(",
324113
324137
  "rect("
324114
324138
  ];
324139
+ RTL_DATE_LIKE_TOKEN_RE = /^-?\d+(?:[./-]\d+)+$/;
324115
324140
  CLIP_PATH_PREFIXES = [
324116
324141
  "inset(",
324117
324142
  "polygon(",
@@ -331495,7 +331520,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
331495
331520
 
331496
331521
  // ../../packages/superdoc/dist/super-editor.es.js
331497
331522
  var init_super_editor_es = __esm(() => {
331498
- init_src_DLNvZ7Yw_es();
331523
+ init_src_DnSeNxAx_es();
331499
331524
  init_SuperConverter_BInxZk0I_es();
331500
331525
  init_jszip_C49i9kUs_es();
331501
331526
  init_xml_js_CqGKpaft_es();
@@ -469957,6 +469982,28 @@ function dispatchIntentTool(toolName, args3, execute) {
469957
469982
  }
469958
469983
  }
469959
469984
 
469985
+ // src/tools/param-renames.ts
469986
+ function applyParamRenames(opId, input2) {
469987
+ const renames = PARAM_RENAMES[opId];
469988
+ if (!renames)
469989
+ return input2;
469990
+ const renamed = {};
469991
+ for (const [key3, value] of Object.entries(input2)) {
469992
+ renamed[renames[key3] ?? key3] = value;
469993
+ }
469994
+ return renamed;
469995
+ }
469996
+ var PARAM_RENAMES;
469997
+ var init_param_renames = __esm(() => {
469998
+ PARAM_RENAMES = {
469999
+ getNodeById: { id: "nodeId" },
470000
+ "comments.create": { parentId: "parentCommentId" },
470001
+ "comments.patch": { id: "commentId" },
470002
+ "comments.delete": { id: "commentId" },
470003
+ "comments.get": { id: "commentId" }
470004
+ };
470005
+ });
470006
+
469960
470007
  // src/tools/intent.ts
469961
470008
  function jsonSchemaPropertyToZod(prop) {
469962
470009
  const desc = prop.description;
@@ -470010,7 +470057,7 @@ function buildZodSchema(tool) {
470010
470057
  }
470011
470058
  function executeOperation(api2, operationId, input2) {
470012
470059
  const opId = operationId.startsWith("doc.") ? operationId.slice(4) : operationId;
470013
- return api2.invoke({ operationId: opId, input: input2 });
470060
+ return api2.invoke({ operationId: opId, input: applyParamRenames(opId, input2) });
470014
470061
  }
470015
470062
  function registerIntentTools(server, sessions) {
470016
470063
  const catalog = MCP_TOOL_CATALOG;
@@ -470045,6 +470092,7 @@ function registerIntentTools(server, sessions) {
470045
470092
  var init_intent = __esm(() => {
470046
470093
  init_zod();
470047
470094
  init_catalog();
470095
+ init_param_renames();
470048
470096
  });
470049
470097
 
470050
470098
  // src/tools/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.3.0-next.77",
3
+ "version": "0.3.0-next.79",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"