@presentation-md/mcp-server 1.14.6 → 1.15.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.
|
@@ -44,7 +44,7 @@ export const generateDeckPromptTool = {
|
|
|
44
44
|
"- Prefer stunning-25 themes when the brief matches (see stunning_25_reference). Open that structured proof and match density — do not invent a watered-down palette.",
|
|
45
45
|
"- Density lock: choose speaker-led vs reading-first once with purpose; keep that density for the whole deck.",
|
|
46
46
|
"- Ban Inter-only / purple-on-white / cream-terracotta defaults unless the chosen theme owns them (see anti_slop_reference).",
|
|
47
|
-
"- When theme is unsure: use theme_shortlists_reference (or list_themes include_shortlists/mood/query) — pick a 3-theme shortlist (safe + bold + wildcard), preview_themes
|
|
47
|
+
"- When theme is unsure: use theme_shortlists_reference (or list_themes include_shortlists/mood/query) — pick a 3-theme shortlist (safe + bold + wildcard), call preview_themes (≥2 themes auto-defaults to mode=\"layouts\"; pass mode=\"title\" only for a cover skim), then lock meta.theme. Default shortlist for vague briefs: core-defaults (prefer popular:true).",
|
|
48
48
|
"- Match a layout_recipes_reference slide map (pitch / launch / wrap / neon / poster / paper / hud / modernist / hard-bento / glass / electric / briefing / quiet-luxe / soft-product / playful / neon-tech / data-editorial / scatterbrain) before freehanding layouts.",
|
|
49
49
|
"- Include ≥1 image-hero for visual/investor/launch/brand decks (kinetic-wrapped wraps may use ranked/streak/metric/hero-stat instead).",
|
|
50
50
|
"- Force asymmetry early: every comparison MUST set emphasis left|right; prefer non-1-1 two-column ratios; 5-card grids use columns:\"bento\".",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-deck-prompt.js","sourceRoot":"","sources":["../../src/tools/generate-deck-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACz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J;YAC5J,kJAAkJ;YAClJ,iJAAiJ;YACjJ,05CAA05C;YAC15C,meAAme;YACne,mmBAAmmB;YACnmB,0OAA0O;YAC1O,gUAAgU;YAChU,qNAAqN;YACrN,mJAAmJ;YACnJ,sKAAsK;YACtK,mLAAmL;YACnL,qSAAqS;YACrS,iKAAiK;YACjK,uJAAuJ;YACvJ,uKAAuK;YACvK,gKAAgK;YAChK,8LAA8L;YAC9L,mJAAmJ;YACnJ,sJAAsJ;YACtJ,sCAAsC;YACtC,wXAAwX;YACxX,+HAA+H;YAC/H,iHAAiH;SAClH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,MAAM;YACN,OAAO;YACP,aAAa,EAAE,YAAY;YAC3B,KAAK;YACL,qBAAqB,EAAE,mBAAmB;YAC1C,gBAAgB,EAAE,QAAQ,IAAI,SAAS;YACvC,qBAAqB,EAAE,UAAU,IAAI,SAAS;YAC9C,mBAAmB,EAAE,QAAQ,IAAI,SAAS;YAC1C,wBAAwB,EAAE,aAAa,IAAI,SAAS;YACpD,0BAA0B,EAAE,UAAU,IAAI,SAAS;YACnD,OAAO,EAAE,KAAK,CAAC,OAA4C;YAC3D,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,181 +1,13 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { findShortlist, loadThemeShortlists } from "@presentation-md/core";
|
|
4
|
-
import { renderDeck } from "@presentation-md/render";
|
|
4
|
+
import { buildLayoutsPreviewDeck, buildTitlePreviewDeck, layoutsPreviewSlideCount, renderDeck, } from "@presentation-md/render";
|
|
5
5
|
import { resolveThemesDir } from "../lib/resolve-themes.js";
|
|
6
6
|
import { assertWritablePathInCwd } from "../lib/cwd-path.js";
|
|
7
7
|
const DEFAULT_PREVIEW_DIR = ".presentation-md/theme-previews";
|
|
8
|
-
function titlePreviewDeck(title, theme, company) {
|
|
9
|
-
return JSON.stringify({
|
|
10
|
-
type: "deck",
|
|
11
|
-
meta: { title, company: company ?? title, theme },
|
|
12
|
-
slides: [
|
|
13
|
-
{
|
|
14
|
-
layout: "title",
|
|
15
|
-
eyebrow: theme.replace(/-/g, " "),
|
|
16
|
-
heading: title,
|
|
17
|
-
lead: "A preview of this theme's typography, palette, and surface treatment.",
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/** Canonical multi-layout bake so agents can judge comparison/stats/quote craft — not title alone. */
|
|
23
|
-
function layoutsPreviewDeck(title, theme, company) {
|
|
24
|
-
const isWrap = theme === "kinetic-wrapped";
|
|
25
|
-
const slides = [
|
|
26
|
-
{
|
|
27
|
-
layout: "title",
|
|
28
|
-
eyebrow: theme.replace(/-/g, " "),
|
|
29
|
-
heading: title,
|
|
30
|
-
lead: "Multi-layout craft preview — title, hero, bento, comparison, ranked bars, stats, quote, code, closing.",
|
|
31
|
-
...(isWrap ? { tone: "lime" } : {}),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
layout: "image-hero",
|
|
35
|
-
eyebrow: "Visual beat",
|
|
36
|
-
heading: "Show the product, place, or atmosphere.",
|
|
37
|
-
lead: "Full-bleed craft that still exports to PPTX.",
|
|
38
|
-
image: "data:image/svg+xml," +
|
|
39
|
-
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>`),
|
|
40
|
-
imageAlt: "Abstract craft field",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
layout: "feature-grid",
|
|
44
|
-
eyebrow: "Capabilities",
|
|
45
|
-
heading: "Five moves that matter",
|
|
46
|
-
columns: "bento",
|
|
47
|
-
cards: [
|
|
48
|
-
{ icon: "fa-solid fa-bolt", title: "Fast path", body: "Ship the decisive slide without redesigning chrome." },
|
|
49
|
-
{ icon: "fa-solid fa-layer-group", title: "Layered craft", body: "Surfaces stay out of the way of body layouts." },
|
|
50
|
-
{ icon: "fa-solid fa-eye", title: "Show, don't tell", body: "Judge the vibe across layouts before you lock a theme." },
|
|
51
|
-
{ icon: "fa-solid fa-chart-simple", title: "Native charts", body: "SVG in HTML, editable in PPTX." },
|
|
52
|
-
{ icon: "fa-solid fa-share-nodes", title: "Share frame", body: "Designed to leave the deck." },
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
layout: "two-column",
|
|
57
|
-
eyebrow: "Asymmetry",
|
|
58
|
-
heading: "Weight the copy when the story needs it.",
|
|
59
|
-
body: "Ratio and reverse keep media and copy in tension — not a default 50/50 split.",
|
|
60
|
-
aside: "2:1 craft proof",
|
|
61
|
-
ratio: "2-1",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
layout: "comparison",
|
|
65
|
-
eyebrow: "Before / After",
|
|
66
|
-
heading: "Discovery that survives the second slide.",
|
|
67
|
-
leftLabel: "Title only",
|
|
68
|
-
left: "Pretty cover.\nUnknown body craft.\nGuess and regenerate.",
|
|
69
|
-
rightLabel: "Multi-layout",
|
|
70
|
-
right: "See cards, stats, code.\nCatch contrast bugs early.\nLock the theme with evidence.",
|
|
71
|
-
emphasis: "right",
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
layout: "ranked-list",
|
|
75
|
-
eyebrow: "Ranking",
|
|
76
|
-
heading: "Bars that stay editable",
|
|
77
|
-
lead: "Prefer ranked-list over custom-html for top-N craft.",
|
|
78
|
-
items: [
|
|
79
|
-
{ label: "Primary beat", value: "88%", widthPct: 88 },
|
|
80
|
-
{ label: "Secondary", value: "58%", widthPct: 58 },
|
|
81
|
-
{ label: "Tertiary", value: "34%", widthPct: 34 },
|
|
82
|
-
],
|
|
83
|
-
...(isWrap ? { tone: "magenta" } : {}),
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
layout: "stat-row",
|
|
87
|
-
eyebrow: "Proof",
|
|
88
|
-
heading: isWrap ? "Mega number energy" : "Numbers that read at billboard scale",
|
|
89
|
-
...(isWrap
|
|
90
|
-
? {
|
|
91
|
-
variant: "hero",
|
|
92
|
-
tone: "orange",
|
|
93
|
-
lead: "One claim per frame. Built to screenshot.",
|
|
94
|
-
stats: [
|
|
95
|
-
{ value: "287", label: "Sessions this year" },
|
|
96
|
-
{ value: "5.5×", label: "per week" },
|
|
97
|
-
{ value: "+34%", label: "vs last year" },
|
|
98
|
-
],
|
|
99
|
-
}
|
|
100
|
-
: {
|
|
101
|
-
stats: [
|
|
102
|
-
{ value: "18", label: "Schema layouts" },
|
|
103
|
-
{ value: "75", label: "Theme surfaces" },
|
|
104
|
-
{ value: "1", label: "JSON field to swap vibe" },
|
|
105
|
-
],
|
|
106
|
-
}),
|
|
107
|
-
},
|
|
108
|
-
...(isWrap
|
|
109
|
-
? [
|
|
110
|
-
{
|
|
111
|
-
layout: "streak-grid",
|
|
112
|
-
tone: "violet",
|
|
113
|
-
eyebrow: "Streak",
|
|
114
|
-
heading: "No excuses.",
|
|
115
|
-
lead: "Schema cells — not custom-html squares.",
|
|
116
|
-
filled: 47,
|
|
117
|
-
total: 60,
|
|
118
|
-
cols: 10,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
layout: "metric-ring",
|
|
122
|
-
tone: "cyan",
|
|
123
|
-
eyebrow: "Percentile",
|
|
124
|
-
heading: "TOP 3%.",
|
|
125
|
-
value: "3%",
|
|
126
|
-
label: "globally",
|
|
127
|
-
pct: 100,
|
|
128
|
-
lead: "Circular KPI without inventing HTML.",
|
|
129
|
-
},
|
|
130
|
-
]
|
|
131
|
-
: []),
|
|
132
|
-
{
|
|
133
|
-
layout: "chart",
|
|
134
|
-
eyebrow: "Data viz",
|
|
135
|
-
heading: "Charts stay on-palette.",
|
|
136
|
-
chartType: "bar",
|
|
137
|
-
categories: ["Q1", "Q2", "Q3", "Q4"],
|
|
138
|
-
series: [{ name: "Signal", values: [12, 19, 28, 41] }],
|
|
139
|
-
showLegend: false,
|
|
140
|
-
showValues: true,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
layout: "quote",
|
|
144
|
-
quote: "If the second slide looks generic, the theme isn't ready.",
|
|
145
|
-
by: "presentation-md craft bar",
|
|
146
|
-
...(isWrap ? { tone: "cyan" } : {}),
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
layout: "code",
|
|
150
|
-
eyebrow: "Snippet",
|
|
151
|
-
heading: "Dev decks get a real code surface",
|
|
152
|
-
filename: "preview.ts",
|
|
153
|
-
language: "ts",
|
|
154
|
-
code: `const deck = {\n type: "deck",\n meta: { theme: "${theme}", title: "${title.replace(/"/g, '\\"')}" },\n slides: [{ layout: "code", code: "…" }],\n};`,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
layout: "closing",
|
|
158
|
-
eyebrow: "Next",
|
|
159
|
-
heading: "Pick this vibe — or preview another.",
|
|
160
|
-
lead: "Set meta.theme and generate the full deck.",
|
|
161
|
-
actions: isWrap
|
|
162
|
-
? [
|
|
163
|
-
{ label: "Share Wrapped", href: "#", style: "solid" },
|
|
164
|
-
{ label: "Post to X", href: "#", style: "outline" },
|
|
165
|
-
]
|
|
166
|
-
: [{ label: "Lock theme", href: "#", style: "solid" }],
|
|
167
|
-
...(isWrap ? { tone: "lime" } : {}),
|
|
168
|
-
},
|
|
169
|
-
];
|
|
170
|
-
return JSON.stringify({
|
|
171
|
-
type: "deck",
|
|
172
|
-
meta: { title, company: company ?? title, theme },
|
|
173
|
-
slides,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
8
|
export const previewThemesTool = {
|
|
177
9
|
name: "preview_themes",
|
|
178
|
-
description: "Render 1–3 theme preview HTML files for visual discovery (show-don't-tell). Pass themes[] and/or a shortlist id from theme-shortlists.json (shortlist themes fill when themes is omitted; otherwise themes wins, capped at 3).
|
|
10
|
+
description: "Render 1–3 theme preview HTML files for visual discovery (show-don't-tell). Pass themes[] and/or a shortlist id from theme-shortlists.json (shortlist themes fill when themes is omitted; otherwise themes wins, capped at 3). Pick-3 / duo compares (≥2 themes) default to mode=\"layouts\" so agents judge body craft without a second call — pass mode=\"title\" for a fast cover-only skim. Single-theme default remains title. kinetic-wrapped previews inject tone + hero mega-stat + share pills.",
|
|
179
11
|
inputSchema: {
|
|
180
12
|
type: "object",
|
|
181
13
|
properties: {
|
|
@@ -201,7 +33,7 @@ export const previewThemesTool = {
|
|
|
201
33
|
mode: {
|
|
202
34
|
type: "string",
|
|
203
35
|
enum: ["title", "layouts"],
|
|
204
|
-
description: 'Preview depth. "title"
|
|
36
|
+
description: 'Preview depth. Omit to auto-pick: layouts when ≥2 themes (pick-3), title for a single theme. "title" = one cover slide. "layouts" = multi-slide craft bake (comparison, stats, quote, code, closing).',
|
|
205
37
|
},
|
|
206
38
|
output_dir: {
|
|
207
39
|
type: "string",
|
|
@@ -240,14 +72,19 @@ export const previewThemesTool = {
|
|
|
240
72
|
}
|
|
241
73
|
const title = input["title"] ?? "Your Deck Title";
|
|
242
74
|
const company = input["company"];
|
|
243
|
-
const
|
|
75
|
+
const explicitMode = input["mode"];
|
|
76
|
+
const mode = explicitMode === "layouts" || explicitMode === "title"
|
|
77
|
+
? explicitMode
|
|
78
|
+
: themes.length >= 2
|
|
79
|
+
? "layouts"
|
|
80
|
+
: "title";
|
|
244
81
|
const outputDir = await assertWritablePathInCwd(input["output_dir"] ?? DEFAULT_PREVIEW_DIR, "output_dir");
|
|
245
82
|
await mkdir(outputDir, { recursive: true });
|
|
246
83
|
const previews = [];
|
|
247
84
|
for (const theme of themes) {
|
|
248
85
|
const deckJson = mode === "layouts"
|
|
249
|
-
?
|
|
250
|
-
:
|
|
86
|
+
? buildLayoutsPreviewDeck(theme, title, company)
|
|
87
|
+
: buildTitlePreviewDeck(theme, title, company);
|
|
251
88
|
const html = await renderDeck(deckJson, resolveThemesDir());
|
|
252
89
|
const filename = mode === "layouts" ? `${theme}-layouts-preview.html` : `${theme}-preview.html`;
|
|
253
90
|
const path = join(outputDir, filename);
|
|
@@ -257,7 +94,7 @@ export const previewThemesTool = {
|
|
|
257
94
|
path,
|
|
258
95
|
filename,
|
|
259
96
|
mode,
|
|
260
|
-
slides: mode === "layouts" ?
|
|
97
|
+
slides: mode === "layouts" ? layoutsPreviewSlideCount(theme) : 1,
|
|
261
98
|
});
|
|
262
99
|
}
|
|
263
100
|
return {
|
|
@@ -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,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAChG,OAAO,
|
|
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,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAChG,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,MAAM,mBAAmB,GAAG,iCAAiC,CAAC;AAE9D,MAAM,CAAC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,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;gBACxC,CAAC,CAAC;oBACE,mBAAmB,EAAE,IAAI;oBACzB,YAAY,EACV,0JAA0J;iBAC7J;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,WAAW,EACT,IAAI,KAAK,SAAS;gBAChB,CAAC,CAAC,iLAAiL;gBACnL,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC;oBAClB,CAAC,CAAC,qKAAqK;oBACvK,CAAC,CAAC,qMAAqM;SAC9M,CAAC;IACJ,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.15.0",
|
|
4
4
|
"description": "MCP server exposing all 11 presentation-md tools (render/export/audit/judge/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.16.
|
|
18
|
-
"@presentation-md/create-theme": "1.1.
|
|
19
|
-
"@presentation-md/export": "^1.23.
|
|
20
|
-
"@presentation-md/render": "1.7.
|
|
17
|
+
"@presentation-md/core": "1.16.4",
|
|
18
|
+
"@presentation-md/create-theme": "1.1.6",
|
|
19
|
+
"@presentation-md/export": "^1.23.6",
|
|
20
|
+
"@presentation-md/render": "1.7.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^20.0.0",
|