decklight 0.8.0 → 0.9.0

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