decklight 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -9
- package/SPEC.md +239 -17
- package/cli/agents.mjs +97 -2
- package/cli/banner.mjs +125 -0
- package/cli/bundle.mjs +14 -4
- package/cli/{rec.mjs → cast.mjs} +25 -8
- package/cli/comments.mjs +389 -0
- package/cli/commit-flow.mjs +157 -0
- package/cli/commit-message.mjs +475 -0
- package/cli/decklight.mjs +95 -25
- package/cli/dev.mjs +193 -25
- package/cli/edit.mjs +1055 -39
- package/cli/git-tree.mjs +87 -0
- package/cli/git.mjs +370 -0
- package/cli/history.mjs +145 -0
- package/cli/init.mjs +199 -7
- package/cli/marketplace.mjs +123 -17
- package/cli/port-conflict.mjs +228 -22
- package/cli/present.mjs +297 -12
- package/cli/publish.mjs +15 -40
- package/cli/record.mjs +154 -0
- package/cli/restore.mjs +120 -4
- package/cli/review-remote.mjs +330 -0
- package/cli/review-store.mjs +107 -0
- package/cli/review-submit.mjs +292 -0
- package/cli/review.mjs +361 -0
- package/cli/serve.mjs +60 -1
- package/cli/skill-content.mjs +12 -1
- package/cli/theme.mjs +78 -11
- package/cli/units.mjs +2 -2
- package/cli/upstream.mjs +256 -0
- package/cli/util.mjs +59 -0
- package/dist/build-info.json +1 -0
- package/dist/decklight.css +534 -3
- package/dist/decklight.js +102 -76
- package/dist/decklight.js.map +4 -4
- package/docs/architecture.svg +7 -0
- package/package.json +2 -1
- package/tools/args.mjs +20 -0
- package/tools/deck-html.mjs +84 -0
- package/tools/elevenlabs-tts.mjs +1 -1
- package/tools/lipsync-server.mjs +64 -2
- package/tools/lipsync.mjs +40 -24
- package/tools/local-voice.mjs +170 -16
- package/tools/publish-voices.mjs +78 -18
- package/tools/recording-impact.mjs +110 -0
- package/tools/review-anchor.mjs +180 -0
- package/tools/test-impact.mjs +259 -0
- package/tools/tts-engines.mjs +211 -12
- package/tools/tts-setup.mjs +2 -9
- package/tools/video.mjs +56 -12
- package/tools/voiceover-server.mjs +262 -11
- package/tools/voiceover.mjs +32 -13
package/SPEC.md
CHANGED
|
@@ -20,6 +20,7 @@ being moved, and it says what it points at.
|
|
|
20
20
|
| `CODE_AND_MATH` | code blocks and LaTeX |
|
|
21
21
|
| `TERMINAL_RECORDINGS` · `RECORDER_CLI` · `CAST_FORMAT` · `TERMINAL_PLAYER` · `ASCIICAST_INTEROP` | truthful terminals |
|
|
22
22
|
| `PRESENTING` | keys, speaker view, narration, print/PDF, overflow |
|
|
23
|
+
| `REVIEW` | reviewer comments on a deck, anchored to slides and carried by git |
|
|
23
24
|
| `JS_API` · `DECK_IMPORT` | the public API, and bringing a deck across |
|
|
24
25
|
| `MARKETPLACE_REGISTRY` · `VOICE_UNITS` · `AGENT_UNITS` · `ENGINE_UNITS` · `ENGINE_PREREQUISITES` · `UNIT_COMPAT` · `UNIT_PINNING` · `EXTENSIONS_TRANSFORMS` · `EXTENSIONS_CHECK` · `EXTENSIONS_ADAPTERS` | catalogs of themes, templates, skills and engines — registered, not fetched; the unit library; voices as references; agents as descriptors, and the remembered preference; the speech-engine factory contract and installing one; what an engine needs from the machine before a key is worth asking for; compat for code-carrying units; the digest pin they install against; the transform calling convention; the marketplace admission gate for it; the import adapter calling convention, and running one |
|
|
25
26
|
| `REPO_LAYOUT` · `NON_GOALS` | for contributors |
|
|
@@ -152,7 +153,7 @@ container, zero classes on the items.
|
|
|
152
153
|
- Navigation: `→`/`Space`/click advances one step; `←` reverses; arriving from the previous slide shows step 0 (nothing built); arriving *backwards* from the next slide shows all steps built.
|
|
153
154
|
- Hidden steps: `visibility: hidden` (not `display:none` — layout must not shift).
|
|
154
155
|
- Events: `decklight:build` fires with `{slide, index, total, direction}`.
|
|
155
|
-
- URL: `#/<slide>/<step>` deep-links to a build state.
|
|
156
|
+
- URL: `#/<slide>/<step>` deep-links to a build state. A slide change **pushes** a history entry and a build step **replaces** one, so Back leaves a slide rather than unwinding its builds. The writes are **coalesced to one per settled position** and then **verified**: WebKit caps history writes at 100 per 10 seconds and counts `pushState` and `replaceState` against the same budget, so one write per keypress meant a held arrow key silently exhausted it and left the URL on an earlier slide — *permanently*, since only a further navigation would have resynced it and at the end of a deck there are none (#328). Coalescing is both the fix and what stops the budget being spent; a write that still does not land is retried once on the next frame, because a dropped one used to go unnoticed. Blink and Gecko have no such limit, which is why this needed a deck driven under WebKit to find (`npm run cross-engine`).
|
|
156
157
|
|
|
157
158
|
### BUILD_ENTRANCES — Entrance styles
|
|
158
159
|
|
|
@@ -264,6 +265,28 @@ The **shipped themes conform to the same rules**, graded by `test/palette-rules.
|
|
|
264
265
|
|
|
265
266
|
### THEME_DISTRIBUTION — Distributing a theme
|
|
266
267
|
|
|
268
|
+
**Where an installed theme came from travels with the deck.** A theme installed
|
|
269
|
+
from a marketplace carries `data-theme-marketplace` (the catalog's kebab `name`
|
|
270
|
+
— the identity a later dedup or upgrade would key on) and, when the catalog
|
|
271
|
+
supplied an optional manifest `title`, `data-theme-source` (what a human reads).
|
|
272
|
+
The theme picker groups by the first, labels by the second, and falls back to
|
|
273
|
+
the kebab name and then to **Added** — which stops being the catch-all every
|
|
274
|
+
runtime install fell into and becomes what it always meant: a theme from a raw
|
|
275
|
+
URL, a local file, or a hand-authored block. **Nothing is derived**: guessing
|
|
276
|
+
"Confluent" out of `decklight-confluent` breaks for `acme-themes` and would put
|
|
277
|
+
decklight in the business of naming other people's catalogs. Both values are
|
|
278
|
+
escaped on the way in — a manifest is somebody else's file and the attributes
|
|
279
|
+
are double-quoted.
|
|
280
|
+
|
|
281
|
+
The reason this is written into the deck rather than looked up is that **a deck
|
|
282
|
+
travels**: opened on a machine where that marketplace was never registered there
|
|
283
|
+
is nothing to consult, and a group heading that disappears when you send someone
|
|
284
|
+
the file would be worse than none. The consequence is a disclosure and it is
|
|
285
|
+
deliberate — a deck installed from `acme-internal` names that catalog to whoever
|
|
286
|
+
opens it. A catalog whose *name* is sensitive should not be named in a deck: omit
|
|
287
|
+
`title`, or do not use this. `data-theme-added` stays on every installed block,
|
|
288
|
+
so decks written before this keep working and keep showing under **Added**.
|
|
289
|
+
|
|
267
290
|
A theme travels as what it already is: **one CSS file**. There is no registry and no version number — the distribution unit is the file (a repo, a gist, the `.css` that `⌃⇧T` downloads), and compatibility with a runtime *is* passing that runtime's check. When the contract grows a token, the check names exactly what an older theme is missing.
|
|
268
291
|
|
|
269
292
|
- **`decklight theme check <file|url>`** runs the token contract and the WCAG gates (`tools/theme-check.mjs` — the same function `test/contrast.mjs` runs over the shipped themes, so the two can never drift) on any file, so a theme author outside this repo can prove their file is contract-complete before sharing it.
|
|
@@ -296,7 +319,7 @@ An installed theme becomes a `<style data-theme="<name>" data-theme-added media=
|
|
|
296
319
|
|
|
297
320
|
### RECORDER_CLI — Recorder CLI (authoring-time; the only part with native deps)
|
|
298
321
|
|
|
299
|
-
`cli/
|
|
322
|
+
`cli/cast.mjs`, invoked as `npx decklight@latest cast <script.term.yaml> [-o out.cast.json]`. It briefly shipped as `rec`, a name dropped with **no alias and no refusal stub** — it reads as an abbreviation of `record`, and `decklight record` now records the author's VOICE, so keeping it alive would mean keeping a name that quietly means the opposite of what its reader assumes. Nothing is released against it, so there is nothing to migrate. `cast` was already the word: the file is `.cast.json`, the format is CAST_FORMAT, `refresh` takes casts and `export` flattens one
|
|
300
323
|
(the `decklight` dispatcher in `cli/decklight.mjs` also provides `refresh`, `export`, `bundle`,
|
|
301
324
|
and a global `--help`; the per-file entry points still run directly, undocumented).
|
|
302
325
|
|
|
@@ -429,14 +452,15 @@ absent — no compatibility break in either direction.
|
|
|
429
452
|
|
|
430
453
|
## PRESENTING — Presenting & output
|
|
431
454
|
|
|
432
|
-
- Keyboard: `→/←/Space` steps+slides, `Home/End`, `O` overview grid, `B` blackout, `F` fullscreen, `T` theme picker (`,`/`.` cycle the theme, `[`/`]` cycle the font), `L`/`⇧L` cycle the current slide's layout (author mode — a persisted deck edit), `E` toggle element edit mode — right-click a slide element or its background for a menu (author mode), `Z`/`⇧Z` undo/redo deck edits (author mode), `A` ask an AI agent to edit the deck (author mode), `/` command palette,
|
|
455
|
+
- Keyboard: `→/←/Space` steps+slides, `Home/End`, `O` overview grid, `B` blackout, `F` fullscreen, `T` theme picker (`,`/`.` cycle the theme, `[`/`]` cycle the font), `L`/`⇧L` cycle the current slide's layout (author mode — a persisted deck edit), `E` toggle element edit mode — right-click a slide element or its background for a menu (author mode), `Z`/`⇧Z` undo/redo deck edits (author mode), `A` ask an AI agent to edit the deck (author mode), `/` command palette, **`⎵` pauses and resumes the voice while it is speaking** and **`V`** opens the panel that holds everything else about it — track, live voice, engine, tone, character, recording, captions, speed. `⎵` takes the key only while the narration is **in play**, never to start it: a deck that merely carries a track keeps `⎵` as the advance key, because presenting a narrated deck by hand is ordinary and a space bar that began narrating over the presenter would be a derailment in front of an audience rather than a stumble. Nothing is lost by the narrowing — a playing track advances the deck itself, so `⎵` is free exactly when the voice wants it — and starting stays deliberate: `P` is the unconditional verb from any state, and the panel has the track. `→`/`PageDown`/click always advance. The predicate is answered synchronously, because a keypress cannot wait on a probe. `<`/`>` change the voice speed in 0.25× steps, 0.25–2×, persisted per deck — YouTube's shortcut, `C` captions, `W` pen / `⇧W` laser pointer (draw on the slide, `⌫` clears), `J` progress bar, `D` debug log, `` ` `` messages, `G` slide/module finder (deliberately not `⌘F` — browser find stays untouched), `H` deck history — the commits, which of them are only on this machine, a live preview, and `⏎` to restore one (author mode; `R` is the same door). In **present** mode `H` is the deck update instead (`PRESENT#UPSTREAM`), `?` help overlay.
|
|
433
456
|
- **Captions** (`C`): a YouTube-style bar at the bottom showing the current notes segment — the same ⟨CLICK⟩-segmented text the live voice speaks — synced to slide/step, with narration on or off. Slides/steps without notes show no bar. Persists per deck in localStorage.
|
|
434
457
|
- **Presenter clock** (`K`): the wall-clock time (HH:MM) and the elapsed talk time, directly below the slide number — positioned so it never covers the slide number, the message window, or the default logo/controls corners. The elapsed count starts at the deck's **first advance after load**, not at page load — a deck idling on its title slide while the room fills is not a talk yet. Off by default, persists per deck in localStorage, never rendered in `?print`. `instance.toggleClock()` programmatically.
|
|
435
|
-
- **Progress bar** (`
|
|
458
|
+
- **Progress bar** (`J`): a hairline along the bottom edge of the deck whose width tracks the position through the deck (slide plus build step, slide 1 empty → last slide full), updated on every navigation — keys, `G`, `Home`/`End`, deep links. A passive readout of the deck state: it never drives navigation or auto-advance. Sits at the very bottom edge, below the captions bar, the character overlay and the corner chrome, so it covers none of them. Off by default, persists per deck in localStorage, never rendered in `?print`. `instance.toggleProgress()` programmatically.
|
|
436
459
|
- **Ink annotations** (`W` / `⇧W`): Keynote-style presenter ink on a canvas overlay above the slides. `W` toggles the **pen** — the cursor becomes a crosshair and pointer drags (mouse, touch, stylus) draw strokes in the theme's `--accent`; `⇧W` toggles the **laser pointer** — a glowing accent dot with a ~300 ms fading trail follows the pointer. `Backspace` clears the canvas while a tool is active. Annotations are EPHEMERAL: cleared on every slide change, never persisted, never rendered in `?print` (the annotator is not instantiated there — the clock pattern, exclusion by construction). Strokes are stored in **design coordinates** and redrawn at the engine's scale, so a window resize or rescale never drifts them off their slide positions; the ink color is read live from the applied theme, so switching themes recolors the next stroke. With no tool active the canvas is `pointer-events: none` — slide clicks and touch swipes work exactly as before. `instance.annotate = { toggle, laser, clear, stroke }` programmatically (`stroke(points)` draws one from design-coordinate points — the headless-harness and demo-driver hook).
|
|
437
460
|
- **Transcript** (palette → Transcript…): the deck's full spoken script — every slide's notes segments in order, slide titles jump on click — with export to plain text or markdown (`<deck>-transcript.txt|.md`). Also programmatic: `instance.transcript.text()` / `.markdown()` / `.open()`.
|
|
438
461
|
- **Author mode (edit server)**: `decklight author <deck.html>` serves the deck over localhost with live reload and accepts persisted edits from the player. Endpoints: `GET /edit/ping` (capabilities: deck name, undo/redo depths, git state, detected agents, `agentBusy`), SSE `GET /edit/events` (`reload` on any file change; named `agent` events for job status), `POST /edit/notes {slide, text}`, `POST /edit/layout {slide, layout}` (writes `data-layout` into the slide's `<section>` tag; `auto` removes it; a no-change write is skipped), `GET /edit/element/source?slide=&index=` (an element's outerHTML, read fresh from the FILE — never the live DOM), `POST /edit/element/remove {slide, index}`, `POST /edit/element/content {slide, index, html}`, `POST /edit/element/effect {slide, index, effect}` (writes `data-build`; `effect: null` strips it), `POST /edit/undo` / `POST /edit/redo`, and `POST /edit/agent {prompt, agent?}`. **The server binds `127.0.0.1`, and has no flag that widens it.** That is the enforcement rather than a check: there is no off-machine caller for a classifier to have to refuse. It served the phone remote behind `--remote` until `PRESENT#REMOTE` moved the clicker to `decklight present`, which is a server with no edit surface to widen — so `author` now takes neither `--remote` nor `--host`, and **refuses both out loud** (exit 2, naming `decklight present <deck> --remote`) rather than binding loopback and leaving someone holding a phone that never connects. No `/remote/*` route is registered here at all, mirroring the way `present` registers no `/edit/*`.
|
|
439
462
|
- **Present mode (read-only server)**: `decklight present <deck.html> [--port 8790]` plays a deck you did **not** author. It serves **the deck's own directory** — never the cwd — over `127.0.0.1`, with the same port-conflict handling as the author server (`listenTakingOverIfNeeded`). Everything under the served root is fetchable by the deck's own script same-origin, and with `connect-src https:` open (below), fetchable means exfiltratable — so the root is the exposure you accepted by opening the file, not whatever directory the command happened to run from (`$HOME` via file association, a project checkout with its sources). Two refusals are unconditional on top of that: **no path segment may start with a dot** (`.env`, `.git/config` — decoded or percent-encoded), and **no file type outside the server's MIME table is served** (a deck plays HTML, CSS, JS, JSON, images, fonts, audio and video; `id_rsa` or a `.pem` beside a travelled deck is only ever fetched to be exfiltrated). A **source** deck whose assets are not siblings — `demo/showcase.html` reaches up for `../dist/decklight.js` — needs **`--root <dir>`**: the deck must live under it, the same dotfile and file-type rules still apply, and the wider exposure is a flag someone typed and a directory startup prints, never a default. GET only, except the phone remote's own `POST /remote/{key,pos}` (below). It exists because a deck travels: code inlined into one runs in front of an audience that installed nothing, and a deck opened over `file://` gets no policy at all. Serving it instead buys a **`Content-Security-Policy` HTTP header**, which the document cannot override the way it could a `<meta>` tag an attacker edited in the same pass as the payload. The header rides on **every** response the server writes — the deck and its assets, but also the error pages, the control-channel JSON and SSE, and the remote controller — set at one seam ahead of the routes, so the coverage holds by construction rather than by each route's `writeHead` remembering. The policy is `default-src 'none'` plus exactly what a SPEC'd deck needs: `media-src`/`connect-src` reach `https:` (a recorded track's `dir` may be an absolute URL, background video stays external, and a manifest track's presigned URL has no knowable origin to pin), `frame-src`/`frame-ancestors` are `'self'` (the theme picker, slide finder and speaker view boot the deck into same-origin iframes), `style-src` allows inline (themes are inline `<style data-theme>` blocks and the engine writes inline custom properties), and `object-src`/`base-uri`/`form-action` are `'none'`. `script-src` must allow inline — a bundled deck **is** inline script — so the header does not stop a deck from executing; it constrains where that execution can reach. Naming what runs is `PRESENT#AUDIT`, removing it is `PRESENT#STRICT`. The **`/edit/*` routes are not registered at all**: a POST to one is answered exactly like a POST to any unknown path, because there is no route to have refused it. Nothing in the command writes a file. **The deck itself is served from the audited in-memory bytes** — a container's verified payload slice and a plain `.html` alike — so a file edited on disk after startup can never ride out under the verdict already printed and read; every *other* file under the root is read per request, because the ingredients label is an inventory of the deck, not of the directory. If live reload of the deck under `present` is ever wanted, it must re-run the audit and re-print the verdict, never silently serve new bytes under the old one. The local TTS/lipsync bridges are deliberately unreachable — live synthesis is an authoring-path engine, and recorded narration needs no bridge. **The phone remote and speaker view live here** (`PRESENT#REMOTE`), not on the author server, and the reason is the whole point: they used to sit in `cli/edit.mjs` behind `allowRemote`, so getting a clicker meant running `/edit/notes`, `/edit/layout` and `/edit/commit` against your deck while you were on stage and not looking at it. `present --remote` widens the **listener** only — off this machine **only `/remote/*` answers**, and only carrying the per-run token the printed URL and its QR embed; the deck itself and every file beside it stay unreachable from the LAN whether or not the flag is passed. `allowRemote` is the same classifier the author server uses, not a second one. The deck discovers it is being *presented* rather than authored via **`GET /present/ping`**, whose answer carries no agent roster and no edit capability because there is nothing here that edits, and subscribes to **`/present/events`**, which carries exactly one event — `remote`. There is no unnamed `reload` message: a presenting server has no file watcher, and one that could tell a deck to reload would be an editing server with the writes left out. The runtime wires this in its own path rather than through the edit path with a flag, since a shared path with a boolean in it is how a presenting server quietly acquires an editing capability later; `editAvailable` stays **false**, so `E`, `A`, `Z` and layout picks all still say they need author mode. Without `--remote` the QR **404s rather than encoding `127.0.0.1`** — a code that scans cleanly and goes nowhere is worse than no code — while `/present/ping` and the position readout still answer, because those are loopback business.
|
|
463
|
+
- **Upstream updates** (`PRESENT#UPSTREAM`; a deck in a clone only). When the presented deck is a **tracked file in a git work tree whose branch has an upstream**, `present` checks that upstream — every 10 minutes by default (`--upstream-every N`; **`0` stops the timer and keeps the manual check**, `--no-upstream` turns it all off; `CI` and `DECKLIGHT_NO_UPSTREAM_CHECK` suppress it, and the reason is a string a test can read). The check is `git fetch` with no refspec plus `rev-list --left-right --count @{upstream}...HEAD`: **no name, path or refspec derived from anything is ever a git argument**, prompts are off (`GIT_TERMINAL_PROMPT=0` plus `ssh -oBatchMode=yes`), and hooks, `fsmonitor`, submodule recursion and `gc` are disabled — decklight is not the presenter typing `git pull`, and it must not run local scripts in the middle of a talk. Every outcome is a **named state**, and a fetch that failed is **never** reported as up to date: like a signature that could not be checked, "unchecked" is its own answer and never a pass. **The gate that carries the safety is `untracked`** — anyone whose `$HOME` is a repository has every deck in `~/Downloads` "inside a clone", so the deck must be a file that repository actually versions. With **`--upstream-pull`** the server also registers `POST /present/upstream/pull`, which **takes no parameter of any kind** (the body is not read), only ever runs `merge --ff-only @{upstream}` against the repository resolved at startup, and refuses unless the branch is strictly behind with a clean tree. It is **not registered at all** without the flag, without an upstream, or with `--remote` on — a phone must never move somebody's repository. It is gated on the request's **exact own origin**, which is stricter than `/edit/*`'s: that one admits `null`, and `null` is a **sandboxed plugin frame**'s origin. **A pull re-runs the audit and re-prints the verdict** — the payload, the label and `strict` are recomputed and printed, bracketed by the sentence saying the new label replaces the old one, which is this section's own stated condition on live reload. `strict` **ratchets**: a pull may turn it on and never off, or a deck could disarm the one mitigation `present` applies unasked. When the new bytes carry findings the old ones did not, the deck is swapped but **not reloaded** — swapping executes nothing, so the reload waits for a second confirmation naming what was found. **The page reloads itself; the server never tells it to**: `/present/events` still carries exactly one event, `remote`, because the prohibition was never about the word — a server that can move a deck that did not ask is an editing server with the writes left out, and that capability is not created here. **Why this is still not an editing server, and where the argument stops**: nothing here originates content — the server cannot write a byte that did not already exist in a commit on a remote the presenter chose to clone, cannot rewrite history, cannot create a commit, and accepts nothing from the request; and a deck you were emailed is a single file with no repository, so none of it is ever registered. What is honestly given up: while the route exists, **any script in the deck can call it**, because a page's own script is indistinguishable from its user server-side — so a deck served from a clone can update itself to any commit its upstream offers. That is why the route is a flag someone typed, why every pull is printed, and why the re-printed label is not optional.
|
|
440
464
|
- **Ingredients label** (printed by every `present` start, before the first slide renders; `decklight present --check <deck>` prints it and exits instead of serving). A decklight deck's shape is predictable — content is HTML, themes are CSS, charts and casts are JSON read by the runtime — so the executable surface is short and everything else that executes is worth naming. The label states: the embedded runtime's banner version and the first bytes of its SHA-256, compared against the build this install ships (**three-valued**: `identical to this install` / `DIFFERS from this install's build of X` / `not comparable here` when the deck carries another version — a package can only vouch for the build it has, and calling an older release a mismatch would read as an accusation); the inert counts (JSON data blocks — casts, viseme sidecars, voice manifests — plus `<style data-theme>` blocks, templates, and the `Decklight.init` call); and then **every unaccounted script block, named with its line number, byte size and opening line**. Script blocks are not the whole executable surface — the `'unsafe-inline'` a bundled deck forces into `script-src` also lets an inline handler and a `javascript:` navigation run — so the label names **executable attributes** on their own lines, with the same coordinates: any `on*=` handler attribute carrying a value; any URL attribute (`href`, `src`, `action`, `formaction`, `xlink:href`, `data`) whose value resolves to `javascript:` or `data:text/html` — resolved the way a browser would read it, character references decoded and scheme whitespace stripped, so `javascript:` does not pass on spelling; and any non-empty `srcdoc`, an inline document that inherits the deck's CSP. A handler *mentioned* in prose, an HTML comment, an escaped code sample or the runtime's own strings is not a handler on a tag and is not named — comments and script/style text are masked before the tag scan, offsets preserved. When there are none, the label says `0 inline handlers or executable URLs in attributes` out loud, because the zero line is what states this class of content was examined at all. Accounted for = the runtime (by `data-decklight-runtime`, or the unmarked block defining `Decklight` before the init call — the same locator `upgrade` uses, so the two commands never disagree about which block is the engine), a `src=` naming `decklight.js`, `type="application/json"` or `text/template` data, and a `<script>` whose entire body is one `Decklight.init(…)` call. That last one is matched by **shape, not by mention**: `Decklight.init(); fetch('//evil')` mentions it too, so the call's parentheses are walked (skipping string literals) and anything after the closing paren but a semicolon disqualifies it. A source deck's runtime lives in a separate file the audit never sees, and the label says so rather than reporting a hash it did not compute. **It is an inventory, never a verdict** — no "safe", no check mark, no score. The scan is a heuristic over a file someone may have edited, and a green mark would promise more than the mechanism can keep; a list of what will run promises nothing and is still what you needed. `--check` exits non-zero on any unaccounted block or executable attribute, which means "this deck executes something I could not account for", not "this deck is malicious". The crypto path — a signature over the whole file — is `INTEGRITY#SIGNING` and is deliberately separate: this audit needs no signature, no network, and no cooperation from whoever produced the file.
|
|
441
465
|
- **Strict mode** (`decklight present --strict <deck>`, and **automatic** whenever the label finds an unaccounted block or an executable attribute): the deck is served with every unaccounted block removed — each replaced by a fixed HTML comment carrying only a byte count, since interpolating any of the removed bytes into the page would hand the payload a second way in. Executable attributes (`PRESENT#AUDIT`) go in the same pass, spliced out of their tag with nothing in their place — a comment cannot live inside a tag, and the fixed-text rule holds either way. The removal happens **on the way out**, never on disk: the deck you were sent stays byte-for-byte the deck you were sent, so you can still diff it or forward it. It applies to every `text/html` response, not only the named deck — the picker, finder and speaker view all boot documents into same-origin iframes, so a mode that stopped at one file would have a door beside it. What survives is what a deck needs to render itself (runtime, the `Decklight.init` call, JSON data, templates); builds, layouts, themes, `data-chart` JSON and background media are markup, CSS and inert attributes — nothing a browser executes — and were never in the blast radius. A clean deck under `--strict` is **byte-identical** to the same deck without it. Two failure modes are rejected outright: it never refuses to serve, and it never serves the unaccounted block. There is deliberately **no `--force`** — ten minutes before a talk is the worst moment for a refusal, and an escape hatch would be reached for at exactly that moment, so the deck always plays and the part nobody could account for is the part that doesn't. What was stripped is named **in the terminal, never on the page**: the audience did not choose to open this file and cannot act on the finding. The label and the stripper share one scanner and move together, since a printed inventory that disagreed with the served bytes would be worse than a limit you can read. The honest limit that remains is that both are heuristics over markup: a parser trick the scan does not see is a parser trick strict serves, which is why the label is an inventory and never a verdict. A signature that does not verify degrades exactly the same way (`INTEGRITY#SIGNING`) — signing adds a source of failure, not a second behaviour to understand.
|
|
442
466
|
- **Signing** (`decklight publish` **by default**, `--no-sign` opts out; `decklight bundle --sign`; verified by `present`). A file cannot vouch for itself — an attacker who edits the payload edits any embedded checker in the same pass, and `file://` HTML gets no OS signature UI — so the attestation is **detached**: `talk.html` is signed and `talk.html.sig` carries the Sigstore bundle, which is the authority. Nothing is embedded in the deck, because a copy inside the payload cannot cover the payload containing it and a convenience that *looks* like a signature is worse than none. **Sigstore keyless: there are no keys**, not "the keys live elsewhere" — a short-lived certificate is minted against an OIDC identity, used once, and left to expire; the transparency log is what keeps the signature checkable afterwards, and it is the same trust root the npm release's provenance already uses. The identity is the ambient OIDC token in CI (GitHub Actions `id-token: write`) or `SIGSTORE_ID_TOKEN` — the client has **no interactive browser flow**, and saying otherwise would send someone waiting for a window that never opens. **`publish` signs by default and `bundle` does not**, which is one decision and not an inconsistency: `publish` is already a network action, so signing adds no failure mode it did not already have, while `bundle` is offline-clean and would gain one. Neither is ever *silently* unsigned — signing runs **before anything is written or pushed**, so a failure leaves no artifact and no commit, and names `--no-sign` as the deliberate way past. `present` verifies before rendering and prints **who** signed (identity, issuer, and the log's own timestamp — never a timestamp the signer chose), read from what the verifier established rather than from the bundle, which is the attacker-supplied half. A signature can check out while the certificate names nobody; that prints as **verified with unknown identity** — precise about what is and is not known: the bytes did verify, the signer did not resolve to a name — and it *gates* as unverified, because the name is the part a person can judge and a nameless one leaves nothing to judge. Four states, and the distinctions are the point: `verified`; `tampered` (these are not the bytes that were signed); `unchecked` (a sidecar that could not be evaluated here — no client, no network — which is **not a pass**, because a gate that passes what it could not evaluate is not a gate); and `unsigned`, which is **not a finding** — most decks are unsigned, and alarming on that would train people to ignore the one case that matters. Anything but `verified` with a named identity on a deck that carries a sidecar feeds the **same degrade-to-strict path** as an unaccounted script block: signing adds a source of failure, not a new behaviour. `present --check` exits non-zero on it, for CI. The client is an **optional** dependency loaded lazily and confined to `cli/` — the runtime keeps zero dependencies, and CI installs `--omit=optional`, so every path behaves sensibly when it is simply absent.
|
|
@@ -445,10 +469,33 @@ absent — no compatibility break in either direction.
|
|
|
445
469
|
- **Presenter plugins** (`decklight plugin add|list|check|remove`; loaded by `present`, never by `bundle`). Chrome the *presenter* installs for themselves — a talk timer, a teleprompter, a confidence monitor — layered on at serve time from `~/.decklight/plugins/`, so the deck on disk is untouched and the same file presented on a machine without them is identical slides with no warning. This is defensible for the reason a build-time transform is (`EXTENSIONS`): **the installer is the risk-bearer, and nothing travels**. A plugin is two files, `plugin.json` and `plugin.js`. **Scope is chrome only, and the browser is what enforces it**: the code runs inside `<iframe sandbox="allow-scripts" srcdoc=…>` with no `allow-same-origin`, so the frame holds an **opaque origin** and `parent.document` throws — there is no handle on a slide to misuse, which is a different thing from a rule against reaching for one. A deck has to stay a deterministic artifact, or two people presenting the same file are presenting different decks. Two checks sit *in front* of that boundary and neither carries it: the manifest vocabulary is **closed** the way the wizard's field types are (`slot` from a fixed list so a plugin cannot place itself over the stage, sizes clamped for the same reason, unknown keys refused rather than ignored), and a **lint** rejects source that reaches for the deck's document — which already fails at run time, so catching it at install turns a `SecurityError` nobody is watching into a sentence. What crosses into the frame is a one-way push with no request channel: deck position, build step, elapsed time, and **speaker notes only to a plugin that declared `needs: ["notes"]`**, which `plugin list` and the `present` startup line both name. Reading notes is not transforming them, and the speaker view already shows those words on that machine — but a timer never sees a line of the talk. A plugin **never enters the ingredients label**: the label is an inventory of the file (`PRESENT#AUDIT`), the chrome is injected after the audit has read the bytes and after strict mode has stripped what it could not account for, and it is reported on its own line as the presenter's own. It **registers no route and widens no policy** — a `srcdoc` frame is never fetched, so `frame-src` has no URL to judge and it loads under the deck's existing CSP untouched. A broken plugin is skipped with a reason rather than being fatal (`PRESENT#STRICT`'s argument: nothing about a timer should cost someone their talk), `--no-plugins` presents without the library, and with nothing installed `present` serves a deck byte for byte as it did before any of this existed.
|
|
446
470
|
- **Engine wizard** (`ENGINES#WIZARD`; author mode only). A capability ships with its affordance always present (`V`/`N`, `A`, the palette entries) and **no bundled provider**; first use opens a wizard that installs and configures one. **The door is the `/` palette**: the author server's ping advertises every engine a registered marketplace declares a wizard for (`wizards`, beside its `agents`), and each gets a contextual `Configure ⟨engine⟩… (dev)` row that opens the form — named by **qualified** ref (`engine@marketplace`), so two catalogs sharing a bare name cannot silently resolve to whichever registered first. Without a server the list is empty and the rows are ABSENT, not disabled — same reasoning as the gate below. `instance.wizard(⟨engine⟩)` is the programmatic door, for drivers that cannot click. **Core renders; a plugin only declares** — a schema of questions, field types and a validation path, never markup. The field vocabulary is **closed** (`secret`, `text`, `choice`, `path`, `boolean`) and that is the mechanism, not a style rule: "the wizard appears only in author mode" is enforceable exactly as long as no plugin can put its own markup on a slide. Unknown keys are refused rather than ignored (a silently dropped key is a wizard asking for less than its author believed), a `secret` may not carry a `default` (a placeholder to be pasted over, or a key baked into a catalog — the second is bad enough to refuse the first), and `validate` is a **path** the plugin chooses on an origin it does not (a schema that could name where to send a freshly pasted key would be an exfiltration primitive with a config file for a delivery mechanism). A schema is vetted on the way **out** of the server as well as on the way in, because a catalog is a file someone else wrote. **Credentials**: pasted in the player, posted to the author server, and stored under the config home beside `marketplaces.json` **restricted to the account that pasted them** — and re-restricted on every write, since `writeFileSync`'s mode is ignored for a path that already exists. What that restriction IS is per-platform, and decklight says which: `0600` on POSIX, where the mode is the whole of the protection; on Windows an explicit ACL, because a mode there is a number with no meaning and inheriting whatever the user profile hands out is not a decision decklight ever made. That ACL is set in three steps and the third is the one that matters: `/inheritance:r` drops what was inherited, `/grant:r` puts this account on, and then **every other principal is removed by name** — including `SYSTEM` and the Administrators group, since an administrator can take ownership whatever the DACL says. The usual one-line recipe stops after the first two and silently does nothing at all on a file whose entries are already explicit; a Windows CI run is the only thing that can tell the difference, which is why one gates this. Every sentence printed about this — the wizard's own destination line, the author server's log, `report-bug`'s environment block — is derived from the file **read back**, never from what the write intended: a key with weak permissions is bad, and a key with weak permissions under a CLI reporting `0600` is worse. A machine with no ACLs to set (a FAT volume, a share) is not an error and is not silently accepted either — it is reported as inherited, in those words. Never logged, never in the response (redaction is **one** function, so a key cannot reach a debug panel two features later), never written into the deck, never read by `bundle`. **Never outside author mode**: the routes are `/edit/*`, so `allowRemote` refuses them off-loopback unconditionally and `present` registers nothing resembling them — a credential prompt in a deck you were emailed is a phishing primitive, and the player gate refuses *before* it builds a single input. Install and configure are one flow with **three distinguishable answers**: `unreachable` (wait), `rejected` (fix the key, the answers, or the plugin's schema), and "no such engine" (add the marketplace — named, not one of the two failures). Nothing is stored on any failing path, and answers that fail the schema never cost a network call. Recorded narration needs none of this: a deck with a voice track plays from files with no engine installed.
|
|
447
471
|
- **Undo/redo** (`Z`/`⇧Z`): the server keeps ONE in-memory edit history — whole-file snapshots, capped at 200 — fed by every mutation it performs (layout picks, notes saves, agent runs). Undo/redo rewrites the deck file; the watcher's reload shows the result (the hash keeps the position). The history is deliberately **independent of git**: commits never consume or reset it, and undoing never touches the repository. A file edited externally between an edit and its undo isn't lost — the current content rides the opposite stack. Empty stacks answer 409, and the player toasts the remaining depths.
|
|
448
|
-
- **Git autocommit**: with `--git` (or automatically when the deck already sits inside a repository; `--no-git` opts out) the server
|
|
472
|
+
- **Git autocommit**: with `--git` (or automatically when the deck already sits inside a repository; `--no-git` opts out) the server keeps the deck safe and lets you say when it enters history. **The cadence no longer commits.** It used to, every `--commit-every` seconds, and what that produced was a column of `decklight: autosave deck.html` in which no commit marked anything — a backup wearing a history's clothes. The two jobs are now separate. The **backup** is a silent snapshot: every 30s the deck's current bytes are written to `refs/decklight/wip`, a real commit object parented on HEAD and reachable by that name and nothing else — not on your branch, never in `git log`, never pushed, and deck-only (it is built with plumbing rather than `git stash create`, which would sweep in a co-worker's unrelated working-tree changes). A crash costs `git show decklight/wip:<deck>`, not an afternoon. The **history** is yours: decklight asks — **once per stretch of uncommitted work** — and commits when you answer. The ask is a small chip in the deck (`K`, or click it) that fires when the work has sat for 10 minutes **or** grown past 40 changed lines, whichever comes first, and then stays quiet however long it sits or however large it grows until a commit resets the episode; an unanswered nag is an answer, the same rule the unpushed-work toast keeps and for the same reason — a nudge that reappears on a timer is one people turn off. `K` opens the commit window — or **⌘K / ⌃K**, which is the shortcut JetBrains has meant by "commit" for twenty years and the one place the deck's no-modifiers rule is bent: it is handled above the typing guard, so it reaches you mid-sentence in the notes editor, and the message box lets it back out again so the key that opened the window also closes it. What the window holds: what changed, a message box, and one button, with **⌘⏎ / ⌃⏎** to commit — the convention VS Code and every GUI client share; with `--commit-messages` on, a subject is drafted from the uncommitted diff the moment it opens and it never overwrites what you have already typed, because a proposal that eats your sentence is not one. The **session bookends** follow the same rule — a run that ends with uncommitted work refreshes the snapshot and *names* it on the way out rather than committing it — while the save taken **before an agent edits** stays, because it exists to keep authorship honest rather than to save anything. **`--git-mode timer`** restores the old cadence, bookends included, for anyone who wants it. `--git` creates the repository when none exists; `decklight author` ASKS first on a TTY ("no git repository here — create one and auto-commit?"). A repository decklight creates starts with a starter `.gitignore` — `.shots/` (screenshot evidence), `.DS_Store`, and, behind a delete-this-line comment naming the tradeoff (bulky vs. cloud narration costing money to regenerate), `voiceover/` — written between `git init` and any initial commit; an existing `.gitignore` is never touched, and a repository decklight didn't create never gets one. Only the deck file is staged (`git add -- <deck>`), and a machine with no git identity gets a per-commit `-c user.name/user.email` fallback rather than a silent failure. **When to commit** is chosen by `--git-mode`: `agent` (the **default**), `timer`, or `off`. In `agent` mode a completed agent edit produces one commit carrying the agent's own summary as the subject — a failed run or one that changed nothing commits nothing — — while the snapshot runs underneath as the backstop, held back while a job is in flight so nothing captures a half-finished agent run. A timer is the wrong boundary for agent-authored work: the commits land on a clock that lines up with nothing the agent did and every message reads `autosave`, which is why the cadence became a snapshot and a question rather than a commit. **`--commit-messages`** answers the other half of that: an agent reads each commit's diff and writes the subject decklight would otherwise template, so the cadence's wall of `decklight: autosave deck.html` becomes `add a grind slide framing time as a consequence, not a setting`. It covers every subject decklight authors itself — the save that clears the way before an agent edit, the `timer`-mode cadence and bookends — and never an agent's own message, which already says what happened. It is also what pre-fills the commit window, where the sentence is a proposal you can edit rather than one that lands behind you. **The commit lands first and the subject arrives after, as an amend**: autocommit exists so a crash cannot cost an afternoon, and a safety net that waits on a language model is not one, so a slow, wedged, missing or rambling agent costs a generically-worded commit rather than a lost one. That ordering is also what makes the amend safe — it rewords one commit, on the tip, seconds old, and refuses the moment `HEAD` has moved (a restore, the agent flow's own commit, a second tick) or the commit has reached a remote, so it is never a rewrite of anything shared or of anything below the tip. The agent is asked through a **read-only** argv — `claude` without `acceptEdits`, `codex` under `--sandbox read-only`, `aider` handed no deck at all — because a call to describe a change has no business being able to make one. The diff is capped at 24 KB and truncation is stated in the prompt rather than hidden, since a deck is one enormous file and a theme swap rewrites 70 KB of CSS around the two sentences that matter. **The prompt also says WHERE the change is** — the deck's `<title>`, and the heading of every slide the hunks fall inside — because a diff cannot carry that and git's own hunk header is worse than nothing here: its function-context heuristic picks the last line resembling a definition, which in a single-file deck is a CSS selector from the inlined stylesheet thousands of lines above. Without it an agent with a gap fills it, and did: a row added to a brewing deck's troubleshooting table came back as *the espresso troubleshooting table*, a word the deck never uses. A change inside no `<section>` reports exactly that, so a theme or runtime swap is not described as slide content; and the prompt asks for a slide's own words rather than its number, which stops being true the moment one is inserted above it. **Consented, not inferred.** A diff of your deck goes to whichever agent CLI is installed and most are cloud-backed, so decklight never turns this on because an agent happens to be on `PATH` — the same rule `lipsync --veo` follows. It is instead **asked once, when a repository is created** (`init`, and `author`'s own first-run git offer), worded so the cost is on screen before the answer — and the default is **yes**, which is defensible only because it is a question a person answered. The answer is stored in that repository's own git config as `decklight.commit-messages`, because it describes what happens to that repository's commits: it survives, it is inspectable, and it is reversible with the tool the user already has (`git config decklight.commit-messages false`). No agent installed, or no TTY to answer on, means no question and no feature — a headless run is never opted in by a default. An **existing** repository is never interrupted with the new question; it uses the flag, and `--commit-messages` / `--no-commit-messages` outrank the stored answer in both directions for a single session.
|
|
473
|
+
|
|
474
|
+
**Unpushed work is named in four places, and none of them nags.** `decklight
|
|
475
|
+
history` and the `H` overlay show it when you go looking; author mode prints one
|
|
476
|
+
line on its way out (`↑13 commits only on this machine — git push -u origin
|
|
477
|
+
main` — the command that would actually work, which is not always `git push`);
|
|
478
|
+
and the player says it **once per session**, only past ten commits, and never
|
|
479
|
+
when there is no remote to push to — that nudge belongs to `init`, once, at the
|
|
480
|
+
moment a remote could actually be added. One-per-session is a count rather than
|
|
481
|
+
an interval on purpose: an interval decays into "every few minutes", which is
|
|
482
|
+
the kind of reminder people turn off, after which it is worth nothing. Every one
|
|
483
|
+
of the four reads the same three functions, so they cannot drift apart.
|
|
484
|
+
|
|
485
|
+
**`decklight init` offers a remote** for a repository it just created — never
|
|
486
|
+
for one that was already there, which may be a monorepo or somebody's checkout
|
|
487
|
+
and is not decklight's to publish. With `gh` installed **and signed in** it
|
|
488
|
+
offers `gh repo create --private` (private, and the prompt says so: a public
|
|
489
|
+
repository created off a default-yes prompt is a disclosure, not a
|
|
490
|
+
convenience); otherwise it asks for a URL. `--remote <url>` and `--no-remote`
|
|
491
|
+
make the whole path scriptable, a URL that is really a flag is refused, and
|
|
492
|
+
every failure is a note rather than an exit — the deck is the product. When the
|
|
493
|
+
directory already held other work, the question's **default flips to no** and
|
|
494
|
+
the files that would be pushed are named first: `initRepo` runs `git add -A`, so
|
|
495
|
+
that init has just committed all of them.
|
|
449
496
|
|
|
450
497
|
Authorship is **structural, not detected**: the server spawns the agent itself and diffs the deck around that process. An agent driven from OUTSIDE that flow — a `claude` session in another terminal — is indistinguishable from a hand edit, and nothing in the filesystem could tell them apart. Such an agent declares itself instead, by `POST /edit/commit { message }` when it finishes a logical change; the installed authoring skill instructs agents to do exactly that. The same endpoint is how a multi-step agent marks intermediate boundaries. Uncommitted work is committed before an agent job starts, so the agent's commit holds only the agent's work. Agent-supplied messages are untrusted text: collapsed to a single line, length-capped, and never allowed to begin with `-`. `decklight init` states the policy when it creates a repository rather than asking about it.
|
|
451
|
-
- **Ask an agent** (`A`): author mode drives whichever AI coding agent CLIs the authoring machine has installed — the roster (`cli/agents.mjs`) covers **Claude Code** (`claude -p … --permission-mode acceptEdits`), **Codex CLI** (`codex exec --full-auto …`), and **IBM Bob** (`bob -p … --accept-license`), plus Gemini CLI, GitHub Copilot CLI, OpenCode, Goose, Aider, Cursor CLI, and Qwen Code — each as a headless one-shot invocation, detected by probing `$PATH`. A opens a prompt overlay (agent picker when several are detected; `--agent` sets the default); the server snapshots the deck, spawns the agent in the serving directory with the instruction wrapped in deck context, and streams start/done status over SSE (toasts in the player; 10-minute timeout; strictly one job at a time — `agentBusy` survives reloads via ping). If the agent changed the file, the watcher reloads every browser and `Z` takes the edit back like any other.
|
|
498
|
+
- **Ask an agent** (`A`): author mode drives whichever AI coding agent CLIs the authoring machine has installed — the roster (`cli/agents.mjs`) covers **Claude Code** (`claude -p … --permission-mode acceptEdits`), **Codex CLI** (`codex exec --full-auto …`), and **IBM Bob** (`bob -p … --accept-license`), plus Gemini CLI, GitHub Copilot CLI, OpenCode, Goose, Aider, Cursor CLI, and Qwen Code — each as a headless one-shot invocation, detected by probing `$PATH`. A opens a prompt overlay (agent picker when several are detected; `--agent` sets the default); the server snapshots the deck, spawns the agent in the serving directory with the instruction wrapped in deck context, and streams start/done status over SSE (toasts in the player; 10-minute timeout; strictly one job at a time — `agentBusy` survives reloads via ping). **The run narrates itself**: Claude Code is invoked with `--output-format stream-json`, each tool call becomes an `activity` event on the same channel ("editing talk.html", "running: npm test"), and the chip shows the latest clue beside the timer — a run that used to read as "stuck" after twenty silent seconds now says what it is doing; the final `result` is what the done-toast carries, never the raw JSON wall. Agents without a stream dialect get their last non-empty stdout line, throttled — the glance a person watching the terminal would take. The activity is the agent's text and is rendered as text, never markup, and it survives a reload the same way the timer does (it rides `agentBusy`). **An edit that would strand a recording is warned about**: after an agent run the server diffs the deck's `narration.files` config and its per-slide notes against the snapshot, and if a configured track lost its config (orphaned), a recorded slide's notes were rewritten (stale), or the slide count changed under a track (reshaped — files map to slides by position), the done event carries a `recordingWarning` the deck holds as a longer toast and the terminal prints. It is a warning, never a block — the file is already written and `Z` takes it back, the audio never leaving the disk — and it is silent when the recordings are untouched or a track has nothing on disk. This is the one thing an agent asked to "rewrite the voiceover" can quietly destroy: minutes of somebody's own voice, orphaned by a rewritten `Decklight.init` with nothing on screen to say so. If the agent changed the file, the watcher reloads every browser and `Z` takes the edit back like any other.
|
|
452
499
|
- **Notes editor** (right-click a slide's background, or the `/` palette): opens a notes editor — ⟨CLICK⟩-separated plain text — whose Save rewrites the slide's `<aside class="notes">` in the file (one `<p>` per segment, HTML-escaped; the aside is inserted if the slide had none). `E` used to open this directly; it now arms element edit mode instead (below), and the background right-click is where notes editing moved to — the same `toggleEditor()`, unchanged, reached a different way. The server watches the deck file and broadcasts a reload to every connected browser on ANY change — the player's edits and external editors alike — and the `#/slide/step` hash restores the position. `file://`-opened decks probe the server at its default localhost port so the printed URL and a double-clicked file both work; `config.edit.url` overrides, and a basename guard refuses a server that's editing a different deck. **The `/edit/*` surface is not CORS-open.** Binding loopback is the wrong boundary for the threat: the dangerous caller is the user's *own* browser, where any open tab can `fetch()` the port, and a wildcard `access-control-allow-origin` waves that through — a `text/plain` POST is a "simple" request the browser sends with no preflight, so a coding agent has already run against the deck's directory by the time CORS is consulted on the way back. So every request is gated on its `Origin` **before** any handler runs (`allowEditRequest`, `cli/serve.mjs`): a loopback web origin (the deck this server serves), `null` (the `file://` double-click above), and a missing header (the CLI, the port-conflict probe, `curl` — not a browser cross-origin call) are admitted; a foreign site is refused with no CORS grant, so it cannot even read the refusal. The one residual is that `null` is also a sandboxed iframe's origin — closing it would cost the `file://` path a token it has no way to receive, so the double-click affordance is kept and the residual named here.
|
|
453
500
|
- **Messages** (`` ` `` — the key left of `1`, matched on `code` so it is the same physical key on every layout; or the palette's "Messages"): the deck talks back in the **top-left corner** — 20px, high-contrast, stacked newest-last (at most 4 at a time), each fading after a few seconds. Every message is also KEPT: that key opens the log — the full history with arrival times — because a message that explains why the voice stopped is worthless if it faded while you were looking at the slide. The shortcut is handled BEFORE the typing guard, so `` ⌃` ``/`` ⌥` `` reach you even while the notes editor has focus and owns every bare keystroke; the bare key works whenever you are not typing. `instance.messages()` returns `[{ at, text }]`, `instance.toggleMessages()` opens the log.
|
|
454
501
|
- **Onboarding — the first-run welcome and the tips that follow it**: the two moments a deck can afford to teach the tool, and they never share a load.
|
|
@@ -465,26 +512,181 @@ Authorship is **structural, not detected**: the server spawns the agent itself a
|
|
|
465
512
|
- **Inline-theme mode** (bundled single-file decks): when `<style data-theme="name">` blocks exist, they replace the link — `applyTheme` toggles which block applies (via `media="not all"`; the HTML `disabled` attribute on `<style>` is non-functional per spec, and the engine normalizes either form at init). The picker lists the embedded names (config `themes` narrows), `?theme=` works, and everything else is unchanged.
|
|
466
513
|
- **Theme generator**: `⌃T` generates a brand-new contract-complete theme (THEMING note) and applies it instantly — press again to re-roll. The roll lives as a `<style data-theme data-generated>` block appended last in `<head>` (wins the cascade over the link/inline base); cycling `<`/`>` or picking another theme deactivates it but keeps it in the theme list under its autoname (`gen-<word>-<hex4>`) until the next roll replaces it. The picker's first row is **“✨ Generate new…”**: selecting it rolls a candidate and previews it live like any other theme (`⌃T` re-rolls while selected; `Enter` applies). Previews for generated and saved-custom themes carry their tokens in the URL — `?gen=<base64url {name, tokens}>` — which the engine applies statelessly at init (works on `file://` and inside bundles). The preview deck loads **once per picker session**; subsequent selections are postMessage'd into the embedded instance (`{__decklightPreview: {theme|gen}}`, parent-origin-guarded) and applied in place — no document reload per candidate, which matters in bundles where each reload would re-parse the whole payload. `⌃⇧T` **saves** the applied generated theme: prompts for a name (sanitized `[a-z0-9-]{1,40}`, `custom-` prefixed on collision with a shipped name), persists `{name → tokens}` into `localStorage['decklight-custom-themes']`, and downloads `<name>.css` (a normal theme file). Saved customs appear in the theme list and picker (tagged “custom”), survive reload, and apply via the same inline-style mechanism — but localStorage is per-origin/per-browser: **the downloaded .css is the portable artifact** (drop it into `themes/` and commit). Unsaved generated autonames are never persisted as the deck's theme choice.
|
|
467
514
|
- **Brand logo**: `init({ logo: { onLight, onDark, src?, height?, position? } })` renders a mark as chrome on every slide (default `bottom-left`; also `top-left|top-right|bottom-right`; default height 30px). `onLight`/`onDark` are the variants for light/dark canvases: the engine reads the applied theme's real background luminance (first gradient stop for gradient canvases), sets `data-canvas="dark|light"` on the root, and the matching variant shows — following theme cycling, the picker, and generated themes ( `src` alone shows always). Refs resolve as `'#id'` (clones an inline element — bundle- and `file://`-safe, the `data-cast-inline` idiom), `'<svg…'` raw markup, or an `<img>` URL. In `?print`, every slide gets its own copy. **Hero variant**: `data-logo` on a section prepends a larger in-flow copy of the mark above the slide's content (default 96 design px; `data-logo="128"` overrides) — module openers and cover slides. Hero slides hide the corner chrome (and skip the print copy), the mark doesn't count as pinnable content, and the same on-light/on-dark variant switching applies.
|
|
468
|
-
- **Narration**: `V` toggles voice-over; `N` opens the picker (persisted per deck). Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures `narration: { files: '<dir>' }` or `[{ label, dir }, …]` for several takes. A `dir` may be an absolute URL, so a **public** bucket has always served a track with no extra machinery (`dir: 'https://storage.googleapis.com/…/algenib'` — media elements load cross-origin without asking). **Manifest tracks** exist for the case a `dir` cannot express: `[{ label, manifest: 'voices/algenib/manifest.signed.json' }, …]` fetches a small JSON list once when narration starts and plays each slide's URL **verbatim**, because a presigned URL carries its signature in the query string and a query string can never be a directory prefix. The manifest is the file `tools/voiceover.mjs` already writes (`{engine, voice, style, slides: [{file, hash}]}`), extended with an optional per-slide `url` and a top-level `expires` (ISO 8601); a slide with no `url` resolves its `file` next to the manifest, so an unsigned `manifest.json` in a public bucket is a track for free, and a `null` slide (no notes, no file) is silence rather than a failure. `tools/publish-voices.mjs <dir> --bucket gs://… [--sign 7d]` uploads the slides whose hash moved (the last `manifest.signed.json` is the record of what is already up there; `--all` overrides), signs every slide through `gcloud storage sign-url` — never our own key handling — and writes `manifest.signed.json` to deploy beside the deck while the megabytes stay in the bucket. It refuses a `--sign` longer than **7 days**, the V4 signing scheme's own ceiling, and names the public-bucket alternative for audio that must outlive a week. Signatures expiring is one more way for the voice to be unplayable, so it behaves like all the others: the expiry is checked before the first clip, narration turns off, auto-advance stops, and the message names the track, the date, and the literal re-sign command (the manifest records the `source`, `bucket` and `signDuration` it was made with, so it is a line to re-run and not a shape to fill in). A signed file that fails to load is treated the same way — a media element cannot report an HTTP status, so a 403 for a lapsed signature is indistinguishable from any other failure, and naming the only cause worth naming beats staying silent. `N` shows a manifest track with a ☁ and the time left. `decklight bundle` **inlines the manifest** under its own path (`data-decklight-voices`), like the viseme sidecars, because `fetch` is dead on `file://`; the audio stays in the bucket, which is the whole point. One honest caveat: the character overlay's `amplitude` fallback reads the audio through WebAudio, and cross-origin media taints that unless the bucket sends CORS headers — viseme sidecars are same-origin JSON and are unaffected. **Live voice**: the player synthesizes each slide's notes on the fly through the local bridge (`decklight tts`, default `http://127.0.0.1:8787/tts`, override via `narration.liveUrl`). The bridge speaks with one of four engines (`--engine`, tools/tts-engines.mjs): **gemini** (gemini-2.5-{pro,flash}-tts on Vertex AI — a delivery style always reaches it; no free tier, and a fresh project's per-minute quota 429s under the lookahead's bursts), **chirp** (Chirp 3: HD on the Cloud Text-to-Speech API — the same 30 star-named voices, ~1s a sentence, 1M characters a month free, no style channel), **piper** (a local neural model — offline, unlimited, free, no credentials; one voice per installed model, and the process is held RESIDENT because piper reloads its ~120 MB model on every start), or **elevenlabs** (your own ElevenLabs account's voices — the ones you *cloned* included, which is the reason it exists). The first three know their roster up front; ElevenLabs cannot, because the interesting voices are yours, so it fetches the account's list once and `/ping` and `/voices` await it — **your** voices first (cloned, then professional, then premade), each tagged with where it came from, and the picker's default is the first of them. The player sends a voice NAME; a `voice_id` pasted from the dashboard resolves too. Its key is read from `$ELEVENLABS_API_KEY` and is **never written to `tts.json`** — decklight remembers the choice and leaves the secret to your environment. Style reaches it only through `--tts-model eleven_v3` (`stylable` follows the model chosen, not just the engine): v3 reads a short bracketed **audio tag** ahead of the sentence as performance direction — never the Gemini-shaped prose instruction, and never sent to any other ElevenLabs model, where the brackets would just be read aloud as words instead of shaping them. An optional `--tts-stability creative|natural|robust` (v3 only; refused up front on any other model rather than silently doing nothing) trades how hard v3 follows the tag against how much it drifts, and is left alone entirely — no `voice_settings` sent at all — when unasked. Both the tag and the sentence it directs are billed as the characters actually sent, and it is metered in characters against a plan rate decklight cannot see, so the bridge reports characters rather than inventing a dollar figure. Audio is `pcm_24000` wrapped as WAV like every other engine; `--tts-format mp3` is the escape hatch for plans without PCM output and costs you `⇧V` offline recording and the lip-sync bridge, both of which read WAV — so it is opt-in, never a silent downgrade. `GET /ping` reports `{engine, model, voices, stylable}` and the picker offers exactly those voices, skipping the tone step when the engine cannot be told how to speak — a roster the bridge cannot pronounce would be a silent lie. The bridge is probed when live narration **starts**, not only when the picker opens, and a saved voice the live bridge does not have is treated as **stale rather than chosen**: it came from a different engine (the star roster is the default, and an ElevenLabs key knows none of those names), so the bridge's first voice takes over, is persisted, and the swap is announced — a voice changing on its own must never be silent. **The voice already on the machine**: with no engine chosen, none saved, and no cloud project, `decklight author` asks the operating system what it can speak with before defaulting to an engine that would only be skipped. **macOS** is read through `say -v '?'` — the roster mixes twenty years of engines, so voices are ranked by the tier macOS itself labels (a **Personal Voice** the user recorded first, then Premium/Neural, then Enhanced, then built-in) and filtered to the deck's language, because a Mac whose best voice speaks Italian must not narrate an English deck with it. **Windows** is read through PowerShell (`System.Speech`), preferring the newer `(Natural)` voices. Both become real bridge engines (`--tts-engine say|sapi`), synthesizing 24 kHz PCM in a WAV like every other engine, `stylable: false` so the picker skips the tone step. **Android** is detected and refused with the reason: Termux reports `android` and runs Node, but Android's TextToSpeech is an in-process Java API with no command line behind it, so there is nothing for a bridge to call — the honest path there is a recorded track, which needs no bridge. A native voice is the ONLY engine claimed automatically, because it is the only one that needs no setup at all; **piper is never auto-selected even when it is on PATH**, since it needs a toolchain and a ~120 MB model and that choice belongs to the first-run wizard, which saves it. Any `--tts-engine`, `--project`, `GOOGLE_CLOUD_PROJECT` or saved config wins outright and detection is never consulted. When a machine has nothing, the skip line says what THIS machine lacks and names piper; and if **Ollama** is answering on 127.0.0.1:11434 (a ~300 ms probe, raced against a timeout so a hung socket cannot stall startup) it adds that Ollama serves LLMs and has no speech endpoint — the single most common thing a local-AI user expects to cover this. **A missing piper voice is caught before the bridge starts, not by it**: piper installed and chosen but with no model on disk used to bring the bridge up looking healthy and fail on the first sentence — a keypress into silence, for a file that was never there. `decklight author` now checks, names the model, its directory and its size, and on a **TTY** offers to fetch it; accepting re-plans so the bridge joins the session, declining or a non-TTY run keeps the skip line. **Nothing is ever downloaded silently.** The command it runs is chosen for the machine (`tools/tts-engines.mjs`): a python that can already import piper gets `python -m piper.download_voices`, and otherwise `uvx --from piper-tts` runs it inside the isolated venv `uv tool install piper-tts` creates — the plain form cannot work there, which is why it used to fail with `ModuleNotFoundError` on a machine that had just followed decklight's own install instruction. **First-run setup**: the first time the bridge cannot start — a bare `decklight tts`, or `decklight author` about to skip the voice because nothing is configured — decklight asks a few plain questions on the terminal (TTY only) instead of exiting with the engine's error: the engine, with the free/offline/cloud trade-offs stated and the default following what the machine already has (an `$ELEVENLABS_API_KEY` outranks everything — nobody exports one by accident; else piper on `PATH`, else a project visible in the environment or gcloud config), then only that engine's prerequisites — a GCP project id (prefilled, validated with the same rule the flags enforce) plus a credentials probe for the cloud engines; for piper the install and voice-model download commands, run only on an explicit yes; for elevenlabs nothing at all when the key is exported (the roster answers "which voice", so it is not asked) and otherwise where to make a key and why setup will not save it for you. Setup proves the choice with one real synthesis of the picker's preview sentence, reporting duration and the engine's cost note, and only a config that has spoken is saved — to `~/.config/decklight/tts.json` (`$XDG_CONFIG_HOME` honored), which both `decklight tts` and `decklight author` read from then on; precedence is flags > environment > saved config > built-in default. `decklight tts --setup` re-runs the questions, deleting the file resets to first-run, and non-TTY invocations never prompt — exit codes and messages stay as they were. **The voice is the clock**: auto-advance is driven by narration finishing, so when the voice CANNOT be played — a quota 429, an unreachable bridge, a browser that blocked autoplay, a recorded track with no file for this slide — the deck **stops advancing** rather than walking the talk past slides nobody has heard, and says why in a message (`I`) naming the cause and the way out (`--tts-engine chirp` for a 429, `decklight tts` for a dead bridge, one click for blocked audio). Narration switches itself off; `V` retries — the picker drills tracks → voice (30 prebuilt Gemini/Chirp names, one piper model, an OS voice, or the ElevenLabs account's own roster) → tone, on any engine `/ping` reports as `stylable` (six presets or a custom typed instruction — a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs `eleven_v3`). Every voice row carries a ▶ **preview** that speaks an editable test sentence (default "Hey, this is Decklight", input at the top of the voices view, ↺ restores the default) through the bridge in that voice; tone rows preview the drafted voice in that delivery style, and the custom-tone input has a ▶ to audition a typed instruction before committing it. After a preview plays, the rest of its roster prefetches sequentially in the background (all voices neutrally, or all tones for the drafted voice). Two preview caches: the default sentence's cache is permanent once built; the custom sentence's cache holds exactly one sentence and is swapped (old audio freed) when the text changes. **Build-synced auto-advance**: the ⟨CLICK⟩ markers that segment the notes for the speaker view segment the audio too — segment k is synthesized as its own clip and narrates build step k (0 = arrival); when a clip ends the deck reveals the next build, and after the last segment it moves to the next slide, so a deck with well-segmented notes presents itself beat by beat. A segment with no words advances after a short beat; a slide with no notes is skipped; manual navigation mid-clip wins over the pending advance and re-syncs the voice to the new step. **`data-narration="hold"`** on a section marks it interactive (quiz, exercise, live demo): narration plays whatever notes it has and builds still sync, but the deck never auto-advances *off* it — the presenter moves on manually and narration resumes on the next slide. The spoken unit is a **sentence**: each ⟨CLICK⟩ segment splits into sentences, every sentence is its own TTS call and cache entry (slide, segment, sentence, voice, style), playback chains them and advances only after the segment's last one — so first audio arrives after one short synthesis, never a whole paragraph. While narration is on, a **lookahead buffer** keeps the next 10 sentences synthesized in the background (a few parallel low-priority workers, window re-derived from the current position, results landing in the same cache); an unreachable bridge toasts once and pauses the buffer until the next event. `⇧V` downloads per-slide `slide-NN.wav` files **stitched from this same sentence cache** (short silences joining sentences and builds) — already-heard clips cost nothing, only unheard sentences synthesize. **`P` pauses/resumes** narration — audio freezes mid-sentence and resumes exactly there, and auto-advance holds while paused. Captions (`C`) follow the voice **sentence by sentence** during live narration (segment-level when narration is off). With nothing configured, `V` opens the picker instead of failing. **The deck announces its own voice**: when a recorded track is configured, a small pill fades in bottom-center about a second after load — *🔊 this deck has a voice-over — `V` plays it* — and clicking it starts narration (the click is itself the user gesture, so the audio is never the blocked-autoplay case). It fades out on its own after ~12s and is written to the message log (`I`) rather than toasted, since the pill is already on screen saying it. It never appears in `?print`, in embedded previews (the theme picker and slide finder boot real decks in iframes), under `?voiceover` (which starts on the first gesture anyway), while captions (`C`) hold that same corner, or once narration has been started on this deck — remembered per deck path like every other narration preference. Without it the only proactive surface was the touch sound button, which CSS shows on `pointer: coarse` alone, so a viewer on a laptop could only learn the deck talks from a key nobody had mentioned. Files are generated by `tools/voiceover.mjs`: notes → optional local-LLM rewrite → `--engine piper` (local neural TTS; `--voice` = piper model name) or `--engine gemini` (gemini-2.5-pro-tts on Vertex AI; `--voice` = prebuilt voice name). The built-in speech-synthesis voices were removed — not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
469
|
-
- **Character** (`
|
|
515
|
+
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel — track, live voice, engine, tone, character, recording, captions, speed (persisted per deck). Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures `narration: { files: '<dir>' }` or `[{ label, dir }, …]` for several takes. **A recorded track can pace the builds, not just the slides.** `tools/voiceover.mjs` already writes one file per `⟨CLICK⟩` segment (`<dir>/slide-NN-KK.m4a`, KK 1-based over the segments that produced audio — empty segments produce none, so the file number is not the step number) and lists them as `slides[i].segments`; a track carrying them reveals build step k when segment k ends, which is the build-synced pacing the live voice has, from a recording. On a **directory** track it is opt-in — `narration: { files: '<dir>', segments: true }`, off again with `segments: false` — because the runtime cannot see the folder and must not guess. A **manifest** track needs no flag, the manifest being the list of what exists; except on a *signed* one, where a segment counts only if it carries a `url` of its own. `publish-voices.mjs` writes those urls — every beat is uploaded and signed alongside its slide — and the rule stands anyway, because a manifest published before it did lists beats whose bytes never left the author's disk, and a signature is the only thing that tells the two apart. Whether a track paces itself is settled **once**, when narration starts, from what the track declares — never by probing for a file, which neither `file://` nor a CORS-less bucket can answer. A slide recorded whole inside such a track still plays as one file and then advances; a surplus `⟨CLICK⟩` beyond the slide's builds is chained onto the last step exactly as the live voice chains it. A missing FIRST segment falls back to the whole-slide file; one missing mid-slide has nothing to fall back to, so the deck stops and names it — the voice is the clock. The character keeps up: `tools/lipsync.mjs` cuts a sidecar per beat too (`slide-NN-KK.visemes.json`, from that beat's own `slide-NN-KK.txt` as the dialog hint), the synthesized recorder writes them beside its beat WAVs, and `decklight bundle` inlines them under the same stem. A beat with no sidecar animates from amplitude rather than replaying the slide's timeline — which would start at zero against every beat and be confidently wrong. The talking-head *video* stays per slide: a clip is minutes of GPU time and the element mirrors the audio's transport rather than seeking a timeline, so cutting it per beat would cost a great deal to fix a smaller error. **Both recorders write those beats.** the panel's `Record this deck…` stitches them from the live voice's own sentence cache alongside the whole-slide file it always wrote — so a synthesized track gains build-pacing for free, with no second pass — and **the panel's `Record this deck…` records them in your own voice**, for which `decklight record <deck.html>` is the door: a browser will not open a microphone for a `file://` page (getUserMedia needs a secure context, and `http://127.0.0.1` is one), so the command serves the deck and opens it at `?record` — your-voice recorder on a `file://` deck says exactly that instead of failing silently. The deck is the teleprompter: it shows one ⟨CLICK⟩ beat at a time at the build that beat plays over, and `→` ends the take *and* reveals the next build — one gesture, so the timing you record is the timing you will present. `⌫` retakes the beat just read, `Esc` stops (every slide already finished is already written). Capture is WebAudio → 16-bit PCM → `stitchWav`, at 24 kHz mono like every engine's output — not MediaRecorder, whose webm/opus nothing else here reads, and not an AudioWorklet, whose module would have to come from a `blob:` URL that `decklight present`'s `script-src 'self' 'unsafe-inline'` forbids. Each slide is written twice by EITHER recorder: one `slide-NN-KK.wav` per beat, and the whole-slide `slide-NN.wav`, so `lipsync.mjs`, `video.mjs` and a deck that never opts in all keep working — the layout on disk says nothing about which recorder made it. A beat file carries neither the segment-sized silence that separates beats (it belongs between them, not at the head of one) nor the slide's trailing `data-narration-pause` — and neither does the **whole-slide file**, nor the viseme timeline beside it: `advanceFrom` honours every pause at play time for recorded and live tracks alike, so baking one into a file as well would hold twice (which the whole-slide file quietly did until the pause gained a non-zero default and the double showed). A slide the tool would not have segmented (fewer than two beats with words in them) is one take and no segment files, the same threshold `tools/voiceover.mjs` gives up at; a slide with builds but no ⟨CLICK⟩ is recorded whole and says so on the card, because that is an authoring gap and the moment you are reading its notes aloud is the moment to learn about it. Files are written through the author server (`POST /edit/record`, which is told a folder and a beat number and builds the name itself), and fall back to the browser's download folder when there is none — **saying which of the three reasons** applies, because where the files went is not something a presenter can act on and why they went there is. Whether a server exists is **awaited, never sampled**: the probe answers asynchronously and a recorder that read it early sent whole takes to the download folder because the answer had not arrived yet, not because there was no server. A deck opened with `?record` that finds no server is the loud case — that parameter means one was started, so something else is holding the port for another deck — and it says so on the intro card, before the first beat rather than after the last. **A TRACK IS A FOLDER**, and the recorders name it after the voice: a deck carries as many tracks as you have voices — several cloned ones, the system voice, two takes of your own — and `N` is the switcher, so a single `voiceover` default meant recording a second voice erased the first with nothing said. The folder is chosen by four rules in order: `--dir`/`?dir=` (asked for out loud); a folder whose `manifest.json` names this same engine and voice (a re-record **refreshes** its take rather than accumulating `-2`, `-3`); the deck's own single configured folder (a deck that names one place has decided); else `voices/<voice>`, suffixed past anything already there. `GET /edit/tracks` is how the deck finds out what exists — it cannot see the filesystem, which is why `segments: true` is opt-in at all — and the proposal is shown on the card as an **editable field** before recording starts, because a proposal that cannot be corrected is a decision made somewhere else. The done card then **offers to point the deck at what it just wrote** — `POST /edit/narration` **adds** the track to `narration.files` (updating in place when that folder is already listed, never duplicating a row) through the same `applyEdit` door every other edit uses; the one-string form becomes a one-element list carrying the same `ext`/`segments`, which is the shape `narrationTracks()` normalises it to anyway, so `Z` takes it back and live-reload shows it. A button rather than automatic: editing someone's deck the moment a recording ends is the wrong default even with undo behind it, and the offer is absent exactly where it could not work (no author server → the card prints the line, as before). The call site is located by the same classifier `audit` and `upgrade` use, and its argument walked with strings skipped, because `{ title: 'Acme (Inc)' }` is a deck that did nothing wrong. A deck that builds its config elsewhere (`const cfg = {…}; Decklight.init(cfg)`) has no literal to edit: that is **refused with the reason**, never guessed at. `decklight record --slides a-b` re-records a range and leaves every other slide's files alone — recording starts at slide 1 and cannot skip, so without it a fluffed beat on slide 30 costs 29 slides of reading. A `dir` may be an absolute URL, so a **public** bucket has always served a track with no extra machinery (`dir: 'https://storage.googleapis.com/…/algenib'` — media elements load cross-origin without asking). **Manifest tracks** exist for the case a `dir` cannot express: `[{ label, manifest: 'voices/algenib/manifest.signed.json' }, …]` fetches a small JSON list once when narration starts and plays each slide's URL **verbatim**, because a presigned URL carries its signature in the query string and a query string can never be a directory prefix. The manifest is the file `tools/voiceover.mjs` already writes (`{engine, voice, style, slides: [{file, hash}]}`), extended with an optional per-slide `url` and a top-level `expires` (ISO 8601); a slide with no `url` resolves its `file` next to the manifest, so an unsigned `manifest.json` in a public bucket is a track for free, and a `null` slide (no notes, no file) is silence rather than a failure. `tools/publish-voices.mjs <dir> --bucket gs://… [--sign 7d]` uploads the files whose hash moved (the last `manifest.signed.json` is the record of what is already up there; `--all` overrides), signs every one through `gcloud storage sign-url` — never our own key handling — and writes `manifest.signed.json` to deploy beside the deck while the megabytes stay in the bucket. It refuses a `--sign` longer than **7 days**, the V4 signing scheme's own ceiling, and names the public-bucket alternative for audio that must outlive a week. Signatures expiring is one more way for the voice to be unplayable, so it behaves like all the others: the expiry is checked before the first clip, narration turns off, auto-advance stops, and the message names the track, the date, and the literal re-sign command (the manifest records the `source`, `bucket` and `signDuration` it was made with, so it is a line to re-run and not a shape to fill in). A signed file that fails to load is treated the same way — a media element cannot report an HTTP status, so a 403 for a lapsed signature is indistinguishable from any other failure, and naming the only cause worth naming beats staying silent. `N` shows a manifest track with a ☁ and the time left. `decklight bundle` **inlines the manifest** under its own path (`data-decklight-voices`), like the viseme sidecars, because `fetch` is dead on `file://`; the audio stays in the bucket, which is the whole point. One honest caveat: the character overlay's `amplitude` fallback reads the audio through WebAudio, and cross-origin media taints that unless the bucket sends CORS headers — viseme sidecars are same-origin JSON and are unaffected. **Live voice**: the player synthesizes each slide's notes on the fly through the local bridge (`decklight tts`, default `http://127.0.0.1:8787/tts`, override via `narration.liveUrl`). The bridge speaks with one engine at a time — six built in (`--engine`, tools/tts-engines.mjs), plus any installed one — and the deck can change which: **gemini** (gemini-2.5-{pro,flash}-tts on Vertex AI — a delivery style always reaches it; no free tier, and a fresh project's per-minute quota 429s under the lookahead's bursts), **chirp** (Chirp 3: HD on the Cloud Text-to-Speech API — the same 30 star-named voices, ~1s a sentence, 1M characters a month free, no style channel), **piper** (a local neural model — offline, unlimited, free, no credentials; one voice per installed model, and the process is held RESIDENT because piper reloads its ~120 MB model on every start), or **elevenlabs** (your own ElevenLabs account's voices — the ones you *cloned* included, which is the reason it exists). The first three know their roster up front; ElevenLabs cannot, because the interesting voices are yours, so it fetches the account's list once and `/ping` and `/voices` await it — **your** voices first (cloned, then professional, then premade), each tagged with where it came from, and the picker's default is the first of them. The player sends a voice NAME; a `voice_id` pasted from the dashboard resolves too. Its key is read from `$ELEVENLABS_API_KEY` and is **never written to `tts.json`** — decklight remembers the choice and leaves the secret to your environment. Style reaches it only through `--tts-model eleven_v3` (`stylable` follows the model chosen, not just the engine): v3 reads a short bracketed **audio tag** ahead of the sentence as performance direction — never the Gemini-shaped prose instruction, and never sent to any other ElevenLabs model, where the brackets would just be read aloud as words instead of shaping them. An optional `--tts-stability creative|natural|robust` (v3 only; refused up front on any other model rather than silently doing nothing) trades how hard v3 follows the tag against how much it drifts, and is left alone entirely — no `voice_settings` sent at all — when unasked. Both the tag and the sentence it directs are billed as the characters actually sent, and it is metered in characters against a plan rate decklight cannot see, so the bridge reports characters rather than inventing a dollar figure. Audio is `pcm_24000` wrapped as WAV like every other engine; `--tts-format mp3` is the escape hatch for plans without PCM output and costs you the panel's `Record this deck…` offline recording and the lip-sync bridge, both of which read WAV — so it is opt-in, never a silent downgrade. `GET /ping` reports `{engine, model, voices, stylable}` and the picker offers exactly those voices, skipping the tone step when the engine cannot be told how to speak — a roster the bridge cannot pronounce would be a silent lie. **Which engine is itself a choice the deck can make**: `GET /engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing; `POST /engine {engine}` swaps the live one. The picker hangs off the voices view (`N` → live voice → *engine*), because the engine decides the whole roster and that is the screen where you notice the names are not the ones you wanted. **The readiness check is shared with `decklight author`** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs — a picker offering an engine `author` would have refused to start is a picker that lies — and it is asked BEFORE the engine is built, because gemini and chirp construct perfectly well against an unchecked project and fail on the first sentence, which mid-talk is a keypress into silence. A swap re-runs the same stale-voice rule a first probe does, and the response cache is keyed by engine name, so switching back replays instantly rather than re-billing. **An engine that cannot be used is shown, dimmed, with the terminal command that fixes it** — hiding it would answer "where did ElevenLabs go?" with silence — and every fix is something you do in a terminal: the deck lists what is missing and never collects it, because a key or a project id typed into a web page (even one on loopback) is a different thing from one exported in a shell, and a deck under `--remote` is reachable from a phone. **The choice is not persisted.** `tts.json` is what the CLI and the wizard write and what the next `decklight author` starts with; an experiment two minutes before a talk must not quietly become tomorrow's default. The bridge keeps it until restarted, so it survives a reload. The bridge is probed when live narration **starts**, not only when the picker opens, and a saved voice the live bridge does not have is treated as **stale rather than chosen**: it came from a different engine (the star roster is the default, and an ElevenLabs key knows none of those names), so the bridge's first voice takes over, is persisted, and the swap is announced — a voice changing on its own must never be silent. **The voice already on the machine**: with no engine chosen, none saved, and no cloud project, `decklight author` asks the operating system what it can speak with before defaulting to an engine that would only be skipped. **macOS** is read through `say -v '?'` — the roster mixes twenty years of engines, so voices are ranked and shown by **quality category**: *best* (a **Personal Voice** the user recorded, and **Siri** voices — recognisable on current macOS only by their sample sentence, the name markers having disappeared from the listing), *good* (Premium/Neural, then Enhanced), *average* (plain built-ins, and the **robots** — Albert, Zarvox, Bad News and the rest of the novelty/formant roster, pinned there by name and listed last, because they sort alphabetically first and once narrated decks by default). The categories render as labelled shelves in the picker, and only the deck's language gets them: the **novelty tail** (robots and the 2022 persona family — Eddy, Flo, Grandma, Grandpa, Reed, Rocko, Sandy, Shelley) and **every other-language voice** each fold to a single expandable row (`‣ novelty voices (26)` · `‣ other languages (140)`), expanded per picker-open and never persisted — a real Mac answers ~184 names, and ~165 of them were the reason "which voice is good here" was unanswerable. When no best-tier voice is installed, the BEST shelf holds an actionable row — *⬇ Get Siri voices — free download* — whose commit asks the bridge's `POST /voices/install` to open the macOS voice-download pane: darwin-only, loopback-only, and the argv is a **frozen constant** (`open x-apple.systempreferences:…`) that no byte of any request reaches; the download itself stays a human clicking through, which is the point of the pane. This is the ONE exec a deck may trigger, and it opens a Settings pane and nothing else. A Mac whose best voice speaks Italian must still not narrate an English deck with it. A Siri voice hiding behind a **duplicate display name** (how current macOS lists them) is dropped rather than offered — `say -v` addresses by name, so that row would play a different voice than it names. A machine with **no best-tier voice** is told, on the caveat channel every engine already has (the bridge's startup line, the deck's toast): Siri voices are a free download away, with the Settings path and the `open "x-apple.systempreferences:…"` command that gets there — suggested, never run, because only a person can click through a voice download. **Windows** is read through PowerShell — the **WinRT** stack first (`Windows.Media.SpeechSynthesis`, projected from Windows PowerShell 5.1), because that is where the **natural** voices live (Aria, Jenny, Guy — the neural ones Narrator and Edge use, and the closest thing Windows has to Siri); `System.Speech`, the 2006 API that sees only David, Zira and Mark, is the fallback for a PowerShell that cannot project. Synthesis goes through whichever stack listed the voice, and a name the machine does not have throws rather than falling back to the default voice. A machine with no natural voice installed is told where they are — Settings → Accessibility → Narrator → *Add natural voices* — on the same caveat channel and with the same picker row as macOS's Siri hint (`start ms-settings:easeofaccess-narrator`, a frozen argv, is the one exec that row may trigger there). Both become real bridge engines (`--tts-engine say|sapi`), synthesizing 24 kHz PCM in a WAV like every other engine, `stylable: false` so the picker skips the tone step. **Android** is detected and refused with the reason: Termux reports `android` and runs Node, but Android's TextToSpeech is an in-process Java API with no command line behind it, so there is nothing for a bridge to call — the honest path there is a recorded track, which needs no bridge. A native voice is the ONLY engine claimed automatically, because it is the only one that needs no setup at all; **piper is never auto-selected even when it is on PATH**, since it needs a toolchain and a ~120 MB model and that choice belongs to the first-run wizard, which saves it. Any `--tts-engine`, `--project`, `GOOGLE_CLOUD_PROJECT` or saved config wins outright and detection is never consulted. When a machine has nothing, the skip line says what THIS machine lacks and names piper; and if **Ollama** is answering on 127.0.0.1:11434 (a ~300 ms probe, raced against a timeout so a hung socket cannot stall startup) it adds that Ollama serves LLMs and has no speech endpoint — the single most common thing a local-AI user expects to cover this. **A missing piper voice is caught before the bridge starts, not by it**: piper installed and chosen but with no model on disk used to bring the bridge up looking healthy and fail on the first sentence — a keypress into silence, for a file that was never there. `decklight author` now checks, names the model, its directory and its size, and on a **TTY** offers to fetch it; accepting re-plans so the bridge joins the session, declining or a non-TTY run keeps the skip line. **Nothing is ever downloaded silently.** The command it runs is chosen for the machine (`tools/tts-engines.mjs`): a python that can already import piper gets `python -m piper.download_voices`, and otherwise `uvx --from piper-tts` runs it inside the isolated venv `uv tool install piper-tts` creates — the plain form cannot work there, which is why it used to fail with `ModuleNotFoundError` on a machine that had just followed decklight's own install instruction. **First-run setup**: the first time the bridge cannot start — a bare `decklight tts`, or `decklight author` about to skip the voice because nothing is configured — decklight asks a few plain questions on the terminal (TTY only) instead of exiting with the engine's error: the engine, with the free/offline/cloud trade-offs stated and the default following what the machine already has (an `$ELEVENLABS_API_KEY` outranks everything — nobody exports one by accident; else piper on `PATH`, else a project visible in the environment or gcloud config), then only that engine's prerequisites — a GCP project id (prefilled, validated with the same rule the flags enforce) plus a credentials probe for the cloud engines; for piper the install and voice-model download commands, run only on an explicit yes; for elevenlabs nothing at all when the key is exported (the roster answers "which voice", so it is not asked) and otherwise where to make a key and why setup will not save it for you. Setup proves the choice with one real synthesis of the picker's preview sentence, reporting duration and the engine's cost note, and only a config that has spoken is saved — to `~/.config/decklight/tts.json` (`$XDG_CONFIG_HOME` honored), which both `decklight tts` and `decklight author` read from then on; precedence is flags > environment > saved config > built-in default. `decklight tts --setup` re-runs the questions, deleting the file resets to first-run, and non-TTY invocations never prompt — exit codes and messages stay as they were. **The voice is the clock**: auto-advance is driven by narration finishing, so when the voice CANNOT be played — a quota 429, an unreachable bridge, a browser that blocked autoplay, a recorded track with no file for this slide — the deck **stops advancing** rather than walking the talk past slides nobody has heard, and says why in a message (`I`) naming the cause and the way out (`--tts-engine chirp` for a 429, `decklight tts` for a dead bridge, one click for blocked audio). Narration switches itself off; `V` retries — the picker drills tracks → voice (30 prebuilt Gemini/Chirp names, one piper model, an OS voice, or the ElevenLabs account's own roster) → tone, on any engine `/ping` reports as `stylable` (six presets or a custom typed instruction — a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs `eleven_v3`). Every voice row carries a ▶ **preview** that speaks an editable test sentence (default "Hey, this is Decklight", input at the top of the voices view, ↺ restores the default) through the bridge in that voice; tone rows preview the drafted voice in that delivery style, and the custom-tone input has a ▶ to audition a typed instruction before committing it. After a preview plays, the rest of its roster prefetches sequentially in the background (all voices neutrally, or all tones for the drafted voice). Two preview caches: the default sentence's cache is permanent once built; the custom sentence's cache holds exactly one sentence and is swapped (old audio freed) when the text changes. **Build-synced auto-advance**: the ⟨CLICK⟩ markers that segment the notes for the speaker view segment the audio too — segment k is synthesized as its own clip and narrates build step k (0 = arrival); when a clip ends the deck reveals the next build, and after the last segment it moves to the next slide, so a deck with well-segmented notes presents itself beat by beat. **More segments than builds** — the commonest case being a slide with no `data-build` at all, which has exactly one step — used to drop every surplus segment: never synthesized, never spoken, never mentioned, while the speaker view went on displaying it, so the presenter read a cue the deck would never say. The surplus now rides on the **last** step. There is nothing left to reveal, so the marker becomes a beat rather than a build trigger — the same call `tools/video.mjs` makes for a count that does not line up, and the same one the panel's `Record this deck…` stitching and the viseme sidecars make, each giving a folded segment a segment-sized silence rather than a sentence-sized one so a recorded take breathes where the live one does. The counts disagreeing is still nearly always an authoring slip, so it is named once per slide in the message log (`I`) and the debug log — never toasted, because it is a note about the deck rather than something to act on mid-sentence. The opposite mismatch needs no rule: fewer segments than builds already advances after a short beat, losing nothing. A segment with no words advances after a short beat; a slide with no notes is skipped; manual navigation mid-clip wins over the pending advance and re-syncs the voice to the new step. **Between sentences the voice breathes 0.25s by default** — the pause a reader takes at a full stop, which a chain of separately synthesized clips otherwise lacks — overridable for the deck (`narration: { sentencePause: 0.5 }`) and per slide (`data-narration-sentence-pause="0"`, where an explicit zero is zero); a typo falls through to the next tier, never to silence. the panel's `Record this deck…` stitches the same breath between sentences, so a recorded take paces a slide exactly as the live voice did. **Every pause resolves the same three tiers** — the slide's attribute, else the deck's `narration: { sentencePause, beatPause, slidePause }`, else the built-in default (0.25s between sentences, **0.5s between builds, 1s before the slide turns**) — opt-*out* rather than opt-in, because a deck that talks straight through its own punctuation is the behaviour nobody asks for on purpose; so a deck can breathe uniformly from one line of config and a single slide can still say otherwise, down to `"0"`; an unparseable value at either tier falls through, never to silence. **`data-narration-beat-pause="0.5"`** is the same breath **between builds**: each bullet lands, holds that many seconds, and only then does the voice reveal the next — honored at play time for live and recorded tracks alike, never baked into a recording, and malformed values read as no pause, exactly like its end-of-slide sibling. **`data-narration="hold"`** on a section marks it interactive (quiz, exercise, live demo): narration plays whatever notes it has and builds still sync, but the deck never auto-advances *off* it — the presenter moves on manually and narration resumes on the next slide. The spoken unit is a **sentence**: each ⟨CLICK⟩ segment splits into sentences, every sentence is its own TTS call and cache entry (slide, segment, sentence, voice, style), playback chains them and advances only after the segment's last one — so first audio arrives after one short synthesis, never a whole paragraph. While narration is on, a **lookahead buffer** keeps the next 10 sentences synthesized in the background (a few parallel low-priority workers, window re-derived from the current position, results landing in the same cache); an unreachable bridge toasts once and pauses the buffer until the next event. the panel's `Record this deck…` records per-slide `slide-NN.wav` files **stitched from this same sentence cache** (short silences joining sentences and builds) — already-heard clips cost nothing, only unheard sentences synthesize. **They are written next to the deck, not downloaded**: in author mode each stitched slide is POSTed to the server that already owns the deck file (`/edit/record`), which writes it — and the character's `slide-NN.visemes.json` sidecar — into the deck's own `narration.files` folder, or `voiceover/` when the deck names none. That is the only place `narration.files` can point at and the only place `decklight bundle` looks, so the recording is finished where the next command reads it; the browser's download folder is neither, and is now the FALLBACK for the cases nothing may write to disk — a `file://` deck, or one served read-only by `decklight present`. The player names the folder and never the file: `/edit/record` builds `slide-NN.wav` itself and refuses a folder that resolves outside the served root, so the write surface a recording opens is one directory of one deck. The card that ends the recording says which of the two happened and, on disk, the exact `narration: { files, ext: 'wav' }` line that plays the set back. **`P` pauses/resumes** narration — audio freezes mid-sentence and resumes exactly there, and auto-advance holds while paused. Captions (`C`) follow the voice **sentence by sentence** during live narration (segment-level when narration is off). With nothing configured, `V` opens the picker instead of failing. **The deck announces its own voice**: when a recorded track is configured, a small pill fades in bottom-center about a second after load — *🔊 this deck has a voice-over — `V` plays it* — and clicking it starts narration (the click is itself the user gesture, so the audio is never the blocked-autoplay case). It fades out on its own after ~12s and is written to the message log (`I`) rather than toasted, since the pill is already on screen saying it. It never appears in `?print`, in embedded previews (the theme picker and slide finder boot real decks in iframes), under `?voiceover` (which starts on the first gesture anyway), while captions (`C`) hold that same corner, or once narration has been started on this deck — remembered per deck path like every other narration preference. Without it the only proactive surface was the touch sound button, which CSS shows on `pointer: coarse` alone, so a viewer on a laptop could only learn the deck talks from a key nobody had mentioned. Files are generated by **`decklight voiceover <deck.html>`** (the dispatcher spawns `tools/voiceover.mjs`, which arg-parses at load and so cannot be imported — the same way `video --voiceover` runs it) — the headless counterpart of the deck's the panel's `Record this deck…`: notes → optional local-LLM rewrite → `--engine piper` (local neural TTS; `--voice` = piper model name) or `--engine gemini` (gemini-2.5-pro-tts on Vertex AI; `--voice` = prebuilt voice name). The built-in speech-synthesis voices were removed — not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
516
|
+
- **Character** (`V` → Character…, or palette → Character…): an animated narrator in a stage corner whose lips sync to the narration — fully offline, no cloud service. Two render modes behind one overlay (`.decklight-character`, persisted per deck): **🎭 2D character** — a layered SVG bust (theme-aware clothing/backdrop, blink, idle sway) with one mouth group per Rhubarb shape (`A–H` + `X` rest); a 30 Hz loop maps `narrAudio.currentTime` onto a **viseme timeline** and shows the matching `[data-mouth]` group, so pause (`P`) and voice speed (`<`/`>`) sync for free. **🎥 Neural video** — a muted picture-in-picture `<video>` talking head (audio always comes from the narration element; muted video is immune to autoplay policy) generated by Wav2Lip or SadTalker on the presenter's own GPU, drift-corrected against the audio clock (±150 ms) and mirroring its play/pause/rate. Timelines and clips come from the **lipsync bridge** (`decklight lipsync`, default `http://127.0.0.1:8789`, override via `narration.character.bridgeUrl`; CORS-open, 127.0.0.1-only, disk-cached in `~/.cache/decklight/lipsync` keyed by audio+params hash): `GET /ping` reports which engines actually resolve (the picker greys out the rest), `POST /viseme?text=` (raw WAV body → timeline JSON v1: `{v, duration, cues: [{t, v}]}` — start-time cues, each shape holds until the next), `POST /video?engine=&portrait=` (raw WAV → muted faststart MP4; strictly serial GPU queue). In **live voice** mode the sentence is the unit here too: the lookahead buffer that keeps 10 sentences of audio warm hands each synthesized sentence's WAV to the bridge, so lip-sync data prefetches through the same window, workers, and promise-cache dedup as the voice — and playback NEVER waits on lip-sync (a late timeline lands mid-sentence; until then the **fallback** animates: `amplitude` (default) drives a coarse 4-shape mouth from a WebAudio analyser, `hide` shows the idle face). In **recorded** mode the overlay loads per-slide sidecars from the track's dir — `slide-NN.visemes.json` / `slide-NN.mp4`, generated by `tools/lipsync.mjs` (rhubarb + optional SadTalker/Wav2Lip batch, hash-incremental like voiceover.mjs) — preferring an inline `<script type="application/json" data-decklight-visemes="slide-NN">` block when present (`decklight bundle` inlines viseme JSONs; fetch is blocked on `file://`). the panel's `Record this deck…` exports `slide-NN.visemes.json` alongside each stitched WAV (same sentence cache, same silence gaps) so a recorded set is character-ready with zero extra synthesis. **Solo** (`N` → Character… → Solo, or palette → "Character solo"): the narrator takes the stage — the slide content, progress bar and slide number step aside (`visibility: hidden` on `.decklight-stage`, which the overlay is a sibling of) and the character centers, sized to the stage (`--character-solo-size`, default `min(74vh, 74vw)`). A talking-head slide with nothing else on it, without authoring one. Works with either render mode, persists per deck alongside `mode`, and is a *presentation* state, not a layout: the root's `decklight-solo` class is only ever set while the character is actually on screen, so turning the character off — or stopping the narration — can never leave a blank stage behind. Turning solo ON shows the character immediately (idling, blinking) rather than waiting for `V`. **Motion** (`decklight lipsync --veo`, SPEC PRESENTING): Wav2Lip repaints the lip region and leaves the rest of its source untouched — from a still photo that is a frozen stare with a moving mouth. With `--veo` the bridge animates each portrait ONCE through Veo image-to-video on Vertex AI (`veo-3.1-lite-generate-001` by default; 4/6/8s; `generateAudio: false` — the deck owns the voice, and it is the cheaper rate) and gives Wav2Lip that clip as its `--face`, so the head turns and blinks under the new mouth. The unit is the PORTRAIT, not the sentence: the player asks for video once per sentence through a 10-sentence lookahead, so a Veo call per sentence would be both unusably slow (~40s) and a runaway bill — instead each portrait's motion clip is bought on first use, deduped in flight, and cached on disk (keyed by portrait+model+seconds+prompt), so a deck of any length costs exactly one call per portrait, ever. Delete the cache entry to re-roll the performance. The clip is cropped square around the head (the overlay is a circle) and scaled to 640px (s3fd misses faces in a large frame). SadTalker is excluded — it generates its own head motion and wants a still. A refusal by Veo's person-generation filter surfaces as an error naming the cause, never an empty clip; a misconfigured `--veo` disables only itself and leaves visemes and still-portrait video working. It is the only part of the bridge that leaves the machine, so it is opt-in, and `decklight author` passes it straight through. Config (`narration.character`, all optional): `mode: 'off'|'viseme'|'video'` (picker overrides, persisted), `solo: boolean` (default false; picker overrides, persisted), `bridgeUrl`, `position: 'br'|'bl'|'tr'|'tl'`, `size` (design px, default 220), `svg` (custom art: inline markup, `'#id'` ref, or URL — contract: `[data-mouth="A"…"X"]` groups; optional `[data-eyelid]`/`[data-idle]` get the blink/sway), `sprites: {A: url, …}` (image frames instead), `engine`/`portrait` (video mode; Wav2Lip suits live — static pose, seamless per-sentence cuts; SadTalker suits batch clips), `fallback: 'amplitude'|'hide'`. Bundles: viseme JSONs inline (1–4 KB/slide); per-slide MP4s stay external with a CLI notice — video cannot inline sanely.
|
|
470
517
|
- **Command palette**: `/` opens a Claude-style palette — every command with its shortcut, type-to-filter, `Enter` runs, `Esc` clears then closes. Argument commands (Theme…, Font…, Narration voice…, Module…, Find slide…) drill into their pickers; contextual commands appear only when applicable (Save generated theme, Browse marketplace themes, the Configure ⟨engine⟩ wizard rows, Module). Inline arguments work: `goto 27` — or just typing `27` — surfaces a “Go to slide 27 / N” row (clamped to the deck), and selecting the bare “Go to slide…” command keeps the palette open with `goto ` prefilled. Text matching no command falls back to a “Search slides for …” row that opens the finder with the query prefilled.
|
|
471
518
|
- **Slide finder**: reached from the palette (`/` → Enter, or the search fallback) — a find-a-slide overlay with the picker's anatomy — a query bar and result list on the left, a live preview of the selected slide on the right. Typing filters as an AND over the query's words against each slide's text; slides whose **title** contains every word rank first, body-only matches follow, and every match is listed as `<slide number> · <title>` (slides without a heading fall back to their leading text). `↑/↓`/hover browse (the preview swaps live), `Enter`/click jumps to the slide, `Backspace` edits, `Esc` clears the query then closes. The preview reuses the picker's lazy embedded-deck mechanism — the iframe boots once (carrying the active theme, generated/custom included via `?gen=`), then selections postMessage `{__decklightPreview: {goto: [slide, step]}}` into it; no reload per candidate.
|
|
472
519
|
- **Playlist (multi-deck navigation)**: `Decklight.init({ playlist: { modules: [{title, href}…], index: n } })`. Advancing past the last build of the last slide navigates to the next module (`href#/1/0`); reversing before slide 1 goes to the previous module's end (`href#/999/999` — oversized hashes clamp to the last slide/step). The other modules appear as rows in the **slide finder** (`G`) — marked `▸ <title> — module`, previewed like any slide, and `Enter` loads that file; the slide-number chrome shows the module title and opens the finder on click. There is no separate module menu: "go somewhere" is one question with one answer. Works on `file://` with relative hrefs; embedded instances never chain.
|
|
473
|
-
- **
|
|
520
|
+
- **History** (`H`, author mode; `R` is the same door). Every commit that touched this deck, newest first, with a live preview of each and a `⇑` on the ones that exist nowhere but this machine. Each row carries what that version **was** and what it **changed** — a slide count, and `+added` / `−removed` lines in the two colours every diff has used for forty years — because a hash and a subject cannot tell "tightened the wording" apart from "cut four slides", and that is exactly the distinction you are scanning for. The preview has its own transport (`⇤ ← → ⇥`, and the same keys), so a version is judged by walking it rather than by its first slide; the deck behind the overlay does not move. **The preview is what this overlay is for**, so the layout is built never to fight it: a wide panel, the preview on a 16:9 `aspect-ratio` because a deck is 1280×720 and a letterboxed sliver judges nothing, and a rail that is structurally incapable of squeezing it. That last part is the lesson from shipping it squeezed — a flex item's default `min-width: auto` forbids shrinking below its own min-content width, so a rail whose row put four things on one line, under a `nowrap` title bar, made `flex: 0 0 300px` a suggestion its content could veto, and the pane rendered 57px. The row is two lines now — subject, then a dimmer line of hash, badges and a compact age — the title bar wraps, and `min-width: 0` is on the column, so nothing in the rail wants to be wide and the preview's size stops being an accident of how somebody worded a commit message. `⏎` **asks** — it names the version, says the restore is written as a NEW commit and that nothing is rewritten — and `⏎` again does it. Restoring is recoverable, but recoverable is not the same as intended, and the whole premise of a history is that you opened it to look rather than to decide. Restoring used to be its own overlay with its own list and its own name for a commit; folding it in means there is one place a version is looked at and one place it is chosen, rather than two that had already begun to differ. It is the git-level sibling of `Z`/`⇧Z`: `Z` takes back a keystroke, this takes back a session. **In present mode `H` opens the deck update instead** (`PRESENT#UPSTREAM`): a presented deck has no edit server and so no history to preview, and the live question there is whether the author has pushed anything since you cloned it.
|
|
474
521
|
- **Speaker view**: `S` opens a popup (synced via BroadcastChannel): current + next slide thumbnails, notes (with `⟨CLICK⟩` markers highlighted as the matching build lands), elapsed timer, build step list (provider labels). **Rehearse mode**: pressing `S` again (in the deck or in the popup; the header badge also toggles) swaps the prose notes for the slide's `aside.rehearse` cue cards (DECK_ANATOMY) — rendered large and bold, one cue per segment, same said/now/next highlighting. Slides without rehearse notes fall back to the full prose. `S` in the deck only opens a new popup when none is connected; while one is open it toggles the mode. **Phone remote**: when the deck is being played by `decklight present --remote` (below), the speaker view also shows a QR of the controller URL — click it to enlarge for scanning across a lectern. It appears only when a remote is actually on, since without it there is no LAN URL to encode.
|
|
475
522
|
- **Phone remote** (`decklight present <deck.html> --remote`): the presenting server also listens on the LAN and serves `GET /remote` — a self-contained controller page with prev/next and a live "slide x/N" readout, no external asset of any kind (a phone is off-loopback, so anything it fetched from elsewhere would be a hole). A tap is relayed as a named `remote` event on the SSE stream the deck already holds, and the deck POSTs its position back, so the readout tracks the deck however it moved (phone, keyboard, or click). `POST /remote/pos` is the deck→phones direction and **accepts only loopback callers**: the deck is the one thing that knows the position, it reports from this machine, and a phone — or anyone who obtained the QR token — posting a fabricated `{i,n}` would desync the readout every other phone shows. `--remote` widens the **listener** and nothing else: off this machine **only** `/remote/*` answers, and only with the per-run random token the printed URL and its QR embed — the deck itself and every file beside it stay unreachable from the LAN either way. One exported classifier decides it, `allowRemote(req, token)`, and `PRESENT#REMOTE` is why it lives on this server: the remote used to sit on the **author** server, so a clicker meant running `/edit/notes`, `/edit/layout` and `/edit/agent` on the LAN during a talk you were not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes.
|
|
476
523
|
- **Print/PDF**: `?print` renders all slides sequentially, every build complete, terminal casts fully expanded, one slide per page (`@media print` CSS). No JS needed after layout. Background media (DECK_ANATOMY) prints as a still: no `<video>` element is ever created in print — the slide's `data-background-poster` renders as the background image instead. Two handout variants restructure the same fully-built render onto portrait pages (one `.print-page` per sheet): `?print=handout` groups slides three to a page, each scaled slide beside a column of ruled note-taking lines (page count = ⌈N/3⌉); `?print=notes` gives one page per slide with that slide's speaker notes rendered underneath — slides without notes keep their page with an empty notes block. **Page count equals slide count** (⌈N/3⌉ for handout): the page box has no margin, so the document has none either — the UA's default body margin would push the last slide's final pixels past the last page box and emit a blank final sheet. **`decklight pdf <deck.html>`** writes that render to a file without a print dialog: headless Chrome over the deck's own `?print`, one slide per 1280×720 page (960×540 pt), `-o` for the path, `--theme` to export in another theme (it rides `?theme=`), `--wait` for decks that need longer to settle. Slides the overflow guardrail flagged are named on stderr by slide number — the PDF is still written, because a clipped slide is worth knowing about, not worth refusing. No Chrome, or no file produced, exits non-zero rather than leaving a silent empty PDF.
|
|
477
|
-
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4 — a full-resolution still per FRAME (each a one-shot headless Chrome against `#/<n>/<step>`, the shot.mjs mechanism), muxed with the audio into a single file. A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail. A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load — the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP** — the same loopback core `present` uses (`serveForRender`) — never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `present`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead — fixing the deck's length — reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>`, `--slides a-b`, `--voiceover` (runs the voiceover batch first). Needs ffmpeg + ffprobe — missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). Honest MVP limits: frames are stills, so the **character overlay appears but frozen** and terminals render fully expanded rather than typing (animated capture needs a CDP screencast — a named Node ≥22 follow-up), and a build **cuts rather than animating** (the frame is a still of each step, not a capture of the transition between them). A **narrated** slide builds too where its notes say so: `⟨CLICK⟩` segments the speaker notes, `tools/voiceover.mjs` synthesises one audio file per segment (same characters, so the same cost — the per-slide `slide-NN.m4a` is *concatenated* from them, and every existing consumer of it is untouched), and segment k narrates build step k for that segment's ffprobe'd duration. This is the recorded mirror of a rule that already ships: `src/core/narration.js` speaks live narration the same way, and captions, rehearse mode and the notes editor share the segmentation. A marker count that does not match the build count **warns naming the slide and renders the old way** — a wrong sync baked into an mp4 is worse than no sync — and a manifest written before this renders exactly as it did.
|
|
524
|
+
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4 — a full-resolution still per FRAME (each a one-shot headless Chrome against `#/<n>/<step>`, the shot.mjs mechanism), muxed with the audio into a single file. A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail — plus the slide's hold: the built-in 1s, or whatever `data-narration-pause="2"` asks for instead — so the mp4 breathes where the live deck does. (`video.mjs` reads sections, not the boot call, so the deck-wide `narration.slidePause` tier is not seen there; the attribute is.) (That attribute is the narrated counterpart of `data-video-hold`, which paces a *silent* slide: a slide with no narration has no narration to pause after.) A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load — the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP** — the same loopback core `present` uses (`serveForRender`) — never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `present`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead — fixing the deck's length — reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>`, `--slides a-b`, `--voiceover` (runs the voiceover batch first). Needs ffmpeg + ffprobe — missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). Honest MVP limits: frames are stills, so the **character overlay appears but frozen** and terminals render fully expanded rather than typing (animated capture needs a CDP screencast — a named Node ≥22 follow-up), and a build **cuts rather than animating** (the frame is a still of each step, not a capture of the transition between them). A **narrated** slide builds too where its notes say so: `⟨CLICK⟩` segments the speaker notes, `tools/voiceover.mjs` synthesises one audio file per segment (same characters, so the same cost — the per-slide `slide-NN.m4a` is *concatenated* from them, and every existing consumer of it is untouched), and segment k narrates build step k for that segment's ffprobe'd duration. This is the recorded mirror of a rule that already ships: `src/core/narration.js` speaks live narration the same way, and captions, rehearse mode and the notes editor share the segmentation. A marker count that does not match the build count **warns naming the slide and renders the old way** — a wrong sync baked into an mp4 is worse than no sync — and a manifest written before this renders exactly as it did.
|
|
478
525
|
- **Overflow guardrail**: content that exceeds the slide flex-shrinks into a scroll box and reads as clipped. The engine warns (`console.warn`) and marks the section with a `data-overflow` attribute — on each slide activation, and for the whole deck in `?print`. The mark is **live, not latched**: layout is not final when a slide activates (a webfont resolves, an image decodes, a chart or terminal mounts), so the active slide is watched and the check re-runs whenever its content changes size or shape. It never waits on a frame — headless renders run out of frames once the page goes idle, and an unmeasured slide is indistinguishable from a clean one. The warning fires on the way in only, so one clipped slide is one line, not one per re-check — so authoring agents can assert `[data-overflow]` is absent in their headless verification (`decklight pdf` does this for a whole deck in one pass and names the offending slides). Overflow always goes **down**, never up: a slide centers its content with `safe center`, so content taller than the slide falls back to top alignment instead of overflowing symmetrically. Plain centering would push half the excess out of the top of the box, through the padding a pinned title reserves for itself, and render the first content element on top of the title.
|
|
479
526
|
- **Pinned titles**: `pinTitles: true | false | <px>` keeps slide titles at one vertical position instead of drifting with content height. **On by default** (`true`); `pinTitles: false` restores the drift-with-content centering deck-wide. `true` pins at **99px** from the stage top (design coordinates — the natural title position of the course's "The Single-Agent Limit" diagram slide, the chosen reference); a number pins at that Y. The leading `h1`/`h2` of each **pinnable** section is absolutely positioned at the pin Y; the section reserves `pin Y + measured title height + 18px` of top padding so the remaining content centers below. Pinnable = has a leading `h1`/`h2` AND content beyond it (`ul, ol, svg, pre, table, .terminal, img, .columns` outside the notes) — title cards and quote/statement slides stay centered. Per-slide: `data-pin` forces a pin (even when the config is off), `data-pin="none"` opts out, `data-pin="<px>"` overrides the Y. Titles are re-measured on `sync()` and when webfonts finish loading; print uses the same layout. A detected **subtitle** (DECK_ANATOMY) joins the pinned header block — absolutely positioned directly beneath the title (6px gap) and included in the reserved padding, so content centers below title + subtitle.
|
|
480
527
|
- **Terminal footprint**: a terminal's screen area has a stable size — a **16:9 aspect floor** (width-driven) clamped by the `data-rows` cap as the max — so the box arrives full-size before anything plays and never resizes as steps stream in (output beyond the box scrolls). Real print expands casts fully.
|
|
481
|
-
- `Decklight.init(config)` options: `transition`, `hash` (default true), `controls` (default true: prev/next chevrons; the progress bar is the `
|
|
528
|
+
- `Decklight.init(config)` options: `transition`, `hash` (default true), `controls` (default true: prev/next chevrons; the progress bar is the `J` toggle, above), `slideNumber` (default `false | 'n' | 'n/N'`), `width/height` design resolution (default 1280×720, scaled to fit), `themes` (array of theme names for the picker/cycle; default: all shipped themes), `playlist` (multi-deck navigation, above), `pinTitles` (pinned titles, above), `concepts` (diagram concept-color pinning, SVG_DIAGRAMS), `logo` (brand mark, above).
|
|
482
529
|
- **Single-file bundling**: `decklight bundle <deck.html> [-o out.html] [--themes current|all|a,b,…]` flattens a deck into one self-contained HTML — runtime and structure CSS inlined, selected themes embedded as inline-theme blocks, `data-cast` terminals converted to `data-cast-inline`, images (`<img src>`, `data-background-image`, `data-background-poster`) to data: URIs. Background videos stay external with a notice — the same posture as character MP4s. Playlist links can't resolve inside a single file; the CLI lists them as a notice.
|
|
483
530
|
- **Runtime upgrade**: `decklight upgrade <deck.html> [--dry-run]` brings a self-contained deck's inlined runtime up to the installed package: the runtime css + js blocks are swapped for the installed `dist/` builds and re-marked `data-decklight-runtime="css|js"` (decks from before the marker are recognized too — the first head `<style>` carrying the structural css, and the `<script>` defining `Decklight` before the `Decklight.init` call), and `<style data-theme>` blocks refresh from the installed `themes/`, preserving which one is active. A block naming a theme not in `themes/` is always kept as-is, with a warning that says which of two things this is (MARKETPLACE.md `OPEN` 1): carrying `data-theme-added` (`theme add`/Browse's own marker, THEME_DISTRIBUTION) means the theme was never decklight's to begin with, so there is no "upstream" copy to refresh it from — `upgrade` never fetches one, the same registered-not-fetched posture `MARKETPLACE_REGISTRY` already holds elsewhere, and a theme carries no version to pin or refuse a stale one against (deliberate — THEMING); without the marker, it is a theme decklight's own shipped set has since dropped. Everything the author wrote survives byte-for-byte. In place, `<deck>.html.bak` written first; `--dry-run` prints the plan and touches nothing; a second run reports "already current". Non-decklight files (no `Decklight.init`) and merged multi-module bundles are refused. `init` marks the blocks it writes with the same attribute.
|
|
484
531
|
- **Merged single-file presentation**: `decklight bundle <deck.html> --all [--title "…"]` follows the deck's playlist and concatenates EVERY module's sections into one deck (explicit form: `decklight bundle a.html b.html … -o one.html`). Each module's first section is marked `data-module="<title>"`; embedded cast ids are prefixed per module to stay unique; relative asset refs are rebased onto the first deck's directory; the per-module `playlist` config is stripped. **In-file module navigation**: `data-module` sections are ordinary slides, so the finder (`G`) already finds them by title or body text and `goto()`s them with no page load; the chrome module tag shows the module of the current slide (nearest preceding marker).
|
|
485
532
|
- **Publish (GitHub Pages)**: `decklight publish <deck.html> [--branch gh-pages] [--remote origin] [--no-bundle] [--path <subdir>]` — bundles the deck (single-file, via the bundler above; `--no-bundle` pushes the file as-is) to `index.html` + `.nojekyll` and pushes them to the branch on the remote, then prints the site URL derived from the remote URL: `git@github.com:owner/repo.git` and `https://github.com/owner/repo(.git)` both → `https://owner.github.io/repo/`, an `owner.github.io` repo → `https://owner.github.io/`, and a non-GitHub remote just prints the pushed ref. The commit is built with git plumbing (`hash-object → mktree → commit-tree → push <sha>:refs/heads/<branch>`), so the author's working tree, index, and checked-out branch are never touched. The first publish creates the branch as an orphan and prints where to enable Pages in the repo Settings; every later publish fetches the remote branch and parents on it — history, not force-push — and the sign-off in the commit message comes from `git config user.name/user.email`. `--path <subdir>` publishes under a subdirectory, preserving whatever else the branch already carries. Zero new dependencies: plain git.
|
|
486
533
|
- **Publish targets** (`--target gh-pages|netlify|vercel`, default `gh-pages`; MARKETPLACE.md ENGINES): where the bundled page goes is a choice, not only a place. gh-pages — the bullet above, unchanged — needs git auth and no credential, so it stays core. Netlify and Vercel need a token, so they follow the rule anything on the authoring path needing a credential becomes a marketplace engine behind a core affordance: the affordance is `--target`, and each declares a real `ENGINES#WIZARD` schema (`cli/wizard.mjs` `validateSchema`), so a missing or malformed answer is refused by the exact validation a browser-wizard engine goes through, not a bespoke check. **The token is never a terminal prompt and never the browser wizard** — `publish` is a one-shot, often-headless command (CI has no browser to paste a key into, and no `/edit/wizard` to post it to, since that endpoint is served by the author server, which `publish` never starts) — so it is read from the **provider's own CLI env var** (`NETLIFY_AUTH_TOKEN` + `NETLIFY_SITE_ID`, `VERCEL_TOKEN` + `VERCEL_PROJECT` + optional `VERCEL_TEAM_ID`), matching the ElevenLabs precedent (`tools/elevenlabs-tts.mjs`): a key is not boring, so the environment remembers it and it is never written to `~/.decklight/`. `--branch`/`--remote` are refused alongside a non-gh-pages target rather than silently ignored, since they would otherwise appear to do something. Netlify deploys as a single zip (`cli/zip.mjs`, the `skills --pack` container plumbing); Vercel takes the same files inline as base64 in one JSON POST, per its own API shape. **S3 is deliberately not a target yet** — the one provider needing request signing (SigV4) rather than a bearer token, and a hand-rolled signer nobody can exercise against a real bucket in CI is a correctness claim not worth shipping unverified; Netlify and Vercel are what prove the shape generalizes (MARKETPLACE.md `OPEN`).
|
|
487
534
|
|
|
535
|
+
## REVIEW — Reviewer comments
|
|
536
|
+
|
|
537
|
+
A deck gets reviewed the way a document does — "slide 12 contradicts slide 4", "cut the third bullet" — and
|
|
538
|
+
the numbers in that sentence go stale the moment a slide is inserted. Comments therefore live beside the deck
|
|
539
|
+
and are **anchored to slides by content**, not by number.
|
|
540
|
+
|
|
541
|
+
**The store** is `<deck>.review.jsonl` beside the deck: one JSON object per line, **append-only, never
|
|
542
|
+
rewritten**. That is the merge strategy rather than a tidiness rule — `.gitattributes` declares
|
|
543
|
+
`*.review.jsonl merge=union`, so two reviewers commenting at once produce two sets of added lines and no
|
|
544
|
+
conflict, and it holds only while nothing ever edits a line. Resolving a comment and replying to one are
|
|
545
|
+
records of their own (`{op:"resolve", re}` and `{re}`), so state is **folded from the log** rather than stored:
|
|
546
|
+
two people resolving the same comment is two harmless lines, and a resolve that `merge=union` placed above the
|
|
547
|
+
comment it refers to still lands. JSONL rather than JSON because an appended line is a one-line diff — a
|
|
548
|
+
reviewer's push reads in a pull request with no tooling at all — and `body` is written last so the eye lands on
|
|
549
|
+
the prose. A malformed line is skipped and **counted**, never fatal: this file arrives over email and through a
|
|
550
|
+
union merge, and refusing to read it because of one truncated line is how forty comments are lost to a
|
|
551
|
+
forty-first. It is not deck content: `bundle` never inlines it and the ingredients label never counts it, so a
|
|
552
|
+
signed deck stays `verified` no matter how much review it attracts.
|
|
553
|
+
|
|
554
|
+
**Every comment records which commit the deck was on** when it was written. That is a different question from anchoring and neither implies the other: a slide can be untouched in a deck that has moved forty commits since somebody read it. It is gated on being in a repository, **not** on `--no-git` — that flag says "do not commit for me", and this is provenance. `decklight comments` reports it with the distance (`against 1504ce8, 3 commits ago`), stays silent when there is nothing to say, and **never counts a commit this clone cannot resolve** — a comment can arrive by `--import` from someone whose history yours has not seen, and reporting `0 commits since` for a hash you do not have would be a confident lie. `--at <id>` is what the field is for: it prints what the slide SAID at that commit beside what it says now, because a verdict of `stale` can say the slide changed without being able to say how, and how is usually the whole question — a reviewer objecting to a sentence that is no longer there has either been answered already or been misread.
|
|
555
|
+
|
|
556
|
+
**Anchoring.** A slide has no stable identity — `locateSlide` is the nth `<section>` in the file and
|
|
557
|
+
`data-slide-index` is written from array position at every load — so a comment records the slide number, that
|
|
558
|
+
slide's title, and a **fingerprint** of its text, and resolution walks them in descending order of confidence,
|
|
559
|
+
**reporting which one answered**: `exact` (the fingerprint matched — this is the slide wherever it now sits,
|
|
560
|
+
naming where it moved from), `stale` (the fingerprint is gone but exactly one slide still carries the title —
|
|
561
|
+
probably right, and worth saying it may not be), `unanchored` (no fingerprint was ever recorded, so the index
|
|
562
|
+
is not a worse answer than nothing), `orphaned` (the slide is gone). A title match must be **unique**: two
|
|
563
|
+
slides called "Agenda" is an ordinary deck and picking the first would be a coin flip presented as an answer.
|
|
564
|
+
The positional fallback is **not** a fallback for a known slide — a comment that recorded a fingerprint and
|
|
565
|
+
cannot find it has lost its slide, and pinning it to whatever is twelfth now puts an objection under prose that
|
|
566
|
+
never said the thing. An orphan is listed rather than dropped, last: an objection to a slide somebody deleted
|
|
567
|
+
is often the most interesting line in the file. The fingerprint is over the slide's text with **whitespace
|
|
568
|
+
removed, not collapsed**, because the browser reads it through the DOM and a tool reads it out of the file and
|
|
569
|
+
the two disagree about spacing in endless invisible ways; notes are excluded, so an author polishing their own
|
|
570
|
+
speaker notes does not orphan every comment on the slide.
|
|
571
|
+
|
|
572
|
+
**`decklight review <deck.html>`** serves the deck over `http://127.0.0.1` and opens it at `?review`. It
|
|
573
|
+
registers `GET /review/ping`, `GET /review/comments` and `POST /review/comments`, opens the deck **read-only**,
|
|
574
|
+
and the one path it will ever write is the sidecar. It is a third command with a third route namespace rather
|
|
575
|
+
than a flag on `present` (which registers no `/edit/*` to have refused) or on `author` (which would hand a
|
|
576
|
+
reviewer the power to rewrite what they were asked to read) — the capability is stated by what is registered,
|
|
577
|
+
per PRESENTING's rule that a shared path with a boolean in it is how a server quietly acquires a capability
|
|
578
|
+
later, and it is **asserted as a test**: every `/edit/*` route answers as the unknown path it is, and the deck
|
|
579
|
+
is byte-identical afterwards. With a repository each comment is committed — the sidecar alone, staged by
|
|
580
|
+
itself, with the same per-invocation identity fallback every other decklight commit uses. **The server never
|
|
581
|
+
pushes**; that invariant is what a browser is pointed at, and it survives unchanged. Pushing exists only as
|
|
582
|
+
`review submit` below — a one-shot subcommand somebody typed, which is the argument `publish` already makes.
|
|
583
|
+
With no repository the file is simply written, because a reviewer who was sent a deck and has no clone must
|
|
584
|
+
still be able to say something; that file is the deliverable, and the author takes it in with
|
|
585
|
+
`decklight comments <deck> --import <file>` (merge by id, so importing twice changes nothing).
|
|
586
|
+
|
|
587
|
+
**`decklight review submit <deck.html>`** sends the review back: it pushes **one file** — the sidecar — to a
|
|
588
|
+
branch of its own, `review/<user>-<YYYY-MM-DD>` (the slug is a lossy rendering; the full identity rides in the
|
|
589
|
+
commit's `Signed-off-by`). The commit is built the way `publish` builds one — blob, tree parented on **what the
|
|
590
|
+
remote has**, `commit-tree`, push by object name — so the reviewer's working tree, index and checked-out branch
|
|
591
|
+
are never touched and none of their local commits come along; the assembled ref goes through the same
|
|
592
|
+
`refProblem` gate every user-influenced ref does. A second submit the same day parents on the branch already
|
|
593
|
+
there: a morning of reviewing is one branch, one pull request. The parent is the review branch, else the
|
|
594
|
+
checkout's upstream, else the remote's default branch — and **never an orphan**: an orphan's pull-request diff
|
|
595
|
+
reads as "delete every file in the repository", so no resolvable parent is a refusal, not a guess. `--pr` opens
|
|
596
|
+
the pull request **against the branch the review is of** — the checkout's upstream, else the remote's default
|
|
597
|
+
branch — never blindly against the repository default, which for a review of a feature branch would bury the
|
|
598
|
+
comments under that branch's own commits (behind `gh`, signed in; any failure past the push is a note, never an
|
|
599
|
+
exit), `--dry-run`
|
|
600
|
+
builds the commit and stops before any ref is written, and the announced count is **open comments through the
|
|
601
|
+
same fold every reader uses** — never a raw line count.
|
|
602
|
+
|
|
603
|
+
**The author finds out** without being asked, on three surfaces sharing one reader (two network calls no matter
|
|
604
|
+
how many reviews wait, landing refs exactly where a plain `git fetch` would): a line at `decklight author`
|
|
605
|
+
startup — detached, never awaited, never on a timer, and nowhere near the SIGINT path — the `M` overlay's
|
|
606
|
+
incoming section (read on demand, behind the keypress that opened it), and `decklight comments --incoming` for
|
|
607
|
+
SSH and pipes (exit 0 when the question was answered, including "none"; 1 when it could not be asked). The
|
|
608
|
+
startup check is a fetch the author did not type: it is the **named, sanctioned exception** to "never a fetch
|
|
609
|
+
you did not ask for", kept to the update-check shape, and switched off by any of `--no-review-check`,
|
|
610
|
+
`DECKLIGHT_NO_REVIEW_CHECK`, or `CI` — each reporting the *reason* it was skipped, because a silent skip and "no
|
|
611
|
+
reviews waiting" look identical and mean opposite things. The explicit switches silence **every** surface —
|
|
612
|
+
they mean "never touch the network for reviews" — while `CI` silences only the unasked startup fetch: a route
|
|
613
|
+
somebody exercises deliberately must still answer there. A check that could not run is a **named failure
|
|
614
|
+
state and never renders as "none waiting"** — unchecked is its own answer and never a pass. The `refs/heads/review/*`
|
|
615
|
+
glob is a frozen constant in the source; nothing derived from a deck, a request, or a reviewer's choices
|
|
616
|
+
reaches a refspec position.
|
|
617
|
+
|
|
618
|
+
**Reading and writing are two keys.** `M` shows every comment there is — yours and each review branch's —
|
|
619
|
+
**grouped by who said it**, one heading per source, open first and finished ones struck through below them
|
|
620
|
+
inside their group. `⇧M` leaves a comment on the slide you are looking at, in a card of its own that also lists
|
|
621
|
+
**what is already said about that slide**, so a point is not made twice. The composer used to live at the top of
|
|
622
|
+
`M`, which put a text box above twenty comments you were trying to read — and, worse, appeared only when a
|
|
623
|
+
`decklight review` server answered, so an author leaving themselves a note had to start a second server on a
|
|
624
|
+
second port in a mode that would not let them edit the slide they were commenting on. `author` now takes a
|
|
625
|
+
comment through the same append-only route it already used for resolves, and both servers build the record with
|
|
626
|
+
the same `reviewRecord`, so a union merge never meets two shapes of one thing.
|
|
627
|
+
|
|
628
|
+
**Doneness is per comment, and where the mark lives follows who owns it.** Your own comments already had a way
|
|
629
|
+
to be finished with — the append-only `{op:"resolve"}` record, which travels, so a reviewer can see you dealt
|
|
630
|
+
with their point; "done" is not a second state beside it, it IS that record. A reviewer's comments live on their
|
|
631
|
+
branch, which is not yours to write, so the mark is kept in **this clone's git config**
|
|
632
|
+
(`[decklight-review "<branch>"] done-<id>`): private, never pushed, reversible with `git config --unset`, and a
|
|
633
|
+
comment id is checked against the shape a config key allows before it becomes one. `R` marks the selected
|
|
634
|
+
comment either way — armed then confirmed for your own, because that append is shared and cannot be taken back;
|
|
635
|
+
immediately for a reviewer's, because a private mark is one keypress from undone and an arm protects nothing.
|
|
636
|
+
A review branch stops counting as waiting when every one of its open comments is marked, so finishing half of a
|
|
637
|
+
long review leaves the other half on screen and in the count. Marking one **re-sorts** it below the open ones,
|
|
638
|
+
so the selection follows the comment by id rather than by position — otherwise `R` pressed twice would mark a
|
|
639
|
+
second comment instead of un-marking the first. Nothing is ever copied: the merge/PR path still works for
|
|
640
|
+
anyone who wants the records themselves; it is simply not what this overlay does.
|
|
641
|
+
|
|
642
|
+
**A comment on a slide that no longer exists is reconciled, never stranded.** An orphan is still listed last
|
|
643
|
+
and never silently re-pinned — but `⏎` on it (with nowhere to jump) unfolds **what the slide said** at the
|
|
644
|
+
commit the comment was written against (`GET /edit/review/at`, the `--at` machinery served), putting the
|
|
645
|
+
objection back under the prose it was about; most orphans dissolve into a resolve right there. For a slide
|
|
646
|
+
rewritten past what fingerprint + title can find, `A` **moves the comment to the slide on screen** (armed,
|
|
647
|
+
then confirmed): an appended `{op:"anchor", re, slide, title, fp}` record — the third member of the
|
|
648
|
+
append-only op family, beside resolve and reply. The fold applies the **latest** anchor before resolution, so
|
|
649
|
+
the moved comment reads as if written there (`exact`), while the reviewer's original line is never edited —
|
|
650
|
+
which is what keeps `merge=union` and a replayed `--import` safe; an op's identity is its tuple, so arriving
|
|
651
|
+
twice is one line. `movedFrom` keeps pointing at where the reviewer wrote it: that history is the comment's,
|
|
652
|
+
not the anchor's.
|
|
653
|
+
|
|
654
|
+
**In the deck, `M`** opens one overlay whose powers depend on which server answered: a review server means the
|
|
655
|
+
composer is there, on the slide you are looking at; an author server means rows can be resolved; with neither,
|
|
656
|
+
the list still reads and says where comments come from. `⌘/⌃⏎` posts and a bare `⏎` is a newline, because a
|
|
657
|
+
comment is prose. Resolving is **armed, then confirmed**, and `Esc` backs out of the arm without closing. Submitting is the
|
|
658
|
+
same two-step (`S`, or the palette's "Submit review…"), and the browser never runs git: it asks
|
|
659
|
+
`POST /review/submit`, and the local server — the only thing in the room holding a capability — does the
|
|
660
|
+
pushing with the same code the typed subcommand runs.
|
|
661
|
+
Rows are built as nodes, never `innerHTML` — a comment is somebody else's text that arrived over git. The
|
|
662
|
+
author's server exposes the same store under the same append-only rule (`GET`/`POST /edit/review`).
|
|
663
|
+
|
|
664
|
+
**The panel sits beside the slide, not over it.** Reviewing is writing about what is on screen, so the overlay
|
|
665
|
+
is **non-modal**: it never dims or covers the deck. A small control in its header places it — **float**
|
|
666
|
+
(a movable card, the default, dragged by its header), or docked **left**, **right**, or **bottom**, where it
|
|
667
|
+
reserves a gutter (`--dock-left/right/bottom` on the root) and the stage reflows into what is left through the
|
|
668
|
+
same `rescale` that fits the slide to the window. The placement is **remembered per deck** in `localStorage`,
|
|
669
|
+
like the clock and the character. Because the panel is non-modal the deck keeps the keyboard: the panel owns
|
|
670
|
+
the arrows only while you are working **in** it (your last click or focus was the card), and hands them back to
|
|
671
|
+
the slides the moment you touch the deck — so you walk the deck with `←`/`→` while the panel stays up. The
|
|
672
|
+
composer's target **follows the slide you are on while the box is empty, and locks to it once you start typing**
|
|
673
|
+
(the label then says which slide it will land on and which you are merely viewing), so glancing at other slides
|
|
674
|
+
mid-comment never silently moves where it is filed. **Jumping to a comment's slide leaves the panel open** —
|
|
675
|
+
it navigates the deck beside it and nothing else. Closing on the jump was right while the overlay covered the
|
|
676
|
+
deck, because getting out of the way was the only way to see what you had jumped to; beside the slide that
|
|
677
|
+
reasoning inverts, and walking a review is jump, read, jump. `Esc` and `M` always close from either surface.
|
|
678
|
+
**`decklight comments <deck.html>`** is the terminal reader: grouped by slide, each group carrying how it was
|
|
679
|
+
found, orphans last, resolved ones counted rather than printed (`--all`, `--unresolved`).
|
|
680
|
+
|
|
681
|
+
Comment text is **untrusted input from a third party**. It is data everywhere it travels; the one place it
|
|
682
|
+
reaches a command line is a commit subject, and that goes through the same sanitiser as an agent's (one line,
|
|
683
|
+
capped, never leading `-`). It must never reach the `A` agent path unattended — CONTRIBUTING's split between
|
|
684
|
+
the thing with a schedule and the thing with hands applies directly.
|
|
685
|
+
|
|
686
|
+
This persists where ink (PRESENTING) is deliberately ephemeral, and the two must not be confused in the
|
|
687
|
+
vocabulary either: ink is the **presenter** marking a slide during a talk and is cleared on every slide change;
|
|
688
|
+
a review comment is a **reviewer** writing to the author before one. Different actor, different lifetime.
|
|
689
|
+
|
|
488
690
|
## JS_API — Public JS API
|
|
489
691
|
|
|
490
692
|
```js
|
|
@@ -556,6 +758,25 @@ A marketplace is a git repo (or a local directory) with
|
|
|
556
758
|
mirroring Claude Code's layout deliberately (MARKETPLACE.md MARKETPLACES). The
|
|
557
759
|
manifest names the catalog and its entries:
|
|
558
760
|
|
|
761
|
+
**Which ref.** `add` and `update` take `--branch <ref>`, and it accepts a **tag**
|
|
762
|
+
as readily as a branch — a tag is how a catalog gets pinned to a version known
|
|
763
|
+
to work. Without it the shallow clone follows the remote's own `HEAD`, so
|
|
764
|
+
nothing here has ever assumed `main` or `master` and a repo whose default is
|
|
765
|
+
`trunk` always worked; what was missing was any way to ask for a ref that is not
|
|
766
|
+
the default. The ref is **remembered in the registry**, so `update` re-clones the
|
|
767
|
+
same one — a pin that a refresh silently abandoned would be decoration — and
|
|
768
|
+
`update --branch` is how the pin is deliberately moved. `list` shows it as
|
|
769
|
+
`#ref` beside the `@commit`, because the two answer different questions: the ref
|
|
770
|
+
is what you asked for and what the next update will fetch, the commit is where
|
|
771
|
+
that ref happened to point. A ref is validated against an allowlist before it
|
|
772
|
+
reaches the command line, since a value beginning with `-` is an option rather
|
|
773
|
+
than a ref; a full commit SHA is refused with its own message, because
|
|
774
|
+
`--branch` takes a ref and a bare object name is not one — fetching a commit
|
|
775
|
+
means a second round trip and a checkout, which is a different shape from the
|
|
776
|
+
single shallow clone. `--branch` against a **local** directory is an error, not
|
|
777
|
+
a no-op: a directory has no refs to choose between, and accepting the flag
|
|
778
|
+
while ignoring it would look exactly like success.
|
|
779
|
+
|
|
559
780
|
```json
|
|
560
781
|
{
|
|
561
782
|
"name": "nord-pack",
|
|
@@ -945,7 +1166,7 @@ string` pass the other two code-carrying kinds export:
|
|
|
945
1166
|
```js
|
|
946
1167
|
export default function createEngine(opts) {
|
|
947
1168
|
return {
|
|
948
|
-
name, voices, // the roster the
|
|
1169
|
+
name, voices, // the roster the V picker offers
|
|
949
1170
|
stylable, // may the tone step be shown for it?
|
|
950
1171
|
synth(text, { voice, style }) {}, // → { wav, usage }
|
|
951
1172
|
};
|
|
@@ -1146,23 +1367,24 @@ decklight/
|
|
|
1146
1367
|
SPEC.md README.md package.json
|
|
1147
1368
|
src/core/ engine.js (init, nav, builds, transitions, stage, chrome, input) + the features that own their own
|
|
1148
1369
|
state and keyboard: themes.js (switching, packs, generator, picker), narration.js (voice, captions,
|
|
1149
|
-
character,
|
|
1150
|
-
undo/redo, restore), hud.js (clock, progress, ink, transcript), onboarding.js (the first-open card
|
|
1370
|
+
character, the recorders), editmode.js (live reload, notes editor, element edit mode, agents
|
|
1371
|
+
and the chip that says one is still working, undo/redo, restore), hud.js (clock, progress, ink, transcript), onboarding.js (the first-open card
|
|
1151
1372
|
and tips) + the decidable pieces engine.js's init() no longer holds, each unit-tested without a
|
|
1152
1373
|
browser: overflow.js (the guardrail's watch), playlist.js (module navigation), finder.js (the
|
|
1153
1374
|
finder's index + ranking), layout.js (the L ring + its write-through), palette.js (what a typed
|
|
1154
1375
|
string means), debuglog.js (the D ring buffer), overlay.js (backdrop, list selection, the
|
|
1155
|
-
typeahead keyboard), escape.js,
|
|
1376
|
+
typeahead keyboard), escape.js, htmlfmt.js (dedenting an element's source for the
|
|
1377
|
+
content editor, without changing what it renders), motion.js (the duration, FLIP and transition-class decisions
|
|
1156
1378
|
behind SLIDE_TRANSITIONS and AUTO_ANIMATE) — plus autoanimate, builds, print, svg, charts, media,
|
|
1157
1379
|
speaker, annotate, character, character-art, devmode, themegen, voicetrack
|
|
1158
1380
|
src/math/ LaTeX math on data-math slides (Temml → MathML Core)
|
|
1159
1381
|
src/code/ highlight bundling + line stepping provider
|
|
1160
1382
|
src/terminal/ ansi.mjs (parser), player.mjs (provider + modes)
|
|
1161
|
-
cli/ decklight.mjs (dispatcher: init/skills/rec/refresh/export/bundle/restore/upgrade/pdf/import/theme/
|
|
1383
|
+
cli/ decklight.mjs (dispatcher: init/skills/rec/refresh/export/bundle/restore/history/upgrade/pdf/import/theme/
|
|
1162
1384
|
publish/marketplace/plugin/template/importer/transform/engine/extension/voice/agent/tts/lipsync/
|
|
1163
1385
|
video/author/present/associate/report-bug; `dev` is a hidden alias for `author`, `edit` refuses out
|
|
1164
1386
|
loud) + pkg.mjs (the package root and the one runtime-inlining transform) and util.mjs (CommandError
|
|
1165
|
-
+ runMain: every command fails one way), init.mjs,
|
|
1387
|
+
+ runMain: every command fails one way), init.mjs, cast.mjs, bundle.mjs, upgrade.mjs, restore.mjs,
|
|
1166
1388
|
theme.mjs (validate + install a theme, THEMING), import.mjs (PowerPoint/Keynote/Google Slides →
|
|
1167
1389
|
deck, JS_API), publish.mjs, marketplace.mjs (register catalogs, MARKETPLACE_REGISTRY), units.mjs
|
|
1168
1390
|
(templates/skills/importers/voices/engines/agents), plugin.mjs (presenter chrome, PRESENT#PLUGINS),
|