decklight 0.1.0 → 0.3.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 (139) hide show
  1. package/LICENSE +202 -21
  2. package/README.md +105 -183
  3. package/SPEC.md +861 -74
  4. package/cli/agents.mjs +206 -0
  5. package/cli/associate.mjs +279 -0
  6. package/cli/audit.mjs +424 -0
  7. package/cli/bundle.mjs +210 -45
  8. package/cli/deckfile.mjs +233 -0
  9. package/cli/decklight.mjs +216 -5
  10. package/cli/dev.mjs +455 -0
  11. package/cli/edit.mjs +733 -63
  12. package/cli/extension.mjs +108 -0
  13. package/cli/git.mjs +141 -0
  14. package/cli/import.mjs +398 -0
  15. package/cli/init.mjs +465 -121
  16. package/cli/loader.mjs +263 -0
  17. package/cli/marketplace.mjs +730 -0
  18. package/cli/pdf.mjs +156 -0
  19. package/cli/pkg.mjs +69 -0
  20. package/cli/plugin.mjs +646 -0
  21. package/cli/port-conflict.mjs +94 -0
  22. package/cli/present.mjs +560 -0
  23. package/cli/publish.mjs +342 -0
  24. package/cli/qr.mjs +334 -0
  25. package/cli/rec.mjs +12 -8
  26. package/cli/remote.mjs +149 -0
  27. package/cli/report-bug.mjs +97 -0
  28. package/cli/restore.mjs +174 -0
  29. package/cli/serve.mjs +247 -0
  30. package/cli/sign.mjs +216 -0
  31. package/cli/skill-content.mjs +222 -0
  32. package/cli/skills.mjs +338 -0
  33. package/cli/supervise.mjs +57 -0
  34. package/cli/theme.mjs +201 -0
  35. package/cli/units.mjs +488 -0
  36. package/cli/upgrade.mjs +250 -0
  37. package/cli/util.mjs +90 -0
  38. package/cli/wizard.mjs +432 -0
  39. package/cli/zip.mjs +121 -0
  40. package/dist/decklight.css +949 -72
  41. package/dist/decklight.js +220 -103
  42. package/dist/decklight.js.map +4 -4
  43. package/docs/architecture.svg +1 -1
  44. package/package.json +9 -6
  45. package/themes/README.md +6 -4
  46. package/themes/aurora.css +4 -1
  47. package/themes/berry.css +4 -1
  48. package/themes/carbon.css +4 -1
  49. package/themes/citrus.css +4 -1
  50. package/themes/coastal.css +4 -1
  51. package/themes/cosmos.css +4 -1
  52. package/themes/dune.css +4 -1
  53. package/themes/eclipse.css +4 -1
  54. package/themes/ember.css +4 -1
  55. package/themes/fjord.css +4 -1
  56. package/themes/gallery.html +3 -11
  57. package/themes/glacier.css +4 -1
  58. package/themes/graphite.css +4 -1
  59. package/themes/harvest.css +4 -1
  60. package/themes/ibm-modern.css +4 -1
  61. package/themes/ink.css +4 -1
  62. package/themes/latte.css +4 -1
  63. package/themes/linen.css +4 -1
  64. package/themes/meadow.css +4 -1
  65. package/themes/metropolis.css +4 -1
  66. package/themes/midnight.css +4 -1
  67. package/themes/mint.css +4 -1
  68. package/themes/moss.css +4 -1
  69. package/themes/obsidian.css +4 -1
  70. package/themes/orchid.css +4 -1
  71. package/themes/packs.json +4 -31
  72. package/themes/paper.css +4 -1
  73. package/themes/peony.css +4 -1
  74. package/themes/porcelain.css +4 -1
  75. package/themes/reveal-beige.css +4 -1
  76. package/themes/reveal-black.css +4 -1
  77. package/themes/reveal-blood.css +4 -1
  78. package/themes/reveal-dracula.css +4 -1
  79. package/themes/reveal-league.css +4 -1
  80. package/themes/reveal-moon.css +4 -1
  81. package/themes/reveal-night.css +4 -1
  82. package/themes/reveal-serif.css +4 -1
  83. package/themes/reveal-simple.css +4 -1
  84. package/themes/reveal-sky.css +4 -1
  85. package/themes/reveal-solarized.css +4 -1
  86. package/themes/reveal-white.css +4 -1
  87. package/themes/sepia.css +4 -1
  88. package/themes/seriph.css +4 -1
  89. package/themes/slate.css +4 -1
  90. package/themes/storm.css +4 -1
  91. package/themes/synthwave.css +4 -1
  92. package/themes/velvet.css +4 -1
  93. package/themes/yamabuki.css +120 -0
  94. package/tools/args.mjs +32 -0
  95. package/tools/bridge.mjs +30 -0
  96. package/tools/chrome.mjs +52 -0
  97. package/tools/color.mjs +110 -0
  98. package/tools/deck-html.mjs +138 -0
  99. package/tools/elevenlabs-tts.mjs +248 -0
  100. package/tools/escape.mjs +40 -0
  101. package/tools/extension-check-runner.mjs +41 -0
  102. package/tools/extension-check.mjs +266 -0
  103. package/tools/gemini-tts.mjs +44 -4
  104. package/tools/lipsync-engines.mjs +81 -0
  105. package/tools/lipsync-server.mjs +290 -0
  106. package/tools/lipsync.mjs +181 -0
  107. package/tools/local-voice.mjs +209 -0
  108. package/tools/ooxml.mjs +151 -0
  109. package/tools/pptx.mjs +320 -0
  110. package/tools/publish-site-voices.mjs +5 -1
  111. package/tools/publish-targets.mjs +143 -0
  112. package/tools/publish-voices.mjs +230 -0
  113. package/tools/shot.mjs +129 -0
  114. package/tools/theme-check.mjs +139 -0
  115. package/tools/tts-engines.mjs +455 -0
  116. package/tools/tts-setup.mjs +257 -0
  117. package/tools/veo.mjs +204 -0
  118. package/tools/video.mjs +316 -0
  119. package/tools/visemes.mjs +26 -0
  120. package/tools/voiceover-server.mjs +0 -0
  121. package/tools/voiceover.mjs +73 -39
  122. package/tools/zip.mjs +143 -0
  123. package/docs/demo.svg +0 -124
  124. package/themes/aliens.css +0 -84
  125. package/themes/apple2.css +0 -126
  126. package/themes/blade-runner.css +0 -83
  127. package/themes/c64.css +0 -85
  128. package/themes/friends.css +0 -82
  129. package/themes/gameboy.css +0 -118
  130. package/themes/genesis.css +0 -84
  131. package/themes/godfather.css +0 -82
  132. package/themes/ibm-oldschool.css +0 -84
  133. package/themes/miami-vice.css +0 -84
  134. package/themes/pulp-fiction.css +0 -84
  135. package/themes/severance.css +0 -82
  136. package/themes/snes.css +0 -82
  137. package/themes/star-wars.css +0 -85
  138. package/themes/stranger-things.css +0 -84
  139. package/themes/terminator.css +0 -84
