@presentation-md/mcp-server 1.2.0 → 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.
- package/README.md +5 -3
- package/dist/lib/html-metrics.d.ts +14 -0
- package/dist/lib/html-metrics.js +389 -0
- package/dist/lib/html-metrics.js.map +1 -0
- package/dist/lib/resolve-themes.d.ts +4 -0
- package/dist/lib/resolve-themes.js +30 -0
- package/dist/lib/resolve-themes.js.map +1 -0
- package/dist/lib/screenshot-slides.d.ts +27 -0
- package/dist/lib/screenshot-slides.js +204 -0
- package/dist/lib/screenshot-slides.js.map +1 -0
- package/dist/tools/audit-deck.js +28 -1
- package/dist/tools/audit-deck.js.map +1 -1
- package/dist/tools/export-deck.js +4 -2
- package/dist/tools/export-deck.js.map +1 -1
- package/dist/tools/generate-deck-prompt.js +3 -3
- package/dist/tools/generate-deck-prompt.js.map +1 -1
- package/dist/tools/judge-deck.js +343 -26
- package/dist/tools/judge-deck.js.map +1 -1
- package/dist/tools/preview-themes.js +122 -72
- package/dist/tools/preview-themes.js.map +1 -1
- package/dist/tools/render-deck.js +3 -2
- package/dist/tools/render-deck.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import { renderDeck
|
|
3
|
+
import { renderDeck } from "@presentation-md/render";
|
|
4
|
+
import { resolveThemesDir } from "../lib/resolve-themes.js";
|
|
4
5
|
const DEFAULT_PREVIEW_DIR = ".presentation-md/theme-previews";
|
|
5
6
|
function titlePreviewDeck(title, theme, company) {
|
|
6
7
|
return JSON.stringify({
|
|
@@ -18,83 +19,132 @@ function titlePreviewDeck(title, theme, company) {
|
|
|
18
19
|
}
|
|
19
20
|
/** Canonical multi-layout bake so agents can judge comparison/stats/quote craft — not title alone. */
|
|
20
21
|
function layoutsPreviewDeck(title, theme, company) {
|
|
22
|
+
const isWrap = theme === "kinetic-wrapped";
|
|
23
|
+
const slides = [
|
|
24
|
+
{
|
|
25
|
+
layout: "title",
|
|
26
|
+
eyebrow: theme.replace(/-/g, " "),
|
|
27
|
+
heading: title,
|
|
28
|
+
lead: "Multi-layout craft preview — title, hero, bento, comparison, ranked bars, stats, quote, code, closing.",
|
|
29
|
+
...(isWrap ? { tone: "lime" } : {}),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
layout: "image-hero",
|
|
33
|
+
eyebrow: "Visual beat",
|
|
34
|
+
heading: "Show the product, place, or atmosphere.",
|
|
35
|
+
lead: "Full-bleed craft that still exports to PPTX.",
|
|
36
|
+
image: "data:image/svg+xml," +
|
|
37
|
+
encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="900" viewBox="0 0 1600 900"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop stop-color="#0B1220"/><stop offset="1" stop-color="#FF3B1F"/></linearGradient></defs><rect width="1600" height="900" fill="url(#g)"/><circle cx="1180" cy="280" r="180" fill="#0D9488" opacity=".35"/></svg>`),
|
|
38
|
+
imageAlt: "Abstract craft field",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
layout: "feature-grid",
|
|
42
|
+
eyebrow: "Capabilities",
|
|
43
|
+
heading: "Five moves that matter",
|
|
44
|
+
columns: "bento",
|
|
45
|
+
cards: [
|
|
46
|
+
{ icon: "fa-solid fa-bolt", title: "Fast path", body: "Ship the decisive slide without redesigning chrome." },
|
|
47
|
+
{ icon: "fa-solid fa-layer-group", title: "Layered craft", body: "Surfaces stay out of the way of body layouts." },
|
|
48
|
+
{ icon: "fa-solid fa-eye", title: "Show, don't tell", body: "Judge the vibe across layouts before you lock a theme." },
|
|
49
|
+
{ icon: "fa-solid fa-chart-simple", title: "Native charts", body: "SVG in HTML, editable in PPTX." },
|
|
50
|
+
{ icon: "fa-solid fa-share-nodes", title: "Share frame", body: "Designed to leave the deck." },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
layout: "two-column",
|
|
55
|
+
eyebrow: "Asymmetry",
|
|
56
|
+
heading: "Weight the copy when the story needs it.",
|
|
57
|
+
body: "Ratio and reverse keep media and copy in tension — not a default 50/50 split.",
|
|
58
|
+
aside: "2:1 craft proof",
|
|
59
|
+
ratio: "2-1",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
layout: "comparison",
|
|
63
|
+
eyebrow: "Before / After",
|
|
64
|
+
heading: "Discovery that survives the second slide.",
|
|
65
|
+
leftLabel: "Title only",
|
|
66
|
+
left: "Pretty cover.\nUnknown body craft.\nGuess and regenerate.",
|
|
67
|
+
rightLabel: "Multi-layout",
|
|
68
|
+
right: "See cards, stats, code.\nCatch contrast bugs early.\nLock the theme with evidence.",
|
|
69
|
+
emphasis: "right",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
layout: "ranked-list",
|
|
73
|
+
eyebrow: "Ranking",
|
|
74
|
+
heading: "Bars that stay editable",
|
|
75
|
+
lead: "Prefer ranked-list over custom-html for top-N craft.",
|
|
76
|
+
items: [
|
|
77
|
+
{ label: "Primary beat", value: "88%", widthPct: 88 },
|
|
78
|
+
{ label: "Secondary", value: "58%", widthPct: 58 },
|
|
79
|
+
{ label: "Tertiary", value: "34%", widthPct: 34 },
|
|
80
|
+
],
|
|
81
|
+
...(isWrap ? { tone: "magenta" } : {}),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
layout: "stat-row",
|
|
85
|
+
eyebrow: "Proof",
|
|
86
|
+
heading: isWrap ? "Mega number energy" : "Numbers that read at billboard scale",
|
|
87
|
+
...(isWrap
|
|
88
|
+
? {
|
|
89
|
+
variant: "hero",
|
|
90
|
+
tone: "orange",
|
|
91
|
+
lead: "One claim per frame. Built to screenshot.",
|
|
92
|
+
stats: [
|
|
93
|
+
{ value: "287", label: "Sessions this year" },
|
|
94
|
+
{ value: "5.5×", label: "per week" },
|
|
95
|
+
{ value: "+34%", label: "vs last year" },
|
|
96
|
+
],
|
|
97
|
+
}
|
|
98
|
+
: {
|
|
99
|
+
stats: [
|
|
100
|
+
{ value: "15", label: "Schema layouts" },
|
|
101
|
+
{ value: "75", label: "Theme surfaces" },
|
|
102
|
+
{ value: "1", label: "JSON field to swap vibe" },
|
|
103
|
+
],
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
layout: "chart",
|
|
108
|
+
eyebrow: "Data viz",
|
|
109
|
+
heading: "Charts stay on-palette.",
|
|
110
|
+
chartType: "bar",
|
|
111
|
+
categories: ["Q1", "Q2", "Q3", "Q4"],
|
|
112
|
+
series: [{ name: "Signal", values: [12, 19, 28, 41] }],
|
|
113
|
+
showLegend: false,
|
|
114
|
+
showValues: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
layout: "quote",
|
|
118
|
+
quote: "If the second slide looks generic, the theme isn't ready.",
|
|
119
|
+
by: "presentation-md craft bar",
|
|
120
|
+
...(isWrap ? { tone: "cyan" } : {}),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
layout: "code",
|
|
124
|
+
eyebrow: "Snippet",
|
|
125
|
+
heading: "Dev decks get a real code surface",
|
|
126
|
+
filename: "preview.ts",
|
|
127
|
+
language: "ts",
|
|
128
|
+
code: `const deck = {\n type: "deck",\n meta: { theme: "${theme}", title: "${title.replace(/"/g, '\\"')}" },\n slides: [{ layout: "code", code: "…" }],\n};`,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
layout: "closing",
|
|
132
|
+
eyebrow: "Next",
|
|
133
|
+
heading: "Pick this vibe — or preview another.",
|
|
134
|
+
lead: "Set meta.theme and generate the full deck.",
|
|
135
|
+
cta: { label: "Lock theme", href: "#" },
|
|
136
|
+
...(isWrap ? { tone: "lime" } : {}),
|
|
137
|
+
},
|
|
138
|
+
];
|
|
21
139
|
return JSON.stringify({
|
|
22
140
|
type: "deck",
|
|
23
141
|
meta: { title, company: company ?? title, theme },
|
|
24
|
-
slides
|
|
25
|
-
{
|
|
26
|
-
layout: "title",
|
|
27
|
-
eyebrow: theme.replace(/-/g, " "),
|
|
28
|
-
heading: title,
|
|
29
|
-
lead: "Multi-layout craft preview — title, grid, comparison, stats, quote, code, closing.",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
layout: "feature-grid",
|
|
33
|
-
eyebrow: "Capabilities",
|
|
34
|
-
heading: "Three moves that matter",
|
|
35
|
-
columns: 3,
|
|
36
|
-
cards: [
|
|
37
|
-
{ icon: "fa-solid fa-bolt", title: "Fast path", body: "Ship the decisive slide without redesigning chrome." },
|
|
38
|
-
{ icon: "fa-solid fa-layer-group", title: "Layered craft", body: "Surfaces stay out of the way of body layouts." },
|
|
39
|
-
{ icon: "fa-solid fa-eye", title: "Show, don't tell", body: "Judge the vibe across layouts before you lock a theme." },
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
layout: "comparison",
|
|
44
|
-
eyebrow: "Before / After",
|
|
45
|
-
heading: "Discovery that survives the second slide.",
|
|
46
|
-
leftLabel: "Title only",
|
|
47
|
-
left: "Pretty cover.\nUnknown body craft.\nGuess and regenerate.",
|
|
48
|
-
rightLabel: "Multi-layout",
|
|
49
|
-
right: "See cards, stats, code.\nCatch contrast bugs early.\nLock the theme with evidence.",
|
|
50
|
-
emphasis: "right",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
layout: "stat-row",
|
|
54
|
-
eyebrow: "Proof",
|
|
55
|
-
heading: "Numbers that read at billboard scale",
|
|
56
|
-
stats: [
|
|
57
|
-
{ value: "14", label: "Schema layouts" },
|
|
58
|
-
{ value: "75", label: "Theme surfaces" },
|
|
59
|
-
{ value: "1", label: "JSON field to swap vibe" },
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
layout: "chart",
|
|
64
|
-
eyebrow: "Data viz",
|
|
65
|
-
heading: "Charts stay on-palette.",
|
|
66
|
-
chartType: "bar",
|
|
67
|
-
categories: ["Q1", "Q2", "Q3", "Q4"],
|
|
68
|
-
series: [{ name: "Signal", values: [12, 19, 28, 41] }],
|
|
69
|
-
showLegend: false,
|
|
70
|
-
showValues: true,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
layout: "quote",
|
|
74
|
-
quote: "If the second slide looks generic, the theme isn't ready.",
|
|
75
|
-
by: "presentation-md craft bar",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
layout: "code",
|
|
79
|
-
eyebrow: "Snippet",
|
|
80
|
-
heading: "Dev decks get a real code surface",
|
|
81
|
-
filename: "preview.ts",
|
|
82
|
-
language: "ts",
|
|
83
|
-
code: `const deck = {\n type: "deck",\n meta: { theme: "${theme}", title: "${title.replace(/"/g, '\\"')}" },\n slides: [{ layout: "code", code: "…" }],\n};`,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
layout: "closing",
|
|
87
|
-
eyebrow: "Next",
|
|
88
|
-
heading: "Pick this vibe — or preview another.",
|
|
89
|
-
lead: "Set meta.theme and generate the full deck.",
|
|
90
|
-
cta: { label: "Lock theme", href: "#" },
|
|
91
|
-
},
|
|
92
|
-
],
|
|
142
|
+
slides,
|
|
93
143
|
});
|
|
94
144
|
}
|
|
95
145
|
export const previewThemesTool = {
|
|
96
146
|
name: "preview_themes",
|
|
97
|
-
description: "Render 1–3 theme preview HTML files for visual discovery (show-don't-tell). Default mode is a title slide; pass mode=\"layouts\" for a multi-slide craft preview (title,
|
|
147
|
+
description: "Render 1–3 theme preview HTML files for visual discovery (show-don't-tell). Default mode is a title slide; pass mode=\"layouts\" for a multi-slide craft preview (title, image-hero, bento, two-column, comparison, ranked-list, stat-row, quote, code, closing). kinetic-wrapped previews inject tone + hero mega-stat.",
|
|
98
148
|
inputSchema: {
|
|
99
149
|
type: "object",
|
|
100
150
|
properties: {
|
|
@@ -137,7 +187,7 @@ export const previewThemesTool = {
|
|
|
137
187
|
const deckJson = mode === "layouts"
|
|
138
188
|
? layoutsPreviewDeck(title, theme, company)
|
|
139
189
|
: titlePreviewDeck(title, theme, company);
|
|
140
|
-
const html = await renderDeck(deckJson,
|
|
190
|
+
const html = await renderDeck(deckJson, resolveThemesDir());
|
|
141
191
|
const filename = mode === "layouts" ? `${theme}-layouts-preview.html` : `${theme}-preview.html`;
|
|
142
192
|
const path = join(outputDir, filename);
|
|
143
193
|
await writeFile(path, html, "utf-8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-themes.js","sourceRoot":"","sources":["../../src/tools/preview-themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"preview-themes.js","sourceRoot":"","sources":["../../src/tools/preview-themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,mBAAmB,GAAG,iCAAiC,CAAC;AAI9D,SAAS,gBAAgB,CAAC,KAAa,EAAE,KAAa,EAAE,OAAgB;IACtE,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,EAAE;QACjD,MAAM,EAAE;YACN;gBACE,MAAM,EAAE,OAAO;gBACf,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;gBACjC,OAAO,EAAE,KAAK;gBACd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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,QAAQ;YACR,IAAI;YACJ,UAAU,EAAE,SAAS;YACrB,WAAW,EACT,IAAI,KAAK,SAAS;gBAChB,CAAC,CAAC,iLAAiL;gBACnL,CAAC,CAAC,qMAAqM;SAC5M,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { writeFile } from "node:fs/promises";
|
|
2
|
-
import { renderDeck
|
|
2
|
+
import { renderDeck } from "@presentation-md/render";
|
|
3
|
+
import { resolveThemesDir } from "../lib/resolve-themes.js";
|
|
3
4
|
export const renderDeckTool = {
|
|
4
5
|
name: "render_deck",
|
|
5
6
|
description: "Render a presentation-md deck JSON spec to a self-contained HTML slide deck. Returns the HTML string and optionally writes to a file.",
|
|
@@ -30,7 +31,7 @@ export const renderDeckTool = {
|
|
|
30
31
|
parsed["meta"] = meta;
|
|
31
32
|
deckJson = JSON.stringify(parsed);
|
|
32
33
|
}
|
|
33
|
-
const html = await renderDeck(deckJson,
|
|
34
|
+
const html = await renderDeck(deckJson, resolveThemesDir());
|
|
34
35
|
let deck;
|
|
35
36
|
try {
|
|
36
37
|
deck = JSON.parse(deckJson);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-deck.js","sourceRoot":"","sources":["../../src/tools/render-deck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"render-deck.js","sourceRoot":"","sources":["../../src/tools/render-deck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,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AAgB,EAAE,CAAC,CAAC;QAE5D,IAAI,IAA4B,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAA2B,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvE,MAAM,MAAM,GAAyD;YACnE,IAAI;YACJ,WAAW,EAAE,UAAU;SACxB,CAAC;QAEF,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC3C,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;QAC3B,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@presentation-md/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MCP server exposing presentation-md tools 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.0.
|
|
19
|
-
"@presentation-md/export": "^1.
|
|
20
|
-
"@presentation-md/render": "1.
|
|
17
|
+
"@presentation-md/core": "1.3.0",
|
|
18
|
+
"@presentation-md/create-theme": "1.0.6",
|
|
19
|
+
"@presentation-md/export": "^1.6.0",
|
|
20
|
+
"@presentation-md/render": "1.4.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^20.0.0",
|