@netnodeag/kraftwerk 0.81.0 → 0.83.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.
Files changed (104) hide show
  1. package/README.md +227 -0
  2. package/dist/cli/boards.d.ts +2 -0
  3. package/dist/cli/boards.js +486 -0
  4. package/dist/cli/init.js +2 -0
  5. package/dist/cli/kraftwerk.js +6 -0
  6. package/dist/cli/presentations.d.ts +2 -0
  7. package/dist/cli/presentations.js +261 -0
  8. package/dist/client/routes.d.ts +32 -0
  9. package/dist/client/routes.js +32 -0
  10. package/dist/config.d.ts +35 -0
  11. package/dist/config.js +33 -2
  12. package/dist/core/attention.d.ts +2 -2
  13. package/dist/core/attention.js +22 -2
  14. package/dist/core/board-wake.d.ts +21 -0
  15. package/dist/core/board-wake.js +221 -0
  16. package/dist/core/boards.d.ts +269 -0
  17. package/dist/core/boards.js +969 -0
  18. package/dist/core/chat/acp.d.ts +1 -1
  19. package/dist/core/chat/acp.js +2 -1
  20. package/dist/core/chat/backend.d.ts +11 -0
  21. package/dist/core/chat/backend.js +9 -1
  22. package/dist/core/chat/context.js +25 -4
  23. package/dist/core/chat/pi.d.ts +1 -1
  24. package/dist/core/chat/pi.js +2 -1
  25. package/dist/core/chat/seats.js +3 -2
  26. package/dist/core/chat/sessions.d.ts +2 -0
  27. package/dist/core/chat/sessions.js +1 -0
  28. package/dist/core/chat/state.js +1 -1
  29. package/dist/core/chat/types.d.ts +11 -1
  30. package/dist/core/files.d.ts +1 -1
  31. package/dist/core/files.js +19 -1
  32. package/dist/core/git.js +5 -1
  33. package/dist/core/notifications.d.ts +1 -1
  34. package/dist/core/presentations/browser.d.ts +43 -0
  35. package/dist/core/presentations/browser.js +53 -0
  36. package/dist/core/presentations/builtin.d.ts +3 -0
  37. package/dist/core/presentations/builtin.js +142 -0
  38. package/dist/core/presentations/chart.d.ts +34 -0
  39. package/dist/core/presentations/chart.js +159 -0
  40. package/dist/core/presentations/deck.d.ts +63 -0
  41. package/dist/core/presentations/deck.js +198 -0
  42. package/dist/core/presentations/export.d.ts +21 -0
  43. package/dist/core/presentations/export.js +75 -0
  44. package/dist/core/presentations/html.d.ts +135 -0
  45. package/dist/core/presentations/html.js +389 -0
  46. package/dist/core/presentations/index.d.ts +252 -0
  47. package/dist/core/presentations/index.js +753 -0
  48. package/dist/core/presentations/layout.d.ts +47 -0
  49. package/dist/core/presentations/layout.js +147 -0
  50. package/dist/core/presentations/markdown.d.ts +49 -0
  51. package/dist/core/presentations/markdown.js +158 -0
  52. package/dist/core/presentations/merge.d.ts +26 -0
  53. package/dist/core/presentations/merge.js +28 -0
  54. package/dist/core/presentations/presence.d.ts +31 -0
  55. package/dist/core/presentations/presence.js +131 -0
  56. package/dist/core/presentations/render.d.ts +33 -0
  57. package/dist/core/presentations/render.js +318 -0
  58. package/dist/core/presentations/slots.d.ts +33 -0
  59. package/dist/core/presentations/slots.js +114 -0
  60. package/dist/core/presentations/template.d.ts +253 -0
  61. package/dist/core/presentations/template.js +141 -0
  62. package/dist/core/presentations/versions.d.ts +30 -0
  63. package/dist/core/presentations/versions.js +75 -0
  64. package/dist/core/refs.d.ts +1 -1
  65. package/dist/core/refs.js +33 -1
  66. package/dist/core/search.d.ts +22 -0
  67. package/dist/core/search.js +25 -0
  68. package/dist/core/settings.d.ts +4 -0
  69. package/dist/core/settings.js +24 -1
  70. package/dist/core/trash.d.ts +1 -1
  71. package/dist/server/api/boards.d.ts +105 -0
  72. package/dist/server/api/boards.js +160 -0
  73. package/dist/server/api/chats.d.ts +2 -0
  74. package/dist/server/api/chats.js +9 -3
  75. package/dist/server/api/index.d.ts +167 -3
  76. package/dist/server/api/index.js +4 -0
  77. package/dist/server/api/presentations.d.ts +66 -0
  78. package/dist/server/api/presentations.js +185 -0
  79. package/dist/server/api/socket.js +24 -1
  80. package/dist/server/api/workspace.d.ts +10 -0
  81. package/dist/server/api/workspace.js +4 -0
  82. package/dist/server/push.js +1 -1
  83. package/dist/server/server.js +3 -0
  84. package/package.json +6 -2
  85. package/schema/kraftwerk.schema.json +57 -0
  86. package/web/dist/assets/{dist-Ba6WSVOB.js → dist-5-ibIscm.js} +1 -1
  87. package/web/dist/assets/{dist-ENZYo2jZ.js → dist-5lgY5B-M.js} +1 -1
  88. package/web/dist/assets/{dist-BiU4F98O.js → dist-BJaPgnhj.js} +1 -1
  89. package/web/dist/assets/{dist-Dy1SvhKC.js → dist-Bar1_NBq.js} +1 -1
  90. package/web/dist/assets/{dist-AhnSw4hy.js → dist-BxCxboU8.js} +1 -1
  91. package/web/dist/assets/dist-CDitSY16.js +1 -0
  92. package/web/dist/assets/{dist-FfKYtQxT.js → dist-CRXT8IL6.js} +1 -1
  93. package/web/dist/assets/{dist-BK0VhAPQ.js → dist-CXRjiHpl.js} +1 -1
  94. package/web/dist/assets/{dist-Dx3aajX1.js → dist-CpnB7MfK.js} +1 -1
  95. package/web/dist/assets/{dist-8IOFzZx-.js → dist-D1VK1YdB.js} +1 -1
  96. package/web/dist/assets/{dist-cewmjxFi.js → dist-D52LvyO8.js} +1 -1
  97. package/web/dist/assets/{editor-CZMrhTTL.css → editor-C0_Snnzk.css} +1 -1
  98. package/web/dist/assets/{editor-CaRa1NMC.js → editor-HCNTXWWs.js} +3 -3
  99. package/web/dist/assets/index-Dnlu16AL.css +2 -0
  100. package/web/dist/assets/index-kwWnQOhD.js +473 -0
  101. package/web/dist/index.html +2 -2
  102. package/web/dist/assets/dist-lgUK2Fjt.js +0 -1
  103. package/web/dist/assets/index-Dpzux3OC.js +0 -231
  104. package/web/dist/assets/index-Dvt-vE1h.css +0 -2
