@presentation-md/mcp-server 1.32.7 → 1.32.9
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildThemesDiscoveryList, discoverInstalledThemes } from "@presentation-md/core";
|
|
2
2
|
import { getBundledThemesDir } from "@presentation-md/render";
|
|
3
3
|
export const listThemesTool = {
|
|
4
4
|
name: "list_themes",
|
|
@@ -33,102 +33,25 @@ export const listThemesTool = {
|
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
handler: async (input) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const browse = browseRaw && isThemeBrowseFilterId(browseRaw) ? browseRaw : "";
|
|
43
|
-
const browseInvalid = Boolean(browseRaw) && !browse;
|
|
44
|
-
const [discovered, shortlistsDoc, selectionIndex] = await Promise.all([
|
|
45
|
-
discoverInstalledThemes({
|
|
46
|
-
bundledThemesDir: getBundledThemesDir(),
|
|
47
|
-
nodeModulesRoot: process.cwd(),
|
|
48
|
-
}),
|
|
49
|
-
loadThemeShortlists(),
|
|
50
|
-
loadThemeSelectionIndex(),
|
|
51
|
-
]);
|
|
52
|
-
const shortlists = sortShortlistsForDiscovery(shortlistsDoc.shortlists);
|
|
53
|
-
const selectionByName = new Map(selectionIndex.themes.map((t) => [t.name, t]));
|
|
54
|
-
const matchedShortlist = shortlistId ? findShortlist(shortlistsDoc, shortlistId) : undefined;
|
|
55
|
-
let allowNames = null;
|
|
56
|
-
if (matchedShortlist) {
|
|
57
|
-
allowNames = new Set(matchedShortlist.themes);
|
|
58
|
-
}
|
|
59
|
-
let themes = discovered.map((d) => {
|
|
60
|
-
const sel = selectionByName.get(d.name);
|
|
61
|
-
const links = themeDiscoveryLinks(d.name, sel?.gallery);
|
|
62
|
-
return {
|
|
36
|
+
const discovered = await discoverInstalledThemes({
|
|
37
|
+
bundledThemesDir: getBundledThemesDir(),
|
|
38
|
+
nodeModulesRoot: process.cwd(),
|
|
39
|
+
});
|
|
40
|
+
return buildThemesDiscoveryList({
|
|
41
|
+
discovered: discovered.map((d) => ({
|
|
63
42
|
name: d.name,
|
|
64
43
|
version: d.version,
|
|
44
|
+
source: d.source,
|
|
65
45
|
description: d.manifest.description,
|
|
66
46
|
vibe: d.manifest.vibe,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...links,
|
|
75
|
-
};
|
|
47
|
+
})),
|
|
48
|
+
shortlist: typeof input["shortlist"] === "string" ? input["shortlist"] : undefined,
|
|
49
|
+
browse: typeof input["browse"] === "string" ? input["browse"] : undefined,
|
|
50
|
+
mood: typeof input["mood"] === "string" ? input["mood"] : undefined,
|
|
51
|
+
query: typeof input["query"] === "string" ? input["query"] : undefined,
|
|
52
|
+
includeShortlists: input["include_shortlists"] === true,
|
|
53
|
+
includeBrowseFilters: input["include_browse_filters"] === true,
|
|
76
54
|
});
|
|
77
|
-
if (allowNames) {
|
|
78
|
-
themes = themes.filter((t) => allowNames.has(t.name));
|
|
79
|
-
}
|
|
80
|
-
if (browse && browse !== "all") {
|
|
81
|
-
themes = themes.filter((t) => themeMatchesBrowseFilter({
|
|
82
|
-
scheme: t.scheme,
|
|
83
|
-
mood: t.mood,
|
|
84
|
-
formality: t.formality,
|
|
85
|
-
}, browse, t.name));
|
|
86
|
-
}
|
|
87
|
-
if (mood) {
|
|
88
|
-
themes = themes.filter((t) => themeMatchesMood({ name: t.name, mood: t.mood }, mood));
|
|
89
|
-
}
|
|
90
|
-
if (query) {
|
|
91
|
-
themes = themes.filter((t) => themeMatchesQuery({
|
|
92
|
-
name: t.name,
|
|
93
|
-
vibe: t.vibe,
|
|
94
|
-
description: t.description,
|
|
95
|
-
aliases: t.aliases,
|
|
96
|
-
best_for: t.best_for,
|
|
97
|
-
mood: t.mood,
|
|
98
|
-
}, query));
|
|
99
|
-
}
|
|
100
|
-
const suggested_preview = pickDiscoveryPreviewTrio(themes.map((t) => ({
|
|
101
|
-
name: t.name,
|
|
102
|
-
scheme: t.scheme,
|
|
103
|
-
mood: t.mood,
|
|
104
|
-
formality: t.formality,
|
|
105
|
-
})));
|
|
106
|
-
const result = {
|
|
107
|
-
themes,
|
|
108
|
-
discovery_hint: "Theme Discovery: offer browse chips (list_themes include_browse_filters) or a shortlist (prefer popular:true), use suggested_preview (safe/bold/wildcard) or open studio_url / preview_url, then preview_themes with those 3 names (layouts auto; inline PNGs + studio_share_url for the exact bake — vision show-don't-tell). Lock meta.theme before generating the full deck.",
|
|
109
|
-
};
|
|
110
|
-
if (suggested_preview) {
|
|
111
|
-
result.suggested_preview = suggested_preview;
|
|
112
|
-
}
|
|
113
|
-
if (browse) {
|
|
114
|
-
result.browse = browse;
|
|
115
|
-
}
|
|
116
|
-
else if (browseInvalid) {
|
|
117
|
-
result.browse_error = `Unknown browse chip "${browseRaw}". Call list_themes with include_browse_filters:true for ids (popular/dark/editorial/neon/…).`;
|
|
118
|
-
}
|
|
119
|
-
if (matchedShortlist) {
|
|
120
|
-
result.shortlist = matchedShortlist;
|
|
121
|
-
}
|
|
122
|
-
else if (shortlistId) {
|
|
123
|
-
result.shortlist_error = `Unknown shortlist id "${shortlistId}". Call list_themes with include_shortlists:true to see ids.`;
|
|
124
|
-
}
|
|
125
|
-
if (includeShortlists) {
|
|
126
|
-
result.shortlists = shortlists;
|
|
127
|
-
}
|
|
128
|
-
if (includeBrowseFilters || browseInvalid) {
|
|
129
|
-
result.browse_filters = THEME_BROWSE_FILTERS;
|
|
130
|
-
}
|
|
131
|
-
return result;
|
|
132
55
|
},
|
|
133
56
|
};
|
|
134
57
|
//# sourceMappingURL=list-themes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-themes.js","sourceRoot":"","sources":["../../src/tools/list-themes.ts"],"names":[],"mapp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AAM;gBAChB,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW;gBACnC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI;aACtB,CAAC,CAAC;YACH,SAAS,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YAClF,MAAM,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;YACzE,IAAI,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;YACnE,KAAK,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;YACtE,iBAAiB,EAAE,KAAK,CAAC,oBAAoB,CAAC,KAAK,IAAI;YACvD,oBAAoB,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,IAAI;SAC/D,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@presentation-md/mcp-server",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.9",
|
|
4
4
|
"description": "MCP server exposing all 13 presentation-md tools (render/export/audit/judge/scaffold/share/import/preview) to any MCP-compatible AI agent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
16
16
|
"zod": "^3.23.0",
|
|
17
|
-
"@presentation-md/core": "1.
|
|
18
|
-
"@presentation-md/create-theme": "1.1.
|
|
19
|
-
"@presentation-md/export": "^1.23.
|
|
20
|
-
"@presentation-md/render": "1.
|
|
17
|
+
"@presentation-md/core": "1.31.0",
|
|
18
|
+
"@presentation-md/create-theme": "1.1.33",
|
|
19
|
+
"@presentation-md/export": "^1.23.32",
|
|
20
|
+
"@presentation-md/render": "1.17.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^20.0.0",
|