decklight 0.8.1 → 0.10.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 (138) hide show
  1. package/PLATFORM.md +707 -0
  2. package/README.md +226 -150
  3. package/SPEC.md +803 -888
  4. package/cli/agent-review.mjs +246 -0
  5. package/cli/agents.mjs +35 -9
  6. package/cli/associate.mjs +12 -12
  7. package/cli/audit.mjs +42 -10
  8. package/cli/banner.mjs +41 -17
  9. package/cli/bundle-audio.mjs +190 -0
  10. package/cli/bundle-module.mjs +95 -0
  11. package/cli/bundle.mjs +439 -35
  12. package/cli/cast.mjs +48 -12
  13. package/cli/check-fixes.mjs +186 -0
  14. package/cli/check.mjs +988 -0
  15. package/cli/clone-deck.mjs +179 -0
  16. package/cli/commands.mjs +345 -0
  17. package/cli/comments.mjs +64 -18
  18. package/cli/commit-flow.mjs +51 -22
  19. package/cli/commit-message.mjs +51 -74
  20. package/cli/commit-split.mjs +601 -0
  21. package/cli/deck-refs.mjs +64 -0
  22. package/cli/deck-routes.mjs +67 -0
  23. package/cli/deckfile.mjs +3 -5
  24. package/cli/decklight.mjs +68 -289
  25. package/cli/design-system-deps.mjs +209 -0
  26. package/cli/design-system-edit.mjs +194 -0
  27. package/cli/design-system-refs.mjs +666 -0
  28. package/cli/design-system.mjs +497 -0
  29. package/cli/doctor.mjs +115 -0
  30. package/cli/edit-git.mjs +353 -0
  31. package/cli/edit-handover.mjs +551 -0
  32. package/cli/edit-look.mjs +631 -0
  33. package/cli/edit-slides.mjs +683 -0
  34. package/cli/edit.mjs +2585 -855
  35. package/cli/enhance.mjs +485 -0
  36. package/cli/extension.mjs +10 -10
  37. package/cli/font-refs.mjs +273 -0
  38. package/cli/font.mjs +246 -0
  39. package/cli/git-tree.mjs +1 -1
  40. package/cli/git.mjs +78 -11
  41. package/cli/import.mjs +56 -10
  42. package/cli/init.mjs +407 -236
  43. package/cli/library.mjs +127 -0
  44. package/cli/loader.mjs +3 -1
  45. package/cli/marketplace-autocheck.mjs +200 -0
  46. package/cli/marketplace.mjs +460 -29
  47. package/cli/narrate.mjs +251 -0
  48. package/cli/open-browser.mjs +63 -0
  49. package/cli/open.mjs +961 -0
  50. package/cli/pdf.mjs +64 -17
  51. package/cli/pkg.mjs +44 -2
  52. package/cli/plugin.mjs +43 -41
  53. package/cli/port-conflict.mjs +53 -23
  54. package/cli/pptx-export.mjs +63 -27
  55. package/cli/publish.mjs +8 -4
  56. package/cli/qr.mjs +1 -1
  57. package/cli/record.mjs +85 -23
  58. package/cli/remote.mjs +43 -17
  59. package/cli/restore.mjs +11 -4
  60. package/cli/review-ref.mjs +125 -0
  61. package/cli/review-remote.mjs +92 -48
  62. package/cli/review-routes.mjs +254 -0
  63. package/cli/review-store.mjs +47 -7
  64. package/cli/review-submit.mjs +47 -57
  65. package/cli/runtime-link.mjs +560 -0
  66. package/cli/serve.mjs +236 -45
  67. package/cli/setup.mjs +112 -0
  68. package/cli/sign.mjs +1 -1
  69. package/cli/skill-content.mjs +229 -35
  70. package/cli/skills.mjs +353 -26
  71. package/cli/start.mjs +110 -0
  72. package/cli/supervise.mjs +6 -6
  73. package/cli/theme-refs.mjs +527 -0
  74. package/cli/theme.mjs +181 -137
  75. package/cli/trust.mjs +83 -0
  76. package/cli/units.mjs +112 -47
  77. package/cli/update-check.mjs +1 -5
  78. package/cli/upgrade.mjs +194 -28
  79. package/cli/upstream.mjs +4 -3
  80. package/cli/util.mjs +4 -4
  81. package/cli/wizard.mjs +6 -6
  82. package/dist/build-info.json +1 -1
  83. package/dist/decklight.css +1533 -59
  84. package/dist/decklight.js +258 -115
  85. package/dist/decklight.js.map +4 -4
  86. package/docs/GLOSSARY.md +141 -0
  87. package/docs/architecture.svg +17 -17
  88. package/package.json +4 -2
  89. package/themes/README.md +9 -8
  90. package/themes/reveal-solarized.css +10 -0
  91. package/tools/args.mjs +20 -0
  92. package/tools/atomic-write.mjs +48 -0
  93. package/tools/brand-palette.mjs +717 -0
  94. package/tools/bridge.mjs +1 -1
  95. package/tools/build-groups.mjs +42 -0
  96. package/tools/color.mjs +48 -0
  97. package/tools/deck-html.mjs +396 -11
  98. package/tools/design-system-format.mjs +778 -0
  99. package/tools/design-system-migrations.mjs +207 -0
  100. package/tools/elevenlabs-tts.mjs +110 -17
  101. package/tools/exec.mjs +11 -3
  102. package/tools/extension-check.mjs +31 -7
  103. package/tools/font-format.mjs +190 -0
  104. package/tools/font-stacks.mjs +24 -0
  105. package/tools/gemini-tts.mjs +3 -0
  106. package/tools/lipsync-config.mjs +103 -0
  107. package/tools/lipsync-engines.mjs +205 -2
  108. package/tools/lipsync-server.mjs +264 -41
  109. package/tools/lipsync.mjs +37 -18
  110. package/tools/local-voice.mjs +32 -42
  111. package/tools/narration-manifest.mjs +270 -0
  112. package/tools/narration-synth.mjs +416 -0
  113. package/tools/pptx.mjs +776 -19
  114. package/tools/publish-targets.mjs +1 -1
  115. package/tools/publish-voices.mjs +3 -3
  116. package/tools/recording-impact.mjs +7 -3
  117. package/tools/render-theme.mjs +33 -0
  118. package/tools/review-anchor.mjs +28 -12
  119. package/tools/semver.mjs +40 -0
  120. package/tools/sentences.mjs +180 -0
  121. package/tools/shot.mjs +14 -7
  122. package/tools/site-clip.mjs +114 -0
  123. package/tools/site-voices.mjs +232 -0
  124. package/tools/template-theme.mjs +1 -1
  125. package/tools/test-impact.mjs +17 -10
  126. package/tools/theme-check.mjs +30 -3
  127. package/tools/tts-cache.mjs +4 -3
  128. package/tools/tts-engines.mjs +38 -20
  129. package/tools/tts-setup.mjs +7 -7
  130. package/tools/video-options.mjs +34 -0
  131. package/tools/video.mjs +530 -54
  132. package/tools/voiceover-server.mjs +185 -104
  133. package/tools/voiceover.mjs +119 -261
  134. package/tools/zip.mjs +1 -1
  135. package/cli/dev.mjs +0 -623
  136. package/cli/present.mjs +0 -853
  137. package/cli/review.mjs +0 -361
  138. package/tools/publish-site-voices.mjs +0 -75