package/cli/decklight.mjs CHANGED
@@ -1,18 +1,39 @@
1
1
  #!/usr/bin/env node
2
+ // Copyright 2026 Gilles Philippart
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
2
5
  /**
3
6
  * decklight — the Decklight command line.
4
7
  *
5
8
  * decklight rec record a terminal cast from a YAML script
6
9
  * decklight refresh re-run embedded scripts, rewrite drifted casts
7
10
  * decklight export convert a cast to asciicast v2
11
+ * decklight pdf render a deck to a PDF — one slide per page, no print dialog
12
+ * decklight theme validate a theme file, or install one into a deck
13
+ * decklight import convert a PowerPoint/Keynote/Google Slides deck into a decklight deck
8
14
  * decklight bundle flatten a deck into one self-contained HTML file
15
+ * decklight upgrade bring a self-contained deck's inlined runtime up to the installed version
16
+ * decklight publish bundle a deck and push it to a gh-pages branch
17
+ * decklight marketplace register catalogs of themes, templates, skills and engines
18
+ * decklight plugin install your own presenter chrome (timer, teleprompter) — never enters a deck
19
+ * decklight template install deck templates for `init --from`
20
+ * decklight importer install import adapters for formats decklight cannot read itself
21
+ * decklight transform install build-time transforms, run via `bundle --transform <name>`
22
+ * decklight engine install a speech engine beyond the six built in — the N picker then offers it
23
+ * decklight extension check a transform file — the marketplace admission gate, not a bundle step
24
+ * decklight voice add a marketplace voice to the N picker — a reference, never a model
25
+ * decklight agent teach A a coding agent beyond the built-in roster — a descriptor, never code
9
26
  * decklight tts serve the live voice bridge (on-the-fly Gemini narration)
27
+ * decklight lipsync serve the lip-sync bridge (character visemes + talking-head video)
28
+ * decklight video render a deck to a narrated mp4 (stills + voiceover audio)
10
29
  *
11
30
  * The subcommand implementations live in rec.mjs and
12
31
  * bundle.mjs (importable modules; direct execution still works but
13
32
  * this dispatcher is the documented entry point).
14
33
  */
