decklight 0.8.1 → 0.9.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 +666 -0
- package/README.md +224 -150
- package/SPEC.md +732 -886
- package/cli/agent-review.mjs +245 -0
- package/cli/agents.mjs +25 -5
- package/cli/associate.mjs +12 -12
- package/cli/audit.mjs +42 -10
- package/cli/banner.mjs +41 -17
- package/cli/bundle-audio.mjs +183 -0
- package/cli/bundle.mjs +383 -31
- package/cli/cast.mjs +7 -7
- package/cli/check.mjs +961 -0
- package/cli/clone-deck.mjs +179 -0
- package/cli/commands.mjs +345 -0
- package/cli/comments.mjs +64 -18
- package/cli/commit-flow.mjs +44 -19
- package/cli/commit-message.mjs +51 -74
- package/cli/commit-split.mjs +601 -0
- package/cli/deck-refs.mjs +59 -0
- package/cli/deck-routes.mjs +67 -0
- package/cli/deckfile.mjs +3 -5
- package/cli/decklight.mjs +68 -289
- package/cli/design-system-deps.mjs +209 -0
- package/cli/design-system-edit.mjs +194 -0
- package/cli/design-system-refs.mjs +409 -0
- package/cli/design-system.mjs +429 -0
- package/cli/doctor.mjs +115 -0
- package/cli/edit-git.mjs +353 -0
- package/cli/edit-handover.mjs +445 -0
- package/cli/edit-look.mjs +388 -0
- package/cli/edit-slides.mjs +683 -0
- package/cli/edit.mjs +2126 -842
- package/cli/enhance.mjs +483 -0
- package/cli/extension.mjs +10 -10
- package/cli/font-refs.mjs +273 -0
- package/cli/font.mjs +246 -0
- package/cli/git-tree.mjs +1 -1
- package/cli/git.mjs +65 -11
- package/cli/import.mjs +56 -10
- package/cli/init.mjs +400 -234
- package/cli/library.mjs +127 -0
- package/cli/loader.mjs +3 -1
- package/cli/marketplace.mjs +215 -21
- package/cli/narrate.mjs +176 -0
- package/cli/open-browser.mjs +63 -0
- package/cli/open.mjs +943 -0
- package/cli/pdf.mjs +41 -13
- package/cli/pkg.mjs +44 -2
- package/cli/plugin.mjs +43 -41
- package/cli/port-conflict.mjs +53 -23
- package/cli/pptx-export.mjs +57 -24
- package/cli/publish.mjs +8 -4
- package/cli/qr.mjs +1 -1
- package/cli/record.mjs +14 -12
- package/cli/remote.mjs +11 -11
- package/cli/restore.mjs +11 -4
- package/cli/review-ref.mjs +125 -0
- package/cli/review-remote.mjs +92 -48
- package/cli/review-routes.mjs +254 -0
- package/cli/review-store.mjs +47 -7
- package/cli/review-submit.mjs +47 -57
- package/cli/runtime-link.mjs +560 -0
- package/cli/serve.mjs +235 -44
- package/cli/setup.mjs +112 -0
- package/cli/sign.mjs +1 -1
- package/cli/skill-content.mjs +190 -33
- package/cli/skills.mjs +107 -24
- package/cli/start.mjs +110 -0
- package/cli/supervise.mjs +6 -6
- package/cli/theme-refs.mjs +515 -0
- package/cli/theme.mjs +181 -137
- package/cli/trust.mjs +83 -0
- package/cli/units.mjs +39 -42
- package/cli/update-check.mjs +1 -5
- package/cli/upgrade.mjs +194 -28
- package/cli/upstream.mjs +4 -3
- package/cli/util.mjs +4 -4
- package/cli/wizard.mjs +6 -6
- package/dist/build-info.json +1 -1
- package/dist/decklight.css +1126 -49
- package/dist/decklight.js +212 -115
- package/dist/decklight.js.map +4 -4
- package/docs/GLOSSARY.md +141 -0
- package/docs/architecture.svg +17 -17
- package/package.json +4 -2
- package/themes/README.md +9 -8
- package/themes/reveal-solarized.css +10 -0
- package/tools/args.mjs +20 -0
- package/tools/atomic-write.mjs +48 -0
- package/tools/brand-palette.mjs +717 -0
- package/tools/bridge.mjs +1 -1
- package/tools/build-groups.mjs +42 -0
- package/tools/color.mjs +48 -0
- package/tools/deck-html.mjs +396 -11
- package/tools/design-system-format.mjs +753 -0
- package/tools/elevenlabs-tts.mjs +110 -17
- package/tools/exec.mjs +1 -1
- package/tools/extension-check.mjs +31 -7
- package/tools/font-format.mjs +190 -0
- package/tools/font-stacks.mjs +24 -0
- package/tools/gemini-tts.mjs +3 -0
- package/tools/lipsync-config.mjs +103 -0
- package/tools/lipsync-engines.mjs +205 -2
- package/tools/lipsync-server.mjs +264 -41
- package/tools/lipsync.mjs +37 -18
- package/tools/local-voice.mjs +32 -42
- package/tools/narration-manifest.mjs +196 -0
- package/tools/narration-synth.mjs +416 -0
- package/tools/pptx.mjs +776 -19
- package/tools/publish-targets.mjs +1 -1
- package/tools/publish-voices.mjs +3 -3
- package/tools/recording-impact.mjs +7 -3
- package/tools/render-theme.mjs +33 -0
- package/tools/review-anchor.mjs +28 -12
- package/tools/semver.mjs +40 -0
- package/tools/sentences.mjs +180 -0
- package/tools/shot.mjs +14 -7
- package/tools/site-voices.mjs +232 -0
- package/tools/template-theme.mjs +1 -1
- package/tools/test-impact.mjs +17 -10
- package/tools/theme-check.mjs +30 -3
- package/tools/tts-cache.mjs +4 -3
- package/tools/tts-engines.mjs +38 -20
- package/tools/tts-setup.mjs +7 -7
- package/tools/video-options.mjs +34 -0
- package/tools/video.mjs +461 -48
- package/tools/voiceover-server.mjs +185 -104
- package/tools/voiceover.mjs +119 -261
- package/tools/zip.mjs +1 -1
- package/cli/dev.mjs +0 -623
- package/cli/present.mjs +0 -853
- package/cli/review.mjs +0 -361
- package/tools/publish-site-voices.mjs +0 -75
package/SPEC.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Decklight
|
|
1
|
+
# Decklight: Specification v1
|
|
2
2
|
|
|
3
|
-
A presentation library in the Reveal.js tradition, designed to be **authored by AI agents and humans alike**: a deck is
|
|
3
|
+
A presentation library in the Reveal.js tradition, designed to be **authored by AI agents and humans alike**: a deck is one HTML file of slides that *references* the runtime (one JS + one CSS + one theme CSS, served by `decklight <deck>` in either mode from the installed package) and becomes a single self-contained file when it is handed over (`bundle`, `publish`). No build step. Every feature is designed to be **verifiable by a headless render** (the authoring agent can prove a deck works).
|
|
4
4
|
|
|
5
5
|
This document is the contract. All subsystems (core, themes, terminal, demos) build against it.
|
|
6
6
|
|
|
7
|
-
**Sections are named, not numbered.** Every heading below carries a `MNEMONIC
|
|
7
|
+
**Sections are named, not numbered.** Every heading below carries a `MNEMONIC`: that is
|
|
8
8
|
the identifier a code comment, a commit message, a review or a skill file cites, and it is
|
|
9
9
|
the only form that should ever be used. Chapter numbers move whenever a section is
|
|
10
10
|
inserted or split, which silently rots every reference that named one; a mnemonic survives
|
|
@@ -19,15 +19,17 @@ being moved, and it says what it points at.
|
|
|
19
19
|
| `THEMING` · `THEME_DISTRIBUTION` | the token contract, and sharing a theme |
|
|
20
20
|
| `CODE_AND_MATH` | code blocks and LaTeX |
|
|
21
21
|
| `TERMINAL_RECORDINGS` · `RECORDER_CLI` · `CAST_FORMAT` · `TERMINAL_PLAYER` · `ASCIICAST_INTEROP` | truthful terminals |
|
|
22
|
-
| `PRESENTING` |
|
|
22
|
+
| `PRESENTING` · `PRESENTING_NAVIGATION` · `PRESENTING_CHROME` · `PRESENTING_LOOK` · `PRESENTING_MODES` · `PRESENTING_EDITING` · `PRESENTING_VOICE` · `PRESENTING_FIT` · `PRESENTING_OUTPUT` | moving through a deck, the presenter's chrome, themes, write and no-trust mode, editing, the voice, keeping a slide on the slide, and print and export |
|
|
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
|
-
| `MARKETPLACE_REGISTRY` · `VOICE_UNITS` · `AGENT_UNITS` · `ENGINE_UNITS` · `ENGINE_PREREQUISITES` · `UNIT_COMPAT` · `UNIT_PINNING` · `EXTENSIONS_TRANSFORMS` · `EXTENSIONS_CHECK` · `EXTENSIONS_ADAPTERS` | catalogs of themes, templates, skills and engines
|
|
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 |
|
|
27
|
+
| `FONTS` | a typeface's files and licence, from a marketplace, referenced by a deck so its faces travel with it |
|
|
26
28
|
| `REPO_LAYOUT` · `NON_GOALS` | for contributors |
|
|
27
29
|
|
|
28
30
|
---
|
|
29
31
|
|
|
30
|
-
## DECK_ANATOMY
|
|
32
|
+
## DECK_ANATOMY · Deck anatomy
|
|
31
33
|
|
|
32
34
|
```html
|
|
33
35
|
<!doctype html>
|
|
@@ -45,7 +47,7 @@ being moved, and it says what it points at.
|
|
|
45
47
|
<li>First point</li>
|
|
46
48
|
<li>Second — with <strong>bold</strong> and <code>code</code></li>
|
|
47
49
|
</ul>
|
|
48
|
-
<aside class="notes">Speaker notes.
|
|
50
|
+
<aside class="notes">Speaker notes. [click] markers align with builds.</aside>
|
|
49
51
|
</section>
|
|
50
52
|
</div>
|
|
51
53
|
<script src="decklight/dist/decklight.js"></script>
|
|
@@ -55,20 +57,70 @@ being moved, and it says what it points at.
|
|
|
55
57
|
```
|
|
56
58
|
|
|
57
59
|
- Slides are `<section>` children of `.decklight`. Flat list (no vertical nesting in v1).
|
|
58
|
-
- **
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- **
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
- **Two shapes of one deck** (#517, #520). The shape you *author* is **data**: the slides, plus one configuration block (`<script type="application/json" data-decklight-config>{ "decklight": "0.8.1", "theme": "aurora", … }</script>`) and nothing in the file that executes: no runtime, no `Decklight.init` call. `decklight init` and `import` write exactly that; `open`, `--no-trust` and every render reference the installed runtime, its stylesheet and the block's theme into the page on the way out (`PRESENT`), the engine boots itself from the block, the runtime is always the installed one, and a git history of the deck is a history of slides. The block holds everything `init` takes (below), as JSON; `decklight` is the version the deck was written for (the one key that is the file's, not the engine's) and `theme` (default `aurora`) is **the theme the deck opens on**: the server links it into a deck that has no theme of its own, and the runtime selects it among a deck's inline `<style data-theme>` blocks, its own or added ones. The runtime's order is `?gen=`, then `?theme=`, then the pick saved in this browser, then `theme`, then the first block (a deck held to a design system's brand holds the last three to the brand's themes: BRAND_PALETTE); the configured theme is applied without being saved, so it stays a default rather than becoming somebody's pick. Before #547 nothing read it on a deck whose themes are inline blocks (every `upgrade --link` deck, which the server never gives a theme link) so such a deck, and every render of it, opened on its first block whatever the block said. The example above, with its own references and its own `init` call, is the same deck written by hand and is served untouched: a deck that carries the runtime, by reference or embedded, is never given a second one, and `Decklight.init(config)` stays the JS API's escape hatch for a deck that scripts against the engine (`JS_API`). The shape you *hand over* is self-contained: `bundle` and `publish` embed the runtime, stylesheet and themes at that moment, so the file opens from disk, mails, and still plays in ten years, pinned to the version that embedded it, signed and audited as those bytes (`INTEGRITY`). `init --inline` and `import --inline` write the self-contained shape directly for anyone who needs a file that double-clicks; `upgrade --link` turns one back into data. The cost of the data shape is pinning: it runs whatever is installed, which is why behavioural change stays behind the configuration and `--no-trust --audit` says when the deck's recorded version and the served runtime differ by a major.
|
|
61
|
+
- **Markdown slides were removed in 0.3.0.** `data-markdown` + a `<script type="text/template">` body was a second authoring surface for the same DOM, and it earned its bundle: `marked`, a `::: build` directive, a parallel notes syntax, a `` ```chart `` fence that existed only because a nested `</script>` cannot live in a template, and a math path that had to extract every span *before* the parse so TeX underscores would not become emphasis. HTML is the one surface now. A deck still carrying `data-markdown` sections would render them EMPTY (the template is a `<script>` no browser paints) so the engine recognises the attribute for exactly long enough to refuse out loud: it marks the section `data-markdown-removed` (assertable headlessly) and warns per slide, naming the slide number. It parses nothing.
|
|
62
|
+
- Speaker notes: `<aside class="notes">`. Two markers inside them are timing, never words: `[click]` cuts the notes into beats, one per build step (BUILDS), and `[pause]` holds a let-it-sink-in beat where it stands (PRESENTING); `[long pause]` is two of them, and `[short pause]` (ElevenLabs' own spelling) is one. **Who holds a pause depends on the voice:** one that acts on audio tags (ElevenLabs v3/v4, `audioTags`) is sent it as `[pause]` / `[long pause]` inside the sentence and holds it in its own breath, in one clip; for every other engine decklight holds it itself: cuts the sentence there and joins the pieces with silence, live and in a recording. A beat of nothing but pauses has no words to send, so decklight holds it on every engine. **Square brackets are the form decklight writes** (the scaffold, the notes editor's text and its save, a recording's `.txt` script), the way a script for a voice is written. **Any spelling a person writes is the same marker**: `[click]`, `<click>`, `⟨CLICK⟩`, `[pause]`, `<pause>`, `⟨PAUSE⟩`, in any case, typed as text, escaped (`<pause>`), or written as an element in the deck's HTML (which the runtime reads as the marker, not as the nothing `textContent` sees); so is a marker whose brackets are entities (`⟨CLICK⟩`). `[slow]` is not a marker (decklight does not pace the voice itself) but an audio tag like any other, below; `<slow>` and `⟨SLOW⟩` read as that tag, and a closing `[/slow]` as nothing, never read aloud. Only those exact words match: `[1]`, `[ ]` and `<script>` in a note stay prose. The canonical forms read, and hash, exactly as they always have: the hash is taken over the marker, never its spelling, so rewriting `⟨CLICK⟩` as `[click]` re-voices nothing; a spelling that used to be spoken aloud is now the marker, so a recorded slide that carried one is stale once. Any other square-bracketed words (`[whispers]`, `[laughs]`, `[nervous laugh]`, `[door slams]`) are an **audio tag**: direction for a voice that can act on one (ElevenLabs `eleven_v3`, `eleven_v4`, `eleven_v4_turbo`; an engine says so as `audioTags`), sent to it as written; **any other engine never hears it**: the live bridge and the recorder take it out, and a beat or slide that is nothing but tags and pauses has no take on any engine. A tag is never a caption or a subtitle, and the speaker view shows it as a cue. Brackets around anything but letters (`[1]`, `[2024]`) are not a tag.
|
|
63
|
+
- **Module markers** (optional): `data-module="<title>"` on a section marks the
|
|
64
|
+
start of a chapter, and every slide after it belongs to that chapter until the
|
|
65
|
+
next marker: the nearest PRECEDING marker wins, so a deck needs one only
|
|
66
|
+
where a chapter begins. `decklight bundle --all` writes them when it merges a
|
|
67
|
+
playlist of files into one deck, and **an author may write them by hand for
|
|
68
|
+
the same effect**: nothing reads where they came from. The runtime shows the
|
|
69
|
+
current chapter in the slide-number chrome (clicking it opens the finder), the
|
|
70
|
+
slide finder shows the deck as a foldable outline of them (`PRESENTING`), and the
|
|
71
|
+
palette navigates between them. A marked section is still an ordinary slide;
|
|
72
|
+
it is shown, numbered and presented like any other.
|
|
73
|
+
- **Sources** (`SLIDE_SOURCES`, optional): `<aside class="sources">`, a sibling
|
|
74
|
+
of the notes aside, holding what the slide is standing on: a `<dl>` of named
|
|
75
|
+
facts (owner, last reviewed, the document a claim came from) and a `<ul>` of
|
|
76
|
+
links, each optionally followed by a few words about it. Ordinary `<dl>` and
|
|
77
|
+
`<ul>`, because both already mean exactly this in HTML: nothing here invents a
|
|
78
|
+
syntax to learn or a parser to go wrong, and an agent can write it.
|
|
79
|
+
**Hidden on the slide and read in the inspector** (`I`, `PRESENTING`), whose
|
|
80
|
+
sources section lists them under the slide's other facts. Being reachable
|
|
81
|
+
from a key is the whole difference from the other two asides: **notes are for the
|
|
82
|
+
person talking, and where to read more is for the person listening**, so this
|
|
83
|
+
ships in the deck a reader is handed rather than being stripped from it. The
|
|
84
|
+
links are real `<a target="_blank" rel="noopener">` rows, so they can be
|
|
85
|
+
opened in a new tab, copied or middle-clicked like any link.
|
|
86
|
+
**In write mode they are written in their own editor**: `e` in the inspector
|
|
87
|
+
(or the palette's *Add sources to this slide…* / *Edit sources on this
|
|
88
|
+
slide…*) opens a draft, a card in the same panel slot as the inspector, with
|
|
89
|
+
its own tab, (rows of named facts and rows of
|
|
90
|
+
link/title/note) and `⏎` saves it through `POST /deck/edit/slide/sources` as **one undo
|
|
91
|
+
entry**, `esc` leaving the deck exactly as it was. A link is written only if
|
|
92
|
+
its scheme is one a reference can honestly be (`http`, `https`, `mailto`, or
|
|
93
|
+
a path): `javascript:` and `data:` are executable, this aside TRAVELS, and an
|
|
94
|
+
editor that will write an executable link is one that will eventually write
|
|
95
|
+
somebody else's. A refused link is **named in the toast** rather than
|
|
96
|
+
disappearing. Clearing every row removes the aside instead of leaving an
|
|
97
|
+
empty one.
|
|
98
|
+
**A source bigger than what the slide uses names the part it uses**, so a
|
|
99
|
+
reader lands where the claim is rather than at page one of a long document:
|
|
100
|
+
the link points into the source (a PDF page with `#page=12`, a section of a
|
|
101
|
+
web page by its anchor or a `#:~:text=` fragment) and the note says how much
|
|
102
|
+
(`pp. 12–14`, `lines 40–88`, `the Enterprise tier`). A local file is linked
|
|
103
|
+
by its path relative to the deck. Nothing checks either; they are what makes
|
|
104
|
+
the aside worth following.
|
|
105
|
+
It is not a comment (`REVIEW`): a comment is what somebody thinks for now and
|
|
106
|
+
is answered and resolved, while a source is true until the source changes,
|
|
107
|
+
so it lives in the section and travels with it through `bundle` and `publish`.
|
|
108
|
+
`aside.sources` is named in the same `display: none` rule as the other two,
|
|
109
|
+
which is the list of asides that are NOT the slide; a new kind renders on the
|
|
110
|
+
slide until it is added there.
|
|
111
|
+
- **Rehearse notes** (optional, build-time authored): a condensed cue-card variant of the notes for the speaker view's rehearse mode (PRESENTING): a few words per segment instead of full prose, with **exactly the same ⟨CLICK⟩ segmentation** as the notes so build-step highlighting aligns. `<aside class="rehearse">` as a sibling of the notes aside. Slides without a rehearse aside fall back to the full notes in rehearse mode.
|
|
112
|
+
- **Subtitle**: the `<p>` immediately following a slide's leading `h1`/`h2` is auto-marked `.subtitle` and gets one canonical look (muted, 0.72em). Opt out per slide with `data-subtitle="none"` on the section; an author-placed `class="subtitle"` is respected as-is. Don't bake subtitle text into diagram SVGs; author it as this `<p>` so it themes and scales with the deck.
|
|
113
|
+
- **Background media**: `data-background-image="hero.jpg"` on a section renders the image full-bleed behind the slide's content: `data-background-size="cover|contain"` (default cover), `data-background-position` (default center). `data-background-dim="0.5"` lays a canvas-colored (`--bg`) overlay between the media and the content so text stays readable over arbitrary photos. `data-background-video="clip.mp4"` plays a muted looping `playsinline` clip while the slide is active: play/pause is driven from the engine's slide event, so a deactivated slide's video is *paused*, not merely hidden; `data-background-poster="poster.jpg"` is its stand-in still (required for print, PRESENTING). The engine injects the layer as an idempotent `.slide-bg` first child on `sync()`: absolutely positioned below the content, so backgrounds never count against the overflow guardrail (PRESENTING) and transitions/auto-animate carry them for free. `class="full-bleed"` on an `<img>` gives a *content* image the same cover-the-slide treatment (absolute inset-0, object-fit cover, under the in-flow text); images inside split layouts (PRESENTING) are capped (object-fit contain, max-height) so a tall photo can't blow the slide. `decklight bundle` inlines `data-background-image`/`data-background-poster` as data: URIs like `<img src>`; background videos stay external with a CLI notice (PRESENTING).
|
|
114
|
+
- **Bleed** (#643): a slide's background art fills the **screen**, not just the stage. The stage keeps its design size (`width`×`height`, 1280×720) and is scaled to fit without changing shape, so a 16:9 deck on a 16:10 laptop or a 4:3 projector has bands above and below (66 px a side at 1512×982); and art painted inside the slide used to stop at the stage's edge, the bands showing the theme's `--bg`. Now one layer behind the stage (`.decklight-bleed`, `src/core/bleed.js`), covering the viewport, paints the **current** slide's art: its background media (the image with its own size and position resolved against the viewport (`cover`, centred, by default) or a muted clone of its video, the on-stage clip paused) or a slide template's art (the element its template marks `data-ds-bleed`, `DESIGN_SYSTEMS`: its computed background, resolved against the viewport). While a slide bleeds it carries `data-bled` and its on-stage copy of the art is hidden: never drawn twice at two scales; overview and finder thumbnails, being clones elsewhere, keep theirs. The **content** stays on the stage: titles, pins, splits, slots and the overflow guardrail measure exactly as before, and at 16:9 nothing moves. The layer cross-fades with the slide transition; a slide with no art clears it. Never in print, `?print`, `pdf`, `pptx` or `video` (16:9 frames, nothing to fill), nor in an embedded preview (the theme picker's, the speaker view's panes); `"bleed": false` in the config keeps the hard letterbox edge for a deck that wants it.
|
|
115
|
+
|
|
116
|
+
**Hidden slides** (`HIDDEN_SLIDES`): `<section data-hidden>` is a slide the audience does not see. It **keeps its number**, as in PowerPoint, so everything that numbers slides file-side (comments, review anchors, history) stays in step; presenting steps over it, a deep link onto it lands on the nearest shown neighbour in the direction of travel, the overview shows it dimmed and badged so an author can find it, and `pdf`, `pptx`, `video` and `voiceover` produce nothing for it. `?all` presents hidden slides too, never the default, because hidden is hidden from the audience and the default is the audience. The command palette carries both halves: **Hidden slides show / skip** flips `?all` (the row exists only when the deck has something hidden), and in write mode **Hide this slide / Unhide this slide** writes `data-hidden` onto the current section through the edit server (`POST /deck/edit/slide/hidden`, one undo entry, the same door as a layout pick) and steps off it. `decklight import` keeps a PowerPoint hidden slide as one rather than dropping it.
|
|
117
|
+
|
|
118
|
+
### SLIDE_DENSITY · How much goes on a slide
|
|
67
119
|
|
|
68
120
|
The overflow guardrail (PRESENTING) is the **late** failure. It fires once content is
|
|
69
121
|
already clipped, which is a different and worse problem than "fits, but nobody
|
|
70
|
-
can read it from the back of the room".
|
|
71
|
-
|
|
122
|
+
can read it from the back of the room". These are the rules, and the budgets
|
|
123
|
+
below are also counted (see the end of this section):
|
|
72
124
|
|
|
73
125
|
- **One idea per slide.** If the title needs an "and", it is two slides.
|
|
74
126
|
- **~3–4 bullets, or ~2 short paragraphs, per column.** Past that, split the
|
|
@@ -81,10 +133,26 @@ so it is a rule rather than a check:
|
|
|
81
133
|
fit is telling you something. Take the note.
|
|
82
134
|
|
|
83
135
|
This matters most for an agent authoring twenty slides in one pass with no
|
|
84
|
-
human looking until the end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
136
|
+
human looking until the end: every slide renders, so the overflow guardrail
|
|
137
|
+
never fires.
|
|
138
|
+
|
|
139
|
+
**Counted, and marked like overflow** (`src/core/density.js`). As it lays the
|
|
140
|
+
deck out, the runtime counts each column (a split slide's two sides, a split
|
|
141
|
+
list's two halves, otherwise the slide) and marks a crowded section
|
|
142
|
+
`data-dense="<why>"`, the way the guardrail marks `data-overflow`: more than 5
|
|
143
|
+
bullets (nested ones count), more than 2 paragraphs (the subtitle under a title
|
|
144
|
+
is not one), a paragraph over 50 words, more than 80 words of prose, or the
|
|
145
|
+
section's own type shrunk below 1em (`style="font-size:0.85em"`). The budgets
|
|
146
|
+
are the rule's "~" plus one step of grace, because a check that fires on the
|
|
147
|
+
fifth bullet is one people learn to ignore. Prose means what a reader reads off
|
|
148
|
+
the slide: headings, speaker notes, code, diagrams, charts, terminal casts and
|
|
149
|
+
tables are left out. `data-dense-ok` on a section says it is meant (a reference
|
|
150
|
+
slide), like `data-scroll-ok` for overflow. Three readers, one count:
|
|
151
|
+
`decklight check` reports a marked slide as `crowded`, a **warning** that never
|
|
152
|
+
fails the run; the palette's **Check deck…** lists it (PRESENTING); and the
|
|
153
|
+
Inspector's Info tab says *crowded* for the slide on screen.
|
|
154
|
+
|
|
155
|
+
### COMPARISON_SLIDES · Comparison slides (pros / cons, this-vs-that)
|
|
88
156
|
|
|
89
157
|
The most common structured slide, and the one with a trap in it. Use `split`
|
|
90
158
|
(PRESENTING) with **two sibling blocks and an optional third as a footer**:
|
|
@@ -106,12 +174,12 @@ The most common structured slide, and the one with a trap in it. Use `split`
|
|
|
106
174
|
|
|
107
175
|
<p><strong>Alternatives:</strong> Mercurial; Jujutsu</p>
|
|
108
176
|
|
|
109
|
-
<aside class="notes">Pros first, then the two that bite.
|
|
177
|
+
<aside class="notes">Pros first, then the two that bite. [click] Alternatives briefly.</aside>
|
|
110
178
|
</section>
|
|
111
179
|
```
|
|
112
180
|
|
|
113
181
|
The two `<div>`s become the columns and **share a top edge**; the trailing `<p>`
|
|
114
|
-
becomes a full-width centred footer under both. Nothing else is needed
|
|
182
|
+
becomes a full-width centred footer under both. Nothing else is needed, in
|
|
115
183
|
particular:
|
|
116
184
|
|
|
117
185
|
> **Do not combine `data-layout="split"` with your own column flexbox.** A
|
|
@@ -119,27 +187,27 @@ particular:
|
|
|
119
187
|
> `data-layout="split"` gives the slide two layout systems arguing: the split
|
|
120
188
|
> row's own alignment overrides the space `[data-pinned]` reserves for the
|
|
121
189
|
> pinned title, the columns shrink, every bullet wraps, and the footer is
|
|
122
|
-
> pushed off the bottom. Pick one
|
|
190
|
+
> pushed off the bottom. Pick one: `split`, or your own shell with **no**
|
|
123
191
|
> `data-layout`. This is a real deck that shipped that way; the overflow
|
|
124
192
|
> guardrail caught it, which is why PRESENTING asks you to check.
|
|
125
193
|
|
|
126
194
|
The engine flags the mixed state itself, not just its symptom: a `split`
|
|
127
195
|
section with a content block that computes to a **row** flexbox is marked
|
|
128
|
-
`data-split-conflict
|
|
129
|
-
(PRESENTING)
|
|
196
|
+
`data-split-conflict`, assertable headlessly exactly like `data-overflow`
|
|
197
|
+
(PRESENTING), with one console warning naming the slide, and `decklight pdf`'s
|
|
130
198
|
audit names such slides beside the overflowing ones. Cycling a layout onto such
|
|
131
|
-
a slide with
|
|
199
|
+
a slide with the bar's **Layout** button says so in the toast. Column-direction flex inside a
|
|
132
200
|
block is fine: it stacks, it does not take sides.
|
|
133
201
|
|
|
134
202
|
Three columns is deliberately not a shape here (PRESENTING). Two and a footer, or
|
|
135
|
-
another slide
|
|
203
|
+
another slide: see SLIDE_DENSITY for why.
|
|
136
204
|
|
|
137
|
-
## BUILDS
|
|
205
|
+
## BUILDS · Builds (Keynote-style; Reveal calls these fragments)
|
|
138
206
|
|
|
139
|
-
Design goal: **the container opts in, the engine does the rest
|
|
207
|
+
Design goal: **the container opts in, the engine does the rest**: one attribute on the
|
|
140
208
|
container, zero classes on the items.
|
|
141
209
|
|
|
142
|
-
### BUILD_AUTHORING
|
|
210
|
+
### BUILD_AUTHORING · Authoring
|
|
143
211
|
|
|
144
212
|
| Syntax | Meaning |
|
|
145
213
|
|---|---|
|
|
@@ -148,22 +216,23 @@ container, zero classes on the items.
|
|
|
148
216
|
| `data-build="fade-up"` | entrance style (see 2.3) |
|
|
149
217
|
| `data-build-order="3"` | explicit step index within the slide (default: document order) |
|
|
150
218
|
| `data-build-stay` on a child of a `data-build` container | child is exempt (stays static) |
|
|
219
|
+
| `data-draw-stops="347 542 767"` on a stroke in a `draw` build | one stroke drawn in stages: path lengths, or fractions of the total when every value is ≤ 1 (or written `25%`): step k draws to stop k, the arrowhead riding each stage, a reversed build retracting stage by stage (a build provider, so a deep link lands on the right stop); with `data-build-order="N"` on the stroke its stops take the keys N, N+1, …, so an element carrying the same key fades in on the click that draws to that stop (BUILD_PROVIDER_API). A staged stroke is **paced by length**, 300 path units per second by default (a 300 px stage takes a second, never less than the flat draw duration), so a longer stage takes longer, where the flat 660 ms read as a swoosh; `data-draw-speed="400"` (path units per second) sets the pace exactly |
|
|
151
220
|
|
|
152
|
-
### BUILD_SEMANTICS
|
|
221
|
+
### BUILD_SEMANTICS · Engine semantics
|
|
153
222
|
|
|
154
223
|
- All build steps on a slide form one ordered sequence (document order, overridden by `data-build-order`; ties advance together).
|
|
155
224
|
- Navigation: `→`/`Space`/click advances one step; `←` reverses; arriving from the previous slide shows step 0 (nothing built); arriving *backwards* from the next slide shows all steps built.
|
|
156
|
-
- Hidden steps: `visibility: hidden` (not `display:none
|
|
225
|
+
- Hidden steps: `visibility: hidden` (not `display:none`, layout must not shift).
|
|
157
226
|
- Events: `decklight:build` fires with `{slide, index, total, direction}`.
|
|
158
|
-
- URL: `#/<slide>/<step>` deep-links to a build state. A slide change **pushes** a history entry and a build step **replaces** one, so Back leaves a slide rather than unwinding its builds. The writes are **coalesced to one per settled position** and then **verified**: WebKit caps history writes at 100 per 10 seconds and counts `pushState` and `replaceState` against the same budget, so one write per keypress meant a held arrow key silently exhausted it and left the URL on an earlier slide
|
|
227
|
+
- URL: `#/<slide>/<step>` deep-links to a build state. A slide change **pushes** a history entry and a build step **replaces** one, so Back leaves a slide rather than unwinding its builds. The writes are **coalesced to one per settled position** and then **verified**: WebKit caps history writes at 100 per 10 seconds and counts `pushState` and `replaceState` against the same budget, so one write per keypress meant a held arrow key silently exhausted it and left the URL on an earlier slide, *permanently*, since only a further navigation would have resynced it and at the end of a deck there are none (#328). Coalescing is both the fix and what stops the budget being spent; a write that still does not land is retried once on the next frame, because a dropped one used to go unnoticed. Blink and Gecko have no such limit, which is why this needed a deck driven under WebKit to find (`npm run cross-engine`).
|
|
159
228
|
|
|
160
|
-
### BUILD_ENTRANCES
|
|
229
|
+
### BUILD_ENTRANCES · Entrance styles
|
|
161
230
|
|
|
162
|
-
`fade` (default) · `fade-up` · `fade-down` · `zoom` · `pop` (overshoot) · `draw` (SVG paths/lines: stroke-dashoffset animation; non-stroke elements fall back to fade) · `highlight` (element already visible; step emphasizes it: accent outline + others dim) · `none` (instant).
|
|
231
|
+
`fade` (default) · `fade-up` · `fade-down` · `zoom` · `pop` (overshoot) · `draw` (SVG paths/lines: stroke-dashoffset animation; non-stroke elements fall back to fade; **Line Draw**: a stroke with a `marker-end` (or `marker-start`) draws with its arrowhead riding the tip from the first frame, oriented along the path, on straight lines and curves alike, and un-draws with the head on the retracting tip, the way Keynote's Line Draw carries an arrowhead (#522): the marker's content becomes a head placed by the same frame loop that advances the dash offset, since a CSS transition on each would drift apart; the head is **revealed to the drawn length** while it is still short of the head's own reach (#527): a Line Draw grows out of a point, shaft and head as one silhouette, and retreats into it on the way back, rather than a full-size head standing on the origin on the first frame; `marker-mid`, and a marker on a shape that is not a path, wait at the endpoint until the stroke has drawn; a **dashed stroke draws dashed** (#737): its authored `stroke-dasharray` stays on from the first frame, the stroke revealed through an engine-made `<mask>` rather than drawn by its own dash offset, so there is no solid line snapping to dashes at the end, and it retracts dashed; `?print`, the overview and instant application show the finished stroke with its one head) · `highlight` (element already visible; step emphasizes it: accent outline + others dim) · `none` (instant).
|
|
163
232
|
|
|
164
233
|
All entrance styles are CSS-driven (`.build-step[data-build-state="done|current|pending"]`), duration via `--build-duration` (theme-overridable, default 300ms).
|
|
165
234
|
|
|
166
|
-
### BUILD_PROVIDER_API
|
|
235
|
+
### BUILD_PROVIDER_API · Build Provider API (for subsystems)
|
|
167
236
|
|
|
168
237
|
Complex widgets (code stepping, terminal player) register **build providers** instead of DOM steps:
|
|
169
238
|
|
|
@@ -175,9 +244,9 @@ Decklight.registerBuildProvider(element, {
|
|
|
175
244
|
});
|
|
176
245
|
```
|
|
177
246
|
|
|
178
|
-
The engine interleaves provider steps into the slide's sequence at the element's document position. Providers must be idempotent (`apply` may be called with any index in any order
|
|
247
|
+
The engine interleaves provider steps into the slide's sequence at the element's document position; or, when the element carries `data-build-order="N"`, at the explicit keys N, N+1, …, so a DOM step sharing one of those keys advances together with that provider step (#524; a staged stroke's stops tied to the boxes they reach). Providers must be idempotent (`apply` may be called with any index in any order, e.g. deep links).
|
|
179
248
|
|
|
180
|
-
## SVG_DIAGRAMS
|
|
249
|
+
## SVG_DIAGRAMS · SVG diagrams (first-class)
|
|
181
250
|
|
|
182
251
|
- Inline SVG is the canonical diagram format. `data-build` on `<svg>` or a `<g>` makes direct-child groups progressive (exactly the pattern from BUILD_AUTHORING).
|
|
183
252
|
- **Theme-aware diagrams**: themes define diagram tokens (THEMING). Diagrams authored with
|
|
@@ -185,12 +254,30 @@ The engine interleaves provider steps into the slide's sequence at the element's
|
|
|
185
254
|
`var(--d-accent)` re-color automatically across all 46 shipped themes.
|
|
186
255
|
Hardcoded-color SVGs still work; they just don't adapt.
|
|
187
256
|
- `data-build="draw"` on groups animates strokes (paths, lines, polylines) via dash-offset.
|
|
188
|
-
-
|
|
189
|
-
- **
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
257
|
+
- **A diagram is built, by default.** One that lands whole hands the audience the entire picture before the speaker has said its first part, so `decklight check` and Check deck… (PRESENTING) give a **hint** (never a failed run) for an authored `<svg>` diagram, three drawn shapes or more with a `<text>` label among them and outside a chart or a terminal, that has no build on it or inside it. A still picture that is meant says so with `data-static-ok` on the svg or on its section. An illustration with no words in it is drawn, not explained, and asks for nothing.
|
|
258
|
+
- **Lines that draw**, the rules an author (or an agent) writes to (BUILD_ENTRANCES has the engine's side):
|
|
259
|
+
- A shape draws when it has a stroke (`stroke` as an attribute, inline, or inherited from its group) and a length: a `path`, `line`, `polyline`, `polygon`, `circle`, `ellipse` or `rect`. A shape with no stroke, and every `text`, fades in once the strokes of its step have drawn.
|
|
260
|
+
- An arrowhead is a `<marker>` referenced by `marker-end` (or `marker-start`) on the stroke. It rides the drawing tip; the marker is sized as the bullet above says. Put the head on the stroke, never as a separate shape at the end of the line, or it stands there before the line arrives.
|
|
261
|
+
- A dashed line is `stroke-dasharray` on the stroke, as an attribute or in its `style`. It draws dashed, start to finish, and retracts dashed. A dash pattern set from a stylesheet class is not seen by the draw and would draw solid, then snap.
|
|
262
|
+
- One line in stages is `data-draw-stops` on the stroke (BUILD_AUTHORING), with `data-build-order` to tie the boxes it reaches to the clicks that reach them.
|
|
263
|
+
- A line is one step when it is a direct child of the `data-build="draw"` container, or part of a step when it sits inside a direct-child `<g>` with the box it points at: group a line with its box when they should arrive together, keep it a direct child when the line is its own beat.
|
|
264
|
+
- The engine adds nodes of its own beside a drawing stroke, a `.draw-head` for a riding arrowhead and a `.draw-mask` for a dashed line. They are never in the file: an agent reading the rendered DOM must not copy them into the deck, and write mode, the colour picker and the inspector skip them.
|
|
265
|
+
- **Arrowheads**: a `<marker>` is sized in MULTIPLES OF THE STROKE, not in pixels: SVG's `markerUnits` defaults to `strokeWidth`, so `markerWidth`/`markerHeight` are scaled by the `stroke-width` of the line that references them. The shipped pattern is `markerWidth="6" markerHeight="4" refX="5" refY="2"` over `points="0 0, 6 2, 0 4"`: a head six strokes long and four across, its tip one stroke past the line's end, which stays proportionate across the 1.5–2.5 stroke widths diagrams are drawn at. Multiply those numbers by the stroke to predict the rendered size (9×6 px on a 1.5 line); an 8×6 marker is a 12×9 px head on that same line, which is what reads as oversized. `markerUnits="userSpaceOnUse"` sizes a head in absolute units instead, and it then no longer tracks the line.
|
|
266
|
+
- The runtime namespaces `id` attributes inside each inline `<svg>` at init (prefix `svg{n}-`, rewriting `url(#…)` and `href="#…"` refs): the defs-collision bug class is eliminated at the engine level.
|
|
267
|
+
- **Nested fills** (#541): a filled shape drawn inside a filled shape (a box on a panel) is painted a tone step of its container's slot, `var(--d-fill-N-in)`: the same hue, one OKLab lightness step toward the ink (`color-mix(in oklab, var(--d-fill-N) 82%, var(--d-text))` by default, a theme's own value when it declares one; `--d-fill-N-in2` is the step below that, and the deepest, deeper nesting stays there), so the boxes read as the panel's *children* and two panels of different colours hold two visibly different families. The pass (`applyNesting`, src/core/svg.js) runs when a slide is displayed (activation, print, an overview clone) since containment is geometric: a shape whose authored fill is a plain slot token takes the tone of the innermost **earlier-painted** filled shape whose bounding box (in the svg's own space, transforms included) holds its own; a big shape painted last is an overlay, never a panel, and `fill="none"` is never a container. `data-concept` wins over nesting (a `tools` box inside an `agent` panel stays tools-coloured); any fill that is not a plain slot token is left alone; `data-nest="off"` on a shape or a group opts out; `data-nest="on"` takes a shape the box test misses (rotated) by its centre; `fill: var(--d-fill-in)` on a child means "my container's nested tone" outright, so re-slotting the panel re-slots its children. Idempotent across `sync()`: the authored fill is remembered on the shape. Charts are never nested: their series are slots, not panels.
|
|
268
|
+
- **Labels are edited in place** (write mode): a double-click on a `<text>`, or on one `<tspan>` line of a label of several, or `⏎` on one selected, lays a text box over the label in its own font, size, weight and ink, the label hidden under it and the shape beneath still showing; the box grows from the label's `text-anchor`, so a centred label stays centred while it is typed. `⏎` or leaving the box saves, `Esc` gives up, and the deck's keys stand aside meanwhile. SVG text takes no `contenteditable`, which is why it is a box and not the label itself. The save is `POST /deck/edit/element/text` `{ slide, index, path, tag, was, text }`, addressed the way the colour card addresses a shape (the file's element-child path, the engine's own nodes skipped, the tag the page found): only the words between that one node's tags change, the whitespace the file has around them is kept, `<`, `>` and `&` are escaped, and the diagram's markup is never re-serialised, so `viewBox`, self-closing shapes and the file's layout survive byte for byte. The save is in place: the label shows the new words, nothing reloads, other pages do. One undo entry, the undo chord takes it back. Refused: a `<text>` that holds `<tspan>` lines (each line is its own label, and the page asks for one), a label the file no longer says (`was` differs: a 409, reload), anything but a `<text>` or `<tspan>`, a line break (SVG text does not wrap), more than 400 characters, and an empty label (it could not be clicked again; the page keeps the old words). A chart's labels are drawn from its data and are not offered.
|
|
269
|
+
- **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
|
+
**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* and where to give it one.
|
|
273
|
+
- **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
|
+
- **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
|
+
- **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.
|
|
276
|
+
- **Suggested.** The same words on boxes on two or more slides, painted in two or more colours and not all one concept already, are a **hint**: Check deck… (PRESENTING) lists it on the first such slide (*"Other" is on slides 5 and 6 in 2 colours: make it the "other" concept*), and in write mode **⏎** on it attaches every one of those shapes to the concept (named from the label: `Rate limiter` → `rate-limiter`, or the concept some of them already wear). The runtime stamps the same suggestions on the print view's root (`data-concept-hints`) and `decklight check` prints each as a `hint`, which never fails the run. The colour card's **Fill** side on a concept shape is a notice instead of a palette, since a fill picked there would be painted over on the next load: pin the slot, or **Detach from concept**. `decklight check` warns (`concept-fill`) when a concept shape also carries a fill of its own.
|
|
277
|
+
|
|
278
|
+
### CHARTS · Charts (`data-chart`)
|
|
279
|
+
|
|
280
|
+
Declarative charts from inline JSON: a chart IS a theme-aware SVG diagram, generated at init instead of drawn by hand. No chart library, no images, no new theme tokens.
|
|
194
281
|
|
|
195
282
|
```html
|
|
196
283
|
<div class="chart" data-chart="bar" data-title="Latency by release" data-build="draw">
|
|
@@ -202,29 +289,29 @@ Declarative charts from inline JSON — a chart IS a theme-aware SVG diagram, ge
|
|
|
202
289
|
</div>
|
|
203
290
|
```
|
|
204
291
|
|
|
205
|
-
- **Types**: `bar` (grouped), `line`, `area`, `pie` (`donut` is an alias; `"donut": true` also works).
|
|
206
|
-
- **Colors come exclusively from the THEMING diagram tokens**: series *i* → `--d-fill-i` (cycling past 6), axes `--d-stroke`, labels `--d-text`, gridlines `--d-muted`. Value labels sit on the slice fills, which is exactly the `--d-text`-against-every-fill contrast gate `test/contrast.mjs` already enforces
|
|
207
|
-
- **Ink**: the `--d-fill` panels sit deliberately close to the canvas (gated for text ON them, never against `--bg`), so charts use the hand-drawn-diagram box idiom
|
|
208
|
-
- **Concepts**: `"concept": "agent"` on a series emits `data-concept` on that series' `<g>`, resolved by the ordinary SVG_DIAGRAMS concept pinning
|
|
209
|
-
- **Builds**: the wrapper's authored `data-build` moves onto the generated `<svg>`, which emits one `<g>` per series
|
|
292
|
+
- **Types**: `bar` (grouped), `line`, `area`, `pie` (`donut` is an alias; `"donut": true` also works), and **`scatter`**. Scatter is the one whose x is a *measurement* rather than a category, so it takes `"points": [[x, y], …]` per series instead of `"data"`, no `"labels"` at all, and optional `"x"` / `"y"` axis titles (a scatter with two unnamed numeric axes is a picture of nothing in particular); a pair that is not two finite numbers is dropped rather than drawn at zero, and a series left with none of them is a refusal. The others use a category x-axis; ~5-tick linear y-axis with nice-number bounds, zero always on the grid; pie/donut renders slices with outside name labels and on-slice percentage labels. An inline legend appears automatically on multi-series axis charts (`"legend": false` opts out, `true` forces one). Out of scope in v1: CSV input, stacked bars, dual axes, tooltips/interactivity.
|
|
293
|
+
- **Colors come exclusively from the THEMING diagram tokens**: series *i* → `--d-fill-i` (cycling past 6), axes `--d-stroke`, labels `--d-text`, gridlines `--d-muted`. Value labels sit on the slice fills, which is exactly the `--d-text`-against-every-fill contrast gate `test/contrast.mjs` already enforces: every shipped and generated theme colors charts correctly with zero chart-specific work.
|
|
294
|
+
- **Ink**: the `--d-fill` panels sit deliberately close to the canvas (gated for text ON them, never against `--bg`), so charts use the hand-drawn-diagram box idiom: bars, slices and legend swatches are outlined with `--d-stroke`, and every line/area stroke rides on a `--d-stroke` casing under its fill-colored core. Series identity lives in the fill slot; legibility lives in the ink, in every theme.
|
|
295
|
+
- **Concepts**: `"concept": "agent"` on a series emits `data-concept` on that series' `<g>`, resolved by the ordinary SVG_DIAGRAMS concept pinning: bar/slice/area fills and dot fills repaint, a line's core stroke recolors via the `fill="none"` rule above, and the casing sits one group deeper so the ink is never repainted.
|
|
296
|
+
- **Builds**: the wrapper's authored `data-build` moves onto the generated `<svg>`, which emits one `<g>` per series: the BUILD_AUTHORING SVG-container semantics apply untouched, so series step in per ⟨CLICK⟩ with no build provider. `data-build="draw"` draws each series' ink (bar/slice outlines, line casings and cores) via the BUILD_ENTRANCES dash-offset machinery, while fills, dots and labels materialize on the existing `draw-fade` channel: nothing of a series is visible before its step.
|
|
210
297
|
- **Sizing**: `viewBox` 640×360 by default; `data-aspect="4:3"` (or an `"aspect"` JSON key, `"w:h"`) overrides the height. The chart scales to its container width and behaves as an ordinary content block in split layouts and `?print`.
|
|
211
|
-
- **Errors are visible**: invalid input (bad JSON, unknown type, a pie with two series, …) renders a `.chart-broken` error box naming the problem
|
|
298
|
+
- **Errors are visible**: invalid input (bad JSON, unknown type, a pie with two series, …) renders a `.chart-broken` error box naming the problem (the terminal player's broken-box idiom), never a blank slide, never a console explosion.
|
|
212
299
|
|
|
213
|
-
## MOTION
|
|
300
|
+
## MOTION · Motion
|
|
214
301
|
|
|
215
|
-
### SLIDE_TRANSITIONS
|
|
216
|
-
`transition: 'none' | 'fade' | 'slide' | 'scale' | 'flip'
|
|
302
|
+
### SLIDE_TRANSITIONS · Slide transitions
|
|
303
|
+
`transition: 'none' | 'fade' | 'slide' | 'scale' | 'flip'`: deck-level config, per-slide override `data-transition`. Duration `--transition-duration` (default 350ms). Reduced-motion: all transitions collapse to `none` under `prefers-reduced-motion`.
|
|
217
304
|
|
|
218
|
-
### AUTO_ANIMATE
|
|
305
|
+
### AUTO_ANIMATE · Auto-animate (Magic Move)
|
|
219
306
|
- `data-auto-animate` on two adjacent sections.
|
|
220
307
|
- Matching: elements sharing `data-id`; unmatched elements fade in/out.
|
|
221
308
|
- Animated properties: position/size (FLIP transform), opacity, color, background, border-radius, font-size. Works for HTML and inline-SVG elements (x/y/width/height via transform).
|
|
222
309
|
- Duration `--auto-animate-duration` (default 500ms).
|
|
223
310
|
|
|
224
|
-
### ELEMENT_ANIMATIONS
|
|
225
|
-
`data-animate="pulse | float | shake | spin | blink | bounce | swing | glow | breathe"
|
|
311
|
+
### ELEMENT_ANIMATIONS · Element animations
|
|
312
|
+
`data-animate="pulse | float | shake | spin | blink | bounce | swing | glow | breathe"`: looping attention animations, start when the slide becomes active (and only then; pause on inactive slides). Respect reduced-motion.
|
|
226
313
|
|
|
227
|
-
## THEMING
|
|
314
|
+
## THEMING · the token contract
|
|
228
315
|
|
|
229
316
|
`decklight.css` = structure only (layout, builds, navigation chrome, print). A theme = one CSS file defining tokens on `.decklight`:
|
|
230
317
|
|
|
@@ -241,88 +328,83 @@ Themes set (all required):
|
|
|
241
328
|
| Accent | `--accent`, `--accent-contrast` (text on accent) |
|
|
242
329
|
| Blocks | `--block-bg`, `--block-border`, `--block-radius`, `--shadow` |
|
|
243
330
|
| Code | `--code-bg`, `--code-fg`, plus highlight token colors `--hl-keyword`, `--hl-string`, `--hl-number`, `--hl-comment`, `--hl-function`, `--hl-type`, `--hl-punct` |
|
|
244
|
-
| Diagram | `--d-stroke`, `--d-text`, `--d-muted`, `--d-accent`, `--d-fill-1` … `--d-fill-6` |
|
|
331
|
+
| Diagram | `--d-stroke`, `--d-text`, `--d-muted`, `--d-accent`, `--d-fill-1` … `--d-fill-6`; optionally the nested tones `--d-fill-1-in` … `--d-fill-6-in` (derived from the slot and the ink when absent, SVG_DIAGRAMS) |
|
|
245
332
|
| Terminal | `--term-bg`, `--term-fg`, `--term-prompt`, `--term-cursor`, `--term-selection`, ANSI 16: `--ansi-black` … `--ansi-bright-white` |
|
|
246
333
|
| Builds | optionally override `--build-duration`, dim level `--dim-opacity` |
|
|
247
334
|
|
|
248
335
|
Requirements for the shipped themes:
|
|
249
336
|
- Body text ≥ WCAG AA contrast on `--bg`; code tokens ≥ AA on `--code-bg` (validated by `test/contrast.mjs`).
|
|
250
|
-
- **Diagram ink clears the diagram panels**: `--d-text` ≥ 3.0 and `--d-muted`/`--d-accent` ≥ 2.6 against **every** `--d-fill-1..6`, not just the canvas
|
|
337
|
+
- **Diagram ink clears the diagram panels**: `--d-text` ≥ 3.0 and `--d-muted`/`--d-accent` ≥ 2.6 against **every** `--d-fill-1..6`, not just the canvas: labels sit on the fills, and a theme can pass every canvas gate while its boxes are unreadable (the gameboy lesson). Enforced by `test/contrast.mjs` on shipped themes and by the generator's property tests.
|
|
338
|
+
- **A nested box clears its panel** (#541): for every slot, the nested tone (`--d-fill-N-in`, the theme's or the derived default) sits at least 0.06 OKLab lightness off `--d-fill-N` and carries `--d-text` at ≥ 3.0: a theme can pass every ink gate while a box nested in its panel vanishes into it. Same enforcement, in `tools/theme-check.mjs` so a theme outside the repo is judged the same way; a theme whose ink has no headroom toward the tone declares its own `-in` values (reveal-solarized does).
|
|
251
339
|
- Variety: ≥10 dark, ≥10 light, ≥4 serif-headed, ≥4 gradient/duotone canvases, ≤2 that are safe-corporate-boring.
|
|
252
340
|
- Fonts: system stacks or bundled-safe Google-font `@import` (deck authors may be offline: every theme must degrade to a system stack gracefully).
|
|
253
341
|
|
|
254
|
-
Runtime-**generated** themes (PRESENTING, `⌃T`) satisfy the same contract: `src/core/themegen.js` derives every token with WCAG luminance math and iterates until all of `test/contrast.mjs`'s gates pass
|
|
342
|
+
Runtime-**generated** themes (PRESENTING, `⌃T`) satisfy the same contract: `src/core/themegen.js` derives every token with WCAG luminance math and iterates until all of `test/contrast.mjs`'s gates pass: a generated theme can never fail validation (property-tested across seeds in `test/themegen.test.mjs`).
|
|
343
|
+
|
|
344
|
+
Generation also follows **codified palette rules** (R1–R8 in `themegen.js`), distilled from the most-loved editor themes (Solarized, Nord, Catppuccin, Gruvbox) and the 60-30-10 doctrine, each enforced by an independent property test:
|
|
345
|
+
- **R1 limited palette**: one base hue plus the harmony's ≤5 accent hues, reused across every role (syntax, links, diagram fills); never a fresh hue per token.
|
|
346
|
+
- **R2 quiet dominant areas**: the canvas stays near-neutral; chroma belongs to small accents, not large surfaces.
|
|
347
|
+
- **R3 dimmed pastels**: vivid rolls are biased toward muted and saturation is hard-capped below neon.
|
|
348
|
+
- **R4 one accent lightness band**: accent-family colors share a starting lightness and saturation, so no color shouts louder than its peers.
|
|
349
|
+
- **R5 selective contrast**: syntax roles differ by hue at similar brightness, not by brightness spikes.
|
|
350
|
+
- **R6 no pure black or white**: every neutral carries the base-hue tint.
|
|
351
|
+
- **R7 gradients sparingly**: ~15% of rolls, low-drift same-family washes only.
|
|
352
|
+
- **R8 semantic anchors**: terminal red/green/yellow keep their recognizable hue even when muted (the green band admits olive: Solarized's green is h68, Gruvbox's h63).
|
|
353
|
+
|
|
354
|
+
The **shipped themes conform to the same rules**, graded by `test/palette-rules.mjs` (part of `npm run verify`; R7 is graded on the collection, gradient canvases ≤ 30% of the set). A theme may opt out of a rule where conformance would break its identity (official brand colors, an intentional duotone canvas) by declaring the exception *in the theme file* with a reason: `rule-exception: R2 official Polar→Glow brand gradient canvas is the identity`. Undeclared violations fail the grader; declared ones are printed with every run so they stay reviewable.
|
|
355
|
+
|
|
356
|
+
### THEME_DISTRIBUTION · Distributing a theme
|
|
255
357
|
|
|
256
|
-
|
|
257
|
-
- **R1 limited palette** — one base hue plus the harmony's ≤5 accent hues, reused across every role (syntax, links, diagram fills); never a fresh hue per token.
|
|
258
|
-
- **R2 quiet dominant areas** — the canvas stays near-neutral; chroma belongs to small accents, not large surfaces.
|
|
259
|
-
- **R3 dimmed pastels** — vivid rolls are biased toward muted and saturation is hard-capped below neon.
|
|
260
|
-
- **R4 one accent lightness band** — accent-family colors share a starting lightness and saturation, so no color shouts louder than its peers.
|
|
261
|
-
- **R5 selective contrast** — syntax roles differ by hue at similar brightness, not by brightness spikes.
|
|
262
|
-
- **R6 no pure black or white** — every neutral carries the base-hue tint.
|
|
263
|
-
- **R7 gradients sparingly** — ~15% of rolls, low-drift same-family washes only.
|
|
264
|
-
- **R8 semantic anchors** — terminal red/green/yellow keep their recognizable hue even when muted (the green band admits olive — Solarized's green is h68, Gruvbox's h63).
|
|
358
|
+
A theme travels as what it already is: **one CSS file**. There is no registry, and the file carries no version number. A marketplace entry that offers it may (`UNIT_VERSIONS`), which is an install fact about the entry, never something the file or a deck records. The distribution unit is the file (a repo, a gist, the `.css` that `⌃⇧T` downloads), and compatibility with a runtime *is* passing that runtime's check. When the contract grows a token, the check names exactly what an older theme is missing.
|
|
265
359
|
|
|
266
|
-
|
|
360
|
+
**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:
|
|
267
361
|
|
|
268
|
-
|
|
362
|
+
```json
|
|
363
|
+
{ "decklight": "0.9.0", "theme": "acme",
|
|
364
|
+
"markedThemes": ["acme@acme-themes"], "themeSources": { "acme-themes": "acme/decklight-themes" } }
|
|
365
|
+
```
|
|
269
366
|
|
|
270
|
-
**
|
|
271
|
-
from a marketplace carries `data-theme-marketplace` (the catalog's kebab `name`
|
|
272
|
-
— the identity a later dedup or upgrade would key on) and, when the catalog
|
|
273
|
-
supplied an optional manifest `title`, `data-theme-source` (what a human reads).
|
|
274
|
-
The theme picker groups by the first, labels by the second, and falls back to
|
|
275
|
-
the kebab name and then to **Added** — which stops being the catch-all every
|
|
276
|
-
runtime install fell into and becomes what it always meant: a theme from a raw
|
|
277
|
-
URL, a local file, or a hand-authored block. **Nothing is derived**: guessing
|
|
278
|
-
"Confluent" out of `decklight-confluent` breaks for `acme-themes` and would put
|
|
279
|
-
decklight in the business of naming other people's catalogs. Both values are
|
|
280
|
-
escaped on the way in — a manifest is somebody else's file and the attributes
|
|
281
|
-
are double-quoted.
|
|
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.
|
|
282
368
|
|
|
283
|
-
|
|
284
|
-
travels**: opened on a machine where that marketplace was never registered there
|
|
285
|
-
is nothing to consult, and a group heading that disappears when you send someone
|
|
286
|
-
the file would be worse than none. The consequence is a disclosure and it is
|
|
287
|
-
deliberate — a deck installed from `acme-internal` names that catalog to whoever
|
|
288
|
-
opens it. A catalog whose *name* is sensitive should not be named in a deck: omit
|
|
289
|
-
`title`, or do not use this. `data-theme-added` stays on every installed block,
|
|
290
|
-
so decks written before this keep working and keep showing under **Added**.
|
|
369
|
+
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.
|
|
291
370
|
|
|
292
|
-
|
|
371
|
+
`bundle` and `publish` **inline** every marked theme, as a `<style data-theme="<name>" data-theme-added data-theme-marketplace=…>` block (a reference to a marketplace means nothing to whoever opens the file) alongside the shipped theme the deck plays with; `--theme <name>` sets the one the file opens on, and a marked theme that cannot be resolved fails the bundle rather than quietly changing its look. A served page never gains a second copy of a theme it already carries a block for.
|
|
293
372
|
|
|
294
|
-
|
|
295
|
-
- **`decklight theme add <file|url> <deck.html>`** validates and then installs, refusing anything the shipped set would not be allowed to contain — a deck is never left carrying a broken theme, and a file that fails leaves the deck byte-for-byte unchanged. It reads from disk or over https, takes `--name` to install under another name, and `--dry-run` to report without writing.
|
|
373
|
+
**Where a marked theme came from travels with it.** Its link and its bundled block carry `data-theme-marketplace` (the catalog's kebab `name`, the identity a later dedup or upgrade would key on) and, when the catalog supplied an optional manifest `title`, `data-theme-source` (what a human reads). The theme picker groups by the first, labels by the second, and falls back to the kebab name and then to **Added**, what it always meant: a theme from a hand-authored block. **Nothing is derived**: guessing "Confluent" out of `decklight-confluent` breaks for `acme-themes` and would put decklight in the business of naming other people's catalogs. Both values are escaped on the way in: a manifest is somebody else's file and the attributes are double-quoted. A bundle opened on a machine where that marketplace was never registered still draws the right heading, because the heading is in the file. The consequence is a disclosure and it is deliberate: a deck that marks a theme from `acme-internal` names that catalog to whoever opens it. A catalog whose *name* is sensitive should not be named in a deck: omit `title`, or do not use this.
|
|
296
374
|
|
|
297
|
-
|
|
375
|
+
- **`decklight theme gate <file|url>`** runs the token contract and the WCAG gates (`tools/theme-check.mjs`: the same function `test/contrast.mjs` runs over the shipped themes, so the two can never drift) on any file, so a theme author outside this repo can prove their file is contract-complete before sharing it.
|
|
376
|
+
- **`decklight theme add <name|name@marketplace|file|url> <deck.html>`** marks a **shipped** theme by name as it is (it passed the contract when it shipped); anything else it validates and then **marks**, refusing anything the shipped set would not be allowed to contain. A theme that fails leaves the deck byte-for-byte unchanged. A marketplace theme is marked where it is (a bare name resolves when exactly one marketplace has it). A file or a URL has no marketplace to be referenced in, so it is first copied into the **personal marketplace**, `~/.decklight/local/` (an ordinary local marketplace, registered as `local` the first time it is needed, deliberately outside `~/.decklight/marketplaces/` so `marketplace remove local` can never delete it) and marked as `<name>@local`; `--name` names it there, and re-adding a file replaces its copy (re-adding **is** the update path). A marked name is never a shipped theme's name, nor another marked theme's. `--dry-run` reports without writing.
|
|
377
|
+
- **`decklight theme remove <name|name@marketplace> <deck.html>`** unmarks, except the theme the deck opens on, which would leave it opening on nothing.
|
|
298
378
|
|
|
299
|
-
**
|
|
379
|
+
**Marketplace themes while authoring** (`THEME_BROWSE#UI`, write mode only, `PRESENTING`). The picker lists **every theme of every registered marketplace**, each marketplace a pack under its title, from the **cache only**: `marketplace update` is the one thing that fetches a catalog, so a deck on conference wifi, a plane, or air-gapped lists exactly what it has and **names the marketplaces it could not read** rather than looking short. (The first-party marketplace is registered-not-fetched by design and therefore always in that state on a fresh install, which is why silence there would be the common case looking broken.) Any of them can be previewed and applied: the page links it on demand from the same path a marked theme is served at. **Space** marks the selected one, or unmarks it (`POST /deck/edit/theme/mark`, one undo entry); marking runs `theme add`'s own validator, so **a theme the command line would refuse is refused here, by the same code**, and the picker stays up with the contract problems in its caption. An export or a publish with an **unmarked** theme on screen is refused with `409 { unmarked }` rather than handed over in a theme the deck does not carry; choosing the row again marks it and carries on across the reload the mark causes. A manifest's `source` never reaches the player. A presented deck lists the themes it marks and nothing else: everyone who opens it sees the same list.
|
|
300
380
|
|
|
301
|
-
|
|
381
|
+
**Sharing a deck, as opposed to a theme**: prefer the link. A published deck is served from an origin, over https, by a host the recipient already trusts. The channel is the attestation, and nothing about a URL asks them to decide whether a file is safe to open. When a file has to travel instead (email, an air-gapped room, a conference laptop), send a `.decklight`: it carries the signature with it, and opening it with decklight on the other end checks it. A bare `.html` attachment is the weakest of the three and should be the last resort; it attests to nothing and runs with no policy at all.
|
|
302
382
|
|
|
303
|
-
|
|
383
|
+
An added theme (linked for a marked theme, a bundle's inline copy, or a block an older `theme add` pasted into a deck, which keeps working) carries `data-theme-added`, which is what distinguishes it from the deck's own inline theme blocks: without that distinction a link-mode deck that gained one added theme would flip to inline mode and its whole theme list would collapse to that single file (and a data deck carrying only added themes would lose its base theme link). Added themes therefore behave like saved customs, extra entries in the list, applied by media toggle, and work identically in both modes. They cycle with `,`/`.` and resolve from `?theme=`.
|
|
304
384
|
|
|
305
|
-
|
|
385
|
+
## CODE_AND_MATH · Code & math
|
|
386
|
+
|
|
387
|
+
- `<pre><code class="language-sql">…</code></pre>`: highlighting via bundled highlight.js
|
|
306
388
|
(languages: sql, js, ts, python, bash/shell, yaml, json, java, go, rust, html/xml, css, plaintext), themed through the `--hl-*` tokens (no separate hljs theme files).
|
|
307
389
|
- **Line stepping**: `data-lines="1|3-5|all"` on the `<pre>` → registers a build provider with one step per segment; non-highlighted lines get `--dim-opacity`. `data-lines-numbers` shows line numbers.
|
|
308
390
|
- Escaping rule for authors: use `<` inside code blocks.
|
|
309
391
|
- **Math** (`data-math` on the section): LaTeX math renders at init to MathML Core via
|
|
310
|
-
bundled [Temml](https://temml.org)
|
|
392
|
+
bundled [Temml](https://temml.org): no per-deck build step, no network fetch, no
|
|
311
393
|
webfonts (evergreen browsers render MathML natively; `?print` output included).
|
|
312
394
|
Delimiters: `$$…$$` display, `\(…\)` inline.
|
|
313
395
|
Single-`$` is **deliberately not a delimiter** (currency false positives:
|
|
314
396
|
"between $5 and $10" is prose, not math); a literal dollar next to real math is
|
|
315
|
-
written `\$`. Math inside code
|
|
397
|
+
written `\$`. Math inside code (fenced blocks, inline spans, `<pre><code>`) is
|
|
316
398
|
left alone, as are speaker asides (notes are spoken) and SVG text. Sections without `data-math`
|
|
317
|
-
are never scanned
|
|
399
|
+
are never scanned: zero cost, zero behavior change. A TeX parse error renders as
|
|
318
400
|
a visible red error span, never a broken init. Math is core, not a plugin (NON_GOALS).
|
|
319
401
|
|
|
320
|
-
## TERMINAL_RECORDINGS
|
|
402
|
+
## TERMINAL_RECORDINGS · Terminal recordings
|
|
321
403
|
|
|
322
|
-
### RECORDER_CLI
|
|
404
|
+
### RECORDER_CLI · Recorder CLI (authoring-time; the only part with native deps)
|
|
323
405
|
|
|
324
|
-
`cli/cast.mjs`, invoked as `npx decklight@latest cast <script.term.yaml> [-o out.cast.json]`. It briefly shipped as `rec`, a name dropped with **no alias and no refusal stub
|
|
325
|
-
(the `decklight` dispatcher in `cli/decklight.mjs` also provides `
|
|
406
|
+
`cli/cast.mjs`, invoked as `npx decklight@latest cast <script.term.yaml> [-o out.cast.json]`. It briefly shipped as `rec`, a name dropped with **no alias and no refusal stub**: it reads as an abbreviation of `record`, and `decklight narrate --mic` now records the author's VOICE, so keeping it alive would mean keeping a name that quietly means the opposite of what its reader assumes. Nothing is released against it, so there is nothing to migrate. `cast` was already the word: the file is `.cast.json`, the format is CAST_FORMAT, `refresh` takes casts and `export` flattens one
|
|
407
|
+
(the `decklight` dispatcher in `cli/decklight.mjs` also provides `bundle`,
|
|
326
408
|
and a global `--help`; the per-file entry points still run directly, undocumented).
|
|
327
409
|
|
|
328
410
|
Script format:
|
|
@@ -364,17 +446,17 @@ failures as content (prompts and error output are often the point).
|
|
|
364
446
|
|
|
365
447
|
**Secrets**: a secret send is written to the PTY for real but stored as `▓▓▓` in the
|
|
366
448
|
cast's `input` record, and its value is auto-added to that step's output redaction.
|
|
367
|
-
Prefer the `$ENV` form
|
|
449
|
+
Prefer the `$ENV` form: it resolves from the recorder's environment at run time, so
|
|
368
450
|
`--refresh` keeps working. Literal secret values (and script-`env` entries a `$NAME`
|
|
369
451
|
secret refers to) are scrubbed to `▓▓▓` in the embedded script; refreshing such a cast
|
|
370
452
|
requires the operator to provide the value via the environment.
|
|
371
453
|
|
|
372
|
-
**Refresh**: the cast embeds the full script. `decklight refresh <dir|cast…>` re-executes
|
|
454
|
+
**Refresh**: the cast embeds the full script. `decklight cast refresh <dir|cast…>` re-executes
|
|
373
455
|
every embedded script and rewrites casts whose output changed; prints a drift summary.
|
|
374
|
-
(Note: a cast that records the state of the repository it lives in
|
|
456
|
+
(Note: a cast that records the state of the repository it lives in (e.g. `git status`)
|
|
375
457
|
converges over two refreshes, since the rewrite itself changes that state.)
|
|
376
458
|
|
|
377
|
-
### CAST_FORMAT
|
|
459
|
+
### CAST_FORMAT · Cast format (`.cast.json`, version 1)
|
|
378
460
|
|
|
379
461
|
```json
|
|
380
462
|
{
|
|
@@ -395,9 +477,9 @@ converges over two refreshes, since the rewrite itself changes that state.)
|
|
|
395
477
|
|
|
396
478
|
The format stays `decklightCast: 1`: every addition (`hidden`, `typeSpeed`, `input`,
|
|
397
479
|
sleep steps) is an optional field that old casts simply lack and the player treats as
|
|
398
|
-
absent
|
|
480
|
+
absent: no compatibility break in either direction.
|
|
399
481
|
|
|
400
|
-
### TERMINAL_PLAYER
|
|
482
|
+
### TERMINAL_PLAYER · Player (runtime; zero native deps)
|
|
401
483
|
|
|
402
484
|
```html
|
|
403
485
|
<div class="terminal" data-cast="casts/demo.cast.json" data-mode="step"></div>
|
|
@@ -406,20 +488,20 @@ absent — no compatibility break in either direction.
|
|
|
406
488
|
<script type="application/json" id="my-cast">{ "decklightCast": 1, … }</script>
|
|
407
489
|
```
|
|
408
490
|
|
|
409
|
-
- `data-mode="step"` (default): registers a build provider
|
|
491
|
+
- `data-mode="step"` (default): registers a build provider: each advance **types the command**
|
|
410
492
|
(synthesized keystrokes, 80–135ms jitter, each landing with a synthesized switch sound: data-type-sound="thocky" (default) | "creamy" | "clacky" | "off") then streams its real
|
|
411
493
|
output with recorded pacing compressed to ≤2.5s per step (`data-max-step` override).
|
|
412
494
|
Provider is idempotent: `apply(i)` renders steps `< i` instantly-complete, animates step `i` if
|
|
413
495
|
reached by a forward advance, clears the rest.
|
|
414
496
|
- **Typing sound**: a subtle synthesized key click accompanies each typed character
|
|
415
|
-
(WebAudio
|
|
497
|
+
(WebAudio: a ~35ms bandpassed noise tick with jittered pitch/level, no asset;
|
|
416
498
|
spaces land deeper, with more bass). Three voicings, `data-type-sound="thocky"`
|
|
417
499
|
(default) | `"creamy"` | `"clacky"`, or `"off"` to mute. A `♪ voice` titlebar button
|
|
418
500
|
lets the presenter cycle thocky → creamy → clacky → off live; that choice persists per
|
|
419
501
|
deck in localStorage and overrides the authored value. Degrades to silence where audio
|
|
420
502
|
is unavailable.
|
|
421
503
|
- **Typing speed**: `data-type-speed` is a `1` (slow) … `10` (fast) scale, default `5`
|
|
422
|
-
(the classic pace; the mapping is exponential
|
|
504
|
+
(the classic pace; the mapping is exponential: 1 ≈ ⅓×, 10 ≈ 4×, and factor 1 reads at
|
|
423
505
|
~55 wpm). A `⌨ n wpm` titlebar button lets the presenter cycle the speed live through
|
|
424
506
|
words-per-minute presets (30 … 160); that choice persists per deck in localStorage and
|
|
425
507
|
overrides the authored value on every terminal (which maps to the nearest preset).
|
|
@@ -439,132 +521,192 @@ absent — no compatibility break in either direction.
|
|
|
439
521
|
- A scrollback cap (default 24 rows visible, older lines scroll) with themed chrome
|
|
440
522
|
(`--term-*`), rounded window with fake traffic lights (theme may hide via `--term-chrome: none`).
|
|
441
523
|
|
|
442
|
-
### ASCIICAST_INTEROP
|
|
524
|
+
### ASCIICAST_INTEROP · asciicast v2 interop
|
|
443
525
|
|
|
444
|
-
- **Export**: `decklight export <cast.json> [-o out.cast]` flattens a decklight cast to
|
|
445
|
-
asciicast v2 NDJSON
|
|
526
|
+
- **Export**: `decklight cast export <cast.json> [-o out.cast]` flattens a decklight cast to
|
|
527
|
+
asciicast v2 NDJSON: prompt and typed command injected as output events
|
|
446
528
|
(deterministic 45ms/char typing), step boundaries as `m` marker events, hidden steps
|
|
447
529
|
omitted, sleep steps as pure time gaps. Unlocks the asciinema ecosystem:
|
|
448
530
|
`agg out.cast demo.gif` for READMEs, asciinema.org sharing, asciinema-player embeds.
|
|
449
531
|
- **Import**: `data-cast` also accepts a plain asciicast v2 file (detected by shape,
|
|
450
|
-
not extension). Imported streams are `raw
|
|
532
|
+
not extension). Imported streams are `raw`: they already contain prompts and echoed
|
|
451
533
|
input, so the player injects nothing. With `m` markers the recording is step-capable
|
|
452
534
|
(one build per marker); without markers it plays as a single timeline (`data-mode="step"`
|
|
453
535
|
falls back to `play`).
|
|
454
536
|
|
|
455
|
-
## PRESENTING
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
- **
|
|
464
|
-
-
|
|
465
|
-
- **
|
|
466
|
-
-
|
|
467
|
-
- **
|
|
468
|
-
- **
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
537
|
+
## PRESENTING · Presenting & output
|
|
538
|
+
|
|
539
|
+
One section with eight parts, each its own mnemonic: `PRESENTING_NAVIGATION`, `PRESENTING_CHROME`, `PRESENTING_LOOK`, `PRESENTING_MODES`, `PRESENTING_EDITING`, `PRESENTING_VOICE`, `PRESENTING_FIT`, `PRESENTING_OUTPUT`. `PRESENTING` still names the whole.
|
|
540
|
+
|
|
541
|
+
### PRESENTING_NAVIGATION · Moving through a deck
|
|
542
|
+
|
|
543
|
+
- Keyboard: `→/←/Space` steps+slides, `Home/End`, `O` overview grid (in write mode it rearranges the deck: drag a slide to a new place, and each cell carries new, duplicate and delete), `B` blackout, `F` fullscreen (and `⌘⏎` / `Ctrl+Enter`, the present chord, which a card that is open keeps for its save), `⇧F` shows or hides the previous/next arrows and the slide number **in fullscreen** (also a Settings row and a palette row; shown by default, remembered per deck in `decklight-fs-chrome:`; out of fullscreen they always show), `T` theme picker (`,`/`.` cycle the theme, `[`/`]` cycle the font), editing is on in write mode: a bar along the bottom names every editing door (Text, Picture, Layout, Notes, Slide ▾, Undo, Redo, Lock), a click selects an element, and a right-click opens its menu, `⌘Z`/`⌘⇧Z` on a Mac, `Ctrl+Z`/`Ctrl+⇧Z` elsewhere undo/redo deck edits (write mode), `A` ask an AI agent to edit the deck (write mode), `/` command palette, **`⎵` pauses and resumes the voice while it is speaking** and **`V`** opens the panel that holds everything else about it: track, live voice, engine, tone, character, recording, captions, speed. Recording walks **all the slides or a picked range**: the recorder view's first row, **Slides**, opens the same range picker the video export uses (`src/core/ranges.js`: this slide, this chapter, from here, up to here, or typed), starts from `?slides=a-b` when `decklight narrate --mic --slides` opened the deck, and leaves every slide outside the range exactly as it was. `⎵` takes the key only while the narration is **in play**, never to start it: a deck that merely carries a track keeps `⎵` as the advance key, because presenting a narrated deck by hand is ordinary and a space bar that began narrating over the presenter would be a derailment in front of an audience rather than a stumble. Nothing is lost by the narrowing (a playing track advances the deck itself, so `⎵` is free exactly when the voice wants it) and starting stays deliberate: the palette's **Narration play** is the unconditional verb from any state, and the panel has the track. `→`/`PageDown`/click always advance. The predicate is answered synchronously, because a keypress cannot wait on a probe. `<`/`>` change the voice speed in 0.25× steps, 0.25–2×, persisted per deck (YouTube's shortcut), `C` captions, `W` pen / `⇧W` laser pointer (draw on the slide, `⌫` clears), `` ` `` messages, `G` slide/module finder (deliberately not `⌘F`: browser find stays untouched), `H` deck history: the commits, which of them are only on this machine, a live preview, and `⏎` to restore one (write mode). In **present** mode `H` is the deck update instead (`NO_TRUST#UPSTREAM`), `?` help overlay.
|
|
544
|
+
- **←/→ move the deck while a panel has the keyboard**: the notes, the inspector, the sources, the comments, the agent and the HTML editor, floating or docked, never keep a bare `←` or `→`; only a text field does, for its caret. What the arrows did used to depend on the panel and on how it was docked.
|
|
545
|
+
- **Esc closes any panel**, with one press, from wherever the focus is: the page, a button in the panel, or one of its text boxes. A panel whose own keys do not answer Esc is closed by the deck's dispatcher, the one place every panel's keys pass through, and every box in a panel answers Esc itself, because the deck's key handler never hears a key typed into a field. Help (`?`) and the debug log (`D`), which take no keys, close on it too. Nothing typed is lost: a draft lives in its panel's state, not in the box (the comments box is the same node across closes). A selection is the one thing let go of first: with an element selected in the inspector, Esc steps back to the slide, and the next one closes it. The `escapeall` render harness opens every panel through its door and presses Esc once on the focused element, and once in each of its boxes.
|
|
546
|
+
- Touch: swipe navigation.
|
|
547
|
+
- **Pinch zoom**: a pinch zooms the **slide**, never the page. On a trackpad a pinch arrives as a `wheel` event with `ctrlKey` (every browser), on a touch screen as two fingers; the engine takes both (`preventDefault`, so the browser does not zoom the whole page) and multiplies the stage's fit transform by a factor, 1 to 4, zooming about the point under the fingers. Only the stage is transformed, so every panel, bar, overlay and caption keeps its size (`--stage-scale`, which sizes the captions, stays the fit scale). While zoomed, a plain two-finger scroll pans, bounded so the stage never leaves the window, and a one-finger swipe pans rather than turns the slide. **The percentage shows**, top right (on the slide number's row, to its left, while editing), for as long as the slide is not at fit: a zoomed slide looks like a slide, and that chip is what says why the edges are missing; a click on it fits, like `0`. A zoom is a look closer, not a setting: it is not persisted, and `0`, `Esc` (before Esc closes anything), a slide change, or pinching back below 1 snap it to fit, and the chip goes with it. The gesture is the slide's where the fingers are over the slide or the letterbox around it: over a panel beside it (the notes card, the inspector) or over a picker or the overview it zooms nothing, and the page still never zooms; a docked panel being open is no reason not to zoom the slide next to it. Nothing happens in print or an embedded preview. `instance.zoom()` reads it and `instance.setZoom(k)` sets it.
|
|
548
|
+
- URL: `#/<slide>[/<step>]`; back/forward supported. `?theme=<name>` loads any theme at startup.
|
|
549
|
+
- **Command palette**: `/` opens the palette: every command with its shortcut, type-to-filter, `Enter` runs, `Esc` clears then closes. **Every command sits at the root, named by its category** (`src/core/palette.js`), the way VS Code's command palette reads: `Go to: Find slide…`, `Slide: Duplicate this slide`, `Voice: Live voice…`, `Share: Export to PDF…`. With no query the list runs category by category (Go to, Slide, Edit, Look, Voice, Present, Review, Git, Share, Help, Preferences) and in written order within each; there are no groups to drill into. Typing matches the category, the name and the aliases, every typed word in any order, so `share` narrows to that category, `voice live` finds `Voice: Live voice…` and `handout` finds both the PDF handout and the print handout. The best match leads: a name or title that starts with what was typed, then one whose title holds every word, then one found only through an alias. **One rule for write mode**: a row that changes the file, or needs the edit server to run, exists only while the deck can be written, and carries a **write** tag; the one exception is the lock row, which stays while the deck is locked because it is how you unlock it. Argument commands (Theme…, Font…, Narration…, Find slide…) drill into their pickers; contextual commands appear only when applicable (Save generated theme, Marketplace themes, the Configure ⟨engine⟩ wizard rows, Copy style and Paste style with a selection). Inline arguments work: `goto 27`, or just typing `27`, surfaces a “Go to slide 27 / N” row (clamped to the deck), and selecting the bare “Go to slide…” command keeps the palette open with `goto ` prefilled. Text whose words start no command falls back to a “Search slides for …” row that opens the finder with the query prefilled.
|
|
550
|
+
- **Slide finder**: reached from the palette (`/` → Enter, or the search fallback): a find-a-slide overlay with the picker's anatomy, a query bar and result list on the left, a live preview of the selected slide on the right. Typing filters as an AND over the query's words against each slide's text; slides whose **title** contains every word rank first, body-only matches follow, and every match is listed as `<slide number> · <title>` (slides without a heading fall back to their leading text). `↑/↓`/hover browse (the preview swaps live), `Enter`/click jumps to the slide, `Backspace` edits, `Esc` clears the query then closes. The preview reuses the picker's lazy embedded-deck mechanism: the iframe boots once (carrying the active theme, generated/custom included via `?gen=`), then selections postMessage `{__decklightPreview: {goto: [slide, step]}}` into it; no reload per candidate. **A multi-module deck's finder is its outline**: on a deck carrying in-file
|
|
551
|
+
`data-module` markers (`DECK_ANATOMY`) and nothing typed, `G` shows each chapter
|
|
552
|
+
as a `▸ <title> — module · N slides` row folding its own slides, from the
|
|
553
|
+
marked slide up to the next marker, underneath it, with any slides before the
|
|
554
|
+
first chapter left top-level. It opens folded except for the chapter you are
|
|
555
|
+
standing in, cursor on your slide. `→` unfolds a chapter (and steps into an open
|
|
556
|
+
one), `←` folds it (and climbs from a slide back to its chapter), and the
|
|
557
|
+
`▸`/`▾` glyph folds in place on a click; `⏎` or a click on the row itself still
|
|
558
|
+
goes there: a `goto()` in this file, which the caption says (`module — <title>
|
|
559
|
+
(slide N of this deck)`). **Typing drops the fold** and shows the flat ranked
|
|
560
|
+
list, chapters matching as titles, because a query's answer is sorted by
|
|
561
|
+
relevance and a tree would hide half of it; clearing the query returns to the
|
|
562
|
+
outline unfolded on the chapter of whatever was selected. Only for the in-file
|
|
563
|
+
shape: a `config.playlist` deck is untouched, the two never coexisting. Before
|
|
564
|
+
this a 150-slide merge showed ten chapter rows bolted onto a flat dump of every
|
|
565
|
+
slide. The chapters were visible, but they organised nothing.
|
|
566
|
+
- **Playlist (multi-deck navigation)**: `Decklight.init({ playlist: { modules: [{title, href}…], index: n } })`. Advancing past the last build of the last slide navigates to the next module (`href#/1/0`); reversing before slide 1 goes to the previous module's end (`href#/999/999`, oversized hashes clamp to the last slide/step). The other modules appear as rows in the **slide finder** (`G`): marked `▸ <title> — module`, previewed like any slide, and `Enter` loads that file; the slide-number chrome shows the module title and opens the finder on click. There is no separate module menu: "go somewhere" is one question with one answer. Works on `file://` with relative hrefs; embedded instances never chain.
|
|
567
|
+
|
|
568
|
+
### PRESENTING_CHROME · What sits over the slides while you talk
|
|
569
|
+
|
|
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
|
+
- **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
|
+
- **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
|
+
- **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
|
+
- **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 left of `1`, matched on `code` so it is the same physical key on every layout; or the palette's "Messages"): the deck talks back in the **top-left corner**: 20px, high-contrast, stacked newest-last (at most 4 at a time), each fading after a few seconds. Every message is also KEPT: that key opens the log (the full history with arrival times) because a message that explains why the voice stopped is worthless if it faded while you were looking at the slide. The shortcut is handled BEFORE the typing guard, so `` ⌃` ``/`` ⌥` `` reach you even while the notes editor has focus and owns every bare keystroke; the bare key works whenever you are not typing. `instance.messages()` returns `[{ at, text }]`, `instance.toggleMessages()` opens the log.
|
|
576
|
+
- **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
|
+
- **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
|
+
- **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
|
+
- **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
|
+
- **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
|
+
- **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
|
+
- **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()`.
|
|
584
|
+
- Neither ever appears in `?print` or `?embedded` (a printout and a preview teach nobody), nor when the URL deep-links past slide 1 / step 0, which is somebody presenting from a link rather than a first run. Both seen-flags are **global** (`localStorage['decklight-onboarded']`, `decklight-onboarded-tour`), not path-scoped like the theme/font/clock keys: they remember what a *person* has been told, not what a *deck* should look like, the same reasoning as `decklight-custom-themes`. Every write is best-effort, so `file://` and private mode play normally and simply forget.
|
|
585
|
+
- **Settings** (`SETTINGS`): the palette's **Settings…** row (also found by typing `config`, `preferences` or `version`) opens a small panel of facts about what this deck is running, and **the home for the presenter's knobs**: each row reads what the deck remembers and ⏎ changes it, the panel staying open around it. Besides the rows below, it holds **Arrows and slide number in fullscreen** (shown/hidden, `⇧F`), **Clock**, **Progress bar** and **Captions** (on/off), **Voice speed** (⏎ walks 0.75×, 1×, 1.25×, 1.5×, 2×; `<`/`>` still step by 0.25) and, in write mode, the **Editing bar** (shown/hidden). The palette keeps its rows for the same toggles: the palette is where you do a thing, Settings is where you see how the deck is set up. A row with no action is a **fact**, shown at full strength with no pointer cursor, never greyed out the way an unavailable command is: dimming it would say "not available to you" about something that is merely information. Its fixed rows: the first is the **runtime version**, which is the first thing a bug report asks for and which nothing in the player could previously answer: the version rides the bundle's banner, a comment you would have to open the file to read. It shows the **build**, not just the version (`0.9.0+107.g6dad7a3`, the same stamp `decklight --version` prints, plain on a release build), because "which 0.9.0?" is the question a bug report is asking. It is baked in at build time (`__DECKLIGHT_VERSION__`), formatted by the CLI's own `versionLine` from the `git describe` the build already records, so the panel and the terminal can never spell one build two ways; a render assertion checks the panel against the runtime's own `Decklight.version`. **⏎ or a click copies it** ("copied 0.9.0+108.gcca64bd"), because a version retyped into a bug report arrives with a typo in it: the async clipboard first, the old select-and-copy where that is refused (a deck on `file://` is not a secure context everywhere), and if both are refused the toast carries the text itself. `instance.settings.open()` / `.close()` / `.rows()` is the programmatic door, and `rows()` answers `[{ label, value?, run? }]` without opening an overlay, so a headless probe can read the version without driving the UI. The second is **Display**, the one knob: the deck's own ratio (`16:9` for the default 1280×720, letterboxed on any other screen) or **fill screen**, and ⏎ switches between them with a toast naming the new one. **A knob switches in place**: the panel stays open with the same row selected and the row reads the new value, so a second ⏎ switches back and Escape closes; it was closing on every press, which made a two-way switch cost three keys a turn. The copy is the whole of its act, so that row still closes. Filling grows the stage to the screen's shape instead of stretching it: a wider screen keeps the deck's height and gains width, a taller one keeps its width and gains height, so the slides lay out into the extra room and nothing that fits at the deck's ratio is squeezed. Pinned titles and the overflow guardrail measure again once a resize stops. Past 1:1 and 2.4:1 it letterboxes again, because a phone held upright or an ultrawide would turn a slide into a ribbon. **In fullscreen the bands are black**, like a projector's, and the slide itself carries the theme's canvas and accent; in a window they keep the theme's colour, and a slide whose art bleeds (Bleed, DECK_ANATOMY) still fills the screen. The choice belongs to this browser and this deck (`decklight-display:<path>`), like a dock placement: it says how this screen shows the deck, never what the file says, so print, PDF and every export keep the deck's ratio, and the row is absent under `?print`. The third, in write mode only, is **Push tags**: `with the branch` (the default) or `off`, and ⏎ switches it, in place like Display. It decides whether the commit window's **Push** sends the annotated tags with the branch (`git push --follow-tags`) or the branch alone, so a tag can stay a local mark until you push it yourself. It is kept per browser and per deck (`decklight-push-tags:<path>`), because a tag is a release name in one repository and a scratch mark in another; the page sends it with each push (`POST /deck/edit/commit/push {tags}`), and a push with no body sends tags as before. The fourth, in write mode only, is **Notes autosave**, the notes card's quiet time (PRESENTING, speaker notes): ⏎ cycles it, in place.
|
|
586
|
+
|
|
587
|
+
### PRESENTING_LOOK · Themes and type
|
|
588
|
+
|
|
589
|
+
- **Theme switching**: the theme is the stylesheet link into `themes/`; the engine swaps its href in place, so every token cascades and the deck restyles live. `T` opens the **theme picker**: the theme list (config `themes: [...]`, defaulting to the shipped set baked in at build time) beside a live preview of the *current slide at the current step*: a real embedded deck (`?embedded&theme=<name>#/<slide>/<step>`). `↑/↓`/hover browse (debounced), `Enter`/click applies, `Esc` closes. **Packs** (themes/packs.json, baked in at build; the build fails if a shipped theme is missing from the manifest): the picker opens on the pack list (name + count; the active theme's pack is marked), `Enter` drills in, the `← packs` row or `Esc` goes back, `✳ all themes` flattens; saved-custom and generated themes form dynamic packs at the end. An active filter always searches globally and tags each hit with its pack. **Marketplace themes** (`THEME_BROWSE#UI`) are listed **only in write mode**, not greyed out, absent: a presented deck lists the themes it marks and nothing else, and never reaches for a catalog. **The mark itself shows in every mode**: a theme the deck marks (THEME_DISTRIBUTION) is tagged `●` whoever opens the file, without trust or from disk as much as while authoring, and the marked themes come first, as a `● Marked` pack ahead of the recommended one and at the head of the flattened list, because the mark is a fact of the file and a reader with the shipped set in front of them has no other way to tell the deck's four from the forty beside them; the caption says *marked, part of the bundle* and, outside write mode, nothing about changing it. While authoring, every registered marketplace is a pack under its title, its themes tagged `●` when the deck marks them and `○` when it does not; any of them previews and applies, and **Space** marks or unmarks the selected one, a shipped theme as well, which a bundle then carries; a shipped row is tagged `●` only when marked, since `○` on every shipped theme would be noise, and its caption says Space marks it. The mark is written quietly: the row changes in place and the picker stays open, because the page is not reloaded for a write the picker has already shown. Space is free because the filter types `[a-z0-9-]` only. A theme whose bytes live at a URL has **no preview** until it is marked. Marking is the explicit act that reads it. A refusal keeps the picker up with the contract problems in the caption rather than closing on a failure; a mark lands on disk and the watcher's reload brings the deck back with the list as the file now says it is. **Pack-aware cycling**: `,`/`.` walk the pack-grouped order; a step that would cross into another pack pends instead of applying: a toast names the pack and target theme, the same key confirms, the opposite key or `Esc` cancels, and the pending step times out after 4s. **Quick filter**: printable keys type into a filter bar that narrows the list (substring match; the generate row hides while a filter is active); `Backspace` edits, `Esc` clears the filter first and closes on the second press. Because keystrokes feed the filter, the picker has no letter shortcuts (`⌃T` re-rolls the generate-row candidate; the former `R`/`T` bindings are gone). The applied choice persists per deck path in `localStorage`; **embedded instances never persist** (previews can't pollute the saved choice).
|
|
590
|
+
- **Inline-theme mode** (bundled single-file decks): when `<style data-theme="name">` blocks exist, they replace the link: `applyTheme` toggles which block applies (via `media="not all"`; the HTML `disabled` attribute on `<style>` is non-functional per spec, and the engine normalizes either form at init). The picker lists the embedded names (config `themes` narrows), `?theme=` works, and everything else is unchanged.
|
|
591
|
+
- **Theme generator**: `⌃T` generates a brand-new contract-complete theme (THEMING note) and applies it instantly: press again to re-roll. The roll lives as a `<style data-theme data-generated>` block appended last in `<head>` (wins the cascade over the link/inline base); cycling `<`/`>` or picking another theme deactivates it but keeps it in the theme list under its autoname (`gen-<word>-<hex4>`) until the next roll replaces it. The picker's first row is **“✨ Generate new…”**: selecting it rolls a candidate and previews it live like any other theme (`⌃T` re-rolls while selected; `Enter` applies). Previews for generated and saved-custom themes carry their tokens in the URL (`?gen=<base64url {name, tokens}>`) which the engine applies statelessly at init (works on `file://` and inside bundles). The preview deck loads **once per picker session**; subsequent selections are postMessage'd into the embedded instance (`{__decklightPreview: {theme|gen}}`, parent-origin-guarded) and applied in place: no document reload per candidate, which matters in bundles where each reload would re-parse the whole payload. `⌃⇧T` **saves** the applied generated theme: prompts for a name (sanitized `[a-z0-9-]{1,40}`, `custom-` prefixed on collision with a shipped name), persists `{name → tokens}` into `localStorage['decklight-custom-themes']`, and downloads `<name>.css` (a normal theme file). Saved customs appear in the theme list and picker (tagged “custom”), survive reload, and apply via the same inline-style mechanism, but localStorage is per-origin/per-browser: **the downloaded .css is the portable artifact** (drop it into `themes/` and commit). Unsaved generated autonames are never persisted as the deck's theme choice.
|
|
592
|
+
- **Font cycling**: `[`/`]` walk a curated list of offline-safe system stacks (sans, rounded, humanist, geometric, two serifs, slab, mono; entry 0 = the theme's own type), then the deck's **font packages** (`FONTS`), applied to `--font-body` + `--font-heading` as inline root properties: they win over any theme and survive theme switches. The choice persists per deck path in localStorage, **by name** (a 0.9.0 pick was an index into the stacks and still restores), and is restored before the first layout pass, falling back to the deck's own default, its config's `font`; every change re-measures pinned titles and re-runs the overflow guardrail (type metrics differ). **Font…** (`/`) lists the same, each row in its own face, and **previews on the slide** as the selection moves: `⏎` keeps it, `Esc` or a click outside puts back the font you came with; a design system's `recommendedFonts` come first under **★ recommended by …**; while authoring, every font the registered marketplaces offer is listed too (○ / ● in the deck), previewable before it is referenced, and **Space** references it (`FONTS`). `instance.cycleFont(±1)` programmatically.
|
|
593
|
+
|
|
594
|
+
### PRESENTING_MODES · Write mode, no-trust mode, and what a deck may run
|
|
595
|
+
|
|
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
|
+
- **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
|
+
- **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
|
+
- **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.
|
|
600
|
+
- **Strict mode** (`decklight <deck> --no-trust --strict`, and **automatic** whenever the label finds an unaccounted block or an executable attribute): the deck is served with every unaccounted block removed: each replaced by a fixed HTML comment carrying only a byte count, since interpolating any of the removed bytes into the page would hand the payload a second way in. Executable attributes (`NO_TRUST#AUDIT`) go in the same pass, spliced out of their tag with nothing in their place: a comment cannot live inside a tag, and the fixed-text rule holds either way. The removal happens **on the way out**, never on disk: the deck you were sent stays byte-for-byte the deck you were sent, so you can still diff it or forward it. It applies to every `text/html` response, not only the named deck: the picker, finder and speaker view all boot documents into same-origin iframes, so a mode that stopped at one file would have a door beside it. What survives is what a deck needs to render itself (runtime, the `Decklight.init` call, JSON data, templates); builds, layouts, themes, `data-chart` JSON and background media are markup, CSS and inert attributes, nothing a browser executes, and were never in the blast radius. A clean deck under `--strict` is **byte-identical** to the same deck without it. Two failure modes are rejected outright: it never refuses to serve, and it never serves the unaccounted block. There is deliberately **no `--force`**: ten minutes before a talk is the worst moment for a refusal, and an escape hatch would be reached for at exactly that moment, so the deck always plays and the part nobody could account for is the part that doesn't. What was stripped is named **in the terminal, never on the page**: the audience did not choose to open this file and cannot act on the finding. The label and the stripper share one scanner and move together, since a printed inventory that disagreed with the served bytes would be worse than a limit you can read. The honest limit that remains is that both are heuristics over markup: a parser trick the scan does not see is a parser trick strict serves, which is why the label is an inventory and never a verdict. A signature that does not verify degrades exactly the same way (`INTEGRITY#SIGNING`): signing adds a source of failure, not a second behaviour to understand.
|
|
601
|
+
- **Signing** (`decklight publish` **by default**, `--no-sign` opts out; `decklight bundle --sign`; verified by `--no-trust`). A file cannot vouch for itself (an attacker who edits the payload edits any embedded checker in the same pass, and `file://` HTML gets no OS signature UI), so the attestation is **detached**: `talk.html` is signed and `talk.html.sig` carries the Sigstore bundle, which is the authority. Nothing is embedded in the deck, because a copy inside the payload cannot cover the payload containing it and a convenience that *looks* like a signature is worse than none. **Sigstore keyless: there are no keys**, not "the keys live elsewhere": a short-lived certificate is minted against an OIDC identity, used once, and left to expire; the transparency log is what keeps the signature checkable afterwards, and it is the same trust root the npm release's provenance already uses. The identity is the ambient OIDC token in CI (GitHub Actions `id-token: write`) or `SIGSTORE_ID_TOKEN`: the client has **no interactive browser flow**, and saying otherwise would send someone waiting for a window that never opens. **`publish` signs by default and `bundle` does not**, which is one decision and not an inconsistency: `publish` is already a network action, so signing adds no failure mode it did not already have, while `bundle` is offline-clean and would gain one. Neither is ever *silently* unsigned: signing runs **before anything is written or pushed**, so a failure leaves no artifact and no commit, and names `--no-sign` as the deliberate way past. `--no-trust` verifies before rendering and prints **who** signed (identity, issuer, and the log's own timestamp, never a timestamp the signer chose), read from what the verifier established rather than from the bundle, which is the attacker-supplied half. A signature can check out while the certificate names nobody; that prints as **verified with unknown identity** (precise about what is and is not known: the bytes did verify, the signer did not resolve to a name), and it *gates* as unverified, because the name is the part a person can judge and a nameless one leaves nothing to judge. Four states, and the distinctions are the point: `verified`; `tampered` (these are not the bytes that were signed); `unchecked` (a sidecar that could not be evaluated here, no client, no network, which is **not a pass**, because a gate that passes what it could not evaluate is not a gate); and `unsigned`, which is **not a finding**: most decks are unsigned, and alarming on that would train people to ignore the one case that matters. Anything but `verified` with a named identity on a deck that carries a sidecar feeds the **same degrade-to-strict path** as an unaccounted script block: signing adds a source of failure, not a new behaviour. `--no-trust --audit` exits non-zero on it, for CI. The client is an **optional** dependency loaded lazily and confined to `cli/`: the runtime keeps zero dependencies, and CI installs `--omit=optional`, so every path behaves sensibly when it is simply absent.
|
|
602
|
+
- **The `.decklight` container** (`decklight bundle --deck`, `decklight publish --deck`; played by `decklight <file>.decklight`, without trust by nature). A signed deck travels as *two* files, the deck and its sidecar, and two is one more than people forward, so the container carries the pair as one artifact: the bundled deck, its Sigstore sidecar, and a `manifest.json` (runtime version, origin repo and commit when a repository can be read, never guessed, and declared extensions). Opt-in on both commands until the container proves itself, and `--deck` **implies `--sign`**: the container *is* the signed artifact, so an unsigned one would be an archive wearing the name of an attestation (`--deck --no-sign` is refused). **The extension is `.decklight`**, decided against the obvious `.deck`, which belongs to Decker (an active cross-platform HyperCard revival whose files are *also* interactive decks exported as single HTML documents) while `.dck` is Forge/XMage. Zero-collision verbosity is the feature. **Layout**: the bundled deck verbatim at offset 0, then `\n<!--\n`, then a ZIP of the two metadata files, closed by `\n-->\n` carried in the ZIP's own archive-comment field. That shape satisfies the requirement the format exists to meet: **a `.decklight` renamed to `.html` plays in a plain browser**, degrading to the artifact it wraps rather than to garbage, because the recipient without the tooling is who the container must not become a wall for. The HTML comment is load-bearing, not decoration: character tokens after `</html>` are reprocessed into the body, so a bare append puts raw archive bytes on screen (a render harness caught precisely that); a comment token is never rendered. Offsets are written file-relative, as a self-extracting archive's are, so `unzip` reads the container without complaint. Packing pads the manifest until the compressed bytes contain no `-->`, keeping the wrapper intact and the output byte-reproducible. The manifest sits **outside** the payload so editing the deck and editing its label are not one action, and carries the payload's SHA-256, but it *describes*, it does not attest: the signature is the only part anyone checked, and `--no-trust` prints the manifest as what the container **says** about itself, **except its origin (repo and commit), which is recorded but never printed**. The signature covers the payload alone, so even on a *verified* container the origin is whatever the packer wrote: an Alice-signed payload repacked with a trusted repo's name still verifies as Alice and still passes the digest, and the borrowed provenance would print one skim away from her verified identity. The runtime claim survives on the line because the ingredients label measures the embedded runtime independently, so a lie there sits next to its own contradiction; the origin has no such check, and a claim nobody vouches for adds nothing beside an identity somebody did: it stays in the manifest for tooling to read, and earns a printed line only if it ever comes inside the signed bytes. `--no-trust` unwraps in memory (nothing is written, ever), then applies the same audit, the same CSP and the same strict rule as the plain HTML; the payload's length is taken from the ZIP's own first offset, never from the manifest that claims it, and a manifest whose digest disagrees degrades exactly like a signature that does not verify.
|
|
603
|
+
- **File association** (`decklight associate`, `--uninstall`, `--print`): wires a double-clicked `.decklight` to `decklight <file> --no-trust`, so a deck someone sent opens *verified* rather than raw. Per-user everywhere: nothing needs administrator rights and nothing is written outside the user's home. Linux gets a `.desktop` entry (`Exec=… present %f`, `Terminal=true` so the label is readable, and `%f` not `%F` because `--no-trust` takes one deck) plus a shared-MIME-info XML declaring `application/vnd.decklight` as a subclass of `text/html`; macOS gets a minimal `~/Applications/Decklight.app` because a UTI can only be **exported by an application** (`io.decklight.deck`, conforming to `public.html`); Windows gets `HKCU\Software\Classes` entries. The double-clicked path is **untrusted input**: it is the filename of a file someone sent, and the launcher runs before `--no-trust` checks a byte, so the macOS launcher hands it to `osascript` as an *argument* (`on run argv`, shell-quoted by AppleScript's `quoted form of`), never spliced into the `do script` text where a quote in the name would become shell. An unsupported platform is refused by name rather than silently doing nothing. The association buys the verified path, **not the only path**. A renamed container still opens in any browser whether or not this ever ran.
|
|
604
|
+
- **Presenter plugins** (`decklight library add plugin|list|check|remove`; loaded in **both** modes, write and no-trust, and never by `bundle`; `--no-plugins` plays without them in either. It used to be no-trust only, so presenting your own deck with your own timer meant opening it without trust). Chrome the *presenter* installs for themselves (a talk timer, a teleprompter, a confidence monitor) layered on at serve time from `~/.decklight/plugins/`, so the deck on disk is untouched and the same file presented on a machine without them is identical slides with no warning. This is defensible for the reason a build-time transform is (`EXTENSIONS`): **the installer is the risk-bearer, and nothing travels**. A plugin is two files, `plugin.json` and `plugin.js`. **Scope is chrome only, and the browser is what enforces it**: the code runs inside `<iframe sandbox="allow-scripts" srcdoc=…>` with no `allow-same-origin`, so the frame holds an **opaque origin** and `parent.document` throws. There is no handle on a slide to misuse, which is a different thing from a rule against reaching for one. A deck has to stay a deterministic artifact, or two people presenting the same file are presenting different decks. Two checks sit *in front* of that boundary and neither carries it: the manifest vocabulary is **closed** the way the wizard's field types are (`slot` from a fixed list so a plugin cannot place itself over the stage, sizes clamped for the same reason, unknown keys refused rather than ignored), and a **lint** rejects source that reaches for the deck's document, which already fails at run time, so catching it at install turns a `SecurityError` nobody is watching into a sentence. What crosses into the frame is a one-way push with no request channel: deck position, build step, elapsed time, and **speaker notes only to a plugin that declared `needs: ["notes"]`**, which `plugin list` and the `--no-trust` startup line both name. Reading notes is not transforming them, and the speaker view already shows those words on that machine, but a timer never sees a line of the talk. A plugin **never enters the ingredients label**: the label is an inventory of the file (`NO_TRUST#AUDIT`), the chrome is injected after the audit has read the bytes and after strict mode has stripped what it could not account for, and it is reported on its own line as the presenter's own. It **registers no route and widens no policy**: a `srcdoc` frame is never fetched, so `frame-src` has no URL to judge and it loads under the deck's existing CSP untouched. A broken plugin is skipped with a reason rather than being fatal (`NO_TRUST#STRICT`'s argument: nothing about a timer should cost someone their talk), `--no-plugins` presents without the library, and with nothing installed `--no-trust` serves a deck byte for byte as it did before any of this existed.
|
|
605
|
+
|
|
606
|
+
### PRESENTING_EDITING · Editing a deck in the browser
|
|
607
|
+
|
|
608
|
+
- **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
|
+
- **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
|
+
- **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 draft is never written this way**: ✨ and 🗣 land their text in the box to be read, and until it is saved with `⌘⏎` or the button, dropped with ↺, or typed into (which makes it the author's own), leaving the card does not write it, moving on leaves the card with the slide it was drafted for, and closing says so and keeps it open. `⌘⏎` 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.
|
|
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`; 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.
|
|
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 closing words. 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.
|
|
614
|
+
- **Check deck…** (palette; also found by `lint`, `issues`, `crowded`, `overflow`; `src/core/deckcheck.js`). What is wrong with this deck, slide by slide, without leaving it: `decklight check` answers that in a terminal, and an author with the deck open has none in front of them. 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. A row per finding, errors (`✗`) before warnings (`!`) within a slide: the slide number, its title, what is wrong; ⏎ or a click goes to that slide and closes the panel. The head counts them (*check · 5 issues on 4 slides · 1 error*), a clean deck says *no issues: 9 slides checked*, and the last line names what only the file can tell (missing files the page never asked for, scripts), which stays `decklight check`'s. After the issues come **suggestions** (`+`), counted apart (*· 1 suggestion*): a label that recurs across slides in different colours, worth a concept (SVG_DIAGRAMS), where ⏎ in write mode 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*). Otherwise read-only, in every mode. `instance.check()` returns the same findings, shaped like the CLI's `--json`, for a headless probe.
|
|
615
|
+
- **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.)
|
|
475
617
|
|
|
476
618
|
**Unpushed work is named in four places, and none of them nags.** `decklight
|
|
477
|
-
history` and the `H` overlay show it when you go looking;
|
|
619
|
+
history` and the `H` overlay show it when you go looking; write mode prints one
|
|
478
620
|
line on its way out (`↑13 commits only on this machine — git push -u origin
|
|
479
|
-
main
|
|
621
|
+
main`, the command that would actually work, which is not always `git push`);
|
|
480
622
|
and the player says it **once per session**, only past ten commits, and never
|
|
481
|
-
when there is no remote to push to
|
|
623
|
+
when there is no remote to push to: that nudge belongs to `init`, once, at the
|
|
482
624
|
moment a remote could actually be added. One-per-session is a count rather than
|
|
483
625
|
an interval on purpose: an interval decays into "every few minutes", which is
|
|
484
626
|
the kind of reminder people turn off, after which it is worth nothing. Every one
|
|
485
627
|
of the four reads the same three functions, so they cannot drift apart.
|
|
486
628
|
|
|
487
|
-
**`decklight init` offers a remote** for a repository it just created
|
|
629
|
+
**`decklight init` offers a remote** for a repository it just created, never
|
|
488
630
|
for one that was already there, which may be a monorepo or somebody's checkout
|
|
489
631
|
and is not decklight's to publish. With `gh` installed **and signed in** it
|
|
490
632
|
offers `gh repo create --private` (private, and the prompt says so: a public
|
|
491
633
|
repository created off a default-yes prompt is a disclosure, not a
|
|
492
634
|
convenience); otherwise it asks for a URL. `--remote <url>` and `--no-remote`
|
|
493
635
|
make the whole path scriptable, a URL that is really a flag is refused, and
|
|
494
|
-
every failure is a note rather than an exit
|
|
636
|
+
every failure is a note rather than an exit: the deck is the product. When the
|
|
495
637
|
directory already held other work, the question's **default flips to no** and
|
|
496
638
|
the files that would be pushed are named first: `initRepo` runs `git add -A`, so
|
|
497
639
|
that init has just committed all of them.
|
|
498
640
|
|
|
499
|
-
Authorship is **structural, not detected**: the server spawns the agent itself and diffs the deck around that process. An agent driven from OUTSIDE that flow
|
|
500
|
-
- **
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
- **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`/`⌃T` for themes, `S`/`V` for speaker view and narration, and author mode (`decklight author`, `A` to ask an agent, `E`, `Z`). 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()`.
|
|
505
|
-
|
|
506
|
-
- Neither ever appears in `?print` or `?embedded` (a printout and a preview teach nobody), nor when the URL deep-links past slide 1 / step 0, which is somebody presenting from a link rather than a first run. Both seen-flags are **global** (`localStorage['decklight-onboarded']`, `decklight-tips-seen`, `decklight-tips-off`), not path-scoped like the theme/font/clock keys: they remember what a *person* has been told, not what a *deck* should look like — the same reasoning as `decklight-custom-themes`. Every write is best-effort, so `file://` and private mode play normally and simply forget.
|
|
507
|
-
- **
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
-
|
|
512
|
-
-
|
|
513
|
-
- **
|
|
514
|
-
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel — **off**, track, live voice, engine, tone, character, recording, captions, speed (persisted per deck). **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 `narration: { files: '<dir>' }` or `[{ label, dir }, …]` for several takes. **A recorded track can pace the builds, not just the slides.** `tools/voiceover.mjs` already writes one file per `⟨CLICK⟩` segment (`<dir>/slide-NN-KK.m4a`, KK 1-based over the segments that produced audio — empty segments produce none, so the file number is not the step number) and lists them as `slides[i].segments`; a track carrying them reveals build step k when segment k ends, which is the build-synced pacing the live voice has, from a recording. On a **directory** track it is opt-in — `narration: { files: '<dir>', segments: true }`, off again with `segments: false` — because the runtime cannot see the folder and must not guess. A **manifest** track needs no flag, the manifest being the list of what exists; except on a *signed* one, where a segment counts only if it carries a `url` of its own. `publish-voices.mjs` writes those urls — every beat is uploaded and signed alongside its slide — and the rule stands anyway, because a manifest published before it did lists beats whose bytes never left the author's disk, and a signature is the only thing that tells the two apart. Whether a track paces itself is settled **once**, when narration starts, from what the track declares — never by probing for a file, which neither `file://` nor a CORS-less bucket can answer. A slide recorded whole inside such a track still plays as one file and then advances; a surplus `⟨CLICK⟩` beyond the slide's builds is chained onto the last step exactly as the live voice chains it. A missing FIRST segment falls back to the whole-slide file; one missing mid-slide has nothing to fall back to, so the deck stops and names it — the voice is the clock. The character keeps up: `tools/lipsync.mjs` cuts a sidecar per beat too (`slide-NN-KK.visemes.json`, from that beat's own `slide-NN-KK.txt` as the dialog hint), the synthesized recorder writes them beside its beat WAVs, and `decklight bundle` inlines them under the same stem. A beat with no sidecar animates from amplitude rather than replaying the slide's timeline — which would start at zero against every beat and be confidently wrong. The talking-head *video* stays per slide: a clip is minutes of GPU time and the element mirrors the audio's transport rather than seeking a timeline, so cutting it per beat would cost a great deal to fix a smaller error. **Both recorders write those beats.** the panel's `Record this deck…` stitches them from the live voice's own sentence cache alongside the whole-slide file it always wrote — so a synthesized track gains build-pacing for free, with no second pass — and **the panel's `Record this deck…` records them in your own voice**, for which `decklight record <deck.html>` is the door: a browser will not open a microphone for a `file://` page (getUserMedia needs a secure context, and `http://127.0.0.1` is one), so the command serves the deck and opens it at `?record` — your-voice recorder on a `file://` deck says exactly that instead of failing silently. The deck is the teleprompter: it shows one ⟨CLICK⟩ beat at a time at the build that beat plays over, and `→` ends the take *and* reveals the next build — one gesture, so the timing you record is the timing you will present. `⌫` retakes the beat just read, `Esc` stops (every slide already finished is already written). Capture is WebAudio → 16-bit PCM → `stitchWav`, at 24 kHz mono like every engine's output — not MediaRecorder, whose webm/opus nothing else here reads, and not an AudioWorklet, whose module would have to come from a `blob:` URL that `decklight present`'s `script-src 'self' 'unsafe-inline'` forbids. Each slide is written twice by EITHER recorder: one `slide-NN-KK.wav` per beat, and the whole-slide `slide-NN.wav`, so `lipsync.mjs`, `video.mjs` and a deck that never opts in all keep working — the layout on disk says nothing about which recorder made it. A beat file carries neither the segment-sized silence that separates beats (it belongs between them, not at the head of one) nor the slide's trailing `data-narration-pause` — and neither does the **whole-slide file**, nor the viseme timeline beside it: `advanceFrom` honours every pause at play time for recorded and live tracks alike, so baking one into a file as well would hold twice (which the whole-slide file quietly did until the pause gained a non-zero default and the double showed). A slide the tool would not have segmented (fewer than two beats with words in them) is one take and no segment files, the same threshold `tools/voiceover.mjs` gives up at; a slide with builds but no ⟨CLICK⟩ is recorded whole and says so on the card, because that is an authoring gap and the moment you are reading its notes aloud is the moment to learn about it. Files are written through the author server (`POST /edit/record`, which is told a folder and a beat number and builds the name itself), and fall back to the browser's download folder when there is none — **saying which of the three reasons** applies, because where the files went is not something a presenter can act on and why they went there is. Whether a server exists is **awaited, never sampled**: the probe answers asynchronously and a recorder that read it early sent whole takes to the download folder because the answer had not arrived yet, not because there was no server. A deck opened with `?record` that finds no server is the loud case — that parameter means one was started, so something else is holding the port for another deck — and it says so on the intro card, before the first beat rather than after the last. **A TRACK IS A FOLDER**, and the recorders name it after the voice: a deck carries as many tracks as you have voices — several cloned ones, the system voice, two takes of your own — and `N` is the switcher, so a single `voiceover` default meant recording a second voice erased the first with nothing said. The folder is chosen by four rules in order: `--dir`/`?dir=` (asked for out loud); a folder whose `manifest.json` names this same engine and voice (a re-record **refreshes** its take rather than accumulating `-2`, `-3`); the deck's own single configured folder (a deck that names one place has decided); else `voices/<voice>`, suffixed past anything already there. `GET /edit/tracks` is how the deck finds out what exists — it cannot see the filesystem, which is why `segments: true` is opt-in at all — and the proposal is shown on the card as an **editable field** before recording starts, because a proposal that cannot be corrected is a decision made somewhere else. The done card then **offers to point the deck at what it just wrote** — `POST /edit/narration` **adds** the track to `narration.files` (updating in place when that folder is already listed, never duplicating a row) through the same `applyEdit` door every other edit uses; the one-string form becomes a one-element list carrying the same `ext`/`segments`, which is the shape `narrationTracks()` normalises it to anyway, so `Z` takes it back and live-reload shows it. A button rather than automatic: editing someone's deck the moment a recording ends is the wrong default even with undo behind it, and the offer is absent exactly where it could not work (no author server → the card prints the line, as before). The call site is located by the same classifier `audit` and `upgrade` use, and its argument walked with strings skipped, because `{ title: 'Acme (Inc)' }` is a deck that did nothing wrong. A deck that builds its config elsewhere (`const cfg = {…}; Decklight.init(cfg)`) has no literal to edit: that is **refused with the reason**, never guessed at. `decklight record --slides a-b` re-records a range and leaves every other slide's files alone — recording starts at slide 1 and cannot skip, so without it a fluffed beat on slide 30 costs 29 slides of reading. A `dir` may be an absolute URL, so a **public** bucket has always served a track with no extra machinery (`dir: 'https://storage.googleapis.com/…/algenib'` — media elements load cross-origin without asking). **Manifest tracks** exist for the case a `dir` cannot express: `[{ label, manifest: 'voices/algenib/manifest.signed.json' }, …]` fetches a small JSON list once when narration starts and plays each slide's URL **verbatim**, because a presigned URL carries its signature in the query string and a query string can never be a directory prefix. The manifest is the file `tools/voiceover.mjs` already writes (`{engine, voice, style, slides: [{file, hash}]}`), extended with an optional per-slide `url` and a top-level `expires` (ISO 8601); a slide with no `url` resolves its `file` next to the manifest, so an unsigned `manifest.json` in a public bucket is a track for free, and a `null` slide (no notes, no file) is silence rather than a failure. `tools/publish-voices.mjs <dir> --bucket gs://… [--sign 7d]` uploads the files whose hash moved (the last `manifest.signed.json` is the record of what is already up there; `--all` overrides), signs every one through `gcloud storage sign-url` — never our own key handling — and writes `manifest.signed.json` to deploy beside the deck while the megabytes stay in the bucket. It refuses a `--sign` longer than **7 days**, the V4 signing scheme's own ceiling, and names the public-bucket alternative for audio that must outlive a week. Signatures expiring is one more way for the voice to be unplayable, so it behaves like all the others: the expiry is checked before the first clip, narration turns off, auto-advance stops, and the message names the track, the date, and the literal re-sign command (the manifest records the `source`, `bucket` and `signDuration` it was made with, so it is a line to re-run and not a shape to fill in). A signed file that fails to load is treated the same way — a media element cannot report an HTTP status, so a 403 for a lapsed signature is indistinguishable from any other failure, and naming the only cause worth naming beats staying silent. `N` shows a manifest track with a ☁ and the time left. `decklight bundle` **inlines the manifest** under its own path (`data-decklight-voices`), like the viseme sidecars, because `fetch` is dead on `file://`; the audio stays in the bucket, which is the whole point. One honest caveat: the character overlay's `amplitude` fallback reads the audio through WebAudio, and cross-origin media taints that unless the bucket sends CORS headers — viseme sidecars are same-origin JSON and are unaffected. **Live voice**: the player synthesizes each slide's notes on the fly through the local bridge (`decklight tts`, default `http://127.0.0.1:8787/tts`, override via `narration.liveUrl`). The bridge speaks with one engine at a time — six built in (`--engine`, tools/tts-engines.mjs), plus any installed one — and the deck can change which: **gemini** (gemini-2.5-{pro,flash}-tts on Vertex AI — a delivery style always reaches it; no free tier, and a fresh project's per-minute quota 429s under the lookahead's bursts), **chirp** (Chirp 3: HD on the Cloud Text-to-Speech API — the same 30 star-named voices, ~1s a sentence, 1M characters a month free, no style channel), **piper** (a local neural model — offline, unlimited, free, no credentials; one voice per installed model, and the process is held RESIDENT because piper reloads its ~120 MB model on every start), or **elevenlabs** (your own ElevenLabs account's voices — the ones you *cloned* included, which is the reason it exists). The first three know their roster up front; ElevenLabs cannot, because the interesting voices are yours, so it fetches the account's list once and `/ping` and `/voices` await it — **your** voices first (cloned, then professional, then premade), each tagged with where it came from, and the picker's default is the first of them. The player sends a voice NAME; a `voice_id` pasted from the dashboard resolves too. Its key is read from `$ELEVENLABS_API_KEY` and is **never written to `tts.json`** — decklight remembers the choice and leaves the secret to your environment. Style reaches it only through `--tts-model eleven_v3` (`stylable` follows the model chosen, not just the engine): v3 reads a short bracketed **audio tag** ahead of the sentence as performance direction — never the Gemini-shaped prose instruction, and never sent to any other ElevenLabs model, where the brackets would just be read aloud as words instead of shaping them. An optional `--tts-stability creative|natural|robust` (v3 only; refused up front on any other model rather than silently doing nothing) trades how hard v3 follows the tag against how much it drifts, and is left alone entirely — no `voice_settings` sent at all — when unasked. Both the tag and the sentence it directs are billed as the characters actually sent, and it is metered in characters against a plan rate decklight cannot see, so the bridge reports characters rather than inventing a dollar figure. Audio is `pcm_24000` wrapped as WAV like every other engine; `--tts-format mp3` is the escape hatch for plans without PCM output and costs you the panel's `Record this deck…` offline recording and the lip-sync bridge, both of which read WAV — so it is opt-in, never a silent downgrade. `GET /ping` reports `{engine, model, voices, stylable}` and the picker offers exactly those voices, skipping the tone step when the engine cannot be told how to speak — a roster the bridge cannot pronounce would be a silent lie. **Which engine is itself a choice the deck can make**: `GET /engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing; `POST /engine {engine}` swaps the live one. The picker hangs off the voices view (`N` → live voice → *engine*), because the engine decides the whole roster and that is the screen where you notice the names are not the ones you wanted. **The readiness check is shared with `decklight author`** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs — a picker offering an engine `author` would have refused to start is a picker that lies — and it is asked BEFORE the engine is built, because gemini and chirp construct perfectly well against an unchecked project and fail on the first sentence, which mid-talk is a keypress into silence. A swap re-runs the same stale-voice rule a first probe does, and the response cache is keyed by engine name, so switching back replays instantly rather than re-billing. **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 voiceover` (`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 choice is not persisted.** `tts.json` is what the CLI and the wizard write and what the next `decklight author` starts with; an experiment two minutes before a talk must not quietly become tomorrow's default. The bridge keeps it until restarted, so it survives a reload. The bridge is probed when live narration **starts**, not only when the picker opens, and a saved voice the live bridge does not have is treated as **stale rather than chosen**: it came from a different engine (the star roster is the default, and an ElevenLabs key knows none of those names), so the bridge's first voice takes over, is persisted, and the swap is announced — a voice changing on its own must never be silent. **The voice already on the machine**: with no engine chosen, none saved, and no cloud project, `decklight author` asks the operating system what it can speak with before defaulting to an engine that would only be skipped. **macOS** is read through `say -v '?'` — the roster mixes twenty years of engines, so voices are ranked and shown by **quality category**: *best* (a **Personal Voice** the user recorded, and **Siri** voices — recognisable on current macOS only by their sample sentence, the name markers having disappeared from the listing), *good* (Premium/Neural, then Enhanced), *average* (plain built-ins, and the **robots** — Albert, Zarvox, Bad News and the rest of the novelty/formant roster, pinned there by name and listed last, because they sort alphabetically first and once narrated decks by default). The categories render as labelled shelves in the picker, and only the deck's language gets them: the **novelty tail** (robots and the 2022 persona family — Eddy, Flo, Grandma, Grandpa, Reed, Rocko, Sandy, Shelley) and **every other-language voice** each fold to a single expandable row (`‣ novelty voices (26)` · `‣ other languages (140)`), expanded per picker-open and never persisted — a real Mac answers ~184 names, and ~165 of them were the reason "which voice is good here" was unanswerable. When no best-tier voice is installed, the BEST shelf holds an actionable row — *⬇ Get Siri voices — free download* — whose commit asks the bridge's `POST /voices/install` to open the macOS voice-download pane: darwin-only, loopback-only, and the argv is a **frozen constant** (`open x-apple.systempreferences:…`) that no byte of any request reaches; the download itself stays a human clicking through, which is the point of the pane. This is the ONE exec a deck may trigger, and it opens a Settings pane and nothing else. A Mac whose best voice speaks Italian must still not narrate an English deck with it. A Siri voice hiding behind a **duplicate display name** (how current macOS lists them) is dropped rather than offered — `say -v` addresses by name, so that row would play a different voice than it names. A machine with **no best-tier voice** is told, on the caveat channel every engine already has (the bridge's startup line, the deck's toast): Siri voices are a free download away, with the Settings path and the `open "x-apple.systempreferences:…"` command that gets there — suggested, never run, because only a person can click through a voice download. **Windows** is read through PowerShell — the **WinRT** stack first (`Windows.Media.SpeechSynthesis`, projected from Windows PowerShell 5.1), because that is where the **natural** voices live (Aria, Jenny, Guy — the neural ones Narrator and Edge use, and the closest thing Windows has to Siri); `System.Speech`, the 2006 API that sees only David, Zira and Mark, is the fallback for a PowerShell that cannot project. Synthesis goes through whichever stack listed the voice, and a name the machine does not have throws rather than falling back to the default voice. A machine with no natural voice installed is told where they are — Settings → Accessibility → Narrator → *Add natural voices* — on the same caveat channel and with the same picker row as macOS's Siri hint (`start ms-settings:easeofaccess-narrator`, a frozen argv, is the one exec that row may trigger there). Both become real bridge engines (`--tts-engine say|sapi`), synthesizing 24 kHz PCM in a WAV like every other engine, `stylable: false` so the picker skips the tone step. **Android** is detected and refused with the reason: Termux reports `android` and runs Node, but Android's TextToSpeech is an in-process Java API with no command line behind it, so there is nothing for a bridge to call — the honest path there is a recorded track, which needs no bridge. A native voice is the ONLY engine claimed automatically, because it is the only one that needs no setup at all; **piper is never auto-selected even when it is on PATH**, since it needs a toolchain and a ~120 MB model and that choice belongs to the first-run wizard, which saves it. Any `--tts-engine`, `--project`, `GOOGLE_CLOUD_PROJECT` or saved config wins outright and detection is never consulted. When a machine has nothing, the skip line says what THIS machine lacks and names piper; and if **Ollama** is answering on 127.0.0.1:11434 (a ~300 ms probe, raced against a timeout so a hung socket cannot stall startup) it adds that Ollama serves LLMs and has no speech endpoint — the single most common thing a local-AI user expects to cover this. **A missing piper voice is caught before the bridge starts, not by it**: piper installed and chosen but with no model on disk used to bring the bridge up looking healthy and fail on the first sentence — a keypress into silence, for a file that was never there. `decklight author` now checks, names the model, its directory and its size, and on a **TTY** offers to fetch it; accepting re-plans so the bridge joins the session, declining or a non-TTY run keeps the skip line. **Nothing is ever downloaded silently.** The command it runs is chosen for the machine (`tools/tts-engines.mjs`): a python that can already import piper gets `python -m piper.download_voices`, and otherwise `uvx --from piper-tts` runs it inside the isolated venv `uv tool install piper-tts` creates — the plain form cannot work there, which is why it used to fail with `ModuleNotFoundError` on a machine that had just followed decklight's own install instruction. **First-run setup**: the first time the bridge cannot start — a bare `decklight tts`, or `decklight author` about to skip the voice because nothing is configured — decklight asks a few plain questions on the terminal (TTY only) instead of exiting with the engine's error: the engine, with the free/offline/cloud trade-offs stated and the default following what the machine already has (an `$ELEVENLABS_API_KEY` outranks everything — nobody exports one by accident; else piper on `PATH`, else a project visible in the environment or gcloud config), then only that engine's prerequisites — a GCP project id (prefilled, validated with the same rule the flags enforce) plus a credentials probe for the cloud engines; for piper the install and voice-model download commands, run only on an explicit yes; for elevenlabs nothing at all when the key is exported (the roster answers "which voice", so it is not asked) and otherwise where to make a key and why setup will not save it for you. Setup proves the choice with one real synthesis of the picker's preview sentence, reporting duration and the engine's cost note, and only a config that has spoken is saved — to `~/.config/decklight/tts.json` (`$XDG_CONFIG_HOME` honored), which both `decklight tts` and `decklight author` read from then on; precedence is flags > environment > saved config > built-in default. `decklight tts --setup` re-runs the questions, deleting the file resets to first-run, and non-TTY invocations never prompt — exit codes and messages stay as they were. **The voice is the clock**: auto-advance is driven by narration finishing, so when the voice CANNOT be played — a quota 429, an unreachable bridge, a browser that blocked autoplay, a recorded track with no file for this slide — the deck **stops advancing** rather than walking the talk past slides nobody has heard, and says why in a message (`I`) naming the cause and the way out (`--tts-engine chirp` for a 429, `decklight tts` for a dead bridge, one click for blocked audio). Narration switches itself off; `V` retries — the picker drills tracks → voice (30 prebuilt Gemini/Chirp names, one piper model, an OS voice, or the ElevenLabs account's own roster) → tone, on any engine `/ping` reports as `stylable` (six presets or a custom typed instruction — a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs `eleven_v3`). Every voice row carries a ▶ **preview** that speaks an editable test sentence (default "Hey, this is Decklight", input at the top of the voices view, ↺ restores the default) through the bridge in that voice; tone rows preview the drafted voice in that delivery style, and the custom-tone input has a ▶ to audition a typed instruction before committing it. After a preview plays, the rest of its roster prefetches sequentially in the background (all voices neutrally, or all tones for the drafted voice). Two preview caches: the default sentence's cache is permanent once built; the custom sentence's cache holds exactly one sentence and is swapped (old audio freed) when the text changes. **Build-synced auto-advance**: the ⟨CLICK⟩ markers that segment the notes for the speaker view segment the audio too — segment k is synthesized as its own clip and narrates build step k (0 = arrival); when a clip ends the deck reveals the next build, and after the last segment it moves to the next slide, so a deck with well-segmented notes presents itself beat by beat. **More segments than builds** — the commonest case being a slide with no `data-build` at all, which has exactly one step — used to drop every surplus segment: never synthesized, never spoken, never mentioned, while the speaker view went on displaying it, so the presenter read a cue the deck would never say. The surplus now rides on the **last** step. There is nothing left to reveal, so the marker becomes a beat rather than a build trigger — the same call `tools/video.mjs` makes for a count that does not line up, and the same one the panel's `Record this deck…` stitching and the viseme sidecars make, each giving a folded segment a segment-sized silence rather than a sentence-sized one so a recorded take breathes where the live one does. The counts disagreeing is still nearly always an authoring slip, so it is named once per slide in the message log (`I`) and the debug log — never toasted, because it is a note about the deck rather than something to act on mid-sentence. The opposite mismatch needs no rule: fewer segments than builds already advances after a short beat, losing nothing. A segment with no words advances after a short beat; a slide with no notes is skipped; manual navigation mid-clip wins over the pending advance and re-syncs the voice to the new step. **Between sentences the voice breathes 0.25s by default** — the pause a reader takes at a full stop, which a chain of separately synthesized clips otherwise lacks — overridable for the deck (`narration: { sentencePause: 0.5 }`) and per slide (`data-narration-sentence-pause="0"`, where an explicit zero is zero); a typo falls through to the next tier, never to silence. the panel's `Record this deck…` stitches the same breath between sentences, so a recorded take paces a slide exactly as the live voice did. **Every pause resolves the same three tiers** — the slide's attribute, else the deck's `narration: { sentencePause, beatPause, slidePause }`, else the built-in default (0.25s between sentences, **0.5s between builds, 1s before the slide turns**) — opt-*out* rather than opt-in, because a deck that talks straight through its own punctuation is the behaviour nobody asks for on purpose; so a deck can breathe uniformly from one line of config and a single slide can still say otherwise, down to `"0"`; an unparseable value at either tier falls through, never to silence. **`data-narration-beat-pause="0.5"`** is the same breath **between builds**: each bullet lands, holds that many seconds, and only then does the voice reveal the next — honored at play time for live and recorded tracks alike, never baked into a recording, and malformed values read as no pause, exactly like its end-of-slide sibling. **`data-narration="hold"`** on a section marks it interactive (quiz, exercise, live demo): narration plays whatever notes it has and builds still sync, but the deck never auto-advances *off* it — the presenter moves on manually and narration resumes on the next slide. The spoken unit is a **sentence**: each ⟨CLICK⟩ segment splits into sentences, every sentence is its own TTS call and cache entry (slide, segment, sentence, voice, style), playback chains them and advances only after the segment's last one — so first audio arrives after one short synthesis, never a whole paragraph. While narration is on, a **lookahead buffer** keeps the next 10 sentences synthesized in the background (a few parallel low-priority workers, window re-derived from the current position, results landing in the same cache); an unreachable bridge toasts once and pauses the buffer until the next event. the panel's `Record this deck…` records per-slide `slide-NN.wav` files **stitched from this same sentence cache** (short silences joining sentences and builds) — already-heard clips cost nothing, only unheard sentences synthesize. **They are written next to the deck, not downloaded**: in author mode each stitched slide is POSTed to the server that already owns the deck file (`/edit/record`), which writes it — and the character's `slide-NN.visemes.json` sidecar — into the deck's own `narration.files` folder, or `voiceover/` when the deck names none. That is the only place `narration.files` can point at and the only place `decklight bundle` looks, so the recording is finished where the next command reads it; the browser's download folder is neither, and is now the FALLBACK for the cases nothing may write to disk — a `file://` deck, or one served read-only by `decklight present`. The player names the folder and never the file: `/edit/record` builds `slide-NN.wav` itself and refuses a folder that resolves outside the served root, so the write surface a recording opens is one directory of one deck. The card that ends the recording says which of the two happened and, on disk, the exact `narration: { files, ext: 'wav' }` line that plays the set back. **`P` pauses/resumes** narration — audio freezes mid-sentence and resumes exactly there, and auto-advance holds while paused. Captions (`C`) follow the voice **sentence by sentence** during live narration (segment-level when narration is off). With nothing configured, `V` opens the picker instead of failing. **The deck announces its own voice**: when a recorded track is configured, a small pill fades in bottom-center about a second after load — *🔊 this deck has a voice-over — `V` plays it* — and clicking it starts narration (the click is itself the user gesture, so the audio is never the blocked-autoplay case). It fades out on its own after ~12s and is written to the message log (`I`) rather than toasted, since the pill is already on screen saying it. It never appears in `?print`, in embedded previews (the theme picker and slide finder boot real decks in iframes), under `?voiceover` (which starts on the first gesture anyway), while captions (`C`) hold that same corner, or once narration has been started on this deck — remembered per deck path like every other narration preference. Without it the only proactive surface was the touch sound button, which CSS shows on `pointer: coarse` alone, so a viewer on a laptop could only learn the deck talks from a key nobody had mentioned. Files are generated by **`decklight voiceover <deck.html>`** (the dispatcher spawns `tools/voiceover.mjs`, which arg-parses at load and so cannot be imported — the same way `video --voiceover` runs it) — the headless counterpart of the deck's the panel's `Record this deck…`: notes → optional local-LLM rewrite → `--engine piper` (local neural TTS; `--voice` = piper model name) or `--engine gemini` (gemini-2.5-pro-tts on Vertex AI; `--voice` = prebuilt voice name). The built-in speech-synthesis voices were removed — not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
518
|
-
- **
|
|
519
|
-
- **
|
|
520
|
-
- **Slide finder**: reached from the palette (`/` → Enter, or the search fallback) — a find-a-slide overlay with the picker's anatomy — a query bar and result list on the left, a live preview of the selected slide on the right. Typing filters as an AND over the query's words against each slide's text; slides whose **title** contains every word rank first, body-only matches follow, and every match is listed as `<slide number> · <title>` (slides without a heading fall back to their leading text). `↑/↓`/hover browse (the preview swaps live), `Enter`/click jumps to the slide, `Backspace` edits, `Esc` clears the query then closes. The preview reuses the picker's lazy embedded-deck mechanism — the iframe boots once (carrying the active theme, generated/custom included via `?gen=`), then selections postMessage `{__decklightPreview: {goto: [slide, step]}}` into it; no reload per candidate.
|
|
521
|
-
- **
|
|
522
|
-
- **
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
- **
|
|
529
|
-
- **
|
|
530
|
-
- **
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
- **Publish (GitHub Pages)**: `decklight publish <deck.html> [--branch gh-pages] [--remote origin] [--no-bundle] [--path <subdir>]` — bundles the deck (single-file, via the bundler above; `--no-bundle` pushes the file as-is) to `index.html` + `.nojekyll` and pushes them to the branch on the remote, then prints the site URL derived from the remote URL: `git@github.com:owner/repo.git` and `https://github.com/owner/repo(.git)` both → `https://owner.github.io/repo/`, an `owner.github.io` repo → `https://owner.github.io/`, and a non-GitHub remote just prints the pushed ref. The commit is built with git plumbing (`hash-object → mktree → commit-tree → push <sha>:refs/heads/<branch>`), so the author's working tree, index, and checked-out branch are never touched. The first publish creates the branch as an orphan and prints where to enable Pages in the repo Settings; every later publish fetches the remote branch and parents on it — history, not force-push — and the sign-off in the commit message comes from `git config user.name/user.email`. `--path <subdir>` publishes under a subdirectory, preserving whatever else the branch already carries. Zero new dependencies: plain git.
|
|
536
|
-
- **Publish targets** (`--target gh-pages|netlify|vercel`, default `gh-pages`; MARKETPLACE.md ENGINES): where the bundled page goes is a choice, not only a place. gh-pages — the bullet above, unchanged — needs git auth and no credential, so it stays core. Netlify and Vercel need a token, so they follow the rule anything on the authoring path needing a credential becomes a marketplace engine behind a core affordance: the affordance is `--target`, and each declares a real `ENGINES#WIZARD` schema (`cli/wizard.mjs` `validateSchema`), so a missing or malformed answer is refused by the exact validation a browser-wizard engine goes through, not a bespoke check. **The token is never a terminal prompt and never the browser wizard** — `publish` is a one-shot, often-headless command (CI has no browser to paste a key into, and no `/edit/wizard` to post it to, since that endpoint is served by the author server, which `publish` never starts) — so it is read from the **provider's own CLI env var** (`NETLIFY_AUTH_TOKEN` + `NETLIFY_SITE_ID`, `VERCEL_TOKEN` + `VERCEL_PROJECT` + optional `VERCEL_TEAM_ID`), matching the ElevenLabs precedent (`tools/elevenlabs-tts.mjs`): a key is not boring, so the environment remembers it and it is never written to `~/.decklight/`. `--branch`/`--remote` are refused alongside a non-gh-pages target rather than silently ignored, since they would otherwise appear to do something. Netlify deploys as a single zip (`cli/zip.mjs`, the `skills --pack` container plumbing); Vercel takes the same files inline as base64 in one JSON POST, per its own API shape. **S3 is deliberately not a target yet** — the one provider needing request signing (SigV4) rather than a bearer token, and a hand-rolled signer nobody can exercise against a real bucket in CI is a correctness claim not worth shipping unverified; Netlify and Vercel are what prove the shape generalizes (MARKETPLACE.md `OPEN`).
|
|
537
|
-
|
|
538
|
-
## REVIEW — Reviewer comments
|
|
539
|
-
|
|
540
|
-
A deck gets reviewed the way a document does — "slide 12 contradicts slide 4", "cut the third bullet" — and
|
|
641
|
+
Authorship is **structural, not detected**: the server spawns the agent itself and diffs the deck around that process. An agent driven from OUTSIDE that flow, a `claude` session in another terminal, is indistinguishable from a hand edit, and nothing in the filesystem could tell them apart. Such an agent declares itself instead, by `POST /deck/edit/commit { message }` when it finishes a logical change; the installed authoring skill instructs agents to do exactly that. The same endpoint is how a multi-step agent marks intermediate boundaries. Uncommitted work is committed before an agent job starts, so the agent's commit holds only the agent's work. Agent-supplied messages are untrusted text: collapsed to a single line, length-capped, and never allowed to begin with `-`. `decklight init` states the policy when it creates a repository rather than asking about it.
|
|
642
|
+
- **History** (`H`, write mode). Every commit that touched this deck, newest first, with a live preview of each and a `⇑` on the ones that exist nowhere but this machine. Each row carries what that version **was** and what it **changed**: a slide count, and `+added` / `−removed` lines in the two colours every diff has used for forty years: because a hash and a subject cannot tell "tightened the wording" apart from "cut four slides", and that is exactly the distinction you are scanning for. The preview has its own transport (`⇤ ← → ⇥`, and the same keys), so a version is judged by walking it rather than by its first slide; the deck behind the overlay does not move. Under the transport, a **details line** spells out the selected row in a sentence (hash, age, subject, slide and line counts), and it is **off by default**: it repeats a row you can already read, right under the slide you are trying to judge. `I` (as in information) or the **details** button at the end of the transport shows and hides it, and the choice is remembered per browser (`decklight-history-details`), because it is how you like this overlay rather than a fact about any one deck. It is not captions and is not called so. The **captions** are the deck's own: `C` or the **CC** button beside it flips the same switch `C` flips on the deck, and with it on the preview carries a caption bar with **that version's notes** for the slide and step on screen, because a version's notes are part of what it changed and the history is where you read them side by side. The preview is told by its URL (`&captions`) when it loads and by a message when the switch flips, so turning them on does not reload the version. Any other embedded preview (the slide finder, the theme and template pickers) is a thumbnail of wherever the cursor is and still shows none. Beside it, **all slides / changes** (`D`, or the button) decides what the transport walks: every slide of the version, or only the slides that version **changed, added or removed** against the one before it, which are the slides a version is about. Each stop is named beside the position in the commit window's three colours (*slide 2 changed*, *slide 4 added*, *slide 3 removed*), a version that touched no slide says *no slide changed*, and a **removed slide is shown from the version before it**, at its old number, since that is the only version that still has it. The slides are matched the way the commit window counts them (`slideDiff` in cli/commit-split.mjs: the longest run of identical slides kept, an edit paired by heading or shared lines), answered per version by `GET /deck/edit/history/changes?ref=<hash>` (a hash only, since the ref is handed to `git show`; a commit never changes, so the answer is kept), and the choice is remembered per browser (`decklight-history-changes`) like the captions. The preview's URL carries the slide (`#/N`), so a version opens where it is asked to rather than on slide 1. **The preview is what this overlay is for**, so the layout is built never to fight it: a wide panel, the preview on a 16:9 `aspect-ratio` because a deck is 1280×720 and a letterboxed sliver judges nothing, and a rail that is structurally incapable of squeezing it. That last part is the lesson from shipping it squeezed: a flex item's default `min-width: auto` forbids shrinking below its own min-content width, so a rail whose row put four things on one line, under a `nowrap` title bar, made `flex: 0 0 300px` a suggestion its content could veto, and the pane rendered 57px. The row is two lines now: subject, then a dimmer line of hash, badges and a compact age. The title bar wraps, and `min-width: 0` is on the column, so nothing in the rail wants to be wide and the preview's size stops being an accident of how somebody worded a commit message. A preview that cannot be produced **says so in the frame**: `/deck/edit/history/at` answers with a small page carrying the reason, because this frame is dark chrome and a bare line of error text rendered in it reads as a black rectangle, which is exactly how a deck that was merely too big to read looked for a release (#508: `git show` through `execFileSync` capped stdout at Node's 1 MB default and THREW `ENOBUFS` rather than truncating, and a blanket catch reported that as a missing revision). `GIT_MAX_BUFFER` (cli/git.mjs, 128 MB) is that cap named once and shared by every git read of a deck, a single-file deck is over 1 MB as a matter of course, and only a ref git itself does not know is a 404. `⏎` **asks** (it names the version, says the restore is written as a NEW commit and that nothing is rewritten), and `⏎` again does it. Restoring is recoverable, but recoverable is not the same as intended, and the whole premise of a history is that you opened it to look rather than to decide. Restoring used to be its own overlay with its own list and its own name for a commit; folding it in means there is one place a version is looked at and one place it is chosen, rather than two that had already begun to differ. It is the git-level sibling of the undo chord: that takes back an edit, this takes back a session. **In no-trust mode `H` opens the deck update instead** (`NO_TRUST#UPSTREAM`): a presented deck has no edit server and so no history to preview, and the live question there is whether the author has pushed anything since you cloned it.
|
|
643
|
+
|
|
644
|
+
### PRESENTING_VOICE · The voice
|
|
645
|
+
|
|
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 before / after, in the notes editor**. **↺ 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, written by the quiet time or drafted by the agent, and when the file has moved on meanwhile (the quiet time wrote the typing) 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. **⇄ before / after** swaps the box for a word-level diff against the notes AS LAST SAVED (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; ⌘⏎ still saves the after, Esc or the button goes back to editing. Both are inert while the box says what the file says. When a rewrite lands in the box the before/after button is lit until looked at: the way to read what an agent changed before it is written.
|
|
648
|
+
- **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
|
+
- **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
|
+
### PRESENTING_FIT · Keeping a slide on the slide
|
|
652
|
+
|
|
653
|
+
- **Overflow guardrail**: content that exceeds the slide flex-shrinks into a scroll box and reads as clipped. The engine warns (`console.warn`) and marks the section with a `data-overflow` attribute, on each slide activation, and for the whole deck in `?print`. The mark is **live, not latched**: layout is not final when a slide activates (a webfont resolves, an image decodes, a chart or terminal mounts), so the active slide is watched and the check re-runs whenever its content changes size or shape. It never waits on a frame: headless renders run out of frames once the page goes idle, and an unmeasured slide is indistinguishable from a clean one. The warning fires on the way in only, so one clipped slide is one line, not one per re-check. So authoring agents can assert `[data-overflow]` is absent in their headless verification (`decklight pdf` does this for a whole deck in one pass and names the offending slides). Overflow always goes **down**, never up: a slide centers its content with `safe center`, so content taller than the slide falls back to top alignment instead of overflowing symmetrically. Plain centering would push half the excess out of the top of the box, through the padding a pinned title reserves for itself, and render the first content element on top of the title.
|
|
654
|
+
- **Pinned titles**: `pinTitles: true | false | <px>` keeps slide titles at one vertical position instead of drifting with content height. **On by default** (`true`); `pinTitles: false` restores the drift-with-content centering deck-wide. `true` pins at **99px** from the stage top (design coordinates, the natural title position of the course's "The Single-Agent Limit" diagram slide, the chosen reference); a number pins at that Y. The leading `h1`/`h2` of each **pinnable** section is absolutely positioned at the pin Y; the section reserves `pin Y + measured title height + 18px` of top padding so the remaining content centers below. Pinnable = has a leading `h1`/`h2` AND content beyond it (`ul, ol, svg, pre, table, .terminal, img, .columns` outside the notes); title cards and quote/statement slides stay centered. Per-slide: `data-pin` forces a pin (even when the config is off), `data-pin="none"` opts out, `data-pin="<px>"` overrides the Y. Titles are re-measured on `sync()` and when webfonts finish loading; print uses the same layout. A detected **subtitle** (DECK_ANATOMY) joins the pinned header block: absolutely positioned directly beneath the title (6px gap) and included in the reserved padding, so content centers below title + subtitle.
|
|
655
|
+
- **Terminal footprint**: a terminal's screen area has a stable size: a **16:9 aspect floor** (width-driven) clamped by the `data-rows` cap as the max, so the box arrives full-size before anything plays and never resizes as steps stream in (output beyond the box scrolls). Real print expands casts fully.
|
|
656
|
+
- `Decklight.init(config)` options: `transition`, `hash` (default true), `controls` (default true: prev/next chevrons; the progress bar is a palette toggle, above), `slideNumber` (default `false | 'n' | 'n/N'`), `width/height` design resolution (default 1280×720, scaled to fit), `themes` (array of theme names for the picker/cycle; default: all shipped themes), `markedThemes` (the marketplace themes the deck marks, as `name@marketplace`) and `themeSources` (where each of those marketplaces comes from, THEME_DISTRIBUTION), `playlist` (multi-deck navigation, above), `pinTitles` (pinned titles, above), `concepts` (diagram concept-color pinning, SVG_DIAGRAMS), `logo` (brand mark, above).
|
|
657
|
+
|
|
658
|
+
### PRESENTING_OUTPUT · Print, export and hand-over
|
|
659
|
+
|
|
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.
|
|
664
|
+
- **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
|
+
deck** (`bundle --all`, recognisable by its `data-module` markers) upgrades
|
|
666
|
+
like any other deck, with a note that a later re-merge would overwrite it: the
|
|
667
|
+
refusal that used to stand there assumed the per-module sources still existed,
|
|
668
|
+
and a multi-module deck hand-edited ever since with those files long gone IS the
|
|
669
|
+
source of truth. The refusal was protecting a workflow nobody had. `init` marks the blocks it writes with the same attribute.
|
|
670
|
+
- **Merged single-file presentation**: `decklight bundle <deck.html> --all [--title "…"]` follows the deck's playlist and concatenates EVERY module's sections into one deck (explicit form: `decklight bundle a.html b.html … -o one.html`). A deck that links the runtime and ships none of it bundles from the installed package: `decklight.js`, `decklight.css` and each theme, said in a note per file, so what a bundle carries is what the deck was playing with; a copy beside the deck wins, and `--themes all` lists the shipped themes when there is no `themes/` folder to list. Each module's first section is marked `data-module="<title>"`; embedded cast ids are prefixed per module to stay unique; relative asset refs are rebased onto the first deck's directory; the per-module `playlist` config is stripped. **In-file module navigation**: `data-module` sections are ordinary slides, so the finder (`G`) already finds them by title or body text and `goto()`s them with no page load; the chrome module tag shows the module of the current slide (nearest preceding marker).
|
|
671
|
+
- **Publish (GitHub Pages)**: `decklight publish <deck.html> [--branch gh-pages] [--remote origin] [--no-bundle] [--path <subdir>]`: bundles the deck (single-file, via the bundler above; `--no-bundle` pushes the file as-is) to `index.html` + `.nojekyll` and pushes them to the branch on the remote, then prints the site URL derived from the remote URL: `git@github.com:owner/repo.git` and `https://github.com/owner/repo(.git)` both → `https://owner.github.io/repo/`, an `owner.github.io` repo → `https://owner.github.io/`, and a non-GitHub remote just prints the pushed ref. The commit is built with git plumbing (`hash-object → mktree → commit-tree → push <sha>:refs/heads/<branch>`), so the author's working tree, index, and checked-out branch are never touched. The first publish creates the branch as an orphan and prints where to enable Pages in the repo Settings; every later publish fetches the remote branch and parents on it, history, not force-push, and the sign-off in the commit message comes from `git config user.name/user.email`. `--path <subdir>` publishes under a subdirectory, preserving whatever else the branch already carries. Zero new dependencies: plain git. In write mode it is a palette row too, **Publish this deck…**, and the only hand-over row that reaches off the machine: every other one writes a file beside the deck, this one puts up a page no undo can take back. So it is **two presses**: the first asks the server for the plan (`GET /deck/edit/publish/plan`: the remote, the branch, the URL somebody will be sent, whether the deck still needs bundling, and whether this machine can sign) and shows it; the second, within the arming window, publishes (`POST /deck/edit/publish`). Doing nothing disarms it. The arming lives in the deck, not the server: an unarmed POST publishes, exactly as the command line does, because a confirmation belongs to the surface that can show a person what they are agreeing to. Two things the route decides so a presenter does not have to: a deck that is **already one file** is published as it is (the bundler would refuse it, which is a sentence about a flag, not an answer), and a machine **without the sigstore client** is told so at the plan, with the command that fixes it, rather than after a confirmation the publish was never going to honour; publish signs by default and refuses rather than publishing unsigned (INTEGRITY). `GIT_TERMINAL_PROMPT=0` for the push: publish pushes with a synchronous git, so a credential prompt would not be asking anybody anything; it would hang the write-mode session on a terminal nobody is watching.
|
|
672
|
+
- **Publish targets** (`--target gh-pages|netlify|vercel`, default `gh-pages`; MARKETPLACE.md ENGINES): where the bundled page goes is a choice, not only a place. gh-pages, the bullet above, unchanged, needs git auth and no credential, so it stays core. Netlify and Vercel need a token, so they follow the rule anything on the authoring path needing a credential becomes a marketplace engine behind a core affordance: the affordance is `--target`, and each declares a real `ENGINES#WIZARD` schema (`cli/wizard.mjs` `validateSchema`), so a missing or malformed answer is refused by the exact validation a browser-wizard engine goes through, not a bespoke check. **The token is never a terminal prompt and never the browser wizard**: `publish` is a one-shot, often-headless command (CI has no browser to paste a key into, and no `/deck/edit/wizard` to post it to, since that endpoint is served by the edit server, which `publish` never starts), so it is read from the **provider's own CLI env var** (`NETLIFY_AUTH_TOKEN` + `NETLIFY_SITE_ID`, `VERCEL_TOKEN` + `VERCEL_PROJECT` + optional `VERCEL_TEAM_ID`), matching the ElevenLabs precedent (`tools/elevenlabs-tts.mjs`): a key is not boring, so the environment remembers it and it is never written to `~/.decklight/`. `--branch`/`--remote` are refused alongside a non-gh-pages target rather than silently ignored, since they would otherwise appear to do something. Netlify deploys as a single zip (`cli/zip.mjs`, the `skills --pack` container plumbing); Vercel takes the same files inline as base64 in one JSON POST, per its own API shape. **S3 is deliberately not a target yet**: the one provider needing request signing (SigV4) rather than a bearer token, and a hand-rolled signer nobody can exercise against a real bucket in CI is a correctness claim not worth shipping unverified; Netlify and Vercel are what prove the shape generalizes (MARKETPLACE.md `OPEN`).
|
|
673
|
+
|
|
674
|
+
## REVIEW · Reviewer comments
|
|
675
|
+
|
|
676
|
+
A deck gets reviewed the way a document does ("slide 12 contradicts slide 4", "cut the third bullet"), and
|
|
541
677
|
the numbers in that sentence go stale the moment a slide is inserted. Comments therefore live beside the deck
|
|
542
678
|
and are **anchored to slides by content**, not by number.
|
|
543
679
|
|
|
544
680
|
**The store** is `<deck>.review.jsonl` beside the deck: one JSON object per line, **append-only, never
|
|
545
|
-
rewritten**. That is the merge strategy rather than a tidiness rule
|
|
681
|
+
rewritten**. That is the merge strategy rather than a tidiness rule: `.gitattributes` declares
|
|
546
682
|
`*.review.jsonl merge=union`, so two reviewers commenting at once produce two sets of added lines and no
|
|
547
|
-
conflict, and it holds only while nothing ever edits a line.
|
|
548
|
-
|
|
683
|
+
conflict, and it holds only while nothing ever edits a line. **decklight writes that line itself**
|
|
684
|
+
(`ensureReviewAttribute`): a repository it creates starts with it, and the first record it appends to the file in any other
|
|
685
|
+
repository, in write mode or by `--import`, adds it to the repository's `.gitattributes`, carried by the deck's next commit; the no-trust mode writes nothing into the work tree, and its branches need no attribute since nothing merges into them but a submit. Nobody has to know the line
|
|
686
|
+
exists, and the alternative is the reviewer's first `git pull --rebase` after the author's resolve meeting a
|
|
687
|
+
plain add/add conflict on the sidecar, which resolved the usual way loses their comment. Resolving a comment, reopening it, deleting it and moving one are
|
|
688
|
+
records of their own (`{op:"resolve", re}`, `{op:"reopen", re}`, `{op:"delete", re}` and `{op:"anchor", re, …}`), so state is **folded from the log** rather than stored:
|
|
549
689
|
two people resolving the same comment is two harmless lines, and a resolve that `merge=union` placed above the
|
|
550
|
-
comment it refers to still lands. JSONL rather than JSON because an appended line is a one-line diff
|
|
551
|
-
reviewer's push reads in a pull request with no tooling at all
|
|
690
|
+
comment it refers to still lands. JSONL rather than JSON because an appended line is a one-line diff: a
|
|
691
|
+
reviewer's push reads in a pull request with no tooling at all, and `body` is written last so the eye lands on
|
|
552
692
|
the prose. A malformed line is skipped and **counted**, never fatal: this file arrives over email and through a
|
|
553
693
|
union merge, and refusing to read it because of one truncated line is how forty comments are lost to a
|
|
554
694
|
forty-first. It is not deck content: `bundle` never inlines it and the ingredients label never counts it, so a
|
|
555
695
|
signed deck stays `verified` no matter how much review it attracts.
|
|
556
696
|
|
|
557
|
-
**
|
|
697
|
+
**Comments are one-way.** A reviewer says something about a slide; the author reads it, and resolves it or moves it. There is no reply, no thread, no notification: decklight is not a messaging system, and the conversation a comment starts, if it starts one, happens wherever the two of them already talk. The store knows five records and no more: a comment, a resolve, a reopen, a delete, a move. A record that names another comment and carries no `op`, which a version before 0.9.0 wrote as a reply, is skipped by the fold, counted nowhere and printed nowhere: it has no slide, so it is not a comment, and nothing hangs under one. The route refuses to write a new one.
|
|
558
698
|
|
|
559
|
-
**
|
|
560
|
-
|
|
699
|
+
**Every comment records which commit the deck was on** when it was written. That is a different question from anchoring and neither implies the other: a slide can be untouched in a deck that has moved forty commits since somebody read it. It is gated on being in a repository, **not** on `--no-git`: that flag says "do not commit for me", and this is provenance. `decklight comments` reports it with the distance (`against 1504ce8, 3 commits ago`), stays silent when there is nothing to say, and **never counts a commit this clone cannot resolve**: a comment can arrive by `--import` from someone whose history yours has not seen, and reporting `0 commits since` for a hash you do not have would be a confident lie. `--at <id>` is what the field is for: it prints what the slide SAID at that commit beside what it says now, because a verdict of `stale` can say the slide changed without being able to say how, and how is usually the whole question: a reviewer objecting to a sentence that is no longer there has either been answered already or been misread.
|
|
700
|
+
|
|
701
|
+
**Anchoring.** A slide has no stable identity: `locateSlide` is the nth `<section>` in the file and
|
|
702
|
+
`data-slide-index` is written from array position at every load, so a comment records the slide number, that
|
|
561
703
|
slide's title, and a **fingerprint** of its text, and resolution walks them in descending order of confidence,
|
|
562
|
-
**reporting which one answered**: `exact` (the fingerprint matched
|
|
563
|
-
naming where it moved from), `stale` (the fingerprint is gone but exactly one slide still carries the title
|
|
704
|
+
**reporting which one answered**: `exact` (the fingerprint matched, this is the slide wherever it now sits,
|
|
705
|
+
naming where it moved from), `stale` (the fingerprint is gone but exactly one slide still carries the title,
|
|
564
706
|
probably right, and worth saying it may not be), `unanchored` (no fingerprint was ever recorded, so the index
|
|
565
707
|
is not a worse answer than nothing), `orphaned` (the slide is gone). A title match must be **unique**: two
|
|
566
708
|
slides called "Agenda" is an ordinary deck and picking the first would be a coin flip presented as an answer.
|
|
567
|
-
The positional fallback is **not** a fallback for a known slide
|
|
709
|
+
The positional fallback is **not** a fallback for a known slide: a comment that recorded a fingerprint and
|
|
568
710
|
cannot find it has lost its slide, and pinning it to whatever is twelfth now puts an objection under prose that
|
|
569
711
|
never said the thing. An orphan is listed rather than dropped, last: an objection to a slide somebody deleted
|
|
570
712
|
is often the most interesting line in the file. The fingerprint is over the slide's text with **whitespace
|
|
@@ -572,109 +714,105 @@ removed, not collapsed**, because the browser reads it through the DOM and a too
|
|
|
572
714
|
the two disagree about spacing in endless invisible ways; notes are excluded, so an author polishing their own
|
|
573
715
|
speaker notes does not orphan every comment on the slide.
|
|
574
716
|
|
|
575
|
-
|
|
576
|
-
registers `GET /review/ping`, `GET /review/comments` and `POST /review/comments`, opens the deck **read-only**,
|
|
577
|
-
and the one path it will ever write is the sidecar. It is a third command with a third route namespace rather
|
|
578
|
-
than a flag on `present` (which registers no `/edit/*` to have refused) or on `author` (which would hand a
|
|
579
|
-
reviewer the power to rewrite what they were asked to read) — the capability is stated by what is registered,
|
|
580
|
-
per PRESENTING's rule that a shared path with a boolean in it is how a server quietly acquires a capability
|
|
581
|
-
later, and it is **asserted as a test**: every `/edit/*` route answers as the unknown path it is, and the deck
|
|
582
|
-
is byte-identical afterwards. With a repository each comment is committed — the sidecar alone, staged by
|
|
583
|
-
itself, with the same per-invocation identity fallback every other decklight commit uses. **The server never
|
|
584
|
-
pushes**; that invariant is what a browser is pointed at, and it survives unchanged. Pushing exists only as
|
|
585
|
-
`review submit` below — a one-shot subcommand somebody typed, which is the argument `publish` already makes.
|
|
717
|
+
**The review routes are the one server's, in both of its modes** (`cli/review-routes.mjs`): `GET`/`POST /deck/review/comments` (a comment, a resolve, a reopen, a delete, a re-anchor: every record is an append) and `POST /deck/review/submit` are registered by the no-trust mode and by the edit server alike, so a review can be left on a deck opened either way; **where a record goes is the mode's**: in no-trust mode, in a repository and not with `--no-git`, **a review is a branch** (`cli/review-ref.mjs`): each record is a commit of its own on the reviewer's local `review/<me>-<date>` branch, built with plumbing (a blob, the parent's tree with one path replaced, `commit-tree`, `update-ref`) so her checked-out branch and the tracked sidecar in her work tree are never touched, her pull never diverges and a `git reset --hard` never loses a comment; the probe names the branch (`review.branch`) and so does every terminal line; otherwise the sidecar beside the deck is appended, which is the author's own file in write mode, the deliverable when there is no repository (`--import`), and what `--no-git` asked for. In write mode the file is **committed with the deck**: `K`, an agent's boundary and the session's bookends stage the sidecar beside the deck when it changed, the commit card counts its lines, and the snapshot ref stays deck-only, so a resolve the author pressed `R` for reaches the reviewer by the same push the deck does; under the edit server the player keeps the owner's overlay (what is waiting, and resolving it). The probe's `review` block (`/deck/ping`: mode, whether comments commit, who is writing, the store) is what a page reads before it comments; the owner's routes, `GET /deck/review/incoming` and `GET /deck/review/at`, are registered by the edit server alone. **Every reader folds one state** (`reviewState`): the sidecar beside the deck, which after a pull carries the author's resolves, and the reviewer's own local review branches, merged by id in that order; the no-trust server, `decklight comments` and `comments submit` all read through it, so none of them can disagree about what was said. **A reviewer opens the deck the way anyone does**, `decklight <deck.html> --no-trust` (a repository URL is cloned first, or the clone already here is opened), and comments with `M`; `?review` opens the panel on load. Nothing about the capability changed when the third command went: the no-trust mode registers no `/deck/edit/*` route to have refused, so the reviewer's own session cannot rewrite what it was asked to read, and the review routes on the edit server widen nothing, because that server could already write everything. The capability is still stated by what is registered, per PRESENTING's rule that a shared path with a boolean in it is how a server quietly acquires a capability later, and it is **asserted as a test** (`test/review-routes.test.mjs`): in no-trust mode every `/deck/edit/*` route answers as the unknown path it is, and in both modes the deck is byte-identical after a comment. With a repository each comment is committed as it lands in no-trust mode: the sidecar alone, staged by itself, with the same per-invocation identity fallback every other decklight commit uses (in write mode the deck's own commits carry it). **The server never pushes**; that invariant is what a browser is pointed at, and it survives unchanged. Pushing exists only as `comments submit` below, a one-shot subcommand somebody typed, which is the argument `publish` already makes.
|
|
586
718
|
With no repository the file is simply written, because a reviewer who was sent a deck and has no clone must
|
|
587
719
|
still be able to say something; that file is the deliverable, and the author takes it in with
|
|
588
720
|
`decklight comments <deck> --import <file>` (merge by id, so importing twice changes nothing).
|
|
589
721
|
|
|
590
|
-
**`decklight
|
|
722
|
+
**`decklight comments submit <deck.html>`** sends the review back: it pushes **one file**, the sidecar as the one state reads it (the file and the local review branches, merged), to a
|
|
591
723
|
branch of its own, `review/<user>-<YYYY-MM-DD>` (the slug is a lossy rendering; the full identity rides in the
|
|
592
|
-
commit's `Signed-off-by`). The commit is built the way `publish` builds one
|
|
593
|
-
remote has**, `commit-tree`, push by object name
|
|
724
|
+
commit's `Signed-off-by`). The commit is built the way `publish` builds one: blob, tree parented on **what the
|
|
725
|
+
remote has**, `commit-tree`, push by object name, so the reviewer's working tree, index and checked-out branch
|
|
594
726
|
are never touched and none of their local commits come along; the assembled ref goes through the same
|
|
595
727
|
`refProblem` gate every user-influenced ref does. A second submit the same day parents on the branch already
|
|
596
|
-
there: a morning of reviewing is one branch, one pull request. The parent is the review branch, else the
|
|
597
|
-
checkout's upstream, else the remote's default branch
|
|
728
|
+
there, with the branch's records and the sidecar's merged by id, so a submit only ever adds to the branch; after the push the local review branch follows the pushed commit, so the next record appends to it and nothing is pushed twice: a morning of reviewing is one branch, one pull request. The parent is the review branch, else the
|
|
729
|
+
checkout's upstream, else the remote's default branch, and **never an orphan**: an orphan's pull-request diff
|
|
598
730
|
reads as "delete every file in the repository", so no resolvable parent is a refusal, not a guess. `--pr` opens
|
|
599
|
-
the pull request **against the branch the review is of
|
|
600
|
-
branch
|
|
731
|
+
the pull request **against the branch the review is of**: the checkout's upstream, else the remote's default
|
|
732
|
+
branch; never blindly against the repository default, which for a review of a feature branch would bury the
|
|
601
733
|
comments under that branch's own commits (behind `gh`, signed in; any failure past the push is a note, never an
|
|
602
734
|
exit), `--dry-run`
|
|
603
735
|
builds the commit and stops before any ref is written, and the announced count is **open comments through the
|
|
604
|
-
same fold every reader uses
|
|
736
|
+
same fold every reader uses**, never a raw line count.
|
|
605
737
|
|
|
606
738
|
**The author finds out** without being asked, on three surfaces sharing one reader (two network calls no matter
|
|
607
|
-
how many reviews wait, landing refs exactly where a plain `git fetch` would): a line at
|
|
608
|
-
startup
|
|
739
|
+
how many reviews wait, landing refs exactly where a plain `git fetch` would): a line at write-mode
|
|
740
|
+
startup (detached, never awaited, never on a timer, and nowhere near the SIGINT path), the `M` overlay's
|
|
609
741
|
incoming section (read on demand, behind the keypress that opened it), and `decklight comments --incoming` for
|
|
610
742
|
SSH and pipes (exit 0 when the question was answered, including "none"; 1 when it could not be asked). The
|
|
611
743
|
startup check is a fetch the author did not type: it is the **named, sanctioned exception** to "never a fetch
|
|
612
744
|
you did not ask for", kept to the update-check shape, and switched off by any of `--no-review-check`,
|
|
613
|
-
`DECKLIGHT_NO_REVIEW_CHECK`, or `CI
|
|
614
|
-
reviews waiting" look identical and mean opposite things. The explicit switches silence **every** surface
|
|
615
|
-
they mean "never touch the network for reviews"
|
|
745
|
+
`DECKLIGHT_NO_REVIEW_CHECK`, or `CI`, each reporting the *reason* it was skipped, because a silent skip and "no
|
|
746
|
+
reviews waiting" look identical and mean opposite things. The explicit switches silence **every** surface:
|
|
747
|
+
they mean "never touch the network for reviews", while `CI` silences only the unasked startup fetch: a route
|
|
616
748
|
somebody exercises deliberately must still answer there. A check that could not run is a **named failure
|
|
617
|
-
state and never renders as "none waiting"
|
|
749
|
+
state and never renders as "none waiting"**; unchecked is its own answer and never a pass. The `refs/heads/review/*`
|
|
618
750
|
glob is a frozen constant in the source; nothing derived from a deck, a request, or a reviewer's choices
|
|
619
751
|
reaches a refspec position.
|
|
620
752
|
|
|
621
|
-
**
|
|
753
|
+
**The panel reads and writes.** `M` shows every comment there is, yours and each review branch's,
|
|
622
754
|
**grouped by who said it**, one heading per source, open first and finished ones struck through below them
|
|
623
|
-
inside their group.
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
755
|
+
inside their group. **Its foot is a composer for the slide on screen**, pinned there while the list scrolls
|
|
756
|
+
above it: the line over the box names the slide (`on slide 2 · Why this matters`) and follows the deck as you
|
|
757
|
+
walk it, so a docked panel is a place to go through a talk and leave comments without opening anything else.
|
|
758
|
+
`⌘⏎` leaves the comment on whatever slide is on screen at that moment, the list picks it up and the box empties
|
|
759
|
+
for the next one; typing never moves the deck, and `Esc` closes the panel from the box as from anywhere, the
|
|
760
|
+
draft kept. The box is the same node across repaints and closes, so a half-written comment survives both;
|
|
761
|
+
docked at the bottom, the button sits beside the box, because the tray is short. It is at the **foot**, not the
|
|
762
|
+
top: the composer once sat above the list, which put a text box over twenty comments you were trying to read.
|
|
763
|
+
`⇧M` goes into that box when the panel is up; when it is not, it opens a card of its own that also lists
|
|
764
|
+
**what is already said about that slide**, so a point is not made twice. Either way, an author can comment as
|
|
765
|
+
well as a reviewer: the composer once appeared only when a reviewer's server answered, so an author
|
|
766
|
+
leaving themselves a note had to start a second server on a second port in a mode that would not let them edit
|
|
767
|
+
the slide they were commenting on. The edit server now takes a
|
|
768
|
+
comment through the same append-only route it already used for resolves, and both modes build the record with
|
|
629
769
|
the same `reviewRecord`, so a union merge never meets two shapes of one thing.
|
|
630
770
|
|
|
631
|
-
**Doneness is per comment, and
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
branch, which is not yours to write, so the mark is kept in **this clone's git config**
|
|
635
|
-
(`[decklight-review "<branch>"] done-<id>`): private, never pushed, reversible with `git config --unset`, and a
|
|
636
|
-
comment id is checked against the shape a config key allows before it becomes one. `R` marks the selected
|
|
637
|
-
comment either way — armed then confirmed for your own, because that append is shared and cannot be taken back;
|
|
638
|
-
immediately for a reviewer's, because a private mark is one keypress from undone and an arm protects nothing.
|
|
639
|
-
A review branch stops counting as waiting when every one of its open comments is marked, so finishing half of a
|
|
640
|
-
long review leaves the other half on screen and in the count. Marking one **re-sorts** it below the open ones,
|
|
641
|
-
so the selection follows the comment by id rather than by position — otherwise `R` pressed twice would mark a
|
|
642
|
-
second comment instead of un-marking the first. Nothing is ever copied: the merge/PR path still works for
|
|
643
|
-
anyone who wants the records themselves; it is simply not what this overlay does.
|
|
771
|
+
**Doneness is per comment, and the mark is the same record whoever owns the comment.** Your own comments are finished with by an append-only `{op:"resolve", re}` record in the deck's sidecar, which travels; "done" is not a second state beside it, it IS that record. **Taken back the same way**: `{op:"reopen", re}` is a line of its own, never an edit of the resolve, so the file stays a log and `merge=union` stays safe. Resolve and reopen are one history per comment and the fold applies the **latest**: by `at` where both sides stamped one, because a union merge keeps each side's order and nothing else, and a stale resolve from one clone must not outrank a later reopen from another; by file order where no stamp says otherwise. **A reviewer's comment is resolved by the same record, from your side**: their comments live on their branch, which is not yours to write, so the resolve goes in *your* sidecar, naming their id, and the incoming listing folds their branch together with your ops to say which are done. Nothing of theirs is copied. Because the record travels with the deck, **the reviewer sees the tick**: after a pull their own fold meets your resolve, and the comment reads resolved on their screen, in no-trust mode, with the same `✓` yours get. The marks an earlier version kept in this clone's git config (`[decklight-review "<branch>"] done-<id>`) are still read, never written again, so an upgrade un-marks nobody's work. `R` marks the selected comment either way, and `R` again takes it back, **immediately in both cases**: the resolve once had a two-step because the append could not be taken back, and now it can, so an arm would protect nothing. A review branch stops counting as waiting when every one of its open comments is marked, so finishing half of a long review leaves the other half on screen and in the count. Marking one **re-sorts** it below the open ones, so the selection follows the comment by id rather than by position; otherwise `R` pressed twice would mark a second comment instead of un-marking the first. **`D` hides what is done**, yours resolved and a reviewer's marked alike, and shows it again: the headings keep their counts, a line under each group says how many are hidden and that `D` shows them, and the choice is this browser's, per deck, like the dock. A filter on the view, never on the file. Nothing is ever copied: the merge/PR path still works for anyone who wants the records themselves; it is simply not what this overlay does.
|
|
772
|
+
|
|
773
|
+
**Your own comment can be withdrawn.** `⌫` in the panel deletes the selected comment of your own, armed then confirmed, because unlike a resolve this append has no key that takes it back: an appended `{op:"delete", re}`, never a line removed, so the file stays a log and `merge=union` stays safe. The fold drops the comment from every view, the panel's, the CLI's, the submit count's, and a resolve or a move that names it lands on nothing; applied last, so a delete a union merge placed above its comment still lands. A reviewer's comment is not yours to delete, as it is not yours to move: the key says so and writes nothing. A reviewer deletes their own the same way, through the same route, in no-trust mode.
|
|
644
774
|
|
|
645
775
|
**A comment on a slide that no longer exists is reconciled, never stranded.** An orphan is still listed last
|
|
646
|
-
and never silently re-pinned
|
|
647
|
-
commit the comment was written against (`GET /
|
|
776
|
+
and never silently re-pinned, but `⏎` on it (with nowhere to jump) unfolds **what the slide said** at the
|
|
777
|
+
commit the comment was written against (`GET /deck/review/at`, the `--at` machinery served), putting the
|
|
648
778
|
objection back under the prose it was about; most orphans dissolve into a resolve right there. For a slide
|
|
649
779
|
rewritten past what fingerprint + title can find, `A` **moves the comment to the slide on screen** (armed,
|
|
650
|
-
then confirmed): an appended `{op:"anchor", re, slide, title, fp}` record
|
|
651
|
-
append-only op family, beside resolve and
|
|
652
|
-
the moved comment reads as if written there (`exact`), while the reviewer's original line is never edited
|
|
780
|
+
then confirmed): an appended `{op:"anchor", re, slide, title, fp}` record, the fourth member of the
|
|
781
|
+
append-only op family, beside resolve, reopen and delete. The fold applies the **latest** anchor before resolution, so
|
|
782
|
+
the moved comment reads as if written there (`exact`), while the reviewer's original line is never edited,
|
|
653
783
|
which is what keeps `merge=union` and a replayed `--import` safe; an op's identity is its tuple, so arriving
|
|
654
784
|
twice is one line. `movedFrom` keeps pointing at where the reviewer wrote it: that history is the comment's,
|
|
655
785
|
not the anchor's.
|
|
656
786
|
|
|
657
|
-
**
|
|
658
|
-
|
|
787
|
+
**What a reviewer submitted stays in front of her.** Her records live on her review branches, local and, once submitted, on the remote, never on the branch she has checked out; `M` lists the one state above, and in no-trust mode `GET /deck/review/comments` also folds in the records on her own `review/<me>-*` branches *on the remote* (`myReviews`), merged by id behind the rest, so a clone that never had them locally, or lost its local branch, still shows what she sent; the response says so (`mine: { state, branches }`). Behind the same switches that silence the author's inbox check, once a minute at most, and never fatal: a remote that cannot be asked leaves the local state alone on screen.
|
|
788
|
+
|
|
789
|
+
**In the deck, `M`** opens one overlay whose powers depend on which mode answered: no-trust mode means the
|
|
790
|
+
composer is there, on the slide you are looking at; an edit server means rows can be resolved; with neither,
|
|
659
791
|
the list still reads and says where comments come from. `⌘/⌃⏎` posts and a bare `⏎` is a newline, because a
|
|
660
792
|
comment is prose. Resolving is **armed, then confirmed**, and `Esc` backs out of the arm without closing. Submitting is the
|
|
661
793
|
same two-step (`S`, or the palette's "Submit review…"), and the browser never runs git: it asks
|
|
662
|
-
`POST /review/submit`, and the local server
|
|
794
|
+
`POST /deck/review/submit`, and the local server, the only thing in the room holding a capability, does the
|
|
663
795
|
pushing with the same code the typed subcommand runs.
|
|
664
|
-
Rows are built as nodes, never `innerHTML
|
|
665
|
-
author's server exposes the same store under the same append-only rule (`GET`/`POST /
|
|
796
|
+
Rows are built as nodes, never `innerHTML`: a comment is somebody else's text that arrived over git. The
|
|
797
|
+
author's server exposes the same store under the same append-only rule (`GET`/`POST /deck/review/comments`).
|
|
666
798
|
|
|
667
799
|
**The panel sits beside the slide, not over it.** Reviewing is writing about what is on screen, so the overlay
|
|
668
|
-
is **non-modal**: it never dims or covers the deck. A small control in its header places it
|
|
800
|
+
is **non-modal**: it never dims or covers the deck. A small control in its header places it: **float**
|
|
669
801
|
(a movable card, the default, dragged by its header), or docked **left**, **right**, or **bottom**, where it
|
|
670
802
|
reserves a gutter (`--dock-left/right/bottom` on the root) and the stage reflows into what is left through the
|
|
671
803
|
same `rescale` that fits the slide to the window. The placement is **remembered per deck** in `localStorage`,
|
|
672
|
-
like the clock and the character.
|
|
804
|
+
like the clock and the character. **One slot, one placement** (`src/core/dock.js`): the comments, the notes,
|
|
805
|
+
the inspector, the sources, the agent ask and the HTML editor share it. They share ONE placement per deck
|
|
806
|
+
(`decklight-panel-dock:`; a panel nobody has placed yet opens at its own default, the notes at the bottom,
|
|
807
|
+
the inspector on the right), opening one closes whichever other holds the slot, and every header carries a
|
|
808
|
+
row of **tabs** to the others this deck offers (the agent only in write mode, the sources where they can be
|
|
809
|
+
written; the HTML editor opens on an element, so it has no tab). Six panels used to keep six placements,
|
|
810
|
+
any number open at once on any sides. Because the panel is non-modal the deck keeps the keyboard: the panel owns
|
|
673
811
|
the arrows only while you are working **in** it (your last click or focus was the card), and hands them back to
|
|
674
|
-
the slides the moment you touch the deck
|
|
812
|
+
the slides the moment you touch the deck, so you walk the deck with `←`/`→` while the panel stays up. The
|
|
675
813
|
composer's target **follows the slide you are on while the box is empty, and locks to it once you start typing**
|
|
676
814
|
(the label then says which slide it will land on and which you are merely viewing), so glancing at other slides
|
|
677
|
-
mid-comment never silently moves where it is filed. **Jumping to a comment's slide leaves the panel open
|
|
815
|
+
mid-comment never silently moves where it is filed. **Jumping to a comment's slide leaves the panel open**:
|
|
678
816
|
it navigates the deck beside it and nothing else. Closing on the jump was right while the overlay covered the
|
|
679
817
|
deck, because getting out of the way was the only way to see what you had jumped to; beside the slide that
|
|
680
818
|
reasoning inverts, and walking a review is jump, read, jump. `Esc` and `M` always close from either surface.
|
|
@@ -683,17 +821,17 @@ found, orphans last, resolved ones counted rather than printed (`--all`, `--unre
|
|
|
683
821
|
|
|
684
822
|
Comment text is **untrusted input from a third party**. It is data everywhere it travels; the one place it
|
|
685
823
|
reaches a command line is a commit subject, and that goes through the same sanitiser as an agent's (one line,
|
|
686
|
-
capped, never leading `-`). It must never reach the `A` agent path unattended
|
|
824
|
+
capped, never leading `-`). It must never reach the `A` agent path unattended: CONTRIBUTING's split between
|
|
687
825
|
the thing with a schedule and the thing with hands applies directly.
|
|
688
826
|
|
|
689
827
|
This persists where ink (PRESENTING) is deliberately ephemeral, and the two must not be confused in the
|
|
690
828
|
vocabulary either: ink is the **presenter** marking a slide during a talk and is cleared on every slide change;
|
|
691
829
|
a review comment is a **reviewer** writing to the author before one. Different actor, different lifetime.
|
|
692
830
|
|
|
693
|
-
## JS_API
|
|
831
|
+
## JS_API · Public JS API
|
|
694
832
|
|
|
695
833
|
```js
|
|
696
|
-
Decklight.init(config) → instance
|
|
834
|
+
Decklight.init(config?) → instance // no argument: the options come from the data-decklight-config block (DECK_ANATOMY); a deck with no init call boots itself
|
|
697
835
|
instance.next() / .prev() / .goto(slide, step)
|
|
698
836
|
instance.on('slide'|'build'|'ready', fn)
|
|
699
837
|
Decklight.registerBuildProvider(el, provider) // available pre- and post-init
|
|
@@ -703,28 +841,28 @@ instance.theme(name) // switch theme programmatically
|
|
|
703
841
|
instance.themePicker.open() / .close()
|
|
704
842
|
instance.generateTheme() // ⌃T programmatically; returns the autoname
|
|
705
843
|
instance.cycleFont(dir) // [ / ] programmatically (±1)
|
|
706
|
-
instance.cycleLayout(dir) // L / ⇧L programmatically (±1;
|
|
844
|
+
instance.cycleLayout(dir) // L / ⇧L programmatically (±1; write mode only)
|
|
707
845
|
instance.layoutRing(slide?) // the layout ring a slide would cycle (skips applied)
|
|
708
|
-
instance.
|
|
846
|
+
instance.currentTheme() // the theme on screen, by name
|
|
709
847
|
instance.toggleNarration() // V programmatically
|
|
710
848
|
instance.annotate // ink: .toggle() / .laser() / .clear() / .stroke(points)
|
|
711
849
|
instance.showWelcome() // reopen the first-run welcome card
|
|
712
|
-
instance.tips // .show() / .reset() / .set(on) / .status() → { tipsOn, tipsLeft }
|
|
713
850
|
instance.saveGeneratedTheme(name?) // ⌃⇧T; a name argument skips the prompt
|
|
714
851
|
```
|
|
715
852
|
|
|
716
|
-
## DECK_IMPORT
|
|
853
|
+
## DECK_IMPORT · Importing an existing deck
|
|
717
854
|
|
|
718
855
|
`decklight import <deck.pptx | deck.key | google-slides-url>` converts a
|
|
719
|
-
presentation you already have into a
|
|
720
|
-
theme
|
|
856
|
+
presentation you already have into a decklight deck: slides plus a
|
|
857
|
+
configuration block naming the theme, images as `data:` URIs, the `init`
|
|
858
|
+
output shape (`DECK_ANATOMY`); `--inline` embeds the runtime and theme. It is a
|
|
721
859
|
**content importer, not a pixel renderer**: the original template's look is
|
|
722
860
|
deliberately replaced by decklight theming, which is what buys the deck
|
|
723
|
-
everything downstream
|
|
861
|
+
everything downstream: themes, builds, narration, the notes editor, `dev`.
|
|
724
862
|
|
|
725
863
|
**Three front doors, one parser.** `.pptx` is the only one of the three that is
|
|
726
864
|
a readable format. `.key` is an undocumented binary archive, and a Google Slides
|
|
727
|
-
deck is not a local file at all
|
|
865
|
+
deck is not a local file at all, so both are turned into a `.pptx` first, by
|
|
728
866
|
the only software entitled to do it: Keynote exports one via `osascript` on
|
|
729
867
|
macOS (elsewhere the command prints the manual export path), and Google serves
|
|
730
868
|
one from `/export/pptx` for any deck that is link-shared. `.ppt`, the pre-2007
|
|
@@ -732,17 +870,20 @@ binary format, is refused with instructions rather than guessed at.
|
|
|
732
870
|
|
|
733
871
|
| PowerPoint | decklight |
|
|
734
872
|
|---|---|
|
|
735
|
-
| slide | `<section>`, in `<p:sldIdLst>` order (not archive order); hidden
|
|
873
|
+
| slide | `<section>`, in `<p:sldIdLst>` order (not archive order); a hidden slide is **kept** as `data-hidden`, numbered and reported (`HIDDEN_SLIDES`) |
|
|
736
874
|
| title placeholder | `<h2>`; `<h1>` when it is the title layout's centred title (`ctrTitle`) |
|
|
737
875
|
| subtitle placeholder | the following `<p>`, which feeds the DECK_ANATOMY subtitle rule |
|
|
738
876
|
| body bullets | `<ul>`/`<ol>`, indent levels as real nesting **inside** the parent `<li>`; bold/italic/links preserved |
|
|
739
|
-
| `<p:bldP>` (PowerPoint's own per-paragraph build list) | `data-build="fade-up"` on that list
|
|
877
|
+
| `<p:bldP>` (PowerPoint's own per-paragraph build list) | `data-build="fade-up"` on that list, `--build all\|none` overrides |
|
|
740
878
|
| speaker notes | `<aside class="notes">`, one `<p>` per paragraph |
|
|
741
879
|
| pictures | `<img>` with the bytes inlined as a `data:` URI |
|
|
742
880
|
| tables | `<table>`, first row as `<thead>` |
|
|
743
|
-
|
|
|
881
|
+
| charts | `data-chart` JSON built from the chart part's own caches: bar, line, area, pie, doughnut and **scatter**, in the kinds `CHARTS` draws. A scatter's pairs come from `c:xVal`/`c:yVal` and are matched BY INDEX (a cache lists its points in any order), with the axis titles the chart was drawn against. A kind decklight cannot draw (radar, stock, surface, bubble) is dropped by name |
|
|
882
|
+
| SmartArt | its **data model**, never its drawing: a flat sequence of at most six steps becomes a themed SVG strip (`SVG_DIAGRAMS`) with an arrow between each and, for a cycle, the way back drawn under it; anything else (a hierarchy, a longer process, a nested one) keeps every word as a nested list, ordered when the shape was a sequence. The layout part decides which of those it is, the connection list rebuilds the nesting (`srcOrd` is the order, not document order), and the layout's own `pres` points are dropped, being boxes rather than words. The report says which happened. Only a graphic whose data model cannot be read at all is dropped |
|
|
883
|
+
| shapes and connectors (a diagram somebody **drew**) | one themed SVG in the slide's own coordinates: boxes, ellipses, diamonds and triangles by their preset, arrows stopping at the boxes' edges, the shapes' words inside them rather than beside them as stray bullets. A **grouped** shape's own transform is in its group's child space (`a:chOff`/`a:chExt`), and only the group's frame says where on the slide that is, so frames are composed through every nesting level, or a group anyone moved or resized after grouping would come across where it sat before. **`--shapes auto|strict|text`** sets the bar: `auto` (the default) believes the shapes themselves: two placed shapes of which one was *drawn* (a preset other than `rect`, or hand-drawn geometry; a text box, which PowerPoint flags `txBox="1"`, never counts) or a loose line among them is an arrangement, while two text boxes side by side stay a layout, and cross *as* one: `data-layout="split"`, each box a column in left-to-right order, anything else on the slide the footer (`twoColumns`: exactly two text-bearing placed shapes, each clear of the other horizontally, overlapping in height by half the shorter; a third box, a stacked pair or an empty box is not a comparison); `strict` is the connector rule above and nothing more, for a deck where `auto` drew something it should not have; `text` never draws, and says nothing about it. Under `strict`, a slide `auto` would have drawn says so in its report line. What crosses inside a drawing: a line attached at neither end is drawn from its own place with the arrowheads the file gave it (`a:headEnd`/`a:tailEnd`; bent and curved connectors straight between the same two points); a shape's rotation (`a:xfrm@rot`) and flips as an SVG `transform` about its centre; an outline left unfilled (`a:noFill`) stays an outline rather than taking a palette slot, because a region is not a box; the presets people draw with: block arrows, chevrons, hexagons, stars, parallelograms, the plus, as themed polygons of their *kind*, adjust handles ignored, callouts and clouds keeping their family and anything else a rectangle. A box with more to say than four short lines, or a list, or several paragraphs, carries its body as HTML in a `<foreignObject>` (`.dwg-text`), which wraps and keeps a list a list; `<text>` cannot, and four lines of it followed by silence was a drop nobody was told about. **Hand-drawn geometry** (`a:custGeom`) crosses as the path it is: each `a:path` scaled from its own space onto the placed box, lines and Béziers one to one, `a:arcTo` recovered into an SVG arc from the current point, and a subpath's own word on fill kept. **A picture in the arrangement**, the screenshot the arrows point at, crosses inside the drawing as an `<image>` at its place, stretched to its box as PowerPoint shows it (a picture lends no intent of its own: two pictures side by side are a layout). Under `auto`, a line PowerPoint never attached is **attached by where it lands**: an end within 8px of a shape's edge, or inside it, belongs to that shape, and both ends on two different shapes make it a connector drawn edge to edge, with its direction kept, since a head-only arrow points backwards. `strict` believes only the file's own `a:stCxn`/`a:endCxn`. An attached line's arrowheads follow `a:headEnd`/`a:tailEnd` when the file says; a connector with no geometry of its own is an arrow, as before. The test is deliberately strict, because turning an ordinary slide into a strange picture is worse than not trying: **two placed, non-placeholder shapes and one connector that names the shapes at both of its ends** (`a:stCxn`/`a:endCxn`, what PowerPoint writes when somebody attaches an arrow to a box). Short of that nothing changes, except that a slide which LOOKED like a drawing (three placed shapes, or two with a line between them) now says its arrangement did not survive; two text boxes side by side stay silent, being a layout |
|
|
884
|
+
| embedded media, transitions, OLE objects | **dropped, and named** with the slide number and what to rebuild them as |
|
|
744
885
|
|
|
745
|
-
Drops never fail the command
|
|
886
|
+
Drops never fail the command: only an unreadable file, a non-presentation, or
|
|
746
887
|
a deck whose every slide is hidden do. A silent drop is the failure that
|
|
747
888
|
matters here: a chart that quietly vanishes from slide 14 is discovered on
|
|
748
889
|
stage, so every drop is reported with its slide number and, where decklight has
|
|
@@ -750,681 +891,386 @@ a native answer, what to rebuild it with (`chart dropped — rebuild as
|
|
|
750
891
|
data-chart`). PPTX **export** remains a v1 non-goal (NON_GOALS); this is import only.
|
|
751
892
|
|
|
752
893
|
The runtime is not involved: `import` is CLI-only, adds nothing to
|
|
753
|
-
`dist/`, and reads the archive with `tools/zip.mjs` + `tools/ooxml.mjs
|
|
754
|
-
200 lines over `node:zlib
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
## MARKETPLACE_REGISTRY — Marketplaces: registered, not fetched
|
|
758
|
-
|
|
759
|
-
A marketplace is a git repo (or a local directory) with
|
|
760
|
-
`.decklight/marketplace.json` at its root — decentralized, no central registry,
|
|
761
|
-
mirroring Claude Code's layout deliberately (MARKETPLACE.md MARKETPLACES). The
|
|
762
|
-
manifest names the catalog and its entries:
|
|
763
|
-
|
|
764
|
-
**Which ref.** `add` and `update` take `--branch <ref>`, and it accepts a **tag**
|
|
765
|
-
as readily as a branch — a tag is how a catalog gets pinned to a version known
|
|
766
|
-
to work. Without it the shallow clone follows the remote's own `HEAD`, so
|
|
767
|
-
nothing here has ever assumed `main` or `master` and a repo whose default is
|
|
768
|
-
`trunk` always worked; what was missing was any way to ask for a ref that is not
|
|
769
|
-
the default. The ref is **remembered in the registry**, so `update` re-clones the
|
|
770
|
-
same one — a pin that a refresh silently abandoned would be decoration — and
|
|
771
|
-
`update --branch` is how the pin is deliberately moved. `list` shows it as
|
|
772
|
-
`#ref` beside the `@commit`, because the two answer different questions: the ref
|
|
773
|
-
is what you asked for and what the next update will fetch, the commit is where
|
|
774
|
-
that ref happened to point. A ref is validated against an allowlist before it
|
|
775
|
-
reaches the command line, since a value beginning with `-` is an option rather
|
|
776
|
-
than a ref; a full commit SHA is refused with its own message, because
|
|
777
|
-
`--branch` takes a ref and a bare object name is not one — fetching a commit
|
|
778
|
-
means a second round trip and a checkout, which is a different shape from the
|
|
779
|
-
single shallow clone. `--branch` against a **local** directory is an error, not
|
|
780
|
-
a no-op: a directory has no refs to choose between, and accepting the flag
|
|
781
|
-
while ignoring it would look exactly like success.
|
|
894
|
+
`dist/`, and reads the archive with `tools/zip.mjs` + `tools/ooxml.mjs`, about
|
|
895
|
+
200 lines over `node:zlib`, rather than taking a dependency.
|
|
782
896
|
|
|
783
|
-
```json
|
|
784
|
-
{
|
|
785
|
-
"name": "nord-pack",
|
|
786
|
-
"description": "cool blues",
|
|
787
|
-
"entries": [
|
|
788
|
-
{ "name": "nord-deep", "type": "theme", "source": "./themes/nord-deep.css", "description": "deep blues" }
|
|
789
|
-
]
|
|
790
|
-
}
|
|
791
|
-
```
|
|
792
897
|
|
|
793
|
-
|
|
794
|
-
optional; versions and compat ranges arrive with code-carrying extensions —
|
|
795
|
-
versions for code, none for data — see `UNIT_COMPAT`). The one exception is a reference-only kind,
|
|
796
|
-
which carries no `source` because it carries nothing at all — see `VOICE_UNITS`. A malformed manifest is refused **naming the
|
|
797
|
-
line and the field** (`line 7: entries[1].type — missing`), never with a stack
|
|
798
|
-
trace — a typo in somebody's catalog is not an internal error.
|
|
799
|
-
|
|
800
|
-
**A kind may declare extra required fields, and an unknown kind is accepted
|
|
801
|
-
rather than refused.** An `importer` entry must carry `extensions` — the file
|
|
802
|
-
extensions its adapter reads — because that is what lets `decklight import
|
|
803
|
-
talk.marp` name the adapter **from the cache, offline**; an adapter whose
|
|
804
|
-
extensions were only discoverable by installing it could never be offered at
|
|
805
|
-
the moment it is needed. A `type` this decklight does not know is *not* an
|
|
806
|
-
error: a catalog is a file someone else wrote, quite possibly against a newer
|
|
807
|
-
version, and refusing the whole manifest over one unrecognised kind would make
|
|
808
|
-
every catalog un-addable the day it grows an entry. `marketplace list` groups
|
|
809
|
-
entries by kind and prints the install command for each, so an unknown kind
|
|
810
|
-
reads as "not yet" rather than as a typo — the two must never look alike.
|
|
811
|
-
|
|
812
|
-
`decklight marketplace add <owner/repo | git url | path>` reads the manifest at
|
|
813
|
-
the source's root and registers the catalog; `list`, `update <name>` and
|
|
814
|
-
`remove <name>` complete the roster. State lives under `~/.decklight/`
|
|
815
|
-
(`DECKLIGHT_HOME` overrides): one registry file, `marketplaces.json`, plus a
|
|
816
|
-
`marketplaces/` directory holding, per marketplace, its cached manifest
|
|
817
|
-
(`<name>.json`) and the checkout that manifest came with (`<name>/`) — the
|
|
818
|
-
config home the engine wizard (MARKETPLACE.md ENGINES) shares.
|
|
819
|
-
|
|
820
|
-
**A remote marketplace is read by cloning it** (MARKETPLACE.md
|
|
821
|
-
`MARKETPLACES#CLONE`), never by fetching one file at a time off a raw-content
|
|
822
|
-
host, and `owner/repo` is shorthand for that clone rather than for a URL. Three
|
|
823
|
-
things follow, and each was a bug before it did. A clone uses **the caller's own
|
|
824
|
-
git credentials**, so a marketplace in a private repo works exactly as `git
|
|
825
|
-
clone` does in that terminal — a credential helper for HTTPS (`gh auth
|
|
826
|
-
setup-git`, the macOS Keychain), or the SSH form of the URL; an anonymous fetch
|
|
827
|
-
had none, so a private catalog could register and then 404 on every install.
|
|
828
|
-
The manifest and every entry's bytes come from **one commit**, recorded in the
|
|
829
|
-
registry and printed by `list`, where fetching each artifact separately at
|
|
830
|
-
`HEAD` could produce an install matching no single commit of the marketplace.
|
|
831
|
-
And because the clone is kept — `~/.decklight/marketplaces/<name>/`, its `.git`
|
|
832
|
-
dropped, replaced wholesale by the next `update` and removed by `remove` —
|
|
833
|
-
**installing an entry reads the disk**, not the network. A local-path
|
|
834
|
-
marketplace keeps no checkout: its own directory already is one. An entry whose
|
|
835
|
-
`source` is an absolute `https://` URL (a gist, a release asset) is still
|
|
836
|
-
fetched as written.
|
|
837
|
-
|
|
838
|
-
**The invariant everything above serves: registering is not fetching.** The
|
|
839
|
-
network is touched only by an explicit `add` or `update` of a remote source —
|
|
840
|
-
never at registration, never when a deck loads, never while presenting. The
|
|
841
|
-
first-party marketplace is registered on first CLI run as a pure filesystem
|
|
842
|
-
write; its first fetch happens at the first browse or `update`, so first run
|
|
843
|
-
offline is silent and instant, and a deck on conference wifi, on a plane, or
|
|
844
|
-
air-gapped behaves identically to one at a desk. Nothing on the deck-load or
|
|
845
|
-
presenting path imports the marketplace module at all (pinned by
|
|
846
|
-
`test/marketplace.test.mjs`). Offline is a first-class state, not an error
|
|
847
|
-
state: `list` reads only the cache, and a fetch failure is fast and names the
|
|
848
|
-
marketplace and the reason — no spinner, no hang.
|
|
849
|
-
|
|
850
|
-
**The unit library** (`UNITS#REST`) is where the installable kinds land:
|
|
851
|
-
`~/.decklight/templates/`, `.../skills/`, `.../importers/`, `.../voices/`,
|
|
852
|
-
beside the `plugins/` that `PRESENT#PLUGINS` writes. One seam installs all of
|
|
853
|
-
them (`decklight template|importer|voice add`, `decklight skills add`), and
|
|
854
|
-
each is used by the command that needs it. **`decklight init --from <name>` scaffolds from
|
|
855
|
-
an installed template** — replacing only its `<title>` and first `<h1>`, so a
|
|
856
|
-
template is a deck and not a program — and a name that is not installed is met
|
|
857
|
-
with the install command rather than a download: `init` is the first command
|
|
858
|
-
anyone runs, and it does not reach the network. A marketplace skill installs
|
|
859
|
-
into the library and therefore sits **alongside** the authoring skill
|
|
860
|
-
`decklight skills` writes into a project, never replacing it. An import adapter
|
|
861
|
-
is **offered at the point of failure** — `decklight import talk.marp` names the
|
|
862
|
-
adapter that reads `.marp` and how to get it, which is the ENGINES pattern
|
|
863
|
-
(offer at the moment of need) rather than a setup step nobody performs in
|
|
864
|
-
advance. Installing an adapter does not yet make it *run*: executing a
|
|
865
|
-
marketplace module is `EXTENSIONS#TRANSFORMS`, and until that lands `import`
|
|
866
|
-
says so plainly instead of failing in a way that reads like a bug.
|
|
867
|
-
|
|
868
|
-
### UNIT_COMPAT — Compat for code-carrying units: an API version, not an engine version
|
|
869
|
-
|
|
870
|
-
A build-time transform (and, later, an executed import adapter) is Node code,
|
|
871
|
-
so its catalog entry declares a version — unlike a theme or a voice, which
|
|
872
|
-
carry none. What that version is checked *against* is deliberately **not**
|
|
873
|
-
decklight's own package version:
|
|
898
|
+
## The platform contract, in PLATFORM.md
|
|
874
899
|
|
|
875
|
-
|
|
876
|
-
|
|
900
|
+
The marketplace and the library (`MARKETPLACE_REGISTRY`, `UNIT_VERSIONS`,
|
|
901
|
+
`UNIT_COMPAT`, `UNIT_PINNING`, `EXTENSIONS_TRANSFORMS`, `EXTENSIONS_CHECK`,
|
|
902
|
+
`EXTENSIONS_ADAPTERS`, `ENGINE_UNITS`, `ENGINE_PREREQUISITES`, `AGENT_UNITS`,
|
|
903
|
+
`VOICE_UNITS`) are specified in [`PLATFORM.md`](PLATFORM.md), shipped beside
|
|
904
|
+
this file: registering a catalog, and installing, pinning, checking and running
|
|
905
|
+
a unit. A deck author rarely needs them.
|
|
906
|
+
|
|
907
|
+
## DESIGN_SYSTEMS · Design systems: tokens, art and slide templates, by reference
|
|
908
|
+
|
|
909
|
+
A **design system** is what a company publishes once so that every deck built on it inherits what a theme cannot carry: tokens beyond the 56-token theme contract, background art, and **slide templates** with named slots, and receives updates by reference, the way a marked theme does (`THEME_DISTRIBUTION`). It is a marketplace unit of its own (`type: "design-system"`), and decklight never learns any particular design system's name.
|
|
910
|
+
|
|
911
|
+
**Why it is not a theme.** A theme is one CSS file answering a fixed contract, so any deck can wear any theme; switching it is the point. A design system sits **beside** whichever theme is on screen: its stylesheet is always on, its tokens are prefixed so they never collide with the contract, and it may set a contract token only with a declared, printed exception. It also carries structure, templates, which a theme never does.
|
|
912
|
+
|
|
913
|
+
**The package** is a directory:
|
|
914
|
+
|
|
915
|
+
```
|
|
916
|
+
<name>/
|
|
917
|
+
design-system.json required: apiVersion, name ([a-z][a-z0-9-]*), version (semver),
|
|
918
|
+
title, styles ("design-system.css"), templates ("templates.html")
|
|
919
|
+
optional: description, tokenPrefix (default "--<name>-"),
|
|
920
|
+
palette: [{ group, label, token }] or a palette of scales,
|
|
921
|
+
{ colors: { <name>: { label, weights } } }, and themes: [{ name,
|
|
922
|
+
title, mode, tokens }] drawn from it (apiVersion 2, BRAND_PALETTE),
|
|
923
|
+
recommendedThemes: ["…"] (advice only)
|
|
924
|
+
design-system.css always-on styles: prefixed tokens, component and per-template rules;
|
|
925
|
+
url()s resolve relative to this file (url(assets/…))
|
|
926
|
+
templates.html inert <template data-template="…"> blocks, one per template
|
|
927
|
+
assets/… svg · png · jpg · jpeg · webp · woff2 · woff
|
|
877
928
|
```
|
|
878
929
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
`
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
`
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
(`EXTENSIONS#ADAPTEREXEC`) still owes the same question on that surface.
|
|
907
|
-
|
|
908
|
-
### UNIT_PINNING — Code-carrying units install pinned, or not at all
|
|
909
|
-
|
|
910
|
-
A `transform` or `importer` entry carries the SHA-256 of its module file's
|
|
911
|
-
bytes — lowercase hex, exactly as `sha256sum` prints it:
|
|
930
|
+
**`recommendedThemes`** names the themes a design system was drawn for: the page, type and colours are a theme's (the check's `paints-the-page` rule), so this is how a design system says which theme gives its intended look; a marketplace typically ships that theme beside it. It is advice, never applied: the meta block carries it, and the theme picker (**T**) lists the recommended themes the deck can apply right now as a first pack, **★ Recommended** (the caption says whose), first in the flattened list too, and tags them ★ wherever they appear. A name the deck cannot apply (not shipped, not marked, not offered while authoring) is left out; `name@marketplace` is read by its name. No design system, or none that recommends, and the picker is as before.
|
|
931
|
+
|
|
932
|
+
**`recommendedFonts`** does the same for type: font package names (`name` or `name@marketplace`) or font-picker stacks (`humanist`), listed first in **Font…** under **★ recommended by <title>**, only those the deck can apply (`FONTS`).
|
|
933
|
+
|
|
934
|
+
**A design system brings its dependencies; it offers its look** (#642). Adding one (`design-system add`, or toggling it on in **Design systems…**) also marks every theme it recommends (as `theme add` would) and references every font package it recommends (as `font add` would), **in the same edit** as the design system and their shared `themeSources`: one write, one undo entry while authoring, each in `installed.json` as a separate add would record it. A recommended picker stack (`humanist`) is never referenced, only applied. **`--no-recommended`** (⇧ while toggling) adds the design system alone and lists what it would have brought, with the commands. A recommendation resolves as written when it is `name@marketplace`; a bare name is a **shipped** theme of that name, else that name in the design system's **own** marketplace, else the one registered catalog that has it: two or more is refused, naming the qualified forms; nothing is fetched. Each goes through its own gate (`stillValid` for a theme, `font gate` for a font), and one that is missing, ambiguous or failing is a **⚠ warning, never a failure**: the design system and the rest still come, exit 0, with its reason and the command that would add it: a missing font must not cost the templates. Already there is said, not written twice, and still **recorded** in `installed.json` at the catalog's version now, as re-running `theme add` / `font add` would: the deck is not touched, and its line says so when the record changed (`= theme nord@acme — already there, recorded 3.0.0`). That holds for `design-system apply` and the author routes too, even when the deck already wears the look, so `marketplace list` never calls a dependency the deck renders out of date. One the deck has from **another** marketplace's entry of that name is not recorded, and `--no-recommended` (⇧) records none.
|
|
935
|
+
|
|
936
|
+
Applying is **offered, never automatic**: the page and the type are the author's (`paints-the-page`). The look is the first recommended theme the deck can apply and the first recommended font (a package or a stack); when either differs from the deck's `theme` / `font`, a terminal is asked (*"Apply Acme Brand's look — theme nord, font Decklight Sample? [Y/n]"*, naming only what would change), anything else is told the suggestion and `--apply`; **`--apply`** / **`--no-apply`** decide up front, `--no-recommended` implies `--no-apply`. **`decklight design-system apply <ref> <deck>`** gives the look later (bringing any dependency that is missing), idempotently. While authoring, the offer survives the reload the add causes (sessionStorage) and comes back as one dialog (*"apply Acme Brand's look?"*) with the slide previewing the theme and the font live behind it: **⏎ Apply** (`POST /deck/edit/design-system/apply { ref }`, its own undo entry, so the undo chord restores the previous look and keeps the design system; the viewer's own pick follows), **Esc keeps** the current look. **Use slide template…** on a deck whose design system's look was declined opens with one line, *"Not in Acme Brand's look — apply?"*, which offers it again. `POST /deck/edit/design-system/mark { ref, used, recommended?, apply? }` answers what came (`pulled`) and the look (`look`). **Removing** a design system never removes the themes and fonts it brought (another slide or design system may use them) and never changes the deck's `theme` or `font`; it lists the ones still there, with their `remove` commands.
|
|
937
|
+
|
|
938
|
+
**A new deck can start on one** (#812). On a terminal, when a cached catalog of a registered marketplace lists a design system this machine can resolve, `decklight init` asks right after the title, on the same readline as its other questions: one row per design system (title, `name@marketplace`, version, its description dim beneath), then *none: decklight's own themes*. With exactly one it is the default and Enter takes it; with several there is no default, and Enter or an answer naming no row asks again; EOF picks none. The catalogs are read **from the cache only**, the way `design-system list` reads them: nothing is fetched, and a marketplace registered but not fetched, or whose cached catalog no longer reads, is a dim line under the question naming its `decklight marketplace update <name>`. The answer is wired in **before init's one write**, as exactly what `design-system add <ref> <deck> --apply` writes: the gate first, then the reference and its `themeSources` entry, the themes and fonts it recommends, and its look (its own first theme, BRAND_PALETTE, else the first recommended theme the deck can apply, and the first recommended font); the ledger records it as `add` does. The **title slide** is the design system's first template with a slot hinted for a heading (`data-slot-hint` naming `h1` to `h6`), the deck's title in that slot and every other required slot filled by its hint, as **Use slide template… → insert** fills one; with no such template, and always for the second slide (the `data-build` one), the starter is today's. **`--design-system <ref>`** chooses without asking (a bare name or `name@marketplace`, resolved as `design-system add` resolves one; a reference no cached catalog has fails before anything is written, listing what the catalogs offer), **`--no-design-system`** asks nothing, and the two together are refused. `--inline` skips the question and refuses `--design-system`: a file opened from disk has no server to link a design system by reference, and `bundle` is the hand-over that embeds one. Off a terminal nothing is asked: the deck is plain, and one line names what is on offer and `--design-system`. A package that fails its gate, or any error on this path after the question, costs a note naming why and the `design-system add` command that retries, and a plain deck: never the scaffold. With nothing on offer there is no question and no new output; the bare `decklight` offer to start a deck reaches the same question, since it runs `init`.
|
|
939
|
+
|
|
940
|
+
**`data-ds-bleed`** on a template's **top-level** element (at most one per template) marks it as the slide's art: its background (colour, image, size, position, repeat) is painted on the screen-sized bleed layer instead of inside the stage (`DECK_ANATOMY` Bleed), so a 16:9 slide's art reaches the edges of a 16:10 or 4:3 screen while the slots stay on the stage. Its own size and position are resolved against the viewport: a `100% 100%` background stretches to the screen's height. `design-system gate` refuses it anywhere else (`bleed-placement`) or twice in a template (`bleed-twice`).
|
|
941
|
+
|
|
942
|
+
A template carries **structure only**: containers marked `data-slot="<name>"` (children are the default content), `data-slot-hint` (what an author is expected to put there, e.g. `h1,h2`), `data-slot-required`, and at most one `data-slot-default` (where unslotted content lands). Backgrounds and per-template tokens live in the CSS, keyed on the slide's namespaced template (`.decklight section[data-template="acme/section-divider"] { background-image: url(assets/divider.svg) }`), so every `url()` resolves inside the package.
|
|
943
|
+
|
|
944
|
+
**`DESIGN_SYSTEM_API_VERSION`** (2: a palette of scales and the themes drawn from it, BRAND_PALETTE) is the format's own counter, additive only, the doctrine `UNIT_COMPAT` sets for `TRANSFORM_API_VERSION`: bumped only when the format would break an existing package. A package's `apiVersion` above it is refused ("needs a newer decklight"). The package's semver `version` is a different fact (`UNIT_VERSIONS`).
|
|
945
|
+
|
|
946
|
+
**`decklight design-system gate <dir>`** is the admission gate a catalog's CI runs, in the mould of `library gate transform` (`EXTENSIONS_CHECK`): ✔ and a summary (tokens, templates and their slots, assets) and exit 0, or ✘ naming the file, the line and the rule for every problem and exit 1, never a stack. The rules, all in `tools/design-system-format.mjs` (pure over texts, so the serving path and the engine run the same ones):
|
|
947
|
+
|
|
948
|
+
- **the manifest**: valid JSON; the fields and shapes above; `apiVersion` not above this decklight's; `styles` and `templates` present and inside the package (no scheme, not absolute, no `..`);
|
|
949
|
+
- **the CSS**: no `@import`; no `url()` that names a scheme (`https:`, `data:`, any), is absolute or contains `..`; every relative `url()` a file in the package (a `#fragment` is fine); every custom property **declared** (not merely read through `var()`) starts with the `tokenPrefix`; a **theme-contract token** (`THEMING`) is set only with a `/* ds-exception: --token reason */` comment, the `rule-exception:` idiom, and every declared exception is printed on every run so it stays reviewable;
|
|
950
|
+
- **the templates**: everything inside `<template data-template>` blocks; no `script`, `style`, `iframe`, `object`, `embed`, `foreignObject`, `link`, `meta`, `base`, `frame`; no `on*` attribute, no `srcdoc`, no `javascript:` URL (entities decoded first); no `src`/`href`/`srcset`/`poster` reference other than a `#fragment`: art lives in the CSS; template ids and slot names `[a-z][a-z0-9-]*`, template ids unique, a slot name once per template, at most one `data-slot-default`;
|
|
951
|
+
- **SVG assets**: no `<script>`, no `<foreignObject>`, no `on*` attribute, no `href`/`xlink:href` other than a `#fragment`;
|
|
952
|
+
- **the palette**: a list palette's every `token` is defined in the CSS; a palette of scales and its themes are held to BRAND_PALETTE's rules;
|
|
953
|
+
- **the page is the theme's** (⚠ warning, `paints-the-page`): a rule whose subject is the slide itself (`section…`, `.decklight`, `.decklight-stage`) setting its **background colour**, **text `color`** or **type** (`font`, `font-family`) to anything but the theme's own tokens. A design system that does decides every theme's look on its slides (`T` stops changing them, and the chrome on top keeps the theme's), which is exactly what a theme-contract token without a `ds-exception` would do by the other door. Not refused, because a brand page may be the point; said, with the way out: use the theme's tokens, or ship a **theme** beside the design system and name it in `recommendedThemes`, so the page and the chrome are one theme's. A background **image** alone is art, the design system's to bring, and is not counted;
|
|
954
|
+
- **assets**: svg/png/jpg/jpeg/webp/woff2/woff only (a top-level README/LICENSE/CHANGELOG/NOTICE and dotfiles are not assets); over **2 MB** is a ⚠ warning, not a refusal; a symlink resolving outside the package is refused.
|
|
955
|
+
|
|
956
|
+
**A deck references a design system, never copies it.** The configuration block records which ones it uses, beside `markedThemes`:
|
|
912
957
|
|
|
913
958
|
```json
|
|
914
|
-
|
|
915
|
-
|
|
959
|
+
"designSystems": ["acme@acme-mkt"],
|
|
960
|
+
"themeSources": { "acme-mkt": "acme/decklight-marketplace" }
|
|
916
961
|
```
|
|
917
962
|
|
|
918
|
-
**
|
|
919
|
-
marketplace's checkout, cloned at whatever the default branch pointed to when
|
|
920
|
-
`add`/`update` ran (`resolveSource`; no branch name is guessed at) — so the
|
|
921
|
-
bytes an install writes are whatever the file said at that moment, not
|
|
922
|
-
whatever it said when the marketplace admitted the entry (`EXTENSIONS_CHECK`).
|
|
923
|
-
Cloning closed the narrower gap of manifest and artifact disagreeing with each
|
|
924
|
-
other; it cannot close this one, which is between the admission and the
|
|
925
|
-
install. For a theme that gap is closed by `theme add` re-running
|
|
926
|
-
the entire THEMING contract at install; for Node code the loader runs
|
|
927
|
-
unsandboxed at author privilege (`EXTENSIONS_TRANSFORMS`,
|
|
928
|
-
`EXTENSIONS_ADAPTERS`) there is no equivalent re-check — the digest is what
|
|
929
|
-
makes the code that installs the code that was screened.
|
|
930
|
-
|
|
931
|
-
**A content digest, not a commit SHA.** A commit pin only reaches sources a
|
|
932
|
-
host can serve by commit, and verifying it means trusting that host; a digest
|
|
933
|
-
of the bytes holds identically for a raw URL, a git URL and a local
|
|
934
|
-
directory, and holds against the math rather than the server. `decklight
|
|
935
|
-
extension check` prints the digest on a pass, so the gate that admits a
|
|
936
|
-
submission also emits the pin its catalog entry carries; `sha256sum
|
|
937
|
-
<file>` produces the same value.
|
|
938
|
-
|
|
939
|
-
**Enforced at install, with two named refusals** (`cli/units.mjs`).
|
|
940
|
-
`decklight transform add` / `importer add` refuse a pinned kind's entry that
|
|
941
|
-
carries no `sha256` — *before* anything is fetched, since without a pin there
|
|
942
|
-
is no fact to hold the fetched bytes to — and refuse a fetched module whose
|
|
943
|
-
digest does not match, *before* anything is written, naming both digests. A
|
|
944
|
-
mismatch means the file changed since the catalog was cached: possibly a
|
|
945
|
-
legitimate re-pin (`marketplace update <name>` and try again), possibly the
|
|
946
|
-
exact substitution the pin exists to stop — either way nothing lands in the
|
|
947
|
-
library, the same fetch-first-write-second rule every other refusal there
|
|
948
|
-
keeps.
|
|
949
|
-
|
|
950
|
-
**Validated for shape when present, required only at install.** The same
|
|
951
|
-
split `apiVersion` already made (`UNIT_COMPAT`): a *malformed* `sha256` fails
|
|
952
|
-
`marketplace add` naming the line and the field, but an *absent* one does not
|
|
953
|
-
invalidate the manifest — refusing a whole catalog over one unpinned
|
|
954
|
-
transform would cost its theme entries too, the blast-radius reasoning that
|
|
955
|
-
already leaves an unknown `type` accepted. The refusal lands at the one
|
|
956
|
-
moment the risk does: installing the executable entry.
|
|
957
|
-
|
|
958
|
-
**What is deliberately not pinned.** Data kinds (themes, templates, skills)
|
|
959
|
-
install unpinned — nothing in them executes, and a theme re-passes its whole
|
|
960
|
-
contract at install. A unit placed in the library by hand still runs
|
|
961
|
-
(`EXTENSIONS#LOADER`'s decision, unchanged): the pin governs what an
|
|
962
|
-
*install* may write into the library, and the trust model for *running* what
|
|
963
|
-
is there stays `EXTENSIONS_TRANSFORMS`'s — the installer is the risk-bearer.
|
|
964
|
-
|
|
965
|
-
### EXTENSIONS_TRANSFORMS — Build-time transforms: the v1 contract
|
|
966
|
-
|
|
967
|
-
A transform is a single file, `transform.mjs`, exporting one function:
|
|
963
|
+
`themeSources` is **shared**, keyed by marketplace: a design system from a marketplace the deck already marks a theme from records nothing new, and a source goes only with the last mark of **either** kind (`setMarked` and `setDesignSystem` both count both). Entries are parsed with the same `name@marketplace` shape; anything else is dropped, not guessed at; two design systems of the same name from different catalogs are refused, since a slide names one by its name. `decklight design-system add <name@marketplace> <deck.html>` runs the package through `check` first (a package that fails leaves the deck byte-for-byte unchanged and prints why), then writes the reference and its source as one edit, and records `design-system:<name>@<marketplace>` with its version and the marketplace commit in `installed.json` (`UNIT_VERSIONS`); `remove` drops the reference (and the source with the last mark); the package stays in its marketplace. `list [<deck>]` says what a deck uses (version taken against the catalog's) or, with no deck, what every registered marketplace offers, cache-only, naming the ones it could not read; `templates <ref>` lists a package's templates and their slots: the names a slide writes.
|
|
968
964
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
965
|
+
**Resolution** (`cli/design-system-refs.mjs` `resolveDesignSystemRef`) is the theme resolver's twin, on the catalog half they now share (`resolveCatalogEntry`, `cli/theme-refs.mjs`): the recorded source decides which registered catalog a reference means, a marketplace that only shares the name is refused by name, and nothing on the path fetches. A design system resolves to its package **directory** in the checkout; an entry whose `apiVersion` is above this decklight's resolves as missing ("needs a newer decklight") while the catalog still registers (`UNIT_COMPAT`: shape, not currency); an entry naming a URL resolves as missing: a package is a directory, and the one fetching exception themes have (`theme-cache/`) holds single files.
|
|
966
|
+
|
|
967
|
+
**Every server serves it.** `linkDesignSystems` runs wherever `linkAddedThemes` does (the edit server, `--no-trust`, and `serveForRender` behind `shot`/`pdf`/`pptx`/`video`) and injects, after the theme links and before `</head>`, per reference: an **always-on** `<link rel="stylesheet" href="decklight-design-system/<marketplace>/<name>/design-system.css" data-design-system="<name>">` (no `media="not all"`: a design system is not an alternative to choose between, so `T` leaves it applied under any theme); `<script type="application/json" data-design-system-meta="<name>">{ name, version, title, palette, templates: [{ id, title, slots }] }</script>` (every `<` escaped: the manifest is somebody else's file); and `<template data-design-system-templates="<name>">…templates.html…</template>`, inline, so expansion is synchronous and identical for a served deck and a bundled one. Nothing is injected when the page already carries the design system (a bundle's `<style data-design-system>`, or a link it already got). A reference this machine cannot resolve, or a package that **no longer passes `check`**, since `marketplace update` can change its bytes after `add` (re-checked wherever it is used, remembered by a stat signature), becomes `<meta name="decklight-design-system-missing" content="<ref> — <why>">` and a log line, never a silently short page or an unchecked template.
|
|
968
|
+
|
|
969
|
+
**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
|
+
|
|
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, a marketplace not fetched yet said plainly and one whose cached catalog no longer reads as a warning, each with its `marketplace update`), and **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.
|
|
972
|
+
|
|
973
|
+
**`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
|
+
|
|
975
|
+
**A hand-over carries the bytes.** `bundle` embeds every design system the deck references (merged: every module's, once per name and version; one name at two versions is refused, naming both modules), the way it embeds marked themes (THEME_DISTRIBUTION), from this machine's checkouts and never the network: the stylesheet as `<style data-design-system="<name>" data-design-system-version="…">` at the end of `<head>` (after the themes, the cascade the servers give it), **byte for byte** except that every relative `url()` (resolved against the stylesheet, quoted or not) becomes a `data:` URI (SVG as percent-encoded UTF-8, the rest base64; no size cap, as for images), so a font's licence header travels with its face; `data:` and `#fragment` urls are left, an outside one is left with a notice that it will not show offline; and the meta `<script>` and templates `<template>` exactly as the servers inject them, before the runtime's script (classic scripts run mid-parse). The file then expands its templates from `file://`, offline, on a machine that never registered the marketplace. And a server that serves it again links no second copy. A design system this machine cannot resolve **fails** the bundle with the reason and the command that brings it; `--allow-missing-design-systems` bundles anyway, leaving it out with a note, and its slides render plainly. A package that is here but **broken** (it no longer passes `check`, a `url()` naming a file it does not have) fails whatever the flag: half a design system is worse than none. The summary says what went in: `designs acme 1.2.0 (from acme-mkt) — stylesheet, 2 assets (0.3 KB), 2 templates`.
|
|
976
|
+
|
|
977
|
+
**A slide uses a template by naming it** (the existing `data-template`, reused): a value with a `/` is `<design system>/<template>`; the built-in ring (`auto`, `centered`, `pinned`, `top`, `split`, `split-flip`) has no slash, so the two can never collide. The slide carries only content, one element per named slot:
|
|
978
|
+
|
|
979
|
+
```html
|
|
980
|
+
<section data-template="acme/section-divider">
|
|
981
|
+
<p data-slot="kicker">Module 01</p>
|
|
982
|
+
<h2 data-slot="title">Flink on Confluent Cloud</h2>
|
|
983
|
+
<p data-slot="subtitle">Managed runtime doesn't manage correctness.</p>
|
|
984
|
+
<aside class="notes">…</aside>
|
|
985
|
+
</section>
|
|
973
986
|
```
|
|
974
987
|
|
|
975
|
-
-
|
|
976
|
-
*before* `bundle` inlines themes, images, casts or narration. A transform
|
|
977
|
-
compiling `<pre class="mermaid">…</pre>` into inline SVG needs the markup
|
|
978
|
-
the author wrote, not decklight's own runtime already spliced in; running
|
|
979
|
-
before that inlining also keeps a transform's test fixture small — a
|
|
980
|
-
two-line HTML snippet, not a full bundled deck — and keeps decklight's own
|
|
981
|
-
inlining regexes untouched by whatever a transform's output contains.
|
|
982
|
-
- **`opts` is reserved and empty in v1.** Nothing populates it yet. A later
|
|
983
|
-
version MAY add a field (deck title, target theme, …), and doing so is an
|
|
984
|
-
*additive* change under `UNIT_COMPAT` — it does not bump
|
|
985
|
-
`TRANSFORM_API_VERSION`, because an existing transform that ignores an
|
|
986
|
-
unrecognised field keeps working exactly as it did before. Only a change
|
|
987
|
-
that would break an existing transform's assumptions bumps the version.
|
|
988
|
-
- **Loaded by dynamic `import()`, in the same process as `bundle`/`import` —
|
|
989
|
-
no subprocess, no VM sandbox.** This is not a gap: `MARKETPLACE.md
|
|
990
|
-
EXTENSIONS` already decided the trust model for build-time code — the
|
|
991
|
-
installer is the risk-bearer, the same defensible model Claude's own plugin
|
|
992
|
-
marketplace uses — so isolating a transform from the process that invoked
|
|
993
|
-
it would defend against a threat this design already accepted. Contrast
|
|
994
|
-
`PRESENT#PLUGINS`, which sandboxes because *that* code runs on a
|
|
995
|
-
presenter's machine at a stranger's request — a different actor, a
|
|
996
|
-
different risk.
|
|
997
|
-
- **The return value must be a string**, or a thrown/rejected value the
|
|
998
|
-
*loader* reports by naming the transform — a transform has no other
|
|
999
|
-
contract obligation. Turning a throw into a clean refusal rather than a raw
|
|
1000
|
-
stack trace is the loader's job (`EXTENSIONS#LOADER`, `cli/loader.mjs`,
|
|
1001
|
-
called from `bundle --transform <name>`), the same UX every other
|
|
1002
|
-
unit-installing surface in this codebase already gives.
|
|
1003
|
-
|
|
1004
|
-
This is the contract `apiVersion` (`UNIT_COMPAT`) names a version *of*.
|
|
1005
|
-
Freezing it here, ahead of the loader that will call it, is deliberate: the
|
|
1006
|
-
loader is comparatively mechanical once this is fixed, and fixing it after
|
|
1007
|
-
the loader existed would mean the first version number was never actually
|
|
1008
|
-
pinned to anything.
|
|
1009
|
-
|
|
1010
|
-
### EXTENSIONS_CHECK — The marketplace admission gate for build-time code
|
|
1011
|
-
|
|
1012
|
-
`decklight extension check <file> [--type transform]` (`--type transform` is
|
|
1013
|
-
both the default and, in v1, the only kind implemented) validates ONE
|
|
1014
|
-
transform source file and reports 0 or 1, the same shape `theme check`
|
|
1015
|
-
already gives. It is not part of `bundle`, `import` or `publish` — those run
|
|
1016
|
-
an already-*installed*, catalog-backed unit (`EXTENSIONS#LOADER`) and never
|
|
1017
|
-
re-check it. `extension check` instead runs against a bare FILE, because its
|
|
1018
|
-
job is admitting an entry to a marketplace catalog in the first place: a
|
|
1019
|
-
marketplace repo's own CI runs it on every PR that adds or updates a
|
|
1020
|
-
`transform` entry, and a failing check blocks that PR — which is what
|
|
1021
|
-
"failure blocks publish" means (MARKETPLACE.md `EXTENSIONS#CHECK`):
|
|
1022
|
-
publishing the *extension*, not `decklight publish`ing a deck.
|
|
1023
|
-
|
|
1024
|
-
Three phases, checking three different things:
|
|
1025
|
-
|
|
1026
|
-
- **Lint the source text — advisory, not a boundary.** Refused if the file
|
|
1027
|
-
contains `fetch(`, `eval(`, `XMLHttpRequest`, or a dynamic `import(`,
|
|
1028
|
-
anywhere — a shallow source-text scan, the same kind `PRESENT#PLUGINS`
|
|
1029
|
-
already runs on a presenter plugin's source. It catches the honest mistake
|
|
1030
|
-
and states the bar in a sentence, and that is ALL it does: a static
|
|
1031
|
-
`import { execSync } from 'node:child_process'`, a `new Function('return
|
|
1032
|
-
fetch')()`, a `globalThis['fet' + 'ch']` all pass a regex unmatched, and
|
|
1033
|
-
no source-text scan closes that class. What constrains the submission
|
|
1034
|
-
during the check is the process boundary below; what constrains it after
|
|
1035
|
-
admission is nothing — an installed transform runs as trusted, unsandboxed
|
|
1036
|
-
Node (`EXTENSIONS_TRANSFORMS`), because the trust model for build-time
|
|
1037
|
-
code is that the installer bears the risk (MARKETPLACE.md `EXTENSIONS`).
|
|
1038
|
-
Admission screens; it does not absolve.
|
|
1039
|
-
- **The submission only ever executes behind a process boundary.** The
|
|
1040
|
-
checker itself never `import()`s the checked file — a marketplace's CI
|
|
1041
|
-
would be executing a stranger's code at its own privilege *before*
|
|
1042
|
-
deciding whether to admit it. The transform runs in a SEPARATE Node
|
|
1043
|
-
process under the permission model (`--permission`, or
|
|
1044
|
-
`--experimental-permission` back to the `engines` floor of Node 20;
|
|
1045
|
-
a Node with neither is a named refusal, never a silent unsandboxed run):
|
|
1046
|
-
filesystem reads limited to decklight's own package and the submitted
|
|
1047
|
-
file's directory, no filesystem writes, no child processes, no workers, no
|
|
1048
|
-
native addons; a REPLACED environment (the fixture is the only variable
|
|
1049
|
-
that crosses, so a CI runner's secrets never enter the child); a temp
|
|
1050
|
-
working directory; and its own 15s wall-clock kill, because a transform
|
|
1051
|
-
that never returns must become a refusal, not a hang. Stated plainly,
|
|
1052
|
-
what the boundary does NOT cover: Node's permission model does not
|
|
1053
|
-
restrict the network, so a hostile submission can still phone home during
|
|
1054
|
-
the check — the boundary protects the checking machine's files, processes
|
|
1055
|
-
and environment, not its network egress.
|
|
1056
|
-
- **A headless load of the OUTPUT, not the source.** The transform is run
|
|
1057
|
-
against ONE small fixture this command owns — RANDOMISED per check, a
|
|
1058
|
-
fresh nonce in its title, heading and body, so a submission cannot
|
|
1059
|
-
recognise the fixture and behave only while being checked — never the
|
|
1060
|
-
submitter's own deck: proving the CONTRACT, not "does it handle some
|
|
1061
|
-
particular author's markup" (the same "a small fixture beats a full
|
|
1062
|
-
bundled deck" reasoning `EXTENSIONS_TRANSFORMS` already uses to justify
|
|
1063
|
-
testing against the pre-`bundle` source). The output is then rendered
|
|
1064
|
-
headlessly and refused if it contains a `<script>` block OR an inline
|
|
1065
|
-
event handler (an `on…=` attribute) — the second is exactly as executable
|
|
1066
|
-
as the first, just waiting for a click, and a `<script>`-only grep missed
|
|
1067
|
-
it entirely. Both refuse for the same reason: "build-time transforms
|
|
1068
|
-
produce output, not code; nothing executable travels" (MARKETPLACE.md
|
|
1069
|
-
`EXTENSIONS`, SUPERSEDED) is the one invariant this phase can actually
|
|
1070
|
-
prove a given transform honors, rather than merely being asked to.
|
|
1071
|
-
`apiVersion` currency plays no part here: that is `EXTENSIONS#LOADER`'s
|
|
1072
|
-
question at USE time, on an installed unit, not this command's question at
|
|
1073
|
-
ADMISSION time, on a bare file.
|
|
1074
|
-
|
|
1075
|
-
What this gate is, honestly: a screen, not a proof. Code that behaves during
|
|
1076
|
-
one check can behave differently once installed, and no admission-time
|
|
1077
|
-
analysis of Turing-complete code closes that gap — the randomised fixture
|
|
1078
|
-
and the scrubbed, temp-cwd child merely remove the cheap tells a submission
|
|
1079
|
-
could key on. The load-bearing decisions remain the catalog's digest pin
|
|
1080
|
-
(`UNIT_PINNING`) and the trust model (`EXTENSIONS`: the installer
|
|
1081
|
-
bears the risk); this command exists so that the obvious failures never
|
|
1082
|
-
reach either.
|
|
1083
|
-
|
|
1084
|
-
Needs a real browser to run the last phase — the same Chrome dependency
|
|
1085
|
-
`npm run verify`'s render harnesses already carry — and answers the same way
|
|
1086
|
-
they already do when Chrome is absent: a named refusal, never a silent pass.
|
|
1087
|
-
|
|
1088
|
-
**Both executions carry a hard wall-clock kill (15s each), and the headless
|
|
1089
|
-
load's is separate from `--virtual-time-budget`.** That flag bounds Chrome's
|
|
1090
|
-
own clock, not the real one: a synchronous `alert()`/`confirm()`/`prompt()`
|
|
1091
|
-
in the OUTPUT opens a native dialog that blocks the render loop outside
|
|
1092
|
-
virtual time entirely, and an infinite loop blocks it the same way —
|
|
1093
|
-
measured directly, not a theoretical concern. Every other transform failure
|
|
1094
|
-
this section refuses is a *string* found in an *output*; a hang is the one
|
|
1095
|
-
shape that would otherwise have no output to refuse, and this command's
|
|
1096
|
-
whole premise is running code nobody has vetted yet — so a submission that
|
|
1097
|
-
never returns, in its own run or in its output's load, has to become a
|
|
1098
|
-
refusal too, not an unbounded hang in whatever is running the check (a
|
|
1099
|
-
marketplace's own CI).
|
|
1100
|
-
|
|
1101
|
-
### EXTENSIONS_ADAPTERS — Import adapters: the v1 contract, and running one
|
|
1102
|
-
|
|
1103
|
-
An import adapter is a single file, `importer.mjs`, exporting one function —
|
|
1104
|
-
the same shape `EXTENSIONS_TRANSFORMS` gives a build-time transform, with the
|
|
1105
|
-
one difference its different input forces:
|
|
988
|
+
The engine **expands the slide in the DOM, never in the file** (`src/core/design-system.js` `setupSlideTemplates`, the **first** pass of `sync()`, so pins, splits, builds and the overflow guardrail all see the final DOM): it clones the template's template from the page's `data-design-system-templates` block, scrubs the clone once more (forbidden elements, `on*`, `srcdoc` and outside references removed: the markup was checked at admission and at serving; this is the copy that becomes live DOM, and a scrub that had anything to remove is logged), marks every node it brought `data-ds-injected`, and moves the slide's elements into it:
|
|
1106
989
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
990
|
+
- an element with `data-slot="X"` goes into the template's `[data-slot="X"]` container, replacing that container's default children; several elements naming the same slot all land there, in authored order; a slot nobody filled keeps the template's default content;
|
|
991
|
+
- an element with no `data-slot`, or one the template does not define, goes to the template's `[data-slot-default]` container, or, if it has none, into an injected `.ds-unslotted` box, which write mode outlines ("not in a slot");
|
|
992
|
+
- a `data-slot-required` slot left empty is marked on the section (`data-ds-required-empty`) and warned about;
|
|
993
|
+
- `aside.notes`, `aside.sources`, `aside.rehearse`, `script`, `style` and `.slide-bg` stay direct children of the section.
|
|
994
|
+
|
|
995
|
+
**A design system's stylesheet styles a slot box as `[data-ds-injected][data-slot="X"]`, never as a bare `[data-slot="X"]`.** After expansion the slide's own element sits inside the box carrying the same `data-slot="X"`, so a bare attribute selector matches both: a border, padding or size meant for the box lands on the author's heading too (a title rule drawn twice is the usual sign). `data-ds-injected` is on the template's nodes only, so it tells the box from what was put in it; `[data-ds-injected][data-slot="X"] > *` is the content of a slot.
|
|
996
|
+
|
|
997
|
+
The section gets `data-ds-expanded="<template>@<version>"`, and a later `sync()` leaves it alone unless the template, the design system's version or the slide's authored content changed: expanding twice yields identical DOM. Each authored element's index **in the file** is recorded before anything moves (`fileIndexOf`), because write-mode editing addresses elements by file index and expansion reorders the live DOM. **Builds** inside a slot step as anywhere else; their order follows the **template's** DOM order, which may differ from the order the slide was written in. A template's own markup is never itself expanded (one level). Pinned titles and the split template skip these slides (the design system owns the slide's geometry; an unknown slashed value no longer falls into the auto pin), and **the bar's ring does not cycle** one: it toasts why, since a ring pick would silently overwrite the reference. The overflow guardrail still runs. Print, `?print`, `pdf`, `pptx`, `video` and the speaker view show the expanded slide, because expansion precedes print-page construction.
|
|
998
|
+
|
|
999
|
+
**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
|
+
|
|
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`).
|
|
1002
|
+
|
|
1003
|
+
**`/` → 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
|
+
|
|
1005
|
+
- **put it in** the template (convert, from a plain slide): `data-template` is set; children that already carry a `data-slot` the template has keep it; the rest are assigned by the slots' `data-slot-hint`s in the template's slot order (the first `h2` → a slot hinted `h1,h2`, …); leftovers carry no slot and land in the default slot (or the unslotted box);
|
|
1006
|
+
- **switch** it (from another slide template): only the attribute changes: content stays by slot name, and slots the new template lacks are reported (that content shows in the unslotted box);
|
|
1007
|
+
- **insert** a new slide in the template after it: one element per **required** slot, by its hint, saying the slot's name; every other slot shows the template's defaults until filled;
|
|
1008
|
+
|
|
1009
|
+
and, when the current slide uses one, **take it out**: the attribute goes, `data-slot` attributes stay (harmless on a plain slide, and what a later convert reads). Each is one `POST /deck/edit/slide/template { slide, template | null, insert? }`, one undo entry, and a sentence saying what went where (`h2 → title (hint h1,h2) · ul → body (the default slot)`). The server reads the template from the package on disk (the deck's own design systems, through the same resolver and check every server uses), never from the page that asked; a template the deck's design system does not have, or a design system the deck does not use, is refused by name.
|
|
1010
|
+
|
|
1011
|
+
**Slot names are the design system's contract.** A slide addresses a template only by its template id and slot names, so renaming either is a breaking change for the design system's author; a version that keeps them re-lays-out every slide that uses the template on the next load, by design, with the deck file untouched.
|
|
1012
|
+
|
|
1013
|
+
**Plain markup takes the brand's look (base styles).** A slide on a design system says *what* each part is in plain markup, an `<h2>`, a `<p>`, a `<ul>`, a `<table>`, and the design system decides how it looks. So a design system may, and should, style the plain content elements inside a slide, `.decklight section :is(h1, h2, h3, p, ul, ol, li, table, blockquote, pre, code, a, figcaption)`: a slide without a template then wears the brand's title and bullets, and a deck whose design system is missing (`data-ds-missing`) still reads, in decklight's own styles, with nothing lost. These are content, not the page, so `paints-the-page` does not count them. The pattern is to style a component **once**, by its class, with the plain element as a second selector:
|
|
1014
|
+
|
|
1015
|
+
```css
|
|
1016
|
+
.decklight .cf-title,
|
|
1017
|
+
.decklight section:not([data-template]) > h2 { … }
|
|
1111
1018
|
```
|
|
1112
1019
|
|
|
1113
|
-
-
|
|
1114
|
-
import.mjs` before the adapter ever runs) — never a path, so an adapter's
|
|
1115
|
-
contract needs no filesystem access of its own and stays as pure as a
|
|
1116
|
-
transform's `html in, html out`. What the built-in importer calls "a
|
|
1117
|
-
CONTENT importer, not a pixel renderer" (`DECK_IMPORT`) applies here too:
|
|
1118
|
-
the adapter owns turning its format into markup, and decklight themes it
|
|
1119
|
-
same as anything else.
|
|
1120
|
-
- **The return value is the deck's section markup — one HTML string**, not
|
|
1121
|
-
the `{ sections, report }` pair `cli/import.mjs`'s own PowerPoint path uses
|
|
1122
|
-
internally. Requiring a third-party adapter to reproduce that pair would
|
|
1123
|
-
leak an implementation detail of one specific importer into a contract
|
|
1124
|
-
every future adapter has to match; a single string is the same minimal
|
|
1125
|
-
surface `EXTENSIONS_TRANSFORMS` chose for the same reason. Per-slide drop
|
|
1126
|
-
reporting (`DECK_IMPORT`'s "every drop is reported with its slide number")
|
|
1127
|
-
is therefore not part of the v1 adapter contract — an adapter that wants it
|
|
1128
|
-
is free to `console.error` its own, since it runs at the same trust level
|
|
1129
|
-
as anything else in `EXTENSIONS`.
|
|
1130
|
-
- **`opts` is reserved and empty in v1**, for the identical reason
|
|
1131
|
-
`EXTENSIONS_TRANSFORMS`'s is: a later version may add a field, and doing so
|
|
1132
|
-
is *additive* under `UNIT_COMPAT` rather than a version bump, because an
|
|
1133
|
-
adapter that ignores an unrecognised field keeps working exactly as before.
|
|
1134
|
-
- **Loaded by dynamic `import()`, in the same process as `decklight import` —
|
|
1135
|
-
no subprocess, no VM sandbox.** Identical reasoning to
|
|
1136
|
-
`EXTENSIONS_TRANSFORMS`: an import adapter is Node code at author
|
|
1137
|
-
privilege, the trust model `MARKETPLACE.md EXTENSIONS` already settled
|
|
1138
|
-
(the installer is the risk-bearer), and isolating it from the process that
|
|
1139
|
-
invoked it would defend against a threat this design already accepted.
|
|
1140
|
-
- **An independent `apiVersion`, `IMPORTER_API_VERSION` — not
|
|
1141
|
-
`TRANSFORM_API_VERSION`.** The two are different calling conventions
|
|
1142
|
-
(`html, opts → html` versus `bytes, opts → html`) that will each change on
|
|
1143
|
-
their own schedule; sharing one counter would bump every installed
|
|
1144
|
-
transform's compatibility number the day the *importer* contract grew a
|
|
1145
|
-
field it never asked for. Both move the same way `UNIT_COMPAT` already
|
|
1146
|
-
established — additive-only, bumped only when that ONE contract would
|
|
1147
|
-
break an existing unit — they just count separately.
|
|
1148
|
-
- **The return value must be a string**, or a thrown/rejected value the
|
|
1149
|
-
loader reports by naming the adapter — the same clean, never-a-raw-stack
|
|
1150
|
-
collapse `EXTENSIONS#LOADER` already gives a transform's failures
|
|
1151
|
-
(`cli/loader.mjs`'s `runImporterAt`, called from `cli/import.mjs` once
|
|
1152
|
-
`sourceKind` finds no built-in reader for the file but a cached catalog
|
|
1153
|
-
entry names an installed adapter for its extension).
|
|
1154
|
-
|
|
1155
|
-
`import` still says exactly what it always said when no adapter is known, or
|
|
1156
|
-
when one is known but not installed (`decklight importer add <name>`); only
|
|
1157
|
-
an INSTALLED adapter's extension now actually runs, rather than reporting
|
|
1158
|
-
that it does not yet (`EXTENSIONS#ADAPTEREXEC`, MARKETPLACE.md).
|
|
1159
|
-
|
|
1160
|
-
### ENGINE_UNITS — Speech engines: the v1 contract, and installing one
|
|
1161
|
-
|
|
1162
|
-
Six engines ship in core (`PRESENTING`: gemini, chirp, piper, elevenlabs, say,
|
|
1163
|
-
sapi) and are **not units** — they need no marketplace, no library and no
|
|
1164
|
-
catalog, so a machine with nothing registered reaches its own voice exactly as
|
|
1165
|
-
it always did. A seventh is whatever you installed. An engine unit is a single
|
|
1166
|
-
file, `engine.mjs`, exporting a **factory** rather than the `(input, opts) →
|
|
1167
|
-
string` pass the other two code-carrying kinds export:
|
|
1020
|
+
Precedence falls out of specificity: a template's component rule (`.decklight .cf-title`) wins over a base style (`.decklight section h2`), which wins over decklight's own defaults (`.decklight h2`). Authors name a design system's classes only for a component with no plain equivalent (a tile) or a variant the component defines. A design system's README says which plain elements it styles, and `design-system gate` prints them (`base styles h2, ul, li`). `decklight check` gives a **hint** (`·`, never ⚠), once per slide, where a component class sits on an element that plain markup would already give it, for example `<div class="cf-title">` when the base styles give `.cf-title` to a plain `<h2>` (`ds-plain-markup`): *a plain `<h2>` (or a template's title slot) gets this component from the design system*. A class the base styles give to no plain element, a tile, is never hinted at.
|
|
1168
1021
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1022
|
+
**Conventional slot names.** Switching a slide to another template keeps its content by slot name, so the names should mean the same thing in every design system. A design system uses these where its part is that part, each with its usual hint, and its own name only for a part with no conventional one:
|
|
1023
|
+
|
|
1024
|
+
| slot | hint | | slot | hint |
|
|
1025
|
+
|---|---|---|---|---|
|
|
1026
|
+
| `eyebrow` | `p` | | `diagram` | `div,svg,img` |
|
|
1027
|
+
| `title` | `h1,h2` | | `table` | `table` |
|
|
1028
|
+
| `subtitle` | `p` | | `quote` | `blockquote,p` |
|
|
1029
|
+
| `number` | `p` | | `code` | `pre` |
|
|
1030
|
+
| `points` | `ul,ol` | | `image` | `img,figure` |
|
|
1031
|
+
| `body` | `p,div` | | `caption` | `p,figcaption` |
|
|
1032
|
+
|
|
1033
|
+
A switch between two design systems that both use them loses nothing, and the sentence it prints says so (*…content stays by slot name, nothing left over*). `design-system gate` notes a near miss with `·`, never ✘: a slot whose hint names only one part's tags but whose name is not that part's (`heading` hinted `h1,h2`: *the conventional name for this part is "title"*, `slot-name-conventional`). A hint a paragraph could fill (`p`) names no one part, so it is never noted.
|
|
1034
|
+
|
|
1035
|
+
**In a catalog** a design-system entry carries a required positive-integer `apiVersion` (shape only, like a transform's) and a `source` that is a **directory in the marketplace's own repo**: a URL, an absolute path or one with `..` is refused with why (v1 has no https source: the theme cache holds single files, a package is many). `marketplace list` groups the kind like any other. Nothing is ever installed into `~/.decklight/` (`cli/units.mjs` `UNIT_TYPES` has no row): a deck references a package in place, from the checkout; the kind's hint is `decklight design-system add <name@marketplace> <deck>`.
|
|
1036
|
+
|
|
1037
|
+
### BRAND_PALETTE · A design system's palette, and the themes drawn from it
|
|
1038
|
+
|
|
1039
|
+
**The palette is the brand; a theme is one way of wearing it.** A design system's `palette` used to be a side list of swatches, and its `recommendedThemes` somebody's theme files, advice only, with nothing saying the two agreed: a recommended theme could paint the page in a colour the brand never approved. A design system with a **palette of scales** turns that round. The palette belongs to the design system, and the design system **ships its own themes**, each of which uses **only colours from that palette**. A brand can have a dark theme and a light one (or a high-contrast one for a projector) and every one of them is on brand by construction, because an off-palette colour cannot be written down at all. A package that uses this is `apiVersion` 2 (`DESIGN_SYSTEM_API_VERSION`); the older list palette reads as before.
|
|
1040
|
+
|
|
1041
|
+
**The palette is a set of scales.** A company palette is a dozen or so named colours, each in weights from 100 to 1000, and that is the shape the manifest takes:
|
|
1042
|
+
|
|
1043
|
+
```json
|
|
1044
|
+
"palette": {
|
|
1045
|
+
"colors": {
|
|
1046
|
+
"blue": { "label": "Blue", "weights": { "100": "#e7efff", "200": "#c6d8ff", "…": "…", "1000": "#020b2b" } },
|
|
1047
|
+
"slate": { "label": "Slate", "weights": { "100": "#f4f6f9", "…": "…", "1000": "#0b0e14" }, "role": "neutral" }
|
|
1048
|
+
}
|
|
1176
1049
|
}
|
|
1177
1050
|
```
|
|
1178
1051
|
|
|
1179
|
-
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
- **
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
only, bumped only when the factory or `synth` convention itself would break
|
|
1191
|
-
an installed engine — never for a reorganisation of `tools/tts-engines.mjs`,
|
|
1192
|
-
whose six built-ins this number does not version.
|
|
1193
|
-
- **`capability` says which affordance it answers for** (`tts` today).
|
|
1194
|
-
Validated for *shape* in the catalog and checked against what this decklight
|
|
1195
|
-
runs only at LOAD time — a catalog declaring an engine for a capability this
|
|
1196
|
-
version cannot run must stay addable, so the refusal names the one engine
|
|
1197
|
-
rather than invalidating the catalog it arrived in and taking its themes
|
|
1198
|
-
down with it. Same reasoning an unknown `type` already gets
|
|
1199
|
-
(`MARKETPLACE_REGISTRY`).
|
|
1200
|
-
- **The returned object is checked once, at load, not at the first sentence.**
|
|
1201
|
-
A missing `synth`, a factory that is not a function, one that throws while
|
|
1202
|
-
starting, one whose roster is neither a `voices` array nor a `listVoices()`
|
|
1203
|
-
— each is a `LoaderError` naming the engine, never a raw stack, and never a
|
|
1204
|
-
crash mid-talk. `stylable` defaults to **false** when an engine does not say:
|
|
1205
|
-
a plugin with no delivery-instruction channel that forgets to declare one
|
|
1206
|
-
must not have the tone step offered for it, which is the same silent lie
|
|
1207
|
-
`PRESENTING` refuses when it skips that step for chirp and piper.
|
|
1208
|
-
- **Loaded by dynamic `import()`, in the same process as the bridge** — no
|
|
1209
|
-
subprocess, no VM sandbox, identical reasoning to `EXTENSIONS_TRANSFORMS`.
|
|
1210
|
-
- **Author-time only.** Installing and configuring both happen through the
|
|
1211
|
-
author server; `present` registers nothing that could reach either, and a
|
|
1212
|
-
credential still comes from the wizard (`ENGINES#WIZARD`) and is still
|
|
1213
|
-
stored restricted to the account that pasted it — the platform's own form of
|
|
1214
|
-
that, named in `ENGINES#WIZARD` — never into a deck.
|
|
1215
|
-
### ENGINE_PREREQUISITES — What an engine needs before a key is worth asking for
|
|
1216
|
-
|
|
1217
|
-
TTS made two failure states look like enough — "could not reach it" and "that
|
|
1218
|
-
key was refused" — because a credential is the only thing a TTS provider ever
|
|
1219
|
-
needs. Lipsync is the case that proves otherwise (`ENGINES#LIPSYNC`): rhubarb
|
|
1220
|
-
is a **binary**, Wav2Lip is a **python checkout plus model weights**, and only
|
|
1221
|
-
Veo is the paste-a-key shape. So a wizard schema may declare what it needs
|
|
1222
|
-
from the machine, beside what it needs from the person:
|
|
1052
|
+
- A colour's key is its **name** (`[a-z][a-z0-9-]*`), its `label` what a person reads. A weight is a multiple of 100 from 100 to 1000, its value a hex colour. The two together name one swatch, **`blue-700`**, and that name is how a theme refers to it.
|
|
1053
|
+
- Every swatch is a token, **`--<tokenPrefix><colour>-<weight>`** (`--acme-blue-700`), defined by the server from the manifest in a small stylesheet it serves beside the design system's own (`<style data-design-system-palette="acme">`; a bundle carries the same block). **The manifest is the one source**: `design-system.css` reads these tokens with `var()` and never redefines them (`palette-redefined`). Keeping the colours as data is what lets `check` order the scales, find the neutrals, derive a missing weight and run the contrast gates without a browser, and it leaves no second place for a colour to disagree with the first.
|
|
1054
|
+
- **Weights run one way.** Within a scale, OKLab lightness strictly decreases as the weight grows, 100 the lightest and 1000 the darkest; a scale out of order is refused (`palette-order`), naming the two weights.
|
|
1055
|
+
|
|
1056
|
+
**Neutrals and derived colours are added only where the palette lacks them.** The engine never widens a palette that is already wide:
|
|
1057
|
+
|
|
1058
|
+
- **Neutrals.** A scale marked `"role": "neutral"` is the palette's neutral. Unmarked, a scale with OKLCH chroma below 0.03 at every weight is taken as one, and `check` says which it took. Only when the palette has **no** neutral scale is one derived: ten weights at the lightness the palette's scales have at each weight, tinted with a trace of the first colour's hue (chroma 0.012, THEMING `R6`), named `neutral`. Pure white and pure black are never added: a brand that wants them puts them in its neutral scale.
|
|
1059
|
+
- **Derived weights.** A scale with all ten weights derives nothing. A scale with gaps has each missing weight interpolated in OKLab between the weights it does define, and at its ends extrapolated in its own hue and chroma to the lightness the palette's other scales have there. A scale needs at least **three** weights for that; fewer is refused (`palette-too-narrow`).
|
|
1060
|
+
- Everything derived is listed by `check` as a note (`palette-derived-neutral`, `palette-derived-weight`), and the Colors tab draws a derived swatch dashed, so a brand reviewer sees exactly which colours the engine made up.
|
|
1061
|
+
|
|
1062
|
+
**A theme is a map from the theme contract to swatches.** The design system declares its themes in the manifest, never as CSS:
|
|
1223
1063
|
|
|
1224
1064
|
```json
|
|
1225
|
-
"
|
|
1226
|
-
{ "
|
|
1227
|
-
{ "
|
|
1065
|
+
"themes": [
|
|
1066
|
+
{ "name": "acme-dark", "title": "Acme Dark", "mode": "dark", "tokens": { "--accent": "orange-500" } },
|
|
1067
|
+
{ "name": "acme-light", "title": "Acme Light", "mode": "light", "tokens": { "--accent": "blue-700", "--bg": "slate-100" } }
|
|
1228
1068
|
]
|
|
1229
1069
|
```
|
|
1230
1070
|
|
|
1231
|
-
- **
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
- **A
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1071
|
+
- Every **colour** token of the contract (THEMING: canvas, accent, blocks, code, diagram and its nested tones, terminal) takes a swatch, `blue-700`; a swatch at an opacity, `blue-700/40`, for a colour no contrast gate reads (a selection, a block); or, for `--bg` only, a gradient between swatches, `{ "gradient": ["blue-1000", "indigo-1000"], "angle": 160 }`. Nothing else: a value that names no swatch is refused (`theme-off-palette`), naming the token and the value, and so is an opacity on a colour a gate reads.
|
|
1072
|
+
- **What a theme leaves out is chosen for it, from the palette**, never mixed. `mode` decides which end of the neutral scale the canvas comes from; the text is the neutral one weight in from the far end and the headings the end itself; the accent, when unstated, is the brand's first colour at mid-scale. The six diagram fills take six colours (the accent's first) at the quiet end of their scales, each fill's **nested tone the next weight of the same colour toward the ink**, so a box nested in a panel stays on brand. Each syntax role and each ANSI colour takes the palette colour **nearest its hue** (THEMING `R8`: terminal red stays red), at the weight that clears its background; when the nearest is more than 40° away, `check` says it stood in (`theme-nearest-role`, a note).
|
|
1073
|
+
- **Non-colour tokens** (`--font-body`, `--font-heading`, `--font-mono`, `--heading-weight`, `--block-radius`, `--build-duration`, `--dim-opacity`) take plain values as a theme file would; `--shadow` is chosen (a neutral at an opacity) or stated `none`. A token outside the contract is refused (`theme-token`).
|
|
1074
|
+
- **Every theme passes the shipped themes' gates**, the contract and WCAG checks of `tools/theme-check.mjs` (THEMING), after the gaps are filled. One that fails is **refused** (`theme-contrast`), naming the pair, the ratio and the floor, and which side the brand stated (`(stated: --accent blue-600)`), so the message points at the choice to change.
|
|
1075
|
+
- A theme's `name` follows the theme naming rules and may not be a shipped theme's (`theme-name`); its `title` is what a person reads; `mode` is `dark` or `light` (`theme-shape`).
|
|
1076
|
+
|
|
1077
|
+
**How the themes reach a deck.** A deck that references the design system has its themes; nothing is marked. Every server that links the design system (DESIGN_SYSTEMS) also gives the page each of its themes as an added theme block, `<style data-theme="acme-dark" data-theme-added data-design-system-theme="acme" data-theme-source="Acme Brand" media="not all">`, every swatch written as its token with the hex as fallback (`var(--acme-blue-700, #2a5bd7)`), so a theme keeps its colours even if the palette's stylesheet is missing. `bundle` carries the same blocks (`--theme acme-dark` opens the file on one), and its summary names them (`acme-dark (opens on), acme-light (acme's own)`). A deck opens on one by its configuration, `"theme": "acme-dark"`: the server's base theme link is then the default theme, and the runtime applies the brand's block over it, as for a marked theme. `design-system add` offers the design system's first theme as its look (`--apply` takes it).
|
|
1078
|
+
|
|
1079
|
+
**The picker is locked to the brand by default.** With a design system that ships themes, the theme picker (`T`) lists **only the brand's themes**, `,` and `.` cycle among them, ⌃T and the palette's *Generate a theme* are refused (a generated theme is not on the palette), and a theme this browser chose before is not one the deck reopens on. While authoring, the picker's last row, **Show every theme…**, writes `"brandThemesOnly": false` to the configuration (`POST /deck/edit/brand-themes { only }`, quiet and in place, one undo entry) and lists every theme again, the brand's first under its title; **Only <title>'s themes** puts the lock back. A deck on two design systems that both ship themes is held to both brands' themes.
|
|
1080
|
+
|
|
1081
|
+
**Colours on a brand deck.** The Colors tab (PRESENTING, Editing) shows a palette of scales as what it is: one row per colour, `<title> · <colour>`, its ten weights in order, a derived weight dashed, and a dot on each swatch the theme on screen uses, its title naming the roles (*Primary*, *Background*, *Fill 2*). A pick writes the swatch's token with its hex fallback. The **Theme** group of named roles stays: a role is how a box follows the theme from dark to light, and a swatch is how it keeps one colour in both. **Custom (RGB, HSB, hex) is hidden** while the deck is locked, since a literal colour is exactly what leaves the brand. **Paste style** on a locked deck puts a copied literal colour on the swatch nearest it (OKLab) and says which (*style pasted, on the brand's palette: green-700*). Markup written by hand stays the author's, and `decklight check` warns, once per slide, about every literal colour in a fill, stroke or colour attribute or style that is not within OKLab distance 0.02 of a swatch (`off-palette-literal`, ⚠), naming the nearest swatch; `"brandThemesOnly": false` stands it down.
|
|
1082
|
+
|
|
1083
|
+
**The theme a locked deck opens on** (#819). The runtime's startup order (DECK_ANATOMY) is `?gen=`, then `?theme=`, then the pick saved in this browser, then the configured `theme`, then the first block, and the lock holds each step to the brand:
|
|
1084
|
+
|
|
1085
|
+
- `?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
|
+
- **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.
|
|
1088
|
+
- **No configured theme** opens on the brand's first theme too, never on decklight's default.
|
|
1089
|
+
|
|
1090
|
+
Unlocked, every step is as it was: the deck opens on whatever its configuration names.
|
|
1091
|
+
|
|
1092
|
+
**`recommendedThemes`** keeps its meaning (DESIGN_SYSTEMS) for a theme from outside the design system. With a palette of scales, `check` warns about every recommended **shipped** theme whose colours are not within OKLab distance 0.02 of a swatch (`recommended-off-palette`, ⚠), naming the tokens that miss and their nearest swatches. A design system that ships its own themes usually needs none.
|
|
1093
|
+
|
|
1094
|
+
**`design-system gate`** gains these rules, in `tools/brand-palette.mjs` beside the format's own: `palette-shape`, `palette-order`, `palette-too-narrow`, `palette-redefined`, `theme-off-palette`, `theme-token`, `theme-shape`, `theme-name`, `theme-contrast` (✘); `recommended-off-palette` (⚠); and the notes, printed with `·` on every run: `palette-neutral`, `palette-derived-neutral`, `palette-derived-weight`, `theme-nearest-role`. The summary counts the palette (`12 colours, 120 swatches`) and each theme (`acme-dark (dark): 1 token stated, 61 chosen from the palette`).
|
|
1095
|
+
|
|
1096
|
+
### DESIGN_SYSTEM_ROLES · A design system's roles, set by each theme
|
|
1097
|
+
|
|
1098
|
+
**A role is what a colour is for; the theme decides its value.** The heading, the body text, an eyebrow, an accent, a card surface, a tile border: in Figma these are a presentation's Variables (`color-text/heading/main`), and a Variable has one value per mode. Without roles a design system has three ways to name a colour, and they behave differently: the theme contract (`--heading-color`) follows the theme, a swatch (`--acme-blue-700`) never changes, and a design system's own aliases, defined in its stylesheet, never change either, because a brand theme may only set contract tokens. So a component either binds to decklight's contract instead of the brand's names, or keeps the brand's names and never follows the theme. Roles make the design system's own names the ones that follow it.
|
|
1099
|
+
|
|
1100
|
+
**Roles are declared in the manifest, like the palette**, and are an optional key of `apiVersion` 2: a design system without `roles` behaves exactly as before.
|
|
1101
|
+
|
|
1102
|
+
```json
|
|
1103
|
+
"roles": {
|
|
1104
|
+
"text-heading-main": { "label": "Heading · main", "group": "Text" },
|
|
1105
|
+
"text-accent-polar": { "label": "Accent · Polar", "group": "Text" },
|
|
1106
|
+
"surface-bg-page": { "label": "Page", "group": "Surface" },
|
|
1107
|
+
"border-tile-violet": { "label": "Tile · Violet", "group": "Border" }
|
|
1108
|
+
},
|
|
1109
|
+
"contract": { "--bg": "surface-bg-page", "--heading-color": "text-heading-main", "--accent": "text-accent-polar" }
|
|
1110
|
+
```
|
|
1111
|
+
|
|
1112
|
+
- A role's key is its name (`[a-z][a-z0-9-]*`), its `label` what a person reads, its `group` the heading it is listed under (*Roles* when left out). A design system with roles has themes, since the themes set them.
|
|
1113
|
+
- Every role is a token, **`--<tokenPrefix>color-<role>`** (`--acme-color-text-heading-main`), which keeps the names a package written after Figma's Variables already uses. A token longer than a slide's style may name (43 characters) is refused, naming the role to shorten.
|
|
1114
|
+
- **The themes are the one source of a role's value**: `design-system.css` reads role tokens with `var()` and never defines them (`role-redefined`, ✘), as `palette-redefined` holds it to the swatches.
|
|
1115
|
+
|
|
1116
|
+
**Every theme gives every role a swatch**, in its own `roles` map, under the same rules as a theme's tokens (BRAND_PALETTE): a swatch, `polar-500`, or a swatch at an opacity, `polar-500/40`, where no contrast gate reads it.
|
|
1266
1117
|
|
|
1267
1118
|
```json
|
|
1268
|
-
{ "name": "
|
|
1269
|
-
"
|
|
1119
|
+
{ "name": "acme-dark", "title": "Acme Dark", "mode": "dark",
|
|
1120
|
+
"roles": { "text-heading-main": "neutral-100", "text-accent-polar": "polar-500", "surface-bg-page": "neutral-1000", "border-tile-violet": "violet-600/60" } }
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
A role a theme leaves out is refused (`theme-role-missing`), and so is a value that names no swatch (`theme-off-palette`), a role the manifest does not declare (`theme-role-unknown`), and an opacity on a role the contract maps to a token a gate reads.
|
|
1124
|
+
|
|
1125
|
+
**decklight's contract is derived from the roles.** The manifest's `contract` maps contract colour tokens to roles once, for every theme: each theme's `--heading-color` is then the swatch its `text-heading-main` has. A contract token the theme states itself in `tokens` wins; one neither mapped nor stated is chosen from the palette as before (BRAND_PALETTE). The engine's chrome, code highlighting, charts and builds keep reading the contract, and the contract's gates (`theme-contrast`) run on the derived values, naming the role a failing token came through (`(stated: --fg neutral-900 through the role text-body-default)`). On such a deck the contract is internal: authors never name it. `contract` names only colour tokens of the contract, and only declared roles.
|
|
1126
|
+
|
|
1127
|
+
**Each theme block carries the roles.** Every server, and `bundle`, writes every role token into each brand theme's block (`<style data-design-system-theme>`) beside the contract, `--acme-color-text-accent-polar: var(--acme-polar-500, #5ec6ff);`, so `T` among the brand's themes recolours every role and every component that reads one. The contrast gates read the contract alone. **A role is never undefined**: the always-on palette block (`<style data-design-system-palette>`) also carries every role at its value in the brand's **first** theme, and each theme block, after it, sets them again. With no brand theme applied (an unlocked deck on Eclipse, a brand block missing), components keep the brand's colours on the foreign theme's canvas instead of losing them. On a locked deck the brand's own theme is always applied (BRAND_PALETTE, *The theme a locked deck opens on*), so the base values never show.
|
|
1128
|
+
|
|
1129
|
+
**Colours on a deck held to a brand with roles.** The Colors tab (PRESENTING, Editing) lists the design system's roles and nothing else: one group per role `group`, `<title> · <group>`, each swatch showing the value it has in the theme on screen. There is no Theme group of contract roles, no palette scales and no Custom. A pick writes the role's token with its current value as the fallback, `var(--acme-color-text-accent-polar, #5ec6ff)`. Paste style puts a copied colour, a literal or a token that is not a role, on the role whose value in the theme on screen is nearest, and the toast names it (*style pasted, on the brand's roles: Accent · Polar*), except a contract token the manifest maps to a role, which goes on that role.
|
|
1130
|
+
|
|
1131
|
+
**A fill role is its diagram slot.** When `contract` maps a role to a diagram fill (`"--d-fill-3": "surface-diagram-fill-3"`, and `--d-fill-3-in` to its nested tone), a shape filled with that role, bare or with a fallback, is that slot everywhere the engine reads one (SVG_DIAGRAMS): a box on a panel filled with it takes the panel's nested tone, a concept pinned to the slot is that slot, and Paste style names it *fill 3*. What the engine paints for the slot is the role, with the token as its fallback: a nested box gets `var(--acme-color-surface-diagram-fill-3-in, var(--d-fill-3-in))` and a concept pinned to 3 `var(--acme-color-surface-diagram-fill-3, var(--d-fill-3))`, so a deck written in roles stays in roles. A tone no role is mapped to (`-in2`, or a slot the contract leaves out) is painted as the token, as on any other deck. The page learns the mapping from the design system's meta; a deck without one, or whose design system has no `contract`, is unchanged.
|
|
1132
|
+
|
|
1133
|
+
**What `check` holds slides to.** On a deck held to a brand with roles, any colour a slide names in a fill, stroke or colour attribute or a style that is not a role is warned about (`off-role`, ⚠, once per slide): a literal, a contract token (`var(--accent)`, `var(--d-fill-2)`), a swatch (`var(--acme-polar-700)`) or any other of the design system's own tokens, one with its prefix that is neither a role nor a swatch (`var(--acme-color-polar-default)`, an alias kept for older decks: a *design-system token*). Each is named with the role nearest it in the deck's theme, or, for a contract token the manifest maps, the role it reads. A design-system token is measured by the colour it resolves to through `design-system.css`, alias chains followed, at the deck's theme; one that resolves to no colour is still named, with no nearest role, except inside a shorthand (`border`, `outline`, `background`), where it is the width or the image, not the colour. `off-role` replaces `off-palette-literal` on such a deck, so one colour is not warned about twice.
|
|
1134
|
+
|
|
1135
|
+
**What the gate holds the package to.** `design-system gate` warns about every colour in `design-system.css` or a template's `style`, `fill`, `stroke`, `color` or `stop-color` in `templates.html` that is a contract token, a swatch or a literal (`component-off-role`, ⚠), one per declaration, naming the file, the line and the nearest role. A role read with a fallback is a role; a component's own custom properties are its own business. The report prints the roles, by group, and how many contract tokens each theme takes through them.
|
|
1136
|
+
|
|
1137
|
+
**`"brandThemesOnly": false` stands it down** for a deck, as it does the palette lock: the Colors tab shows the theme, the palette and Custom again, and `off-role` is not raised. The gate's `component-off-role` is about the package, not a deck, and stays.
|
|
1138
|
+
|
|
1139
|
+
**`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
|
+
|
|
1141
|
+
## FONTS · Fonts: a typeface's files, by reference
|
|
1142
|
+
|
|
1143
|
+
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.
|
|
1144
|
+
|
|
1270
1145
|
```
|
|
1146
|
+
<name>/
|
|
1147
|
+
font.json required: apiVersion (FONT_API_VERSION, 1), name ([a-z][a-z0-9-]*), version (semver),
|
|
1148
|
+
title, family (the CSS name a theme writes: letters, digits, spaces, _ -),
|
|
1149
|
+
fallback (the stack until the face loads, ending in a generic: "system-ui, sans-serif"),
|
|
1150
|
+
license (the licence file, e.g. "OFL.txt"), faces: [{ file, weight, style }]
|
|
1151
|
+
optional: description, role (body · heading · mono · any)
|
|
1152
|
+
faces .woff2 / .woff — magic bytes checked, one file per weight and style;
|
|
1153
|
+
weight a number or a variable font's "100 900"
|
|
1154
|
+
licence the file `license` names — REQUIRED: a deck that carries a font redistributes it
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
**`decklight font gate <dir>`** is the admission gate (`tools/font-format.mjs`, pure, beside `design-system gate`): the manifest's fields and shapes; every face listed is in the package, a woff2/woff by extension **and** by its first bytes (`wOF2`/`wOFF`); the licence file present and non-empty; no other file but top-level papers (README, LICENSE, OFL…): a script or a stylesheet riding along is refused; a face over **512 KB** is a ⚠ warning (every deck and bundle carries it), as is a face font.json does not list (never served). `fontFaceCss` is the ONE place an `@font-face` rule is written (`font-display: swap`, so the fallback shows at once and a slide is never blank while a face loads) for the servers and `bundle` alike; every value in it was held to the manifest's rules, so nothing can close the rule it sits in.
|
|
1158
|
+
|
|
1159
|
+
**A deck references a font** like a design system: `"fonts": ["inter@type-mkt"]` in the configuration block, the marketplace's portable source in the shared `themeSources` (kept until the last reference of **any** kind, theme, design system or font, from that marketplace goes). `decklight font add <ref> <deck> [--use]` (after the check; `--use` also writes the deck's default, `"font": "inter"`), `font remove` (dropping the default with it), `font list [<deck>]`: the catalog `type` is `font`, `source` a package directory in the marketplace, `apiVersion` the format version (`MARKETPLACE_REGISTRY`). **Every server** (write mode, `--no-trust`, the render server) runs `linkFonts` after `linkDesignSystems`: per reference, a `<style data-font="<name>" data-font-version>` of `@font-face` rules whose `src` is `decklight-font/<marketplace>/<name>/<face>`, and `<script type="application/json" data-font-meta="<name>">{ name, title, family, fallback, stack, role, version }</script>`; nothing when the page already carries `<style data-font>` (a bundle's copy); a reference this machine cannot read, or a package that no longer passes `check`, becomes `<meta name="decklight-font-missing">` and the theme's own stack shows. The `decklight-font/` namespace is **terminal** like `decklight-design-system/`: only a face the manifest lists (never `font.json`, never the licence, never an unlisted file), the package must resolve and still pass its check, the real path stays inside the package, a fixed MIME (`font/woff2`, `font/woff`), `nosniff`, and one plain 404 for every refusal. The edit server answers it for **any registered** font, so the picker can preview one the deck does not reference yet.
|
|
1160
|
+
|
|
1161
|
+
**`bundle`** carries every referenced font the way it carries design systems: the `@font-face` rules at the end of `<head>` with each face a base64 `data:` URI, the meta before the runtime, once per name and version when merging (two versions of one name refused, naming both modules), a `fonts` line in the summary (`sample 1.0.0 (from type-mkt) — 'Decklight Sample', 2 faces (48.2 KB)`). One this machine cannot read **fails** the bundle with the reason and the command; `--allow-missing-fonts` bundles without it, with a note: the theme's stack shows. A package that is here but broken fails whatever the flag.
|
|
1162
|
+
|
|
1163
|
+
**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.
|
|
1271
1164
|
|
|
1272
|
-
|
|
1273
|
-
says. `decklight agent add <name>` fetches nothing and runs nothing of the
|
|
1274
|
-
catalog's — it only teaches decklight how to *call* something already on
|
|
1275
|
-
your `PATH`. That is why `agent` is `REFERENCE_ONLY` beside `voice`, carries
|
|
1276
|
-
no `sha256`, and is the second kind whose `add` works offline. The reason
|
|
1277
|
-
differs from a voice's: not consent, but blast radius — an open roster that
|
|
1278
|
-
required downloading a module would put every new agent in `UNIT_PINNING`'s
|
|
1279
|
-
risk class for no gain, when the thing being described is a binary the user
|
|
1280
|
-
chose and installed themselves.
|
|
1281
|
-
- **The whole template vocabulary is `{prompt}` and `{deck}`**, each
|
|
1282
|
-
substituted into one argv element. The result is spawned as an **argv
|
|
1283
|
-
array, never a shell string**, so a deck path containing a space or a
|
|
1284
|
-
semicolon is an argument and can never become a command. A descriptor whose
|
|
1285
|
-
`args` never mentions `{prompt}` is refused: an agent handed no instruction
|
|
1286
|
-
is not a working entry. The three shapes the built-in roster already covers
|
|
1287
|
-
(`-p …`, `exec --full-auto …`, `run -t …`) are the evidence this vocabulary
|
|
1288
|
-
is closed enough to stay declarative.
|
|
1289
|
-
- **A unit may not shadow a built-in.** An installed descriptor whose name
|
|
1290
|
-
collides with one of the core agents is dropped rather than replacing it —
|
|
1291
|
-
silently changing how `claude` is invoked is not something a catalog should
|
|
1292
|
-
be able to do to a machine. A malformed descriptor is skipped, not thrown
|
|
1293
|
-
on: one broken third-party entry must not take `A` down for the agents
|
|
1294
|
-
beside it.
|
|
1295
|
-
- **The preferred agent is remembered** (`~/.decklight/agent.json`), so `A`
|
|
1296
|
-
opens on the agent you chose rather than on whichever was detected first.
|
|
1297
|
-
Precedence matches every other saved choice: `--agent` > the remembered
|
|
1298
|
-
preference > the first detected agent. Choosing one in the `A` dialog
|
|
1299
|
-
persists it (`POST /edit/agent/prefer`); it is a fact about the machine, so
|
|
1300
|
-
it is written beside the unit library and **never into the deck**.
|
|
1301
|
-
- **A remembered agent that is missing is named, never substituted.** Which
|
|
1302
|
-
agent edits your deck is not an interchangeable detail, so an unavailable
|
|
1303
|
-
preference does not quietly fall back to another one: the author server says
|
|
1304
|
-
so once at startup, and `A` answers with a line naming what is missing, what
|
|
1305
|
-
is available, and how to get it back.
|
|
1306
|
-
- **An agent is offered only if it can be RUN, and it is run as argv.** On
|
|
1307
|
-
Windows every agent that installs from npm lands as a `.cmd` batch shim, and
|
|
1308
|
-
Node refuses to spawn one without a shell. decklight does not turn one on:
|
|
1309
|
-
with a shell the arguments stop being arguments and become a command line for
|
|
1310
|
-
`cmd.exe` to re-split, and one of them is the user's prompt — `%VAR%` there
|
|
1311
|
-
is expanded before any escaping the caller could apply, so no quoting makes
|
|
1312
|
-
it safe. Instead the shim is resolved back to the script it runs and node is
|
|
1313
|
-
spawned on that, which keeps the guarantee above (argv is argv) identical on
|
|
1314
|
-
both platforms. A batch file that names no such script is **not offered at
|
|
1315
|
-
all** — detected-but-unrunnable is a worse answer than absent, and the
|
|
1316
|
-
refusal names the file rather than claiming the command is missing.
|
|
1317
|
-
|
|
1318
|
-
### VOICE_UNITS — Voices: a reference, never a payload
|
|
1319
|
-
|
|
1320
|
-
A marketplace distributes voices as **references**. A `voice` entry names an
|
|
1321
|
-
engine and one of that engine's own voice identifiers — `{ "name":
|
|
1322
|
-
"narrator-anna", "type": "voice", "engine": "elevenlabs", "voiceId": "…" }` —
|
|
1323
|
-
and carries no `source`. There are no model weights, no sample audio, and
|
|
1324
|
-
nothing else that could reproduce a person's voice on a machine that never
|
|
1325
|
-
asked. `decklight voice add` therefore fetches nothing at all: it writes the
|
|
1326
|
-
pointer it already had in the catalog cache, which makes it the one install
|
|
1327
|
-
that works offline, and speaking through it still needs that engine and the
|
|
1328
|
-
installer's own credential.
|
|
1329
|
-
|
|
1330
|
-
**The rule is enforced by subtraction.** A `source` on a `voice` entry is
|
|
1331
|
-
*refused*, not ignored, so the field through which bytes would arrive does not
|
|
1332
|
-
exist — the same shape as the runtime having no plugin system rather than a
|
|
1333
|
-
disabled one (NON_GOALS). An ignored field would still let a catalog carry a
|
|
1334
|
-
model that merely never loads.
|
|
1335
|
-
|
|
1336
|
-
**There is deliberately no consent attestation.** A `consent: true` field would
|
|
1337
|
-
be one boolean an uploader types and no one can verify, and printing it back
|
|
1338
|
-
would manufacture exactly the confidence the ingredients label refuses to
|
|
1339
|
-
manufacture (PRESENTING: an inventory, never a verdict). Distributing only
|
|
1340
|
-
references puts the consent relationship where it can actually be held and
|
|
1341
|
-
withdrawn: a cloned voice lives in a provider account under terms that governed
|
|
1342
|
-
the cloning, it is useless to anyone the owner has not shared it with, and
|
|
1343
|
-
unsharing it revokes every reference at once — which no file, once downloaded,
|
|
1344
|
-
can be made to do.
|
|
1345
|
-
|
|
1346
|
-
**The limit, stated rather than papered over:** this does not stop a catalog
|
|
1347
|
-
naming a voice after a person, or pointing at a provider voice that imitates
|
|
1348
|
-
one. What it stops is decklight becoming the thing that *hands out the
|
|
1349
|
-
likeness*. The rest is the provider's terms and the marketplace's own tier
|
|
1350
|
-
(first-party vetted, community screened, third-party unreviewed) — the same
|
|
1351
|
-
place every other unreviewable claim about a catalog entry already lives.
|
|
1352
|
-
|
|
1353
|
-
Piper voice models are unaffected and stay what they were: downloads offered by
|
|
1354
|
-
the engine when a model is missing, not marketplace units.
|
|
1355
|
-
|
|
1356
|
-
Entry names are qualified `name@marketplace`. A bare name resolves only while
|
|
1357
|
-
it exists in exactly one registered marketplace; the same bare name in two is
|
|
1358
|
-
reported as ambiguous with the qualified forms to use instead — never silently
|
|
1359
|
-
resolved to either. The registry registers, caches and names; installing what
|
|
1360
|
-
an entry points at is each install surface's own contract (theme browse
|
|
1361
|
-
installs through `theme add`, THEME_DISTRIBUTION). Nothing here executes in a
|
|
1362
|
-
deck: the marketplace distributes data and authoring-side units, and the
|
|
1363
|
-
no-plugin-system line (NON_GOALS) stands.
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
## REPO_LAYOUT — Repository layout & tooling
|
|
1165
|
+
## REPO_LAYOUT · Repository layout & tooling
|
|
1367
1166
|
|
|
1368
1167
|
```
|
|
1369
1168
|
decklight/
|
|
1370
|
-
SPEC.md README.md package.json
|
|
1169
|
+
SPEC.md (authoring) PLATFORM.md (marketplace, library) README.md package.json
|
|
1371
1170
|
src/core/ engine.js (init, nav, builds, transitions, stage, chrome, input) + the features that own their own
|
|
1372
|
-
state and keyboard: themes.js (switching, packs, generator, picker),
|
|
1171
|
+
state and keyboard: themes.js (switching, packs, generator, picker), sources.js (SLIDE_SOURCES: what a
|
|
1172
|
+
slide is standing on, and its editor), inspector.js + inspect-facts.js (the I key: all about the slide
|
|
1173
|
+
or the selection), narration.js (voice, captions,
|
|
1373
1174
|
character, the recorders), editmode.js (live reload, notes editor, element edit mode, agents
|
|
1374
1175
|
and the chip that says one is still working, undo/redo, restore), hud.js (clock, progress, ink, transcript), onboarding.js (the first-open card
|
|
1375
|
-
and
|
|
1176
|
+
and the editing tour) + the decidable pieces engine.js's init() no longer holds, each unit-tested without a
|
|
1376
1177
|
browser: overflow.js (the guardrail's watch), playlist.js (module navigation), finder.js (the
|
|
1377
1178
|
finder's index + ranking), layout.js (the L ring + its write-through), palette.js (what a typed
|
|
1378
1179
|
string means), debuglog.js (the D ring buffer), overlay.js (backdrop, list selection, the
|
|
1379
|
-
typeahead keyboard),
|
|
1380
|
-
|
|
1381
|
-
|
|
1180
|
+
typeahead keyboard), preview.js (the iframe preview handshake the finder, the pickers and the
|
|
1181
|
+
history dialog share), escape.js, htmlfmt.js (dedenting an element's source for the
|
|
1182
|
+
content editor, without changing what it renders), colorpicker.js (the Colors… card: RGB/HSB maths, the
|
|
1183
|
+
named theme palette, which shape and label a right-click means), motion.js (the duration, FLIP and transition-class decisions
|
|
1184
|
+
behind SLIDE_TRANSITIONS and AUTO_ANIMATE), thinking.js (the ASCII | / - \\ every wait shows),
|
|
1185
|
+
worddiff.js (the notes editor's before / after, word by word), design-systems.js (the
|
|
1186
|
+
palette's Design systems… list and Use slide template…), design-system.js (a slide's slide template, expanded
|
|
1187
|
+
into slots in the DOM — never the file), fonts.js (the [ / ] stacks and the deck's font
|
|
1188
|
+
packages, and the Font… picker that previews, FONTS), bleed.js (the current slide's background
|
|
1189
|
+
art on a screen-sized layer behind the stage, DECK_ANATOMY), film.js (Film yourself: the camera,
|
|
1190
|
+
a take, and the upload to the lip-sync bridge), editbar.js (the bar that names every door of write
|
|
1191
|
+
mode), pick.js (what a pointer means inside a diagram), style-clip.js (Copy style and Paste style),
|
|
1192
|
+
concepts.js + concept-tools.js (the deck's concepts, and putting shapes into one, SVG_DIAGRAMS),
|
|
1193
|
+
deckcheck.js (Check deck…) + density.js (SLIDE_DENSITY, measured), dock.js (the panel beside the
|
|
1194
|
+
slide), choice.js (one answer on a card), ranges.js (a slide range, picked), prefs.js (the deck's
|
|
1195
|
+
memory, where localStorage may throw), undo-chord.js (the undo chord as this machine spells it)
|
|
1196
|
+
— plus autoanimate, builds, print, svg, charts, media,
|
|
1382
1197
|
speaker, annotate, character, character-art, devmode, themegen, voicetrack
|
|
1383
1198
|
src/math/ LaTeX math on data-math slides (Temml → MathML Core)
|
|
1384
1199
|
src/code/ highlight bundling + line stepping provider
|
|
1385
1200
|
src/terminal/ ansi.mjs (parser), player.mjs (provider + modes)
|
|
1386
|
-
cli/ decklight.mjs (dispatcher: init/skills/cast/
|
|
1387
|
-
import/theme/
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1201
|
+
cli/ decklight.mjs (dispatcher: init/skills/cast/bundle/restore/history/upgrade/pdf/pptx/video/
|
|
1202
|
+
import/theme/font/design-system/marketplace/library/publish/narrate/setup/enhance/comments/
|
|
1203
|
+
associate/trust/check/doctor/report-bug/version, the roster `decklight help` prints;
|
|
1204
|
+
a FILE as the first argument implies its verb (a deck → open.mjs, a
|
|
1205
|
+
.decklight → open --no-trust, an Office file or Slides URL → import, a YAML script → cast), a bare
|
|
1206
|
+
`decklight` on a terminal reads the directory (start.mjs), and an unknown command names the one
|
|
1207
|
+
it probably meant; `edit` (folded into `open`) and `rec` (renamed `cast`) are gone —
|
|
1208
|
+
an unknown command, printing the roster) + commands.mjs (the roster itself: one row per command naming its
|
|
1209
|
+
module and main, plus the help text — test/commands.test.mjs holds the two in step) + pkg.mjs (the package root and the one
|
|
1391
1210
|
runtime-inlining transform) and util.mjs (CommandError + runMain: every command fails
|
|
1392
1211
|
one way), init.mjs, cast.mjs, bundle.mjs, upgrade.mjs, restore.mjs,
|
|
1393
1212
|
theme.mjs (validate + install a theme, THEMING), import.mjs (PowerPoint/Keynote/Google Slides →
|
|
1394
1213
|
deck, JS_API), pdf.mjs (the print variants, PRESENTING) + pptx-export.mjs (deck → PowerPoint,
|
|
1395
|
-
NON_GOALS), publish.mjs, marketplace.mjs (register catalogs, MARKETPLACE_REGISTRY
|
|
1396
|
-
|
|
1214
|
+
NON_GOALS), publish.mjs, marketplace.mjs (register catalogs, MARKETPLACE_REGISTRY; entry versions and
|
|
1215
|
+
the install ledger, UNIT_VERSIONS), enhance.mjs (the notes rewritten by your agent: audio tags, or
|
|
1216
|
+
written for the ear — checked before a byte is written), design-system.mjs (the design-system
|
|
1217
|
+
admission gate, and add/remove/list/templates, DESIGN_SYSTEMS) + design-system-refs.mjs (a deck's
|
|
1218
|
+
design systems: resolution, injection, and serving the package) + design-system-edit.mjs
|
|
1219
|
+
(a slide put into, switched, taken out of or inserted in a slide template; the slot guard) +
|
|
1220
|
+
design-system-deps.mjs (its recommended themes and fonts, brought along; its look, offered), font.mjs
|
|
1221
|
+
(the font admission gate, and add/remove/list, FONTS) + font-refs.mjs (a deck's fonts:
|
|
1222
|
+
resolution, @font-face injection, serving the faces, and the bundle's copy), units.mjs
|
|
1223
|
+
(templates/skills/importers/voices/engines/agents), plugin.mjs (presenter chrome, NO_TRUST#PLUGINS),
|
|
1397
1224
|
loader.mjs + extension.mjs (build-time transforms and their admission gate), wizard.mjs (the
|
|
1398
1225
|
credential wizard, ENGINES#WIZARD), sign.mjs + deckfile.mjs + associate.mjs (signing, the
|
|
1399
1226
|
.decklight container, the double-click), audit.mjs (the ingredients label), serve.mjs (the server
|
|
1400
|
-
core),
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1227
|
+
core), deck-routes.mjs (the deck's channel, both modes'), edit.mjs (the one server, write mode and no-trust mode: a route table, with the slide-mutation routes in
|
|
1228
|
+
edit-slides.mjs, the look routes in edit-look.mjs, the hand-over routes in edit-handover.mjs, the commit and history routes in edit-git.mjs), open.mjs, remote.mjs, agents.mjs (AI-agent roster), git.mjs (the
|
|
1229
|
+
commit-mode decision table: on your word, or the timer), update-check.mjs (the "a newer decklight exists" notice), qr.mjs,
|
|
1230
|
+
port-conflict.mjs, supervise.mjs, skill-content.mjs (the agent skill's shipped text), start.mjs (a bare
|
|
1231
|
+
`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
|
|
1233
|
+
exit code, PRESENTING), open-browser.mjs (hand a URL to the platform launcher), banner.mjs (the
|
|
1234
|
+
startup banner), runtime-link.mjs (a deck as data: the runtime linked in on the way out,
|
|
1235
|
+
DECK_ANATOMY), clone-deck.mjs (a git URL as the deck), trust.mjs (a deck's code, trusted by its
|
|
1236
|
+
bytes), upstream.mjs (NO_TRUST#UPSTREAM), deck-refs.mjs + theme-refs.mjs (what a deck references
|
|
1237
|
+
from a marketplace, one table; its themes as references, THEME_DISTRIBUTION), library.mjs
|
|
1238
|
+
(everything installed into your library), narrate.mjs + record.mjs (the deck's narration, by an
|
|
1239
|
+
engine or `--mic` in your voice), setup.mjs (this machine's voice and face, once), skills.mjs
|
|
1240
|
+
(the authoring skill for each agent), history.mjs, commit-flow.mjs + commit-message.mjs +
|
|
1241
|
+
commit-split.mjs + git-tree.mjs (committing on your word: the snapshot, the subject, the split,
|
|
1242
|
+
a tree built without the working tree), comments.mjs + review-store.mjs + review-ref.mjs +
|
|
1243
|
+
review-routes.mjs + review-submit.mjs + review-remote.mjs (REVIEW: the comment store, a review
|
|
1244
|
+
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), report-bug.mjs
|
|
1246
|
+
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)
|
|
1404
1248
|
themes/ 46 × <name>.css (the graded + reveal-compat sets; the homage packs moved to the
|
|
1405
1249
|
marketplace, THEME_DISTRIBUTION) + packs.json + gallery.html
|
|
1406
1250
|
dist/ decklight.js (IIFE, global Decklight), decklight.css
|
|
1407
1251
|
demo/ smoke.html (the render harnesses' deck — every feature, including deliberate regression
|
|
1408
1252
|
fixtures) + intro.html, features.html, pitch.html, showcase.html + assets/
|
|
1409
1253
|
test/ node:test units (ansi, builds, math, cast format, the CLI, the marketplace, the pieces lifted out
|
|
1410
|
-
of engine.js), found by run.mjs rather than a shell glob +
|
|
1411
|
-
player, narration × 5 — live/picker/recorded/segments/record,
|
|
1412
|
-
|
|
1254
|
+
of engine.js), found by run.mjs rather than a shell glob + 30 headless-Chrome harnesses (render,
|
|
1255
|
+
player, narration × 5 — live/picker/recorded/segments/record, engine × 8 — themes/palette/
|
|
1256
|
+
narration/navigation/handover/sources/authoring/builds, record, review, character, pin,
|
|
1257
|
+
overflow, split, strict, shot, plugin, extension-check, deckfile, pdf, pptx-render, import,
|
|
1258
|
+
theme-config) +
|
|
1413
1259
|
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
|
|
1414
1260
|
blessed suite runs: soak.mjs (pack, install, walk the journey — the release gate) with its
|
|
1415
1261
|
soak-platform.mjs, and video-e2e.mjs (a real ffmpeg render)
|
|
1416
1262
|
```
|
|
1417
1263
|
|
|
1418
1264
|
- Build: `npm run build` = esbuild bundle (`src/index.js` → `dist/decklight.js`, minified + sourcemap) + CSS copy. Node ≥ 20. Runtime has **zero** runtime dependencies (highlight.js + temml are bundled at build time; Temml's stylesheet is appended to `decklight.css` with its optional woff2 `@font-face` stripped); `node-pty`, `js-yaml` are CLI-only deps.
|
|
1419
|
-
- Verification culture: `npm test` runs the units; `npm run verify` builds and then runs **all
|
|
1420
|
-
- Release gate: **`npm run soak`** packs this repo, installs the tarball into an empty project whose path contains a space, and drives the INSTALLED `decklight` through one user journey
|
|
1265
|
+
- Verification culture: `npm test` runs the units; `npm run verify` builds and then runs **all 32 harnesses** (the 30 headless-Chrome ones against `demo/smoke.html` and the decks each covers, plus the two theme graders), reporting every harness rather than stopping at the first failure. A feature is verified against a real render, not only unit-tested.
|
|
1266
|
+
- Release gate: **`npm run soak`** (CI runs it on the hosted Mac for every PR and on the self-hosted Mac on dispatch; by hand before a release) packs this repo, installs the tarball into an empty project whose path contains a space, and drives the INSTALLED `decklight` through one user journey (create, import, marketplace, write mode, no-trust, bundle, transform, pdf, publish, validate, open, record, film) plus a cross-version `upgrade` of a deck scaffolded by a decklight that actually shipped. Manual, in neither blessed suite (it runs a real `npm install`, and skipping inside them would let "green" mean "not actually run"); anything it cannot do here (no Chrome, no network, no ffmpeg, no toolchain) skips **by name**, so a green run with skips is never mistaken for a complete one.
|
|
1421
1267
|
|
|
1422
|
-
## NON_GOALS
|
|
1268
|
+
## NON_GOALS · Non-goals (v1)
|
|
1423
1269
|
|
|
1424
|
-
Vertical slide nesting · full terminal emulation (vim/htop) · multiplex/follow-along · **in-deck runtime extensions** · PPTX round-trip · mobile authoring.
|
|
1270
|
+
Vertical slide nesting · full terminal emulation (vim/htop) · multiplex/follow-along · **in-deck runtime extensions** · PPTX round-trip · mobile authoring · reply threads on review comments (REVIEW: a comment is one-way).
|
|
1425
1271
|
|
|
1426
|
-
**On PPTX.** Export exists (`decklight pptx`, PRESENTING) and is lossy by design: every slide is a picture at its own size with its builds complete, and the speaker notes are real notes. What stays a non-goal is the *round-trip
|
|
1272
|
+
**On PPTX.** Export exists (`decklight pptx`, PRESENTING) and is lossy by design: every slide is a picture at its own size with its builds complete, and the speaker notes are real notes. What stays a non-goal is the *round-trip*: a `.pptx` whose text boxes, builds and charts survive as editable objects. A decklight deck is HTML, builds, casts and a live voice, none of which has a PowerPoint shape; the export is for the people around a decklight user who still ask for the file, not for editing it there.
|
|
1427
1273
|
|
|
1428
|
-
**On that third-from-last one.** "No plugin system" was the v1 non-goal, and 0.3.0 shipped marketplaces
|
|
1274
|
+
**On that third-from-last one.** "No plugin system" was the v1 non-goal, and 0.3.0 shipped marketplaces, so the line is narrowed rather than deleted, because what it was protecting is still protected. A deck travels, so code inlined into it runs in front of an audience that installed nothing and consented to nothing (MARKETPLACE.md `WHY`). Everything a marketplace distributes therefore runs somewhere else: a build-time transform runs in Node during `bundle` and returns HTML (`EXTENSIONS_TRANSFORMS`), a presenter plugin runs on the presenter's own machine in a sandboxed frame and may not touch slide content (NO_TRUST#PLUGINS), an engine or import adapter runs at author time, and a theme or template is data. The runtime still has no plugin API, no `<script>` a catalog can put in a deck, and no execution surface for a recipient to be surprised by: providers + events remain the only extension inside the deck.
|
|
1429
1275
|
|
|
1430
|
-
The phone remote (PRESENTING) is not an exception to multiplex/follow-along: it is a **controller**, not a second screen. The phone renders no slides
|
|
1276
|
+
The phone remote (PRESENTING) is not an exception to multiplex/follow-along: it is a **controller**, not a second screen. The phone renders no slides (two buttons and a position readout) and nothing in it broadcasts a deck to an audience's own devices.
|