decklight 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLATFORM.md +707 -0
- package/README.md +226 -150
- package/SPEC.md +803 -888
- package/cli/agent-review.mjs +246 -0
- package/cli/agents.mjs +35 -9
- package/cli/associate.mjs +12 -12
- package/cli/audit.mjs +42 -10
- package/cli/banner.mjs +41 -17
- package/cli/bundle-audio.mjs +190 -0
- package/cli/bundle-module.mjs +95 -0
- package/cli/bundle.mjs +439 -35
- package/cli/cast.mjs +48 -12
- package/cli/check-fixes.mjs +186 -0
- package/cli/check.mjs +988 -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 +51 -22
- package/cli/commit-message.mjs +51 -74
- package/cli/commit-split.mjs +601 -0
- package/cli/deck-refs.mjs +64 -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 +666 -0
- package/cli/design-system.mjs +497 -0
- package/cli/doctor.mjs +115 -0
- package/cli/edit-git.mjs +353 -0
- package/cli/edit-handover.mjs +551 -0
- package/cli/edit-look.mjs +631 -0
- package/cli/edit-slides.mjs +683 -0
- package/cli/edit.mjs +2585 -855
- package/cli/enhance.mjs +485 -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 +78 -11
- package/cli/import.mjs +56 -10
- package/cli/init.mjs +407 -236
- package/cli/library.mjs +127 -0
- package/cli/loader.mjs +3 -1
- package/cli/marketplace-autocheck.mjs +200 -0
- package/cli/marketplace.mjs +460 -29
- package/cli/narrate.mjs +251 -0
- package/cli/open-browser.mjs +63 -0
- package/cli/open.mjs +961 -0
- package/cli/pdf.mjs +64 -17
- package/cli/pkg.mjs +44 -2
- package/cli/plugin.mjs +43 -41
- package/cli/port-conflict.mjs +53 -23
- package/cli/pptx-export.mjs +63 -27
- package/cli/publish.mjs +8 -4
- package/cli/qr.mjs +1 -1
- package/cli/record.mjs +85 -23
- package/cli/remote.mjs +43 -17
- 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 +236 -45
- package/cli/setup.mjs +112 -0
- package/cli/sign.mjs +1 -1
- package/cli/skill-content.mjs +229 -35
- package/cli/skills.mjs +353 -26
- package/cli/start.mjs +110 -0
- package/cli/supervise.mjs +6 -6
- package/cli/theme-refs.mjs +527 -0
- package/cli/theme.mjs +181 -137
- package/cli/trust.mjs +83 -0
- package/cli/units.mjs +112 -47
- 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 +1533 -59
- package/dist/decklight.js +258 -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 +778 -0
- package/tools/design-system-migrations.mjs +207 -0
- package/tools/elevenlabs-tts.mjs +110 -17
- package/tools/exec.mjs +11 -3
- 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 +270 -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-clip.mjs +114 -0
- 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 +530 -54
- 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/docs/GLOSSARY.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Glossary
|
|
2
|
+
|
|
3
|
+
The words Decklight uses, each defined once. The README, the help and
|
|
4
|
+
`SPEC.md` use them in these senses. Where a SPEC section says more, its
|
|
5
|
+
mnemonic is named.
|
|
6
|
+
|
|
7
|
+
## Decks
|
|
8
|
+
|
|
9
|
+
**Deck.** One HTML file of slides: `<section>` children of a
|
|
10
|
+
`<div class="decklight">`. What you author is data: the slides plus one JSON
|
|
11
|
+
configuration block, with no runtime in the file (`DECK_ANATOMY`).
|
|
12
|
+
|
|
13
|
+
**Bundle.** The self-contained shape of a deck, for handing it over: the
|
|
14
|
+
runtime, stylesheet, themes, fonts and pictures embedded, so the file opens
|
|
15
|
+
from disk. `decklight bundle` writes it; `decklight upgrade --link` turns one
|
|
16
|
+
back into data.
|
|
17
|
+
|
|
18
|
+
**Publish.** Bundle a deck and push it somewhere with a URL: GitHub Pages,
|
|
19
|
+
Netlify, Vercel or a folder (`decklight publish`).
|
|
20
|
+
|
|
21
|
+
**Build.** One step of a slide revealed on the next advance, Keynote style;
|
|
22
|
+
`data-build` on a container makes each child a build (`BUILDS`).
|
|
23
|
+
|
|
24
|
+
**Notes.** The speaker notes, `<aside class="notes">`. They are also the
|
|
25
|
+
narration script. `[click]` cuts them into beats, one per build; `[pause]`
|
|
26
|
+
holds a beat of silence.
|
|
27
|
+
|
|
28
|
+
**Sources.** `<aside class="sources">`: what a slide stands on, named facts
|
|
29
|
+
and links, hidden on the slide and shown in the inspector (`SLIDE_SOURCES`).
|
|
30
|
+
|
|
31
|
+
**Layout.** How one slide places its content: `auto`, `centered`, `top`,
|
|
32
|
+
`split`. Cycled from the bar's Layout button and written as `data-layout`.
|
|
33
|
+
|
|
34
|
+
**Template.** A design system's slide: a structure with named **slots**. A
|
|
35
|
+
slide names it with `data-template` and fills the slots; the structure comes
|
|
36
|
+
from the design system when the deck renders (`DESIGN_SYSTEMS`). Not a layout.
|
|
37
|
+
|
|
38
|
+
## Opening a deck
|
|
39
|
+
|
|
40
|
+
**Write mode.** `decklight <deck.html>`: the deck served on this machine with
|
|
41
|
+
live reload, editing on, an AI agent on `A`, and every edit written to the
|
|
42
|
+
file. The default way to open a deck you wrote.
|
|
43
|
+
|
|
44
|
+
**No-trust mode.** `decklight <deck.html> --no-trust`: the same server for a
|
|
45
|
+
deck you did not write. Every edit route refuses, the deck is served under a
|
|
46
|
+
Content-Security-Policy, and the **ingredients label** (what the file would
|
|
47
|
+
execute) is printed first. `--audit` prints the label and exits.
|
|
48
|
+
|
|
49
|
+
**Lock.** Write mode with changes turned off, from the palette or the bar,
|
|
50
|
+
until it is unlocked. For presenting a deck you are also editing.
|
|
51
|
+
|
|
52
|
+
**Panel.** The one slot beside the slide. Notes, Inspector, Sources,
|
|
53
|
+
Comments and Agent share it, each a tab, in one remembered placement; the
|
|
54
|
+
inspector's HTML tab edits the slide's source there too.
|
|
55
|
+
|
|
56
|
+
**Palette.** `/`: every command, named `Category: name` (`Share: Export to
|
|
57
|
+
PDF…`), filtered as you type. The palette does a thing.
|
|
58
|
+
|
|
59
|
+
**Settings.** The palette's *Preferences: Settings…*: how the deck is set
|
|
60
|
+
up to show itself (clock, progress bar, captions, voice speed, the editing
|
|
61
|
+
bar, the arrows and slide number in fullscreen), each row read back from
|
|
62
|
+
what the deck remembers and changed with `⏎`.
|
|
63
|
+
|
|
64
|
+
## Voice
|
|
65
|
+
|
|
66
|
+
**Live voice.** Narration synthesized while the deck plays, through the
|
|
67
|
+
voice bridge a write-mode session starts.
|
|
68
|
+
|
|
69
|
+
**Track.** Narration recorded into a folder beside the deck, one file per
|
|
70
|
+
slide and per `[click]` beat, played back by the deck. `narration.files`
|
|
71
|
+
names it.
|
|
72
|
+
|
|
73
|
+
**Narrate.** Make a track: `decklight narrate <deck>` has an engine read the
|
|
74
|
+
notes; `--mic` has you read them, one beat at a time; `--face` gives the
|
|
75
|
+
track its lip-sync, so the character plays it with no bridge running.
|
|
76
|
+
|
|
77
|
+
**Engine.** A speech engine: six are built in (gemini, chirp, piper,
|
|
78
|
+
elevenlabs, and the system voice, `say` or `sapi`); more install into the
|
|
79
|
+
library.
|
|
80
|
+
|
|
81
|
+
**Setup.** `decklight setup voice` and `decklight setup face`: this
|
|
82
|
+
machine's voice and talking head, chosen once and saved. Every deck you open
|
|
83
|
+
uses them, and `decklight <deck>` asks nothing about them at startup.
|
|
84
|
+
|
|
85
|
+
**Character.** An animated narrator whose lips follow the voice, or a
|
|
86
|
+
talking head made from a photo or a clip of you.
|
|
87
|
+
|
|
88
|
+
## Recording a terminal
|
|
89
|
+
|
|
90
|
+
**Cast.** A truthful terminal recording: `decklight cast` runs a YAML script
|
|
91
|
+
in a real terminal and the deck replays it, typing and output. Not a video,
|
|
92
|
+
and not narration (`TERMINAL_RECORDINGS`).
|
|
93
|
+
|
|
94
|
+
## Sharing things between decks
|
|
95
|
+
|
|
96
|
+
**Marketplace.** A git repository with a catalog
|
|
97
|
+
(`.decklight/marketplace.json`) of themes, design systems, fonts and library
|
|
98
|
+
units. Registered with `decklight marketplace add`, read from a local cache:
|
|
99
|
+
registering is not fetching (`MARKETPLACE_REGISTRY`).
|
|
100
|
+
|
|
101
|
+
**Library.** What this machine installs from a marketplace for its own use,
|
|
102
|
+
under `~/.decklight/`: plugins, skills, importers, transforms, engines,
|
|
103
|
+
voices and agents. Managed with `decklight library add|remove|list|gate`.
|
|
104
|
+
Nothing in the library travels inside a deck.
|
|
105
|
+
|
|
106
|
+
**Plugin.** Presenter chrome from your library: a timer, a teleprompter.
|
|
107
|
+
Shown over any deck you open, in a sandboxed frame; never bundled.
|
|
108
|
+
|
|
109
|
+
**Reference.** How a deck uses a theme, a design system or a font from a
|
|
110
|
+
marketplace: it names it, and the server serves it in. `decklight theme add`,
|
|
111
|
+
`font add` and `design-system add` write the reference into the deck; a
|
|
112
|
+
bundle embeds what it references.
|
|
113
|
+
|
|
114
|
+
**Design system.** A company's look as a package: tokens, art, slide
|
|
115
|
+
templates and a palette, referenced by a deck (`DESIGN_SYSTEMS`).
|
|
116
|
+
|
|
117
|
+
**Palette of scales.** A design system's brand colours, each a scale of
|
|
118
|
+
weights (`blue-100` to `blue-1000`), and the themes it ships drawn only from
|
|
119
|
+
them (`BRAND_PALETTE`).
|
|
120
|
+
|
|
121
|
+
**Brand lock.** A deck on a design system that ships themes is held to them:
|
|
122
|
+
the picker lists only the brand's themes, the deck opens on one of them, and
|
|
123
|
+
`check` warns about a colour off the brand. `"brandThemesOnly": false` in the
|
|
124
|
+
configuration lifts it (`BRAND_PALETTE`).
|
|
125
|
+
|
|
126
|
+
**Role.** A named colour a design system declares (`text-accent`,
|
|
127
|
+
`surface-card`) and every one of its themes sets, read as
|
|
128
|
+
`var(--<prefix>color-<role>)`. On a brand deck with roles, slides and
|
|
129
|
+
components colour through them alone (`DESIGN_SYSTEM_ROLES`).
|
|
130
|
+
|
|
131
|
+
## Checking
|
|
132
|
+
|
|
133
|
+
**Check.** The deck lint: `decklight check <deck>` and the palette's *Check
|
|
134
|
+
deck…* say, slide by slide, what is clipped, crowded, missing, out of step or off the brand.
|
|
135
|
+
|
|
136
|
+
**Gate.** The admission gate a marketplace's CI runs before listing an entry:
|
|
137
|
+
`decklight theme gate`, `font gate`, `design-system gate`, and
|
|
138
|
+
`library gate transform|plugin`.
|
|
139
|
+
|
|
140
|
+
**Verify.** `npm run verify` in a checkout of Decklight itself: the headless
|
|
141
|
+
render assertions behind every change to the runtime.
|
package/docs/architecture.svg
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 560" font-family="-apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif">
|
|
2
2
|
<defs>
|
|
3
|
-
<marker id="arr" markerWidth="
|
|
4
|
-
<polygon points="0 0,
|
|
3
|
+
<marker id="arr" markerWidth="6" markerHeight="4" refX="5" refY="2" orient="auto">
|
|
4
|
+
<polygon points="0 0, 6 2, 0 4" fill="#8b90a3"/>
|
|
5
5
|
</marker>
|
|
6
|
-
<marker id="arrb" markerWidth="
|
|
7
|
-
<polygon points="0 0,
|
|
6
|
+
<marker id="arrb" markerWidth="6" markerHeight="4" refX="5" refY="2" orient="auto">
|
|
7
|
+
<polygon points="0 0, 6 2, 0 4" fill="#7c9cff"/>
|
|
8
8
|
</marker>
|
|
9
9
|
</defs>
|
|
10
10
|
|
|
11
11
|
<rect x="0" y="0" width="920" height="560" rx="14" fill="#14161d"/>
|
|
12
|
-
<text x="460" y="34" text-anchor="middle" font-size="17" font-weight="700" fill="#e8eaf2">Decklight
|
|
12
|
+
<text x="460" y="34" text-anchor="middle" font-size="17" font-weight="700" fill="#e8eaf2">Decklight: how it's put together</text>
|
|
13
13
|
|
|
14
14
|
<!-- ── authoring column ─────────────────────────────────────────── -->
|
|
15
15
|
<rect x="40" y="70" width="230" height="86" rx="10" fill="#24335c" stroke="#46567f" stroke-width="1.5"/>
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
<text x="155" y="136" text-anchor="middle" font-size="10.5" fill="#aeb4c6">one file, written by humans & agents</text>
|
|
19
19
|
|
|
20
20
|
<rect x="40" y="186" width="230" height="72" rx="10" fill="#23444d" stroke="#3f6a76" stroke-width="1.5"/>
|
|
21
|
-
<text x="155" y="212" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">theme.css
|
|
21
|
+
<text x="155" y="212" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">theme.css: 46 shipped themes</text>
|
|
22
22
|
<text x="155" y="232" text-anchor="middle" font-size="10.5" fill="#aeb4c6">one token contract (~50 vars)</text>
|
|
23
23
|
<text x="155" y="246" text-anchor="middle" font-size="10.5" fill="#aeb4c6">+ runtime generator (⌃T)</text>
|
|
24
24
|
|
|
25
25
|
<!-- ── browser runtime ──────────────────────────────────────────── -->
|
|
26
26
|
<rect x="330" y="70" width="330" height="240" rx="12" fill="#191c26" stroke="#7c9cff" stroke-width="2"/>
|
|
27
|
-
<text x="495" y="96" text-anchor="middle" font-size="13.5" font-weight="700" fill="#7c9cff">browser runtime
|
|
27
|
+
<text x="495" y="96" text-anchor="middle" font-size="13.5" font-weight="700" fill="#7c9cff">browser runtime: zero dependencies</text>
|
|
28
28
|
<text x="495" y="112" text-anchor="middle" font-size="10" fill="#8b90a3">dist/decklight.js + decklight.css · works on file://</text>
|
|
29
29
|
|
|
30
30
|
<g font-size="10.5" fill="#dfe3ee">
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
<!-- ── local servers ────────────────────────────────────────────── -->
|
|
42
42
|
<rect x="710" y="70" width="180" height="76" rx="10" fill="#274035" stroke="#43695a" stroke-width="1.5"/>
|
|
43
|
-
<text x="800" y="96" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">decklight
|
|
43
|
+
<text x="800" y="96" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">decklight talk.html</text>
|
|
44
44
|
<text x="800" y="114" text-anchor="middle" font-size="10.5" fill="#aeb4c6">watches the file · SSE reload</text>
|
|
45
45
|
<text x="800" y="130" text-anchor="middle" font-size="10.5" fill="#aeb4c6">E saves notes back to disk</text>
|
|
46
46
|
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
|
|
56
56
|
<!-- ── cli row ──────────────────────────────────────────────────── -->
|
|
57
57
|
<rect x="40" y="356" width="620" height="86" rx="10" fill="#52402a" stroke="#7d6544" stroke-width="1.5"/>
|
|
58
|
-
<text x="350" y="382" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">CLI
|
|
58
|
+
<text x="350" y="382" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">CLI: node, the only place with native deps</text>
|
|
59
59
|
<g font-size="10.5" fill="#efe9dd">
|
|
60
|
-
<rect x="58" y="396" width="130" height="30" rx="6" fill="#453722"/><text x="123" y="415" text-anchor="middle">cast
|
|
61
|
-
<rect x="200" y="396" width="130" height="30" rx="6" fill="#453722"/><text x="265" y="415" text-anchor="middle">refresh
|
|
62
|
-
<rect x="342" y="396" width="140" height="30" rx="6" fill="#453722"/><text x="412" y="415" text-anchor="middle">export
|
|
63
|
-
<rect x="494" y="396" width="148" height="30" rx="6" fill="#453722"/><text x="568" y="415" text-anchor="middle">bundle
|
|
60
|
+
<rect x="58" y="396" width="130" height="30" rx="6" fill="#453722"/><text x="123" y="415" text-anchor="middle">cast: real PTY casts</text>
|
|
61
|
+
<rect x="200" y="396" width="130" height="30" rx="6" fill="#453722"/><text x="265" y="415" text-anchor="middle">refresh: drift check</text>
|
|
62
|
+
<rect x="342" y="396" width="140" height="30" rx="6" fill="#453722"/><text x="412" y="415" text-anchor="middle">export: asciicast v2</text>
|
|
63
|
+
<rect x="494" y="396" width="148" height="30" rx="6" fill="#453722"/><text x="568" y="415" text-anchor="middle">bundle: one-file deck</text>
|
|
64
64
|
</g>
|
|
65
65
|
|
|
66
66
|
<!-- ── verification band ────────────────────────────────────────── -->
|
|
67
|
-
<!--
|
|
67
|
+
<!-- no-trust mode of the one server: the mode whose write
|
|
68
68
|
surface is a single sidecar file (SPEC REVIEW) -->
|
|
69
69
|
<rect x="710" y="356" width="180" height="86" rx="10" fill="#274035" stroke="#43695a" stroke-width="1.5"/>
|
|
70
|
-
<text x="800" y="382" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">decklight
|
|
70
|
+
<text x="800" y="382" text-anchor="middle" font-size="13" font-weight="700" fill="#e8eaf2">decklight talk.html --no-trust</text>
|
|
71
71
|
<text x="800" y="400" text-anchor="middle" font-size="10.5" fill="#aeb4c6">M leaves comments on a slide</text>
|
|
72
72
|
<text x="800" y="416" text-anchor="middle" font-size="10.5" fill="#aeb4c6">writes deck.review.jsonl only</text>
|
|
73
|
-
<text x="800" y="432" text-anchor="middle" font-size="10.5" fill="#aeb4c6">git carries it ·
|
|
73
|
+
<text x="800" y="432" text-anchor="middle" font-size="10.5" fill="#aeb4c6">git carries it · /deck/edit/* refuses</text>
|
|
74
74
|
<rect x="40" y="470" width="850" height="60" rx="10" fill="#1c2620" stroke="#39584a" stroke-width="1.5"/>
|
|
75
|
-
<text x="465" y="494" text-anchor="middle" font-size="12.5" font-weight="700" fill="#9fd6b4">verification
|
|
75
|
+
<text x="465" y="494" text-anchor="middle" font-size="12.5" font-weight="700" fill="#9fd6b4">verification: SPEC.md is the contract</text>
|
|
76
76
|
<text x="465" y="514" text-anchor="middle" font-size="10.5" fill="#8fae9c">WCAG contrast gates · R1–R8 palette rules · headless render assertions · property tests across seeds · data-overflow guardrail</text>
|
|
77
77
|
|
|
78
78
|
<!-- ── arrows ───────────────────────────────────────────────────── -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decklight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A presentation library designed to be authored by AI agents and humans alike: single-file decks, Keynote-style builds, theme-aware SVG diagrams, and truthful terminal recordings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/decklight.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"dist/",
|
|
14
14
|
"themes/",
|
|
15
15
|
"docs/",
|
|
16
|
-
"SPEC.md"
|
|
16
|
+
"SPEC.md",
|
|
17
|
+
"PLATFORM.md"
|
|
17
18
|
],
|
|
18
19
|
"homepage": "https://decklight.io",
|
|
19
20
|
"repository": {
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"agent"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
38
|
+
"site:voices": "node tools/site-voices.mjs",
|
|
37
39
|
"build": "node build.mjs",
|
|
38
40
|
"prepare": "npm run build",
|
|
39
41
|
"test": "node test/run.mjs",
|
package/themes/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Decklight themes
|
|
2
2
|
|
|
3
|
-
46 themes, one contract. A theme is **a single CSS file that defines tokens on `.decklight
|
|
3
|
+
46 themes, one contract. A theme is **a single CSS file that defines tokens on `.decklight`**; the
|
|
4
4
|
runtime (`dist/decklight.css`) owns all structure; themes own only color, type, and mood. Link exactly
|
|
5
5
|
one theme per deck:
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ Every theme must define **all** of these on `.decklight`:
|
|
|
21
21
|
| Type | `--font-body` `--font-heading` `--font-mono` `--heading-color` `--heading-weight` `--link` | font stacks must degrade offline |
|
|
22
22
|
| Accent | `--accent` `--accent-contrast` | contrast = text placed *on* the accent |
|
|
23
23
|
| Blocks | `--block-bg` `--block-border` `--block-radius` `--shadow` | `--block-border` is a full border value |
|
|
24
|
-
| Code | `--code-bg` `--code-fg` `--hl-keyword` `--hl-string` `--hl-number` `--hl-comment` `--hl-function` `--hl-type` `--hl-punct` | no separate highlighter themes
|
|
24
|
+
| Code | `--code-bg` `--code-fg` `--hl-keyword` `--hl-string` `--hl-number` `--hl-comment` `--hl-function` `--hl-type` `--hl-punct` | no separate highlighter themes: these are it |
|
|
25
25
|
| Diagram | `--d-stroke` `--d-text` `--d-muted` `--d-accent` `--d-fill-1…6` | inline SVGs authored with `var(--d-*)` restyle across all themes |
|
|
26
26
|
| Terminal | `--term-bg` `--term-fg` `--term-prompt` `--term-cursor` `--term-selection` + 16 × `--ansi-*` | the 16 ANSI names map recorded output to the theme |
|
|
27
27
|
| Builds (optional) | `--build-duration` `--dim-opacity` `--term-chrome` | `--term-chrome: none` hides the window chrome |
|
|
@@ -32,7 +32,7 @@ Every theme must define **all** of these on `.decklight`:
|
|
|
32
32
|
|
|
33
33
|
- `--fg`/`--bg` ≥ 4.5 · `--muted`, `--heading-color`, `--link`, `--d-text` ≥ 3.0 (gradient canvases: **every stop** must pass)
|
|
34
34
|
- `--code-fg` and all `--hl-*` ≥ 4.5 on `--code-bg` (`--hl-comment` ≥ 3.0)
|
|
35
|
-
- `--term-fg`, `--term-prompt`, and **all 16** `--ansi-*` ≥ 3.0 on `--term-bg
|
|
35
|
+
- `--term-fg`, `--term-prompt`, and **all 16** `--ansi-*` ≥ 3.0 on `--term-bg`, yes, including `--ansi-black` on dark terminals: recorded output must stay readable on a projector, so "black" is a visible gray
|
|
36
36
|
- `--accent-contrast` ≥ 4.5 on `--accent`
|
|
37
37
|
|
|
38
38
|
A PR that adds or edits a theme must keep the validator green.
|
|
@@ -40,7 +40,7 @@ A PR that adds or edits a theme must keep the validator green.
|
|
|
40
40
|
## Authoring a new theme
|
|
41
41
|
|
|
42
42
|
1. Copy the closest existing theme (dark → `fjord`, light → `porcelain`, gradient → `aurora`).
|
|
43
|
-
2. Rework **every** group
|
|
43
|
+
2. Rework **every** group: hue-rotating one palette produces a clone, not a theme. Decide the
|
|
44
44
|
personality first (one line, like the taglines below), then pick canvas → type → accent →
|
|
45
45
|
code mood → terminal mood in that order.
|
|
46
46
|
3. Fonts: system stacks preferred. A Google-font `@import` is allowed if the stack degrades
|
|
@@ -53,11 +53,12 @@ A PR that adds or edits a theme must keep the validator green.
|
|
|
53
53
|
|
|
54
54
|
**Dark (16):** aurora · graphite · obsidian · midnight · fjord · cosmos · ember · moss · velvet · carbon · synthwave · ink · eclipse · storm · ibm-modern · yamabuki
|
|
55
55
|
**Light (16):** porcelain · paper · meadow · glacier · citrus · dune · orchid · harvest · coastal · linen · berry · slate · latte · peony · mint · sepia
|
|
56
|
-
Plus the Classics pack (`packs.json` is the authoritative roster). The novelty and homage packs
|
|
57
|
-
Old Machines, TV Series, Movies
|
|
58
|
-
decklight/decklight-plugins-official`, MARKETPLACE.md `THEME_BROWSE#SPLIT`).
|
|
56
|
+
Plus the Classics pack (`packs.json` is the authoritative roster). The novelty and homage packs (
|
|
57
|
+
Old Machines, TV Series, Movies) moved to the marketplace (`decklight marketplace add
|
|
58
|
+
decklight/decklight-plugins-official`, MARKETPLACE.md `THEME_BROWSE#SPLIT`). While authoring they
|
|
59
|
+
are packs under `T` like any other; Space marks one for the deck to carry (SPEC `THEME_DISTRIBUTION`).
|
|
59
60
|
|
|
60
61
|
Serif-headed: moss, velvet, porcelain, dune, peony, sepia. Gradient canvases:
|
|
61
62
|
aurora, cosmos, synthwave, storm, coastal. Webfont-enhanced (all with offline fallbacks): carbon,
|
|
62
63
|
synthwave, porcelain, paper, peony, mint. Deliberately corporate-safe:
|
|
63
|
-
slate (and arguably graphite)
|
|
64
|
+
slate (and arguably graphite); the rest have opinions.
|
|
@@ -57,6 +57,16 @@
|
|
|
57
57
|
--d-fill-4: #e6e7da;
|
|
58
58
|
--d-fill-5: #e6d2db;
|
|
59
59
|
--d-fill-6: #c9e4e2;
|
|
60
|
+
/* nested tones (SVG_DIAGRAMS): the runtime's default steps a panel toward
|
|
61
|
+
the ink, and this mid-grey ink has no headroom over these pastels — so
|
|
62
|
+
nested boxes step toward the paper instead: still a clear step off the
|
|
63
|
+
panel, and clearer for the ink */
|
|
64
|
+
--d-fill-1-in: #fafaf8;
|
|
65
|
+
--d-fill-2-in: #f5efed;
|
|
66
|
+
--d-fill-3-in: #e7eef3;
|
|
67
|
+
--d-fill-4-in: #fbfbf9;
|
|
68
|
+
--d-fill-5-in: #f4ebef;
|
|
69
|
+
--d-fill-6-in: #ecf6f5;
|
|
60
70
|
|
|
61
71
|
/* ── terminal ───────────────────────────── */
|
|
62
72
|
--term-bg: #002b36;
|
package/tools/args.mjs
CHANGED
|
@@ -50,3 +50,23 @@ export function firstPositional(argv, valueFlags = []) {
|
|
|
50
50
|
*/
|
|
51
51
|
export const isMain = (metaUrl) =>
|
|
52
52
|
!!process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(metaUrl);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* A `--port` value as a number, or null when it is not one.
|
|
56
|
+
*
|
|
57
|
+
* Five servers read their port with `Number(opt('--port', dflt))` and handed
|
|
58
|
+
* the result straight to `server.listen`, so a typo'd flag reached the user as
|
|
59
|
+
* `RangeError [ERR_SOCKET_BAD_PORT] … Received type number (NaN)` and a Node
|
|
60
|
+
* stack — the shape of failure cli/util.mjs exists to prevent. 0 is a port:
|
|
61
|
+
* the OS picks one, which is how the tests bind without racing each other.
|
|
62
|
+
*/
|
|
63
|
+
export function parsePort(raw) {
|
|
64
|
+
// Number('') and Number(null) are both 0, which would make `--port` with
|
|
65
|
+
// nothing after it a request for an OS-assigned port instead of a mistake.
|
|
66
|
+
if (raw == null || String(raw).trim() === '') return null;
|
|
67
|
+
const n = Number(raw);
|
|
68
|
+
return Number.isInteger(n) && n >= 0 && n <= 65535 ? n : null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The refusal for a port that did not parse, spelled the same way everywhere. */
|
|
72
|
+
export const badPort = (flag, raw) => `${flag} wants a port number (0-65535), got ${JSON.stringify(String(raw))}`;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright 2026 Gilles Philippart
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// One write that is either the whole file or none of it.
|
|
5
|
+
//
|
|
6
|
+
// `writeFileSync` truncates first and then copies: for the length of that copy
|
|
7
|
+
// the file on disk is a PREFIX of what it is becoming, and a crash, a full
|
|
8
|
+
// disk or a kill -9 in that window leaves it that way. The edit server
|
|
9
|
+
// rewrites the deck on every keystroke-level edit — a note, a layout, an undo
|
|
10
|
+
// — so that window is open hundreds of times an authoring session, on the one
|
|
11
|
+
// file the whole talk is. A half-written deck is not a lost edit; it is a lost
|
|
12
|
+
// deck, and the version git has is an autosave old.
|
|
13
|
+
//
|
|
14
|
+
// So: write a sibling in the SAME directory, then rename it over the target.
|
|
15
|
+
// Rename is atomic within a filesystem, which is why the temp file cannot live
|
|
16
|
+
// in /tmp — a cross-device rename is a copy again, with the window back.
|
|
17
|
+
//
|
|
18
|
+
// This is also exactly the shape editors save in, which cli/edit.mjs's live
|
|
19
|
+
// reload already had to survive: it watches the DIRECTORY rather than the file
|
|
20
|
+
// for this reason (a path watch follows the inode a rename replaces). The temp
|
|
21
|
+
// name is deliberately not the deck's, so the watcher's `filename === deck`
|
|
22
|
+
// filter ignores the create and fires once, on the rename.
|
|
23
|
+
|
|
24
|
+
import { writeFileSync, renameSync, rmSync } from 'node:fs';
|
|
25
|
+
import { dirname, join, basename } from 'node:path';
|
|
26
|
+
import { randomBytes } from 'node:crypto';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Write `data` to `path` atomically: whole, or not at all.
|
|
30
|
+
*
|
|
31
|
+
* The temp sibling carries the pid and six random bytes, so two processes
|
|
32
|
+
* writing the same file at once cannot land on the same staging name and
|
|
33
|
+
* rename each other's half-written bytes into place. On any failure the temp
|
|
34
|
+
* file is removed and the error rethrown — the target is untouched, and the
|
|
35
|
+
* directory is not left holding litter that looks like a deck.
|
|
36
|
+
*/
|
|
37
|
+
export function writeFileAtomic(path, data) {
|
|
38
|
+
const tmp = join(dirname(path), `${basename(path)}.${process.pid}.${randomBytes(6).toString('hex')}.tmp`);
|
|
39
|
+
try {
|
|
40
|
+
writeFileSync(tmp, data);
|
|
41
|
+
renameSync(tmp, path);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
// force: the failure may BE that the temp file was never created, and a
|
|
44
|
+
// cleanup that throws would replace the real error with its own.
|
|
45
|
+
try { rmSync(tmp, { force: true }); } catch { /* nothing more to do about it */ }
|
|
46
|
+
throw e;
|
|
47
|
+
}
|
|
48
|
+
}
|