@markdy/mcp-server 1.3.1 → 1.3.3

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 +14 -7
  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
  ]);
@@ -1815,7 +1816,8 @@ function parse(source, opts = {}) {
1815
1816
  fps: 60,
1816
1817
  theme: "paper",
1817
1818
  explicitTheme: false,
1818
- direction: "LR"
1819
+ direction: "LR",
1820
+ explicitDirection: false
1819
1821
  };
1820
1822
  const styles = {};
1821
1823
  const nodes = {};
@@ -1916,10 +1918,11 @@ function parse(source, opts = {}) {
1916
1918
  meta.title = title;
1917
1919
  remainder = str.rest;
1918
1920
  }
1919
- 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);
1920
1922
  if (inlineLayout) {
1921
1923
  meta.direction = inlineLayout[1].toUpperCase();
1922
- remainder = remainder.replace(/\blayout\s+(LR|RL|TB|BT)\b/i, " ");
1924
+ meta.explicitDirection = true;
1925
+ remainder = remainder.replace(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i, " ");
1923
1926
  }
1924
1927
  const props = parseProps(remainder);
1925
1928
  for (const [k, v] of Object.entries(props)) {
@@ -1940,8 +1943,10 @@ function parse(source, opts = {}) {
1940
1943
  const val = String(v).toLowerCase();
1941
1944
  meta.theme = val;
1942
1945
  meta.explicitTheme = val !== "auto";
1943
- } else if (k === "direction" || k === "layout") meta.direction = String(v).toUpperCase();
1944
- else if (PLAYER_FLAT_KEY_SET.has(k)) {
1946
+ } else if (k === "direction" || k === "layout" || k === "rankdir") {
1947
+ meta.direction = String(v).toUpperCase();
1948
+ meta.explicitDirection = true;
1949
+ } else if (PLAYER_FLAT_KEY_SET.has(k)) {
1945
1950
  const error = applyPlayerSetting(meta.player ??= {}, "player", k, String(v));
1946
1951
  if (error) diagnostics.push({ severity: "warning", message: error, line: lineNo });
1947
1952
  } else if (k === "type") {
@@ -1950,8 +1955,9 @@ function parse(source, opts = {}) {
1950
1955
  diagnostics.push({ severity: "warning", message: `unknown diagram type '${v}'`, line: lineNo });
1951
1956
  } else {
1952
1957
  meta.type = t;
1953
- if (t === "flowchart" && !props.direction && !props.layout && !inlineLayout) {
1958
+ if (t === "flowchart" && !props.direction && !props.layout && !props.rankdir && !inlineLayout) {
1954
1959
  meta.direction = "TB";
1960
+ meta.explicitDirection = true;
1955
1961
  }
1956
1962
  }
1957
1963
  }
@@ -1978,6 +1984,7 @@ function parse(source, opts = {}) {
1978
1984
  }
1979
1985
  if (/^layout\s+(LR|RL|TB|BT)\b/i.test(line)) {
1980
1986
  meta.direction = line.split(/\s+/)[1].toUpperCase();
1987
+ meta.explicitDirection = true;
1981
1988
  i++;
1982
1989
  continue;
1983
1990
  }
@@ -2875,7 +2882,7 @@ function diagnoseMarkdyCode(code, options = {}) {
2875
2882
  });
2876
2883
  }
2877
2884
  }
2878
- const layoutMatch = trimmed.match(/\blayout\s*=?\s*(\w+)/i);
2885
+ const layoutMatch = trimmed.match(/\b(?:layout|direction|rankdir)\s*=?\s*(\w+)/i);
2879
2886
  if (layoutMatch) {
2880
2887
  const layoutVal = layoutMatch[1].toUpperCase();
2881
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.1",
3
+ "version": "1.3.3",
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/core": "1.3.1",
43
- "@markdy/compat": "1.3.1"
42
+ "@markdy/compat": "1.3.3",
43
+ "@markdy/core": "1.3.3"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.9.5",