@markdy/mcp-server 1.3.2 → 1.4.0

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 +7 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -694,6 +694,7 @@ var SCENE_KEYS = /* @__PURE__ */ new Set([
694
694
  "duration",
695
695
  "direction",
696
696
  "layout",
697
+ "rankdir",
697
698
  "type",
698
699
  ...PLAYER_FLAT_KEYS
699
700
  ]);
@@ -1917,11 +1918,11 @@ function parse(source, opts = {}) {
1917
1918
  meta.title = title;
1918
1919
  remainder = str.rest;
1919
1920
  }
1920
- const inlineLayout = remainder.match(/\blayout\s+(LR|RL|TB|BT)\b/i);
1921
+ const inlineLayout = remainder.match(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i);
1921
1922
  if (inlineLayout) {
1922
1923
  meta.direction = inlineLayout[1].toUpperCase();
1923
1924
  meta.explicitDirection = true;
1924
- remainder = remainder.replace(/\blayout\s+(LR|RL|TB|BT)\b/i, " ");
1925
+ remainder = remainder.replace(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i, " ");
1925
1926
  }
1926
1927
  const props = parseProps(remainder);
1927
1928
  for (const [k, v] of Object.entries(props)) {
@@ -1942,7 +1943,7 @@ function parse(source, opts = {}) {
1942
1943
  const val = String(v).toLowerCase();
1943
1944
  meta.theme = val;
1944
1945
  meta.explicitTheme = val !== "auto";
1945
- } else if (k === "direction" || k === "layout") {
1946
+ } else if (k === "direction" || k === "layout" || k === "rankdir") {
1946
1947
  meta.direction = String(v).toUpperCase();
1947
1948
  meta.explicitDirection = true;
1948
1949
  } else if (PLAYER_FLAT_KEY_SET.has(k)) {
@@ -1954,8 +1955,9 @@ function parse(source, opts = {}) {
1954
1955
  diagnostics.push({ severity: "warning", message: `unknown diagram type '${v}'`, line: lineNo });
1955
1956
  } else {
1956
1957
  meta.type = t;
1957
- if (t === "flowchart" && !props.direction && !props.layout && !inlineLayout) {
1958
+ if ((t === "flowchart" || t === "nested") && !props.direction && !props.layout && !props.rankdir && !inlineLayout) {
1958
1959
  meta.direction = "TB";
1960
+ meta.explicitDirection = true;
1959
1961
  }
1960
1962
  }
1961
1963
  }
@@ -2880,7 +2882,7 @@ function diagnoseMarkdyCode(code, options = {}) {
2880
2882
  });
2881
2883
  }
2882
2884
  }
2883
- const layoutMatch = trimmed.match(/\blayout\s*=?\s*(\w+)/i);
2885
+ const layoutMatch = trimmed.match(/\b(?:layout|direction|rankdir)\s*=?\s*(\w+)/i);
2884
2886
  if (layoutMatch) {
2885
2887
  const layoutVal = layoutMatch[1].toUpperCase();
2886
2888
  if (!LAYOUT_DIRECTIONS.includes(layoutVal)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/mcp-server",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Model Context Protocol server for Markdy diagram validation, transpilation, and generation.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.6.1",
42
- "@markdy/compat": "1.3.2",
43
- "@markdy/core": "1.3.2"
42
+ "@markdy/compat": "1.4.0",
43
+ "@markdy/core": "1.4.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.9.5",