decklight 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLATFORM.md +44 -3
- package/README.md +7 -5
- package/SPEC.md +100 -31
- package/cli/agent-review.mjs +5 -4
- package/cli/agents.mjs +11 -5
- package/cli/bundle-audio.mjs +10 -3
- package/cli/bundle-module.mjs +95 -0
- package/cli/bundle.mjs +58 -6
- package/cli/cast.mjs +41 -5
- package/cli/check-fixes.mjs +186 -0
- package/cli/check.mjs +32 -5
- package/cli/commit-flow.mjs +7 -3
- package/cli/commit-message.mjs +1 -1
- package/cli/commit-split.mjs +2 -2
- package/cli/deck-refs.mjs +8 -3
- package/cli/design-system-refs.mjs +263 -6
- package/cli/design-system.mjs +82 -14
- package/cli/edit-git.mjs +2 -2
- package/cli/edit-handover.mjs +129 -23
- package/cli/edit-look.mjs +248 -5
- package/cli/edit.mjs +504 -58
- package/cli/enhance.mjs +12 -10
- package/cli/git.mjs +13 -0
- package/cli/init.mjs +8 -3
- package/cli/marketplace-autocheck.mjs +200 -0
- package/cli/marketplace.mjs +250 -13
- package/cli/narrate.mjs +78 -3
- package/cli/open.mjs +24 -6
- package/cli/pdf.mjs +27 -8
- package/cli/pptx-export.mjs +7 -4
- package/cli/record.mjs +73 -13
- package/cli/remote.mjs +32 -6
- package/cli/serve.mjs +2 -2
- package/cli/skill-content.mjs +40 -3
- package/cli/skills.mjs +247 -3
- package/cli/theme-refs.mjs +14 -2
- package/cli/units.mjs +75 -7
- package/dist/build-info.json +1 -1
- package/dist/decklight.css +429 -32
- package/dist/decklight.js +169 -123
- package/dist/decklight.js.map +4 -4
- package/package.json +1 -1
- package/tools/design-system-format.mjs +25 -0
- package/tools/design-system-migrations.mjs +207 -0
- package/tools/exec.mjs +10 -2
- package/tools/narration-manifest.mjs +77 -3
- package/tools/site-clip.mjs +114 -0
- package/tools/video.mjs +69 -6
package/SPEC.md
CHANGED
|
@@ -23,8 +23,9 @@ being moved, and it says what it points at.
|
|
|
23
23
|
| `REVIEW` | reviewer comments on a deck, anchored to slides and carried by git |
|
|
24
24
|
| `JS_API` · `DECK_IMPORT` | the public API, and bringing a deck across |
|
|
25
25
|
| `MARKETPLACE_REGISTRY` · `VOICE_UNITS` · `AGENT_UNITS` · `ENGINE_UNITS` · `ENGINE_PREREQUISITES` · `UNIT_COMPAT` · `UNIT_PINNING` · `UNIT_VERSIONS` · `EXTENSIONS_TRANSFORMS` · `EXTENSIONS_CHECK` · `EXTENSIONS_ADAPTERS` | **in [`PLATFORM.md`](PLATFORM.md)**: catalogs of themes, templates, skills and engines, registered not fetched; the unit library, its pins, gates and calling conventions; voices, agents and engines as units |
|
|
26
|
-
| `DESIGN_SYSTEMS` · `BRAND_PALETTE` · `DESIGN_SYSTEM_ROLES` | a company's tokens, art and slide templates, published once and referenced by every deck built on it; its palette, and the themes drawn from it; its roles, which each theme sets |
|
|
26
|
+
| `DESIGN_SYSTEMS` · `BRAND_PALETTE` · `DESIGN_SYSTEM_ROLES` · `DESIGN_SYSTEM_MIGRATIONS` | a company's tokens, art and slide templates, published once and referenced by every deck built on it; its palette, and the themes drawn from it; its roles, which each theme sets; what each major version renamed, and the deck that took an older one |
|
|
27
27
|
| `FONTS` | a typeface's files and licence, from a marketplace, referenced by a deck so its faces travel with it |
|
|
28
|
+
| `MARKETPLACES_SCREEN` | every registered marketplace on one screen, while authoring: which are out of date, updating them, what's new, and adding one |
|
|
28
29
|
| `REPO_LAYOUT` · `NON_GOALS` | for contributors |
|
|
29
30
|
|
|
30
31
|
---
|
|
@@ -269,7 +270,7 @@ The engine interleaves provider steps into the slide's sequence at the element's
|
|
|
269
270
|
- **Concept colors**: `data-concept="agent"` on a shape (or a group, its direct-child shapes recolor; text never does) pins that concept to ONE diagram-fill slot deck-wide, so a recurring concept never changes color between diagrams. A shape recolors its fill; an unfilled outline (`fill="none"`, a line-chart stroke, a wire shape) recolors its stroke instead, since painting its fill would close it. Resolution: `init({ concepts: { agent: 3 } })` pins a slot (1–6) or any raw CSS color (`'var(--d-accent)'`); unconfigured names fall back to a stable hash of the name, identical across sessions and decks. The indirection targets a slot (`var(--d-fill-N)`), not a color, so concept identity survives all themes, generated ones included. Two concepts hashing to the same slot get a console warning telling the author to pin one explicitly. Applied on `sync()` (idempotent, covers dynamic slides). **Concepts are edited in write mode** (#718): the palette's **Concept colors…** (also found by *colour by meaning*, *legend*, *same colour*) lists every concept the deck's diagrams name (and any the configuration pins that no shape wears yet) with the slot it resolves to, whether pinned or by its name, and how many shapes carry it; a digit `1`–`6` pins the selected concept, `0` takes the pin off, and each pick is written to the deck through `POST /deck/edit/concepts` `{ concepts, quiet, from }` — the `concepts` key of the configuration block, spliced in place (a bundle's plain-data `Decklight.init` literal likewise; an init call that is code is refused), one undo entry — while the page repaints at once and every other open page of the deck is sent a `concepts` event and repaints without a reload, the way a theme pick travels. The element menu's **Concept ▸** on a diagram shape lists the deck's names (the shape's own marked), takes a new name typed in place, and `none (detach)` takes the attribute off. Its last row, **Edit concepts…**, opens the concept list (*Concept colors…*, above) with the cursor on the shape's own concept, for when the question turns from this shape to the concept itself: its colour, its pin, the slides that use it. `POST /deck/edit/element/concept` `{ slide, index, path, tag, concept }` sets or removes `data-concept` on the element the page names (the group, when the shape wears its concept from its group) and nothing else in the tag.
|
|
270
271
|
|
|
271
272
|
**Easy to find, easy to attach** (`src/core/concept-tools.js`). Every way a shape gets its concept goes through one door: `POST /deck/edit/element/concepts` `{ items: [{ slide, index, path, tag }], concept, quiet, from }`, any number of shapes on any slides in ONE write and one undo entry, checked whole before any is written (one the file no longer has is a 409 and nothing changes). It is written **in place**: this page sets the attribute and repaints, every other page is sent `styles` and reloads. The doors:
|
|
272
|
-
- **The Colors tab** (Inspector), where people colour a shape, has a **Concept** row on the Fill side of any diagram shape: the deck's concepts as chips (the shape's own pressed), **+ new** to name one, **none** to take it off. The Info tab names a shape's concept, or says *none*
|
|
273
|
+
- **The Colors tab** (Inspector), where people colour a shape, has a **Concept** row on the Fill side of any diagram shape: the deck's concepts as chips (the shape's own pressed), **+ new** to name one, **none** to take it off, and **edit…** last, into Concept colors… at the shape's concept. On a shape a concept fills, the Fill side says so, with **Concept colors…** (the list, at that concept, to pin its colour) beside **Detach from concept**. The Info tab names a shape's concept as a link into Concept colors… at it, or says *none* as a link to the Colors tab, where the Concept row gives it one.
|
|
273
274
|
- **The look-alikes.** A concept is a recurring idea, and a person sees one recur by the words on the box. After ONE shape joins a concept, every other shape on the deck whose label reads the same (whatever the case) and is not that concept already is offered in one card: *1 other shape on slide 6 says "Agent" too* → **Make it the "agent" concept** (one write) or **Just this one**. A shape's label is the text in its own group when it is the group's one shape, else the labels of its diagram whose anchor falls inside its box (read from its attributes, so a slide not on screen answers too), else the label written right after it.
|
|
274
275
|
- **Where it lives.** Each row of Concept colors… names the slides its shapes are on; the selected concept's shapes on the slide on screen are boxed (dashed, in the accent); **←/→** go to the previous or next slide that has it, the list kept open.
|
|
275
276
|
- **Pick mode.** **⏎** on a row (or its **pick shapes** button) turns the list into a one-line bar over the slide: a click on a shape (or its label) puts it in the concept, a click on one already in takes it out, the hovered shape is boxed, and the arrows walk the slides meanwhile. The first click on a shape whose look-alikes are elsewhere offers them, once per label. **Esc** or **Done** comes back to the list. **New concept…** (the last row, or **N**) takes a name typed in the list and goes straight into picking its shapes, since a concept is nothing until shapes wear it.
|
|
@@ -360,11 +361,11 @@ A theme travels as what it already is: **one CSS file**. There is no registry, a
|
|
|
360
361
|
**A deck refers to a theme; it does not carry one.** A source deck is data (`DECK_ANATOMY`), and a theme from outside the shipped set is somebody else's kilobytes of CSS, so the deck records only *which* theme it uses, as a reference in its configuration block, and the CSS stays in its marketplace:
|
|
361
362
|
|
|
362
363
|
```json
|
|
363
|
-
{ "decklight": "0.
|
|
364
|
+
{ "decklight": "0.10.0", "theme": "acme",
|
|
364
365
|
"markedThemes": ["acme@acme-themes"], "themeSources": { "acme-themes": "acme/decklight-themes" } }
|
|
365
366
|
```
|
|
366
367
|
|
|
367
|
-
**A reference names its catalog by where it comes from, not only by what it is called.** The `acme-themes` in `acme@acme-themes` is the name the marketplace was registered under on the machine that marked it (`marketplace add --name` renames it) so the same catalog can be `acme` on the next machine, and a different catalog can be `acme-themes` there. `themeSources` records each marketplace's source once, beside the list, in the form `marketplace add` takes (`owner/repo`, or a git URL with any credentials it carried removed), and the **source decides**: a reference resolves to whatever this machine calls the marketplace registered from that source; one that only shares the name is refused by name (`"acme-themes" here is a different catalog`) rather than linked; and a missing one is named with the command that brings it: `decklight marketplace add acme/decklight-themes`. Nothing registers itself: adding a marketplace stays an explicit act. A **local** marketplace records no source (its source is a path on the author's disk, meaningless elsewhere and a disclosure of their home directory) so a theme from one, the personal marketplace included, resolves by name and is reported as local to whoever marked it on a machine that lacks it. A second theme marked from a catalog the deck already records keeps the deck's name for it, whatever this machine calls it. The source is recorded when its marketplace's first theme is marked and dropped with its last. Unlike the catalog's name, a source can locate a **private** repository: it is readable in the deck and in anything bundled from it, and a catalog whose location must not travel should not be marked from.
|
|
368
|
+
**A reference names its catalog by where it comes from, not only by what it is called.** The `acme-themes` in `acme@acme-themes` is the name the marketplace was registered under on the machine that marked it (`marketplace add --name` renames it) so the same catalog can be `acme` on the next machine, and a different catalog can be `acme-themes` there. `themeSources` records each marketplace's source once, beside the list, in the form `marketplace add` takes (`owner/repo`, or a git URL with any credentials it carried removed; a GitHub repository is `owner/repo` however it was added, `https://github.com/…`, `git@github.com:…` or `ssh://git@github.com/…`, and a recorded source is read the same way, so one catalog has one identity), and the **source decides**: a reference resolves to whatever this machine calls the marketplace registered from that source; one that only shares the name is refused by name (`"acme-themes" here is a different catalog`) rather than linked; and a missing one is named with the command that brings it: `decklight marketplace add acme/decklight-themes`. Nothing registers itself: adding a marketplace stays an explicit act. A **local** marketplace records no source (its source is a path on the author's disk, meaningless elsewhere and a disclosure of their home directory) so a theme from one, the personal marketplace included, resolves by name and is reported as local to whoever marked it on a machine that lacks it. A second theme marked from a catalog the deck already records keeps the deck's name for it, whatever this machine calls it. The source is recorded when its marketplace's first theme is marked and dropped with its last. Unlike the catalog's name, a source can locate a **private** repository: it is readable in the deck and in anything bundled from it, and a catalog whose location must not travel should not be marked from.
|
|
368
369
|
|
|
369
370
|
A theme in `markedThemes` is **marked**: it will be part of the deck's bundle, and, for a marketplace theme, linked wherever the deck is served. The picker says it in those words: a marked row reads *marked — part of the bundle*, an unmarked one *Space marks it to include it in the bundle*. **A shipped theme can be marked too**, by its bare name: `"markedThemes": ["ember", "acme@acme-themes"]`. It needs no reference, no source and no link: every install has it, and the servers answer it as they always have. What marking it changes is the hand-over: a bundle holds only the themes put in it, so a marked shipped theme is embedded beside the one the file opens on (`<style data-theme="ember" media="not all">`), whatever `--themes` chose, and the file's own picker can switch to it. A bare name that is not a shipped theme is not a mark and is dropped. Unmarking the shipped theme the deck opens on is allowed: every bundle carries its opening theme anyway. Every server (`open`, `--no-trust`, the render server behind pdf/pptx/video) links each marked theme into the page on its way out (`<link rel="stylesheet" href="decklight-theme/<marketplace>/<name>.css" data-theme="<name>" data-theme-added … media="not all">`) and answers that path from the marketplace's files on **this machine**: its checkout, or the directory a local marketplace was registered from. Nothing on that path fetches (`MARKETPLACE_REGISTRY`, registered, not fetched). The one kind of entry that is not a file in its marketplace, one whose `source` is an https URL, is read when it is marked and kept in `~/.decklight/theme-cache/`, and served from there after. A marked theme this machine cannot resolve (its marketplace not registered, or never fetched) is not linked; the page carries `<meta name="decklight-theme-missing">` naming it and why, and the deck says so once when it opens. `theme` may name a marked theme: the server then links the default under it, and the runtime applies the marked one over it.
|
|
370
371
|
|
|
@@ -440,7 +441,7 @@ Behavior: spawn PTY (node-pty), run each `cmd` sequentially in the same shell se
|
|
|
440
441
|
capture raw output chunks with timestamps, apply redaction and idle-clamping, write the
|
|
441
442
|
cast. Commands run inside a brace group with the sentinel on the closing line, so a
|
|
442
443
|
command that reads stdin sees only `interact` sends (never the recorder's own control
|
|
443
|
-
lines). Exit non-zero if any step exceeds its timeout, an `expect` never matches
|
|
444
|
+
lines). **A step can end on Ctrl-C**, the way a server is stopped on camera: an `interact` send of `\u0003`. An interactive shell abandons the rest of the line on an interrupt, which used to take the sentinel with it and time the step out, so under zsh the sentinel sits in the group's `always` block and under bash an INT trap prints it; the step then records exit 130, and 130 counts as a normal end when the script itself sent the interrupt (a command that exits 130 on its own still fails without `--allow-fail`). Exit non-zero if any step exceeds its timeout, an `expect` never matches
|
|
444
445
|
(including command exit before it fires), or the shell dies; `--allow-fail` records
|
|
445
446
|
failures as content (prompts and error output are often the point).
|
|
446
447
|
|
|
@@ -567,17 +568,17 @@ slide. The chapters were visible, but they organised nothing.
|
|
|
567
568
|
|
|
568
569
|
### PRESENTING_CHROME · What sits over the slides while you talk
|
|
569
570
|
|
|
570
|
-
- **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. **On means shown, voice or no voice:** while the live voice speaks it owns the bar (blanked on arrival, then filled sentence by sentence, so the caption follows what is being said rather than the whole segment), and the moment the voice goes, for any reason (switched off in the panel, a bridge that fails before its first clip, audio the browser blocked), the bar is handed back to the step's own text; it never keeps the last sentence spoken, and never sits empty over a slide that has notes. Slides/steps without notes show no bar. Persists per deck in localStorage. The bar sits on the deck root, outside the scaled stage, so it is sized by the stage's scale (`--stage-scale`, published by the engine's rescale). **Down only**: in a slide-finder or theme-picker preview it shrinks with the thumbnail instead of covering it, and a deck at or above its design size captions exactly as before. A slide-finder or theme-picker **preview shows no caption bar** even when the deck behind it has captions on (#490): captions are chrome for the person presenting the current slide, and a preview is a thumbnail of wherever the cursor is; it neither reads the per-deck setting as on nor writes it (`C` inside a preview changes nothing), the same line the voice-over hint holds. The **history's** preview is the one exception, and only on the parent's say: it is a version being read rather than a thumbnail, so it shows that version's notes when the deck's captions are on (History, below).
|
|
571
|
+
- **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. **On means shown, voice or no voice:** while the live voice speaks it owns the bar (blanked on arrival, then filled sentence by sentence, so the caption follows what is being said rather than the whole segment), and the moment the voice goes, for any reason (switched off in the panel, a bridge that fails before its first clip, audio the browser blocked), the bar is handed back to the step's own text; it never keeps the last sentence spoken, and never sits empty over a slide that has notes. Slides/steps without notes show no bar. Persists per deck in localStorage. The bar sits on the deck root, outside the scaled stage, so it is sized by the stage's scale (`--stage-scale`, published by the engine's rescale). **The rest of the chrome follows a small box down too**: the arrows, the slide number, toasts, the voice-over hint and the welcome and help cards take `zoom` from `--chrome-k`, which is `clamp(0.5, --stage-scale × 1.4, 1)`. It is full size whenever the slide is drawn at 0.72× or more (a window about 920 px wide), shrinks with the box below that, and stops at half size so an arrow is still something a finger can hit; it never grows, so a full-screen deck is as it was. A deck embedded in a 520×292 box (decklight.io's hero, slide at 0.4×) showed a full-size welcome card that overflowed the frame; the cards now also cap at 92% of the box, padding included, and scroll inside it. `test/engine.html?mode=chromescale` resizes the root to that box, to one below the floor and to a large one, and asserts each. **Down only**: in a slide-finder or theme-picker preview it shrinks with the thumbnail instead of covering it, and a deck at or above its design size captions exactly as before. A slide-finder or theme-picker **preview shows no caption bar** even when the deck behind it has captions on (#490): captions are chrome for the person presenting the current slide, and a preview is a thumbnail of wherever the cursor is; it neither reads the per-deck setting as on nor writes it (`C` inside a preview changes nothing), the same line the voice-over hint holds. The **history's** preview is the one exception, and only on the parent's say: it is a version being read rather than a thumbnail, so it shows that version's notes when the deck's captions are on (History, below).
|
|
571
572
|
- **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.
|
|
572
573
|
- **Progress bar** (palette: *Present: Progress bar on*): 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.
|
|
573
574
|
- **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).
|
|
574
575
|
- **Transcript** (palette → *Present: Transcript… (speaker view)*): the deck's full spoken script, every slide's notes segments in order, read in the **speaker view's script view** (its `script` button): the slide on screen lit and kept in view, a slide's title moves the deck there. It was a card over the slides, the one way to read notes a presenter could not use while presenting. Export is two palette rows, *Share: Download the transcript (.md)* and *(.txt)* (`<deck>-transcript.txt|.md`), no second window needed. Also programmatic: `instance.transcript.text()` / `.markdown()` / `.download('md'|'txt')` / `.open()` (opens the speaker view on the script).
|
|
575
|
-
- **Messages** (`` ` ``, the key
|
|
576
|
+
- **Messages** (`` ` ``, the tilde key, 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.
|
|
576
577
|
- **Debug log** (palette: *Help: Debug log*; the **events** tab of the one log panel, beside **messages**: `` ` `` opens the panel on messages, the palette row on events, a tab switches in place, and `Esc` closes it on either): a passive monospace panel over the deck (keys keep driving the presentation) showing a timestamped event stream: ready/slide/build with direction, theme and font applies, narration on/off and config changes, every TTS call with its duration and estimated cost (`slide 3 seg 1 · Alnilam · 214 chars → 2.4s · ~$0.0041`, previews included) and failures, and window `error` events; plus a live state line (slide/step/theme/narration incl. the active voice · tone or track, the voice rate, and the running TTS spend). Cost is an ESTIMATE: the Gemini API returns token counts (`usageMetadata`), never dollars; the bridge prices them at published Vertex list rates, sends `x-tts-cost` on each fresh synthesis (0 on cache replays), and prints a per-call line plus session total on its console. Events ring-buffer (last 200) from init, so the panel shows history from before it was opened. **The log survives a reload.** Write mode reloads the page on every write of the file, which used to wipe the one record that could say why: the page leaving now stashes its buffer and the reason it was told (sessionStorage, this tab's and this deck's; older than a minute it is another session's), and the page arriving starts from it, the rows before dimmed with their own times, then a *reload* row first on its own clock: `↻ reloaded — notes saved · this tab`, `↻ reloaded — layout picked · another tab`, `↻ reloaded — claude's edit`, `↻ reloaded — changed on disk — an editor, git, or a tool outside this server`, or `↻ reloaded — by the browser (⌘R, or a navigation)` when no server said. **The reason is the server's** (`cli/edit.mjs`, `describeReload`): the reload message it sends is `data: {"reload":"<what>","from":<page id or null>}` rather than a bare `reload`; *what* is the route that wrote the file within the last two seconds, in words (`whatWrote`: notes saved, layout picked, undo (Z), theme picked, restored from git, git pull …), else the running agent's edit, else a change on disk this server never made; *from* is the page the write named, so the row says whether it was this tab's doing. An older page reloads on any message as before, and an older server's bare `reload` reads as *the file changed*.
|
|
577
578
|
- **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.
|
|
578
579
|
- **Speaker view**: `⌥⏎` / `Alt+Enter` (PowerPoint's presenter-view chord, the same on every OS and no F-key) (or the palette's *Speaker view — second window*) opens a popup (synced via BroadcastChannel): current + next slide thumbnails (**current is what the audience sees**, the slide at the step the deck is on, stepping through its builds in place; it used to show the slide fully built), notes (with `⟨CLICK⟩` markers highlighted as the matching build lands), elapsed timer, build step list (provider labels). **Rehearse mode**: pressing `⌥⏎` again in the deck, or `S` 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 <deck> --no-trust --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.
|
|
579
580
|
- **Rehearsal timings** (`REHEARSAL_TIMINGS`): the speaker view's `⏱ rehearse timings` records how long each slide takes as you present, and `⏹ stop & save timings` writes the result onto the sections as `data-timing="<seconds>"` through the edit server (`POST /deck/edit/timings`, one edit for every slide, one undo entry), or, with no edit server, keeps it in this browser. From then on the speaker view shows a pace line: this slide's elapsed against its planned time (red past five seconds over) and the talk's total against the plan. The deck's own `data-timing` always wins over a browser's memory, because the file is the source of truth. The palette's **Rehearse timings…** opens the speaker view if it is not already open and starts the clock in one step: a recorder that could only be found by opening a popup first was a recorder most presenters never found.
|
|
580
|
-
- **Phone remote** (`decklight <deck.html> --remote`, in either mode): the server also listens on the LAN and serves `GET /deck/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 /deck/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** `/deck/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 `NO_TRUST#REMOTE` is why the flag widens nothing else: a clicker must never mean running `/deck/edit/*` on the LAN during a talk you are not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes.
|
|
581
|
+
- **Phone remote** (`decklight <deck.html> --remote`, in either mode): the server also listens on the LAN and serves `GET /deck/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 /deck/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** `/deck/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 `NO_TRUST#REMOTE` is why the flag widens nothing else: a clicker must never mean running `/deck/edit/*` on the LAN during a talk you are not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes. **While the voice recorder is capturing a beat** (`decklight narrate --mic --remote`), the phone is the recorder's keyboard: `next` ends the beat as `→` does, and the deck is not also stepped (the recorder reveals the next build itself, so stepping too would reveal two); a `retake` key, accepted only by the relay and meaningful only then, is `⌫`; `prev` is ignored, because moving the deck under a take would record the beat at the wrong build. The deck's position report then carries `rec: { slide, beat, of }` (null otherwise, and refused unless all three are integers), and the controller says it is recording, which beat, and swaps prev for retake, so recording needs no glance at the laptop and no keystroke gets into the audio. Anywhere else (the plan card, between slides, no recorder open) the phone is the clicker it always was. The recorder's plan card shows the QR, since the speaker view that usually carries it is not open while you record.
|
|
581
582
|
- **Onboarding, the first-run welcome and the editing tour**: the two moments a deck can afford to teach the tool, and nothing after them. A rotation of one-line tips used to follow the welcome, one per load, with palette rows to turn it off and reset it; the palette answers "how do I…" for anyone who types the word and `?` lists every key, so the tips taught what both already say, and they are gone.
|
|
582
583
|
- **First-run welcome**: the first time a browser opens *any* deck, a card introduces Decklight: the single-file/agent-authorable model, `/` for the palette, `?` for shortcuts, `T` for themes (and `⌃T` to generate one, on a Mac, where the page can have it), `⌥⏎`/`V` for the speaker view and narration (`S` shows the notes, editable when authoring), and write mode (`decklight <deck.html>`, `A` to ask an agent, `⌘Z` / `Ctrl+Z` to undo). Themed through the token contract (`--bg`, `--fg`, `--accent`, `--accent-contrast`, `--muted`), so it reads on every theme. **Any key dismisses it and does nothing else** (a newcomer pressing `→` clears the card, then advances on the next press) and any real advance (touch swipe, the on-screen chevrons, a programmatic `next()`) retires it for good, so it can never sit over a talk in progress. A click dismisses without advancing, even though a bare click on the deck is "next" everywhere else. Reopen from the palette ("Welcome to Decklight") or `instance.showWelcome()`.
|
|
583
584
|
- **Editing tour**: the first load that *is* write mode (the edit server has answered, so the card is about what this deck can do) gets a card of its own, **Editing this deck**: double-click to edit text in place, drop a file to add a picture, the editing bar and click-to-select, `S` for the notes drawer and `O` for the overview that rearranges slides, `A` to describe a change for an agent, `K` to commit what the chip keeps count of, `/` for the rest. Same look and same rules as the welcome: any key dismisses it and does nothing else, a click dismisses without advancing, any real advance retires it, never past slide 1 / step 0, never in `?print`, `?embedded` or `?capture`. One card a load: on the load that shows the welcome, the tour waits for the next write-mode load. Once per browser (`localStorage['decklight-onboarded-tour']`); reopen from the palette ("Editing tour") or `instance.showEditingTour()`.
|
|
@@ -593,7 +594,7 @@ slide. The chapters were visible, but they organised nothing.
|
|
|
593
594
|
|
|
594
595
|
### PRESENTING_MODES · Write mode, no-trust mode, and what a deck may run
|
|
595
596
|
|
|
596
|
-
- **Write mode**: `decklight <deck.html>` (the deck is the command) serves the deck over localhost with live reload and accepts persisted edits from the player. **`--no-trust` is the same server's other mode** (the one described below): the routes that write are registered in both modes, and the mode gate refuses the whole write family (`/deck/edit/*`, the bridges, the review owner's half) with a 403 that names the mode, ahead of any route; the deck is served from its own directory under the CSP header, and the ingredients label runs before the first slide. `--strict`, `--check` and `--root` apply there; `--remote` applies in either mode. **A deck that embeds a runtime older than this install is named at startup** (`runtime:` row, write mode): it is served as it is, and its runtime probes routes the server may no longer have, gets a 404, and hides every write-mode affordance without a word, so the row says it may not wire up and names `decklight upgrade <deck>`; the comparison is `NO_TRUST#AUDIT`'s own (this install's bytes, or a version it cannot vouch for). **So is a project skill older than this install** (`skill:` row): every skill `decklight skills` or `init` writes carries the version that wrote it (`<!-- decklight skill 0.9.0 -->`, after the frontmatter and after the AGENTS.md marker), and a `.claude/skills/decklight/SKILL.md` or a marked AGENTS.md section whose stamp is older, or missing, is named with `decklight skills` as the fix, because the agent reading it reads an old contract and has no way to know. **On a terminal the fix is offered** before the server starts (`decklight <deck>`, write mode): the stale files are listed, the project's and every agent's global home alike (`~/.claude/skills/decklight/SKILL.md`, a marked `AGENTS.md` under `~/.codex` and the rest, whether or not that agent is on PATH today, since a file that was installed is a file something reads), and `update it now? [Y/n]` refreshes them with the command's own writers, so a refresh from the prompt and one from the command cannot differ; `n` is remembered for this version (`skill-prompt-declined` in the config home), so the question comes back with the next decklight and never at the next start, and off a terminal nothing is asked. `decklight skills` refreshes a skill older than the build without `--force`; one that is already this version is refused without it. **The mode is the run's**: `--no-trust` is decided when the deck is opened and never from the page, because a page that could grant itself write access would make the flag worth nothing for the deck it exists for, the one you did not write. **A deck that runs code of its own asks before it opens in write mode** (`cli/open.mjs`, `cli/trust.mjs`): with no flag, the ingredients label (`NO_TRUST#AUDIT`) runs first, every time. Zero findings, which is every deck that is data and every bundle whose runtime is this install's, opens in write mode. Findings are named in yellow, block by block, and on a terminal the question is asked: *do you trust where this deck came from?* Yes opens write mode and is **remembered against the bytes of that code** (`~/.decklight/trust.json`, `decklight trust list` / `forget`), so a changed script asks again and an unchanged one never does; no opens without trust, strict. Off a terminal nobody can answer and no trust is the answer that costs nothing; `--trust` says yes on the command line and is remembered too. The label decides nothing, because it cannot tell your script from a stranger's; only the person who knows the source can, and the question is theirs. **In write mode a theme pick is the deck's**: `T`, the picker's ⏎ and `,`/`.` write the theme into the file the way the deck carries it (`POST /deck/edit/theme { theme, quiet, from }`, `setDeckTheme`: the configuration block's `theme` for a deck that is data, the active `<style data-theme>` for a bundle, the `themes/<name>.css` link for a source deck), quiet and in place like a layout pick, with a `theme` event every other page follows; one undo entry. The cycle keys browse: the theme on screen changes on every press and the file is written once, 600ms after the presses stop, and only if the theme stopped on is not the deck's already; the picker's ⏎ is one deliberate pick and writes at once. A shipped theme or a marked one, which the server can serve as the deck's base; an unmarked marketplace theme stays a look until Space marks it, and a generated theme lives in the browser until it is saved. Without a server, or without trust, a pick is the viewer's preference, remembered in that browser and never written: freezing a watcher's pick into someone else's file would be wrong. **For your own deck, the lock is the one switch**: editing is on from the moment write mode answers, and the lock turns changes off, to avoid making one by mistake, and back on. It is the server's state (`POST /deck/edit/lock { locked }`, said by `/deck/ping` and by a `lock` event on the channel), so every tab and the agent see the same thing: locked, every `POST /deck/edit/*` but the lock answers 423, the bar goes, and the page shows a **🔒 locked** chip at the bottom left that unlocks on a click; the palette carries **Lock deck** / **Unlock deck**, and the bar's **Lock** button is the same switch. While locked `available()` is false, so the bar, the drawer's writes and every other author affordance say so. In no-trust mode `available()` is false too, and the probe says `locked`. **The server owns `/deck/`, and every other path is a file beside the deck.** That is the whole rule, for both modes: nothing decklight answers sits at the root, so no folder beside a deck (`voices/`, `review/`, `edit/`) is ever shadowed by a route, and a test pins it by the path literals in the server's modules. Under it, the families: `/deck/ping` is the one probe every served deck makes (one implementation, `cli/deck-routes.mjs`: in write mode it answers with what write mode offers, in no-trust mode with `noTrust: true`, `phone`, `container` and nothing that edits, and the page wires up accordingly), `/deck/events` is the stream every tab listens on (reload, lock and export events in write mode; the remote's taps in either mode; the upstream's news in no-trust mode), and `/deck/upstream*` is the upstream readout (`NO_TRUST#UPSTREAM`). `/deck/edit/*` is write mode's alone; `/deck/review/*` is the review's, the shared routes both modes' and the owner's write mode's (REVIEW); `/deck/remote/*` is the phone's, the one family `allowRemote` lets off loopback (`NO_TRUST#REMOTE`); `/deck/tts` and `/deck/tts/*` are the voice bridge and `/deck/lipsync/*` the lip-sync bridge on the deck's own origin (write mode; the prefix comes off on the way to the bridge, which serves its routes at its own root). Under `/deck/edit/`, a slide's own properties are `/deck/edit/slide/*` (`layout`, `hidden`, `notes`, `sources`, `slide-template`, and `POST /deck/edit/slide {op}` for the slide itself), one element's are `/deck/edit/element/*` (`source`, `content`, `effect`, `style`, `remove`, `image`), and the recorder's are `/deck/edit/narration/*` (`record`, `tracks`, and `POST /deck/edit/narration` to point the deck at a track). The marketplace routes use five verbs and no others: `browse` reads a catalog, `add` installs into the library, `mark` references from the deck, `apply` changes the deck's look, `insert` makes a slide. **A git URL opens the deck straight from its repository** (`cli/clone-deck.mjs`): the repository is cloned *in full* (its history is what `H` shows and what a restore needs, so a snapshot would open a deck with no past) into `./<repo>` (`--into <dir>` elsewhere, `--branch <ref>` a branch or tag), the deck inside is found (the one `.html` file that is a deck: a `class="decklight"` element, `isDeck`, so a deck that is data is found as surely as one that boots itself; two candidates are refused and listed, and `<url>#<path>` or a GitHub `…/blob/<branch>/<path>` link names one) and it proceeds as `decklight <that path>` with `--git` on, because a clone is a repository and not a question. A directory that already exists is opened only when it is a clone of that same remote, with no pull: the upstream check is what says if it is behind; anything else there is refused rather than written into. **`--no-trust` and `comments submit` take the same URL the same way** (`deckFromUrl`, one function): **one clone per repository, whichever command asked**: they clone to the same `./<repo>` and reuse it after, and a command run from *inside* that clone means this clone rather than `<repo>/<repo>`. A reused clone on another branch than the link names is reported, with the `git switch` to run, never switched. In no-trust mode the clone is the command's doing before any server exists (the server still writes nothing); it is what gives `H` an upstream to check, and what `comments submit` pushes the review branch to. `decklight <repository url>` with no command routes to `open`, as a `.html` file does. Only an explicit URL counts (`https://`, `git@`, `ssh://`, `git://`, `file://`): `owner/repo` shorthand is not accepted, because a mistyped `slides/q3.html` reads exactly like one and the honest answer to a missing path is "no such deck". Nothing here ever pushes. Endpoints: `GET /deck/ping` (capabilities: deck name, undo/redo depths, git state, detected agents, `agentBusy`), SSE `GET /deck/events` (`reload` on any file change; named `agent` events for job status; a named `notes` event `{ slide, aside, from }` instead of a reload when the change was a notes save, which every page puts in place), `POST /deck/edit/slide/notes {slide, text}` (answers `changed`: an edit that normalises to the notes already in the file writes nothing and says so, and the page reports "nothing to save" instead of waiting for a reload; the notes are written literally, so `$1`, `$&` and the like stay the author's text and are never read as replacement patterns), `POST /deck/edit/slide/layout {slide, layout, quiet?, from?}` (writes `data-layout` into the slide's `<section>` tag; `auto` removes it; a no-change write is skipped; with `quiet` the write is one the pages do themselves, as a notes save is: the watcher skips its reload and a `layout` event `{ slide, layout, from }` sends the pick to every other page, which puts it on the slide in place, because the page that picked the layout already showed it and a reload per keypress was the one thing picking a layout did not need), `GET /deck/edit/element/source?slide=&index=` (an element's outerHTML, read fresh from the FILE: never the live DOM), `POST /deck/edit/element/remove {slide, index}`, `POST /deck/edit/element/content {slide, index, html}`, `POST /deck/edit/element/effect {slide, index, effect}` (writes `data-build`; `effect: null` strips it), `POST /deck/edit/undo` / `POST /deck/edit/redo`, and `POST /deck/edit/agent {prompt, agent?}`. **The server binds `127.0.0.1` unless `--remote` asks for the LAN**, in either mode: off this machine only `/deck/remote/*` answers, with the per-run token (`NO_TRUST#REMOTE`), so a clicker widens the listener and never the edit surface. Without the flag the controller still answers on loopback and the QR refuses. **The voice and the face are saved settings, not flags**: `decklight setup voice --engine … --voice … --model … --stability …` and `decklight setup face --portrait … --veo …` write them once (`tts.json`, `lipsync.json`) and the bridges read them; `decklight <deck>` keeps only `--tts-engine` for one session and `--no-tts` / `--no-lipsync`, and refuses the 22 flags it used to pass through, naming where each went.
|
|
597
|
+
- **Write mode**: `decklight <deck.html>` (the deck is the command) serves the deck over localhost with live reload and accepts persisted edits from the player. **`--no-trust` is the same server's other mode** (the one described below): the routes that write are registered in both modes, and the mode gate refuses the whole write family (`/deck/edit/*`, the bridges, the review owner's half) with a 403 that names the mode, ahead of any route; the deck is served from its own directory under the CSP header, and the ingredients label runs before the first slide. `--strict`, `--check` and `--root` apply there; `--remote` applies in either mode. **A deck that embeds a runtime older than this install is named at startup** (`runtime:` row, write mode): it is served as it is, and its runtime probes routes the server may no longer have, gets a 404, and hides every write-mode affordance without a word, so the row says it may not wire up and names `decklight upgrade <deck>`; the comparison is `NO_TRUST#AUDIT`'s own (this install's bytes, or a version it cannot vouch for). **So is a project skill older than this install** (`skill:` row): every skill `decklight skills` or `init` writes carries the version that wrote it (`<!-- decklight skill 0.9.0 -->`, after the frontmatter and after the AGENTS.md marker), and a `.claude/skills/decklight/SKILL.md` or a marked AGENTS.md section whose stamp is older, or missing, is named with `decklight skills` as the fix, because the agent reading it reads an old contract and has no way to know. **On a terminal the fix is offered** before the server starts (`decklight <deck>`, write mode): the stale files are listed, the project's and every agent's global home alike (`~/.claude/skills/decklight/SKILL.md`, a marked `AGENTS.md` under `~/.codex` and the rest, whether or not that agent is on PATH today, since a file that was installed is a file something reads), and `update it now? [Y/n]` refreshes them with the command's own writers, so a refresh from the prompt and one from the command cannot differ; `n` is remembered for this version (`skill-prompt-declined` in the config home), so the question comes back with the next decklight and never at the next start, and off a terminal nothing is asked. `decklight skills` refreshes a skill older than the build without `--force`; one that is already this version is refused without it. **The mode is the run's**: `--no-trust` is decided when the deck is opened and never from the page, because a page that could grant itself write access would make the flag worth nothing for the deck it exists for, the one you did not write. **A deck that runs code of its own asks before it opens in write mode** (`cli/open.mjs`, `cli/trust.mjs`): with no flag, the ingredients label (`NO_TRUST#AUDIT`) runs first, every time. Zero findings, which is every deck that is data and every bundle whose runtime is this install's, opens in write mode. Findings are named in yellow, block by block, and on a terminal the question is asked: *do you trust where this deck came from?* Yes opens write mode and is **remembered against the bytes of that code** (`~/.decklight/trust.json`, `decklight trust list` / `forget`), so a changed script asks again and an unchanged one never does; no opens without trust, strict. Off a terminal nobody can answer and no trust is the answer that costs nothing; `--trust` says yes on the command line and is remembered too. The label decides nothing, because it cannot tell your script from a stranger's; only the person who knows the source can, and the question is theirs. **In write mode a theme pick is the deck's**: `T`, the picker's ⏎ and `,`/`.` write the theme into the file the way the deck carries it (`POST /deck/edit/theme { theme, quiet, from }`, `setDeckTheme`: the configuration block's `theme` for a deck that is data, the active `<style data-theme>` for a bundle, the `themes/<name>.css` link for a source deck), quiet and in place like a layout pick, with a `theme` event every other page follows; one undo entry. The cycle keys browse: the theme on screen changes on every press and the file is written once, 600ms after the presses stop, and only if the theme stopped on is not the deck's already; the picker's ⏎ is one deliberate pick and writes at once. A shipped theme or a marked one, which the server can serve as the deck's base; an unmarked marketplace theme stays a look until Space marks it, and a generated theme lives in the browser until it is saved. Without a server, or without trust, a pick is the viewer's preference, remembered in that browser and never written: freezing a watcher's pick into someone else's file would be wrong. **For your own deck, the lock is the one switch**: editing is on from the moment write mode answers, and the lock turns changes off, to avoid making one by mistake, and back on. It is the server's state (`POST /deck/edit/lock { locked }`, said by `/deck/ping` and by a `lock` event on the channel), so every tab and the agent see the same thing: locked, every `POST /deck/edit/*` but the lock answers 423, the bar goes, and the page shows a **🔒 locked** chip at the bottom left that unlocks on a click; the palette carries **Lock deck** / **Unlock deck**, and the bar's **Lock** button is the same switch. While locked `available()` is false, so the bar, the drawer's writes and every other author affordance say so. In no-trust mode `available()` is false too, and the probe says `locked`. **The server owns `/deck/`, and every other path is a file beside the deck.** That is the whole rule, for both modes: nothing decklight answers sits at the root, so no folder beside a deck (`voices/`, `review/`, `edit/`) is ever shadowed by a route, and a test pins it by the path literals in the server's modules. Under it, the families: `/deck/ping` is the one probe every served deck makes (one implementation, `cli/deck-routes.mjs`: in write mode it answers with what write mode offers, in no-trust mode with `noTrust: true`, `phone`, `container` and nothing that edits, and the page wires up accordingly), `/deck/events` is the stream every tab listens on (reload, lock and export events in write mode; the remote's taps in either mode; the upstream's news in no-trust mode), and `/deck/upstream*` is the upstream readout (`NO_TRUST#UPSTREAM`). `/deck/edit/*` is write mode's alone; `/deck/review/*` is the review's, the shared routes both modes' and the owner's write mode's (REVIEW); `/deck/remote/*` is the phone's, the one family `allowRemote` lets off loopback (`NO_TRUST#REMOTE`); `/deck/tts` and `/deck/tts/*` are the voice bridge and `/deck/lipsync/*` the lip-sync bridge on the deck's own origin (write mode; the prefix comes off on the way to the bridge, which serves its routes at its own root). Under `/deck/edit/`, a slide's own properties are `/deck/edit/slide/*` (`layout`, `hidden`, `notes`, `sources`, `slide-template`, and `POST /deck/edit/slide {op}` for the slide itself), one element's are `/deck/edit/element/*` (`source`, `content`, `effect`, `style`, `remove`, `image`), and the recorder's are `/deck/edit/narration/*` (`record`, `tracks`, and `POST /deck/edit/narration` to point the deck at a track). The marketplace routes use five verbs and no others: `browse` reads a catalog, `add` installs into the library, `mark` references from the deck, `apply` changes the deck's look, `insert` makes a slide. **A git URL opens the deck straight from its repository** (`cli/clone-deck.mjs`): the repository is cloned *in full* (its history is what `H` shows and what a restore needs, so a snapshot would open a deck with no past) into `./<repo>` (`--into <dir>` elsewhere, `--branch <ref>` a branch or tag), the deck inside is found (the one `.html` file that is a deck: a `class="decklight"` element, `isDeck`, so a deck that is data is found as surely as one that boots itself; two candidates are refused and listed, and `<url>#<path>` or a GitHub `…/blob/<branch>/<path>` link names one) and it proceeds as `decklight <that path>` with `--git` on, because a clone is a repository and not a question. A directory that already exists is opened only when it is a clone of that same remote, with no pull: the upstream check is what says if it is behind; anything else there is refused rather than written into. **`--no-trust` and `comments submit` take the same URL the same way** (`deckFromUrl`, one function): **one clone per repository, whichever command asked**: they clone to the same `./<repo>` and reuse it after, and a command run from *inside* that clone means this clone rather than `<repo>/<repo>`. A reused clone on another branch than the link names is reported, with the `git switch` to run, never switched. In no-trust mode the clone is the command's doing before any server exists (the server still writes nothing); it is what gives `H` an upstream to check, and what `comments submit` pushes the review branch to. `decklight <repository url>` with no command routes to `open`, as a `.html` file does. Only an explicit URL counts (`https://`, `git@`, `ssh://`, `git://`, `file://`): `owner/repo` shorthand is not accepted, because a mistyped `slides/q3.html` reads exactly like one and the honest answer to a missing path is "no such deck". Nothing here ever pushes. Endpoints: `GET /deck/ping` (capabilities: deck name, undo/redo depths, git state, detected agents, `agentBusy`), SSE `GET /deck/events` (`reload` on any file change; named `agent` events for job status; a named `notes` event `{ slide, aside, from }` instead of a reload when the change was a notes save, which every page puts in place), `POST /deck/edit/slide/notes {slide, text}` (answers `changed`: an edit that normalises to the notes already in the file writes nothing and says so, and the page reports "nothing to save" instead of waiting for a reload; the notes are written literally, so `$1`, `$&` and the like stay the author's text and are never read as replacement patterns), `POST /deck/edit/slide/layout {slide, layout, quiet?, from?}` (writes `data-layout` into the slide's `<section>` tag; `auto` removes it; a no-change write is skipped; with `quiet` the write is one the pages do themselves, as a notes save is: the watcher skips its reload and a `layout` event `{ slide, layout, from }` sends the pick to every other page, which puts it on the slide in place, because the page that picked the layout already showed it and a reload per keypress was the one thing picking a layout did not need), `GET /deck/edit/element/source?slide=&index=` (an element's outerHTML, read fresh from the FILE: never the live DOM), `POST /deck/edit/element/remove {slide, index}`, `POST /deck/edit/element/content {slide, index, html}`, `POST /deck/edit/element/effect {slide, index, effect}` (writes `data-build`; `effect: null` strips it), `POST /deck/edit/undo` / `POST /deck/edit/redo`, and `POST /deck/edit/agent {prompt, agent?, offer?, place?}`. **Before an agent edit runs, Decklight's skill is offered to an agent that does not have it** (an ask from the agent panel, an agent fix from Check deck… or the review, a Migrate, which adds its own skill to the offer): the agent's copy is looked for where it reads one, its config home's (`~/.claude/skills/decklight/`, a marked `AGENTS.md` under `~/.codex` and the rest) and then the project's, and when there is neither the route answers `{ choose: 'skill', agent, skills, places }` instead of running. The page asks where it goes, **every project** (the config home, recommended and selected), **this project only**, or **not now**, and posts the job again with `place: 'global' | 'project' | 'none'`; an install is `decklight skills [--global]` for that one agent, and Esc sends nothing. Not now is remembered for that project and agent (`skill-offer-declined.json` in the config home), so the next ask goes ahead without asking. Only a page that says it can ask (`offer: true`) is asked, so a script posting a job is never held up, and an agent decklight has no install for is never offered one. **The server binds `127.0.0.1` unless `--remote` asks for the LAN**, in either mode: off this machine only `/deck/remote/*` answers, with the per-run token (`NO_TRUST#REMOTE`), so a clicker widens the listener and never the edit surface. Without the flag the controller still answers on loopback and the QR refuses. **The voice and the face are saved settings, not flags**: `decklight setup voice --engine … --voice … --model … --stability …` and `decklight setup face --portrait … --veo …` write them once (`tts.json`, `lipsync.json`) and the bridges read them; `decklight <deck>` keeps only `--tts-engine` for one session and `--no-tts` / `--no-lipsync`, and refuses the 22 flags it used to pass through, naming where each went.
|
|
597
598
|
- **No-trust mode**: `decklight <deck.html> --no-trust [--port 8788]` plays a deck you did **not** write, and is the only way a `.decklight` container opens. It serves **the deck's own directory** (never the cwd) over `127.0.0.1`, with the same port-conflict handling as write mode (`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). **The runtime a deck links is served from the installed package** (#517): a request for `decklight.js`, `decklight.css` or `themes/<name>.css` that has no file beside the deck, or that reaches outside the served root, as a source deck's `../dist/decklight.js` does, is answered from decklight's own `dist/` and `themes/`, so a deck that carries only its slides plays under `open`, `--no-trust` and every render (`pdf`, `pptx`, `video`, `shot`) with no copy of the runtime beside it. **A deck that carries no reference at all**, the data shape (`DECK_ANATOMY`, #520), has those three references written into the page on its way out, by every server alike (`staticFiles`; no-trust mode applies the same function to the deck it serves from memory, after the audit has described the file): the stylesheet and the block's theme at the end of `<head>`, the engine before the first script that executes or else before `</body>`, never a second reference on a deck that has one. In write mode the deck also reaches the bridges on its own origin: `/tts` and the routes the runtime derives from it are proxied to the voice bridge, `/lipsync/*` to the lip-sync bridge (`--tts-port`, `--lipsync-port`), a missing bridge answering 503, which the deck takes as no bridge at all. Because the deck reaches them through `open`, `open` is the one place a bridge may **move**: when its port is held by a program that is not a decklight bridge (another project's dev server on 8787 is the usual case), it takes the next free port no other service of the run uses, the server is told where to forward, and the banner says who holds the port and where the bridge went. A decklight bridge already on the port is reused, never moved, and the banner says so on the bridge's own row, green (`✓ voice the say voice bridge is already on :8787 — using it`): the bridge that stood aside exited on purpose, and nothing calls that a degradation. A service that exits for any other reason is a red row in the same place (`✗ voice exited (1) — carrying on without it; the deck degrades on its own`), and a second session whose edit port is taken gets a yellow `port` row first (`! port 8788 has another decklight editing "deck.html" — this one is on 8790`) once the question has been answered, in place of two loose lines above the banner (`describePortOutcome`; `resolvePortConflict` takes an `outcome` for the caller that says it this way, and prints its own lines otherwise, which is what a bridge or an edit server run alone still does). A bridge run alone (`decklight tts`, which `decklight <deck>` starts and the help no longer lists) still refuses rather than move, since a deck opened from disk assumes its literal port. The live-voice engine picker tells the two failures apart: a `/tts/engines` 404 from something that answers `/tts/ping` as a decklight bridge is an old bridge (*predates the engine picker*), and from anything else it is *another program answering on the voice bridge's port*. A copy that IS beside the deck wins; nothing else escapes the root or answers for a missing path, so a probe still learns nothing from a 404. A **source** deck whose *other* assets are not siblings, images or casts kept a directory up, still 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 /deck/remote/{key,pos}` (`PRESENTING_CHROME`). 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 `NO_TRUST#AUDIT`, removing it is `NO_TRUST#STRICT`. **The write family refuses**: `/deck/edit/*`, `/deck/tts*`, `/deck/lipsync/*` and the review owner's routes are registered in both modes, and in no-trust mode the gate ahead of the table answers every one of them 403 `{ noTrust: true }` before a body is read or a route runs. Nothing in this mode writes a file but the review sidecar. **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. The watcher never reloads in this mode; entering it re-runs the audit and re-prints the verdict, never silently serving new bytes under the old one. The bridges are refused with the write family: live synthesis is a write-mode engine, and recorded narration needs no bridge. **The phone remote** (`NO_TRUST#REMOTE`) is the server's in either mode. `--remote` widens the **listener** only: off this machine **only `/deck/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 one classifier for both modes. The deck discovers the mode via **`GET /deck/ping`**, whose read-only answer carries no agent roster and no edit capability because nothing that edits answers, and subscribes to **`/deck/events`**, which in this mode carries the remote's taps and the upstream's news and never an unnamed `reload`: the watcher does not reload a deck served from audited bytes. The runtime wires this in its own path rather than through the edit path with a flag; `editAvailable` stays **false**, so `A`, the undo chord and layout picks all still say they need write 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 `/deck/ping` and the position readout still answer, because those are loopback business.
|
|
598
599
|
- **Upstream updates** (`NO_TRUST#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**, no-trust mode 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 /deck/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 `/deck/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 `--no-trust` 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**: `/deck/events` still carries no `reload` in this mode, 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.
|
|
599
600
|
- **Ingredients label** (printed by every no-trust start, before the first slide renders; `decklight <deck> --no-trust --audit` 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, narration audio) 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. A deck that is data (`DECK_ANATOMY`) carries no runtime and, with no author script beside its slides, no script at all: the label's strongest line, `no script in this file — the runtime is the one this install serves (X); written for Y`: presenting someone else's deck means running *your* runtime against *their* content, and the version the block records is compared the way a linked deck's is. **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.
|
|
@@ -608,12 +609,12 @@ slide. The chapters were visible, but they organised nothing.
|
|
|
608
609
|
- **Editing** (write mode, on by default; `src/core/editbar.js`). Write mode has always had several ways to change a deck, each learnt on its own: a double-click, a drop, `L`, `S`, a right-click menu, five palette rows, `Z`. (Bare `L` and `Z` have since gone: a stray press while presenting changed the file, so layout is the bar's button and undo is the platform's chord.) Editing is on from the moment write mode answers, and the bar gives it one face; the lock (above) is what turns it off, and there is no key for either. **The bar**, along the bottom of the deck, names every door with the key it stands for: **Text** (⏎), **Picture** (a file chooser, placed as a drop would be, after the selected element or last on the slide), **Layout · auto** (the button names the layout the slide has; ⇧-click cycles backwards), **Notes** (`S`), **Slide ▾** (new, duplicate, move up, move down, delete), **Undo** (`⌘Z` / `Ctrl+Z`), **Redo** (`⌘⇧Z` / `Ctrl+⇧Z`), **Lock** (locks the deck: the bar goes, the 🔒 chip unlocks). **The bar hides**: the palette's **Hide the bar** / **Show the bar** row takes it off the screen and brings it back, remembered per deck, and fullscreen hides it on its own, the commit chip with it (in write mode fullscreen is a rehearsal, not an edit, and a rehearsal screen says nothing about git); hidden, editing stays on and every door the bar names still works, because the bar is a surface over them. **The bar moves**: a grip (⠿) at its left edge drags it anywhere on the stage, which is where it goes when the bottom of a slide is where the content is; the place is remembered per deck as fractions of the stage, so it survives a resize, and a double-click on the grip puts it back at the bottom centre. **Selection**: while editing, a click on an element selects it, outlined, with a ⋯ handle at its corner that opens the element's menu by left-click, and the pointer outlines, more faintly, what a click would select. **Inside a diagram the selection is a node** (`src/core/pick.js`): a click selects the deepest drawn node under the pointer (a shape, a wire, a label; a label's line selects its whole `<text>`), the diagram's empty canvas selects the `<svg>`, and a chart stays one block. SVG takes no CSS outline, so the node is framed by a box drawn over it, which follows it when the stage reflows (a panel docking) or a build moves it. A shape under the pointer is **boxed by a dashed line in the theme's accent** (the yellow of Eclipse, the mint of Aurora) and **glows** (a drop-shadow that follows its outline), and the stage around it dims a little, by one box that lets every pointer event through. Nodes the engine or a template added are never picked. With something selected, `⏎` edits it in place when it is text (as a double-click would) and opens its menu when it is not, `⌫`/`Delete` removes it (one undo entry, the undo chord takes it back; a node selected inside a diagram goes alone, by `POST /deck/edit/element/remove` `{ slide, index, path, tag }`, its line with it when it stood alone on one, a path that lands on another tag a 409), `Esc` lets it go; the arrows still move between slides, and moving on lets the selection go. The bar writes nothing itself: every button and key goes through the route the gesture or the menu already used, so each lands on the same undo stack. The right-click menu, the double-click and the drop are unchanged; the bar is a surface over them, not a second path. **The slide number** sits at the top right while editing is on, `3 / 12` in the theme's accent on the theme's background, above the commit chip, which steps down under it with the clock; it goes with the lock, and fullscreen hides it as it hides the chip. **A text, code or label save is written in place**: the page that saved keeps what it typed (a code block is rendered again from its new source, highlighted and lined), the slide is rescanned and laid out again, and nothing reloads; the write is quiet (`quiet: true, from`, as the colour card's and the notes drawer's are) and every other page of the deck is sent a `content` event and reloads for the new words. The undo chord takes it back with the ordinary reload. Off a print, an embedded view and a capture, the bar does not appear. The palette carries **Lock deck** and, locked, **Unlock deck**. **The element menu**: with editing on, right-clicking the current slide, or the ⋯ handle on a selection, opens it. Right-clicking a specific element (found by walking up from the click to the section's direct child that contains it, so a click anywhere inside a bullet list or a chart still resolves to that top-level element, and inside a diagram to the node under the pointer as a click would select it) opens a menu about that element: Inspect, Remove element (inside a diagram *Remove this rect* and *Remove the whole svg*), Edit content (HTML), Colors…, Type…, Copy style and Paste style (below), Concept ▸ (on a diagram shape, `SVG_DIAGRAMS`), Add text effect ▸, Slide ▸. No notes row on an element, HTML or SVG: the notes are the slide's, and the background right-click, `S`, the bar's Notes and the palette open them. Right-clicking the bare slide background (nothing under the cursor but the `<section>` itself) shows Edit speaker notes and Slide ▸. Elements are addressed by **raw position among the slide's direct children** (`[...section.children].indexOf(el)`, title included, never filtered as chrome the way the engine's own `splitContent()` filters a *live* DOM): no per-element ID scheme, so a hand-authored deck needs no new markup to become editable. `tools/deck-html.mjs`'s `sectionChildRanges()` is the walker the server-side transforms share with `locateSlide`: it treats `<script>`/`<style>` bodies as opaque (a chart's embedded JSON is not markup) and nests by genuine recursion rather than a same-tag-name counter, so self-closing SVG children and same-name nested tags still resolve correctly. "Edit content (HTML)" reads the element's outerHTML fresh from the **file** via `GET /deck/edit/element/source`, never the live DOM, which the engine mutates in place (pinned-title classes, namespaced SVG ids, chart/code/math subtree replacement), in the same textarea-and-⌘⏎-saves shape as the notes editor, syntax-highlighted by a painted layer behind the textarea that shares its every metric (font, wrapping, padding, so a 400-character line wraps where the caret wraps and the paint scrolls as far as the text does, #529), opened at the top of the source with the caret first. **The editor docks** (#530) (float, left, right or bottom, the review and sources panels' placement (`dock.js`), remembered per deck under its own key): docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, the element under edit keeps the outline a double-click edit gets, and the deck's keys work whenever the caret is not in the textarea; `Esc` and the × close, `⌘⏎` saves and the reload re-opens nothing, so the placement is met again on the next open. **Every editor read and write is bounded** (`boundedFetch`, 8s): Chrome gives a plain-HTTP origin six sockets shared across all its tabs, and each tab of the deck pins one to `/deck/events` for live reload, so with enough tabs open a further fetch queues in the browser and never reaches the server: it neither answers nor rejects. Unbounded, the content editor sat on `loading…`, disabled, with Esc the only way out; bounded, the stalled request fails through the same toast as any other error (`no answer in 8s — close other tabs of this deck and retry`). Reads and writes that can honestly take long (an agent run, an export, a publish) are not bounded. **"Colors…" recolors the shape under the click and the text on it**, in the inspector: the menu's *Inspect*, *Colors…* and *Type…* select what the menu was opened on and open the inspector on its Info, Colors or Type tab, so restyling is one panel, beside the facts about the same node (`src/core/colorpicker.js`): the one row that looks *below* the top-level element, because in a diagram the thing you point at is a box, not the `<svg>`. In a diagram the background is the shape's `fill` and the text is the `<text>` sharing its `<g>` (the one-group-per-box convention; a shape loose on the canvas takes the labels whose centre falls inside it, and right-clicking the label finds the same pair from the other side); anywhere else the element is a box in the CSS sense (the click climbs out of inline runs and out of a highlighted `<pre>`) and the two colors are its `background-color` and `color`. A **Fill | Stroke | Text** switch says which a pick lands on: the fill, the text, or the shape's border (#717), its `stroke` (a box's `border-color`), with a **Width** row beside the Stroke side, a slider and a number in px that preview as they move and land in the same save as the colour (`stroke-width`, unitless as SVG reads it; `border-width` in px on a box), and the card has **two tabs, deliberately**: **Theme** is the applied theme's own palette read live off the token contract (`THEMING`) and *named*: **Primary** (`--accent`), **Secondary** (`--link`, offered only where the theme's links are not simply its accent: one color gets one name), On primary, Heading, Text, Muted, Background, Background alt, Block, the six numbered diagram fills and the diagram inks; a token the theme does not define is left out rather than shown as a dead swatch, the swatch the target already carries is marked, and a pick writes the token **by reference** (`fill: var(--d-fill-3)`, never the hex it resolves to today), so a recolored box still follows `T` to the next theme, still takes its panel's nested tone (`SVG_DIAGRAMS`) and still answers to the theme gates. A deck that uses a **design system** (`DESIGN_SYSTEMS`) gets one more group per design system after the theme's (a palette of scales, one row per colour, its weights in order, and a deck held to its brand no Custom tab: `BRAND_PALETTE`), in the order the deck references them, from its meta block's `palette`, headed `<title> · <group>` (just `<title>` for a one-group palette), each swatch under the design system's own label, painted from the page's live token and dropped when the page leaves the token undefined, and a pick there writes the token **with one hex fallback**, `var(--acme-blue, #0056f9)`, the hex being what the token computed to at pick time: the token is the design system's, not the theme's, so the box keeps its brand colour through `T`, and still has it if the design system goes missing. The marked swatch is matched on the token, never on a fallback that may have gone stale. A deck with no design system shows exactly the theme's groups. **Custom** is a literal color (**RGB** or **HSB** sliders with typed values, and a hex field that reads what people paste (`ffb319`, `#fa0`)) opening on the color the target has now; it is a separate tab because a literal is exactly what stops following the theme, and reaching for it should be a decision rather than the default. Every pick **shows on the slide and is saved at once**, the way DevTools applies a style: one POST and one undo entry a pick (a slider previews while it is dragged and saves when it is let go, a typed value when it is entered), the saves made one after another in the order picked, and a save the server refuses puts the slide back to what was last saved, with a toast; there is no Apply and no Cancel, and the undo chord is the way back. **Reset** takes the colour set here back off, and saves that. It docks wherever the inspector does, and a key pressed inside it stays in it; docked along the bottom it lays the switches in a column beside the palette. Each save is one `POST /deck/edit/element/style` `{ slide, index, edits: [{ path, tag, prop, value }], quiet: true, from }`, **written in place**: the page that picked already shows it, so the server's write is quiet (no reload, the inspector stays open on the node) and every other page of the deck is sent a `styles` event and reloads; without `quiet` the route still answers with the ordinary reload. The edits of one save are **one undo entry**: `path` is the element-child path below the top-level element counted the way the *file* counts (nodes the engine added, a draw build's `.draw-head`, are skipped), `tag` is what the page found there, and a path that lands on a different tag in the file (generated content such as a chart, or a deck that moved on) is refused with a 409 rather than recolored. Only the open tag's `style` is touched, textually: `viewBox` and every other attribute survive byte for byte, and because the value lands inside an attribute the server writes **only** `fill`, `color` or `background-color`, set to a `var(--token)`, a `var(--token, #hex)` (one hex fallback, nothing nested), or a hex, or removed (`null`; an emptied `style` goes with it). **The Type tab** is the editor's other half, and the element menu's **Type…** row opens the inspector on it: the text the card would colour (a diagram's label, a block's own text) gets a **Size** (a slider and a number, 8–160 px, in deck units, since the stage is scaled and the text is not), a **Weight** (Regular 400 to Heavy 800), a **Font** that is one of the theme's three roles by reference (`var(--font-heading)`, `var(--font-body)`, `var(--font-mono)`; a role the theme leaves undefined is offered disabled), never a family name, so the text still follows `T` and a deck's marked fonts (`FONTS`), **Italic**, and **Align**, which is `text-anchor` (start, middle, end) on a diagram label and `text-align` (left, center, right) on a block. The rows open on what the text has now, the role read from its authored `font-family` or matched against the theme's; every change shows at once and is saved as it is made, like a colour; **Reset** on the Type tab takes all five back off, to what the theme or the markup gives (a presentation attribute such as `font-size="14"` is never touched: the style declaration overrides it, and removing the declaration hands it back). The server writes each of these in one closed shape only: `font-size` as `N px` (1–999, one decimal), `font-weight` in hundreds, `font-family` as exactly one of the three role tokens, `font-style` `normal` or `italic`, `text-anchor` `start`/`middle`/`end`, `text-align` `left`/`center`/`right`; anything else is a 400. **Copy style and Paste style** (`src/core/style-clip.js`) put one shape's look on another, the format painter every slide tool has: the element menu's two rows, `⌥⌘C` and `⌥⌘V` on a selection (`Ctrl+Alt+C` and `Ctrl+Alt+V` elsewhere, Keynote's and PowerPoint's chords, read by key position because `⌥` turns the C into a ç), and the palette's *Copy style* and *Paste style* while something is selected. A style is exactly what the Colors and Type tabs write and nothing more: the fill, the border and its width, the text's colour, and the type the source sets (size, weight, font role, italic, alignment). It is copied **by role**, so a diagram box pastes onto an HTML box (fill to `background-color`, stroke to `border-color`, a label's ink to `color`, `middle` to `center`); a size crosses only between two of the same kind, since a diagram's px are its viewBox's. A colour the source's markup writes is copied as written, a token **by reference**, so the paste still follows `T`; a colour it only inherits is copied as what it looks like, the paste first taking the target's own value off and keeping that when the target then looks the same, else writing the hex. A diagram shape's authored fill is read from its `data-nest-fill`, not the nested tone the engine painted over it. **A shape in a concept pastes its concept** onto a diagram shape, not the concept's colour, and a plain style pasted onto a concept shape takes it out of its concept, since the concept would paint over the fill: the route carries the change as `concept: { path, tag, value }` beside the edits, written in the **same** `POST /deck/edit/element/style` and so **one undo entry**. The paste shows at once and is written in place (`quiet`), a refusal puts the slide back, a paste that would change nothing writes nothing (*already that style*), and `⌥⌘V` with nothing selected says to select a shape first. The clip is remembered per browser (`decklight-style-clip`), so it outlives a reload and reaches another deck in another tab. "Add text effect ▸" drills into a submenu offering the spec's 7 entrance styles (`MOTION`) plus `none` (an explicit, instant build step, one more advance still reveals the element, it just carries no animation, which is why it is distinct from "remove effect", the separate action that strips `data-build` entirely). Remove / edit-content / add-effect all land on the SAME undo/redo stack as layout and notes edits, through the same `applyEdit`. **Two gestures need no menu** (`src/core/authoring.js`): with editing on (locked, a double-click on text changes nothing), a **double-click** on a text element (headings, paragraphs, list items, quotes, cells; never generated content such as charts, math, terminals, or an aside) edits it in place, `⏎` saves and `esc` gives up. A diagram's label is text too (`SVG_DIAGRAMS`). **Emphasis while editing**: `⌘B`, `⌘I` and `⌘E` (`Ctrl` on Windows and Linux) wrap the selection in `<strong>`, `<em>` or `<code>` and take it off again, and a pill above any selection offers the same three to the mouse; the file gets the semantic tag, never the `<b>` or `<i>` a browser's own bold command writes, so a theme's rule for `strong` (the heading colour) is what the emphasis looks like. The save fetches the element's SOURCE through `GET /deck/edit/element/source`, changes the one node the click landed on by the same element-child path in both trees, and posts the whole top-level element back through `POST /deck/edit/element/content`, so the file's own markup survives around the words that changed. **A code block is edited as its source text, never its rendered DOM:** double-clicking a `pre > code` reads the element's source from the file and shows the code plain (`contenteditable="plaintext-only"`): code.js has highlighted it into spans and wrapped every line, and writing that back would put the spans in the deck. Enter is a newline, `⌘⏎`/`⌃⏎` or clicking away saves, Tab indents, Escape gives it up. The save changes only the `<code>`'s text (attributes such as `data-lines` and the `language-` class untouched, the file's own newline after `<code>` and before `</code>` kept, `<`/`>`/`&` escaped) through the same `POST /deck/edit/element/content`, so the undo chord takes it back. Escape puts back the very `.code-line` nodes that were shown rather than re-parsing them, because a `data-lines` build steps through references to those nodes. **Dropping an image** onto a slide uploads it through `POST /deck/edit/asset` into `assets/` beside the deck (a safe lowercased name, the extension from the content type; an SVG carrying a script is refused) and places `<img>` after the element under the cursor, or last on the slide, through `POST /deck/edit/element/image`. **The slide as a whole** (new, duplicate, delete, move up, move down) is the palette's five `Slide:` rows and the menu's `Slide ▸` submenu, each one `POST /deck/edit/slide` `{op, slide}` and one undo entry; **the overview (`O`) is where a deck is rearranged**: in write mode every cell drags to a new place (`{ op: 'move', slide, to }`, the slide ending up at `to`, one undo entry however far it went; dropped on the left half of a cell it lands before it, on the right half after it, and a drop that changes nothing asks for nothing), each cell carries **+** new after, **⧉** duplicate and **🗑** delete on hover, and the selected cell answers `N`, `D` and `Delete`. Without an edit server the overview is the picture it always was: no tools, nothing drags. The write reloads the page, and the overview reopens on the slide the server named, so a second drag follows the first without pressing `O` again; a deck keeps at least one slide, and the answer names the slide to land on after the reload. A slide with no per-element source mapping declines the whole menu rather than opening one that cannot honestly save anything: markdown-authored slides (`data-markdown`, removed in 0.3.0, above) are the one case of this today, marked `data-markdown-removed` at parse time. The menu is the first **cursor-anchored** overlay in the engine: every other one dims the screen and centers a card; this one keeps a transparent backdrop (dimming would hide the very slide the menu is about) and positions the card at the click, clamped to stay on-screen. It still reuses the shared `closeOnBackdrop`/`selectInList` machinery: arrow keys navigate, `Escape` and a backdrop click both close it, exactly like every other overlay.
|
|
609
610
|
- **Slide layout cycling** (write mode only): the bar's **Layout** button (⇧-click backwards) and the palette's *Slide: Cycle slide layout* walk the CURRENT slide through the layout ring: `auto` (deck default: the `pinTitles` config, **on by default**, + the pinnable heuristic, so out of the box a pinnable slide pins) → `centered` (title in flow, content vertically centered) → `pinned` (title pinned at the pin Y) → `top` (everything flows from the top of the slide) → `split` → `split-flip`. Ring entries that cannot change the slide's look are SKIPPED so every press shows something new: `pinned` when `auto` already pins, `split-flip` when there aren't two content blocks to swap sides. **Split layouts**: the first two content blocks, everything after the title + subtitle header (which spans the full width, pinned or in flow), become ~half-width sides in a wrapping flex row, first block left and second right; `split-flip` mirrors (bullets left · diagram right ⇄ diagram left · bullets right). The two sides **share a top edge** (`align-items: stretch`): columns of unequal height used to centre independently, so the shorter one's heading floated down the slide and the pair stopped reading as a pair: authors were hand-rolling `display:flex; flex-direction:column; height:100%` on each column to get this back. Images opt out of the stretch (`align-self: center`) so a picture is never letterboxed inside a box taller than itself. A **third block is a footer, not a third column**: it spans both sides, centred, below them (`.split-footer`, applied by the engine to every block past the second). The shape that asks for this is the comparison slide (two columns and a note that applies to both) and treating it as "everything else right" hung that note under one side of a comparison it was about equally. Three side-by-side columns are deliberately **not** a shape: grouping three items onto one slide multiplies content-per-slide, which is what the density guidance exists to discourage; use two and a footer, or another slide. A slide whose ONLY content block is a list can't take sides: the engine marks it `.split-columns` and the list itself splits across two CSS columns (`break-inside: avoid` per item). The pick lands on the section as a `data-layout` attribute (the same attribute an author can write in the file, and headless probes can assert on) and it wins over `data-pin` (`pinned` forces the pin, a numeric `data-pin` still sets the Y; `centered`/`top` lay out in flow; the split pair keeps the deck's auto pin resolution for its header). `auto` removes the attribute. A layout pick is a PERSISTED deck edit, so cycling requires write mode: the pick applies to the DOM instantly and is written back into the file through the edit server (debounced ~600ms, so a cycling burst costs one write/reload, and a pick pending when the slide changes is flushed, not dropped): the file is the ONLY persistence (no localStorage). Without the server, L toasts what it needs and changes nothing: a presenter can't silently fork the deck from what's on disk. Every change re-measures pinned titles and re-runs the overflow guardrail. `instance.cycleLayout(±1)` programmatically (same gate); `instance.layoutRing(n)` exposes a slide's ring, skips included, so headless probes can assert the skip logic without a server; also in the `/` palette ("Cycle slide layout").
|
|
610
611
|
- **Undo/redo** (the platform's own chord: `⌘Z`/`⌘⇧Z` on a Mac, `Ctrl+Z`/`Ctrl+⇧Z` on Windows and Linux; only that platform's, so the other modifier keeps whatever the system makes it). The chord is checked **below the typing guard**, so in a text box, the notes editor or a slide element being edited the browser's own undo is the one you get, and an open dialog still owns it. 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. **Undo waits for an edit still in flight.** The mouse gestures answer asynchronously (a double-click save reads the element's source before it writes, a slide operation and a dropped picture wait on the server), so an undo pressed the instant one is sent used to reach the server first, find nothing to undo, and let the edit land behind it. The browser now holds the undo and redo until every pending write has landed, and then undoes the edit you just made. Agent runs are not waited on: they can take minutes.
|
|
611
|
-
- **Notes editor** (`S`, right-click a slide's background, or the `/` palette). **With no edit server behind the deck** (`--no-trust`, a file), `S` opens the same card **read-only**: the heading says so (*read-only (write mode edits them)*), the box is dashed and cannot be typed into, there is no save or ✨ button, it follows the slide, and it is never modal: `→` and the deck's other keys still work with the caret in it (the typing guard skips a read-only box); `Esc` closes it. In write mode: opens a notes editor (`[click]`-separated plain text, every marker shown in square brackets) whose Save rewrites the slide's `<aside class="notes">` in the file (one `<p>` per paragraph, the editor shows each paragraph a blank line apart and saving never merges them, with a `<p>[click]</p>` between beats, 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()` reached a different way. **The notes are a drawer that saves itself.** The card opens docked along the bottom the first time (`dock.js` `defaultMode`), the deck navigable above it; the dock buttons move it anywhere (float, left, right or bottom), remembered per deck under its own key, modal only while floating; docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, and the deck's keys work whenever the caret is not in the textarea. **It is written without being asked**: once the typing has stopped for the **quiet time** (500 ms unless changed; the mark beside the heading says *autosaving…* while it goes and *saved* for a moment after, with no toast, since one every pause would be a toast every sentence), when the author leaves the card (a press on the slide, or the window going behind another; not a focus event, because the card's own machinery drops focus all the time, a button disabled while drafting, the box hidden behind the before/after view), when the deck moves to another slide (the edits go to the slide they were written for, and the card follows once they are written), and when the card is closed (Esc, ×, `S`: the save first, the close once it is written). A save that fails leaves the card open and marked unsaved, because closing would be the one way to lose what was typed; a box that matches the file writes nothing. **An agent's
|
|
612
|
-
- **Inspector** (`I`, or the palette's *Inspector*; `src/core/inspector.js`). With a top-level element selected in write mode its tabs are **Info**, **Colors**, **Type** and **HTML**: HTML opens the element's source in the content editor, which takes the inspector's place in the panel slot and has a **← Inspector** button that comes back on the same element (the right-click menu's *Edit content (HTML)* opens the same editor). One panel that says everything about the slide on screen, or about the element selected on it, so "what is going on with this slide" has one place to be asked instead of a debug line, the speaker window and a terminal. Its **Info** tab reports and never edits. Each row is a short fact with no commentary, marked the way the terminal banner marks its rows: a green ✓ when it is fine, a yellow ! when it wants a look (the banner adds a red ✗ for a service that failed and is not running). **With nothing selected** it shows the slide: title (the heading the finder and the overview name it by, with its level; ! with no heading, when every list shows the slide by its opening words or its number), layout (and design-system template), builds (`3 steps · on 2`, with the step labels), notes (words and ⟨CLICK⟩s, ! when the clicks do not match the builds), time (planned and rehearsed), fit (✓ fits, ! clips by how many px, ! a split layout fighting a flex block), voice, comments (open and resolved, this deck's own), and its sources (`SLIDE_SOURCES`: named facts and real links). In write mode it adds the slide's lines in the file and what `decklight check`'s static half says about that slide, through the read-only `GET /deck/edit/inspect?slide=N
|
|
613
|
-
- **Ask an agent** (`A`): write 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 --allowedTools "Bash(npx decklight:*)" "Bash(decklight:*)"`: the deck file is its to edit and decklight's own CLI its to run, for the render check the skill asks for, and nothing else, since a headless run has no TTY to ask on), **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`. **The prompt names the slide on screen**, so "this slide" in an ask means that one rather than a question back, and says that decklight commits the edit itself when the agent finishes, so an agent started by A never calls the commit route the skill shows an agent that opened the deck on its own. A opens a prompt card (agent picker when several are detected; `--agent` sets the default) that **docks** like the content editor above (float, left, right or bottom (`dock.js`), remembered per deck under its own key, modal only while floating) so the slide you are asking about stays on screen and the deck's keys work whenever the caret is not in the prompt. **Docked, the card is a conversation**: ⌘⏎ sends and the card stays open (floating, it closes as before), and above the prompt it lists this session's asks, oldest first: each with the slide on screen when it was sent (a click goes back there), the prompt, and what came of it: *working…* with the latest clue, then *edited the deck* / *no changes* / *failed* and the agent's own
|
|
614
|
-
- **Check deck…** (palette; also found by `lint`, `issues`, `crowded`, `overflow`; `src/core/deckcheck.js`).
|
|
612
|
+
- **Notes editor** (`S`, right-click a slide's background, or the `/` palette). **With no edit server behind the deck** (`--no-trust`, a file), `S` opens the same card **read-only**: the heading says so (*read-only (write mode edits them)*), the box is dashed and cannot be typed into, there is no save or ✨ button, it follows the slide, and it is never modal: `→` and the deck's other keys still work with the caret in it (the typing guard skips a read-only box); `Esc` closes it. In write mode: opens a notes editor (`[click]`-separated plain text, every marker shown in square brackets) whose Save rewrites the slide's `<aside class="notes">` in the file (one `<p>` per paragraph, the editor shows each paragraph a blank line apart and saving never merges them, with a `<p>[click]</p>` between beats, 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()` reached a different way. **The notes are a drawer that saves itself.** The card opens docked along the bottom the first time (`dock.js` `defaultMode`), the deck navigable above it; the dock buttons move it anywhere (float, left, right or bottom), remembered per deck under its own key, modal only while floating; docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, and the deck's keys work whenever the caret is not in the textarea. **It is written without being asked**: once the typing has stopped for the **quiet time** (500 ms unless changed; the mark beside the heading says *autosaving…* while it goes and *saved* for a moment after, with no toast, since one every pause would be a toast every sentence), when the author leaves the card (a press on the slide, or the window going behind another; not a focus event, because the card's own machinery drops focus all the time, a button disabled while drafting, the box hidden behind the before/after view), when the deck moves to another slide (the edits go to the slide they were written for, and the card follows once they are written), and when the card is closed (Esc, ×, `S`: the save first, the close once it is written). A save that fails leaves the card open and marked unsaved, because closing would be the one way to lose what was typed; a box that matches the file writes nothing. **An agent's rewrite saves itself**: ✨ and 🗣, for this slide, land their text in the box and write it at once, the quiet way, with ⇄ changes open on what they changed; ↺ reset (or `Z`) takes it back. It was asked for, and a draft that waited for a keystroke before it saved read as a save that did not happen. `⌘⏎` still saves at once; there is no save button, since a card that writes itself when you stop typing has nothing for one to do that `⌘⏎` does not; and the **● unsaved** mark beside the heading says when the box and the file differ. **The quiet time is a setting** (SETTINGS, *Notes autosave*, write mode): `250 ms`, `500 ms`, `1000 ms`, `2000 ms after typing stops`, or `on leaving only`, which is the card as it was before, and ⏎ walks them; it belongs to the browser, not the deck (`decklight-notes-quiet`), because how long a pause means "done" is the typist's, not the file's. **Docked, it follows the slide**: the notes of whatever slide is on screen, and its heading says which. 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 `/deck/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.
|
|
613
|
+
- **Inspector** (`I`, or the palette's *Inspector*; `src/core/inspector.js`). With a top-level element selected in write mode its tabs are **Info**, **Colors**, **Type** and **HTML**: HTML opens the element's source in the content editor, which takes the inspector's place in the panel slot and has a **← Inspector** button that comes back on the same element (the right-click menu's *Edit content (HTML)* opens the same editor). One panel that says everything about the slide on screen, or about the element selected on it, so "what is going on with this slide" has one place to be asked instead of a debug line, the speaker window and a terminal. Its **Info** tab reports and never edits. Each row is a short fact with no commentary, marked the way the terminal banner marks its rows: a green ✓ when it is fine, a yellow ! when it wants a look (the banner adds a red ✗ for a service that failed and is not running). **With nothing selected** it shows the slide: title (the heading the finder and the overview name it by, with its level; ! with no heading, when every list shows the slide by its opening words or its number), layout (and design-system template), builds (`3 steps · on 2`, with the step labels), notes (words and ⟨CLICK⟩s, ! when the clicks do not match the builds), time (planned and rehearsed), fit (✓ fits, ! clips by how many px, ! a split layout fighting a flex block), voice, comments (open and resolved, this deck's own), and its sources (`SLIDE_SOURCES`: named facts and real links). In write mode it adds the slide's lines in the file and what `decklight check`'s static half says about that slide, through the read-only `GET /deck/edit/inspect?slide=N` (the whole deck's, with the fixes, is **Check deck…**'s, below); the render half needs a browser and seconds, and the panel asks on every slide. **With an element selected** (write mode, `Editing` above) it shows that element: what it is (`ul · 5 items`, `svg · 14 nodes`), its box in deck units and share of the slide, its type (`family size/line-height · weight`) and colour, named by the theme token that holds it when one does (`var(--heading-color) · #fafafa`), its **contrast** against what is really behind it (composited up the tree; a gradient stands in by its first stop and is marked `≈`) with ! under the WCAG AA floor for its size, and the figure cut rather than rounded so a fail never reads as the floor, which build step shows it, an image's natural size and whether it has alt text, whether it clips or runs off the slide, and its lines in the file. A **breadcrumb** runs from the selected block down to the node selected (`svg › g.node › "API"`): hovering a crumb lights that node on the slide, clicking one makes it the node selected and inspected. **Colors and Type tabs**: with an element selected in write mode, beside Info, the colour card's two halves (below), on the node inspected, each pick saved as it is made. **The picker** (the header's dashed box with an arrow, DevTools' *select an element*): while it is on, whatever is under the pointer on the slide is lit, a diagram's drawn nodes one by one and anything else as the element itself, and a click makes it the element inspected (the selection moves to it) and turns the picker off; the pointer's presses are the picker's alone, captured before the deck, the selection or a build hears them, and `Esc` turns it off. Without write mode the picker still inspects, on the Info tab. `Esc` lets go of the selection first and closes the panel second. A **copy** button puts the facts on the clipboard as plain text, for an agent or a comment. It **docks** right by default (float, left, right or bottom, remembered per deck), follows the slide and the build step, re-reads the overflow guardrail's verdict when it lands, and leaves the arrow keys to the deck. `e` in it opens the sources editor. Docked panels each claim their own side (`dock.js`), so the inspector beside the agent or the notes keeps both gutters.
|
|
614
|
+
- **Ask an agent** (`A`): write 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 --allowedTools "Bash(npx decklight:*)" "Bash(decklight:*)"`: the deck file is its to edit and decklight's own CLI its to run, for the render check the skill asks for, and nothing else, since a headless run has no TTY to ask on), **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`. **The prompt names the slide on screen**, so "this slide" in an ask means that one rather than a question back, and says that decklight commits the edit itself when the agent finishes, so an agent started by A never calls the commit route the skill shows an agent that opened the deck on its own. A opens a prompt card (agent picker when several are detected; `--agent` sets the default) that **docks** like the content editor above (float, left, right or bottom (`dock.js`), remembered per deck under its own key, modal only while floating) so the slide you are asking about stays on screen and the deck's keys work whenever the caret is not in the prompt. **Docked, the card is a conversation**: ⌘⏎ sends and the card stays open (floating, it closes as before), and above the prompt it lists this session's asks, oldest first: each with the slide on screen when it was sent (a click goes back there), the prompt, and what came of it: *working…* with the latest clue, then *edited the deck* / *no changes* / *failed* and the agent's own report, from its start (a report leads with what it did; past 4000 characters its start and its end, with the cut marked), and the files the run created beside the deck and left there, which no commit takes (*left beside the deck, not committed: before.html*). The edit server keeps that log (`agentAsks` on `/deck/ping`, the last 20, each `{ id, agent, prompt, slide, state, ok, changed, tail }`), because an agent's edit reloads the page; a card docked open before that reload is open after it (per tab), and closing it forgets that. That holds for every panel in the slot: the one open when the deck reloads (an agent's edit, a dropped picture, the HTML editor's own `⌘⏎`) is open after it, the inspector included, and the HTML editor comes back on the element whose save reloaded the deck; a panel closed on purpose stays closed. Send is disabled while a run is in flight. 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 the undo chord 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 the undo chord takes the edit back like any other.
|
|
615
|
+
- **Check deck…** (palette; also found by `lint`, `issues`, `crowded`, `overflow`; `src/core/deckcheck.js`). Every problem with this deck in **one docked panel**, each with the fix that would clear it, without leaving the deck: `decklight check` answers "what is wrong" in a terminal, and an author with the deck open has none in front of them. **Three sources, one list.** The open deck answers what the render half of the CLI asks a headless one, plus what only a live page can: content **clipped** (every slide measured now, an inactive one under the same momentary `.pin-measure` the pinned titles use), a slide **crowded** past SLIDE_DENSITY (the same count as `data-dense`), a split layout **fighting** its own flexbox, **⟨CLICK⟩ markers** that do not match the build steps (counted from the engine's own build groups, so a slide with a terminal or another provider is compared too, where the file-only check has to skip it), an image or a video that **did not load**, and a `data-markdown` slide. In write mode the edit server adds **the file's half for the whole deck** (`GET /deck/edit/check`, read-only: `staticFindings` with the same rule ids `check --json` prints, `{ level, rule, slide, title, message, fix? }`), so nothing needs a terminal: the **head-level, deck-wide findings come first** (`ds-behind`, `theme-off-brand`, `ds-unresolved`, a `missing-asset` or an `unaccounted-script` outside any slide), marked `—` for *the deck*, then each slide's (`off-role`, `off-palette-literal`, `ds-unknown-system`, a slot left empty, …); a finding the page measured itself wins over the file's reading of the same rule on the same slide. A row per finding, errors (`✗`) before warnings (`!`) within a slide: the slide number, its title, what is wrong, and under it **the fix**. The head counts them (*check · 10 issues on 6 slides and the deck · 2 errors · 3 with a fix*), a clean deck says *no issues: 9 slides checked, file included*, and without a server the foot says the file's own findings need write mode. After the issues come **suggestions** (`+`), counted apart (*· 1 suggestion*): a label that recurs across slides in different colours, worth a concept (SVG_DIAGRAMS), whose fix makes it one in a single write; and a diagram with no build (SVG_DIAGRAMS), `decklight check`'s hint asked of the open deck, with the same threshold and opt-out, except that the page asks the engine's build records whether a diagram builds rather than reading its attributes. After both, when one has run, come the **agent review**'s findings (below), under their own head (*agent review · 2 · f asks the agent to fix one*), marked `✦` with their rule named, and counted apart in the head (*· 2 from the agent*). **Every row with a fix shows it**, as what pressing it will do (*Migrate to acme 6.0.0 · 62 renames*, *Switch to acme-dark, the brand's first theme*, *Rename text-main → text-body on slide 4*, *Ask the agent to fix it*); `f`, or the button, applies the selected row's; a row with none says *no quick fix*. **Two kinds of quick fix, both shown in the agent panel.** A **deterministic** fix is one the server applies itself (`POST /deck/edit/check/fix { rule, slide?, all?, ref? }`, `cli/check-fixes.mjs`) and records in the agent panel's log as an entry by *decklight*, beside the agents' edits: `ds-behind` → Migrate (`DESIGN_SYSTEM_MIGRATIONS`, its own words and commit); `theme-off-brand` → the theme the design system's migration renames the configured one to, else the brand's first; `off-role` on a renamed role → its successor, on that slide; `ds-unresolved` → `marketplace update` of the marketplace that holds it (nothing in the deck changes, so the page reloads to link what resolves now); `ds-unknown-system` → `design-system add` when a registered marketplace offers one of that name; `concept-suggestion` → the concept, as before. A **judgement** fix (clipped and crowded slides, `clicks-vs-builds`, `off-palette-literal`, an agent-review finding, anything a migration's `skill` handles) goes to the A agent as an ordinary ask, its prompt carrying the finding and its rule (and the skill, when the fix names one), watched in the docked agent panel with its progress and result — the `f` path the agent review had, open to every finding without a deterministic fix; it is offered only when this machine has an agent. **Either way it is one undo entry and one commit** (`fix: <rule> on slide N`, or `fix: <rule>` for the deck), and the row goes away when the finding does: the panel refreshes after every write. **Fix all**: a rule whose fix is deterministic and safe to batch (renamed roles) offers *every <rule>* on its row, and `⇧F`, applied to every slide as one undo entry and logged as one entry. **It docks** like the other panels (`dock.js`: float, left, right or bottom, right by default, one slot per deck with the tabs to the Inspector, the notes and the agent), stays open across the reload an edit causes, and `⏎` or a click goes to the row's slide without closing it; `←`/`→` keep driving the deck. **The toasts became pointers to it**: the behind, off-brand and missing-design-system toasts say there is a problem with a fix and open the panel on that row, instead of carrying the whole message and expiring. Otherwise read-only, in every mode. `instance.check()` returns the same findings, shaped like the CLI's `--json`, for a headless probe.
|
|
615
616
|
- **Agent review** (palette *Review: Review deck with agent…*, write mode; `cli/agent-review.mjs`). What a count cannot judge and a reader can: the local agent (the one on `A`, `PRESENTING`) reads the deck and says where it could be better, under four rules, each asked in the words `REVIEW_RULES` holds: **`unsourced-figure`** (a figure, date, percentage, ranking or quotation that no source listed for the slide backs, `SLIDE_SOURCES`), **`thin-voiceover`** (no speaker notes, or notes that read the slide back instead of carrying what it does not say), **`topic-title`** (a title naming a topic, "Results", where it could state the point, "Latency halved after the cache"), and **`better-as-visual`** (a process or a comparison written as bullets that a diagram, built step by step, or a table would show better). The agent runs **read-only**, the way `enhance` does: a few slides at a time (`POST /deck/edit/review`, progress as `review` events), shown each slide's text, notes and sources and the deck's outline, and asked for a JSON list. **Every answer is checked before anything is shown**: a finding on a slide it was not asked about, under a rule nobody named, or with nothing to say is dropped, never repaired, and a part that answers nothing usable is reported as unanswered. The findings join **Check deck…**, where ⏎ goes to the slide and **`f` hands that one finding's instruction to the A agent**: an ordinary A edit, one undo entry and one commit (`review: <rule> on slide N`). A figure is never given an invented source: the instruction says to add one only if the agent can open and read it. Findings are kept by the server for the session and re-read on every page load (`GET /deck/edit/review`), each matched to its slide by a fingerprint of the slide's text and notes, so a slide that moved keeps its finding and a slide that was edited, fixed or rewritten, drops it.
|
|
616
|
-
- **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). **The chip is also where the state of the work is read**: it is on screen, quietly, the whole time the deck differs from its last commit (*12 lines since the last commit — K commits*), led by the slides it changed, added and removed in the window's colours with a zero left out (*●1 changed ●1 added · 12 lines since the last commit — K commits*; a change that is only review records touches no slide and reads as before), so what has changed and how to keep it are answered without opening History, Commit or Restore; it is absent when nothing has changed or there is no git to write to. It turns into the ask (*12 lines uncommitted · 5m — K commits*, at full strength) 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, in lines and **in slides** (*3 slides: 1 changed, 1 added, 1 removed*, each count in its colour, amber, green and red, a zero dimmed; slides are matched against HEAD the way a diff matches lines, identical ones kept in order and, between two kept ones, an old and a new paired as one slide edited only when they share their heading or half their lines, so a slide swapped for a different one is one removed and one added, never an edit), a message box, and one button, with **⌘⏎ / ⌃⏎** to commit, the convention VS Code and every GUI client share; **write them for me** asks the agent for the commits the uncommitted work makes (on a click, or the moment the window opens with `--commit-messages`) and it never overwrites what you have already typed, because a proposal that eats your sentence is not one. **The proposal is one commit or several** (`cli/commit-split.mjs`): the deck's diff against HEAD is cut into **units** at zero context, one per hunk, each named by the slides it touches (`slide 3`, `slides 3-4`; past 40 hunks, the hunks of one slide travel together), and the agent is asked to group them, one commit per separate idea, replying `<numbers> | <subject>` a line. Every unit lands in exactly one commit (one named twice stays with the first, one forgotten joins the commit of the unit before it), and an answer with nothing usable leaves the deck as one commit for the author to name. One commit fills the message box as before; several replace it with **a row per commit**, its subject editable and where it lands beside it, a **one commit** button that sets the proposal aside (its first subject offered in the box), and **Commit all N**. **Each row has a tick**, on to start with: an unticked commit is left out (*Commit 2 of 3*, and nothing at all with none ticked), its units staying uncommitted in the working file while the ticked ones are built on HEAD without them, so a change not ready yet need not ride along with one that is. The plan is still normalised whole, so a unit the agent forgot joins its neighbour's commit and stays out with it when that one is unticked. What was left out comes back: the server re-cuts it against the new HEAD (a `-U0` hunk carries its own lines, so it is found again by its text) and the window stays open with those rows, their subjects kept, ready to commit then or later; when they cannot be matched the window offers *write them again*. The review sidecar is never sent to the agent: its units are a commit of their own, the last, with the subject its records give (below). The commits are built in a **private index** (`read-tree`, `update-index`, `write-tree`, `commit-tree`), so what the author staged by hand stays staged and out of them; commit *k*'s deck is HEAD's deck with the units of the ticked commits 1..*k* applied, so with every row ticked the last one is the working file byte for byte; and the branch moves **once**, with `update-ref`'s old-value check, so all of them land or none does. A plan carries `base`, a fingerprint of HEAD and the work it was cut from: an edit that lands while the agent is thinking makes it a plan for other work, refused (`STALE`) with *write them again*. `commit-tree` runs no hooks; the one-commit path still does. A first commit, with no HEAD to cut against, is one commit. Below the commit, two more rows, **so the window opens with nothing to commit too**: **Tag** puts an annotated tag (`git tag -a <name> -m <name>`) on HEAD, the name checked by `git check-ref-format` and refused when it starts with `-` or exists, and the tags already on HEAD named beside it; **Push** sends the branch and the annotated tags on what it sends (`git push --follow-tags`, or `git push --follow-tags -u <remote> <branch>` the first time), or the branch alone when **Settings… → Push tags** is off (then the tags on HEAD read `· not pushed` and the toast says they were kept here), on the click and only then, under `noPromptEnv` and a one-minute bound, turning `pushing |` while it goes. The row reads where the branch stands, from the same local read the four places below use (*↑3 commits not on origin/main*, *main is not on origin yet*, *up to date with origin/main*), and a push that cannot go says why instead of asking (*no remote to push to: git remote add origin <url>*, a detached HEAD, several remotes and none called origin); one the remote refuses says it in words (*origin has commits this branch does not: pull them first*, credentials refused, offline). After a commit the window **stays open when there is somewhere to push**, so commit then push is one visit, and closes when there is not. A change that is only review records (the sidecar beside the deck, REVIEW) gets its subject **from the records themselves, with no agent asked**: *review: resolve 1 comment*, *review: a comment on slide 2*, because that is a fact read off the diff and not a thing to make up; and the window **names the files that changed**, so a resolve reads as a line in `talk.review.jsonl`, never as a line in a deck that did not change. **While a subject is being drafted the window says so**, in the empty message box and on the button that asked: `thinking |`, the bar turning through `| / - \` with the seconds joining after two (slow dots under `prefers-reduced-motion`): ASCII, so it renders in every font a deck can be themed with, and moving, because a draft takes one second or twenty and a still window reads as a stuck 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; write mode ASKS first on a TTY ("no git repository here — create one so every version of the deck is kept?"). 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 and what rides its commits (the review sidecar, and the `.gitattributes` decklight wrote for it, REVIEW) are staged (`git add -- <deck> <sidecar>`), 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 by the click, not by a setting.** A diff of your deck goes to the agent CLI installed on this machine, and most of them pass what they are given on to their provider, so nothing is sent without a person asking. By default the commit window's **write them for me** is always there and asks only when pressed, and **its tooltip says, before it is pressed, where the changes go**: "Sends the deck's uncommitted changes to claude (Claude Code), the agent installed on this machine, which may pass them to its provider". The agent named is the one `describeWorking` would ask (`agentAsk`), carried in the commit state as `describer`. With no agent installed the button reads **write them for me — no agent** and says `decklight doctor` lists the ones it can use; a session started with **`--no-commit-messages`** reads **— off** and says so; neither asks the server anything. **`--commit-messages`** is the automatic level: the window drafts as it opens, and every subject decklight authors itself is written by the agent. Nothing is stored and nothing is asked at `init`: the setting is the command line's, and the button is the consent. (An earlier release asked at repository creation and stored the answer as `decklight.commit-messages` in git config; that key is no longer read.)
|
|
617
|
+
- **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). **The chip is also where the state of the work is read**: it is on screen, quietly, the whole time the deck differs from its last commit (*12 lines since the last commit — K commits*), led by the slides it changed, added and removed in the window's colours with a zero left out (*●1 changed ●1 added · 12 lines since the last commit — K commits*; a change that is only review records touches no slide and reads as before), so what has changed and how to keep it are answered without opening History, Commit or Restore; it is absent when nothing has changed or there is no git to write to. It turns into the ask (*12 lines uncommitted · 5m — K commits*, at full strength) 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, in lines and **in slides** (*3 slides: 1 changed, 1 added, 1 removed*, each count in its colour, amber, green and red, a zero dimmed; slides are matched against HEAD the way a diff matches lines, identical ones kept in order and, between two kept ones, an old and a new paired as one slide edited only when they share their heading or half their lines, so a slide swapped for a different one is one removed and one added, never an edit), a message box, and one button, with **⌘⏎ / ⌃⏎** to commit, the convention VS Code and every GUI client share; **✨ write it for me** asks the agent for the commits the uncommitted work makes (on a click, or the moment the window opens with `--commit-messages`) and it never overwrites what you have already typed, because a proposal that eats your sentence is not one. **The proposal is one commit or several** (`cli/commit-split.mjs`): the deck's diff against HEAD is cut into **units** at zero context, one per hunk, each named by the slides it touches (`slide 3`, `slides 3-4`; past 40 hunks, the hunks of one slide travel together), and the agent is asked to group them, one commit per separate idea, replying `<numbers> | <subject>` a line. Every unit lands in exactly one commit (one named twice stays with the first, one forgotten joins the commit of the unit before it), and an answer with nothing usable leaves the deck as one commit for the author to name. One commit fills the message box as before; several replace it with **a row per commit**, its subject editable and where it lands beside it, an **as one commit** button that sets the proposal aside (its first subject offered in the box), and **Commit all N**. **Each row has a tick**, on to start with: an unticked commit is left out (*Commit 2 of 3*, and nothing at all with none ticked), its units staying uncommitted in the working file while the ticked ones are built on HEAD without them, so a change not ready yet need not ride along with one that is. The plan is still normalised whole, so a unit the agent forgot joins its neighbour's commit and stays out with it when that one is unticked. What was left out comes back: the server re-cuts it against the new HEAD (a `-U0` hunk carries its own lines, so it is found again by its text) and the window stays open with those rows, their subjects kept, ready to commit then or later; when they cannot be matched the window offers *✨ write it again*. The review sidecar is never sent to the agent: its units are a commit of their own, the last, with the subject its records give (below). The commits are built in a **private index** (`read-tree`, `update-index`, `write-tree`, `commit-tree`), so what the author staged by hand stays staged and out of them; commit *k*'s deck is HEAD's deck with the units of the ticked commits 1..*k* applied, so with every row ticked the last one is the working file byte for byte; and the branch moves **once**, with `update-ref`'s old-value check, so all of them land or none does. A plan carries `base`, a fingerprint of HEAD and the work it was cut from: an edit that lands while the agent is thinking makes it a plan for other work, refused (`STALE`) with *✨ write it again*. `commit-tree` runs no hooks; the one-commit path still does. A first commit, with no HEAD to cut against, is one commit. **The window reads top to bottom in the order the work goes**: named for the branch (`git · main`), then three labelled sections, **commit**, **tag** and **push**, each ending in one button at the same right edge. Commit is the only filled button; *✨ write it for me* and *as one commit* sit on the message's own label line, where they act; every button is a real `<button>`, so `Enter` on Tag tags and on Push pushes, and only `Enter` elsewhere (or `⌘⏎`) commits. Push is off when there is nothing to send: no commit ahead, the branch already on the remote, and no tag it would carry. Below the commit, the two other sections, **so the window opens with nothing to commit too**: **Tag** puts an annotated tag (`git tag -a <name> -m <name>`) on HEAD, the name checked by `git check-ref-format` and refused when it starts with `-` or exists, and the tags already on HEAD named beside it; **Push** sends the branch and the annotated tags on what it sends (`git push --follow-tags`, or `git push --follow-tags -u <remote> <branch>` the first time), or the branch alone when **Settings… → Push tags** is off (then the tags on HEAD read `· not pushed` and the toast says they were kept here), on the click and only then, under `noPromptEnv` and a one-minute bound, turning `pushing |` while it goes. The row reads where the branch stands, from the same local read the four places below use (*↑3 commits not on origin/main*, *main is not on origin yet*, *up to date with origin/main*), and a push that cannot go says why instead of asking (*no remote to push to: git remote add origin <url>*, a detached HEAD, several remotes and none called origin); one the remote refuses says it in words (*origin has commits this branch does not: pull them first*, credentials refused, offline). After a commit the window **stays open when there is somewhere to push**, so commit then push is one visit, and closes when there is not. A change that is only review records (the sidecar beside the deck, REVIEW) gets its subject **from the records themselves, with no agent asked**: *review: resolve 1 comment*, *review: a comment on slide 2*, because that is a fact read off the diff and not a thing to make up; and the window **names the files that changed**, so a resolve reads as a line in `talk.review.jsonl`, never as a line in a deck that did not change. **While a subject is being drafted the window says so**, in the empty message box and on the button that asked: `thinking |`, the bar turning through `| / - \` with the seconds joining after two (slow dots under `prefers-reduced-motion`): ASCII, so it renders in every font a deck can be themed with, and moving, because a draft takes one second or twenty and a still window reads as a stuck 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; write mode ASKS first on a TTY ("no git repository here — create one so every version of the deck is kept?"). **A deck git has never seen stays out of history until K.** In a repository with commits, opening an untracked deck commits nothing: whether a deck is versioned is the author's call, so it stays untracked, the snapshot keeps it safe meanwhile (it needs a HEAD, not the deck in it), the chip counts it as uncommitted work, and the startup line says it is not in git and that `K` adds it. It used to be committed at startup on whichever branch was checked out, so a scratch deck opened in a repository landed on `main` before anyone pressed anything. Only a repository with no commits at all still gets the deck as its first commit, since there is no HEAD for a snapshot to parent on. 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 and what rides its commits (the review sidecar, and the `.gitattributes` decklight wrote for it, REVIEW) are staged (`git add -- <deck> <sidecar>`), 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 by the click, not by a setting.** A diff of your deck goes to the agent CLI installed on this machine, and most of them pass what they are given on to their provider, so nothing is sent without a person asking. By default the commit window's **✨ write it for me** is always there and asks only when pressed, and **its tooltip says, before it is pressed, where the changes go**: "Sends the deck's uncommitted changes to claude (Claude Code), the agent installed on this machine, which may pass them to its provider". The agent named is the one `describeWorking` would ask (`agentAsk`), carried in the commit state as `describer`. With no agent installed the button reads **✨ write it for me — no agent** and says `decklight doctor` lists the ones it can use; a session started with **`--no-commit-messages`** reads **— off** and says so; neither asks the server anything. **`--commit-messages`** is the automatic level: the window drafts as it opens, and every subject decklight authors itself is written by the agent. Nothing is stored and nothing is asked at `init`: the setting is the command line's, and the button is the consent. (An earlier release asked at repository creation and stored the answer as `decklight.commit-messages` in git config; that key is no longer read.)
|
|
617
618
|
|
|
618
619
|
**Unpushed work is named in four places, and none of them nags.** `decklight
|
|
619
620
|
history` and the `H` overlay show it when you go looking; write mode prints one
|
|
@@ -643,8 +644,8 @@ Authorship is **structural, not detected**: the server spawns the agent itself a
|
|
|
643
644
|
|
|
644
645
|
### PRESENTING_VOICE · The voice
|
|
645
646
|
|
|
646
|
-
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel: **off**, track, live voice, engine, tone, character, recording, captions, speed (persisted per deck). **The voice ends with the talk**: narration that runs past the last slide turns itself off and says so (`🔚 end of the talk — narration off`), instead of staying "on" in silence; and `⎵` where the live voice has nothing left to say (the last build of the last slide, its notes all spoken on earlier builds) says that (`nothing left to say — this is the end of the talk · ← goes back, Home starts over`) rather than switching the voice on into silence. **Narration is OFF until somebody picks**, however much audio the deck ships: a deck is opened to be read far more often than to be played, and defaulting to the first track made "chosen" indistinguishable from "shipped", the distinction every other decision here needs. `⎵` belongs to the voice only once a track is CHOSEN (in the panel, or restored from a previous visit, both deliberate) or the voice is already running or parked; a deck that merely carries a track keeps `⎵` for advancing, so a presenter talking over their own slides cannot start the narration by pressing it. The panel's first row is `🔇 Off`, current when nothing is chosen, and picking it stops the voice and hands `⎵` back. The choice is written as `off` rather than left implied, so a later change to what "no choice" means cannot start a deck talking that somebody switched off. Two entry points are themselves the choosing and select a track rather than refusing: `?voiceover`, where the url is the request, and the touch sound button, where a speaker icon has one meaning and the phone tapping it has no `V` key to be redirected to; neither persists, being a request for this visit rather than every future one. Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures **one track** as `narration: { files: '<dir>', ext, segments }` (`ext` defaults to `m4a`; this is the line `voiceover`, `record` and the deck's recorder all print) or **several** as `files: [{ label, dir, ext, segments }, …]`, the same fields once per track; the runtime and the edit server normalise the first to a one-item list of the second. **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 writes the folder's `manifest.json` after every slide (engine, model, voice, style, one entry per slide with the hash of the notes it was voiced from and its beat files, the shape `decklight narrate` writes, hashed by the same `tools/narration-manifest.mjs` from the deck file's notes, so an aborted take is a valid partial, `decklight video` and the export dialog take the folder as a track, and re-recording the same engine and voice refreshes that folder instead of minting `voices/<voice>-2`, #535). **Its done card says what the take cost** (#565): `N clips · R reused · S sent to <engine> · ~$X`, counted for THAT run and not the session: a clip already in the window (played, or warmed by the lookahead) and one the bridge replayed from its own disk cache (`x-tts-cached: 1`) are both *reused*, so `reused + sent` is every clip the take voiced, and the spend is what the bridge priced the sent ones at, `$0` on a free or offline engine rather than blank. Re-recording an edited slide into an existing track is the case it answers: nearly everything reused, and a bill only for what changed. The your-voice recorder voices nothing, so it shows no such line, and **the panel's `Record this deck…` records them in your own voice**, for which `decklight narrate --mic <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 the no-trust mode'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 edit server (`POST /deck/edit/narration/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 /deck/edit/narration/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 /deck/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 the undo chord 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 edit 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 narrate --mic --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`; the deck asks its own origin for `/tts`, which `open` proxies to the bridge it started, a deck never spells a port, and falls back to `http://127.0.0.1:8787/tts` when opened from disk; 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 `/tts/ping` and `/tts/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. The model is `eleven_v4` by default (`--tts-model eleven_v4_turbo`, `eleven_v3` or `eleven_multilingual_v2` otherwise; a track keeps the model it was voiced with, so the default moving re-voices nothing). Style reaches it only on a tag model, v3 or v4 (`stylable` and `audioTags` follow the model chosen, not just the engine): it 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. In the notes themselves, `[click]` is decklight's marker on every engine, never sent; `[pause]` and `[long pause]` are sent to a tag model as those tags, where the voice holds them itself, and held by decklight for every other voice (DECK_ANATOMY); any other bracketed tag reaches a tag model as written and is taken out for every other voice. 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 /tts/engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing. **Voices by language** (ElevenLabs): the bridge reports the languages each account voice speaks, what ElevenLabs verified it for and what its labels name (`voiceLangs`), as the roster's fourth element, `[name, flavor, group, langs]`, shown after the flavor (`cloned · en fr`) and matched by the filter's `lang:` term. The voices view carries a **🌐 Language** row (the same `lang:` term, chosen from a list: the deck's language first, then what your voices speak with a count each, then the languages ElevenLabs speaks), and **opens on the deck's own language** (`<html lang>`, once per open, never English) because a deck translated to Spanish wants a Spanish voice. The account's voices are mostly English, so the view ends with **🔎 Find <language> voices in the ElevenLabs library…**: `GET /tts/voices/library?language=&search=` (the bridge asks `/v1/shared-voices`; free, changes nothing), each voice with ElevenLabs' own sample on ▶ (played as hosted, no synthesis). The first ⏎ on one ARMS it ("⏎ again adds “Mateo” to your ElevenLabs voices — it uses one of your plan's voice slots"); the second is `POST /tts/voices/library/add { engine, owner, id, name }` (`/v1/voices/add/{owner}/{id}`), the one call that changes the account; the roster is fetched afresh and the voice picked like any other. A plan with no free slot says so; any other engine answers 404 "has no voice library — ElevenLabs does". **The choice belongs to the tab, not the bridge**: one bridge serves every open tab (a deck, its speaker view, a second deck) so the bridge holds every engine it is asked for side by side, built once, and each tab names its engine on every request (`GET /tts/ping?engine=`, `/tts/voices?engine=`, `/tts/engines?engine=` marks that tab's engine current, `POST /tts { …, engine }`). A deck restores the engine its saved live voice was picked on by asking for it by name, and picking another in the picker does the same; neither switches anything for another tab. (They used to switch the bridge itself, and a second tab restoring its own engine on load silently took the voice from the first.) An engine this machine cannot run is refused with its blocker (409), and the deck speaks with the bridge's default and says so. A request naming no engine gets the default, the one the bridge started with; `POST /engine {engine}` still moves that default, for decks built before `?engine=`. 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. It is drawn as a **bar at the top of the voices card**, above the filter: `ENGINE elevenlabs eleven_v4 … change engine ›`, the model named only where it is a real choice (ElevenLabs, Gemini, Chirp; for say, SAPI and piper it is merely the default voice), so the one control that decides every voice below it is not one more line among them; it is still the first row, so ↑/↓ and ⏎ reach it. The engines view lists the **ready** engines first, then the ones that **need setup**, each group under its own heading with its one-line fix, and the V panel's *Live voice* row names the engine and voice in use. **The readiness check is shared with write mode** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs (a picker offering an engine `open` 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. **Synthesis is cached on disk, for every engine including the paid ones** (`$XDG_CACHE_HOME/decklight/tts`, oldest dropped past 400 MB, `--no-cache` to opt out). The key is `(engine, model, format, voice, style, text)` and it is one function shared by the bridge and `decklight narrate` (`clipKey`, tools/tts-cache.mjs), because those are separate processes and a deck previewed sentence by sentence in the browser and then batch-recorded was billed twice for identical words. The **model** is in the key, which is what makes caching a cloud engine safe rather than reckless: a server that changes its model underneath us produces a MISS, not a stale clip filed under today's name. **Style is in the key only when the engine can act on it**: every engine but gemini and ElevenLabs v3 ignores a delivery instruction, the deck usually sends none and the CLI defaults to a paragraph, so keying on a style nobody read would make identical audio hash two ways and miss every clip. `voiceover`'s manifest hash is that same key, shortened, so the folder-level skip and the content-level cache cannot disagree about whether a slide changed. **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 deck remembers the engine with its live voice**, and nothing else does: a voice name only means something on the engine it came from, so the deck's saved live voice carries its engine, and the next session's probe asks the bridge for that engine before it reads the roster: a bridge restarted on its default engine would otherwise find the saved voice missing and replace it. A saved engine the bridge refuses (the key is gone, the model deleted) is said out loud and the deck speaks with what the bridge has. `tts.json` is still never written from the deck: it is what the CLI and the wizard write and what the next write-mode start uses for *every* deck, and an experiment two minutes before a talk must not quietly become every deck's default. 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, write mode 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. **macOS 27** changed the listing twice over, and the roster reads it as it is: a plain voice now carries its language (`Daniel (English (UK))`, `Samantha (English (US))`), so a plain twin of `Daniel (Enhanced)` is recognised by its **base name**, under both a quality marker and a language pair, rather than its whole name, which let every one of them through; and some voices are printed twice, line for line, and are offered once (a Siri voice under a plain voice's name differs by its sample, so it is not a repeat and stays the rule above's to drop). Names keep their suffix in the picker, because the suffix selects a different build: `say -v Daniel` speaks the Enhanced one. The bridge still accepts a voice by its **bare name** (`Samantha`), which `say -v` answers to, so a deck that saved one, or a track recorded as one, keeps working on a Mac whose listing grew the suffix; a name with no voice under it is still refused rather than quietly swapped for the system default. 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. **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. write mode 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. **Setup** (`decklight setup voice`; a bare `decklight tts` that cannot start runs it too, on a terminal): **write mode asks nothing at startup**: with no voice configured, or a piper model not yet downloaded, the banner's skip row names `decklight setup voice`, and the deck's `V` panel says the same, because the deck never collects a key or a project. The setup asks a few plain questions on the terminal 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 `decklight <deck>` reads from then on (as does the bridge run alone); precedence is flags > environment > saved config > built-in default. `decklight setup voice` 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, opening the deck with `decklight <deck>` 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 `/tts/ping` reports as `stylable` (six presets or a custom typed instruction: a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs v3 and v4). 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. **`⟨PAUSE⟩` anywhere in the notes** (#560) is a let-it-sink-in hold at that spot: **two beat pauses** (1s by default), so it follows the slide's `data-narration-beat-pause` and the deck's `narration.beatPause`, and a slide that zeroes the one zeroes the other. It is never spoken, captioned, subtitled or written to PowerPoint notes. It belongs to the words before it (between sentences, attached to one, or on a line of its own) except that one before any words of a ⟨CLICK⟩ beat holds after that build lands, so `A. ⟨PAUSE⟩ ⟨CLICK⟩ B.` holds then reveals and `A. ⟨CLICK⟩ ⟨PAUSE⟩ B.` reveals then holds. Mid-sentence, it cuts the sentence there, and several in a row hold that many times. The live voice holds it between clips. Because it sits *inside* a beat, where recorded playback has no seam to hold at, every recording **bakes it in** as silence: the deck's recorder (WAV and viseme sidecar alike), and the synthesis core, which voices the words on either side as separate clips and joins them (a clip in anything but WAV needs ffmpeg to decode). A narrated video therefore gets it from the audio's measured length, and a silent frame adds it to its hold itself. The marker's position is part of the text a slide's hash is taken over, so adding or moving one makes a recorded slide stale and the export re-voices it. A slide with no marker hashes exactly as it did before markers existed, and a change of pause *length* does not stale a take, just as a changed `sentencePause` does not. The `.txt` script beside a clip keeps its markers, since they are part of what was recorded; lip-sync hands Rhubarb the words alone, and subtitles leave each hold uncaptioned. A beat of nothing but `⟨PAUSE⟩` has no take of its own: live it holds instead of the usual short silent beat, and the recorders give it no file. **`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 write mode each stitched slide is POSTed to the server that already owns the deck file (`/deck/edit/narration/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 <deck> --no-trust`. The player names the folder and never the file: `/deck/edit/narration/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. **`⎵` pauses/resumes** narration while it plays: 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), in a render (`?capture`, below), on a load the URL sent past the first build of the first slide (a link into the middle of a talk is somebody presenting, not a first view, the rule the welcome card keeps), 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 narrate <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 panel's `Record this deck…`: the notes, voiced as written, by `--engine piper` (local neural TTS; `--voice` = piper model name), `chirp`, `gemini` or `elevenlabs`. **One synthesis core produces every machine-voiced track** (`tools/narration-synth.mjs`, #555): `voiceover` is its command line, and the export that voices a range before rendering goes through it too, so a track made by one can be refreshed by another. It owns sentence synthesis through the shared clip cache, the ⟨CLICK⟩ beat files, stitching a slide from its beats, encoding, and the skip-by-hash that makes a rerun free; `tools/narration-manifest.mjs` (what a slide's text and hash are) and `tools/tts-cache.mjs` (has anyone paid for these words) stay the identity layer beside it. **A track keeps its format**: `wav`, `m4a` or `mp3`, read off its files: a track the deck's recorder made is wav, and refreshing one of its slides writes wav, where `voiceover` used to write m4a beside it, re-voiced in piper; a fresh track is m4a unless `--format` says otherwise, and wav is written directly, with no encoder. **A folder that already holds a track is refreshed AS that track**: its engine, voice, style and (for ElevenLabs and Gemini) model are the defaults, a flag overrides each, and a header field the core does not own (the recorder's `recorder: 'deck'`) is carried. A slide whose hash still matches and whose file (in the track's format) is on disk is kept, whoever made it. A **`--slides` run in another voice is refused** (a header names one voice, and the slides outside the range would read as stale against it), with the way out: voice the whole track, or give the other voice its own folder. The microphone recorder is untouched: a human voice is the browser's. The built-in speech-synthesis voices were removed: not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
647
|
-
- **Enhance the script** (`decklight enhance deck.html --slides <n|a-b|a,b> | --all [--dry-run] [--agent <name>]`; in write mode also `V` → *Enhance the script — ElevenLabs audio tags…* → this slide / every slide with notes, and the two `/` palette rows *Enhance this slide's / every slide's voiceover script…*; and **✨ add audio tags** in the notes editor, which enhances the text IN THE BOX, unsaved edits included, through `POST /deck/edit/enhance/text { text }` and puts the checked answer back in the box to read, edit and save with ⌘⏎, writing nothing itself; its tooltip names the agent and says the text goes to it): adds the audio tags ElevenLabs v4 performs (`[thoughtful]`, `[sighs]`, `[excited]`, DECK_ANATOMY) to the speaker notes. The prompt is **ElevenLabs' own**, the one its [best practices](https://elevenlabs.io/docs/overview/capabilities/text-to-speech/best-practices#prompting-eleven-v4) publish for having an LLM enhance a script, verbatim (`cli/enhance.mjs`), plus a short decklight addendum: one narrator, keep every `[click]` on its own line and every `[pause]`, keep the line breaks, answer with the script only. The **locally installed agent** answers it with the same read-only argv the commit subjects use (one ask per slide, three at a time, two minutes each) and is never let near the file. **Decklight writes, and only what passes a check**: after tags, markers, case and punctuation are set aside the words must be the same words in the same order (the prompt allows only tags, capitals, `!`, `?` and `…`), the `[click]` beats the same count, and no beat may lose a `[pause]` (adding `[short pause]` / `[long pause]` is allowed). A slide whose answer fails is left exactly as it was and the result says why; the paragraphs stay a blank line apart. In write mode the run is `POST /deck/edit/enhance { slides: [n…] | 'all' }` (409 while another enhance or an agent edit runs; 400 naming what is missing with no agent; 422 with no notes to enhance), progress rides SSE `enhance` events into one rewriting row, and the answers land in **one** edit against the deck as it is when the run ends: a slide edited meanwhile keeps the edit, so the undo chord takes the whole run back; the closing line (*enhanced 3 slides — Z undoes · slide 5 left as it was: …*) is said again after the reload the write causes. The notes are sent to that agent, and most agents are cloud services; the CLI's help says so. **Written for the ear** (`--spoken`; V → *🗣 Write the script for the ear…*; palette *Write this slide's / this module's / every slide's notes for the ear*; the notes editor's *🗣 write it for the ear*): the other rewrite, with its own prompt (`SPOKEN_PROMPT`, cli/enhance.mjs): terse, written-style notes turned into sentences a person would say out loud ("Fluffed a line? Backspace retakes it." → "And if you fluff a line, just press Backspace to take it again."), every fact kept, nothing added, symbols said as words, about as long as it was. It REWORDS, so its check is not "same words": the same `[click]` beats (the builds), no `[pause]` lost, no beat emptied, and a length between half and two and a half times the original: an answer outside that is commentary or a dropped point, and the slide is left as it was. **Every rewrite offers three scopes**: this slide, this slide's **module** (the `data-module` chapter it is in, DECK_ANATOMY, offered only when there is one), or every slide with notes. In the notes editor ✨ and 🗣 each ask which first: *this slide* lands in the box to read and ⌘⏎-save (nothing is written by pressing it); a module or the deck is rewritten in the file in one edit, which Z takes back: refused, with a sentence, while the box holds unsaved edits. **⌘⏎ saves the notes editor from wherever the focus is** while it is up: the box, a button in it, its background, or (docked) the slide beside it. A save that silently did nothing, with the text still in the box, read as a save (#646). A typing box of its own (the agent ask, the commit window, the content editor) keeps its own ⌘⏎, and the read-only card (`--no-trust`, `--no-trust`) has no save to reach. **A save does not reload the page**: the notes came from the page, so `POST /deck/edit/slide/notes` writes quietly (the watcher skips the reload for exactly those bytes) and broadcasts the slide's new notes as a `notes` event. Every open view of the deck puts them in place: narration and captions read the new text, the speaker view re-reads it, and a notes card open on that slide in another tab follows them unless it holds edits of its own. The page that saved keeps its card exactly as it was, caret and scroll included, and its own echo (`from` names the page) leaves the box as typed rather than as the file normalised it. Any other change to the file (an undo, an agent's edit, an editor's save) still reloads. Should a save's write reload anyway, the card is reopened on that slide with the caret and the scroll restored, docked or floating as it was, from a record kept in sessionStorage for a minute; Esc or × leaves none, so a card closed on purpose stays closed. **● unsaved** sits beside the heading, at full strength while the heading is dimmed, whenever the box differs from the file; it reads **saving…** while the request is in flight and clears once the box matches the file (a save that wrote, or one that had nothing to write). A failed save leaves it up. **Reset, and
|
|
647
|
+
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel: **off**, track, live voice, engine, tone, character, recording, captions, speed (persisted per deck). **The voice ends with the talk**: narration that runs past the last slide turns itself off and says so (`🔚 end of the talk — narration off`), instead of staying "on" in silence; and `⎵` where the live voice has nothing left to say (the last build of the last slide, its notes all spoken on earlier builds) says that (`nothing left to say — this is the end of the talk · ← goes back, Home starts over`) rather than switching the voice on into silence. **Narration is OFF until somebody picks**, however much audio the deck ships: a deck is opened to be read far more often than to be played, and defaulting to the first track made "chosen" indistinguishable from "shipped", the distinction every other decision here needs. `⎵` belongs to the voice only once a track is CHOSEN (in the panel, or restored from a previous visit, both deliberate) or the voice is already running or parked; a deck that merely carries a track keeps `⎵` for advancing, so a presenter talking over their own slides cannot start the narration by pressing it. The panel's first row is `🔇 Off`, current when nothing is chosen, and picking it stops the voice and hands `⎵` back. The choice is written as `off` rather than left implied, so a later change to what "no choice" means cannot start a deck talking that somebody switched off. Two entry points are themselves the choosing and select a track rather than refusing: `?voiceover`, where the url is the request, and the touch sound button, where a speaker icon has one meaning and the phone tapping it has no `V` key to be redirected to; neither persists, being a request for this visit rather than every future one. Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures **one track** as `narration: { files: '<dir>', ext, segments }` (`ext` defaults to `m4a`; this is the line `voiceover`, `record` and the deck's recorder all print) or **several** as `files: [{ label, dir, ext, segments }, …]`, the same fields once per track; the runtime and the edit server normalise the first to a one-item list of the second. **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 writes the folder's `manifest.json` after every slide (engine, model, voice, style, one entry per slide with the hash of the notes it was voiced from and its beat files, the shape `decklight narrate` writes, hashed by the same `tools/narration-manifest.mjs` from the deck file's notes, so an aborted take is a valid partial, `decklight video` and the export dialog take the folder as a track, and re-recording the same engine and voice refreshes that folder instead of minting `voices/<voice>-2`, #535). **Its done card says what the take cost** (#565): `N clips · R reused · S sent to <engine> · ~$X`, counted for THAT run and not the session: a clip already in the window (played, or warmed by the lookahead) and one the bridge replayed from its own disk cache (`x-tts-cached: 1`) are both *reused*, so `reused + sent` is every clip the take voiced, and the spend is what the bridge priced the sent ones at, `$0` on a free or offline engine rather than blank. Re-recording an edited slide into an existing track is the case it answers: nearly everything reused, and a bill only for what changed. The your-voice recorder voices nothing, so it shows no such line, and **the panel's `Record this deck…` records them in your own voice**, for which `decklight narrate --mic <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. With `--remote` the phone's next and retake do the same (Phone remote, above), for a take with no keyboard in it. **A take is a slide, or a beat**: the plan card's **take** choice (under **How**, remembered with the microphone's, and `narrate --mic --takes slide|beat`, `?takes=`, for one visit until the card is clicked). **Per slide**, the default, a slide is read straight through: `→` reveals the next build and cuts the beat file there while the recording runs on, so nothing said across the key is lost and nothing stops between beats; the card shows the rest of the slide's beats under the one on screen, `⌫` retakes the whole slide from its first beat, and `←` goes to the slide before. **The recording card** keeps the words you read as the largest thing on it; around them, in order: a strip with the red REC dot and the take's running clock (the count-in in their place before a take), `slide N · beat k of M`, and the level meter, so a muted microphone shows as a flat bar beside the words rather than under them; a bar across the slides of this take; the beats already read, ticked off and dimmed above the one on screen with the moment `→` cut them (`[click] · you pressed → at 0:09`, per slide); the beats still to come under it with the `[click]` divider where `→` will cut; and a legend of the keys whose wording does not change mid-take, swapped for the count-in's own (`←`, `Esc`, and that the key pressed is not in the take) while it counts. **Per beat**, each beat is its own take, counted in and retaken on its own. The files are the same either way. **Every take is counted in**: 3, 2, 1 on the card before each take, so per slide before a slide's first beat only (after Enter, `→`, `⌫` or `←`), and nothing is captured while it counts, so the keystroke is not in the take. The length is the plan card's **count-in** (under **How**; 3 s, the default, 1 s, or off, remembered with the microphone's choices), and `narrate --mic --countdown N` (`?countdown=N`, 0 to 9) sets it for one visit until the card is clicked; off starts the take on the key, as before the count-in existed; a red REC dot replaces the count once it runs. `→` and `⌫` wait for the take to start. **`←` goes back**: per beat, mid-slide to the slide's first beat (its takes are only written when the slide is done, so they are dropped), and on a first beat to the slide before, which is recorded again over its own files; the done card counts a slide recorded twice once. **The plan card**, the recorder's first, asks what to record, how, and where, in that order, and checks the microphone before Start. **What to record** is a row of scopes — **Whole deck**, **Only missing or changed · N** (offered when the folder already holds a take of yours with something missing or out of step), **This slide**, and **Slides…**, which opens the range picker — over a list of every slide with its title, its beat count and what the folder holds for it: recorded, not recorded, the notes or the [click] split moved since it was recorded (the server's drift, below), builds with no [click] in the notes to pace them (said here, before the take, rather than slide by slide during it), or no notes · skipped; a click on a slide starts the take there, and a line under the list estimates the reading (`N slides · N beats · about N min`). **How** holds the take, count-in, noise-suppression and sample-rate choices behind one summary line (`One take per slide · 3 s count-in · noise suppression on · 24 kHz`), each with its reason once opened. **Where** is the folder, as a sentence with the field in it and what a take of yours already there means (the slides recorded again replaced, the rest kept). **Microphone** shows the level live from the moment the card opens, with the input picked from the inputs the browser lists (remembered with the microphone's other choices and asked for, never demanded, so an unplugged one falls back), so a muted microphone is found before the first slide rather than after it; a microphone that will not open says why on that row, and Start says it again. The microphone's two choices are remembered for every deck rather than per deck since they are about the microphone and the room: **noise suppression** on (the default) or off, and **24 kHz** (the default, like every engine) or **48 kHz**, about 5.8 MB a minute instead of 2.8 with nothing above 12 kHz thrown away. Echo cancellation and auto gain stay on either way. A bundle that re-encodes audio still resamples to 24 kHz; `original` keeps the take as recorded. `⌫` retakes the beat just read (per slide, the slide), `Esc` stops (every slide already finished is already written). **`E` edits the words** where they fail aloud, a sentence that does not read or a missing "and": during a take or its count-in, it drops the take and puts the beat on screen into a box (markers as the author writes them, `[pause]`), and `Enter` writes them to the deck's notes through the notes card's own route (`⇧Enter` a new line, `Esc` back unchanged), so the file, every open view and the manifest's hash have the new words, then the beat is recorded again, counted in; per slide, the beats before it are kept. Words only: a `[click]` typed into the box would move a build the takes cannot follow, and an emptied beat is no beat, so both are refused on the card with the reason. Offered only with the server behind the deck, which writes the notes. 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 the no-trust mode'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 edit server (`POST /deck/edit/narration/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 plan 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. **Your own voice is `voices/me`**: after `--dir`, no other rule applies, and recording again refreshes that folder rather than proposing `voices/me-2`. The deck's configured folder is not used for it, because that folder is usually an engine's track, and a take of yours written into it replaced the engine's files. `GET /deck/edit/narration/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 /deck/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 the undo chord 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 edit server → the card prints the line, as before). **The done card is a review, not a receipt**: under `N slides · N files · 9 min 12 s · saved next to the deck in voices/me/` (and, stopped early, how many slides were not reached and are left as they were), one row per slide recorded this run with its title, its length, what happened to it (recorded again with the last take kept, or builds with no [click] to pace them), a `▶` that plays the whole-slide file the server just wrote back, and a `redo` that reopens the plan card on that slide; then the offer, **Use my voice in this deck**, in its own box with what it does (one edit to the deck file, which the undo chord takes back); then **Record again from a slide…**, which reopens the plan card; and the config line for a deck edited by hand behind a disclosure (`Editing the deck by hand instead? The line to add`), rather than in the way. 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 narrate --mic --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. **Part of a slide** is the finer grain: `--slides N --beats k-l` (refused unless `--slides` names one slide; a beat the slide does not have is refused on the card with the slide's count, and nothing starts) re-records only those beats, and the plan card (a click on a slide, or its **start at** row: `‹ ›`, or `←` `→` before Enter) starts the take at any beat of any slide in the range, and the row's **to beat** stepper (`‹ ›`, or `⇧←` `⇧→`) ends it at any later beat of that slide: the beats after it are kept, the take stops there, and the chosen beats' opening words are listed under the row so the pick can be checked against the notes; left at the slide's last beat, the take runs on into the slides after it, as a start point alone does. Entering a slide past its first beat, or by `--beats`, records it in part: its beat files are read back first, every one of them since the whole-slide file is rebuilt from all of them (a beat with no file, or beats at two rates, is refused and the card says to record the slide from beat 1), the microphone opens at their rate whatever the card chose, and each new beat is written as it is taken with `slide-NN.wav` rebuilt around it (per slide, the beats of the take are written together when it ends, since a write mid-take would stall the capture). So the beats not redone are never written, and Esc partway leaves the slide consistent. Per beat, `←` inside it goes back to the first beat redone, and `--beats` stops after its last beat. **Your own voice keeps its script** (#850): after each slide the recorder posts the folder's manifest with `mine: true`, which needs no engine; the server writes `recorder: 'mic'`, the notes hash `decklight video` checks, and each slide's `beats` as they read when it was taken (`slideBeats`). A folder recorded before this is seeded from the files already in it (`folderNarration`), so writing slide 6's entry never hides slides 1 to 5 from a render. `scriptDrift` compares a slide's recorded beats with its notes now: in step, **the words changed**, or **only the [click] split moved** (`was`/`now` beat counts), which matters for a take and not for an engine. A recorded beat is cut where you pressed `→`, so moving the marker cannot move the build, and the only fix is to read those beats again. The tracks route reports each track's `drift`. The V panel marks a track's row (`build split changed — re-record slide 6`) and, on a slide that drifted, says why above the rows with the command that fixes it. `decklight narrate <deck> --check [--dir NAME]` says the same for every track beside the deck and exits 1 when anything is out of step. A slide with no recorded script, and a folder with no manifest at all, is unknown and never flagged. 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`; the deck asks its own origin for `/tts`, which `open` proxies to the bridge it started, a deck never spells a port, and falls back to `http://127.0.0.1:8787/tts` when opened from disk; 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 `/tts/ping` and `/tts/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. The model is `eleven_v4` by default (`--tts-model eleven_v4_turbo`, `eleven_v3` or `eleven_multilingual_v2` otherwise; a track keeps the model it was voiced with, so the default moving re-voices nothing). Style reaches it only on a tag model, v3 or v4 (`stylable` and `audioTags` follow the model chosen, not just the engine): it 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. In the notes themselves, `[click]` is decklight's marker on every engine, never sent; `[pause]` and `[long pause]` are sent to a tag model as those tags, where the voice holds them itself, and held by decklight for every other voice (DECK_ANATOMY); any other bracketed tag reaches a tag model as written and is taken out for every other voice. 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 /tts/engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing. **Voices by language** (ElevenLabs): the bridge reports the languages each account voice speaks, what ElevenLabs verified it for and what its labels name (`voiceLangs`), as the roster's fourth element, `[name, flavor, group, langs]`, shown after the flavor (`cloned · en fr`) and matched by the filter's `lang:` term. The voices view carries a **🌐 Language** row (the same `lang:` term, chosen from a list: the deck's language first, then what your voices speak with a count each, then the languages ElevenLabs speaks), and **opens on the deck's own language** (`<html lang>`, once per open, never English) because a deck translated to Spanish wants a Spanish voice. The account's voices are mostly English, so the view ends with **🔎 Find <language> voices in the ElevenLabs library…**: `GET /tts/voices/library?language=&search=` (the bridge asks `/v1/shared-voices`; free, changes nothing), each voice with ElevenLabs' own sample on ▶ (played as hosted, no synthesis). The first ⏎ on one ARMS it ("⏎ again adds “Mateo” to your ElevenLabs voices — it uses one of your plan's voice slots"); the second is `POST /tts/voices/library/add { engine, owner, id, name }` (`/v1/voices/add/{owner}/{id}`), the one call that changes the account; the roster is fetched afresh and the voice picked like any other. A plan with no free slot says so; any other engine answers 404 "has no voice library — ElevenLabs does". **The choice belongs to the tab, not the bridge**: one bridge serves every open tab (a deck, its speaker view, a second deck) so the bridge holds every engine it is asked for side by side, built once, and each tab names its engine on every request (`GET /tts/ping?engine=`, `/tts/voices?engine=`, `/tts/engines?engine=` marks that tab's engine current, `POST /tts { …, engine }`). A deck restores the engine its saved live voice was picked on by asking for it by name, and picking another in the picker does the same; neither switches anything for another tab. (They used to switch the bridge itself, and a second tab restoring its own engine on load silently took the voice from the first.) An engine this machine cannot run is refused with its blocker (409), and the deck speaks with the bridge's default and says so. A request naming no engine gets the default, the one the bridge started with; `POST /engine {engine}` still moves that default, for decks built before `?engine=`. 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. It is drawn as a **bar at the top of the voices card**, above the filter: `ENGINE elevenlabs eleven_v4 … change engine ›`, the model named only where it is a real choice (ElevenLabs, Gemini, Chirp; for say, SAPI and piper it is merely the default voice), so the one control that decides every voice below it is not one more line among them; it is still the first row, so ↑/↓ and ⏎ reach it. The engines view lists the **ready** engines first, then the ones that **need setup**, each group under its own heading with its one-line fix, and the V panel's *Live voice* row names the engine and voice in use. **The readiness check is shared with write mode** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs (a picker offering an engine `open` 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. **Synthesis is cached on disk, for every engine including the paid ones** (`$XDG_CACHE_HOME/decklight/tts`, oldest dropped past 400 MB, `--no-cache` to opt out). The key is `(engine, model, format, voice, style, text)` and it is one function shared by the bridge and `decklight narrate` (`clipKey`, tools/tts-cache.mjs), because those are separate processes and a deck previewed sentence by sentence in the browser and then batch-recorded was billed twice for identical words. The **model** is in the key, which is what makes caching a cloud engine safe rather than reckless: a server that changes its model underneath us produces a MISS, not a stale clip filed under today's name. **Style is in the key only when the engine can act on it**: every engine but gemini and ElevenLabs v3 ignores a delivery instruction, the deck usually sends none and the CLI defaults to a paragraph, so keying on a style nobody read would make identical audio hash two ways and miss every clip. `voiceover`'s manifest hash is that same key, shortened, so the folder-level skip and the content-level cache cannot disagree about whether a slide changed. **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 deck remembers the engine with its live voice**, and nothing else does: a voice name only means something on the engine it came from, so the deck's saved live voice carries its engine, and the next session's probe asks the bridge for that engine before it reads the roster: a bridge restarted on its default engine would otherwise find the saved voice missing and replace it. A saved engine the bridge refuses (the key is gone, the model deleted) is said out loud and the deck speaks with what the bridge has. `tts.json` is still never written from the deck: it is what the CLI and the wizard write and what the next write-mode start uses for *every* deck, and an experiment two minutes before a talk must not quietly become every deck's default. 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, write mode 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. **macOS 27** changed the listing twice over, and the roster reads it as it is: a plain voice now carries its language (`Daniel (English (UK))`, `Samantha (English (US))`), so a plain twin of `Daniel (Enhanced)` is recognised by its **base name**, under both a quality marker and a language pair, rather than its whole name, which let every one of them through; and some voices are printed twice, line for line, and are offered once (a Siri voice under a plain voice's name differs by its sample, so it is not a repeat and stays the rule above's to drop). Names keep their suffix in the picker, because the suffix selects a different build: `say -v Daniel` speaks the Enhanced one. The bridge still accepts a voice by its **bare name** (`Samantha`), which `say -v` answers to, so a deck that saved one, or a track recorded as one, keeps working on a Mac whose listing grew the suffix; a name with no voice under it is still refused rather than quietly swapped for the system default. 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. **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. write mode 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. **Setup** (`decklight setup voice`; a bare `decklight tts` that cannot start runs it too, on a terminal): **write mode asks nothing at startup**: with no voice configured, or a piper model not yet downloaded, the banner's skip row names `decklight setup voice`, and the deck's `V` panel says the same, because the deck never collects a key or a project. The setup asks a few plain questions on the terminal 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 `decklight <deck>` reads from then on (as does the bridge run alone); precedence is flags > environment > saved config > built-in default. `decklight setup voice` 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, opening the deck with `decklight <deck>` 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 `/tts/ping` reports as `stylable` (six presets or a custom typed instruction: a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs v3 and v4). 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. **`⟨PAUSE⟩` anywhere in the notes** (#560) is a let-it-sink-in hold at that spot: **two beat pauses** (1s by default), so it follows the slide's `data-narration-beat-pause` and the deck's `narration.beatPause`, and a slide that zeroes the one zeroes the other. It is never spoken, captioned, subtitled or written to PowerPoint notes. It belongs to the words before it (between sentences, attached to one, or on a line of its own) except that one before any words of a ⟨CLICK⟩ beat holds after that build lands, so `A. ⟨PAUSE⟩ ⟨CLICK⟩ B.` holds then reveals and `A. ⟨CLICK⟩ ⟨PAUSE⟩ B.` reveals then holds. Mid-sentence, it cuts the sentence there, and several in a row hold that many times. The live voice holds it between clips. Because it sits *inside* a beat, where recorded playback has no seam to hold at, every recording **bakes it in** as silence: the deck's recorder (WAV and viseme sidecar alike), and the synthesis core, which voices the words on either side as separate clips and joins them (a clip in anything but WAV needs ffmpeg to decode). A narrated video therefore gets it from the audio's measured length, and a silent frame adds it to its hold itself. The marker's position is part of the text a slide's hash is taken over, so adding or moving one makes a recorded slide stale and the export re-voices it. A slide with no marker hashes exactly as it did before markers existed, and a change of pause *length* does not stale a take, just as a changed `sentencePause` does not. The `.txt` script beside a clip keeps its markers, since they are part of what was recorded; lip-sync hands Rhubarb the words alone, and subtitles leave each hold uncaptioned. A beat of nothing but `⟨PAUSE⟩` has no take of its own: live it holds instead of the usual short silent beat, and the recorders give it no file. **`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 write mode each stitched slide is POSTed to the server that already owns the deck file (`/deck/edit/narration/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 <deck> --no-trust`. The player names the folder and never the file: `/deck/edit/narration/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. **`⎵` pauses/resumes** narration while it plays: 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), in a render (`?capture`, below), on a load the URL sent past the first build of the first slide (a link into the middle of a talk is somebody presenting, not a first view, the rule the welcome card keeps), 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 narrate <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 panel's `Record this deck…`: the notes, voiced as written, by `--engine piper` (local neural TTS; `--voice` = piper model name), `chirp`, `gemini` or `elevenlabs`. **One synthesis core produces every machine-voiced track** (`tools/narration-synth.mjs`, #555): `voiceover` is its command line, and the export that voices a range before rendering goes through it too, so a track made by one can be refreshed by another. It owns sentence synthesis through the shared clip cache, the ⟨CLICK⟩ beat files, stitching a slide from its beats, encoding, and the skip-by-hash that makes a rerun free; `tools/narration-manifest.mjs` (what a slide's text and hash are) and `tools/tts-cache.mjs` (has anyone paid for these words) stay the identity layer beside it. **A track keeps its format**: `wav`, `m4a` or `mp3`, read off its files: a track the deck's recorder made is wav, and refreshing one of its slides writes wav, where `voiceover` used to write m4a beside it, re-voiced in piper; a fresh track is m4a unless `--format` says otherwise, and wav is written directly, with no encoder. **A folder that already holds a track is refreshed AS that track**: its engine, voice, style and (for ElevenLabs and Gemini) model are the defaults, a flag overrides each, and a header field the core does not own (the recorder's `recorder: 'deck'`) is carried. A slide whose hash still matches and whose file (in the track's format) is on disk is kept, whoever made it. A **`--slides` run in another voice is refused** (a header names one voice, and the slides outside the range would read as stale against it), with the way out: voice the whole track, or give the other voice its own folder. The microphone recorder is untouched: a human voice is the browser's. The built-in speech-synthesis voices were removed: not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
648
|
+
- **Enhance the script** (`decklight enhance deck.html --slides <n|a-b|a,b> | --all [--dry-run] [--agent <name>]`; in write mode also `V` → *Enhance the script — ElevenLabs audio tags…* → this slide / every slide with notes, and the two `/` palette rows *Enhance this slide's / every slide's voiceover script…*; and **✨ add audio tags** in the notes editor, which enhances the text IN THE BOX, unsaved edits included, through `POST /deck/edit/enhance/text { text }` and puts the checked answer back in the box to read, edit and save with ⌘⏎, writing nothing itself; its tooltip names the agent and says the text goes to it): adds the audio tags ElevenLabs v4 performs (`[thoughtful]`, `[sighs]`, `[excited]`, DECK_ANATOMY) to the speaker notes. The prompt is **ElevenLabs' own**, the one its [best practices](https://elevenlabs.io/docs/overview/capabilities/text-to-speech/best-practices#prompting-eleven-v4) publish for having an LLM enhance a script, verbatim (`cli/enhance.mjs`), plus a short decklight addendum: one narrator, keep every `[click]` on its own line and every `[pause]`, keep the line breaks, answer with the script only. The **locally installed agent** answers it with the same read-only argv the commit subjects use (one ask per slide, three at a time, two minutes each) and is never let near the file. **Decklight writes, and only what passes a check**: after tags, markers, case and punctuation are set aside the words must be the same words in the same order (the prompt allows only tags, capitals, `!`, `?` and `…`), the `[click]` beats the same count, and no beat may lose a `[pause]` (adding `[short pause]` / `[long pause]` is allowed). A slide whose answer fails is left exactly as it was and the result says why; the paragraphs stay a blank line apart. In write mode the run is `POST /deck/edit/enhance { slides: [n…] | 'all' }` (409 while another enhance or an agent edit runs; 400 naming what is missing with no agent; 422 with no notes to enhance), progress rides SSE `enhance` events into one rewriting row, and the answers land in **one** edit against the deck as it is when the run ends: a slide edited meanwhile keeps the edit, so the undo chord takes the whole run back; the closing line (*enhanced 3 slides — Z undoes · slide 5 left as it was: …*) is said again after the reload the write causes. The notes are sent to that agent, and most agents are cloud services; the CLI's help says so. **Written for the ear** (`--spoken`; V → *🗣 Write the script for the ear…*; palette *Write this slide's / this module's / every slide's notes for the ear*; the notes editor's *🗣 write it for the ear*): the other rewrite, with its own prompt (`SPOKEN_PROMPT`, cli/enhance.mjs): terse, written-style notes turned into sentences a person would say out loud ("Fluffed a line? Backspace retakes it." → "And if you fluff a line, just press Backspace to take it again."), every fact kept, nothing added, symbols said as words, about as long as it was. It REWORDS, so its check is not "same words": the same `[click]` beats (the builds), no `[pause]` lost, no beat emptied, and a length between half and two and a half times the original: an answer outside that is commentary or a dropped point, and the slide is left as it was. **Every rewrite offers three scopes**: this slide, this slide's **module** (the `data-module` chapter it is in, DECK_ANATOMY, offered only when there is one), or every slide with notes. In the notes editor ✨ and 🗣 each ask which first: *this slide* lands in the box to read and ⌘⏎-save (nothing is written by pressing it); a module or the deck is rewritten in the file in one edit, which Z takes back: refused, with a sentence, while the box holds unsaved edits. **⌘⏎ saves the notes editor from wherever the focus is** while it is up: the box, a button in it, its background, or (docked) the slide beside it. A save that silently did nothing, with the text still in the box, read as a save (#646). A typing box of its own (the agent ask, the commit window, the content editor) keeps its own ⌘⏎, and the read-only card (`--no-trust`, `--no-trust`) has no save to reach. **A save does not reload the page**: the notes came from the page, so `POST /deck/edit/slide/notes` writes quietly (the watcher skips the reload for exactly those bytes) and broadcasts the slide's new notes as a `notes` event. Every open view of the deck puts them in place: narration and captions read the new text, the speaker view re-reads it, and a notes card open on that slide in another tab follows them unless it holds edits of its own. The page that saved keeps its card exactly as it was, caret and scroll included, and its own echo (`from` names the page) leaves the box as typed rather than as the file normalised it. Any other change to the file (an undo, an agent's edit, an editor's save) still reloads. Should a save's write reload anyway, the card is reopened on that slide with the caret and the scroll restored, docked or floating as it was, from a record kept in sessionStorage for a minute; Esc or × leaves none, so a card closed on purpose stays closed. **● unsaved** sits beside the heading, at full strength while the heading is dimmed, whenever the box differs from the file; it reads **saving…** while the request is in flight and clears once the box matches the file (a save that wrote, or one that had nothing to write). A failed save leaves it up. **Reset, and changes, in the notes editor**. The card's toolbar holds, on the left, a **✎ edit / ⇄ changes** switch (the lit half is the view on screen) and **↺ reset**, and on the right the agent's rewrites, at a size a pointer finds (13px, 32px tall). **↺ reset** puts the box back to the notes **as the card opened on this slide** (or moved to it): every change made since dropped, typed or rewritten by the agent, and when the file has moved on meanwhile (the quiet time wrote the typing, or the rewrite saved itself) the box is written back the same quiet way, the mark saying so. Not against the last save: a card that writes itself whenever the typing stops is its own last save most of the time, and a reset against it would have nothing to drop. A save from another tab that the card followed is the new starting point, and a reset pressed while a save is in flight lets it land with what it sent, then writes the reset after it. **⇄ changes** swaps the box for a word-level diff against the same starting point, the notes as the card opened on this slide (src/core/worddiff.js: a longest common subsequence over words and the whitespace between them, so line breaks and `[click]` lines survive; whole lines past a size cap), removed words struck through, added words highlighted, with the counts; Esc or ✎ edit goes back to the box. Not against the last save, for reset's reason: the quiet time writes the typing within a second, and a diff against it had nothing to show. Both are inert while the box says what the card opened on. When a rewrite lands in the box, the changes view opens on it.
|
|
648
649
|
- **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 (`⎵`) 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, kept on what is **heard**, not on the audio element's clock: its target is `audio.currentTime` minus the output delay the browser reports (`AudioContext.outputLatency` + `baseLatency`, tens of ms through speakers, far more through Bluetooth) minus `narration.character.lipOffsetMs` (a hand adjustment, positive = lips later); within 250 ms the video's rate is nudged ±8% until it is within 15 ms, and only a bigger gap seeks (`lipCorrection`), so the mouth never stutters on a seek per tick. Measured on a real clip: the old ±150 ms seek-only rule held the lips a steady ~35 ms ahead of the element clock (worse by the output delay) and let them drift to 212 ms; now a median of 13 ms. The debug log (`D`) names the output delay it used. It mirrors the voice's play/pause/rate. Timelines and clips come from the **lipsync bridge** (`decklight lipsync`; the deck asks its own origin for `/lipsync/*`, which `open` proxies to the bridge it started, and falls back to `http://127.0.0.1:8789` when opened from disk; 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), `GET /portrait?name=` (the still the clips are made from). **Set up once, remembered**: `decklight setup face --wav2lip-dir <checkout> --wav2lip-ckpt <wav2lip_gan.pth> --python <its venv python> --portrait me=<photo>` (the bridge's own `--save`, which it still takes) writes `~/.config/decklight/lipsync.json` (`$XDG_CONFIG_HOME` honored) and exits; the bridge reads it under any flag it is not given, `open` starts the bridge for a saved talking head with no flags (rhubarb or not), and `doctor` reports it: one check (`videoSetup`, tools/lipsync-config.mjs) says what stands in the way for all three and the deck's character row, in the same words. **How a clip is made from a photo** (Wav2Lip): a portrait larger than 1024 px is scaled down (S3FD misses the face in a full-size phone photo); its face is found ONCE with Wav2Lip's own detector and cached, then passed as `--box` so no clip detects again; the still is cropped square around the head so the face fills the round overlay (and renders faster); and because Wav2Lip redraws the whole face box at 96 px, only a feathered ellipse over the mouth and chin is taken from its output: everything else stays the sharp photograph (limited-range `yuv420p`). **A portrait can be filmed** (`--portrait me=clip.mp4`, `.mov` `.m4v` `.webm` `.mkv`, 5–10 s facing the camera, mouth relaxed, not talking; its sound is ignored): made ONCE per film and cached by content (`prepareClip`): its first 10 s at 25 fps, scaled like a photo, its face found in one frame a second, cropped square around the head, and played **forward then back** so the loop Wav2Lip makes of it for a long sentence never snaps the head back to the start (Wav2Lip loops its `--face` frames from the first, so a plain film jumps). If the head held still (a face in every sampled frame, its centre wandering less than a tenth of the face width (`steadyBox`)), the union of those boxes goes to Wav2Lip as `--box` and only the mouth is laid over the film, frame for frame (Wav2Lip's frame i is the loop's frame i); a head that moves is left to Wav2Lip's own per-frame detection, the whole face redrawn and softer, and the bridge says so. The film's first frame is the still under the video. Veo is not asked to animate a film, and SadTalker gets that first frame. The bridge prepares every portrait when it starts, not on the talk's first sentence. **Or filmed in the deck**: V → Character → *📹 Film yourself* opens the camera in the medallion's own circle (mirrored, as a face expects; the film is not), with what to do (face the camera, mouth relaxed, don't talk, head still), then a 3-2-1 and `narration.character.filmSeconds` (default 8) of recording, a review of the take (⏎ use it, R retake, Esc cancel), and `POST /portrait?name=filmed` (the MediaRecorder's own mp4 or webm) to the lip-sync bridge. The bridge prepares it like any film, keeps it beside `lipsync.json` (`portraits/filmed.mp4`, a retake replacing it), remembers it there, with the bridge's own Wav2Lip setup where none was saved, and offers it at once, no restart; the deck switches the character to it. A film with no face is refused in a sentence and the card offers a retake; a camera refused or absent is said as what to do. The row shows whenever the bridge can take a film (`/ping` `film`, or `filmWhy`), and a bridge with Wav2Lip and no portrait yet still starts, so filming is how the first portrait gets made (the video row then points at it). **A recorded track needs no pre-rendered clips**: in video mode the deck plays `slide-NN.mp4` beside the track when it exists (`decklight lipsync` renders them as a batch); when the server says it does not, a track you just recorded, and the bridge makes video, the head gets a clip made from the very audio file that plays (`POST /video` with that file; one per beat on a beat-paced track, keyed by the file, cached by content on the bridge), synced to it exactly as a live sentence is, with the rest of the slide and the next one warmed ahead in playing order. Until a clip lands the photo shows, never the previous beat's mouth. A request that cannot be made at all (a deck on file://) trusts the sidecar, as before; the check is a GET with the body dropped, since `open` answers HEAD 405. **The medallion is never black**: in video mode the character shows that same still (`/portrait`) under the video, and the video fades in only while a clip is playing (`playing` → shown, `ended`/`emptied` → the photo again): a clip that is still rendering when its sentence is spoken leaves the photo, not an empty circle. 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 `decklight narrate <deck> --face [--video]` (`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 write mode 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.
|
|
649
650
|
- **Engine wizard** (`ENGINES#WIZARD`; write 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 edit server's ping advertises every engine a registered marketplace declares a wizard for (`wizards`, beside its `agents`), and each gets a contextual `Voice: Configure ⟨engine⟩…` 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 write 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 edit 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 edit 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 write mode**: the routes are `/deck/edit/*`, so `allowRemote` refuses them off-loopback unconditionally and `--no-trust` 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.
|
|
650
651
|
|
|
@@ -657,10 +658,10 @@ Authorship is **structural, not detected**: the server spawns the agent itself a
|
|
|
657
658
|
|
|
658
659
|
### PRESENTING_OUTPUT · Print, export and hand-over
|
|
659
660
|
|
|
660
|
-
- **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. Both are palette rows too (**Print with notes**, **Print handout**), beside the plain print view, so a presenter reaches them without knowing the query string. **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. In write mode each of the three PDFs is a palette row of its own (**Export to PDF…**, **Export a PDF with notes…**, **Export a PDF handout…**), beside **Export to PowerPoint…** and named apart from the *print view* rows above, which open the same pages in a tab rather than writing a file anybody can be sent. Chrome is **awaited, not blocking** (`runAsync`): not for the deadlock reason `pptx` has, but because the edit server runs `pdfMain` in its own process for those rows, and a synchronous child would freeze live reload, the SSE stream and the page itself for as long as Chrome takes to print.
|
|
661
|
-
- **PowerPoint export**: **`decklight pptx <deck.html>`** writes a `.pptx` in which every slide is a picture (rendered at 1280×720 with its builds complete, through the deck's own served page so relative assets resolve) and every speaker note is a real note. It is **lossy by design** and `NON_GOALS` says why: the round-trip is not a goal, and the audience for the command is the people around a decklight user who ask for "the file". `-o` for the path, `--theme` to export in another, `--wait` per slide. **Hidden slides are not in the file** (`HIDDEN_SLIDES`), the same rule `pdf`, `video` and `voiceover` keep, and not merely as a preference: a deep link onto a hidden slide lands on its nearest shown neighbour, so exporting one wrote that neighbour's picture a second time under the hidden slide's notes. The numbering closes up in the exported file; a deck with nothing shown is a refusal rather than an empty one. The deck is served from the **current directory** when it lives under it (so a deck in a subdirectory still reaches the `dist/` and `themes/` at the top of its project) and from **its own directory** otherwise: a deck elsewhere is served, not refused. In write mode it is also a palette row, **Export to PowerPoint…**, because a presenter who needs the file needs it from where they are: the row asks the edit server (`POST /deck/edit/export`, `{ kind, theme | gen }`: `pptx`, `pdf`, `pdf-notes`, `pdf-handout`, `video`, `bundle`), which runs the same command in the same process: never an edit, so it takes no undo entry and leaves the deck byte-for-byte as it was. **Every export is in the theme on screen** (#547): the render is a fresh browser that cannot see the pick saved in this one, so the row names it (`theme`, a theme name and nothing else) and the server passes it on as `--theme`. A theme that lives only in this browser (a saved custom theme, an unsaved ⌃T roll) has no name a fresh render would know, so it goes as its **tokens** (`gen`: base64url JSON `{ name, tokens }`, at most 16 KB, the form the picker's previews already load) and the server passes that on as `--gen`, which each render tool puts on the deck URL as `?gen=`; the runtime vets every token before it becomes CSS (`safeTokens`). `video`, `pptx` and `pdf` take `--gen` from the command line too, and refuse it alongside `--theme`: one theme per render. **One export at a time**, whatever the kind (a second is refused, not queued): two exports at once is still two browsers on one machine, and the second would only be slower. A machine with no Chrome gets a sentence rather than a dead edit server, because the export must not take the session down with it. An export is tens of seconds, so the server **says where it is**: each slide is announced on the `export` channel of the same SSE stream the agent chip rides, and the deck rewrites its one progress row from it: one row that keeps telling the truth, never a toast per slide. **Bundle into one file…** is the row for the file most often sent: `decklight bundle`, run in the edit server, writing `<deck>-standalone.html` beside the deck: the CLI's own name, so the row and the command write the same file. It **carries every marked theme** and **opens on the theme on screen** (`--theme`, written into the bundle's configuration block), and because a bundle *carries* its themes where a render only shows one, it asks first about a theme on screen the deck does not mark: a marketplace theme as every row does, and a **shipped** one too, unless it is the deck's configured theme (every bundle carries that one): `409 { unmarked }`, the row arms, the second press marks it and carries on (THEME_DISTRIBUTION). It launches no browser, so it needs no Chrome; it refuses a generated theme on screen with a sentence, because a bundle embeds files and a roll is tokens in one browser (save it with ⌃⇧T and `theme add` it); and a deck that is already one file is told so rather than bundled again. On a deck with a recorded track the row first asks what the file carries of it, on a card that gives each answer **the size the file would come out at**: leave it beside the deck, as recorded, AAC, Opus. The figures come from `GET /deck/edit/export/estimate` (`{ base, audio }`): the bundle built in memory without its audio and without writing anything, in the theme on screen (in the deck's own when that one cannot be bundled yet), plus what each way adds. `original` is exact, and a codec is estimated from each file's duration (ffprobe) at its bitrate and container overhead, never above the file itself. A codec this machine's ffmpeg lacks is shown dimmed with the reason rather than hidden. The answer is remembered per browser and sent as the export's `audio` (`--audio` and its value); a deck with no recorded audio bundles straight away.
|
|
662
|
-
- **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 `--no-trust` 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 `--no-trust`, 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. **A render is declared, not inferred** (#548): every frame of a video, every slide of the pptx export and a plain `shot` (one with no `--drive` or `--keys`) loads the deck with **`?capture`**, which says this load is a picture, not a live session, so nothing that exists to talk to a person in the room is photographed into it: no toast (still written to the message log), no voice-over hint, no welcome card or tip, no chevrons. Each frame is a fresh one-shot load that has never used the voice, so before this the voice-over hint was burned into every frame of a video of a deck that carried a track. It is its own flag rather than `?embedded` (the picker previews' mode, which brings their postMessage and preference rules with it) or `?print`, which reveals every build and changes the layout. A driven `shot` stays a live load, because the toast a feature raises may be the very thing the screenshot is for. **A track is checked against the deck before a frame is rendered** (#536): each manifest slide carries the hash of the notes it was voiced from, the exporter recomputes it from the deck's current notes (`tools/narration-manifest.mjs`, the same extraction and key `voiceover` writes with, the pre-`model` form of the hash accepted as `voiceover` accepts it) for the slides being rendered, names every slide whose audio no longer matches: `slide 4: narration was recorded from different notes`, and then **re-voices them, when it can** (#553): a track whose manifest header names an engine was machine-voiced, and when that engine is available here (its binary and model, its key, its project) the stale slides (only those, ⟨CLICK⟩ beats and all) are voiced again in the track's own engine, model, voice and style, into its own format and file names, by a range-scoped call into the synthesis core every producer of a track shares; every other slide is untouched, and the check runs again on what that wrote. Before synthesizing it says how many clips it will ask for and from which engine (on a cloud engine that is money; any sentence already voiced comes from the clip cache). What cannot be re-voiced (a track with no engine, such as a take in somebody's own voice, or an engine this machine cannot run, named with what is missing: `it was voiced by elevenlabs, which needs $ELEVENLABS_API_KEY — export it…`) is refused with the way out (`re-record those slides (V → Record this deck… → slides a-b) or pass --allow-stale`); `--allow-stale` renders it and still prints the list, and `--no-revoice` leaves even a machine-voiced track's stale slides to that refusal. Entries with no hash (a take in your own voice) are noted, not refused. `--voiceover` refreshes the track in its own voice and format too, since `voiceover` reads the track's header. The export card carries the same check: a stale track is offered marked `recorded from older notes on N slides` (or, machine-voiced, `N slides from older notes, re-voiced first`); picking it says so on the export's own line, and the render is told the mark was seen. 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`, `--no-narration` (silent even with a `voiceover/` beside the deck), `--format mp4|mov|webm` (H.264/AAC in mp4 and mov, VP9/Opus in webm; read off `-o`'s extension when that names one, and refused when a name and the flag disagree), `--quality draft|standard|high` (encoder quality and audio bitrate; `standard` mp4 is what the command always wrote), `--subtitles none|embed|file` (the narration's words, the script `voiceover` wrote beside each clip, else the deck's notes for that beat, split into sentences exactly as the live captions split them and timed against each beat's real audio, shared out by length within it, with no caption over the breath after a slide; `embed` adds a track the player can turn on, `mov_text` in mp4 and mov and WebVTT in webm, and `file` writes a `.srt` beside the video, `.vtt` for webm; a render with nothing spoken writes none and says so; the vocabulary is `tools/video-options.mjs`, read by the flags, the edit server and the export card alike), `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>` or `--gen <b64url>` (applied as `?theme=` / `?gen=` on the deck URL, as `pdf`, `pptx` and `shot` do too, so it reaches an inline or added theme block as well as a `themes/<name>.css` file: it used to inject a link to that file, which on a deck of inline blocks pointed at nothing), `--slides a-b`, `--voiceover` (runs the voiceover batch first, over the same `--slides` range, so rendering five slides of a forty-slide deck synthesises five: `tools/voiceover.mjs --slides a-b` voices only that range and leaves every other slide's files and manifest entry as they were, the promise `decklight narrate --mic --slides` makes for your own voice). A range renders to `<deck>.slides-a-b.mp4` (`-o` still wins), so re-rendering five slides never overwrites the whole talk. In write mode it is also a palette row, **Export a video…**, which asks **which slides** before anything renders: all, this slide, this chapter (`data-module`), from here to the end, up to here, or a typed range (`src/core/ranges.js`, the same picker the recorders use). And **which voice** it carries, on the same card, alongside its **format**, **quality** and **subtitles** (the flags below), four rows above the ranges that ↑ reaches and ← → turn, the last three remembered per browser for the next export. The voice row offers every folder beside the deck `decklight video` can render from (one with a manifest; your own takes leave none), **the live voice** the deck speaks with in `V` (the engine and model the bridge answered with, the voice and tone picked), or **silence** by name. It starts on the voice already chosen (the live voice when `V` is set to it, the track `V` plays, the `voiceover/` a render would have found on its own, else silence), and never on a paid engine nobody picked. The row asks the edit server (`POST /deck/edit/export`, `{ kind: 'video', theme | gen, slides, format, quality, subtitles }` plus one of `narration`, `synthesize: { engine, model, voice, style, dir }` or `silent`), which checks every field before anything runs, then runs `decklight narrate` (when synthesizing) and `decklight video` as **child processes**, not through their `main`s as `pptx` and `pdf` are: those `main`s exit the process on every refusal, which would take the session down. A synthesized voice is written exactly as `decklight narrate -o` writes one (per slide and per ⟨CLICK⟩ beat, through the shared clip cache, with the engine settings the bridge itself reads (the environment, then `tts.json` for that engine), so a sentence already heard live costs nothing), into `voices/<voice>`, or refreshed in place where this engine and voice recorded before, so a second export re-pays nothing for slides that did not change. It **never lands on a take somebody recorded**: a folder that already holds audio is refreshed only when its manifest names this engine and voice, and the export refuses otherwise. The two phases report separately (`voicing slide n of N`, then the render's slides), read from the tools' own output (`voiceover` ends its plan line `· N to voice`), and a refusal is the tool's own sentence. 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.
|
|
663
|
-
- **Single-file bundling**: `decklight bundle <deck.html> [-o out.html] [--audio [original|aac|opus]] [--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. **Narration audio goes in only when asked.** By default a recorded track's files (a `narration.files` folder, a local manifest's `file` entries) stay beside the deck, and the CLI names the folders to send with the bundle. **`--audio [original|aac|opus]`** inlines each one as a `data-decklight-audio` block keyed by the URL the track would play (`voices/slide-01.m4a`); the runtime decodes it into a blob URL and plays that in place of the path, so the file speaks from disk with nothing beside it. It is a choice because a talk's voice is tens of MB, and base64 adds a third. **`original`** (what `--audio` alone means) carries the files as recorded. **`aac`** re-encodes each one through ffmpeg to mono AAC at 32 kbps, about 4 KB a second of voice, and plays in every browser. **`opus`** re-encodes to mono Opus at 24 kbps in WebM (constrained VBR, so the size stays near the bitrate whatever was recorded), about 3 KB a second and the smallest, for Safari from 17. A recorder WAV is about forty times the AAC. A file a re-encode would not shrink is kept as it was, the key stays the URL the track plays whatever the bytes became, and with no ffmpeg (or no encoder for the codec asked) it refuses with a sentence naming `--audio original`. A manifest entry with its own `url` (a bucket, often signed) stays where it is. `--no-audio` is the default, said explicitly.
|
|
661
|
+
- **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. Both are palette rows too (**Print with notes**, **Print handout**), beside the plain print view, so a presenter reaches them without knowing the query string. **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. A deck whose file name starts with a dot is refused before Chrome starts, with the reason: the render server never serves a dotfile (`PRESENTING_MODES`), and Chrome would print its refusal as one blank page. A render that finds no slides in a file that has them says so, and the page count is held to the file's. In write mode each of the three PDFs is a palette row of its own (**Export to PDF…**, **Export a PDF with notes…**, **Export a PDF handout…**), beside **Export to PowerPoint…** and named apart from the *print view* rows above, which open the same pages in a tab rather than writing a file anybody can be sent. Chrome is **awaited, not blocking** (`runAsync`): not for the deadlock reason `pptx` has, but because the edit server runs `pdfMain` in its own process for those rows, and a synchronous child would freeze live reload, the SSE stream and the page itself for as long as Chrome takes to print.
|
|
662
|
+
- **PowerPoint export**: **`decklight pptx <deck.html>`** writes a `.pptx` in which every slide is a picture (rendered at 1280×720 with its builds complete, through the deck's own served page so relative assets resolve) and every speaker note is a real note. It is **lossy by design** and `NON_GOALS` says why: the round-trip is not a goal, and the audience for the command is the people around a decklight user who ask for "the file". `-o` for the path, `--theme` to export in another, `--wait` per slide. **Hidden slides are not in the file** (`HIDDEN_SLIDES`), the same rule `pdf`, `video` and `voiceover` keep, and not merely as a preference: a deep link onto a hidden slide lands on its nearest shown neighbour, so exporting one wrote that neighbour's picture a second time under the hidden slide's notes. The numbering closes up in the exported file; a deck with nothing shown is a refusal rather than an empty one. The deck is served from the **current directory** when it lives under it (so a deck in a subdirectory still reaches the `dist/` and `themes/` at the top of its project) and from **its own directory** otherwise: a deck elsewhere is served, not refused. In write mode it is also a palette row, **Export to PowerPoint…**, because a presenter who needs the file needs it from where they are: the row asks the edit server (`POST /deck/edit/export`, `{ kind, theme | gen }`: `pptx`, `pdf`, `pdf-notes`, `pdf-handout`, `video`, `bundle`), which runs the same command in the same process: never an edit, so it takes no undo entry and leaves the deck byte-for-byte as it was. **Every export is in the theme on screen** (#547): the render is a fresh browser that cannot see the pick saved in this one, so the row names it (`theme`, a theme name and nothing else) and the server passes it on as `--theme`. A theme that lives only in this browser (a saved custom theme, an unsaved ⌃T roll) has no name a fresh render would know, so it goes as its **tokens** (`gen`: base64url JSON `{ name, tokens }`, at most 16 KB, the form the picker's previews already load) and the server passes that on as `--gen`, which each render tool puts on the deck URL as `?gen=`; the runtime vets every token before it becomes CSS (`safeTokens`). `video`, `pptx` and `pdf` take `--gen` from the command line too, and refuse it alongside `--theme`: one theme per render. **One export at a time**, whatever the kind (a second is refused, not queued): two exports at once is still two browsers on one machine, and the second would only be slower. A machine with no Chrome gets a sentence rather than a dead edit server, because the export must not take the session down with it. An export is tens of seconds, so the server **says where it is**: each slide is announced on the `export` channel of the same SSE stream the agent chip rides, and the deck rewrites its one progress row from it: one row that keeps telling the truth, never a toast per slide. **Every long job can be stopped without stopping the server**: while an export (but a bundle, which is seconds), an agent's edit, a script rewrite or an agent review runs, the palette's first row is **Stop …**, naming it, and the progress row says so. It asks the edit server (`POST /deck/edit/export/stop`, `POST /deck/edit/agent/stop`; both answer while the deck is locked, because a stop writes nothing), which kills the job's children (Chrome, ffmpeg, the agent CLI: SIGTERM, then SIGKILL a few seconds later) and answers at once; the job's own reply is what says it stopped (`{ stopped: true }`, and `stopped` on its `done` event). A stopped export leaves **no file**, not even a half-written one, and no scratch frames (`decklight video` answers SIGTERM by killing its own Chrome and ffmpeg and clearing up); a voice it had already synthesized stays in its folder, where the next export finds it done. A stopped rewrite or review writes nothing; a stopped agent edit keeps whatever it had written, one undo away. `/deck/ping` carries what is running (`exportBusy`, `enhanceBusy`, `reviewBusy`, beside `agentBusy`), so a page that loads mid-job can still stop it. **Bundle into one file…** is the row for the file most often sent: `decklight bundle`, run in the edit server, writing `<deck>-standalone.html` beside the deck: the CLI's own name, so the row and the command write the same file. **A deck in chapters is asked first what goes in**: the whole deck, then each `data-module` chapter (DECK_ANATOMY) with its number, its slides and how many, the card opening on the chapter of the slide on screen (on the whole deck before the first one); a deck without chapters is not asked. A chapter is `--module`, sent as the export's `module` (and the estimate's `?module=`) by its **number**, never its title: `--module` takes a full title too, but the number is the one thing the card and the bundler count the same way, and anything but a whole number from 1 is refused before the bundler runs. It bundles exactly what the command does, narration renumbered, into the command's own name, `<deck>-<chapter>.html`, which never overwrites the whole deck's. The export answers with the notes the command prints after the file (`notes`), and the row repeats the two that say what was handed over: which chapter, as slides of the deck and of the bundle, and whether the narration audio stays beside the deck. A chapter the bundler refuses (none by that number, or a deck with none) is its sentence on the row, and no file. It **carries every marked theme** and **opens on the theme on screen** (`--theme`, written into the bundle's configuration block), and because a bundle *carries* its themes where a render only shows one, it asks first about a theme on screen the deck does not mark: a marketplace theme as every row does, and a **shipped** one too, unless it is the deck's configured theme (every bundle carries that one): `409 { unmarked }`, the row arms, the second press marks it and carries on (THEME_DISTRIBUTION). It launches no browser, so it needs no Chrome; it refuses a generated theme on screen with a sentence, because a bundle embeds files and a roll is tokens in one browser (save it with ⌃⇧T and `theme add` it); and a deck that is already one file is told so rather than bundled again. On a deck with a recorded track the row first asks what the file carries of it, on a card that gives each answer **the size the file would come out at**: leave it beside the deck, as recorded, AAC, Opus. The figures come from `GET /deck/edit/export/estimate` (`{ base, audio }`): the bundle built in memory without its audio and without writing anything, in the theme on screen (in the deck's own when that one cannot be bundled yet), plus what each way adds. `original` is exact, and a codec is estimated from each file's duration (ffprobe) at its bitrate and container overhead, never above the file itself. A codec this machine's ffmpeg lacks is shown dimmed with the reason rather than hidden. The answer is remembered per browser and sent as the export's `audio` (`--audio` and its value); a deck with no recorded audio bundles straight away.
|
|
663
|
+
- **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 `--no-trust` 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 `--no-trust`, 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. **A render is declared, not inferred** (#548): every frame of a video, every slide of the pptx export and a plain `shot` (one with no `--drive` or `--keys`) loads the deck with **`?capture`**, which says this load is a picture, not a live session, so nothing that exists to talk to a person in the room is photographed into it: no toast (still written to the message log), no voice-over hint, no welcome card or tip, no chevrons. Each frame is a fresh one-shot load that has never used the voice, so before this the voice-over hint was burned into every frame of a video of a deck that carried a track. It is its own flag rather than `?embedded` (the picker previews' mode, which brings their postMessage and preference rules with it) or `?print`, which reveals every build and changes the layout. A driven `shot` stays a live load, because the toast a feature raises may be the very thing the screenshot is for. **A track is checked against the deck before a frame is rendered** (#536): each manifest slide carries the hash of the notes it was voiced from, the exporter recomputes it from the deck's current notes (`tools/narration-manifest.mjs`, the same extraction and key `voiceover` writes with, the pre-`model` form of the hash accepted as `voiceover` accepts it) for the slides being rendered, names every slide whose audio no longer matches: `slide 4: narration was recorded from different notes`, and then **re-voices them, when it can** (#553): a track whose manifest header names an engine was machine-voiced, and when that engine is available here (its binary and model, its key, its project) the stale slides (only those, ⟨CLICK⟩ beats and all) are voiced again in the track's own engine, model, voice and style, into its own format and file names, by a range-scoped call into the synthesis core every producer of a track shares; every other slide is untouched, and the check runs again on what that wrote. Before synthesizing it says how many clips it will ask for and from which engine (on a cloud engine that is money; any sentence already voiced comes from the clip cache). What cannot be re-voiced (a track with no engine, such as a take in somebody's own voice, or an engine this machine cannot run, named with what is missing: `it was voiced by elevenlabs, which needs $ELEVENLABS_API_KEY — export it…`) is refused with the way out (`re-record those slides (V → Record this deck… → slides a-b) or pass --allow-stale`); `--allow-stale` renders it and still prints the list, and `--no-revoice` leaves even a machine-voiced track's stale slides to that refusal. Entries with no hash (a take in your own voice) are noted, not refused. `--voiceover` refreshes the track in its own voice and format too, since `voiceover` reads the track's header. The export card carries the same check: a stale track is offered marked `recorded from older notes on N slides` (or, machine-voiced, `N slides from older notes, re-voiced first`); picking it says so on the export's own line, and the render is told the mark was seen. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck. A `--narration` folder with no manifest is **read off the disk** (`folderNarration`): its `slide-NN` files and their `slide-NN-KK` beats are the slides, which is what your own voice (`narrate --mic`) leaves. With no notes hash it is counted as recorded by hand and never called stale, and the export card offers it (`My voice` for `voices/me`) beside the manifest tracks; a folder of beats with no whole-slide file renders nothing and is not offered; 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`, `--no-narration` (silent even with a `voiceover/` beside the deck), `--format mp4|mov|webm` (H.264/AAC in mp4 and mov, VP9/Opus in webm; read off `-o`'s extension when that names one, and refused when a name and the flag disagree), `--quality draft|standard|high` (encoder quality and audio bitrate; `standard` mp4 is what the command always wrote), `--subtitles none|embed|file` (the narration's words, the script `voiceover` wrote beside each clip, else the deck's notes for that beat, split into sentences exactly as the live captions split them and timed against each beat's real audio, shared out by length within it, with no caption over the breath after a slide; `embed` adds a track the player can turn on, `mov_text` in mp4 and mov and WebVTT in webm, and `file` writes a `.srt` beside the video, `.vtt` for webm; a render with nothing spoken writes none and says so; the vocabulary is `tools/video-options.mjs`, read by the flags, the edit server and the export card alike), `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>` or `--gen <b64url>` (applied as `?theme=` / `?gen=` on the deck URL, as `pdf`, `pptx` and `shot` do too, so it reaches an inline or added theme block as well as a `themes/<name>.css` file: it used to inject a link to that file, which on a deck of inline blocks pointed at nothing), `--slides a-b`, `--voiceover` (runs the voiceover batch first, over the same `--slides` range, so rendering five slides of a forty-slide deck synthesises five: `tools/voiceover.mjs --slides a-b` voices only that range and leaves every other slide's files and manifest entry as they were, the promise `decklight narrate --mic --slides` makes for your own voice). A range renders to `<deck>.slides-a-b.mp4` (`-o` still wins), so re-rendering five slides never overwrites the whole talk. In write mode it is also a palette row, **Export a video…**, which opens a card that asks **which slides**: all, this slide, this chapter (`data-module`), from here to the end, up to here, or a typed range (`src/core/ranges.js`, the same picker the recorders use). And **which voice** it carries, on the same card, alongside its **format**, **quality** and **subtitles** (the flags below), four rows under the ranges that ← → turn, the last three remembered per browser for the next export. Choosing a range only chooses it (marked ✓, and named on the button); nothing renders until the card's **Export video** button is pressed, as the recorder's card waits on its Start. The card opens with that button selected, so exporting what is already chosen is one Enter, and Enter on a range chooses it and moves on to the button. The voice row offers every folder beside the deck `decklight video` can render from (one with a manifest; your own takes leave none), **the live voice** the deck speaks with in `V` (the engine and model the bridge answered with, the voice and tone picked), or **silence** by name. It starts on the voice already chosen (the live voice when `V` is set to it, the track `V` plays, the `voiceover/` a render would have found on its own, else silence), and never on a paid engine nobody picked. The row asks the edit server (`POST /deck/edit/export`, `{ kind: 'video', theme | gen, slides, format, quality, subtitles }` plus one of `narration`, `synthesize: { engine, model, voice, style, dir }` or `silent`), which checks every field before anything runs, then runs `decklight narrate` (when synthesizing) and `decklight video` as **child processes**, not through their `main`s as `pptx` and `pdf` are: those `main`s exit the process on every refusal, which would take the session down. A synthesized voice is written exactly as `decklight narrate -o` writes one (per slide and per ⟨CLICK⟩ beat, through the shared clip cache, with the engine settings the bridge itself reads (the environment, then `tts.json` for that engine), so a sentence already heard live costs nothing), into `voices/<voice>`, or refreshed in place where this engine and voice recorded before, so a second export re-pays nothing for slides that did not change. It **never lands on a take somebody recorded**: a folder that already holds audio is refreshed only when its manifest names this engine and voice, and the export refuses otherwise. The two phases report separately (`voicing slide n of N`, then the render's slides), read from the tools' own output (`voiceover` ends its plan line `· N to voice`), and a refusal is the tool's own sentence. 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.
|
|
664
|
+
- **Single-file bundling**: `decklight bundle <deck.html> [-o out.html] [--audio [original|aac|opus]] [--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. **Narration audio goes in only when asked.** By default a recorded track's files (a `narration.files` folder, a local manifest's `file` entries) stay beside the deck, and the CLI names the folders to send with the bundle. **`--audio [original|aac|opus]`** inlines each one as a `data-decklight-audio` block keyed by the URL the track would play (`voices/slide-01.m4a`); the runtime decodes it into a blob URL and plays that in place of the path, so the file speaks from disk with nothing beside it. It is a choice because a talk's voice is tens of MB, and base64 adds a third. **`original`** (what `--audio` alone means) carries the files as recorded. **`aac`** re-encodes each one through ffmpeg to mono AAC at 32 kbps, about 4 KB a second of voice, and plays in every browser. **`opus`** re-encodes to mono Opus at 24 kbps in WebM (constrained VBR, so the size stays near the bitrate whatever was recorded), about 3 KB a second and the smallest, for Safari from 17. A recorder WAV is about forty times the AAC. A file a re-encode would not shrink is kept as it was, the key stays the URL the track plays whatever the bytes became, and with no ffmpeg (or no encoder for the codec asked) it refuses with a sentence naming `--audio original`. A manifest entry with its own `url` (a bucket, often signed) stays where it is. `--no-audio` is the default, said explicitly. **`--module <title | n>`** bundles one chapter of the deck rather than all of it: the sections from its `data-module` marker up to the next one (DECK_ANATOMY), named by title (case ignored) or by number, the slides before the first marker belonging to none; the file is `<deck>-<chapter>.html` unless `-o` says otherwise, and its `<title>` names the chapter. **Its narration comes with it, renumbered**, because a track's files are named by slide number and the runtime counts the chapter's slides from 1 again: a folder track's `slide-NN[-KK]` files and the character's viseme timelines move down by the chapter's offset (slide 7 of a chapter that starts at slide 5 is `slide-03`), a manifest is cut to the chapter's entries, and anything outside the chapter is left out. Nothing is re-voiced: the clips are the same bytes under the number the bundle asks for, carried inside with `--audio` or counted beside it without. Character MP4s stay external and keep the deck's numbering, so a notice says the chapter's character plays from its visemes. A deck with no chapters, or no chapter by that name, is refused with the list of the ones it has; `--module` takes one deck, and with `--all` it points at the playlist module's own file, which is bundled as it is.
|
|
664
665
|
- **Runtime upgrade**: `decklight upgrade <deck.html> [--dry-run]` brings a self-contained deck's embedded runtime up to the installed package (a deck that is data, or one that *links* the runtime, is always current: `upgrade` only refreshes the version it records itself as written for, in the configuration block or on the `<script src>`, the thing `--no-trust --audit` compares; and **`--link`** is the reverse of `bundle`: the deck becomes data (`DECK_ANATOMY`): the embedded or referenced runtime and stylesheet go, the active theme becomes the block's `theme` and the other shipped themes are dropped because the servers link any of them, a theme that is not decklight's is kept embedded, and the `Decklight.init(…)` argument becomes the block when it is a literal, while a call whose argument is code stays as the escape hatch; everything the author wrote survives byte-for-byte): 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 deck records no version for it to pin or refuse a stale one against; an entry's `version` (`UNIT_VERSIONS`) is an install fact, and the path to a newer one is the installed unit, never the deck; 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`) are refused. A **multi-module
|
|
665
666
|
deck** (`bundle --all`, recognisable by its `data-module` markers) upgrades
|
|
666
667
|
like any other deck, with a note that a later re-merge would overwrite it: the
|
|
@@ -920,7 +921,9 @@ A **design system** is what a company publishes once so that every deck built on
|
|
|
920
921
|
palette: [{ group, label, token }] or a palette of scales,
|
|
921
922
|
{ colors: { <name>: { label, weights } } }, and themes: [{ name,
|
|
922
923
|
title, mode, tokens }] drawn from it (apiVersion 2, BRAND_PALETTE),
|
|
923
|
-
recommendedThemes: ["…"] (advice only)
|
|
924
|
+
recommendedThemes: ["…"] (advice only),
|
|
925
|
+
migrations: { "<version>": { skill, roles, tokens, classes,
|
|
926
|
+
themes } } (DESIGN_SYSTEM_MIGRATIONS)
|
|
924
927
|
design-system.css always-on styles: prefixed tokens, component and per-template rules;
|
|
925
928
|
url()s resolve relative to this file (url(assets/…))
|
|
926
929
|
templates.html inert <template data-template="…"> blocks, one per template
|
|
@@ -968,7 +971,9 @@ A template carries **structure only**: containers marked `data-slot="<name>"` (c
|
|
|
968
971
|
|
|
969
972
|
**Its files** are answered under `decklight-design-system/<marketplace>/<name>/<path>`, a **terminal** namespace in `staticFiles`: answered from the package or not at all, so a file a deck folder happens to hold at that path never answers. Every path segment is `[\w-]+` (the extension apart, so no dotted segment, decoded or not); the extension is in the asset allowlist, or the file is the package's own stylesheet (`templates.html`, the manifest, any other `.css` are never served); the package must resolve and still pass its check; and the file's **real path** must stay under the package's real directory, so a symlink cannot reach out. MIME is fixed per extension, never sniffed; every response carries `X-Content-Type-Options: nosniff`, and an SVG also `Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'`: a document served same-origin must not script. **Every refusal is the same plain 404** a missing path gets: a probe learns nothing.
|
|
970
973
|
|
|
971
|
-
**While authoring**, `/` → **Design systems…** lists every design system the registered marketplaces offer, from the cache, grouped by catalog (● this deck uses it, ○ it does not, an unusable one saying why
|
|
974
|
+
**While authoring**, `/` → **Design systems…** lists every design system the registered marketplaces offer, from the cache, grouped by catalog (a heading only over a catalog offering more than one; ● this deck uses it, ○ it does not, one marker and no other; the name with its version set apart; the description one line, the whole of it the row's tooltip; an unusable one saying why; a marketplace not fetched yet said plainly and one whose cached catalog no longer reads as a warning, each with its `marketplace update`), and the selected row says what **Space** would do ("Space: stop using", with how many slides stand on its templates; "Space: use, with its themes and fonts (⇧ alone)"), the footer naming only the keys. **Space** (or ⏎) toggles it through `POST /deck/edit/design-system/mark { ref, used }` (`GET /deck/edit/design-system/browse` lists): the twin of `/deck/edit/theme/mark`, refusing by the same check as the command line (400 with `problems`, 404 unknown, 409 unresolvable or a name clash), one undo entry, and the reload that brings the deck back with it linked. Referencing one changes nothing on screen by itself (a design system styles only the slides that name its templates), so the toast points at **Use slide template…**. the no-trust mode has neither route.
|
|
975
|
+
|
|
976
|
+
**A marketplace can be registered from the deck** (#838): the add view of **Marketplaces…** (`MARKETPLACES_SCREEN`, which has the flow). The empty **Design systems…** (*No registered marketplace offers a design system.*) offers it as a row, and ⏎ on it opens that view on its own and comes back to the list once the marketplace is in.
|
|
972
977
|
|
|
973
978
|
**`decklight check` reads design-system use before the talk.** Every mistake below renders (the engine shows the content plainly or in the unslotted box rather than losing it), so each is a **warning** (exit code unchanged: errors only), one per slide, from the file half (no Chrome; it runs under `--no-render`), naming what was written and what the design system offers: `ds-unknown-system` (a slashed `data-template` naming a design system the deck does not reference: what it does reference, and the `design-system add` that would), `ds-unknown-template` (the template ids it does define), `ds-unknown-slot` (the template's slots, required ones marked `*`), `ds-slot-twice` (one slot filled by two elements, decided from the file alone, except the template's default slot, which is meant to take several), and `ds-required-empty`. The deck's design systems are resolved the way the servers resolve them (checkouts and cache, never a fetch, and through `check`) and injected into `staticFindings` (`designSystems`, beside `exists`), so the rules are testable without a marketplace on disk. One this machine cannot read is a single head-level `ds-unresolved` warning, and its slides' templates and slots are **skipped, not guessed**. A deck that references no design system resolves nothing. The render half adds nothing: `data-ds-missing` slides are already named from the file, and a machine with Chrome must not count a deck's findings differently from one without.
|
|
974
979
|
|
|
@@ -998,7 +1003,7 @@ The section gets `data-ds-expanded="<template>@<version>"`, and a later `sync()`
|
|
|
998
1003
|
|
|
999
1004
|
**When the template is not there** (the design system is not on the page, or has no such template), the section gets `data-ds-missing="<reason>"` and its content stays where it was written, so it renders plainly and nothing is lost. While authoring, the slide carries a badge with the reason and the deck says it once (together with any `decklight-design-system-missing` meta); presenting falls back silently.
|
|
1000
1005
|
|
|
1001
|
-
**Editing a design-system slide edits the file's content, never the template's structure.** Element edit mode, the double-click inline editor, a dropped image and the colour picker all address an element through `authoredTop` / `authoredIndex` (`src/core/design-system.js`): the authored element a click lands in (on an expanded slide, wherever expansion put it) at its index **in the file**, recorded before expansion reordered the DOM, so the server needs nothing new. A click on the template's own decoration (`data-ds-injected`) addresses nothing; the colour picker's path into an element never crosses an injected node. An element-content write that would **drop the `data-slot`** an element on such a slide carries is refused (409, "keep data-slot=…"): an edit may change what an element says, or move it to another slot, never silently send it to the unslotted box (`cli/design-system-edit.mjs` `slotWriteProblem`).
|
|
1006
|
+
**Editing a design-system slide edits the file's content, never the template's structure.** Element edit mode, the double-click inline editor, a dropped image and the colour picker all address an element through `authoredTop` / `authoredIndex` (`src/core/design-system.js`): the authored element a click lands in (on an expanded slide, wherever expansion put it) at its index **in the file**, recorded before expansion reordered the DOM, so the server needs nothing new. A click on the template's own decoration (`data-ds-injected`) addresses nothing; the colour picker's path into an element never crosses an injected node. A diagram the author put in a slot is the author's: inside it a click picks the drawn node, a double-click edits a label, a shape takes a concept and `check` lints the `<svg>`, exactly as on a plain slide, because only the `<svg>` itself or a node between it and the one pointed at can be decoration (`src/core/pick.js` `injectedIn`); the slot container above it holds the diagram, it is not it. An element-content write that would **drop the `data-slot`** an element on such a slide carries is refused (409, "keep data-slot=…"): an edit may change what an element says, or move it to another slot, never silently send it to the unslotted box (`cli/design-system-edit.mjs` `slotWriteProblem`).
|
|
1002
1007
|
|
|
1003
1008
|
**`/` → Use slide template…** (write mode) lists the deck's design systems' templates from the page's meta, grouped by design system, each with its slots (`*` required), and a **live preview**: a scaled slide in that template, expanded by the engine itself, its slots at their default content (an empty one labelled with its name). Choosing a template offers, for the current slide:
|
|
1004
1009
|
|
|
@@ -1084,7 +1089,7 @@ A switch between two design systems that both use them loses nothing, and the se
|
|
|
1084
1089
|
|
|
1085
1090
|
- `?gen=` and `?theme=` are **exempt**: each is one view asked for by name (a picker preview, an export's `--theme`, a link someone made), and neither is saved.
|
|
1086
1091
|
- **The saved pick** is passed over when it is not one of the brand's themes: a theme this browser chose before the deck kept to its brand is not one it reopens on.
|
|
1087
|
-
- **The configured `theme`** opens the deck only when it is one of the brand's themes. A deck configured on another one (written by `T` while the deck was unlocked, or by an earlier `"brandThemesOnly": false`, and kept when the lock went back on) opens on **the brand's first theme** instead, unsaved. While authoring it says so once a session (*"theme": "eclipse" is not one of Acme Brand's themes — opened on acme-dark*), and `decklight check` warns (`theme-off-brand`, ⚠, at the head), naming the brand's themes and `"brandThemesOnly": false` as the way to keep the configured one.
|
|
1092
|
+
- **The configured `theme`** opens the deck only when it is one of the brand's themes. A deck configured on another one (written by `T` while the deck was unlocked, or by an earlier `"brandThemesOnly": false`, and kept when the lock went back on) opens on **the brand's first theme** instead, unsaved. While authoring it says so once a session, in a toast that points at **Check deck…** (*"theme": "eclipse" is not one of Acme Brand's themes — opened on acme-dark · 1 problem with a fix*), whose `theme-off-brand` row offers the fix: the theme a design system's migration renames the configured one to, else the brand's first (`PRESENTING_EDITING`); and `decklight check` warns (`theme-off-brand`, ⚠, at the head), naming the brand's themes and `"brandThemesOnly": false` as the way to keep the configured one.
|
|
1088
1093
|
- **No configured theme** opens on the brand's first theme too, never on decklight's default.
|
|
1089
1094
|
|
|
1090
1095
|
Unlocked, every step is as it was: the deck opens on whatever its configuration names.
|
|
@@ -1138,6 +1143,47 @@ A role a theme leaves out is refused (`theme-role-missing`), and so is a value t
|
|
|
1138
1143
|
|
|
1139
1144
|
**`design-system gate`** gains these rules: `role-redefined`, `theme-role-missing`, `theme-role-unknown` (✘), `component-off-role` (⚠), with a malformed `roles` or `contract` refused as `manifest-field`. `decklight check` gains `off-role` (⚠).
|
|
1140
1145
|
|
|
1146
|
+
### DESIGN_SYSTEM_MIGRATIONS · A design system's major versions, and the deck that took an older one
|
|
1147
|
+
|
|
1148
|
+
A design system's major version may rename what decks write: a role, a token, a component class, a theme. A deck behind it does not fail; it loses colours, silently, because an undefined `var()` falls back. So a deck **records the version it took**, a package **declares what each major renamed**, and decklight says *migrate* once, where the author is, instead of N unrelated warnings.
|
|
1149
|
+
|
|
1150
|
+
**The deck records its version.** `"designSystemVersions": { "<ref>": "5.0.0" }` in the configuration block, keyed by the deck's own spelling of the reference. `design-system add` (and the edit server's add, and `init --design-system`) writes it with the reference, `remove` drops it with the reference, and `migrate` moves it forward. `design-system apply` writes it for a deck that records none, as `add` does for a deck that already used the design system, unless the deck, or a stylesheet it links, still uses a name a migration renamed: recording the new version would hide that the deck is behind. This is the deck's fact and travels with it. The ledger (`~/.decklight/installed.json`, UNIT_VERSIONS) is one machine's and says nothing about a deck written elsewhere, so nothing below reads it. A bundle already carries the version it inlined (`data-design-system-version`).
|
|
1151
|
+
|
|
1152
|
+
**The package declares its migrations** in `design-system.json`, keyed by the version that made the change:
|
|
1153
|
+
|
|
1154
|
+
```json
|
|
1155
|
+
"migrations": {
|
|
1156
|
+
"6.0.0": {
|
|
1157
|
+
"skill": "acme-migrate",
|
|
1158
|
+
"roles": { "text-diagram-blue": "text-diagram-default" },
|
|
1159
|
+
"tokens": { "--acme-font-size-body-lg": "--acme-font-size-body-xl" },
|
|
1160
|
+
"classes": { "acme-tile--zest": "acme-tile--secondary-3" },
|
|
1161
|
+
"themes": { "acme-devrel": "acme-dark" }
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
Every rename is a whole name: a role by its id (a slide writes its token, `--<prefix>color-<role>`), a custom property, a class (no dot), a theme. `skill` names a marketplace skill (`UNITS#REST`) for what a rename cannot decide, a name removed with no successor. The **gate** refuses (`migration`, ✘) a key that is not semver or is later than the package's `version`, a field it does not know, a malformed name, and, against the package as it now is, an old name it still defines (a rename that leaves the name is not one) or a new name it does not define, unless a later migration renamed it again. Roles are read from `roles`; tokens from the stylesheet, the palette and the roles; classes from the stylesheet's selectors and the templates' `class` attributes; themes from the brand's themes and `recommendedThemes`. The report prints one line per migration.
|
|
1167
|
+
|
|
1168
|
+
**Behind** means the deck records an older major than the package this machine serves, or uses (in its own markup or a stylesheet it links from its folder, `<link rel="stylesheet" href="course.css">`) a name that a migration since its recorded version renamed. A deck that records no version is held to every migration. Renames are composed in version order, so a name renamed in 5.0.0 and again in 6.0.0 is said, and moved, straight to the last one.
|
|
1169
|
+
|
|
1170
|
+
**Said where the author is**, in the same words everywhere: *written for acme 5.0.0, this machine serves 6.0.0: 14 renamed names (text-diagram-blue → text-diagram-default, …). Migrate with the acme-migrate skill, or decklight design-system migrate acme@acme-mkt talk.html*.
|
|
1171
|
+
|
|
1172
|
+
- `decklight check`: **one** head-level warning, `ds-behind` (⚠), per design system. The names it counts are not each warned again as `off-role`. An `off-role` that still meets a renamed role names its successor (*was renamed text-diagram-default in 6.0.0*) instead of the nearest role.
|
|
1173
|
+
- **Write mode**: the servers pass the sentence to the page in `<meta name="decklight-design-system-behind" data-ref data-version>`, read from the same input as `check` (the deck and the stylesheets it links), and the runtime says it once a session while authoring, like the off-brand theme, in a toast that **stays** until the author dismisses it: a pointer (*Acme Brand: this deck is behind the version this machine serves — 1 problem with a fix*) whose button opens **Check deck…** on the `ds-behind` row, where the whole sentence is, and **Migrate** is that row's fix (`PRESENTING_EDITING`). Presenting, a render and a preview say nothing.
|
|
1174
|
+
- **After an update.** The Marketplaces screen's update answers with the design systems the open deck is now behind (`behind`, read as above), and its what's new says each in the same sentence with **Migrate** (M), so nobody has to reload to learn it (`MARKETPLACES_SCREEN`).
|
|
1175
|
+
- **`marketplace update`**: a newer design system whose package declares migrations since the version installed says what that means instead of only the reinstall hint: `acme@acme-mkt 5.0.0 → 6.0.0 (major: decks that use it need migrating, with the acme-migrate skill) — decklight check finds them; decklight design-system migrate acme@acme-mkt <deck.html> moves one`. The screen's *newer than what you installed* row says the same.
|
|
1176
|
+
- **`design-system list <deck>`**: the deck's recorded version against the catalog's, `5.0.0 → 6.0.0 (major: migrate)`. A deck that records none shows the catalog's version and says so.
|
|
1177
|
+
|
|
1178
|
+
**`decklight design-system migrate <ref> <deck.html>`** applies the renames pending since the deck's recorded version: roles and tokens wherever they stand as whole names, classes in `class` attributes and CSS selectors, and the configured `theme`. It edits the deck and the stylesheets it links from its folder (never a URL, a design system's own link or a theme), renames every file in memory before writing any, records the package's version, and prints the renames by kind. A deck already on the version is left byte for byte (*nothing to migrate*). It decides nothing a rename cannot: the migration's `skill` is named for that, and it is a marketplace skill an agent loads like any other (`UNITS#REST`).
|
|
1179
|
+
|
|
1180
|
+
**Migrate, while authoring**, is a job the author watches in the docked agent panel, not a silent rewrite (`POST /deck/edit/design-system/migrate { ref, agent? }`). The panel opens on it and stays open across the reload it causes.
|
|
1181
|
+
|
|
1182
|
+
- **With a skill and an agent.** When the pending migrations name a `skill` and an agent is installed, Migrate is an ask like any other, to that agent: its prompt names the design system, the versions, the deck and the skill, and asks it to run `design-system migrate` for the declared renames and then the skill's checks (renders before and after) and judgement calls (a name removed with no successor), and to report the renames with their counts, each call it made, and what it left alone. **A skill the agent does not load yet is offered first**, before anything runs: the route answers `{ choose: 'skill', skills, places }` and the page asks where it goes, **every project** (Claude's config home, `~/.claude/skills/<name>/`, the one recommended and selected), **this project only** (`.claude/skills/<name>/`), or **not now**, and posts again with `place: 'global' | 'project' | 'none'`. An install takes the skill into the library from its catalog entry when it is not there yet, then copies it as `library add skill` does, one folder per skill as Claude reads them, and listed in every AGENTS.md carrying the Decklight section; a skill the agent already has is never asked about. The prompt points at the skill where the agent loads it, else where it already is on this machine (the library's copy, else its marketplace's checkout, `~/.decklight/marketplaces/<name>/…/SKILL.md`), and only in that last case, not now, is the folder given to the agent to read (`--add-dir` for Claude Code, which reads nothing outside the project otherwise): a skill installed for the agent needs no extra reach. Not now installs nothing anywhere. `decklight design-system migrate` and `decklight library add skill` ask the same on a terminal (Enter is every project), and say how to install it when there is none. It names the commit that holds the deck as it was, for the skill's *before* render; and it says that only the deck and its stylesheets change, so the agent leaves no copy or render behind. That report is what the panel shows, and the commit carries the migration's own subject, whole.
|
|
1183
|
+
- **Otherwise** the edit server runs the migration itself and records it in the same panel as an entry by *decklight*: the renames by kind, the count and the files, the version recorded, and the skill named for what a rename cannot decide. With no agent CLI on the machine the panel still opens, to show it.
|
|
1184
|
+
- **Either way it is one step.** Outstanding work is committed first, so the migration gets its own commit (*decklight: migrate talk.html to acme 6.0.0*), stylesheets included. One undo entry holds the deck and the stylesheets it links, so one Z puts them all back and one redo takes them forward. The reload says why: *migrated to acme 6.0.0*.
|
|
1185
|
+
- **Then the deck is no longer behind**: it records the version, so neither the toast nor the what's-new line comes back. A Migrate on a deck already there is *nothing to migrate*.
|
|
1186
|
+
|
|
1141
1187
|
## FONTS · Fonts: a typeface's files, by reference
|
|
1142
1188
|
|
|
1143
1189
|
A theme **names** its type, `--font-body` is a list of family names, and cannot carry it: a family the machine does not have comes from a Google Fonts `@import` that needs the network (and a page policy that allows it), or not at all, and `bundle` cannot help, since the `@import` still points at Google. A **font package** carries the faces themselves, from a marketplace, by reference, so a deck (and its bundle) has them wherever it is opened. It makes a FAMILY available; it does not restyle anything by itself: a theme that names the family gets it, the font picker offers it, and the deck's `font` default or the viewer's pick applies it.
|
|
@@ -1162,6 +1208,24 @@ A theme **names** its type, `--font-body` is a list of family names, and cannot
|
|
|
1162
1208
|
|
|
1163
1209
|
**While authoring**, **Font…** lists every font the registered marketplaces offer (`GET /deck/edit/font/browse`, cache-only, with each face's `decklight-font/` URL), linking an offered font's faces into the page on demand so the selection can preview it; **Space** references it through `POST /deck/edit/font/mark { ref, used, quiet?, use? }` (the same check as the command line, one config entry, one undo), quietly, so the picker stays open. A marketplace with nothing to offer yet is named (`not listed: … — decklight marketplace update`). Presenting, the picker lists the stacks and the deck's own fonts only.
|
|
1164
1210
|
|
|
1211
|
+
## MARKETPLACES_SCREEN · Marketplaces…: every catalog, which are behind, what's new
|
|
1212
|
+
|
|
1213
|
+
While authoring, `/` → **Marketplaces…** (write mode only, so never under `--no-trust`, whose server has none of these routes) is the one screen for the catalogs this machine has registered (PLATFORM `MARKETPLACE_REGISTRY`). It replaced the **Add a marketplace…** card and palette row: adding is one of its views. Every network act on it is the `decklight marketplace` command it would be at a terminal, run by the edit server as a child process, so the registry cannot tell which door anything came in by.
|
|
1214
|
+
|
|
1215
|
+
**The list** is the cache's, and asks no source anything (`GET /deck/edit/marketplaces`): one row per marketplace, sorted by name, with one mark and its state beside the name (*first-party* set apart), its source with the pinned `#ref` and the `@commit` the cached catalog came from, what it offers per kind (*offers 1 design system, 2 fonts*), and how many of your installs it now has newer (`UNIT_VERSIONS`). A marketplace never fetched says so (○ *not fetched yet*), one whose cached catalog no longer reads is a warning, and one nobody has checked says exactly that (· *not checked: C asks its source*). The selected row says what ⏎ would do, and that a remote update is a clone with your git credentials. The last row is **Add a marketplace…**.
|
|
1216
|
+
|
|
1217
|
+
**Which are out of date.** **C** runs `decklight marketplace outdated --json` (`POST /deck/edit/marketplace/check`): a remote is asked where its ref points now (`git ls-remote`, no prompt, nothing written) and held against the recorded commit (the commit a clone would land on: a branch before a tag of the same name, an annotated tag peeled); a local directory's manifest is compared with the cached copy, with no network at all. Each row then says ✓ *up to date*, ↑ *update available @a1b2c3d → @e4f5a6b* (a local one: *changed on disk*), or why it could not tell (unreachable, a pinned tag that is gone, a catalog fetched before commits were recorded), and a summary line says *checked just now: 1 of 3 out of date*. Every answer is recorded on this machine (`~/.decklight/marketplace-check.json`: when, and each marketplace's state), whoever asked, so the list opens on the last one (*checked 3 min ago: 1 of 3 out of date*) without a C. Opening a screen is not consent to reach the network, so the check does not run by itself until the author says it may (below). At the command line, `decklight marketplace outdated [<name>]` prints the same, each behind one with the update that takes it.
|
|
1218
|
+
|
|
1219
|
+
**Checking when decklight starts.** **O** turns on *Check for updates when decklight starts* (`POST /deck/edit/marketplace/auto-check { on }`; `decklight marketplace auto-check on|off` at a terminal, and `marketplace list` says which it is). It is per machine, kept in `marketplaces.json` beside the marketplaces it is about, and **off until it is turned on**: turning it on is the consent the check otherwise lacks, and while it is off nothing runs. While it is off the screen asks once, ever, on its footer: *Check automatically when decklight starts? O turns it on*. While it is on, an edit server that starts runs the same `decklight marketplace outdated --json` that C runs, in the background, never on the critical path (the server starts and serves without waiting, the shape of the decklight update notice), and at most once in 12 hours, measured from the recorded answer, so restarting during a session does not ask every remote again. Turning it on runs one that is due at once. A source that does not answer is a row on the screen and nothing anywhere else. When the answer lands the server tells the open pages, and the startup log names what is out of date.
|
|
1220
|
+
|
|
1221
|
+
**What it offers.** When the recorded answer has a marketplace behind its source (one never fetched is not an update to something you have), the deck in write mode says so in **one toast that stays** (`GET /deck/edit/marketplace/auto-check`, read from the record, asking nothing): *decklight-confluent has an update: this deck uses confluent-developer (design system) from it*. A check asks where a ref points and reads no catalog, so what it can name is not the version the update brings but what the open deck uses from that marketplace; the version, a major, its migrations and *this deck is now behind* are what's new after the update. **Update** opens the screen and updates that row as ⏎ does, what's new and **Migrate** included; **Marketplaces…** opens the screen; several marketplaces behind are named together, with **Marketplaces…** alone. **Dismiss** is remembered at the commit it was offered for (`{ dismiss, remote }`), so the same update is not offered again and the next one is. With nothing out of date it says nothing. It never updates by itself: an update is still the author's ⏎, because it re-clones with their git credentials and changes what every deck on the machine is served.
|
|
1222
|
+
|
|
1223
|
+
**Updating.** **⏎** updates the selected marketplace and **U** every one the check found out of date or never fetched, one after another (`POST /deck/edit/marketplace/update { name }` runs `decklight marketplace update <name>`: the same re-clone at the same pinned ref, the same refusals, and a failure leaves cache and checkout as they were, said in a toast with the command's reason). Afterwards the theme picker, the font picker and **Design systems…** ask the edit server again, so the catalog as it now is is in them without a reload. Nothing in the deck changes, so there is no undo entry and no reload.
|
|
1224
|
+
|
|
1225
|
+
**What's new.** An update records what it changed on the marketplace's registry entry (`changes`: when, the commit before and after, and the entries **added**, **removed**, and whose `version` moved, `catalogChanges` in `cli/marketplace.mjs`); a first fetch is marked as one rather than reported as forty new entries. `update` prints it (`+ frost@acme 0.1.0 (theme)`, `− old@acme (theme) — no longer offered`, `↑ nord@acme 1.0.0 → 1.1.0`), and the screen opens it after ⏎: grouped *new*, *new versions*, *no longer offered*, then *newer than what you installed*, each with the command that takes it, since an update refreshes the catalog and taking a version stays your call (a design system with migrations says decks need migrating, `DESIGN_SYSTEM_MIGRATIONS`). When the update left the open deck behind one of its design systems, *this deck is now behind* follows, in the sentence `check` says, with **Migrate** (a button, or **M**), which closes the screen and runs in the agent panel. **W** reopens it for a row's last update, from the record, any time later. Esc goes back to the list.
|
|
1226
|
+
|
|
1227
|
+
**Adding** (**A**, or ⏎ on the last row) asks for what `decklight marketplace add` takes: an `owner/repo`, a git URL, or a path, a relative one read from the deck's folder, and its `--branch <ref>` after any of them (a branch or a tag, `acme/themes --branch v2.1.0`, parsed from the field the way the command line reads it). One example of each sits under the field; clicking one puts it in the field to start from. The first ⏎ only says what it is about to do (*Clone https://github.com/acme/brand-kit.git with your git credentials on this machine*, or *Register /talks/northwind, read in place, nothing is fetched*) and touches nothing; the second runs the command, so the result is the same registration the command line makes. The pickers ask again, the toast counts what it offers (*registered northwind: 1 design system, 1 theme, 1 font*), and the list comes back with it selected. A failure (unreachable, no credentials, not a marketplace, a malformed manifest) is the command's own sentence with its reason, shown in the view with the source kept to correct, and registers nothing. `POST /deck/edit/marketplace/add { spec, ref?, confirm? }`: without `confirm`, `{ plan }` (400 for what is not a source, for a ref `--branch` would refuse, or for a ref on a local directory, which has none); with it, `{ name, counts, refreshed }` or 409 with the reason.
|
|
1228
|
+
|
|
1165
1229
|
## REPO_LAYOUT · Repository layout & tooling
|
|
1166
1230
|
|
|
1167
1231
|
```
|
|
@@ -1191,7 +1255,8 @@ decklight/
|
|
|
1191
1255
|
mode), pick.js (what a pointer means inside a diagram), style-clip.js (Copy style and Paste style),
|
|
1192
1256
|
concepts.js + concept-tools.js (the deck's concepts, and putting shapes into one, SVG_DIAGRAMS),
|
|
1193
1257
|
deckcheck.js (Check deck…) + density.js (SLIDE_DENSITY, measured), dock.js (the panel beside the
|
|
1194
|
-
slide), choice.js (one answer on a card),
|
|
1258
|
+
slide), choice.js (one answer on a card), marketplaces.js (the Marketplaces… screen, MARKETPLACES_SCREEN),
|
|
1259
|
+
stroke-geometry.js (a hidden shape's stroke length, for a draw build the browser will not measure), ranges.js (a slide range, picked), prefs.js (the deck's
|
|
1195
1260
|
memory, where localStorage may throw), undo-chord.js (the undo chord as this machine spells it)
|
|
1196
1261
|
— plus autoanimate, builds, print, svg, charts, media,
|
|
1197
1262
|
speaker, annotate, character, character-art, devmode, themegen, voicetrack
|
|
@@ -1212,7 +1277,8 @@ decklight/
|
|
|
1212
1277
|
theme.mjs (validate + install a theme, THEMING), import.mjs (PowerPoint/Keynote/Google Slides →
|
|
1213
1278
|
deck, JS_API), pdf.mjs (the print variants, PRESENTING) + pptx-export.mjs (deck → PowerPoint,
|
|
1214
1279
|
NON_GOALS), publish.mjs, marketplace.mjs (register catalogs, MARKETPLACE_REGISTRY; entry versions and
|
|
1215
|
-
the install ledger, UNIT_VERSIONS)
|
|
1280
|
+
the install ledger, UNIT_VERSIONS) + marketplace-autocheck.mjs (the opt-in check when a server
|
|
1281
|
+
starts, MARKETPLACES_SCREEN), enhance.mjs (the notes rewritten by your agent: audio tags, or
|
|
1216
1282
|
written for the ear — checked before a byte is written), design-system.mjs (the design-system
|
|
1217
1283
|
admission gate, and add/remove/list/templates, DESIGN_SYSTEMS) + design-system-refs.mjs (a deck's
|
|
1218
1284
|
design systems: resolution, injection, and serving the package) + design-system-edit.mjs
|
|
@@ -1229,7 +1295,7 @@ decklight/
|
|
|
1229
1295
|
commit-mode decision table: on your word, or the timer), update-check.mjs (the "a newer decklight exists" notice), qr.mjs,
|
|
1230
1296
|
port-conflict.mjs, supervise.mjs, skill-content.mjs (the agent skill's shipped text), start.mjs (a bare
|
|
1231
1297
|
`decklight`: start a deck here, or open the one that is), doctor.mjs (what this machine can do),
|
|
1232
|
-
check.mjs (one deck linted headlessly — the file half and one --dump-dom of ?print, in one
|
|
1298
|
+
check-fixes.mjs (the quick fixes Check deck… offers for check's findings: which, and the renames they apply), check.mjs (one deck linted headlessly — the file half and one --dump-dom of ?print, in one
|
|
1233
1299
|
exit code, PRESENTING), open-browser.mjs (hand a URL to the platform launcher), banner.mjs (the
|
|
1234
1300
|
startup banner), runtime-link.mjs (a deck as data: the runtime linked in on the way out,
|
|
1235
1301
|
DECK_ANATOMY), clone-deck.mjs (a git URL as the deck), trust.mjs (a deck's code, trusted by its
|
|
@@ -1242,20 +1308,23 @@ decklight/
|
|
|
1242
1308
|
a tree built without the working tree), comments.mjs + review-store.mjs + review-ref.mjs +
|
|
1243
1309
|
review-routes.mjs + review-submit.mjs + review-remote.mjs (REVIEW: the comment store, a review
|
|
1244
1310
|
as a branch, its routes, sending it back and what is waiting), agent-review.mjs (Check deck…'s
|
|
1245
|
-
review by the local agent), bundle-audio.mjs (a bundle's narration audio)
|
|
1311
|
+
review by the local agent), bundle-audio.mjs (a bundle's narration audio) + bundle-module.mjs (one
|
|
1312
|
+
chapter as its own bundle, its narration renumbered), report-bug.mjs
|
|
1246
1313
|
tools/ theme-check.mjs (the THEMING token contract + WCAG gates, as a function) + color.mjs (contrast math), local-voice.mjs (what this OS can say: macOS say / Windows SAPI, PRESENTING), zip.mjs (read an Office archive) + ooxml.mjs (a small XML reader) + pptx.mjs (PowerPoint → sections, JS_API) + template-theme.mjs (a .pptx theme part → a gated theme, DECK_IMPORT) + pptx-write.mjs (the other direction: slides as pictures, notes as notes), voiceover.mjs (batch TTS) + voiceover-server.mjs (tts bridge), publish-voices.mjs (track → bucket + signed manifest, PRESENTING), publish-targets.mjs (Netlify/Vercel deploy adapters, PRESENTING), exec.mjs (one bounded subprocess: every hang names itself), atomic-write.mjs (a temp sibling and a rename, so a
|
|
1247
|
-
crash never truncates a deck), tts-cache.mjs (a sentence is synthesized once — the on-disk cache every engine shares), tts-engines.mjs (gemini/chirp/piper/elevenlabs/say/sapi) + gemini-tts.mjs, elevenlabs-tts.mjs, lipsync.mjs (batch visemes/video) + lipsync-server.mjs (lipsync bridge) + lipsync-engines.mjs (rhubarb, Wav2Lip, SadTalker, and preparing a photo or a film) + lipsync-config.mjs (the talking-head setup, saved once), visemes.mjs (timeline v1), design-system-format.mjs (the design-system package rules, pure, DESIGN_SYSTEMS) + font-format.mjs (the font package rules and the one @font-face writer, pure, FONTS) + semver.mjs (versions and their precedence, UNIT_VERSIONS), video.mjs (deck → narrated mp4, PRESENTING)
|
|
1314
|
+
crash never truncates a deck), tts-cache.mjs (a sentence is synthesized once — the on-disk cache every engine shares), tts-engines.mjs (gemini/chirp/piper/elevenlabs/say/sapi) + gemini-tts.mjs, elevenlabs-tts.mjs, lipsync.mjs (batch visemes/video) + lipsync-server.mjs (lipsync bridge) + lipsync-engines.mjs (rhubarb, Wav2Lip, SadTalker, and preparing a photo or a film) + lipsync-config.mjs (the talking-head setup, saved once), visemes.mjs (timeline v1), design-system-format.mjs (the design-system package rules, pure, DESIGN_SYSTEMS) + design-system-migrations.mjs (what a major renamed, and applying it, DESIGN_SYSTEM_MIGRATIONS) + font-format.mjs (the font package rules and the one @font-face writer, pure, FONTS) + semver.mjs (versions and their precedence, UNIT_VERSIONS), video.mjs (deck → narrated mp4, PRESENTING)
|
|
1248
1315
|
themes/ 46 × <name>.css (the graded + reveal-compat sets; the homage packs moved to the
|
|
1249
1316
|
marketplace, THEME_DISTRIBUTION) + packs.json + gallery.html
|
|
1250
1317
|
dist/ decklight.js (IIFE, global Decklight), decklight.css
|
|
1251
1318
|
demo/ smoke.html (the render harnesses' deck — every feature, including deliberate regression
|
|
1252
|
-
fixtures) + intro.html, features.html, pitch.html, showcase.html + assets/
|
|
1319
|
+
fixtures) + intro.html, features.html, pitch.html, showcase.html + assets/ + northwind/ (an
|
|
1320
|
+
invented company's design system, as a local marketplace) + postmortem/ (the talk the showcase
|
|
1321
|
+
tells, at every stage, and its casts)
|
|
1253
1322
|
test/ node:test units (ansi, builds, math, cast format, the CLI, the marketplace, the pieces lifted out
|
|
1254
1323
|
of engine.js), found by run.mjs rather than a shell glob + 30 headless-Chrome harnesses (render,
|
|
1255
1324
|
player, narration × 5 — live/picker/recorded/segments/record, engine × 8 — themes/palette/
|
|
1256
1325
|
narration/navigation/handover/sources/authoring/builds, record, review, character, pin,
|
|
1257
1326
|
overflow, split, strict, shot, plugin, extension-check, deckfile, pdf, pptx-render, import,
|
|
1258
|
-
theme-config) +
|
|
1327
|
+
theme-config) + verify-shard.mjs (VERIFY_SHARD=i/n: the harnesses dealt out, for CI) +
|
|
1259
1328
|
contrast.mjs and palette-rules.mjs (every shipped theme through tools/theme-check.mjs, and the house palette bar) + the two manual end-to-end scripts neither
|
|
1260
1329
|
blessed suite runs: soak.mjs (pack, install, walk the journey — the release gate) with its
|
|
1261
1330
|
soak-platform.mjs, and video-e2e.mjs (a real ffmpeg render)
|