package/cli/cast.mjs CHANGED
@@ -6,7 +6,7 @@
6
6
  * decklight-cast — record truthful terminal casts for Decklight decks (SPEC RECORDER_CLI/CAST_FORMAT).
7
7
  *
8
8
  * decklight cast <script.term.yaml> [-o out.cast.json] [--allow-fail] [--quiet]
9
- * decklight refresh <dir | cast.json…> [--allow-fail]
9
+ * decklight cast refresh <dir | cast.json…> [--allow-fail]
10
10
  *
11
11
  * This briefly shipped as `decklight rec`, a name dropped without an alias or
12
12
  * a refusal stub: `rec` reads as an abbreviation of `record`, and `decklight
@@ -113,6 +113,23 @@ function shellArgs(shellPath) {
113
113
  return [];
114
114
  }
115
115
 
116
+ /**
117
+ * The two lines a step is written as: the command in a brace group, and the
118
+ * sentinel that marks its end. A command stopped with Ctrl-C (an `interact`
119
+ * send of \u0003, the way a server is ended) used to take the sentinel with
120
+ * it: an interactive shell abandons the rest of the line on an interrupt, so
121
+ * the marker never printed and the step timed out. zsh's `always` block runs
122
+ * after an interrupt and bash's INT trap fires on one, both printing the
123
+ * marker with the interrupt's status (130); any other shell keeps the plain
124
+ * form.
125
+ */
126
+ export function stepLine(shellBase, cmd) {
127
+ const mark = (status) => `printf '${GS_OCTAL}DECKLIGHT:%d:${GS_OCTAL}\\n' ${status}`;
128
+ if (shellBase === 'zsh') return `{\n${cmd}\n} always { ${mark('$?')} }\n`;
129
+ if (shellBase === 'bash') return `trap "${mark(130).replace(/"/g, '\\"')}" INT; {\n${cmd}\n}; ${mark('$?')}; trap - INT\n`;
130
+ return `{\n${cmd}\n}; ${mark('$?')}\n`;
131
+ }
132
+
116
133
  function setupLine(shellBase) {
117
134
  const common = `stty -echo; printf '${GS_OCTAL}DECKLIGHT-READY${GS_OCTAL}\\n'`;
118
135
  if (shellBase === 'zsh') return `unsetopt zle prompt_cr prompt_sp banghist 2>/dev/null; PS1=''; PROMPT=''; PS2=''; PROMPT2=''; ${common}\n`;
@@ -165,6 +182,7 @@ export async function recordScript(script, { scriptDir, allowFail = false, log =
165
182
  let onChunk = null; // (data) => void — active step's collector
166
183
  let shellDead = false;
167
184
  let onExitCb = null;
185
+ let finished = false; // every step recorded — the shell is idle at its prompt
168
186
  term.onData(d => { buffer += d; if (onChunk) onChunk(d); });
169
187
  term.onExit(() => { shellDead = true; if (onExitCb) onExitCb(); });
170
188
 
@@ -217,7 +235,7 @@ export async function recordScript(script, { scriptDir, allowFail = false, log =
217
235
  // lines while parsing, so nothing is buffered for the command's stdin —
218
236
  // interact sends are the only input it can see. The lone `}` line also
219
237
  // makes trailing `#` comments in cmd harmless.
220
- term.write(`{\n${step.cmd}\n}; printf '${GS_OCTAL}DECKLIGHT:%d:${GS_OCTAL}\\n' $?\n`);
238
+ term.write(stepLine(path.basename(shellPath), step.cmd));
221
239
 
222
240
  // interact: watch output, answer prompts (expect/send) — runs alongside
223
241
  // the sentinel wait; secrets are sent for real but recorded as ▓▓▓ and
@@ -225,7 +243,7 @@ export async function recordScript(script, { scriptDir, allowFail = false, log =
225
243
  const interacts = Array.isArray(step.interact) ? step.interact : [];
226
244
  const inputs = [];
227
245
  const stepRedactions = [];
228
- let interactState = { done: interacts.length === 0, error: null, pending: null, cancelled: false };
246
+ let interactState = { done: interacts.length === 0, error: null, pending: null, cancelled: false, interrupted: false };
229
247
  if (interacts.length) {
230
248
  (async () => {
231
249
  let searchFrom = 0;
@@ -249,6 +267,7 @@ export async function recordScript(script, { scriptDir, allowFail = false, log =
249
267
  display = text;
250
268
  }
251
269
  inputs.push([round3(Number(process.hrtime.bigint() - t0) / 1e9), display]);
270
+ if (text.includes('\x03')) interactState.interrupted = true;
252
271
  term.write(text);
253
272
  interactState.pending = null;
254
273
  }
@@ -310,14 +329,31 @@ export async function recordScript(script, { scriptDir, allowFail = false, log =
310
329
  ...(inClamped.length ? { input: inClamped } : {}),
311
330
  });
312
331
  log(` ✓ ${step.cmd} (exit ${exit}, ${duration.toFixed(2)}s)`);
313
- if (exit !== 0 && !allowFail) {
332
+ // 130 is how a command ends when the script itself pressed Ctrl-C:
333
+ // that is the step working (a server stopped), not failing
334
+ if (exit !== 0 && !(exit === 130 && interactState.interrupted) && !allowFail) {
314
335
  throw new Error(`step ${idx + 1} exited ${exit}: ${step.cmd} (use --allow-fail to record failures as content)`);
315
336
  }
316
337
  }
338
+ finished = true;
317
339
  return steps;
318
340
  } finally {
319
- try { term.write('exit\n'); } catch { /* already dead */ }
320
- await new Promise(res => { if (shellDead) return res(); onExitCb = res; setTimeout(res, 1500); });
341
+ // A run that completed leaves the shell at its prompt, where `exit` ends
342
+ // it in a few milliseconds. A run that bailed mid-step (a timeout, an
343
+ // abort) leaves that command in the foreground, where `exit` would only
344
+ // queue behind it until the cap below gave up — so that shell is hung up
345
+ // on directly, which takes its foreground job with it.
346
+ if (finished) { try { term.write('exit\n'); } catch { /* already dead */ } }
347
+ else { try { term.kill(); } catch { /* already dead */ } }
348
+ // The cap is a fallback, so it must not outlive the exit it guards: a
349
+ // pending timer keeps the event loop alive, and this one held every
350
+ // recording open for its full 1.5s after the shell had already gone —
351
+ // ~1.5s per `rec` on a 100ms recording, and the bulk of test/cast.test.mjs.
352
+ await new Promise(res => {
353
+ if (shellDead) return res();
354
+ const cap = setTimeout(res, 1500);
355
+ onExitCb = () => { clearTimeout(cap); res(); };
356
+ });
321
357
  try { term.kill(); } catch { /* already dead */ }
322
358
  }
323
359
  }
@@ -457,12 +493,12 @@ async function refresh(targets, { allowFail }) {
457
493
  // --------------------------------------------------------------------- main
458
494
 
459
495
  const HELP = `decklight cast — record terminal casts for Decklight decks
460
- (recording your VOICE narrating a deck is a different command: decklight record)
496
+ (recording your VOICE narrating a deck is a different command: decklight narrate --mic)
461
497
 
462
498
  Usage:
463
499
  decklight cast <script.term.yaml> [-o out.cast.json] [--allow-fail] [--quiet]
464
- decklight refresh <dir | cast.json…> [--allow-fail]
465
- decklight export <cast.json> [-o out.cast] # asciicast v2
500
+ decklight cast refresh <dir | cast.json…> [--allow-fail]
501
+ decklight cast export <cast.json> [-o out.cast] # asciicast v2
466
502
 
467
503
  Script format (YAML):
468
504
  shell: zsh # default: $SHELL (rc files are skipped: zsh -f / bash --norc)
@@ -496,9 +532,9 @@ Notes:
496
532
  that step's output and are stored as ▓▓▓ in the cast's input record. Prefer the
497
533
  $ENV form — a literal secret is scrubbed from the embedded script, which makes
498
534
  that cast non-refreshable.
499
- • --refresh re-executes the script embedded in each cast and rewrites on drift.
500
- • export writes asciicast v2 for the asciinema ecosystem — e.g. a GIF for docs:
501
- decklight export demo.cast.json && agg demo.cast demo.gif
535
+ • cast refresh re-executes the script embedded in each cast and rewrites on drift.
536
+ • cast export writes asciicast v2 for the asciinema ecosystem — e.g. a GIF for docs:
537
+ decklight cast export demo.cast.json && agg demo.cast demo.gif
502
538
  `;
503
539
 
504
540
  export async function castMain(argv = process.argv.slice(2)) {
@@ -0,0 +1,186 @@
1
+ // Copyright 2026 Gilles Philippart
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /**
5
+ * The quick fixes Check deck… offers for what `decklight check` finds (SPEC
6
+ * PRESENTING_EDITING). Pure over the deck's text and the resolved design
7
+ * systems: nothing here writes, spawns or reads the clock. The edit server's
8
+ * `GET /deck/edit/check` runs `quickFixes` over the static findings so every
9
+ * row the panel shows carries what pressing its fix WOULD do, and its
10
+ * `POST /deck/edit/check/fix` applies the transforms below.
11
+ *
12
+ * Two kinds of fix (the issue's distinction, #889). A DETERMINISTIC one is a
13
+ * rename or a setting the server can apply itself, in one write:
14
+ *
15
+ * ds-behind migrate design-system migrate (DESIGN_SYSTEM_MIGRATIONS)
16
+ * theme-off-brand theme the theme the brand's migration renames it to,
17
+ * else the brand's first theme
18
+ * off-role rename a renamed role → its successor, on that slide
19
+ * (batchable: ⇧F does every slide at once)
20
+ * ds-unresolved update marketplace update <marketplace>
21
+ * ds-unknown-system add design-system add <name>@<marketplace>, when a
22
+ * registered marketplace offers one of that name
23
+ *
24
+ * Everything else — clipped and crowded slides, ⟨CLICK⟩s against builds, a
25
+ * literal off the palette, a slot left empty — is a JUDGEMENT fix: the panel
26
+ * hands it to the A agent as an ordinary ask (src/core/deckcheck.js writes
27
+ * that prompt, since the live page has findings of its own), and nothing
28
+ * here claims one.
29
+ */
30
+
31
+ import { deckDesignSystems } from './check.mjs';
32
+ import { configBlock } from './runtime-link.mjs';
33
+ import { deckBehind, designSystemRefs, marketplaceDesignSystems, planMigration } from './design-system-refs.mjs';
34
+ import { configHome, loadRegistry } from './marketplace.mjs';
35
+ import { applyRenames, composeRenames, findRenamed, migrationsOf } from '../tools/design-system-migrations.mjs';
36
+ import { tokenPrefixOf } from '../tools/design-system-format.mjs';
37
+ import { locateSlide, sectionBodies } from '../tools/deck-html.mjs';
38
+
39
+ /** The rules whose fix is deterministic and safe to apply to every slide at once. */
40
+ export const BATCH_RULES = ['off-role'];
41
+
42
+ const readConfig = (html) => { try { return JSON.parse(configBlock(html)?.inner ?? 'null') ?? {}; } catch { return {}; } };
43
+
44
+ /**
45
+ * The role renames every design system the deck uses declares, composed
46
+ * across its migrations: `[{ prefix, roles }]`. ALL its migrations, not
47
+ * only the pending ones: an off-role that still meets a renamed role is a
48
+ * deck recorded at the current version with an old name left in it, which
49
+ * is exactly the case `ds-behind` does not cover (SPEC
50
+ * DESIGN_SYSTEM_MIGRATIONS).
51
+ */
52
+ function roleRenames(systems) {
53
+ const out = [];
54
+ for (const sys of systems.values()) {
55
+ const mm = sys.migrationManifest;
56
+ if (!mm) continue;
57
+ const roles = composeRenames(migrationsOf(mm)).roles;
58
+ if (Object.keys(roles).length) out.push({ prefix: tokenPrefixOf(mm), roles });
59
+ }
60
+ return out;
61
+ }
62
+
63
+ /** The renamed roles slide `n` still uses, as `findRenamed` names them. */
64
+ function renamedRolesOn(html, n, systems) {
65
+ const body = sectionBodies(html)[n - 1];
66
+ if (!body) return [];
67
+ return roleRenames(systems).flatMap(({ prefix, roles }) => findRenamed([body], { roles }, prefix));
68
+ }
69
+
70
+ /**
71
+ * The theme a deck held to its brand should wear instead of the off-brand
72
+ * one its configuration names (SPEC BRAND_PALETTE): the one a design
73
+ * system's migration renames it to, when that is a brand theme, else the
74
+ * brand's first theme, which is what the runtime opens on. Null when the
75
+ * deck is not off its brand or the brand has no themes.
76
+ */
77
+ export function offBrandTarget(html, systems = deckDesignSystems(html)) {
78
+ const config = readConfig(html);
79
+ if (config.brandThemesOnly === false || typeof config.theme !== 'string' || !config.theme) return null;
80
+ const brand = [...systems.values()].flatMap((sys) => sys.themeNames ?? []);
81
+ if (!brand.length || brand.includes(config.theme)) return null;
82
+ for (const sys of systems.values()) {
83
+ const mm = sys.migrationManifest;
84
+ const to = mm ? composeRenames(migrationsOf(mm)).themes[config.theme]?.to : null;
85
+ if (to && brand.includes(to)) return { from: config.theme, to, renamed: true };
86
+ }
87
+ return { from: config.theme, to: brand[0], renamed: false };
88
+ }
89
+
90
+ /**
91
+ * A renamed role moved to its successor on slide `n`, or on every slide
92
+ * (`n` null): `{ html, count, slides }`, the markup otherwise byte for byte.
93
+ * The head and the tail are never touched — a role a stylesheet writes is
94
+ * the migration's, not a slide's.
95
+ */
96
+ export function renameRoles(html, n, systems = deckDesignSystems(html)) {
97
+ const renames = roleRenames(systems);
98
+ const total = sectionBodies(html).length;
99
+ const targets = n ? [n] : Array.from({ length: total }, (_, i) => i + 1);
100
+ let out = html;
101
+ let count = 0;
102
+ const slides = [];
103
+ for (const slide of targets) {
104
+ if (slide < 1 || slide > total) continue;
105
+ const { parts, idx } = locateSlide(out, slide);
106
+ let body = parts[idx];
107
+ let here = 0;
108
+ for (const { prefix, roles } of renames) {
109
+ const r = applyRenames(body, { roles }, prefix);
110
+ body = r.text;
111
+ here += r.count;
112
+ }
113
+ if (!here) continue;
114
+ parts[idx] = body;
115
+ out = parts.join('');
116
+ count += here;
117
+ slides.push(slide);
118
+ }
119
+ return { html: out, count, slides };
120
+ }
121
+
122
+ /** `name@marketplace` → its marketplace, when the reference is spelled so. */
123
+ const marketplaceOf = (ref) => /^[^@\s]+@([\w-]+)$/.exec(String(ref ?? ''))?.[1] ?? null;
124
+
125
+ /**
126
+ * The static findings, each with the deterministic fix the server can apply
127
+ * for it (`fix: { kind, label, … }`) — or none, which the panel says in so
128
+ * many words. `label` is what the fix WILL do, written on the row (*Migrate
129
+ * to acme 3.0.0 · 3 renames*), never a verb alone.
130
+ */
131
+ export function quickFixes(findings, html, dir, { home = configHome(), deck = 'deck.html', systems = null } = {}) {
132
+ const sys = systems ?? (designSystemRefs(html).length ? deckDesignSystems(html) : new Map());
133
+ let behind = null;
134
+ let offered = null;
135
+ const registered = () => { try { return Object.keys(loadRegistry(home).marketplaces ?? {}); } catch { return []; } };
136
+ const fixFor = (f) => {
137
+ switch (f.rule) {
138
+ case 'ds-behind': {
139
+ behind ??= deckBehind(html, dir, home, { deck });
140
+ const b = behind.find((x) => f.message.startsWith(`${x.ref} `)) ?? behind[0];
141
+ if (!b) return null;
142
+ const plan = planMigration(html, dir, b.ref, home);
143
+ if (plan.error || !plan.changed) return null;
144
+ return {
145
+ kind: 'migrate', ref: b.ref,
146
+ label: `Migrate to ${plan.name} ${plan.version}${plan.renamed ? ` · ${plan.renamed} rename${plan.renamed === 1 ? '' : 's'}` : ''}`,
147
+ ...(b.skills.length ? { skills: b.skills } : {}),
148
+ };
149
+ }
150
+ case 'theme-off-brand': {
151
+ const t = offBrandTarget(html, sys);
152
+ return t ? { kind: 'theme', theme: t.to, label: `Switch to ${t.to}${t.renamed ? ` (${t.from} was renamed)` : ', the brand’s first theme'}` } : null;
153
+ }
154
+ case 'off-role': {
155
+ if (!f.slide) return null;
156
+ const found = renamedRolesOn(html, f.slide, sys);
157
+ if (!found.length) return null;
158
+ return {
159
+ kind: 'rename', slide: f.slide, batch: true,
160
+ label: `Rename ${found.length === 1 ? `${found[0].from} → ${found[0].to}` : `${found.length} roles to their successors`} on slide ${f.slide}`,
161
+ };
162
+ }
163
+ case 'ds-unresolved': {
164
+ const ref = /^design system (\S+) cannot be read/.exec(f.message)?.[1];
165
+ const name = marketplaceOf(ref);
166
+ if (!name || !registered().includes(name)) return null;
167
+ return { kind: 'marketplace-update', name, label: `Update the ${name} marketplace` };
168
+ }
169
+ case 'ds-unknown-system': {
170
+ const want = /no design system called "([^"]+)"/.exec(f.message)?.[1];
171
+ if (!want) return null;
172
+ offered ??= marketplaceDesignSystems(home).systems;
173
+ const hit = offered.find((s) => s.name === want && !s.missing);
174
+ return hit ? { kind: 'design-system-add', ref: hit.qualified, label: `Add ${hit.qualified} to the deck` } : null;
175
+ }
176
+ default: return null;
177
+ }
178
+ };
179
+ return findings.map((f) => {
180
+ const fix = fixFor(f);
181
+ return fix ? { ...f, fix } : f;
182
+ });
183
+ }
184
+
185
+ /** `fix: <rule> on slide N`, or `fix: <rule>` for the deck — the commit a quick fix makes. */
186
+ export const fixSubject = (rule, slide = null) => `fix: ${rule}${slide ? ` on slide ${slide}` : ''}`;