@@ -0,0 +1,159 @@
1
+ import { parse } from "yaml";
2
+ /** Series colors, shared by the HTML chart and the PPTX one so both look alike: the template's accent, then fixed extras. */
3
+ export const chartPalette = (accent) => [accent ?? "#0284C7", "#F59E0B", "#10B981", "#8B5CF6", "#EF4444", "#64748B", "#EC4899"];
4
+ /**
5
+ * Charts as SVG for the HTML slides: column, bar, line, area, pie and
6
+ * doughnut from the same `chart` block the PowerPoint export turns into a
7
+ * native chart. Pure — the web editor bundles it.
8
+ */
9
+ export const CHART_KINDS = ["column", "bar", "line", "pie", "doughnut", "area"];
10
+ /** A chart block's YAML (fenced or bare) read and checked; throws with what is wrong. */
11
+ export function parseChart(source) {
12
+ const body = source.replace(/^\s*```\s*chart\s*\n/, "").replace(/\n?```\s*$/, "");
13
+ const data = parse(body);
14
+ if (!data || typeof data !== "object")
15
+ throw new Error("chart block must be a YAML mapping (kind, categories, series)");
16
+ const kind = String(data.kind ?? "column");
17
+ if (!CHART_KINDS.includes(kind))
18
+ throw new Error(`chart kind "${kind}" is not one of ${CHART_KINDS.join(", ")}`);
19
+ const categories = Array.isArray(data.categories) ? data.categories.map(String) : [];
20
+ if (!categories.length)
21
+ throw new Error("chart needs categories: [a, b, …]");
22
+ const seriesIn = Array.isArray(data.series) ? data.series : [];
23
+ if (!seriesIn.length)
24
+ throw new Error("chart needs series: [{name, values}]");
25
+ const series = seriesIn.map((x, i) => {
26
+ const row = (x ?? {});
27
+ const values = Array.isArray(row.values) ? row.values.map(Number) : [];
28
+ if (values.length !== categories.length || values.some((v) => Number.isNaN(v)))
29
+ throw new Error(`series ${i + 1}: values must be ${categories.length} numbers`);
30
+ return { name: String(row.name ?? `Series ${i + 1}`), values };
31
+ });
32
+ return { kind: kind, categories, series, ...(typeof data.title === "string" && data.title.trim() ? { title: data.title.trim() } : {}) };
33
+ }
34
+ /** Two decimals are plenty for a slide 1600 px wide. */
35
+ const tidy = (svg) => svg.replace(/-?\d+\.\d{3,}/g, (n) => String(Math.round(Number(n) * 100) / 100));
36
+ const esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
37
+ const fmt = (n) => (Math.abs(n) >= 1000 ? n.toLocaleString("en-US").replace(/,/g, "'") : String(Math.round(n * 100) / 100));
38
+ /** A "nice" axis: max and step for about five ticks. */
39
+ function niceAxis(max, min) {
40
+ const span = Math.max(max - Math.min(0, min), 1e-9);
41
+ const raw = span / 5;
42
+ const pow = 10 ** Math.floor(Math.log10(raw));
43
+ const step = [1, 2, 2.5, 5, 10].map((m) => m * pow).find((s) => s >= raw) ?? pow * 10;
44
+ return { lo: Math.min(0, Math.floor(min / step) * step), hi: Math.ceil(max / step) * step || step, step };
45
+ }
46
+ /** The chart as an SVG string sized w × h (the slot's box in px), in the theme's palette and text colors. */
47
+ export function chartSvg(c, w, h, look) {
48
+ const fs = look.fontSize;
49
+ const color = (i) => look.palette[i % look.palette.length];
50
+ const parts = [];
51
+ let top = 4;
52
+ if (c.title) {
53
+ parts.push(`<text x="${w / 2}" y="${fs * 1.1}" text-anchor="middle" font-weight="700" font-size="${fs * 1.1}" fill="${look.text}">${esc(c.title)}</text>`);
54
+ top += fs * 1.7;
55
+ }
56
+ const legend = c.series.length > 1 || c.kind === "pie" || c.kind === "doughnut";
57
+ const legendItems = c.kind === "pie" || c.kind === "doughnut" ? c.categories : c.series.map((s) => s.name);
58
+ const bottomLegend = legend ? fs * 1.8 : 0;
59
+ if (legend) {
60
+ const itemW = legendItems.map((t) => t.length * fs * 0.55 + fs * 1.8);
61
+ let x = (w - itemW.reduce((a, b) => a + b, 0)) / 2;
62
+ const y = h - fs * 0.5;
63
+ legendItems.forEach((t, i) => {
64
+ parts.push(`<rect x="${x}" y="${y - fs * 0.75}" width="${fs * 0.8}" height="${fs * 0.8}" rx="${fs * 0.15}" fill="${color(i)}"/><text x="${x + fs * 1.1}" y="${y}" font-size="${fs * 0.9}" fill="${look.muted}">${esc(t)}</text>`);
65
+ x += itemW[i];
66
+ });
67
+ }
68
+ const plotH = h - top - bottomLegend;
69
+ if (c.kind === "pie" || c.kind === "doughnut") {
70
+ const vals = c.series[0].values.map((v) => Math.max(0, v));
71
+ const total = vals.reduce((a, b) => a + b, 0) || 1;
72
+ const r = Math.max(10, Math.min(w, plotH) / 2 - 4);
73
+ const cx = w / 2;
74
+ const cy = top + plotH / 2;
75
+ let a0 = -Math.PI / 2;
76
+ vals.forEach((v, i) => {
77
+ const a1 = a0 + (v / total) * Math.PI * 2;
78
+ const large = a1 - a0 > Math.PI ? 1 : 0;
79
+ const p = (a, rr) => `${cx + rr * Math.cos(a)} ${cy + rr * Math.sin(a)}`;
80
+ if (v / total >= 0.9999)
81
+ parts.push(`<circle cx="${cx}" cy="${cy}" r="${r}" fill="${color(i)}"/>`);
82
+ else
83
+ parts.push(`<path d="M ${cx} ${cy} L ${p(a0, r)} A ${r} ${r} 0 ${large} 1 ${p(a1, r)} Z" fill="${color(i)}" stroke="#fff" stroke-width="2"/>`);
84
+ const mid = (a0 + a1) / 2;
85
+ if (v / total > 0.06)
86
+ parts.push(`<text x="${cx + r * (c.kind === "doughnut" ? 0.78 : 0.62) * Math.cos(mid)}" y="${cy + r * (c.kind === "doughnut" ? 0.78 : 0.62) * Math.sin(mid) + fs * 0.35}" text-anchor="middle" font-size="${fs}" font-weight="700" fill="#fff">${Math.round((v / total) * 100)}%</text>`);
87
+ a0 = a1;
88
+ });
89
+ if (c.kind === "doughnut")
90
+ parts.push(`<circle cx="${cx}" cy="${cy}" r="${r * 0.55}" fill="var(--c-background, #fff)"/>`);
91
+ return tidy(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}" width="100%" height="100%" font-family="inherit">${parts.join("")}</svg>`);
92
+ }
93
+ const all = c.series.flatMap((s) => s.values);
94
+ const { lo, hi, step } = niceAxis(Math.max(...all, 0), Math.min(...all, 0));
95
+ const horizontal = c.kind === "bar";
96
+ const labelW = horizontal ? Math.min(w * 0.3, Math.max(...c.categories.map((t) => t.length)) * fs * 0.55 + fs) : Math.max(...[lo, hi].map((v) => fmt(v).length)) * fs * 0.6 + fs * 0.6;
97
+ const left = labelW;
98
+ const right = w - fs;
99
+ const bottom = top + plotH - (horizontal ? fs * 1.6 : fs * 1.8);
100
+ const plotTop = top + fs * 0.6;
101
+ const ticks = [];
102
+ for (let v = lo; v <= hi + step / 2; v += step)
103
+ ticks.push(Math.round(v * 1e6) / 1e6);
104
+ const n = c.categories.length;
105
+ if (horizontal) {
106
+ const scale = (v) => left + ((v - lo) / (hi - lo)) * (right - left);
107
+ for (const t of ticks)
108
+ parts.push(`<line x1="${scale(t)}" x2="${scale(t)}" y1="${plotTop}" y2="${bottom}" stroke="${look.line}"/><text x="${scale(t)}" y="${bottom + fs * 1.2}" text-anchor="middle" font-size="${fs * 0.85}" fill="${look.muted}">${fmt(t)}</text>`);
109
+ const band = (bottom - plotTop) / n;
110
+ const barH = (band * 0.7) / c.series.length;
111
+ c.categories.forEach((cat, i) => {
112
+ parts.push(`<text x="${left - fs * 0.5}" y="${plotTop + band * (i + 0.5) + fs * 0.35}" text-anchor="end" font-size="${fs * 0.9}" fill="${look.text}">${esc(cat)}</text>`);
113
+ c.series.forEach((s, j) => {
114
+ const y = plotTop + band * i + band * 0.15 + barH * j;
115
+ const x0 = scale(Math.min(0, s.values[i]));
116
+ parts.push(`<rect x="${x0}" y="${y}" width="${Math.abs(scale(s.values[i]) - scale(0))}" height="${barH * 0.92}" rx="2" fill="${color(j)}"/>`);
117
+ });
118
+ });
119
+ return tidy(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}" width="100%" height="100%" font-family="inherit">${parts.join("")}</svg>`);
120
+ }
121
+ const scale = (v) => bottom - ((v - lo) / (hi - lo)) * (bottom - plotTop);
122
+ for (const t of ticks)
123
+ parts.push(`<line x1="${left}" x2="${right}" y1="${scale(t)}" y2="${scale(t)}" stroke="${look.line}"/><text x="${left - fs * 0.4}" y="${scale(t) + fs * 0.32}" text-anchor="end" font-size="${fs * 0.85}" fill="${look.muted}">${fmt(t)}</text>`);
124
+ const band = (right - left) / n;
125
+ c.categories.forEach((cat, i) => parts.push(`<text x="${left + band * (i + 0.5)}" y="${bottom + fs * 1.3}" text-anchor="middle" font-size="${fs * 0.9}" fill="${look.text}">${esc(cat)}</text>`));
126
+ if (c.kind === "column") {
127
+ const barW = (band * 0.7) / c.series.length;
128
+ c.series.forEach((s, j) => s.values.forEach((v, i) => {
129
+ const x = left + band * i + band * 0.15 + barW * j;
130
+ const y = Math.min(scale(v), scale(0));
131
+ parts.push(`<rect x="${x}" y="${y}" width="${barW * 0.92}" height="${Math.abs(scale(v) - scale(0))}" rx="2" fill="${color(j)}"/>`);
132
+ }));
133
+ }
134
+ else {
135
+ c.series.forEach((s, j) => {
136
+ const pts = s.values.map((v, i) => `${left + band * (i + 0.5)},${scale(v)}`);
137
+ if (c.kind === "area")
138
+ parts.push(`<polygon points="${left + band * 0.5},${scale(Math.max(lo, 0))} ${pts.join(" ")} ${left + band * (n - 0.5)},${scale(Math.max(lo, 0))}" fill="${color(j)}" fill-opacity="0.22"/>`);
139
+ parts.push(`<polyline points="${pts.join(" ")}" fill="none" stroke="${color(j)}" stroke-width="${Math.max(2, fs * 0.18)}" stroke-linejoin="round" stroke-linecap="round"/>`);
140
+ s.values.forEach((v, i) => parts.push(`<circle cx="${left + band * (i + 0.5)}" cy="${scale(v)}" r="${Math.max(3, fs * 0.22)}" fill="${color(j)}"/>`));
141
+ });
142
+ }
143
+ parts.push(`<line x1="${left}" x2="${right}" y1="${scale(Math.max(lo, 0))}" y2="${scale(Math.max(lo, 0))}" stroke="${look.muted}"/>`);
144
+ return tidy(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}" width="100%" height="100%" font-family="inherit">${parts.join("")}</svg>`);
145
+ }
146
+ /** A YAML scalar: plain when it reads back the same, else quoted. */
147
+ const scalar = (s) => (/^[\p{L}\p{N}][\p{L}\p{N} ._%'()/&+-]*$/u.test(s) && !/^(true|false|null|yes|no|on|off|~)$/i.test(s) && !/^[\d.+-]+$/.test(s) ? s : JSON.stringify(s));
148
+ /**
149
+ * A chart written back as its block: what the editor's data grid saves.
150
+ * Compact and in the order people read it (kind, title, categories,
151
+ * series); `fenced` keeps the ```chart fence the slot had.
152
+ */
153
+ export function chartSource(c, fenced) {
154
+ const lines = [`kind: ${c.kind}`, ...(c.title ? [`title: ${scalar(c.title)}`] : []), `categories: [${c.categories.map(scalar).join(", ")}]`, "series:"];
155
+ for (const s of c.series)
156
+ lines.push(` - name: ${scalar(s.name)}`, ` values: [${s.values.map((v) => String(Math.round(v * 1e6) / 1e6)).join(", ")}]`);
157
+ const body = lines.join("\n");
158
+ return fenced ? `\`\`\`chart\n${body}\n\`\`\`` : body;
159
+ }
@@ -0,0 +1,63 @@
1
+ export { DEFAULT_SLOT, NOTES_SLOT, joinSlots, slotsOf } from "./slots.js";
2
+ /**
3
+ * deck.md: the whole presentation in one Markdown file, Slidev-style.
4
+ *
5
+ * --- headmatter: the deck (title, template, size) and the
6
+ * title: Why NodeHive first slide's own keys (layout, notes, background)
7
+ * template: default
8
+ * layout: title
9
+ * ---
10
+ * # Why NodeHive slide 1 — content before the first ::slot:: marker is
11
+ * ::subtitle:: the default content: a leading heading fills the
12
+ * Review · Nov 2026 layout's title slot, the rest its body slot
13
+ * ::notes:: ::notes:: are the speaker notes
14
+ * Open with the timeline.
15
+ *
16
+ * --- a `---` line starts the next slide; an optional YAML
17
+ * layout: two-column block right after it (closed by another `---`) is
18
+ * --- the slide's keys
19
+ * # Faster editing
20
+ * ::left::
21
+ * - One API for every channel
22
+ * ::right::
23
+ * ![Architecture](assets/arch.png)
24
+ *
25
+ * The parser is tolerant: a fence (```) hides separators and markers inside
26
+ * it, a `---` with no YAML after it is just a separator, and anything that
27
+ * is not a mapping stays content. `serializeDeck` writes the normalised
28
+ * form back; the editor and the CLI both go through it, agents may edit
29
+ * the file directly.
30
+ */
31
+ /** Headmatter keys the deck reads itself; every other non-slide key stays in `meta` (author, date, …). */
32
+ export declare const DECK_KEYS: readonly ["title", "template", "size", "css", "numbers"];
33
+ export declare const SLIDE_KEYS: readonly ["layout", "notes", "background", "transition"];
34
+ export interface SlideDef {
35
+ /** The layout of the template this slide uses; the template's default when missing. */
36
+ layout?: string;
37
+ /** Speaker notes (the `notes:` key or the ::notes:: slot). */
38
+ notes?: string;
39
+ /** A color name of the template or #hex; overrides the layout's background. */
40
+ background?: string;
41
+ transition?: string;
42
+ /** Other keys of the slide's YAML block, kept as they are. */
43
+ extra: Record<string, unknown>;
44
+ /** The slide's markdown including its `::slot::` markers (the notes slot removed when `notes` came from it). */
45
+ content: string;
46
+ }
47
+ export interface DeckDoc {
48
+ title: string;
49
+ template: string;
50
+ /** The deck's own CSS over the template's theme (scoped to its slides). */
51
+ css?: string;
52
+ size?: "16:9" | "4:3";
53
+ /** `numbers: false` turns the slide numbers off for the whole deck; on when missing. A slide's own `number: false` hides it there. */
54
+ numbers?: false;
55
+ /** Other headmatter keys (author, date, …), kept as they are. */
56
+ meta: Record<string, unknown>;
57
+ slides: SlideDef[];
58
+ }
59
+ export declare function parseDeck(raw: string): DeckDoc;
60
+ /** A deck in its file form: headmatter, then slides separated by `---` lines with their YAML blocks. */
61
+ export declare function serializeDeck(doc: DeckDoc): string;
62
+ /** A new deck's file: a title slide and one content slide, so the editor opens with something to show. */
63
+ export declare function starterDeck(title: string, template: string): DeckDoc;
@@ -0,0 +1,198 @@
1
+ import { parse, stringify } from "yaml";
2
+ import { NOTES_SLOT, joinSlots, slotsOf, trimBlank } from "./slots.js";
3
+ export { DEFAULT_SLOT, NOTES_SLOT, joinSlots, slotsOf } from "./slots.js";
4
+ /**
5
+ * deck.md: the whole presentation in one Markdown file, Slidev-style.
6
+ *
7
+ * --- headmatter: the deck (title, template, size) and the
8
+ * title: Why NodeHive first slide's own keys (layout, notes, background)
9
+ * template: default
10
+ * layout: title
11
+ * ---
12
+ * # Why NodeHive slide 1 — content before the first ::slot:: marker is
13
+ * ::subtitle:: the default content: a leading heading fills the
14
+ * Review · Nov 2026 layout's title slot, the rest its body slot
15
+ * ::notes:: ::notes:: are the speaker notes
16
+ * Open with the timeline.
17
+ *
18
+ * --- a `---` line starts the next slide; an optional YAML
19
+ * layout: two-column block right after it (closed by another `---`) is
20
+ * --- the slide's keys
21
+ * # Faster editing
22
+ * ::left::
23
+ * - One API for every channel
24
+ * ::right::
25
+ * ![Architecture](assets/arch.png)
26
+ *
27
+ * The parser is tolerant: a fence (```) hides separators and markers inside
28
+ * it, a `---` with no YAML after it is just a separator, and anything that
29
+ * is not a mapping stays content. `serializeDeck` writes the normalised
30
+ * form back; the editor and the CLI both go through it, agents may edit
31
+ * the file directly.
32
+ */
33
+ /** Headmatter keys the deck reads itself; every other non-slide key stays in `meta` (author, date, …). */
34
+ export const DECK_KEYS = ["title", "template", "size", "css", "numbers"];
35
+ export const SLIDE_KEYS = ["layout", "notes", "background", "transition"];
36
+ const SEP_RE = /^---[ \t]*$/;
37
+ const FENCE_RE = /^(`{3,}|~{3,})/;
38
+ const KEY_RE = /^[A-Za-z_][\w-]*\s*:/;
39
+ export function parseDeck(raw) {
40
+ const lines = raw.replace(/\r\n?/g, "\n").split("\n");
41
+ let i = 0;
42
+ let head = {};
43
+ // Headmatter: a leading `---` block.
44
+ if (lines.length && SEP_RE.test(lines[0])) {
45
+ const end = lines.findIndex((l, idx) => idx > 0 && SEP_RE.test(l));
46
+ if (end > 0) {
47
+ head = mapping(lines.slice(1, end).join("\n"));
48
+ i = end + 1;
49
+ }
50
+ }
51
+ const doc = { title: str(head.title) || "", template: str(head.template) || "default", meta: {}, slides: [] };
52
+ if (head.size === "4:3" || head.size === "16:9")
53
+ doc.size = head.size;
54
+ if (typeof head.css === "string" && head.css.trim())
55
+ doc.css = head.css;
56
+ if (head.numbers === false)
57
+ doc.numbers = false;
58
+ for (const [k, v] of Object.entries(head))
59
+ if (!DECK_KEYS.includes(k) && !FIRST_SLIDE_KEYS.includes(k))
60
+ doc.meta[k] = v;
61
+ // Split the rest into slide chunks at top-level `---` lines (not inside fences).
62
+ const chunks = [{ attrs: pickSlideKeys(head), body: [] }];
63
+ let fence = null;
64
+ for (; i < lines.length; i++) {
65
+ const line = lines[i];
66
+ const f = FENCE_RE.exec(line);
67
+ if (f) {
68
+ if (!fence)
69
+ fence = f[1];
70
+ else if (line.startsWith(fence))
71
+ fence = null;
72
+ chunks[chunks.length - 1].body.push(line);
73
+ continue;
74
+ }
75
+ if (!fence && SEP_RE.test(line)) {
76
+ // A YAML block directly after the separator?
77
+ const close = lines.findIndex((l, idx) => idx > i && SEP_RE.test(l));
78
+ const between = close > i ? lines.slice(i + 1, close) : [];
79
+ const isYaml = between.length > 0 && between.every((l) => l.trim() !== "") && KEY_RE.test(between[0]) && tryMapping(between.join("\n")) != null;
80
+ if (isYaml) {
81
+ chunks.push({ attrs: mapping(between.join("\n")), body: [] });
82
+ i = close;
83
+ }
84
+ else
85
+ chunks.push({ attrs: {}, body: [] });
86
+ continue;
87
+ }
88
+ chunks[chunks.length - 1].body.push(line);
89
+ }
90
+ // An empty first chunk before the first separator (a deck that starts with `---` after the headmatter) is not a slide.
91
+ if (chunks.length > 1 && chunks[0].body.join("").trim() === "" && Object.keys(chunks[0].attrs).length === 0)
92
+ chunks.shift();
93
+ doc.slides = chunks.map((c) => slideOf(c.attrs, c.body.join("\n")));
94
+ return doc;
95
+ }
96
+ function slideOf(attrs, body) {
97
+ const slide = { extra: {}, content: trimBlank(body) };
98
+ if (typeof attrs.layout === "string" && attrs.layout.trim())
99
+ slide.layout = attrs.layout.trim();
100
+ if (typeof attrs.notes === "string" && attrs.notes.trim())
101
+ slide.notes = attrs.notes.trim();
102
+ if (typeof attrs.background === "string" && attrs.background.trim())
103
+ slide.background = attrs.background.trim();
104
+ if (typeof attrs.transition === "string" && attrs.transition.trim())
105
+ slide.transition = attrs.transition.trim();
106
+ for (const [k, v] of Object.entries(attrs))
107
+ if (!SLIDE_KEYS.includes(k))
108
+ slide.extra[k] = v;
109
+ // ::notes:: in the content wins over the key and is lifted out of the content.
110
+ const slots = slotsOf(slide.content);
111
+ if (slots[NOTES_SLOT] !== undefined) {
112
+ if (slots[NOTES_SLOT].trim())
113
+ slide.notes = slots[NOTES_SLOT].trim();
114
+ delete slots[NOTES_SLOT];
115
+ slide.content = joinSlots(slots);
116
+ }
117
+ return slide;
118
+ }
119
+ /** A deck in its file form: headmatter, then slides separated by `---` lines with their YAML blocks. */
120
+ export function serializeDeck(doc) {
121
+ const head = { title: doc.title || "Untitled", template: doc.template || "default" };
122
+ if (doc.size)
123
+ head.size = doc.size;
124
+ if (doc.numbers === false)
125
+ head.numbers = false;
126
+ if (doc.css?.trim())
127
+ head.css = doc.css.replace(/\s+$/, "") + "\n";
128
+ Object.assign(head, doc.meta);
129
+ const slides = doc.slides.length ? doc.slides : [{ extra: {}, content: "" }];
130
+ Object.assign(head, slideAttrs(slides[0]));
131
+ let out = `---\n${stringify(head)}---\n`;
132
+ out += slideBody(slides[0]);
133
+ for (const s of slides.slice(1)) {
134
+ const attrs = slideAttrs(s);
135
+ out += `\n---\n`;
136
+ if (Object.keys(attrs).length)
137
+ out += `${stringify(attrs)}---\n`;
138
+ out += slideBody(s);
139
+ }
140
+ return out;
141
+ }
142
+ function slideAttrs(s) {
143
+ const attrs = {};
144
+ if (s.layout)
145
+ attrs.layout = s.layout;
146
+ if (s.background)
147
+ attrs.background = s.background;
148
+ if (s.transition)
149
+ attrs.transition = s.transition;
150
+ Object.assign(attrs, s.extra);
151
+ return attrs;
152
+ }
153
+ function slideBody(s) {
154
+ const content = trimBlank(s.content);
155
+ const notes = s.notes?.trim() ? `::notes::\n${s.notes.trim()}` : "";
156
+ const body = [content, notes].filter(Boolean).join("\n\n");
157
+ return body ? `${body}\n` : "";
158
+ }
159
+ /** A new deck's file: a title slide and one content slide, so the editor opens with something to show. */
160
+ export function starterDeck(title, template) {
161
+ return {
162
+ title,
163
+ template,
164
+ meta: {},
165
+ slides: [
166
+ { layout: "title", extra: {}, content: `# ${title}\n\n::subtitle::\n${new Date().toISOString().slice(0, 10)}` },
167
+ { layout: "content", extra: {}, content: "# First point\n\n- What this deck is about\n- Why it matters\n- What we decide" },
168
+ ],
169
+ };
170
+ }
171
+ /** The first slide's keys live in the headmatter: the slide keys and its `slots:` changes. */
172
+ /** The first slide's keys live in the headmatter too: id (comments point at it), hidden, number, slots. */
173
+ const FIRST_SLIDE_KEYS = [...SLIDE_KEYS, "slots", "id", "hidden", "number"];
174
+ function pickSlideKeys(head) {
175
+ const out = {};
176
+ for (const k of FIRST_SLIDE_KEYS)
177
+ if (head[k] !== undefined)
178
+ out[k] = head[k];
179
+ return out;
180
+ }
181
+ const str = (v) => (typeof v === "string" ? v.trim() : v == null ? "" : String(v));
182
+ function mapping(text) {
183
+ const data = text.trim() ? parse(text) : {};
184
+ if (data == null)
185
+ return {};
186
+ if (typeof data !== "object" || Array.isArray(data))
187
+ throw new Error("frontmatter must be a mapping");
188
+ return data;
189
+ }
190
+ function tryMapping(text) {
191
+ try {
192
+ const data = parse(text);
193
+ return data != null && typeof data === "object" && !Array.isArray(data) ? data : null;
194
+ }
195
+ catch {
196
+ return null;
197
+ }
198
+ }
@@ -0,0 +1,21 @@
1
+ import { type PresentationData } from "@office-kit/pptx";
2
+ /**
3
+ * Exports of a rendered deck. The PowerPoint model is the one source: the
4
+ * PPTX is the model saved, a slide image is the model drawn by
5
+ * pptx-preview (resvg, no browser), and the PDF is those drawings, one
6
+ * page per slide, written by the small PDF writer below — so the file the
7
+ * client gets, the preview in the editor and what an agent looks at are the
8
+ * same picture.
9
+ */
10
+ export declare const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
11
+ export declare const toPptx: (pres: PresentationData) => Promise<Uint8Array>;
12
+ /** One slide as PNG, `width` pixels wide (16:9 → width × width·9/16). */
13
+ export declare function slidePng(pres: PresentationData, index: number, width?: number): Uint8Array;
14
+ /** Every slide as PNG. */
15
+ export declare const slidePngs: (pres: PresentationData, width?: number) => Uint8Array[];
16
+ /**
17
+ * The deck as PDF: each slide rasterised at `width` pixels and placed on a
18
+ * page of the canvas size in points. Images are raw RGB under FlateDecode —
19
+ * the only encoding every PDF reader supports without a library here.
20
+ */
21
+ export declare function toPdf(pres: PresentationData, size?: "16:9" | "4:3", width?: number): Uint8Array;
@@ -0,0 +1,75 @@
1
+ import { deflateSync } from "node:zlib";
2
+ import { getSlides, savePresentation } from "@office-kit/pptx";
3
+ import { renderSlideToImage, renderSlideToRgba } from "@office-kit/pptx-preview/node";
4
+ import { CANVAS } from "./template.js";
5
+ /**
6
+ * Exports of a rendered deck. The PowerPoint model is the one source: the
7
+ * PPTX is the model saved, a slide image is the model drawn by
8
+ * pptx-preview (resvg, no browser), and the PDF is those drawings, one
9
+ * page per slide, written by the small PDF writer below — so the file the
10
+ * client gets, the preview in the editor and what an agent looks at are the
11
+ * same picture.
12
+ */
13
+ export const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
14
+ export const toPptx = (pres) => savePresentation(pres);
15
+ /** One slide as PNG, `width` pixels wide (16:9 → width × width·9/16). */
16
+ export function slidePng(pres, index, width = 1280) {
17
+ const slide = getSlides(pres)[index];
18
+ if (!slide)
19
+ throw new Error(`no slide ${index + 1}`);
20
+ return renderSlideToImage(pres, slide, { width });
21
+ }
22
+ /** Every slide as PNG. */
23
+ export const slidePngs = (pres, width = 1280) => getSlides(pres).map((_, i) => slidePng(pres, i, width));
24
+ /**
25
+ * The deck as PDF: each slide rasterised at `width` pixels and placed on a
26
+ * page of the canvas size in points. Images are raw RGB under FlateDecode —
27
+ * the only encoding every PDF reader supports without a library here.
28
+ */
29
+ export function toPdf(pres, size = "16:9", width = 1600) {
30
+ const canvas = CANVAS[size];
31
+ const pageW = canvas.w * 72;
32
+ const pageH = canvas.h * 72;
33
+ const pages = getSlides(pres).map((slide) => {
34
+ const { image } = renderSlideToRgba(pres, slide, { width });
35
+ const rgb = Buffer.alloc(image.width * image.height * 3);
36
+ for (let i = 0, j = 0; i < image.data.length; i += 4, j += 3) {
37
+ rgb[j] = image.data[i];
38
+ rgb[j + 1] = image.data[i + 1];
39
+ rgb[j + 2] = image.data[i + 2];
40
+ }
41
+ return { w: image.width, h: image.height, data: deflateSync(rgb) };
42
+ });
43
+ return writePdf(pages, pageW, pageH);
44
+ }
45
+ function writePdf(images, pageW, pageH) {
46
+ const objects = [];
47
+ const add = (body) => {
48
+ objects.push(Buffer.isBuffer(body) ? body : Buffer.from(body, "latin1"));
49
+ return objects.length;
50
+ };
51
+ // 1 catalog, 2 pages; then per slide: image, content, page.
52
+ const catalog = add("<< /Type /Catalog /Pages 2 0 R >>");
53
+ const pagesIdx = add(""); // placeholder, filled once the page ids are known
54
+ const pageIds = [];
55
+ for (const img of images) {
56
+ const imgId = add(Buffer.concat([Buffer.from(`<< /Type /XObject /Subtype /Image /Width ${img.w} /Height ${img.h} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /FlateDecode /Length ${img.data.length} >>\nstream\n`, "latin1"), img.data, Buffer.from("\nendstream", "latin1")]));
57
+ const content = `q ${pageW.toFixed(2)} 0 0 ${pageH.toFixed(2)} 0 0 cm /Im0 Do Q`;
58
+ const contentId = add(`<< /Length ${content.length} >>\nstream\n${content}\nendstream`);
59
+ const pageId = add(`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${pageW.toFixed(2)} ${pageH.toFixed(2)}] /Resources << /XObject << /Im0 ${imgId} 0 R >> >> /Contents ${contentId} 0 R >>`);
60
+ pageIds.push(pageId);
61
+ }
62
+ objects[pagesIdx - 1] = Buffer.from(`<< /Type /Pages /Kids [${pageIds.map((id) => `${id} 0 R`).join(" ")}] /Count ${pageIds.length} >>`, "latin1");
63
+ const parts = [Buffer.from("%PDF-1.4\n%\xE2\xE3\xCF\xD3\n", "latin1")];
64
+ const offsets = [];
65
+ let length = parts[0].length;
66
+ objects.forEach((body, i) => {
67
+ offsets.push(length);
68
+ const chunk = Buffer.concat([Buffer.from(`${i + 1} 0 obj\n`, "latin1"), body, Buffer.from("\nendobj\n", "latin1")]);
69
+ parts.push(chunk);
70
+ length += chunk.length;
71
+ });
72
+ const xref = [`xref\n0 ${objects.length + 1}\n0000000000 65535 f \n`, ...offsets.map((o) => `${String(o).padStart(10, "0")} 00000 n \n`)].join("");
73
+ parts.push(Buffer.from(`${xref}trailer\n<< /Size ${objects.length + 1} /Root ${catalog} 0 R >>\nstartxref\n${length}\n%%EOF\n`, "latin1"));
74
+ return new Uint8Array(Buffer.concat(parts));
75
+ }
@@ -0,0 +1,135 @@
1
+ import type { SlideDef } from "./deck.js";
2
+ import type { LayoutDef, SlotDef, Snippet } from "./template.js";
3
+ /**
4
+ * The slides as HTML: what the editor shows (and edits in place), what
5
+ * present mode and the thumbnails show, what PDF and PNG are printed
6
+ * from and what `render --html` writes. One model per slide (`slideView`):
7
+ * the layout's slots with the slide's own changes, each slot's HTML, its
8
+ * box in stage pixels (1600 wide, 160 per inch) and its look; the theme
9
+ * styles it with plain CSS (`stageCss`). Pure — the web bundles it; the
10
+ * caller says where pictures live (`asset`).
11
+ */
12
+ /** The template as the HTML renderer needs it: no files, no schema. */
13
+ export interface StageTemplate {
14
+ slug: string;
15
+ name: string;
16
+ size: "16:9" | "4:3";
17
+ fonts: {
18
+ heading: string;
19
+ body: string;
20
+ };
21
+ colors: Record<string, string>;
22
+ layouts: Record<string, LayoutDef>;
23
+ default?: string;
24
+ /** Theme CSS; relative URLs already point where the caller serves the template's files. */
25
+ css: string;
26
+ snippets: Snippet[];
27
+ }
28
+ export interface SlotView {
29
+ name: string;
30
+ kind: SlotDef["kind"];
31
+ /** Box in inches (as in the files). */
32
+ x: number;
33
+ y: number;
34
+ w: number;
35
+ h: number;
36
+ size?: number;
37
+ bold?: boolean;
38
+ italic?: boolean;
39
+ color?: string;
40
+ font?: string;
41
+ align?: "left" | "center" | "right";
42
+ valign?: "top" | "middle" | "bottom";
43
+ fill?: string;
44
+ class?: string;
45
+ underline?: boolean;
46
+ strike?: boolean;
47
+ rotate?: number;
48
+ radius?: number;
49
+ border?: number;
50
+ borderColor?: string;
51
+ shadow?: boolean;
52
+ opacity?: number;
53
+ z?: number;
54
+ fit?: "contain" | "cover";
55
+ required?: boolean;
56
+ placeholder?: string;
57
+ /** A slot of the slide's own (not the layout's). */
58
+ own?: boolean;
59
+ /** The slide changes the layout's slot. */
60
+ changed?: boolean;
61
+ /** The slot's markdown, undefined when nothing fills it. */
62
+ md?: string;
63
+ /** What it shows. For `embed`, empty: see `embed`. */
64
+ html: string;
65
+ embed?: {
66
+ src?: string;
67
+ srcdoc?: string;
68
+ };
69
+ /** Why it could not be drawn (a broken chart block). */
70
+ error?: string;
71
+ }
72
+ /** How a slide comes in when presented: fade (the default), slide in from the right, zoom in, or cut (none). */
73
+ export declare const TRANSITIONS: readonly ["fade", "slide", "zoom", "none"];
74
+ export type Transition = (typeof TRANSITIONS)[number];
75
+ export declare const transitionOf: (value: string | undefined) => Transition;
76
+ export interface SlideView {
77
+ layout: string;
78
+ transition: Transition;
79
+ /** A color, or `url(...) center / cover` for a picture. */
80
+ background: string;
81
+ /** Left out of present mode and the exports. */
82
+ hidden: boolean;
83
+ /** Carries its slide number (the theme draws it, usually not on title and section slides): off with the deck's `numbers: false` or the slide's `number: false`. */
84
+ numbered: boolean;
85
+ shapes: {
86
+ x: number;
87
+ y: number;
88
+ w: number;
89
+ h: number;
90
+ fill: string;
91
+ }[];
92
+ slots: SlotView[];
93
+ problems: string[];
94
+ /** The stage in px. */
95
+ width: number;
96
+ height: number;
97
+ }
98
+ export interface RenderOpts {
99
+ /** Where a slide's picture (`assets/arch.png`) is fetched from. */
100
+ asset: (src: string) => string;
101
+ /** The deck's `numbers`: false leaves every slide without its number. */
102
+ numbers?: boolean;
103
+ }
104
+ export declare const stageHeight: (size: "16:9" | "4:3") => number;
105
+ /** A slot's font size in points as stage px. */
106
+ export declare const ptToPx: (pt: number) => number;
107
+ /** Every slot of a slide with its content and look; problems name what the slide asks for and the layout cannot give. */
108
+ export declare function slideView(slide: SlideDef, t: StageTemplate, opts: RenderOpts): SlideView;
109
+ /** A slot's own CSS: its box in stage px and how its text looks. */
110
+ export declare function slotStyle(s: Pick<SlotView, "x" | "y" | "w" | "h" | "size" | "bold" | "italic" | "color" | "font" | "align" | "fill" | "underline" | "strike" | "rotate" | "radius" | "border" | "borderColor" | "shadow" | "opacity" | "z">, t: StageTemplate): Record<string, string>;
111
+ /**
112
+ * The CSS of a deck's slides: the base (boxes, type, lists, tables), the
113
+ * template's colors and fonts as variables, the theme scoped to
114
+ * `.deck-theme-<slug>`, then the deck's own CSS scoped to its slides.
115
+ */
116
+ export declare function stageCss(t: StageTemplate, deckCss?: string): string;
117
+ /** What every slide gets, whatever the theme; `:where()` keeps it weaker than any theme rule. */
118
+ export declare const BASE_CSS = "\n.deck-slide { position: relative; overflow: hidden; isolation: isolate; color: var(--c-text); font-family: var(--font-body); font-size: 28px; line-height: 1.3; text-align: left; letter-spacing: normal; -webkit-font-smoothing: antialiased; }\n.deck-slide :where(*, *::before, *::after) { box-sizing: border-box; }\n.deck-slide .deck-slot { position: absolute; display: flex; flex-direction: column; min-width: 0; padding: 8px 16px; overflow-wrap: break-word; }\n.deck-slide .deck-slot[data-valign=\"middle\"] { justify-content: center; }\n.deck-slide .deck-slot[data-valign=\"bottom\"] { justify-content: flex-end; }\n.deck-slide .deck-content { min-height: 0; outline: none; }\n.deck-slide .deck-shape { position: absolute; }\n.deck-slide :where(h1, h2, h3, h4, h5, h6) { font-family: var(--font-heading); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; margin: 0; font-size: 1.15em; }\n.deck-slide :where(p, ul, ol, blockquote, figure, table, pre, dl) { margin: 0; }\n.deck-slide :where(p, ul, ol, table, pre, blockquote, figure, div, h1, h2, h3, h4) + :where(p, ul, ol, table, pre, blockquote, figure, h1, h2, h3, h4) { margin-top: 0.5em; }\n.deck-slide :where(ul, ol) { padding-left: 1.15em; }\n.deck-slide :where(ul) { list-style: disc; }\n.deck-slide :where(ol) { list-style: decimal; }\n.deck-slide :where(ul ul) { list-style: circle; }\n.deck-slide :where(li + li) { margin-top: 0.25em; }\n.deck-slide :where(li)::marker { color: var(--c-accent); }\n.deck-slide :where(strong, b) { font-weight: 700; }\n.deck-slide :where(em, i) { font-style: italic; }\n.deck-slide :where(a) { color: var(--c-accent); text-decoration: underline; text-underline-offset: 0.12em; }\n.deck-slide :where(code) { font-family: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace; font-size: 0.9em; color: var(--c-accent); }\n.deck-slide :where(pre) { font-size: 0.7em; line-height: 1.4; background: var(--c-surface); border: 1px solid var(--c-line); padding: 0.6em 0.8em; border-radius: 0.3em; white-space: pre-wrap; }\n.deck-slide :where(pre code) { color: inherit; font-size: 1em; }\n.deck-slide :where(blockquote) { border-left: 4px solid var(--c-accent); padding-left: 0.8em; color: var(--c-muted); }\n.deck-slide :where(img, svg, video) { max-width: 100%; }\n.deck-slide :where(table) { border-collapse: collapse; width: 100%; font-size: 0.95em; }\n.deck-slide :where(th, td) { padding: 0.45em 0.65em; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }\n.deck-slide :where(th) { font-weight: 700; border-bottom: 2px solid var(--c-text); }\n.deck-slide .kind-image .deck-content, .deck-slide .kind-chart .deck-content, .deck-slide .kind-embed .deck-content { flex: 1; display: flex; align-items: center; justify-content: center; }\n.deck-slide .kind-image img { width: 100%; height: 100%; object-fit: contain; display: block; }\n.deck-slide .kind-image[data-fit=\"cover\"] img { object-fit: cover; }\n.deck-slide .kind-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }\n.deck-slide .kind-embed iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }\n.deck-slide .kind-image, .deck-slide .kind-chart, .deck-slide .kind-embed { padding: 0; }\n.deck-slide .deck-error { color: #B91C1C; font-size: 0.6em; font-family: ui-monospace, Menlo, monospace; }\n";
119
+ /** One slide as an HTML string (the export's, the print's and the CLI's form of what the editor shows). */
120
+ export declare function slideHtml(v: SlideView, t: StageTemplate, extraClass?: string, number?: {
121
+ n: number;
122
+ of: number;
123
+ }): string;
124
+ /**
125
+ * The deck as one HTML file: every slide, the theme, arrows and space to
126
+ * step through, F for full screen, P to print (a PDF, one slide a page).
127
+ * The caller inlines the pictures and fonts (`asset` returning data URLs,
128
+ * the theme's URLs rewritten) so the file stands alone.
129
+ */
130
+ export declare function standaloneHtml(deck: {
131
+ title: string;
132
+ slides: SlideDef[];
133
+ css?: string;
134
+ numbers?: false;
135
+ }, t: StageTemplate, opts: RenderOpts): string;