decklight 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/SPEC.md +22 -7
- package/cli/agents.mjs +125 -17
- package/cli/decklight.mjs +9 -0
- package/cli/edit.mjs +10 -2
- package/cli/report-bug.mjs +9 -1
- package/cli/skill-content.mjs +5 -5
- package/cli/update-check.mjs +156 -0
- package/cli/wizard.mjs +184 -16
- package/dist/decklight.js +47 -47
- package/dist/decklight.js.map +4 -4
- package/package.json +5 -3
- package/tools/local-voice.mjs +33 -2
- package/tools/tts-engines.mjs +10 -1
- package/tools/video.mjs +66 -17
- package/tools/voiceover.mjs +69 -11
package/README.md
CHANGED
|
@@ -32,9 +32,15 @@ But the real reason this project exists is the second half: I wanted a codebase
|
|
|
32
32
|
## Quick start
|
|
33
33
|
|
|
34
34
|
```
|
|
35
|
-
npx decklight init "My Deck"
|
|
35
|
+
npx decklight@latest init "My Deck"
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
The `@latest` is load-bearing: `npx decklight` with no version reuses whatever
|
|
39
|
+
`npx` already unpacked into `~/.npm/_npx/`, so the first version you run is the
|
|
40
|
+
one you keep. If you have been running a bare `npx decklight` and it prints an
|
|
41
|
+
old number, clear that cache with `npx clear-npx-cache` (or `rm -rf ~/.npm/_npx`)
|
|
42
|
+
— or install it properly with `npm i -g decklight`.
|
|
43
|
+
|
|
38
44
|
This scaffolds a self-contained `deck.html` (double-click it — no server) **and** a `.claude/skills/decklight/` skill + `AGENTS.md`, so Claude Code (or anything that reads `AGENTS.md`) has the full authoring contract on hand instead of guessing from Reveal.js memory. The skill is sliced straight from `SPEC.md`, so it never drifts from the runtime you actually installed.
|
|
39
45
|
|
|
40
46
|
**Claude Code on the web** reaches the skill two ways. A committed `.claude/skills/decklight/` loads with the clone, so cloud sessions on that repo have it already — that is the per-project route and it needs nothing but a `git commit`. For every project at once, `decklight skills claude --pack` writes `decklight-skill.zip` to upload in your claude.ai skill settings. (`--global` installs into `~/.claude/skills/`, which local sessions read but cloud machines never see.)
|
|
@@ -110,7 +116,7 @@ The whole loop is agent-friendly and stays in one file end to end:
|
|
|
110
116
|
| `decklight bundle deck.html [--all]` | flatten to a self-contained single-file HTML (`--sign` attests it, `--deck` wraps it as `.decklight`) |
|
|
111
117
|
| `decklight publish deck.html` | bundle and push to GitHub Pages — signed by default; Netlify and Vercel install as targets |
|
|
112
118
|
| `decklight pdf deck.html` | one slide per page, at its own size, in its theme — no print dialog |
|
|
113
|
-
| `decklight video deck.html` | render to one narrated mp4 (`--voiceover` synthesizes the narration first) |
|
|
119
|
+
| `decklight video deck.html` | render to one narrated mp4 — ⟨CLICK⟩ segments narrate the builds (`--voiceover` synthesizes the narration first) |
|
|
114
120
|
| `decklight theme check\|add` | validate a theme against the token contract, or install one into a deck |
|
|
115
121
|
| `decklight marketplace add owner/repo` | register a catalog — cloned once with **your** git credentials (so a private one works), then read from disk |
|
|
116
122
|
| `decklight plugin add timer` | presenter chrome into **your** library: `present` loads it, `bundle` never does |
|
package/SPEC.md
CHANGED
|
@@ -296,7 +296,7 @@ An installed theme becomes a `<style data-theme="<name>" data-theme-added media=
|
|
|
296
296
|
|
|
297
297
|
### RECORDER_CLI — Recorder CLI (authoring-time; the only part with native deps)
|
|
298
298
|
|
|
299
|
-
`cli/rec.mjs`, invoked as `npx decklight rec <script.term.yaml> [-o out.cast.json]`
|
|
299
|
+
`cli/rec.mjs`, invoked as `npx decklight@latest rec <script.term.yaml> [-o out.cast.json]`
|
|
300
300
|
(the `decklight` dispatcher in `cli/decklight.mjs` also provides `refresh`, `export`, `bundle`,
|
|
301
301
|
and a global `--help`; the per-file entry points still run directly, undocumented).
|
|
302
302
|
|
|
@@ -443,7 +443,7 @@ absent — no compatibility break in either direction.
|
|
|
443
443
|
- **The `.decklight` container** (`decklight bundle --deck`, `decklight publish --deck`; played by `decklight present <file>.decklight`). 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 `present` 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. `present` 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.
|
|
444
444
|
- **File association** (`decklight associate`, `--uninstall`, `--print`): wires a double-clicked `.decklight` to `decklight present`, 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 `present` 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 `present` 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.
|
|
445
445
|
- **Presenter plugins** (`decklight plugin add|list|check|remove`; loaded by `present`, never by `bundle`). Chrome the *presenter* installs for themselves — a talk timer, a teleprompter, a confidence monitor — layered on at serve time from `~/.decklight/plugins/`, so the deck on disk is untouched and the same file presented on a machine without them is identical slides with no warning. This is defensible for the reason a build-time transform is (`EXTENSIONS`): **the installer is the risk-bearer, and nothing travels**. A plugin is two files, `plugin.json` and `plugin.js`. **Scope is chrome only, and the browser is what enforces it**: the code runs inside `<iframe sandbox="allow-scripts" srcdoc=…>` with no `allow-same-origin`, so the frame holds an **opaque origin** and `parent.document` throws — there is no handle on a slide to misuse, which is a different thing from a rule against reaching for one. A deck has to stay a deterministic artifact, or two people presenting the same file are presenting different decks. Two checks sit *in front* of that boundary and neither carries it: the manifest vocabulary is **closed** the way the wizard's field types are (`slot` from a fixed list so a plugin cannot place itself over the stage, sizes clamped for the same reason, unknown keys refused rather than ignored), and a **lint** rejects source that reaches for the deck's document — which already fails at run time, so catching it at install turns a `SecurityError` nobody is watching into a sentence. What crosses into the frame is a one-way push with no request channel: deck position, build step, elapsed time, and **speaker notes only to a plugin that declared `needs: ["notes"]`**, which `plugin list` and the `present` startup line both name. Reading notes is not transforming them, and the speaker view already shows those words on that machine — but a timer never sees a line of the talk. A plugin **never enters the ingredients label**: the label is an inventory of the file (`PRESENT#AUDIT`), the chrome is injected after the audit has read the bytes and after strict mode has stripped what it could not account for, and it is reported on its own line as the presenter's own. It **registers no route and widens no policy** — a `srcdoc` frame is never fetched, so `frame-src` has no URL to judge and it loads under the deck's existing CSP untouched. A broken plugin is skipped with a reason rather than being fatal (`PRESENT#STRICT`'s argument: nothing about a timer should cost someone their talk), `--no-plugins` presents without the library, and with nothing installed `present` serves a deck byte for byte as it did before any of this existed.
|
|
446
|
-
- **Engine wizard** (`ENGINES#WIZARD`; author mode only). A capability ships with its affordance always present (`V`/`N`, `A`, the palette entries) and **no bundled provider**; first use opens a wizard that installs and configures one. **The door is the `/` palette**: the author server's ping advertises every engine a registered marketplace declares a wizard for (`wizards`, beside its `agents`), and each gets a contextual `Configure ⟨engine⟩… (dev)` row that opens the form — named by **qualified** ref (`engine@marketplace`), so two catalogs sharing a bare name cannot silently resolve to whichever registered first. Without a server the list is empty and the rows are ABSENT, not disabled — same reasoning as the gate below. `instance.wizard(⟨engine⟩)` is the programmatic door, for drivers that cannot click. **Core renders; a plugin only declares** — a schema of questions, field types and a validation path, never markup. The field vocabulary is **closed** (`secret`, `text`, `choice`, `path`, `boolean`) and that is the mechanism, not a style rule: "the wizard appears only in author mode" is enforceable exactly as long as no plugin can put its own markup on a slide. Unknown keys are refused rather than ignored (a silently dropped key is a wizard asking for less than its author believed), a `secret` may not carry a `default` (a placeholder to be pasted over, or a key baked into a catalog — the second is bad enough to refuse the first), and `validate` is a **path** the plugin chooses on an origin it does not (a schema that could name where to send a freshly pasted key would be an exfiltration primitive with a config file for a delivery mechanism). A schema is vetted on the way **out** of the server as well as on the way in, because a catalog is a file someone else wrote. **Credentials**: pasted in the player, posted to the author server,
|
|
446
|
+
- **Engine wizard** (`ENGINES#WIZARD`; author mode only). A capability ships with its affordance always present (`V`/`N`, `A`, the palette entries) and **no bundled provider**; first use opens a wizard that installs and configures one. **The door is the `/` palette**: the author server's ping advertises every engine a registered marketplace declares a wizard for (`wizards`, beside its `agents`), and each gets a contextual `Configure ⟨engine⟩… (dev)` row that opens the form — named by **qualified** ref (`engine@marketplace`), so two catalogs sharing a bare name cannot silently resolve to whichever registered first. Without a server the list is empty and the rows are ABSENT, not disabled — same reasoning as the gate below. `instance.wizard(⟨engine⟩)` is the programmatic door, for drivers that cannot click. **Core renders; a plugin only declares** — a schema of questions, field types and a validation path, never markup. The field vocabulary is **closed** (`secret`, `text`, `choice`, `path`, `boolean`) and that is the mechanism, not a style rule: "the wizard appears only in author mode" is enforceable exactly as long as no plugin can put its own markup on a slide. Unknown keys are refused rather than ignored (a silently dropped key is a wizard asking for less than its author believed), a `secret` may not carry a `default` (a placeholder to be pasted over, or a key baked into a catalog — the second is bad enough to refuse the first), and `validate` is a **path** the plugin chooses on an origin it does not (a schema that could name where to send a freshly pasted key would be an exfiltration primitive with a config file for a delivery mechanism). A schema is vetted on the way **out** of the server as well as on the way in, because a catalog is a file someone else wrote. **Credentials**: pasted in the player, posted to the author server, and stored under the config home beside `marketplaces.json` **restricted to the account that pasted them** — and re-restricted on every write, since `writeFileSync`'s mode is ignored for a path that already exists. What that restriction IS is per-platform, and decklight says which: `0600` on POSIX, where the mode is the whole of the protection; on Windows an explicit ACL, because a mode there is a number with no meaning and inheriting whatever the user profile hands out is not a decision decklight ever made. That ACL is set in three steps and the third is the one that matters: `/inheritance:r` drops what was inherited, `/grant:r` puts this account on, and then **every other principal is removed by name** — including `SYSTEM` and the Administrators group, since an administrator can take ownership whatever the DACL says. The usual one-line recipe stops after the first two and silently does nothing at all on a file whose entries are already explicit; a Windows CI run is the only thing that can tell the difference, which is why one gates this. Every sentence printed about this — the wizard's own destination line, the author server's log, `report-bug`'s environment block — is derived from the file **read back**, never from what the write intended: a key with weak permissions is bad, and a key with weak permissions under a CLI reporting `0600` is worse. A machine with no ACLs to set (a FAT volume, a share) is not an error and is not silently accepted either — it is reported as inherited, in those words. Never logged, never in the response (redaction is **one** function, so a key cannot reach a debug panel two features later), never written into the deck, never read by `bundle`. **Never outside author mode**: the routes are `/edit/*`, so `allowRemote` refuses them off-loopback unconditionally and `present` registers nothing resembling them — a credential prompt in a deck you were emailed is a phishing primitive, and the player gate refuses *before* it builds a single input. Install and configure are one flow with **three distinguishable answers**: `unreachable` (wait), `rejected` (fix the key, the answers, or the plugin's schema), and "no such engine" (add the marketplace — named, not one of the two failures). Nothing is stored on any failing path, and answers that fail the schema never cost a network call. Recorded narration needs none of this: a deck with a voice track plays from files with no engine installed.
|
|
447
447
|
- **Undo/redo** (`Z`/`⇧Z`): the server keeps ONE in-memory edit history — whole-file snapshots, capped at 200 — fed by every mutation it performs (layout picks, notes saves, agent runs). Undo/redo rewrites the deck file; the watcher's reload shows the result (the hash keeps the position). The history is deliberately **independent of git**: commits never consume or reset it, and undoing never touches the repository. A file edited externally between an edit and its undo isn't lost — the current content rides the opposite stack. Empty stacks answer 409, and the player toasts the remaining depths.
|
|
448
448
|
- **Git autocommit**: with `--git` (or automatically when the deck already sits inside a repository; `--no-git` opts out) the server commits the deck on a regular basis — every `--commit-every` seconds (default 300) when it actually changed, plus an opening commit and a final one on Ctrl-C. `--git` creates the repository when none exists; `decklight author` ASKS first on a TTY ("no git repository here — create one and auto-commit?"). A repository decklight creates starts with a starter `.gitignore` — `.shots/` (screenshot evidence), `.DS_Store`, and, behind a delete-this-line comment naming the tradeoff (bulky vs. cloud narration costing money to regenerate), `voiceover/` — written between `git init` and any initial commit; an existing `.gitignore` is never touched, and a repository decklight didn't create never gets one. Only the deck file is staged (`git add -- <deck>`), and a machine with no git identity gets a per-commit `-c user.name/user.email` fallback rather than a silent failure. **When to commit** is chosen by `--git-mode`: `agent` (the **default**), `timer`, or `off`. In `agent` mode a completed agent edit produces one commit carrying the agent's own summary as the subject — a failed run or one that changed nothing commits nothing — **and** the cadence keeps running underneath as a backstop, held back only while a job is in flight so no commit ever captures a half-finished agent run. `agent` is therefore a superset of `timer`, which is what makes it safe to default to: nobody loses the periodic safety net. A timer is the wrong boundary for agent-authored work on its own — the commits land on a clock that lines up with nothing the agent did and every message reads `autosave` — but it is the right backstop, because an agent job only ever sees edits it made.
|
|
449
449
|
|
|
@@ -474,7 +474,7 @@ Authorship is **structural, not detected**: the server spawns the agent itself a
|
|
|
474
474
|
- **Speaker view**: `S` opens a popup (synced via BroadcastChannel): current + next slide thumbnails, notes (with `⟨CLICK⟩` markers highlighted as the matching build lands), elapsed timer, build step list (provider labels). **Rehearse mode**: pressing `S` again (in the deck or in the popup; the header badge also toggles) swaps the prose notes for the slide's `aside.rehearse` cue cards (DECK_ANATOMY) — rendered large and bold, one cue per segment, same said/now/next highlighting. Slides without rehearse notes fall back to the full prose. `S` in the deck only opens a new popup when none is connected; while one is open it toggles the mode. **Phone remote**: when the deck is being played by `decklight present --remote` (below), the speaker view also shows a QR of the controller URL — click it to enlarge for scanning across a lectern. It appears only when a remote is actually on, since without it there is no LAN URL to encode.
|
|
475
475
|
- **Phone remote** (`decklight present <deck.html> --remote`): the presenting server also listens on the LAN and serves `GET /remote` — a self-contained controller page with prev/next and a live "slide x/N" readout, no external asset of any kind (a phone is off-loopback, so anything it fetched from elsewhere would be a hole). A tap is relayed as a named `remote` event on the SSE stream the deck already holds, and the deck POSTs its position back, so the readout tracks the deck however it moved (phone, keyboard, or click). `POST /remote/pos` is the deck→phones direction and **accepts only loopback callers**: the deck is the one thing that knows the position, it reports from this machine, and a phone — or anyone who obtained the QR token — posting a fabricated `{i,n}` would desync the readout every other phone shows. `--remote` widens the **listener** and nothing else: off this machine **only** `/remote/*` answers, and only with the per-run random token the printed URL and its QR embed — the deck itself and every file beside it stay unreachable from the LAN either way. One exported classifier decides it, `allowRemote(req, token)`, and `PRESENT#REMOTE` is why it lives on this server: the remote used to sit on the **author** server, so a clicker meant running `/edit/notes`, `/edit/layout` and `/edit/agent` on the LAN during a talk you were not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes.
|
|
476
476
|
- **Print/PDF**: `?print` renders all slides sequentially, every build complete, terminal casts fully expanded, one slide per page (`@media print` CSS). No JS needed after layout. Background media (DECK_ANATOMY) prints as a still: no `<video>` element is ever created in print — the slide's `data-background-poster` renders as the background image instead. Two handout variants restructure the same fully-built render onto portrait pages (one `.print-page` per sheet): `?print=handout` groups slides three to a page, each scaled slide beside a column of ruled note-taking lines (page count = ⌈N/3⌉); `?print=notes` gives one page per slide with that slide's speaker notes rendered underneath — slides without notes keep their page with an empty notes block. **Page count equals slide count** (⌈N/3⌉ for handout): the page box has no margin, so the document has none either — the UA's default body margin would push the last slide's final pixels past the last page box and emit a blank final sheet. **`decklight pdf <deck.html>`** writes that render to a file without a print dialog: headless Chrome over the deck's own `?print`, one slide per 1280×720 page (960×540 pt), `-o` for the path, `--theme` to export in another theme (it rides `?theme=`), `--wait` for decks that need longer to settle. Slides the overflow guardrail flagged are named on stderr by slide number — the PDF is still written, because a clipped slide is worth knowing about, not worth refusing. No Chrome, or no file produced, exits non-zero rather than leaving a silent empty PDF.
|
|
477
|
-
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4 — a full-resolution still per FRAME (each a one-shot headless Chrome against `#/<n>/<step>`, the shot.mjs mechanism), muxed with the audio into a single file. A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail. A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load — the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP** — the same loopback core `present` uses (`serveForRender`) — never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `present`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead — fixing the deck's length — reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>`, `--slides a-b`, `--voiceover` (runs the voiceover batch first). Needs ffmpeg + ffprobe — missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). Honest MVP limits: frames are stills, so the **character overlay appears but frozen** and terminals render fully expanded rather than typing (animated capture needs a CDP screencast — a named Node ≥22 follow-up), and a build **cuts rather than animating** (the frame is a still of each step, not a capture of the transition between them). **
|
|
477
|
+
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4 — a full-resolution still per FRAME (each a one-shot headless Chrome against `#/<n>/<step>`, the shot.mjs mechanism), muxed with the audio into a single file. A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail. A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load — the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP** — the same loopback core `present` uses (`serveForRender`) — never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `present`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead — fixing the deck's length — reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>`, `--slides a-b`, `--voiceover` (runs the voiceover batch first). Needs ffmpeg + ffprobe — missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). Honest MVP limits: frames are stills, so the **character overlay appears but frozen** and terminals render fully expanded rather than typing (animated capture needs a CDP screencast — a named Node ≥22 follow-up), and a build **cuts rather than animating** (the frame is a still of each step, not a capture of the transition between them). A **narrated** slide builds too where its notes say so: `⟨CLICK⟩` segments the speaker notes, `tools/voiceover.mjs` synthesises one audio file per segment (same characters, so the same cost — the per-slide `slide-NN.m4a` is *concatenated* from them, and every existing consumer of it is untouched), and segment k narrates build step k for that segment's ffprobe'd duration. This is the recorded mirror of a rule that already ships: `src/core/narration.js` speaks live narration the same way, and captions, rehearse mode and the notes editor share the segmentation. A marker count that does not match the build count **warns naming the slide and renders the old way** — a wrong sync baked into an mp4 is worse than no sync — and a manifest written before this renders exactly as it did.
|
|
478
478
|
- **Overflow guardrail**: content that exceeds the slide flex-shrinks into a scroll box and reads as clipped. The engine warns (`console.warn`) and marks the section with a `data-overflow` attribute — on each slide activation, and for the whole deck in `?print`. The mark is **live, not latched**: layout is not final when a slide activates (a webfont resolves, an image decodes, a chart or terminal mounts), so the active slide is watched and the check re-runs whenever its content changes size or shape. It never waits on a frame — headless renders run out of frames once the page goes idle, and an unmeasured slide is indistinguishable from a clean one. The warning fires on the way in only, so one clipped slide is one line, not one per re-check — so authoring agents can assert `[data-overflow]` is absent in their headless verification (`decklight pdf` does this for a whole deck in one pass and names the offending slides). Overflow always goes **down**, never up: a slide centers its content with `safe center`, so content taller than the slide falls back to top alignment instead of overflowing symmetrically. Plain centering would push half the excess out of the top of the box, through the padding a pinned title reserves for itself, and render the first content element on top of the title.
|
|
479
479
|
- **Pinned titles**: `pinTitles: true | false | <px>` keeps slide titles at one vertical position instead of drifting with content height. **On by default** (`true`); `pinTitles: false` restores the drift-with-content centering deck-wide. `true` pins at **99px** from the stage top (design coordinates — the natural title position of the course's "The Single-Agent Limit" diagram slide, the chosen reference); a number pins at that Y. The leading `h1`/`h2` of each **pinnable** section is absolutely positioned at the pin Y; the section reserves `pin Y + measured title height + 18px` of top padding so the remaining content centers below. Pinnable = has a leading `h1`/`h2` AND content beyond it (`ul, ol, svg, pre, table, .terminal, img, .columns` outside the notes) — title cards and quote/statement slides stay centered. Per-slide: `data-pin` forces a pin (even when the config is off), `data-pin="none"` opts out, `data-pin="<px>"` overrides the Y. Titles are re-measured on `sync()` and when webfonts finish loading; print uses the same layout. A detected **subtitle** (DECK_ANATOMY) joins the pinned header block — absolutely positioned directly beneath the title (6px gap) and included in the reserved padding, so content centers below title + subtitle.
|
|
480
480
|
- **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.
|
|
@@ -986,7 +986,8 @@ export default function createEngine(opts) {
|
|
|
986
986
|
- **Author-time only.** Installing and configuring both happen through the
|
|
987
987
|
author server; `present` registers nothing that could reach either, and a
|
|
988
988
|
credential still comes from the wizard (`ENGINES#WIZARD`) and is still
|
|
989
|
-
|
|
989
|
+
stored restricted to the account that pasted it — the platform's own form of
|
|
990
|
+
that, named in `ENGINES#WIZARD` — never into a deck.
|
|
990
991
|
### ENGINE_PREREQUISITES — What an engine needs before a key is worth asking for
|
|
991
992
|
|
|
992
993
|
TTS made two failure states look like enough — "could not reach it" and "that
|
|
@@ -1078,6 +1079,17 @@ extend it — but an agent unit is a **descriptor, never code**:
|
|
|
1078
1079
|
preference does not quietly fall back to another one: the author server says
|
|
1079
1080
|
so once at startup, and `A` answers with a line naming what is missing, what
|
|
1080
1081
|
is available, and how to get it back.
|
|
1082
|
+
- **An agent is offered only if it can be RUN, and it is run as argv.** On
|
|
1083
|
+
Windows every agent that installs from npm lands as a `.cmd` batch shim, and
|
|
1084
|
+
Node refuses to spawn one without a shell. decklight does not turn one on:
|
|
1085
|
+
with a shell the arguments stop being arguments and become a command line for
|
|
1086
|
+
`cmd.exe` to re-split, and one of them is the user's prompt — `%VAR%` there
|
|
1087
|
+
is expanded before any escaping the caller could apply, so no quoting makes
|
|
1088
|
+
it safe. Instead the shim is resolved back to the script it runs and node is
|
|
1089
|
+
spawned on that, which keeps the guarantee above (argv is argv) identical on
|
|
1090
|
+
both platforms. A batch file that names no such script is **not offered at
|
|
1091
|
+
all** — detected-but-unrunnable is a worse answer than absent, and the
|
|
1092
|
+
refusal names the file rather than claiming the command is missing.
|
|
1081
1093
|
|
|
1082
1094
|
### VOICE_UNITS — Voices: a reference, never a payload
|
|
1083
1095
|
|
|
@@ -1140,8 +1152,9 @@ decklight/
|
|
|
1140
1152
|
browser: overflow.js (the guardrail's watch), playlist.js (module navigation), finder.js (the
|
|
1141
1153
|
finder's index + ranking), layout.js (the L ring + its write-through), palette.js (what a typed
|
|
1142
1154
|
string means), debuglog.js (the D ring buffer), overlay.js (backdrop, list selection, the
|
|
1143
|
-
typeahead keyboard), escape.js
|
|
1144
|
-
|
|
1155
|
+
typeahead keyboard), escape.js, motion.js (the duration, FLIP and transition-class decisions
|
|
1156
|
+
behind SLIDE_TRANSITIONS and AUTO_ANIMATE) — plus autoanimate, builds, print, svg, charts, media,
|
|
1157
|
+
speaker, annotate, character, character-art, devmode, themegen, voicetrack
|
|
1145
1158
|
src/math/ LaTeX math on data-math slides (Temml → MathML Core)
|
|
1146
1159
|
src/code/ highlight bundling + line stepping provider
|
|
1147
1160
|
src/terminal/ ansi.mjs (parser), player.mjs (provider + modes)
|
|
@@ -1156,7 +1169,9 @@ decklight/
|
|
|
1156
1169
|
loader.mjs + extension.mjs (build-time transforms and their admission gate), wizard.mjs (the
|
|
1157
1170
|
credential wizard, ENGINES#WIZARD), sign.mjs + deckfile.mjs + associate.mjs (signing, the
|
|
1158
1171
|
.decklight container, the double-click), audit.mjs (the ingredients label), serve.mjs (the server
|
|
1159
|
-
core), present.mjs, edit.mjs, dev.mjs, remote.mjs, agents.mjs (AI-agent roster)
|
|
1172
|
+
core), present.mjs, edit.mjs, dev.mjs, remote.mjs, agents.mjs (AI-agent roster), git.mjs (the
|
|
1173
|
+
autocommit decision table), update-check.mjs (the "a newer decklight exists" notice), qr.mjs,
|
|
1174
|
+
port-conflict.mjs, supervise.mjs, skill-content.mjs (the agent skill's shipped text)
|
|
1160
1175
|
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), 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), 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), visemes.mjs (timeline v1), video.mjs (deck → narrated mp4, PRESENTING)
|
|
1161
1176
|
themes/ 46 × <name>.css (the graded + reveal-compat sets; the homage packs moved to the
|
|
1162
1177
|
marketplace, THEME_DISTRIBUTION) + packs.json + gallery.html
|
package/cli/agents.mjs
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// small, closed vocabulary, and a template expresses all of them.
|
|
23
23
|
|
|
24
24
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
25
|
-
import {
|
|
25
|
+
import path, { dirname, join } from 'node:path';
|
|
26
26
|
import { configHome } from './marketplace.mjs';
|
|
27
27
|
import { listUnits } from './units.mjs';
|
|
28
28
|
|
|
@@ -117,20 +117,108 @@ export function installedAgents(home = configHome()) {
|
|
|
117
117
|
return out;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Where `bin` resolves — the file $PATH would find, or null.
|
|
122
|
+
*
|
|
123
|
+
* The Windows extension list is the one Windows itself searches, in its order,
|
|
124
|
+
* and the empty string is in it because a unit descriptor may name a file that
|
|
125
|
+
* genuinely has no extension. WHICH one matched is the thing this returns and
|
|
126
|
+
* `onPath` throws away, and it is exactly what `spawnSpec` below needs.
|
|
127
|
+
*/
|
|
128
|
+
export function whichBin(bin, env = process.env, platform = process.platform, exists = existsSync) {
|
|
129
|
+
if (!bin) return null;
|
|
123
130
|
// An explicit path, spelled either way — a Windows one carries backslashes,
|
|
124
131
|
// and treating it as a bare name would send it looking down $PATH instead.
|
|
125
|
-
if (bin.includes('/') || bin.includes('\\')) return
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
if (bin.includes('/') || bin.includes('\\')) return exists(bin) ? bin : null;
|
|
133
|
+
// PATH, whatever the case of the variable: Windows spells it `Path`, and a
|
|
134
|
+
// child env built by hand may carry either.
|
|
135
|
+
const list = env.PATH ?? env.Path ?? env.path ?? '';
|
|
136
|
+
// The path grammar of the platform being DESCRIBED, not the one running —
|
|
137
|
+
// test/soak-platform.mjs learned this the hard way. The host's `join` and
|
|
138
|
+
// `delimiter` would split a Windows PATH on `:` (cutting `C:` off the drive)
|
|
139
|
+
// and answer in the wrong separator, from a function whose whole contract is
|
|
140
|
+
// to be pure over its `platform` argument.
|
|
141
|
+
const p = platform === 'win32' ? path.win32 : path.posix;
|
|
142
|
+
const exts = platform === 'win32' ? ['.exe', '.cmd', '.bat', ''] : [''];
|
|
143
|
+
for (const dir of list.split(p.delimiter)) {
|
|
128
144
|
if (!dir) continue;
|
|
129
|
-
for (const ext of exts)
|
|
145
|
+
for (const ext of exts) {
|
|
146
|
+
const file = p.join(dir, bin + ext);
|
|
147
|
+
if (exists(file)) return file;
|
|
148
|
+
}
|
|
130
149
|
}
|
|
131
|
-
return
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Is `bin` on this machine at all? Detection, not runnability — see `canRun`. */
|
|
154
|
+
export function onPath(bin, env = process.env) {
|
|
155
|
+
return whichBin(bin, env) !== null;
|
|
132
156
|
}
|
|
133
157
|
|
|
158
|
+
/**
|
|
159
|
+
* The JS file a `.cmd`/`.bat` shim runs, or null if it does not run one.
|
|
160
|
+
*
|
|
161
|
+
* npm installs every JS CLI on Windows as a generated batch shim whose last
|
|
162
|
+
* line hands a script to node; `npx`, `pnpm` and this repo's own test stubs
|
|
163
|
+
* write the same shape with different spelling. So rather than pattern-match
|
|
164
|
+
* one vendor's template, this takes every JS-looking token in the file, expands
|
|
165
|
+
* whichever "the directory I am in" spelling it uses (`%~dp0`, `%dp0%`,
|
|
166
|
+
* `$basedir`), and returns the first that is really there. A batch file that
|
|
167
|
+
* names no such script is not a shim, and gets null.
|
|
168
|
+
*/
|
|
169
|
+
export function shimTarget(text, dir, { exists = existsSync, platform = process.platform } = {}) {
|
|
170
|
+
const p = platform === 'win32' ? path.win32 : path.posix;
|
|
171
|
+
for (const m of String(text).matchAll(/(?:"([^"\r\n]+?\.[cm]?js)"|(\S+?\.[cm]?js))(?=["\s]|$)/gi)) {
|
|
172
|
+
const token = (m[1] ?? m[2])
|
|
173
|
+
.replaceAll(/%~dp0\\?|%dp0%\\?|\$basedir\//gi, `${dir}${p.sep}`)
|
|
174
|
+
.replaceAll('"', '');
|
|
175
|
+
const file = p.resolve(dir, token);
|
|
176
|
+
// The existence check is what makes the loose match safe: npm's own
|
|
177
|
+
// template mentions `.JS` in a PATHEXT edit several lines above the one
|
|
178
|
+
// that matters, and no such file is ever on disk.
|
|
179
|
+
if (exists(file)) return file;
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* How to spawn `bin` AS ARGV — `{ bin, prefix }` — or null when this machine
|
|
186
|
+
* cannot run it that way.
|
|
187
|
+
*
|
|
188
|
+
* The whole point is that `shell` is never part of the answer. Since
|
|
189
|
+
* CVE-2024-27980 Node refuses to spawn a `.cmd` or `.bat` without `shell:
|
|
190
|
+
* true`, and turning that on would stop the arguments being arguments: they
|
|
191
|
+
* become one command line for `cmd.exe` to re-split, and one of them is the
|
|
192
|
+
* user's PROMPT — untrusted text that may hold `"`, `&`, `|`, `^` or `%VAR%`.
|
|
193
|
+
* `cmd.exe` quoting cannot make that safe (percent expansion happens before
|
|
194
|
+
* any escaping the caller can do), so decklight does not try: it resolves the
|
|
195
|
+
* shim to the script it would have run and spawns node on it directly. argv
|
|
196
|
+
* stays argv, on both platforms, and a prompt is never anything but one
|
|
197
|
+
* argument.
|
|
198
|
+
*
|
|
199
|
+
* A `.cmd` that is a real batch program rather than a shim resolves to null —
|
|
200
|
+
* DETECTED BUT NOT RUNNABLE is the state #307 is about, and reporting it as
|
|
201
|
+
* available is what made it a bug rather than a gap.
|
|
202
|
+
*/
|
|
203
|
+
export function spawnSpec(bin, {
|
|
204
|
+
env = process.env, platform = process.platform, node = process.execPath,
|
|
205
|
+
read = (f) => readFileSync(f, 'utf8'), exists = existsSync,
|
|
206
|
+
} = {}) {
|
|
207
|
+
const found = whichBin(bin, env, platform, exists);
|
|
208
|
+
if (!found) return null;
|
|
209
|
+
// POSIX is untouched: the name goes to spawn exactly as it always did, so
|
|
210
|
+
// $PATH resolution, shebangs and argv all behave as before.
|
|
211
|
+
if (platform !== 'win32') return { bin, prefix: [] };
|
|
212
|
+
const p = path.win32;
|
|
213
|
+
if (!/\.(cmd|bat)$/i.test(found)) return { bin: found, prefix: [] };
|
|
214
|
+
let target = null;
|
|
215
|
+
try { target = shimTarget(read(found), p.dirname(found), { exists, platform }); } catch { /* unreadable */ }
|
|
216
|
+
return target ? { bin: node, prefix: [target] } : null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Can an agent whose command is `bin` actually be run here? */
|
|
220
|
+
export const canRun = (bin, env = process.env) => spawnSpec(bin, { env }) !== null;
|
|
221
|
+
|
|
134
222
|
/**
|
|
135
223
|
* Every agent this machine can actually run, in preference order.
|
|
136
224
|
*
|
|
@@ -139,7 +227,7 @@ export function onPath(bin, env = process.env) {
|
|
|
139
227
|
* silently replacing how `claude` is invoked is not something a catalog
|
|
140
228
|
* should be able to do to a machine.
|
|
141
229
|
*/
|
|
142
|
-
export function detectAgents({ env = process.env, hasBin =
|
|
230
|
+
export function detectAgents({ env = process.env, hasBin = canRun, home } = {}) {
|
|
143
231
|
const builtIn = AGENTS.filter((a) => hasBin(a.bin, env));
|
|
144
232
|
const known = new Set(AGENTS.map((a) => a.name));
|
|
145
233
|
const extra = installedAgents(home).filter((a) => !known.has(a.name) && hasBin(a.bin, env));
|
|
@@ -174,15 +262,25 @@ export function setPreferredAgent(name, home = configHome()) {
|
|
|
174
262
|
* is not a substitutable detail, and one that quietly changed under a
|
|
175
263
|
* remembered preference would be the worst version of this feature.
|
|
176
264
|
*/
|
|
177
|
-
export function agentUnavailable(name, roster, home = configHome()
|
|
265
|
+
export function agentUnavailable(name, roster, home = configHome(),
|
|
266
|
+
{ env = process.env, spec = spawnSpec, platform = process.platform, exists = existsSync } = {}) {
|
|
178
267
|
const have = roster.length
|
|
179
268
|
? `available here: ${roster.map((a) => a.name).join(', ')}`
|
|
180
269
|
: 'no agent CLI is detected on this machine';
|
|
181
270
|
if (!name) return `${have} — install one (claude, codex, bob, …), or: decklight agent add <name>`;
|
|
182
|
-
const
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
271
|
+
const entry = AGENTS.find((a) => a.name === name) ?? installedAgents(home).find((a) => a.name === name);
|
|
272
|
+
if (!entry) return `no agent named "${name}" — ${have}; a marketplace can teach decklight a new one: decklight agent add ${name}`;
|
|
273
|
+
// Found but not runnable is its own answer, and it names the reason rather
|
|
274
|
+
// than the symptom: telling someone their agent "is not on PATH" while
|
|
275
|
+
// `where claude` prints a path is how #307 stayed invisible.
|
|
276
|
+
const where = whichBin(entry.bin, env, platform, exists);
|
|
277
|
+
if (where && !spec(entry.bin, { env, platform, exists })) {
|
|
278
|
+
return `"${name}" is installed at ${where}, but decklight cannot run it as a program: `
|
|
279
|
+
+ 'that file is a batch shim and the script it runs cannot be found. '
|
|
280
|
+
+ 'decklight will not hand your prompt to cmd.exe instead — reinstall the agent, '
|
|
281
|
+
+ `or point one at its real entry point: decklight agent add ${name}`;
|
|
282
|
+
}
|
|
283
|
+
return `"${name}" is known but its command is not on PATH — install it, or pick another (${have})`;
|
|
186
284
|
}
|
|
187
285
|
|
|
188
286
|
/**
|
|
@@ -191,7 +289,7 @@ export function agentUnavailable(name, roster, home = configHome()) {
|
|
|
191
289
|
* file it should edit. Returns { bin, args, label } or null when the agent
|
|
192
290
|
* isn't available.
|
|
193
291
|
*/
|
|
194
|
-
export function agentCommand(name, instruction, deck, { env = process.env, hasBin =
|
|
292
|
+
export function agentCommand(name, instruction, deck, { env = process.env, hasBin = canRun, home, spec = spawnSpec } = {}) {
|
|
195
293
|
const roster = detectAgents({ env, hasBin, home });
|
|
196
294
|
// Precedence, matching how every other saved choice resolves (PRESENTING):
|
|
197
295
|
// an explicit name > the remembered preference > the first detected agent.
|
|
@@ -204,5 +302,15 @@ export function agentCommand(name, instruction, deck, { env = process.env, hasBi
|
|
|
204
302
|
const prompt = `Edit the Decklight deck file "${deck}" — a single-file HTML presentation ` +
|
|
205
303
|
'(one top-level <section> per slide; see SPEC.md or the decklight skill if present). ' +
|
|
206
304
|
`Apply this change, editing the file in place: ${instruction}`;
|
|
207
|
-
|
|
305
|
+
// The spawn spec, not the bare name: on Windows an npm-installed agent is a
|
|
306
|
+
// batch shim, and `prefix` is the script node has to be handed for the
|
|
307
|
+
// arguments below to stay arguments (#307). On POSIX it is empty and this is
|
|
308
|
+
// the same command it always was.
|
|
309
|
+
const how = spec(agent.bin, { env }) ?? { bin: agent.bin, prefix: [] };
|
|
310
|
+
return {
|
|
311
|
+
bin: how.bin,
|
|
312
|
+
args: [...how.prefix, ...agent.args(prompt, deck)],
|
|
313
|
+
label: agent.label,
|
|
314
|
+
name: agent.name,
|
|
315
|
+
};
|
|
208
316
|
}
|
package/cli/decklight.mjs
CHANGED
|
@@ -129,8 +129,16 @@ const { version } = JSON.parse(
|
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
if (!cmd || cmd === '--help' || cmd === '-h') globalHelp();
|
|
132
|
+
// A newer decklight than the one npx pinned (#314). Read from a cache the last
|
|
133
|
+
// run left behind — never a fetch on this path — and written to stderr like the
|
|
134
|
+
// banner below, for the same reason: piped output stays clean.
|
|
135
|
+
const { updateNotice, refreshInBackground } = await import('./update-check.mjs');
|
|
136
|
+
const notice = updateNotice(version);
|
|
137
|
+
refreshInBackground();
|
|
138
|
+
|
|
132
139
|
if (cmd === '--version' || cmd === '-v' || cmd === 'version') {
|
|
133
140
|
process.stdout.write(`decklight ${version}\n`);
|
|
141
|
+
if (notice) process.stderr.write(`${notice}\n`);
|
|
134
142
|
process.exit(0);
|
|
135
143
|
}
|
|
136
144
|
if (cmd === 'help') {
|
|
@@ -142,6 +150,7 @@ if (cmd === 'help') {
|
|
|
142
150
|
// every real command announces the version it runs as — on stderr, so piped
|
|
143
151
|
// output (export, bundle) stays clean
|
|
144
152
|
process.stderr.write(`decklight ${version}\n`);
|
|
153
|
+
if (notice) process.stderr.write(`${notice}\n`);
|
|
145
154
|
|
|
146
155
|
// When a parent supervises us (author runs the deck server and the bridges), go when it
|
|
147
156
|
// goes — a SIGKILLed parent never gets to reap its children. No-op otherwise.
|
package/cli/edit.mjs
CHANGED
|
@@ -726,8 +726,16 @@ export async function editMain(args) {
|
|
|
726
726
|
}
|
|
727
727
|
// Redacted on the way out, always — the response is the one place a key
|
|
728
728
|
// could leak back into a page, a devtools log, or a screen recording.
|
|
729
|
-
console.log(` wizard: ${engine} configured (${r.file})`);
|
|
730
|
-
|
|
729
|
+
console.log(` wizard: ${engine} configured (${r.file} — ${r.protection.label})`);
|
|
730
|
+
// A key that could not be restricted is worth an extra line, at the
|
|
731
|
+
// moment it is stored rather than in a doc nobody reads (#308): what
|
|
732
|
+
// decklight says about a credential and what is true of it on disk
|
|
733
|
+
// have to be the same sentence.
|
|
734
|
+
if (r.protection.state !== 'private') {
|
|
735
|
+
console.log(` wizard: decklight could NOT restrict that file to your account — ${r.protection.label}`);
|
|
736
|
+
if (r.protection.why) console.log(` the system said: ${r.protection.why}`);
|
|
737
|
+
}
|
|
738
|
+
return json(200, { ok: true, state: r.state, engine, stored: r.stored, protection: r.protection.label });
|
|
731
739
|
}
|
|
732
740
|
if (req.method === 'POST' && url.pathname === '/edit/wizard/forget') {
|
|
733
741
|
const { engine } = JSON.parse(body);
|
package/cli/report-bug.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import { createRequire } from 'node:module';
|
|
|
25
25
|
import { isMain } from '../tools/args.mjs';
|
|
26
26
|
import { findChrome } from '../tools/chrome.mjs';
|
|
27
27
|
import { PKG } from './skill-content.mjs';
|
|
28
|
+
import { credentialsPath, protectionOf } from './wizard.mjs';
|
|
28
29
|
|
|
29
30
|
/** Is an optional dependency actually installed? Resolution only — never loaded. */
|
|
30
31
|
export function resolves(name, req = createRequire(import.meta.url)) {
|
|
@@ -38,13 +39,19 @@ export function resolves(name, req = createRequire(import.meta.url)) {
|
|
|
38
39
|
*/
|
|
39
40
|
export function probe({ platform = os.platform(), release = os.release(), arch = os.arch(),
|
|
40
41
|
node = process.version, chrome = findChrome(), pty = resolves('node-pty'),
|
|
41
|
-
version = PKG.version } = {}) {
|
|
42
|
+
version = PKG.version, credentials = protectionOf(credentialsPath()) } = {}) {
|
|
42
43
|
return {
|
|
43
44
|
decklight: version,
|
|
44
45
|
node,
|
|
45
46
|
os: `${platform} ${release} (${arch})`,
|
|
46
47
|
chrome: chrome ? `yes (${chrome})` : 'not found',
|
|
47
48
|
pty: pty ? 'installed' : 'not installed (terminal recording unavailable)',
|
|
49
|
+
// What is actually protecting any stored API key, read off the file rather
|
|
50
|
+
// than assumed from the platform (#308). Someone debugging a leaked key
|
|
51
|
+
// looks here first, and the value is a description of the protection —
|
|
52
|
+
// never a key, never an engine's answers, never even which engines are
|
|
53
|
+
// configured, since that is a list of what the user pays for.
|
|
54
|
+
credentials: credentials.label,
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
|
|
@@ -58,6 +65,7 @@ export function environmentBlock(facts) {
|
|
|
58
65
|
`- os: ${facts.os}`,
|
|
59
66
|
`- headless Chrome: ${facts.chrome}`,
|
|
60
67
|
`- node-pty: ${facts.pty}`,
|
|
68
|
+
`- stored credentials: ${facts.credentials}`,
|
|
61
69
|
].join('\n');
|
|
62
70
|
}
|
|
63
71
|
|
package/cli/skill-content.mjs
CHANGED
|
@@ -70,7 +70,7 @@ with a build and notes already wired):
|
|
|
70
70
|
</div>
|
|
71
71
|
\`\`\`
|
|
72
72
|
|
|
73
|
-
**CLI** (\`npx decklight <command>\`, no install needed):
|
|
73
|
+
**CLI** (\`npx decklight@latest <command>\`, no install needed):
|
|
74
74
|
- \`decklight author deck.html\` — the whole authoring loop: serve with live reload; **E** in the browser edits speaker notes back into the file
|
|
75
75
|
- \`decklight rec script.term.yaml\` — record a truthful terminal cast in a real PTY, for \`<div class="terminal">\`
|
|
76
76
|
- \`decklight bundle deck.html --themes all\` — flatten into one self-contained file to hand off or publish
|
|
@@ -84,7 +84,7 @@ browser. An agent authoring twenty slides in one pass never sees it, and ships
|
|
|
84
84
|
decks whose bottom lines are simply missing. One command checks all of them:
|
|
85
85
|
|
|
86
86
|
\`\`\`sh
|
|
87
|
-
npx decklight pdf deck.html -o /tmp/check.pdf
|
|
87
|
+
npx decklight@latest pdf deck.html -o /tmp/check.pdf
|
|
88
88
|
\`\`\`
|
|
89
89
|
|
|
90
90
|
Every \`⚠ slide N overflows\` line is a slide losing content: split it, cut it,
|
|
@@ -148,7 +148,7 @@ contract: builds, notes, SVG diagrams, themes, terminals, narration).
|
|
|
148
148
|
Read that file before adding or editing slides.
|
|
149
149
|
|
|
150
150
|
After editing slides, render the deck and check nothing is clipped:
|
|
151
|
-
\`npx decklight pdf deck.html -o /tmp/check.pdf\` — every \`⚠ slide N overflows\`
|
|
151
|
+
\`npx decklight@latest pdf deck.html -o /tmp/check.pdf\` — every \`⚠ slide N overflows\`
|
|
152
152
|
line is a slide losing content. Overflow is the late failure, though: a slide
|
|
153
153
|
that fits can still be too crowded, so keep to one idea and ~3–4 bullets per
|
|
154
154
|
column rather than to whatever renders.
|
|
@@ -159,7 +159,7 @@ change you finish rather than leaving it to the timer's generic \`autosave\`:
|
|
|
159
159
|
-d '{"message":"what this change did"}'\`. No server listening means no
|
|
160
160
|
authoring session — skip it and carry on.
|
|
161
161
|
|
|
162
|
-
Hit a Decklight bug? Run \`npx decklight report-bug\` for the environment
|
|
162
|
+
Hit a Decklight bug? Run \`npx decklight@latest report-bug\` for the environment
|
|
163
163
|
facts, then ask the user what happened, what they expected, and the smallest
|
|
164
164
|
repro — and show them the whole issue before filing anything.
|
|
165
165
|
${AGENTS_MARKER}
|
|
@@ -186,7 +186,7 @@ description: File a Decklight bug report — gather version and environment fact
|
|
|
186
186
|
Help the user file a bug report against Decklight that a triager can act on
|
|
187
187
|
without a round trip. Work in this order.
|
|
188
188
|
|
|
189
|
-
**1. Collect the machine facts.** Run \`npx decklight report-bug\`. It prints a
|
|
189
|
+
**1. Collect the machine facts.** Run \`npx decklight@latest report-bug\`. It prints a
|
|
190
190
|
markdown environment block and the issues URL and does nothing else — no
|
|
191
191
|
network, nothing sent. Use its output verbatim; do not retype it from memory.
|
|
192
192
|
|