@markdy/mcp-server 1.4.4 → 1.4.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 +34 -9
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1919,11 +1919,19 @@ function parse(source, opts = {}) {
1919
1919
  meta.title = title;
1920
1920
  remainder = str.rest;
1921
1921
  }
1922
- const inlineLayout = remainder.match(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i);
1922
+ const inlineLayout = remainder.match(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT|auto)\b/i);
1923
1923
  if (inlineLayout) {
1924
- meta.direction = inlineLayout[1].toUpperCase();
1925
- meta.explicitDirection = true;
1926
- remainder = remainder.replace(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i, " ");
1924
+ const val = inlineLayout[1].toUpperCase();
1925
+ if (val === "AUTO") {
1926
+ meta.direction = "LR";
1927
+ meta.explicitDirection = false;
1928
+ meta.layoutMode = "auto";
1929
+ } else {
1930
+ meta.direction = val;
1931
+ meta.explicitDirection = true;
1932
+ meta.layoutMode = "explicit";
1933
+ }
1934
+ remainder = remainder.replace(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT|auto)\b/i, " ");
1927
1935
  }
1928
1936
  const props = parseProps(remainder);
1929
1937
  for (const [k, v] of Object.entries(props)) {
@@ -1945,8 +1953,16 @@ function parse(source, opts = {}) {
1945
1953
  meta.theme = val;
1946
1954
  meta.explicitTheme = val !== "auto";
1947
1955
  } else if (k === "direction" || k === "layout" || k === "rankdir") {
1948
- meta.direction = String(v).toUpperCase();
1949
- meta.explicitDirection = true;
1956
+ const val = String(v).toUpperCase();
1957
+ if (val === "AUTO") {
1958
+ meta.direction = "LR";
1959
+ meta.explicitDirection = false;
1960
+ meta.layoutMode = "auto";
1961
+ } else {
1962
+ meta.direction = val;
1963
+ meta.explicitDirection = true;
1964
+ meta.layoutMode = "explicit";
1965
+ }
1950
1966
  } else if (PLAYER_FLAT_KEY_SET.has(k)) {
1951
1967
  const error = applyPlayerSetting(meta.player ??= {}, "player", k, String(v));
1952
1968
  if (error) diagnostics.push({ severity: "warning", message: error, line: lineNo });
@@ -1983,9 +1999,17 @@ function parse(source, opts = {}) {
1983
1999
  i++;
1984
2000
  continue;
1985
2001
  }
1986
- if (/^layout\s+(LR|RL|TB|BT)\b/i.test(line)) {
1987
- meta.direction = line.split(/\s+/)[1].toUpperCase();
1988
- meta.explicitDirection = true;
2002
+ if (/^layout\s+(LR|RL|TB|BT|auto)\b/i.test(line)) {
2003
+ const val = line.split(/\s+/)[1].toUpperCase();
2004
+ if (val === "AUTO") {
2005
+ meta.direction = "LR";
2006
+ meta.explicitDirection = false;
2007
+ meta.layoutMode = "auto";
2008
+ } else {
2009
+ meta.direction = val;
2010
+ meta.explicitDirection = true;
2011
+ meta.layoutMode = "explicit";
2012
+ }
1989
2013
  i++;
1990
2014
  continue;
1991
2015
  }
@@ -3694,6 +3718,7 @@ function getIntelliCodeCompletions(docText, cursorLine, cursorCol) {
3694
3718
  }
3695
3719
  if (/(layout\s+|direction\s*=\s*)\w*$/i.test(ctx.linePrefix)) {
3696
3720
  items.push(
3721
+ { label: "auto", insertText: "auto", kind: "layout", detail: "Responsive Auto (LR / TB)", documentation: "Automatically adapts layout orientation between horizontal (LR) and vertical (TB) based on container width.", boost: 11 },
3697
3722
  { label: "LR", insertText: "LR", kind: "layout", detail: "Left-to-Right", documentation: "Horizontal left-to-right system flow layout.", boost: 10 },
3698
3723
  { label: "TB", insertText: "TB", kind: "layout", detail: "Top-to-Bottom", documentation: "Vertical top-to-bottom hierarchy layout.", boost: 9 },
3699
3724
  { label: "RL", insertText: "RL", kind: "layout", detail: "Right-to-Left", documentation: "Right-to-left reverse topology layout.", boost: 5 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/mcp-server",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
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.4.4",
43
- "@markdy/core": "1.4.4"
42
+ "@markdy/compat": "1.4.5",
43
+ "@markdy/core": "1.4.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.9.5",