15
34
 
35
+ import { readFileSync } from 'node:fs';
36
+
16
37
  const GLOBAL_HELP = `decklight — author, record, and package Decklight presentations
17
38
 
18
39
  Usage:
@@ -21,6 +42,10 @@ Usage:
21
42
  Commands:
22
43
  init scaffold a starter deck, plus an agent skill (.claude/skills/decklight/, AGENTS.md)
23
44
  EXAMPLE: decklight init "My Deck"
45
+ skills install the Decklight authoring skill for AI agents (Claude, Codex, OpenCode, IBM Bob)
46
+ EXAMPLE: decklight skills claude codex (or --all, or omit to use detected agents)
47
+ EXAMPLE: decklight skills --global (install into each agent's config home, every project)
48
+ EXAMPLE: decklight skills claude --pack (zip it to upload in your claude.ai skill settings)
24
49
  rec record a truthful terminal cast by running a YAML command script in a real PTY
25
50
  EXAMPLE: decklight rec deck.term.yaml -o deck.cast.json
26
51
  refresh re-execute the script embedded in each cast; rewrite the ones whose output drifted
@@ -30,11 +55,64 @@ Commands:
30
55
  bundle flatten a deck into ONE self-contained HTML file (runtime, themes, casts, images inlined)
31
56
  EXAMPLE: decklight bundle demo/showcase.html --themes midnight,graphite
32
57
  EXAMPLE: decklight bundle deck.html --all --title "My Course" (merge the whole playlist into one file)
58
+ restore list the commits that touched a deck, and put it back to any of them
59
+ EXAMPLE: decklight restore deck.html (list)
60
+ EXAMPLE: decklight restore deck.html a1b2c3d (restore, as a new commit on top)
61
+ upgrade bring a self-contained deck's inlined runtime + themes up to the installed version, in place
62
+ EXAMPLE: decklight upgrade deck.html --dry-run (see what would change; drop the flag to apply)
63
+ pdf render the deck to a PDF — one slide per page, at its own size, in its theme
64
+ EXAMPLE: decklight pdf deck.html (writes deck.pdf; --theme exports in another)
65
+ import convert an existing PowerPoint, Keynote or Google Slides deck into a decklight deck
66
+ EXAMPLE: decklight import "Q3 Review.pptx" (also .key on macOS, or a Slides URL)
67
+ theme validate a theme file against the token contract, or install one into a deck
68
+ EXAMPLE: decklight theme check nord-deep.css
69
+ EXAMPLE: decklight theme add https://gist.../nord-deep.css talk.html
70
+ publish bundle a deck and push it to GitHub Pages — deck to shareable URL in one command
71
+ EXAMPLE: decklight publish deck.html (prints https://owner.github.io/repo/)
72
+ marketplace register catalogs (git repos with .decklight/marketplace.json) — registered, not fetched
73
+ EXAMPLE: decklight marketplace add owner/repo (or a git URL, or a local path)
74
+ EXAMPLE: decklight marketplace list (offline-safe: reads only the cache)
75
+ plugin install presenter chrome into YOUR library — present loads it, bundle never does
76
+ EXAMPLE: decklight plugin add timer (then: decklight present talk.html)
77
+ EXAMPLE: decklight plugin list (says which ones read your speaker notes)
78
+ template install deck templates from a marketplace — scaffold with: decklight init --from <name>
79
+ EXAMPLE: decklight template add startup-pitch
80
+ importer install an import adapter for a format decklight cannot read itself — decklight
81
+ import runs it the moment it is installed for the extension in hand
82
+ EXAMPLE: decklight importer add marp-import (then: decklight import talk.marp)
83
+ transform install a build-time transform — Node code that runs during bundle, never in the deck
84
+ EXAMPLE: decklight transform add grammar-check
85
+ EXAMPLE: decklight bundle deck.html --transform grammar-check (runs it before signing)
86
+ engine install a speech engine the six built-in ones do not cover — Node code that runs
87
+ at author time only, never in a deck; your own credential still comes from the wizard
88
+ EXAMPLE: decklight engine add azure-tts (then: decklight tts --engine azure-tts)
89
+ extension the marketplace admission gate for a transform file — lint, then a headless load
90
+ of its OUTPUT; not run by bundle/import/publish, which never re-check an installed unit
91
+ EXAMPLE: decklight extension check grammar-check.mjs
92
+ voice add a marketplace voice to the picker — a reference to one of an engine's
93
+ voices, never a model, so nothing that reproduces a person is ever downloaded
94
+ EXAMPLE: decklight voice add narrator-anna (works offline; speaking needs your key)
95
+ agent teach A a coding agent the built-in roster does not cover — a descriptor of how to
96
+ run it headlessly, never code, so this downloads nothing and works offline
97
+ EXAMPLE: decklight agent add my-agent (install the agent itself its own way)
33
98
  tts serve the live voice bridge — the player synthesizes narration on the fly through it
34
99
  EXAMPLE: decklight tts (then pick "Live voice…" in the deck's / palette)
35
- edit serve the deck with live reload; E in the player edits speaker notes back into the file
36
- EXAMPLE: decklight edit demo/showcase.html (then open the printed URL)
100
+ lipsync serve the lip-sync bridge — offline visemes (rhubarb) + talking-head video (local GPU)
101
+ EXAMPLE: decklight lipsync (then pick "Character…" in the deck's / palette)
102
+ video render the deck to ONE narrated mp4 — a still per slide, held for its narration audio
103
+ EXAMPLE: decklight video deck.html -o deck.mp4 (add --voiceover to synthesize first)
104
+ author one command for the whole authoring loop: live-reload editing + every bridge this
105
+ machine can run, one Ctrl-C; E in the player edits speaker notes back into the file
106
+ EXAMPLE: decklight author demo/showcase.html (bridges without prerequisites are skipped)
107
+ present play a deck you did not author — read-only over localhost, under a CSP header;
108
+ prints what the file will execute, and strips what it cannot account for
109
+ EXAMPLE: decklight present talk.html (no editing surface, nothing is written)
110
+ associate wire double-clicking a .decklight file to decklight present
111
+ EXAMPLE: decklight associate (per-user, no admin rights; --uninstall undoes it)
112
+ report-bug gather the version + environment facts a Decklight bug report needs, and the issue URL
113
+ EXAMPLE: decklight report-bug (prints and exits — nothing is sent anywhere)
37
114
  help show this help, or a command's help: decklight help bundle
115
+ version print the installed version (also --version / -v)
38
116
  `;
