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/PLATFORM.md
ADDED
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
# Decklight: Platform contract
|
|
2
|
+
|
|
3
|
+
The half of the contract that is not about writing a deck: how a marketplace
|
|
4
|
+
is registered and read, and how the units your library installs from one
|
|
5
|
+
(skills, import adapters, build-time transforms, speech engines, agents,
|
|
6
|
+
voices) are pinned, checked and run. [`SPEC.md`](SPEC.md) is the authoring
|
|
7
|
+
contract, and the one an agent writing slides reads; this file was split out
|
|
8
|
+
of it because it was 640 lines, longer than every authoring section combined,
|
|
9
|
+
read by agents that only ever write slides.
|
|
10
|
+
|
|
11
|
+
**Sections are named, not numbered**, as in `SPEC.md`: cite them by mnemonic.
|
|
12
|
+
|
|
13
|
+
| Mnemonic | Section |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `MARKETPLACE_REGISTRY` · `UNIT_VERSIONS` | catalogs: registered, not fetched; what you installed, and what the catalog has newer |
|
|
16
|
+
| `UNIT_COMPAT` · `UNIT_PINNING` | compat for code-carrying units, and the digest pin they install against |
|
|
17
|
+
| `EXTENSIONS_TRANSFORMS` · `EXTENSIONS_CHECK` · `EXTENSIONS_ADAPTERS` | the transform calling convention, its admission gate, and import adapters |
|
|
18
|
+
| `ENGINE_UNITS` · `ENGINE_PREREQUISITES` | the speech-engine factory contract, and what an engine needs before a key is worth asking for |
|
|
19
|
+
| `AGENT_UNITS` · `VOICE_UNITS` | agents as descriptors, voices as references |
|
|
20
|
+
|
|
21
|
+
Themes, design systems and fonts also come from a marketplace, but a deck
|
|
22
|
+
references them, so their contracts stay in `SPEC.md` (`THEME_DISTRIBUTION`,
|
|
23
|
+
`DESIGN_SYSTEMS`, `FONTS`).
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## MARKETPLACE_REGISTRY · Marketplaces: registered, not fetched
|
|
28
|
+
|
|
29
|
+
A marketplace is a git repo (or a local directory) with
|
|
30
|
+
`.decklight/marketplace.json` at its root, decentralized, no central registry,
|
|
31
|
+
mirroring Claude Code's layout deliberately (MARKETPLACE.md MARKETPLACES). The
|
|
32
|
+
manifest names the catalog and its entries:
|
|
33
|
+
|
|
34
|
+
**Which ref.** `add` and `update` take `--branch <ref>`, and it accepts a **tag**
|
|
35
|
+
as readily as a branch: a tag is how a catalog gets pinned to a version known
|
|
36
|
+
to work. Without it the shallow clone follows the remote's own `HEAD`, so
|
|
37
|
+
nothing here has ever assumed `main` or `master` and a repo whose default is
|
|
38
|
+
`trunk` always worked; what was missing was any way to ask for a ref that is not
|
|
39
|
+
the default. The ref is **remembered in the registry**, so `update` re-clones the
|
|
40
|
+
same one, a pin that a refresh silently abandoned would be decoration, and
|
|
41
|
+
`update --branch` is how the pin is deliberately moved. `list` shows it as
|
|
42
|
+
`#ref` beside the `@commit`, because the two answer different questions: the ref
|
|
43
|
+
is what you asked for and what the next update will fetch, the commit is where
|
|
44
|
+
that ref happened to point. A ref is validated against an allowlist before it
|
|
45
|
+
reaches the command line, since a value beginning with `-` is an option rather
|
|
46
|
+
than a ref; a full commit SHA is refused with its own message, because
|
|
47
|
+
`--branch` takes a ref and a bare object name is not one: fetching a commit
|
|
48
|
+
means a second round trip and a checkout, which is a different shape from the
|
|
49
|
+
single shallow clone. `--branch` against a **local** directory is an error, not
|
|
50
|
+
a no-op: a directory has no refs to choose between, and accepting the flag
|
|
51
|
+
while ignoring it would look exactly like success.
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"name": "nord-pack",
|
|
56
|
+
"description": "cool blues",
|
|
57
|
+
"entries": [
|
|
58
|
+
{ "name": "nord-deep", "type": "theme", "source": "./themes/nord-deep.css", "description": "deep blues" }
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`name` and each entry's `name`/`type`/`source` are required (`description`
|
|
64
|
+
optional; versions and compat ranges arrive with code-carrying extensions:
|
|
65
|
+
versions for code, none for data, see `UNIT_COMPAT`). The one exception is a reference-only kind,
|
|
66
|
+
which carries no `source` because it carries nothing at all, see `VOICE_UNITS`. A malformed manifest is refused **naming the
|
|
67
|
+
line and the field** (`line 7: entries[1].type — missing`), never with a stack
|
|
68
|
+
trace: a typo in somebody's catalog is not an internal error.
|
|
69
|
+
|
|
70
|
+
**A kind may declare extra required fields, and an unknown kind is accepted
|
|
71
|
+
rather than refused.** An `importer` entry must carry `extensions`: the file
|
|
72
|
+
extensions its adapter reads, because that is what lets `decklight import
|
|
73
|
+
talk.marp` name the adapter **from the cache, offline**; an adapter whose
|
|
74
|
+
extensions were only discoverable by installing it could never be offered at
|
|
75
|
+
the moment it is needed. A `type` this decklight does not know is *not* an
|
|
76
|
+
error: a catalog is a file someone else wrote, quite possibly against a newer
|
|
77
|
+
version, and refusing the whole manifest over one unrecognised kind would make
|
|
78
|
+
every catalog un-addable the day it grows an entry. `marketplace list` groups
|
|
79
|
+
entries by kind and prints the install command for each, so an unknown kind
|
|
80
|
+
reads as "not yet" rather than as a typo; the two must never look alike.
|
|
81
|
+
|
|
82
|
+
`decklight marketplace add <owner/repo | git url | path>` reads the manifest at
|
|
83
|
+
the source's root and registers the catalog; `list`, `update <name>` and
|
|
84
|
+
`remove <name>` complete the roster. State lives under `~/.decklight/`
|
|
85
|
+
(`DECKLIGHT_HOME` overrides): one registry file, `marketplaces.json`, plus a
|
|
86
|
+
`marketplaces/` directory holding, per marketplace, its cached manifest
|
|
87
|
+
(`<name>.json`) and the checkout that manifest came with (`<name>/`), the
|
|
88
|
+
config home the engine wizard (MARKETPLACE.md ENGINES) shares.
|
|
89
|
+
|
|
90
|
+
**A remote marketplace is read by cloning it** (MARKETPLACE.md
|
|
91
|
+
`MARKETPLACES#CLONE`), never by fetching one file at a time off a raw-content
|
|
92
|
+
host, and `owner/repo` is shorthand for that clone rather than for a URL. Three
|
|
93
|
+
things follow, and each was a bug before it did. A clone uses **the caller's own
|
|
94
|
+
git credentials**, so a marketplace in a private repo works exactly as `git
|
|
95
|
+
clone` does in that terminal: a credential helper for HTTPS (`gh auth
|
|
96
|
+
setup-git`, the macOS Keychain), or the SSH form of the URL; an anonymous fetch
|
|
97
|
+
had none, so a private catalog could register and then 404 on every install.
|
|
98
|
+
The manifest and every entry's bytes come from **one commit**, recorded in the
|
|
99
|
+
registry and printed by `list`, where fetching each artifact separately at
|
|
100
|
+
`HEAD` could produce an install matching no single commit of the marketplace.
|
|
101
|
+
And because the clone is kept (`~/.decklight/marketplaces/<name>/`, its `.git`
|
|
102
|
+
dropped, replaced wholesale by the next `update` and removed by `remove`),
|
|
103
|
+
**installing an entry reads the disk**, not the network. A local-path
|
|
104
|
+
marketplace keeps no checkout: its own directory already is one. An entry whose
|
|
105
|
+
`source` is an absolute `https://` URL (a gist, a release asset) is still
|
|
106
|
+
fetched as written.
|
|
107
|
+
|
|
108
|
+
**The invariant everything above serves: registering is not fetching.** The
|
|
109
|
+
network is touched only by an explicit `add`, `update` or `outdated` of a
|
|
110
|
+
remote source (and `outdated` only asks where a ref points; it fetches no
|
|
111
|
+
file; the auto-check the author turned on is that same `outdated`): never at
|
|
112
|
+
registration, never when a deck loads, never while presenting. The
|
|
113
|
+
first-party marketplace is registered on first CLI run as a pure filesystem
|
|
114
|
+
write; its first fetch happens at the first browse or `update`, so first run
|
|
115
|
+
offline is silent and instant, and a deck on conference wifi, on a plane, or
|
|
116
|
+
air-gapped behaves identically to one at a desk. Nothing on the deck-load or
|
|
117
|
+
presenting path imports the marketplace module at all (pinned by
|
|
118
|
+
`test/marketplace.test.mjs`). Offline is a first-class state, not an error
|
|
119
|
+
state: `list` reads only the cache, and a fetch failure is fast and names the
|
|
120
|
+
marketplace and the reason, no spinner, no hang.
|
|
121
|
+
|
|
122
|
+
**The in-deck door.** In write mode, `/` → **Marketplaces…** lists every
|
|
123
|
+
registered catalog, says which are behind their source, updates them and says
|
|
124
|
+
what's new, and registers a new one without leaving the deck (SPEC
|
|
125
|
+
`MARKETPLACES_SCREEN` has the flow). Checking, updating and adding each run the
|
|
126
|
+
`decklight marketplace` command (`outdated`, `update`, `add`) as a child
|
|
127
|
+
process. Checking is the one network act that fetches nothing: `outdated` asks
|
|
128
|
+
each remote where its ref points (`git ls-remote`) and compares a local
|
|
129
|
+
directory's manifest with the cached copy, and it runs only when asked: C on
|
|
130
|
+
the screen, or, once the author has turned on *Check for updates when decklight
|
|
131
|
+
starts* (off until then), an edit server as it starts, at most twice a day.
|
|
132
|
+
Either way it only ever offers; an update is still asked for. Adding takes the
|
|
133
|
+
same three forms and `--branch`, and the edit server runs **`decklight marketplace add`
|
|
134
|
+
itself**, as a child process: the same command, the caller's git credentials on
|
|
135
|
+
this machine, the same refusals, so `marketplace list` cannot tell which door a
|
|
136
|
+
marketplace came in by, and a failed add leaves nothing registered from either.
|
|
137
|
+
It is still an explicit act, and still the only fetch: the row says what it is
|
|
138
|
+
about to clone (or which directory it would read in place) and asks for a
|
|
139
|
+
second ⏎ before it does, as publish does, since a clone is network access as
|
|
140
|
+
the person. A relative path is the **deck's** folder's, registered as an
|
|
141
|
+
absolute one, because the registry keeps a source as given and a relative path
|
|
142
|
+
would mean something else to the next `update`. Nothing is fetched on a later
|
|
143
|
+
open. A deck opened `--no-trust` has neither the row nor the routes
|
|
144
|
+
(`GET /deck/edit/marketplaces`, `POST /deck/edit/marketplace/check`,
|
|
145
|
+
`/update` and `/add`), which sit behind the server's mode gate with every
|
|
146
|
+
other write.
|
|
147
|
+
|
|
148
|
+
**The unit library** (`UNITS#REST`) is where the installable kinds land:
|
|
149
|
+
`~/.decklight/skills/`, `.../importers/`, `.../voices/`,
|
|
150
|
+
beside the `plugins/` that `NO_TRUST#PLUGINS` writes. One seam installs all of
|
|
151
|
+
them (`decklight library add <kind>`: `skill`, `importer`, `voice`, …), and
|
|
152
|
+
each is used by the command that needs it. A deck template, a whole deck installed to scaffold from or take slides out of, was a kind here until 0.9.0 and is gone: a design system's slide templates (`DESIGN_SYSTEMS`) are what a slide borrows now, by reference, never by copy.
|
|
153
|
+
|
|
154
|
+
A marketplace skill installs
|
|
155
|
+
into the library and therefore sits **alongside** the authoring skill
|
|
156
|
+
`decklight skills` writes into a project, never replacing it. Its consumer is
|
|
157
|
+
an agent, not a decklight command, and no agent reads `~/.decklight/skills/`,
|
|
158
|
+
so `library add skill` also **hands it on** to the agents `decklight skills`
|
|
159
|
+
writes for: a copy in `.claude/skills/<name>/` (the current directory's when
|
|
160
|
+
it already has a `.claude/` or a Decklight AGENTS.md, `--dir` for a named
|
|
161
|
+
project, `--global` for Claude's config home; run anywhere else, it copies
|
|
162
|
+
nothing and says how to), and a line naming it and its `SKILL.md` in every
|
|
163
|
+
AGENTS.md that carries the Decklight section. A copy
|
|
164
|
+
carries a `.decklight-library` mark, and only a marked directory is ever
|
|
165
|
+
replaced or removed, so a skill of the same name the author wrote is left
|
|
166
|
+
alone. `library remove skill` takes both away; `decklight skills` and `init`
|
|
167
|
+
copy the missing ones and keep the rest as they are. The authoring skill
|
|
168
|
+
itself says where installed skills live, so an agent with neither still finds
|
|
169
|
+
them. An import adapter
|
|
170
|
+
is **offered at the point of failure**: `decklight import talk.marp` names the
|
|
171
|
+
adapter that reads `.marp` and how to get it, which is the ENGINES pattern
|
|
172
|
+
(offer at the moment of need) rather than a setup step nobody performs in
|
|
173
|
+
advance. Installing an adapter does not yet make it *run*: executing a
|
|
174
|
+
marketplace module is `EXTENSIONS#TRANSFORMS`, and until that lands `import`
|
|
175
|
+
says so plainly instead of failing in a way that reads like a bug.
|
|
176
|
+
|
|
177
|
+
### UNIT_VERSIONS · What you installed, and what the catalog has newer
|
|
178
|
+
|
|
179
|
+
Every marketplace entry (a theme, a template, a skill, a plugin, any kind, with code or without) may carry its own **semver `version`** (`"1.1.0"`; SemVer 2.0.0 exactly, prerelease and build metadata allowed, no leading `v`). It is **optional**: a catalog without versions validates as it always did. One that is not semver is refused with the field named: `line 7: entries[1].version — "v1.1" — a semver version, major.minor.patch (e.g. "1.1.0"), no leading v`, because "is this newer than what I have" needs real precedence, not a guess (`cli/marketplace.mjs` `SEMVER_RE`, `semverCompare`: numbers numerically, a prerelease before its release, build metadata ignored). This is Claude Code's model, where a plugin that is only skills still has releases.
|
|
180
|
+
|
|
181
|
+
Three versions, three questions, never confused: an entry's **`version`** is a catalog/install fact: what an install took and whether the catalog now offers newer; **`apiVersion`** (`UNIT_COMPAT`) is the calling convention a code entry needs, checked for compatibility; **decklight's package version** is decklight's, and says nothing about any entry.
|
|
182
|
+
|
|
183
|
+
**Every kind's `add` records what it took** in `~/.decklight/installed.json`: one record per `type:name@marketplace` with the entry's `version` (null when it carries none), the marketplace **commit** its files came from, and when. `theme add` records too: it marks a theme in a deck, and the ledger is what remembers the version it marked. `remove` of an installed unit or plugin forgets the record. **Re-running the kind's `add` takes the newer version and records it**: the ledger is overwritten, nothing else is learned.
|
|
184
|
+
|
|
185
|
+
**`decklight marketplace list`** shows each entry's version, and for one you installed, what you have against what is offered: `nord@acme 1.0.0 installed`, `confluent-devrel@decklight-confluent 1.0.0 → 1.1.0`. **`decklight marketplace update <name>`**, after refreshing the catalog, names every entry you installed from it that is now newer and the one command that takes it (`nord@acme 1.0.0 → 1.1.0 — decklight theme add nord@acme <deck>`) and **installs nothing itself**: an update refreshes the catalog; taking a new version stays your call. An install recorded before its entry carried a version reads `unversioned → 1.1.0`.
|
|
186
|
+
|
|
187
|
+
**Decks are never touched by any of this.** A deck holds a *mark* (`markedThemes`), never a version; a theme already inline in a deck and every bundled deck stay byte-for-byte what they were: bundles are frozen on purpose (`THEME_DISTRIBUTION`). The update path is the installed unit, not the deck. Nothing here reaches the network either: `list` reads the ledger and the cache, and `update` fetches only what it always fetched.
|
|
188
|
+
|
|
189
|
+
### UNIT_COMPAT · Compat for code-carrying units: an API version, not an engine version
|
|
190
|
+
|
|
191
|
+
A build-time transform (and, later, an executed import adapter) is Node code,
|
|
192
|
+
so its catalog entry declares a version, unlike a theme or a voice, which
|
|
193
|
+
carry none. What that version is checked *against* is deliberately **not**
|
|
194
|
+
decklight's own package version:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{ "name": "grammar-check", "type": "transform", "source": "./grammar.mjs", "apiVersion": 1 }
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Why not decklight's version.** `src/core/engine.js` has been split apart
|
|
201
|
+
repeatedly (four feature modules pulled out in one PR alone) without any of
|
|
202
|
+
those reorganisations ever being a promise to anyone outside the repo. Pinning
|
|
203
|
+
a transform's compatibility to decklight's package version would tie it to
|
|
204
|
+
that same internal churn: a patch release could break every installed
|
|
205
|
+
transform for a reason the transform never touched.
|
|
206
|
+
|
|
207
|
+
**The alternative:** `apiVersion` names a version of the transform *invocation
|
|
208
|
+
contract* alone: the narrow "HTML in, HTML out" calling convention
|
|
209
|
+
`EXTENSIONS#TRANSFORMS` declares, and that number moves the way
|
|
210
|
+
`CAST_FORMAT`'s `decklightCast` does: **additive only**, bumped only when the
|
|
211
|
+
calling convention itself would break an existing transform, never for an
|
|
212
|
+
internal reorganisation elsewhere in the codebase. A transform declares the
|
|
213
|
+
lowest contract version it needs; decklight is compatible with anything at or
|
|
214
|
+
below its own `TRANSFORM_API_VERSION` (`cli/marketplace.mjs`), because nothing
|
|
215
|
+
additive-only ever removes what an older transform relied on.
|
|
216
|
+
|
|
217
|
+
**Validated for shape, not for currency.** `apiVersion` must be a positive
|
|
218
|
+
integer: that is checked the moment a catalog is registered (`marketplace
|
|
219
|
+
add`/`update`), by the same `ENTRY_SHAPES` mechanism that requires an
|
|
220
|
+
`importer`'s `extensions`. It is never refused merely for naming a version
|
|
221
|
+
ahead of what this decklight currently implements: a catalog is a file someone
|
|
222
|
+
else wrote, quite possibly against a newer decklight, and the same reasoning
|
|
223
|
+
that leaves an unrecognised `type` accepted rather than refused applies here
|
|
224
|
+
too. Whether a *particular* transform can actually run on *this* decklight is
|
|
225
|
+
answered by the loader (`EXTENSIONS#LOADER`, `cli/loader.mjs`): this section
|
|
226
|
+
only settled what it checks against; running an installed import adapter
|
|
227
|
+
(`EXTENSIONS#ADAPTEREXEC`) still owes the same question on that surface.
|
|
228
|
+
|
|
229
|
+
### UNIT_PINNING · Code-carrying units install pinned, or not at all
|
|
230
|
+
|
|
231
|
+
A `transform` or `importer` entry carries the SHA-256 of its module file's
|
|
232
|
+
bytes, lowercase hex, exactly as `sha256sum` prints it:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{ "name": "grammar-check", "type": "transform", "source": "./grammar.mjs",
|
|
236
|
+
"apiVersion": 1, "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" }
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Why the pin exists.** An entry's relative `source` resolves against the
|
|
240
|
+
marketplace's checkout, cloned at whatever the default branch pointed to when
|
|
241
|
+
`add`/`update` ran (`resolveSource`; no branch name is guessed at), so the
|
|
242
|
+
bytes an install writes are whatever the file said at that moment, not
|
|
243
|
+
whatever it said when the marketplace admitted the entry (`EXTENSIONS_CHECK`).
|
|
244
|
+
Cloning closed the narrower gap of manifest and artifact disagreeing with each
|
|
245
|
+
other; it cannot close this one, which is between the admission and the
|
|
246
|
+
install. For a theme that gap is closed by the THEMING contract itself,
|
|
247
|
+
run when a theme is marked and again wherever a marked theme is served or
|
|
248
|
+
bundled (THEME_DISTRIBUTION); for Node code the loader runs
|
|
249
|
+
unsandboxed at author privilege (`EXTENSIONS_TRANSFORMS`,
|
|
250
|
+
`EXTENSIONS_ADAPTERS`) there is no equivalent re-check: the digest is what
|
|
251
|
+
makes the code that installs the code that was screened.
|
|
252
|
+
|
|
253
|
+
**A content digest, not a commit SHA.** A commit pin only reaches sources a
|
|
254
|
+
host can serve by commit, and verifying it means trusting that host; a digest
|
|
255
|
+
of the bytes holds identically for a raw URL, a git URL and a local
|
|
256
|
+
directory, and holds against the math rather than the server. `decklight
|
|
257
|
+
extension check` prints the digest on a pass, so the gate that admits a
|
|
258
|
+
submission also emits the pin its catalog entry carries; `sha256sum
|
|
259
|
+
<file>` produces the same value.
|
|
260
|
+
|
|
261
|
+
**Enforced at install, with two named refusals** (`cli/units.mjs`).
|
|
262
|
+
`decklight library add transform` / `importer add` refuse a pinned kind's entry that
|
|
263
|
+
carries no `sha256` (*before* anything is fetched, since without a pin there
|
|
264
|
+
is no fact to hold the fetched bytes to) and refuse a fetched module whose
|
|
265
|
+
digest does not match, *before* anything is written, naming both digests. A
|
|
266
|
+
mismatch means the file changed since the catalog was cached: possibly a
|
|
267
|
+
legitimate re-pin (`marketplace update <name>` and try again), possibly the
|
|
268
|
+
exact substitution the pin exists to stop; either way nothing lands in the
|
|
269
|
+
library, the same fetch-first-write-second rule every other refusal there
|
|
270
|
+
keeps.
|
|
271
|
+
|
|
272
|
+
**Validated for shape when present, required only at install.** The same
|
|
273
|
+
split `apiVersion` already made (`UNIT_COMPAT`): a *malformed* `sha256` fails
|
|
274
|
+
`marketplace add` naming the line and the field, but an *absent* one does not
|
|
275
|
+
invalidate the manifest: refusing a whole catalog over one unpinned
|
|
276
|
+
transform would cost its theme entries too, the blast-radius reasoning that
|
|
277
|
+
already leaves an unknown `type` accepted. The refusal lands at the one
|
|
278
|
+
moment the risk does: installing the executable entry.
|
|
279
|
+
|
|
280
|
+
**What is deliberately not pinned.** Data kinds (themes, skills)
|
|
281
|
+
install unpinned: nothing in them executes, and a theme re-passes its whole
|
|
282
|
+
contract at install. A unit placed in the library by hand still runs
|
|
283
|
+
(`EXTENSIONS#LOADER`'s decision, unchanged): the pin governs what an
|
|
284
|
+
*install* may write into the library, and the trust model for *running* what
|
|
285
|
+
is there stays `EXTENSIONS_TRANSFORMS`'s: the installer is the risk-bearer.
|
|
286
|
+
|
|
287
|
+
### EXTENSIONS_TRANSFORMS · Build-time transforms: the v1 contract
|
|
288
|
+
|
|
289
|
+
A transform is a single file, `transform.mjs`, exporting one function:
|
|
290
|
+
|
|
291
|
+
```js
|
|
292
|
+
export default async function transform(html, opts) {
|
|
293
|
+
return html; // HTML in, HTML out (MARKETPLACE.md EXTENSIONS) — nothing else crosses
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
- **`html` is the deck's own source**: the file as the author wrote it,
|
|
298
|
+
*before* `bundle` inlines themes, images, casts or narration. A transform
|
|
299
|
+
compiling `<pre class="mermaid">…</pre>` into inline SVG needs the markup
|
|
300
|
+
the author wrote, not decklight's own runtime already spliced in; running
|
|
301
|
+
before that inlining also keeps a transform's test fixture small (a
|
|
302
|
+
two-line HTML snippet, not a full bundled deck) and keeps decklight's own
|
|
303
|
+
inlining regexes untouched by whatever a transform's output contains.
|
|
304
|
+
- **`opts` is reserved and empty in v1.** Nothing populates it yet. A later
|
|
305
|
+
version MAY add a field (deck title, target theme, …), and doing so is an
|
|
306
|
+
*additive* change under `UNIT_COMPAT`: it does not bump
|
|
307
|
+
`TRANSFORM_API_VERSION`, because an existing transform that ignores an
|
|
308
|
+
unrecognised field keeps working exactly as it did before. Only a change
|
|
309
|
+
that would break an existing transform's assumptions bumps the version.
|
|
310
|
+
- **Loaded by dynamic `import()`, in the same process as `bundle`/`import`:
|
|
311
|
+
no subprocess, no VM sandbox.** This is not a gap: `MARKETPLACE.md
|
|
312
|
+
EXTENSIONS` already decided the trust model for build-time code (the
|
|
313
|
+
installer is the risk-bearer, the same defensible model Claude's own plugin
|
|
314
|
+
marketplace uses) so isolating a transform from the process that invoked
|
|
315
|
+
it would defend against a threat this design already accepted. Contrast
|
|
316
|
+
`NO_TRUST#PLUGINS`, which sandboxes because *that* code runs on a
|
|
317
|
+
presenter's machine at a stranger's request, a different actor, a
|
|
318
|
+
different risk.
|
|
319
|
+
- **The return value must be a string**, or a thrown/rejected value the
|
|
320
|
+
*loader* reports by naming the transform: a transform has no other
|
|
321
|
+
contract obligation. Turning a throw into a clean refusal rather than a raw
|
|
322
|
+
stack trace is the loader's job (`EXTENSIONS#LOADER`, `cli/loader.mjs`,
|
|
323
|
+
called from `bundle --transform <name>`), the same UX every other
|
|
324
|
+
unit-installing surface in this codebase already gives.
|
|
325
|
+
|
|
326
|
+
This is the contract `apiVersion` (`UNIT_COMPAT`) names a version *of*.
|
|
327
|
+
Freezing it here, ahead of the loader that will call it, is deliberate: the
|
|
328
|
+
loader is comparatively mechanical once this is fixed, and fixing it after
|
|
329
|
+
the loader existed would mean the first version number was never actually
|
|
330
|
+
pinned to anything.
|
|
331
|
+
|
|
332
|
+
### EXTENSIONS_CHECK · The marketplace admission gate for build-time code
|
|
333
|
+
|
|
334
|
+
`decklight library gate transform <file> [--type transform]` (`--type transform` is
|
|
335
|
+
both the default and, in v1, the only kind implemented) validates ONE
|
|
336
|
+
transform source file and reports 0 or 1, the same shape `theme gate`
|
|
337
|
+
already gives. It is not part of `bundle`, `import` or `publish`: those run
|
|
338
|
+
an already-*installed*, catalog-backed unit (`EXTENSIONS#LOADER`) and never
|
|
339
|
+
re-check it. `library gate transform` instead runs against a bare FILE, because its
|
|
340
|
+
job is admitting an entry to a marketplace catalog in the first place: a
|
|
341
|
+
marketplace repo's own CI runs it on every PR that adds or updates a
|
|
342
|
+
`transform` entry, and a failing check blocks that PR, which is what
|
|
343
|
+
"failure blocks publish" means (MARKETPLACE.md `EXTENSIONS#CHECK`):
|
|
344
|
+
publishing the *extension*, not `decklight publish`ing a deck.
|
|
345
|
+
|
|
346
|
+
Three phases, checking three different things:
|
|
347
|
+
|
|
348
|
+
- **Lint the source text: advisory, not a boundary.** Refused if the file
|
|
349
|
+
contains `fetch(`, `eval(`, `XMLHttpRequest`, or a dynamic `import(`,
|
|
350
|
+
anywhere: a shallow source-text scan, the same kind `NO_TRUST#PLUGINS`
|
|
351
|
+
already runs on a presenter plugin's source. It catches the honest mistake
|
|
352
|
+
and states the bar in a sentence, and that is ALL it does: a static
|
|
353
|
+
`import { execSync } from 'node:child_process'`, a `new Function('return
|
|
354
|
+
fetch')()`, a `globalThis['fet' + 'ch']` all pass a regex unmatched, and
|
|
355
|
+
no source-text scan closes that class. What constrains the submission
|
|
356
|
+
during the check is the process boundary below; what constrains it after
|
|
357
|
+
admission is nothing: an installed transform runs as trusted, unsandboxed
|
|
358
|
+
Node (`EXTENSIONS_TRANSFORMS`), because the trust model for build-time
|
|
359
|
+
code is that the installer bears the risk (MARKETPLACE.md `EXTENSIONS`).
|
|
360
|
+
Admission screens; it does not absolve.
|
|
361
|
+
- **The submission only ever executes behind a process boundary.** The
|
|
362
|
+
checker itself never `import()`s the checked file: a marketplace's CI
|
|
363
|
+
would be executing a stranger's code at its own privilege *before*
|
|
364
|
+
deciding whether to admit it. The transform runs in a SEPARATE Node
|
|
365
|
+
process under the permission model (`--permission`, or
|
|
366
|
+
`--experimental-permission` back to the `engines` floor of Node 20;
|
|
367
|
+
a Node with neither is a named refusal, never a silent unsandboxed run):
|
|
368
|
+
filesystem reads limited to decklight's own package and the submitted
|
|
369
|
+
file's directory, no filesystem writes, no child processes, no workers, no
|
|
370
|
+
native addons; a REPLACED environment (the fixture is the only variable
|
|
371
|
+
that crosses, so a CI runner's secrets never enter the child); a temp
|
|
372
|
+
working directory; and its own 15s wall-clock kill, because a transform
|
|
373
|
+
that never returns must become a refusal, not a hang. Stated plainly,
|
|
374
|
+
what the boundary does NOT cover: Node's permission model does not
|
|
375
|
+
restrict the network, so a hostile submission can still phone home during
|
|
376
|
+
the check: the boundary protects the checking machine's files, processes
|
|
377
|
+
and environment, not its network egress.
|
|
378
|
+
- **A headless load of the OUTPUT, not the source.** The transform is run
|
|
379
|
+
against ONE small fixture this command owns (RANDOMISED per check, a
|
|
380
|
+
fresh nonce in its title, heading and body, so a submission cannot
|
|
381
|
+
recognise the fixture and behave only while being checked), never the
|
|
382
|
+
submitter's own deck: proving the CONTRACT, not "does it handle some
|
|
383
|
+
particular author's markup" (the same "a small fixture beats a full
|
|
384
|
+
bundled deck" reasoning `EXTENSIONS_TRANSFORMS` already uses to justify
|
|
385
|
+
testing against the pre-`bundle` source). The output is then rendered
|
|
386
|
+
headlessly and refused if it contains a `<script>` block OR an inline
|
|
387
|
+
event handler (an `on…=` attribute): the second is exactly as executable
|
|
388
|
+
as the first, just waiting for a click, and a `<script>`-only grep missed
|
|
389
|
+
it entirely. Both refuse for the same reason: "build-time transforms
|
|
390
|
+
produce output, not code; nothing executable travels" (MARKETPLACE.md
|
|
391
|
+
`EXTENSIONS`, SUPERSEDED) is the one invariant this phase can actually
|
|
392
|
+
prove a given transform honors, rather than merely being asked to.
|
|
393
|
+
`apiVersion` currency plays no part here: that is `EXTENSIONS#LOADER`'s
|
|
394
|
+
question at USE time, on an installed unit, not this command's question at
|
|
395
|
+
ADMISSION time, on a bare file.
|
|
396
|
+
|
|
397
|
+
What this gate is, honestly: a screen, not a proof. Code that behaves during
|
|
398
|
+
one check can behave differently once installed, and no admission-time
|
|
399
|
+
analysis of Turing-complete code closes that gap: the randomised fixture
|
|
400
|
+
and the scrubbed, temp-cwd child merely remove the cheap tells a submission
|
|
401
|
+
could key on. The load-bearing decisions remain the catalog's digest pin
|
|
402
|
+
(`UNIT_PINNING`) and the trust model (`EXTENSIONS`: the installer
|
|
403
|
+
bears the risk); this command exists so that the obvious failures never
|
|
404
|
+
reach either.
|
|
405
|
+
|
|
406
|
+
Needs a real browser to run the last phase (the same Chrome dependency
|
|
407
|
+
`npm run verify`'s render harnesses already carry) and answers the same way
|
|
408
|
+
they already do when Chrome is absent: a named refusal, never a silent pass.
|
|
409
|
+
|
|
410
|
+
**Both executions carry a hard wall-clock kill: 15s for the transform's own
|
|
411
|
+
run, and a separate one for the headless load, which defaults to the same and
|
|
412
|
+
is raised by `DECKLIGHT_CHECK_LOAD_MS` on a slow machine.** They are separate
|
|
413
|
+
numbers because they measure different things: the transform's clock has only
|
|
414
|
+
the submission on it, while the headless load's also pays for starting a
|
|
415
|
+
browser, which the submission had no part in. A shared CI runner slow enough to
|
|
416
|
+
make a cold Chrome start eat the budget will otherwise refuse a clean
|
|
417
|
+
submission for "blocking the page": an admission gate accusing honest work of
|
|
418
|
+
hanging is a worse failure than taking a minute to reject hostile work. The
|
|
419
|
+
headless kill stays load-bearing either way, and is separate from
|
|
420
|
+
`--virtual-time-budget`. That flag bounds Chrome's
|
|
421
|
+
own clock, not the real one: a synchronous `alert()`/`confirm()`/`prompt()`
|
|
422
|
+
in the OUTPUT opens a native dialog that blocks the render loop outside
|
|
423
|
+
virtual time entirely, and an infinite loop blocks it the same way,
|
|
424
|
+
measured directly, not a theoretical concern. Every other transform failure
|
|
425
|
+
this section refuses is a *string* found in an *output*; a hang is the one
|
|
426
|
+
shape that would otherwise have no output to refuse, and this command's
|
|
427
|
+
whole premise is running code nobody has vetted yet, so a submission that
|
|
428
|
+
never returns, in its own run or in its output's load, has to become a
|
|
429
|
+
refusal too, not an unbounded hang in whatever is running the check (a
|
|
430
|
+
marketplace's own CI).
|
|
431
|
+
|
|
432
|
+
### EXTENSIONS_ADAPTERS · Import adapters: the v1 contract, and running one
|
|
433
|
+
|
|
434
|
+
An import adapter is a single file, `importer.mjs`, exporting one function:
|
|
435
|
+
the same shape `EXTENSIONS_TRANSFORMS` gives a build-time transform, with the
|
|
436
|
+
one difference its different input forces:
|
|
437
|
+
|
|
438
|
+
```js
|
|
439
|
+
export default async function importAdapter(bytes, opts) {
|
|
440
|
+
return html; // bytes in, HTML out — the deck's <section> markup, nothing else crosses
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
- **`bytes` is the source file's raw contents** (a `Buffer`, read by `cli/
|
|
445
|
+
import.mjs` before the adapter ever runs), never a path, so an adapter's
|
|
446
|
+
contract needs no filesystem access of its own and stays as pure as a
|
|
447
|
+
transform's `html in, html out`. What the built-in importer calls "a
|
|
448
|
+
CONTENT importer, not a pixel renderer" (`DECK_IMPORT`) applies here too:
|
|
449
|
+
the adapter owns turning its format into markup, and decklight themes it
|
|
450
|
+
same as anything else.
|
|
451
|
+
- **The return value is the deck's section markup, one HTML string**, not
|
|
452
|
+
the `{ sections, report }` pair `cli/import.mjs`'s own PowerPoint path uses
|
|
453
|
+
internally. Requiring a third-party adapter to reproduce that pair would
|
|
454
|
+
leak an implementation detail of one specific importer into a contract
|
|
455
|
+
every future adapter has to match; a single string is the same minimal
|
|
456
|
+
surface `EXTENSIONS_TRANSFORMS` chose for the same reason. Per-slide drop
|
|
457
|
+
reporting (`DECK_IMPORT`'s "every drop is reported with its slide number")
|
|
458
|
+
is therefore not part of the v1 adapter contract: an adapter that wants it
|
|
459
|
+
is free to `console.error` its own, since it runs at the same trust level
|
|
460
|
+
as anything else in `EXTENSIONS`.
|
|
461
|
+
- **`opts` is reserved and empty in v1**, for the identical reason
|
|
462
|
+
`EXTENSIONS_TRANSFORMS`'s is: a later version may add a field, and doing so
|
|
463
|
+
is *additive* under `UNIT_COMPAT` rather than a version bump, because an
|
|
464
|
+
adapter that ignores an unrecognised field keeps working exactly as before.
|
|
465
|
+
- **Loaded by dynamic `import()`, in the same process as `decklight import`:
|
|
466
|
+
no subprocess, no VM sandbox.** Identical reasoning to
|
|
467
|
+
`EXTENSIONS_TRANSFORMS`: an import adapter is Node code at author
|
|
468
|
+
privilege, the trust model `MARKETPLACE.md EXTENSIONS` already settled
|
|
469
|
+
(the installer is the risk-bearer), and isolating it from the process that
|
|
470
|
+
invoked it would defend against a threat this design already accepted.
|
|
471
|
+
- **An independent `apiVersion`, `IMPORTER_API_VERSION`, not
|
|
472
|
+
`TRANSFORM_API_VERSION`.** The two are different calling conventions
|
|
473
|
+
(`html, opts → html` versus `bytes, opts → html`) that will each change on
|
|
474
|
+
their own schedule; sharing one counter would bump every installed
|
|
475
|
+
transform's compatibility number the day the *importer* contract grew a
|
|
476
|
+
field it never asked for. Both move the same way `UNIT_COMPAT` already
|
|
477
|
+
established (additive-only, bumped only when that ONE contract would
|
|
478
|
+
break an existing unit), they just count separately.
|
|
479
|
+
- **The return value must be a string**, or a thrown/rejected value the
|
|
480
|
+
loader reports by naming the adapter: the same clean, never-a-raw-stack
|
|
481
|
+
collapse `EXTENSIONS#LOADER` already gives a transform's failures
|
|
482
|
+
(`cli/loader.mjs`'s `runImporterAt`, called from `cli/import.mjs` once
|
|
483
|
+
`sourceKind` finds no built-in reader for the file but a cached catalog
|
|
484
|
+
entry names an installed adapter for its extension).
|
|
485
|
+
|
|
486
|
+
`import` still says exactly what it always said when no adapter is known, or
|
|
487
|
+
when one is known but not installed (`decklight library add importer <name>`); only
|
|
488
|
+
an INSTALLED adapter's extension now actually runs, rather than reporting
|
|
489
|
+
that it does not yet (`EXTENSIONS#ADAPTEREXEC`, MARKETPLACE.md).
|
|
490
|
+
|
|
491
|
+
### ENGINE_UNITS · Speech engines: the v1 contract, and installing one
|
|
492
|
+
|
|
493
|
+
Six engines ship in core (`PRESENTING`: gemini, chirp, piper, elevenlabs, say,
|
|
494
|
+
sapi) and are **not units**: they need no marketplace, no library and no
|
|
495
|
+
catalog, so a machine with nothing registered reaches its own voice exactly as
|
|
496
|
+
it always did. A seventh is whatever you installed. An engine unit is a single
|
|
497
|
+
file, `engine.mjs`, exporting a **factory** rather than the `(input, opts) →
|
|
498
|
+
string` pass the other two code-carrying kinds export:
|
|
499
|
+
|
|
500
|
+
```js
|
|
501
|
+
export default function createEngine(opts) {
|
|
502
|
+
return {
|
|
503
|
+
name, voices, // the roster the V picker offers
|
|
504
|
+
stylable, // may the tone step be shown for it?
|
|
505
|
+
audioTags, // does it act on [whispers]-style tags?
|
|
506
|
+
synth(text, { voice, style }) {}, // → { wav, usage }
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
- **`decklight library add engine <name>` installs one**, into `~/.decklight/engines/`
|
|
512
|
+
like any other unit; `decklight <deck> --tts-engine <name>` then speaks with it and
|
|
513
|
+
the picker treats it exactly as it treats a built-in. An engine is Node code
|
|
514
|
+
at author privilege, so it is **pinned** by `sha256` on the same terms as a
|
|
515
|
+
transform or an adapter (`UNIT_PINNING`): refused before any fetch without
|
|
516
|
+
one, refused before any write on a mismatch.
|
|
517
|
+
- **An independent `apiVersion`, `ENGINE_API_VERSION`**, a third counter
|
|
518
|
+
beside `TRANSFORM_API_VERSION` and `IMPORTER_API_VERSION`, for the third
|
|
519
|
+
reason they are separate (`UNIT_COMPAT`): this convention is not `input →
|
|
520
|
+
string` at all, so the day either of the others grows a field, an engine's
|
|
521
|
+
contract is untouched and must not be invalidated alongside them. Additive
|
|
522
|
+
only, bumped only when the factory or `synth` convention itself would break
|
|
523
|
+
an installed engine, never for a reorganisation of `tools/tts-engines.mjs`,
|
|
524
|
+
whose six built-ins this number does not version.
|
|
525
|
+
- **`capability` says which affordance it answers for** (`tts` today).
|
|
526
|
+
Validated for *shape* in the catalog and checked against what this decklight
|
|
527
|
+
runs only at LOAD time: a catalog declaring an engine for a capability this
|
|
528
|
+
version cannot run must stay addable, so the refusal names the one engine
|
|
529
|
+
rather than invalidating the catalog it arrived in and taking its themes
|
|
530
|
+
down with it. Same reasoning an unknown `type` already gets
|
|
531
|
+
(`MARKETPLACE_REGISTRY`).
|
|
532
|
+
- **The returned object is checked once, at load, not at the first sentence.**
|
|
533
|
+
A missing `synth`, a factory that is not a function, one that throws while
|
|
534
|
+
starting, one whose roster is neither a `voices` array nor a `listVoices()`:
|
|
535
|
+
each is a `LoaderError` naming the engine, never a raw stack, and never a
|
|
536
|
+
crash mid-talk. `stylable` defaults to **false** when an engine does not say:
|
|
537
|
+
a plugin with no delivery-instruction channel that forgets to declare one
|
|
538
|
+
must not have the tone step offered for it, which is the same silent lie
|
|
539
|
+
`PRESENTING` refuses when it skips that step for chirp and piper. So does
|
|
540
|
+
`audioTags`: an engine that does not say it acts on audio tags is sent the
|
|
541
|
+
notes with every tag taken out (DECK_ANATOMY), never one read aloud.
|
|
542
|
+
- **Loaded by dynamic `import()`, in the same process as the bridge**: no
|
|
543
|
+
subprocess, no VM sandbox, identical reasoning to `EXTENSIONS_TRANSFORMS`.
|
|
544
|
+
- **Write mode only.** Installing and configuring both happen through the
|
|
545
|
+
server in write mode; no-trust mode refuses every route that could reach either, and a
|
|
546
|
+
credential still comes from the wizard (`ENGINES#WIZARD`) and is still
|
|
547
|
+
stored restricted to the account that pasted it (the platform's own form of
|
|
548
|
+
that, named in `ENGINES#WIZARD`), never into a deck.
|
|
549
|
+
### ENGINE_PREREQUISITES · What an engine needs before a key is worth asking for
|
|
550
|
+
|
|
551
|
+
TTS made two failure states look like enough ("could not reach it" and "that
|
|
552
|
+
key was refused") because a credential is the only thing a TTS provider ever
|
|
553
|
+
needs. Lipsync is the case that proves otherwise (`ENGINES#LIPSYNC`): rhubarb
|
|
554
|
+
is a **binary**, Wav2Lip is a **python checkout plus model weights**, and only
|
|
555
|
+
Veo is the paste-a-key shape. So a wizard schema may declare what it needs
|
|
556
|
+
from the machine, beside what it needs from the person:
|
|
557
|
+
|
|
558
|
+
```json
|
|
559
|
+
"requires": [
|
|
560
|
+
{ "kind": "binary", "name": "rhubarb", "hint": "brew install rhubarb-lip-sync" },
|
|
561
|
+
{ "kind": "file", "name": "~/models/wav2lip.pth", "hint": "download the checkpoint" }
|
|
562
|
+
]
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
- **Two kinds, and deliberately no third.** `binary` (a command that must be
|
|
566
|
+
on `PATH`) and `file` (a path that must exist: a checkout, a checkpoint, a
|
|
567
|
+
model). Everything a talking-head engine needs is one of those two, and a
|
|
568
|
+
vocabulary that grew past them would stop being a declaration and start
|
|
569
|
+
being a build script. Closed for the same reason `FIELD_TYPES` is: a
|
|
570
|
+
prerequisite core cannot check is refused **by name**, never rendered as a
|
|
571
|
+
best guess.
|
|
572
|
+
- **`hint` is displayed, never executed.** It is the line a human would type,
|
|
573
|
+
shown so it can be copied. Decklight does not run it, and that is the only
|
|
574
|
+
reason it can be catalog-supplied at all. A plugin able to get a shell
|
|
575
|
+
command run at author privilege merely by declaring a "prerequisite" would
|
|
576
|
+
make the wizard a remote-code-execution primitive with a config file for a
|
|
577
|
+
delivery mechanism, the exact inversion `MARKETPLACE.md WHY` exists to
|
|
578
|
+
refuse. The piper offer-to-fetch (`PRESENTING`) looks similar and is not:
|
|
579
|
+
that command is chosen by decklight's own code, against a package decklight
|
|
580
|
+
names, and no catalog can put a string in it.
|
|
581
|
+
- **A third state, `prerequisite`, beside `unreachable` and `rejected`**:
|
|
582
|
+
`412` on the wire, its own line in the player. Someone missing rhubarb must
|
|
583
|
+
not be told to check their key, exactly as someone with a wrong key must not
|
|
584
|
+
be told to check their network.
|
|
585
|
+
- **The gate runs first.** Before the answers are checked, before the network
|
|
586
|
+
is touched, and before anything is written: an engine that cannot run here
|
|
587
|
+
never has a credential collected for it, and a provider outage can never
|
|
588
|
+
mask a missing binary.
|
|
589
|
+
- **Nothing is ever downloaded, and non-TTY runs never prompt**: unchanged
|
|
590
|
+
from the offer-to-fetch precedents, because nothing here fetches at all.
|
|
591
|
+
- **`capability: "lipsync"`** is a runnable engine kind alongside `tts`
|
|
592
|
+
(`ENGINE_UNITS`): the factory contract is identical, and what differs is
|
|
593
|
+
exactly the prerequisites above.
|
|
594
|
+
|
|
595
|
+
### AGENT_UNITS · AI agents: a descriptor, and a remembered preference
|
|
596
|
+
|
|
597
|
+
`A` (PRESENTING) hands an installed coding agent one editing task. The roster
|
|
598
|
+
of agents decklight knows how to invoke ships in core, and a marketplace can
|
|
599
|
+
extend it, but an agent unit is a **descriptor, never code**:
|
|
600
|
+
|
|
601
|
+
```json
|
|
602
|
+
{ "name": "my-agent", "type": "agent",
|
|
603
|
+
"bin": "my-agent", "args": ["-p", "{prompt}", "--yes"] }
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
- **`bin` is a command you already installed**, the way its own documentation
|
|
607
|
+
says. `decklight library add agent <name>` fetches nothing and runs nothing of the
|
|
608
|
+
catalog's: it only teaches decklight how to *call* something already on
|
|
609
|
+
your `PATH`. That is why `agent` is `REFERENCE_ONLY` beside `voice`, carries
|
|
610
|
+
no `sha256`, and is the second kind whose `add` works offline. The reason
|
|
611
|
+
differs from a voice's: not consent, but blast radius; an open roster that
|
|
612
|
+
required downloading a module would put every new agent in `UNIT_PINNING`'s
|
|
613
|
+
risk class for no gain, when the thing being described is a binary the user
|
|
614
|
+
chose and installed themselves.
|
|
615
|
+
- **The whole template vocabulary is `{prompt}` and `{deck}`**, each
|
|
616
|
+
substituted into one argv element. The result is spawned as an **argv
|
|
617
|
+
array, never a shell string**, so a deck path containing a space or a
|
|
618
|
+
semicolon is an argument and can never become a command. A descriptor whose
|
|
619
|
+
`args` never mentions `{prompt}` is refused: an agent handed no instruction
|
|
620
|
+
is not a working entry. The three shapes the built-in roster already covers
|
|
621
|
+
(`-p …`, `exec --full-auto …`, `run -t …`) are the evidence this vocabulary
|
|
622
|
+
is closed enough to stay declarative.
|
|
623
|
+
- **A unit may not shadow a built-in.** An installed descriptor whose name
|
|
624
|
+
collides with one of the core agents is dropped rather than replacing it:
|
|
625
|
+
silently changing how `claude` is invoked is not something a catalog should
|
|
626
|
+
be able to do to a machine. A malformed descriptor is skipped, not thrown
|
|
627
|
+
on: one broken third-party entry must not take `A` down for the agents
|
|
628
|
+
beside it.
|
|
629
|
+
- **The preferred agent is remembered** (`~/.decklight/agent.json`), so `A`
|
|
630
|
+
opens on the agent you chose rather than on whichever was detected first.
|
|
631
|
+
Precedence matches every other saved choice: `--agent` > the remembered
|
|
632
|
+
preference > the first detected agent. Choosing one in the `A` dialog
|
|
633
|
+
persists it (`POST /deck/edit/agent/prefer`); it is a fact about the machine, so
|
|
634
|
+
it is written beside the unit library and **never into the deck**.
|
|
635
|
+
- **A remembered agent that is missing is named, never substituted.** Which
|
|
636
|
+
agent edits your deck is not an interchangeable detail, so an unavailable
|
|
637
|
+
preference does not quietly fall back to another one: the edit server says
|
|
638
|
+
so once at startup, and `A` answers with a line naming what is missing, what
|
|
639
|
+
is available, and how to get it back.
|
|
640
|
+
- **An agent is offered only if it can be RUN, and it is run as argv.** On
|
|
641
|
+
Windows every agent that installs from npm lands as a `.cmd` batch shim, and
|
|
642
|
+
Node refuses to spawn one without a shell. decklight does not turn one on:
|
|
643
|
+
with a shell the arguments stop being arguments and become a command line for
|
|
644
|
+
`cmd.exe` to re-split, and one of them is the user's prompt: `%VAR%` there
|
|
645
|
+
is expanded before any escaping the caller could apply, so no quoting makes
|
|
646
|
+
it safe. Instead the shim is resolved back to the script it runs and node is
|
|
647
|
+
spawned on that, which keeps the guarantee above (argv is argv) identical on
|
|
648
|
+
both platforms. A batch file that names no such script is **not offered at
|
|
649
|
+
all**: detected-but-unrunnable is a worse answer than absent, and the
|
|
650
|
+
refusal names the file rather than claiming the command is missing.
|
|
651
|
+
|
|
652
|
+
### VOICE_UNITS · Voices: a reference, never a payload
|
|
653
|
+
|
|
654
|
+
A marketplace distributes voices as **references**. A `voice` entry names an
|
|
655
|
+
engine and one of that engine's own voice identifiers (`{ "name":
|
|
656
|
+
"narrator-anna", "type": "voice", "engine": "elevenlabs", "voiceId": "…" }`)
|
|
657
|
+
and carries no `source`. There are no model weights, no sample audio, and
|
|
658
|
+
nothing else that could reproduce a person's voice on a machine that never
|
|
659
|
+
asked. `decklight library add voice` therefore fetches nothing at all: it writes the
|
|
660
|
+
pointer it already had in the catalog cache, which makes it the one install
|
|
661
|
+
that works offline, and speaking through it still needs that engine and the
|
|
662
|
+
installer's own credential.
|
|
663
|
+
|
|
664
|
+
**The rule is enforced by subtraction.** A `source` on a `voice` entry is
|
|
665
|
+
*refused*, not ignored, so the field through which bytes would arrive does not
|
|
666
|
+
exist: the same shape as the runtime having no plugin system rather than a
|
|
667
|
+
disabled one (NON_GOALS). An ignored field would still let a catalog carry a
|
|
668
|
+
model that merely never loads.
|
|
669
|
+
|
|
670
|
+
**There is deliberately no consent attestation.** A `consent: true` field would
|
|
671
|
+
be one boolean an uploader types and no one can verify, and printing it back
|
|
672
|
+
would manufacture exactly the confidence the ingredients label refuses to
|
|
673
|
+
manufacture (PRESENTING: an inventory, never a verdict). Distributing only
|
|
674
|
+
references puts the consent relationship where it can actually be held and
|
|
675
|
+
withdrawn: a cloned voice lives in a provider account under terms that governed
|
|
676
|
+
the cloning, it is useless to anyone the owner has not shared it with, and
|
|
677
|
+
unsharing it revokes every reference at once, which no file, once downloaded,
|
|
678
|
+
can be made to do.
|
|
679
|
+
|
|
680
|
+
**The limit, stated rather than papered over:** this does not stop a catalog
|
|
681
|
+
naming a voice after a person, or pointing at a provider voice that imitates
|
|
682
|
+
one. What it stops is decklight becoming the thing that *hands out the
|
|
683
|
+
likeness*. The rest is the provider's terms and the marketplace's own tier
|
|
684
|
+
(first-party vetted, community screened, third-party unreviewed): the same
|
|
685
|
+
place every other unreviewable claim about a catalog entry already lives.
|
|
686
|
+
|
|
687
|
+
Piper voice models are unaffected and stay what they were: downloads offered by
|
|
688
|
+
the engine when a model is missing, not marketplace units.
|
|
689
|
+
|
|
690
|
+
Entry names are qualified `name@marketplace`. A bare name resolves only while
|
|
691
|
+
it exists in exactly one registered marketplace; the same bare name in two is
|
|
692
|
+
reported as ambiguous with the qualified forms to use instead, never silently
|
|
693
|
+
resolved to either. The registry registers, caches and names; installing what
|
|
694
|
+
an entry points at is each install surface's own contract (a theme is marked
|
|
695
|
+
through `theme add`'s validator and referenced, never copied, THEME_DISTRIBUTION).
|
|
696
|
+
Nothing here executes in a deck: the marketplace distributes data and
|
|
697
|
+
authoring-side units, and the no-plugin-system line (NON_GOALS) stands.
|
|
698
|
+
|
|
699
|
+
**The personal marketplace.** A theme that arrives as a file or a URL has no
|
|
700
|
+
marketplace for a deck to refer to it in, so `theme add` copies it into one:
|
|
701
|
+
`~/.decklight/local/`, a local marketplace like any other (a
|
|
702
|
+
`.decklight/marketplace.json` and the files beside it), registered as `local`
|
|
703
|
+
the first time it is needed. It lives outside `~/.decklight/marketplaces/`,
|
|
704
|
+
where clones are kept, because `marketplace remove` deletes the clone of what
|
|
705
|
+
it removes: unregistering `local` must never delete somebody's themes. A
|
|
706
|
+
marketplace already registered as `local` from anywhere else is left alone,
|
|
707
|
+
and `theme add` says so rather than taking the name.
|