@markdy/mcp-server 1.4.16 → 1.4.18

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 +75 -9
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -670,6 +670,14 @@ var SCENE_KEYS = /* @__PURE__ */ new Set([
670
670
  "height",
671
671
  "fps",
672
672
  "theme",
673
+ "theme.light",
674
+ "theme.dark",
675
+ "theme_light",
676
+ "theme_dark",
677
+ "light_theme",
678
+ "dark_theme",
679
+ "default_themes",
680
+ "default_theme",
673
681
  "duration",
674
682
  "direction",
675
683
  "layout",
@@ -1119,6 +1127,36 @@ var ParseError = class extends Error {
1119
1127
  }
1120
1128
  };
1121
1129
  var FLOW_OP_RE = /(->|<-|~>|--|\.\.>|<->)/;
1130
+ function parseThemeSpecification(raw) {
1131
+ const trimmed = raw.trim();
1132
+ const lightMatch = trimmed.match(/(?:^|[\s,;])(?:light|light_theme|theme\.light)\s*[:=]\s*([a-zA-Z0-9_-]+)/i);
1133
+ const darkMatch = trimmed.match(/(?:^|[\s,;])(?:dark|dark_theme|theme\.dark)\s*[:=]\s*([a-zA-Z0-9_-]+)/i);
1134
+ if (lightMatch || darkMatch) {
1135
+ return {
1136
+ theme: "auto",
1137
+ explicitTheme: false,
1138
+ defaultThemes: {
1139
+ ...lightMatch ? { light: lightMatch[1].toLowerCase() } : {},
1140
+ ...darkMatch ? { dark: darkMatch[1].toLowerCase() } : {}
1141
+ }
1142
+ };
1143
+ }
1144
+ if (trimmed.includes("/")) {
1145
+ const parts = trimmed.split("/").map((s) => s.trim().toLowerCase());
1146
+ if (parts.length >= 2 && parts[0] && parts[1]) {
1147
+ return {
1148
+ theme: "auto",
1149
+ explicitTheme: false,
1150
+ defaultThemes: { light: parts[0], dark: parts[1] }
1151
+ };
1152
+ }
1153
+ }
1154
+ const lower = trimmed.toLowerCase();
1155
+ return {
1156
+ theme: lower,
1157
+ explicitTheme: lower !== "auto"
1158
+ };
1159
+ }
1122
1160
  function stripComment(line) {
1123
1161
  let inString = false;
1124
1162
  let escaped = false;
@@ -1928,9 +1966,21 @@ function parse(source, opts = {}) {
1928
1966
  meta.fps = Number(v);
1929
1967
  } else if (k === "duration") meta.duration = Number(v);
1930
1968
  else if (k === "theme") {
1931
- const val = String(v).toLowerCase();
1932
- meta.theme = val;
1933
- meta.explicitTheme = val !== "auto";
1969
+ const parsed = parseThemeSpecification(String(v));
1970
+ if (parsed.theme) meta.theme = parsed.theme;
1971
+ if (parsed.explicitTheme !== void 0) meta.explicitTheme = parsed.explicitTheme;
1972
+ if (parsed.defaultThemes) {
1973
+ meta.defaultThemes = { ...meta.defaultThemes, ...parsed.defaultThemes };
1974
+ }
1975
+ } else if (k === "theme.light" || k === "theme_light" || k === "light_theme") {
1976
+ meta.defaultThemes = { ...meta.defaultThemes, light: String(v).toLowerCase().trim() };
1977
+ } else if (k === "theme.dark" || k === "theme_dark" || k === "dark_theme") {
1978
+ meta.defaultThemes = { ...meta.defaultThemes, dark: String(v).toLowerCase().trim() };
1979
+ } else if (k === "default_themes" || k === "default_theme") {
1980
+ const parsed = parseThemeSpecification(String(v));
1981
+ if (parsed.defaultThemes) {
1982
+ meta.defaultThemes = { ...meta.defaultThemes, ...parsed.defaultThemes };
1983
+ }
1934
1984
  } else if (k === "direction" || k === "layout" || k === "rankdir") {
1935
1985
  const val = String(v).toUpperCase();
1936
1986
  if (val === "AUTO") {
@@ -1961,12 +2011,28 @@ function parse(source, opts = {}) {
1961
2011
  i++;
1962
2012
  continue;
1963
2013
  }
1964
- if (/^theme\s*[:=]?\s*([a-zA-Z0-9_-]+)/i.test(line)) {
1965
- const match = line.match(/^theme\s*[:=]?\s*([a-zA-Z0-9_-]+)/i);
1966
- if (match) {
1967
- const val = match[1].toLowerCase();
1968
- meta.theme = val;
1969
- meta.explicitTheme = val !== "auto";
2014
+ const themeDirectMatch = line.match(
2015
+ /^(?:(theme(?:\.(?:light|dark)|_(?:light|dark))?|default_themes?)|(light_theme|dark_theme))\s*[:=]?\s*(.+)$/i
2016
+ );
2017
+ if (themeDirectMatch) {
2018
+ const propKey = (themeDirectMatch[1] || themeDirectMatch[2]).toLowerCase();
2019
+ const rawVal = themeDirectMatch[3].trim();
2020
+ if (propKey === "theme.light" || propKey === "theme_light" || propKey === "light_theme") {
2021
+ meta.defaultThemes = { ...meta.defaultThemes, light: rawVal.toLowerCase() };
2022
+ } else if (propKey === "theme.dark" || propKey === "theme_dark" || propKey === "dark_theme") {
2023
+ meta.defaultThemes = { ...meta.defaultThemes, dark: rawVal.toLowerCase() };
2024
+ } else if (propKey === "default_themes" || propKey === "default_theme") {
2025
+ const parsed = parseThemeSpecification(rawVal);
2026
+ if (parsed.defaultThemes) {
2027
+ meta.defaultThemes = { ...meta.defaultThemes, ...parsed.defaultThemes };
2028
+ }
2029
+ } else {
2030
+ const parsed = parseThemeSpecification(rawVal);
2031
+ if (parsed.theme) meta.theme = parsed.theme;
2032
+ if (parsed.explicitTheme !== void 0) meta.explicitTheme = parsed.explicitTheme;
2033
+ if (parsed.defaultThemes) {
2034
+ meta.defaultThemes = { ...meta.defaultThemes, ...parsed.defaultThemes };
2035
+ }
1970
2036
  }
1971
2037
  i++;
1972
2038
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/mcp-server",
3
- "version": "1.4.16",
3
+ "version": "1.4.18",
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.16",
43
- "@markdy/core": "1.4.16"
42
+ "@markdy/core": "1.4.18",
43
+ "@markdy/compat": "1.4.18"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.9.5",