39
117
 
40
118
  function globalHelp(exitCode = 0) {
@@ -46,19 +124,58 @@ const argv = process.argv.slice(2);
46
124
  let cmd = argv[0];
47
125
  let rest = argv.slice(1);
48
126
 
127
+ const { version } = JSON.parse(
128
+ readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
129
+ );
130
+
49
131
  if (!cmd || cmd === '--help' || cmd === '-h') globalHelp();
132
+ if (cmd === '--version' || cmd === '-v' || cmd === 'version') {
133
+ process.stdout.write(`decklight ${version}\n`);
134
+ process.exit(0);
135
+ }
50
136
  if (cmd === 'help') {
51
137
  if (!rest[0]) globalHelp();
52
138
  cmd = rest[0];
53
139
  rest = ['--help'];
54
140
  }
55
141
 
142
+ // every real command announces the version it runs as — on stderr, so piped
143
+ // output (export, bundle) stays clean
144
+ process.stderr.write(`decklight ${version}\n`);
145
+
146
+ // When a parent supervises us (author runs the deck server and the bridges), go when it
147
+ // goes — a SIGKILLed parent never gets to reap its children. No-op otherwise.
148
+ const { exitWhenOrphaned } = await import('./supervise.mjs');
149
+ exitWhenOrphaned();
150
+
151
+ // The first-party marketplace is REGISTERED on first run, never fetched
152
+ // (SPEC MARKETPLACE_REGISTRY): this writes two files under ~/.decklight/ and
153
+ // touches nothing else — offline first run is silent and instant. A config
154
+ // home that cannot be written must never cost a command.
155
+ try {
156
+ const { ensureFirstPartyRegistered } = await import('./marketplace.mjs');
157
+ ensureFirstPartyRegistered();
158
+ } catch { /* registration is a courtesy, not a dependency */ }
159
+
160
+ // ONE ERROR BOUNDARY FOR EVERY COMMAND. A command refuses by throwing a
161
+ // CommandError (cli/util.mjs) and it is printed here, once, in the shape
162
+ // commands have always printed: `decklight <cmd>: <message>`. Anything else
163
+ // reaching this point is a bug rather than a refusal, and prints as a message
164
+ // with the stack behind DECKLIGHT_DEBUG — never as the raw Node stack a user
165
+ // used to get (`decklight import` did exactly that on any install path with a
166
+ // space in it, #275).
167
+ try {
56
168
  switch (cmd) {
57
169
  case 'init': {
58
170
  const { initMain } = await import('./init.mjs');
59
171
  await initMain(rest);
60
172
  break;
61
173
  }
174
+ case 'skills': {
175
+ const { skillsMain } = await import('./skills.mjs');
176
+ await skillsMain(rest);
177
+ break;
178
+ }
62
179
  case 'rec': {
63
180
  const { recMain } = await import('./rec.mjs');
64
181
  await recMain(rest);
@@ -79,17 +196,111 @@ switch (cmd) {
79
196
  await bundleMain(rest);
80
197
  break;
81
198
  }
199
+ case 'upgrade': {
200
+ const { upgradeMain } = await import('./upgrade.mjs');
201
+ await upgradeMain(rest);
202
+ break;
203
+ }
204
+ case 'pdf': {
205
+ const { pdfMain } = await import('./pdf.mjs');
206
+ process.exitCode = await pdfMain(rest);
207
+ break;
208
+ }
209
+ case 'import': {
210
+ const { importMain } = await import('./import.mjs');
211
+ process.exitCode = await importMain(rest);
212
+ break;
213
+ }
214
+ case 'theme': {
215
+ const { themeMain } = await import('./theme.mjs');
216
+ process.exitCode = await themeMain(rest);
217
+ break;
218
+ }
219
+ case 'publish': {
220
+ const { publishMain } = await import('./publish.mjs');
221
+ await publishMain(rest);
222
+ break;
223
+ }
224
+ case 'marketplace': {
225
+ const { marketplaceMain } = await import('./marketplace.mjs');
226
+ process.exitCode = await marketplaceMain(rest);
227
+ break;
228
+ }
229
+ case 'plugin': {
230
+ const { pluginMain } = await import('./plugin.mjs');
231
+ process.exitCode = await pluginMain(rest);
232
+ break;
233
+ }
234
+ // Four rows of the same table (UNITS#REST) — one implementation, in units.mjs.
235
+ case 'template':
236
+ case 'voice':
237
+ case 'agent':
238
+ case 'importer':
239
+ case 'engine':
240
+ case 'transform': {
241
+ const { unitMain } = await import('./units.mjs');
242
+ process.exitCode = await unitMain(cmd, rest);
243
+ break;
244
+ }
245
+ case 'extension': {
246
+ const { extensionMain } = await import('./extension.mjs');
247
+ process.exitCode = await extensionMain(rest);
248
+ break;
249
+ }
82
250
  case 'tts': {
83
251
  const { ttsMain } = await import('../tools/voiceover-server.mjs');
84
252
  await ttsMain(rest);
85
253
  break;
86
254
  }
87
- case 'edit': {
88
- const { editMain } = await import('./edit.mjs');
89
- await editMain(rest);
255
+ case 'lipsync': {
256
+ const { lipsyncMain } = await import('../tools/lipsync-server.mjs');
257
+ await lipsyncMain(rest);
90
258
  break;
91
259
  }
260
+ case 'video': {
261
+ const { videoMain } = await import('../tools/video.mjs');
262
+ await videoMain(rest);
263
+ break;
264
+ }
265
+ case 'report-bug': {
266
+ const { reportBugMain } = await import('./report-bug.mjs');
267
+ process.exitCode = await reportBugMain(rest);
268
+ break;
269
+ }
270
+ case 'restore': {
271
+ const { restoreMain } = await import('./restore.mjs');
272
+ process.exitCode = await restoreMain(rest);
273
+ break;
274
+ }
275
+ case 'author':
276
+ case 'dev': { // permanent hidden alias — the pre-rename name; works forever, documented nowhere
277
+ const { devMain } = await import('./dev.mjs');
278
+ await devMain(rest);
279
+ break;
280
+ }
281
+ case 'present': {
282
+ const { presentMain } = await import('./present.mjs');
283
+ process.exitCode = await presentMain(rest);
284
+ break;
285
+ }
286
+ case 'associate': {
287
+ const { associateMain } = await import('./associate.mjs');
288
+ process.exitCode = await associateMain(rest);
289
+ break;
290
+ }
291
+ case 'edit': {
292
+ // Removed as a command (COMMANDS in MARKETPLACE.md) — but a removal must
293
+ // refuse out loud, naming the way forward, not shrug "unknown command".
294
+ // The server itself lives on in edit.mjs; `author` starts it.
295
+ process.stderr.write('decklight edit was folded into the authoring loop — run `decklight author <deck.html>` instead\n');
296
+ process.exit(1);
297
+ }
92
298
  default:
93
299
  process.stderr.write(`decklight: unknown command "${cmd}"\n\n`);
94
300
  globalHelp(1);
95
301
  }
302
+ } catch (e) {
303
+ const { reportFailure } = await import('./util.mjs');
304
+ reportFailure(e, cmd);
305
+ process.exitCode = 1;
306
+ }