@slidevideo/cli 0.1.2 → 0.2.1

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 (64) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/IMPRESSUM.md +18 -4
  3. package/LICENSE-TERMS.md +46 -13
  4. package/README.md +5 -5
  5. package/addons/slidevideo/geometry.ts +63 -30
  6. package/addons/slidevideo/global-top.vue +41 -9
  7. package/addons/slidevideo/playback-entries.ts +17 -6
  8. package/addons/slidevideo/preview.ts +27 -15
  9. package/dist/adapters/browser-runtime.d.ts +3 -0
  10. package/dist/adapters/elevenlabs.d.ts +1 -0
  11. package/dist/adapters/elevenlabs.js +8 -4
  12. package/dist/adapters/powerpoint.d.ts +7 -4
  13. package/dist/adapters/powerpoint.js +123 -34
  14. package/dist/adapters/slidev-inspection.d.ts +5 -2
  15. package/dist/adapters/slidev-inspection.js +5 -6
  16. package/dist/adapters/slidev-server.js +136 -15
  17. package/dist/adapters/slidev.d.ts +12 -4
  18. package/dist/adapters/slidev.js +356 -70
  19. package/dist/annotation-paint.d.ts +65 -11
  20. package/dist/annotation-paint.js +290 -10
  21. package/dist/annotations.d.ts +13 -8
  22. package/dist/annotations.js +620 -89
  23. package/dist/assembly.d.ts +48 -40
  24. package/dist/assembly.js +72 -28
  25. package/dist/calibration.js +5 -4
  26. package/dist/cli.js +180 -39
  27. package/dist/compositor.d.ts +38 -6
  28. package/dist/compositor.js +299 -46
  29. package/dist/contracts.d.ts +96 -35
  30. package/dist/contracts.js +2 -1
  31. package/dist/executables.d.ts +2 -0
  32. package/dist/executables.js +27 -8
  33. package/dist/media.d.ts +12 -1
  34. package/dist/media.js +53 -4
  35. package/dist/pipeline.d.ts +36 -10
  36. package/dist/pipeline.js +163 -46
  37. package/dist/preview/contracts.d.ts +3 -3
  38. package/dist/preview/player.js +20 -15
  39. package/dist/preview/server.d.ts +2 -1
  40. package/dist/preview/server.js +8 -7
  41. package/dist/run.d.ts +1 -1
  42. package/dist/run.js +8 -3
  43. package/dist/setup-install.d.ts +1 -0
  44. package/dist/setup-install.js +8 -1
  45. package/dist/setup.d.ts +29 -8
  46. package/dist/setup.js +183 -76
  47. package/dist/skill-install.d.ts +35 -0
  48. package/dist/skill-install.js +132 -0
  49. package/dist/speech.js +10 -6
  50. package/dist/storyboard.js +12 -6
  51. package/dist/timing.js +2 -2
  52. package/package.json +4 -3
  53. package/schemas/annotation-geometry.v1.json +260 -28
  54. package/schemas/run-manifest.v1.json +31 -0
  55. package/schemas/schedule.v1.json +655 -1
  56. package/schemas/storyboard.v1.json +558 -33
  57. package/skills/slidevideo/SKILL.md +11 -9
  58. package/skills/slidevideo/references/decks.md +228 -0
  59. package/skills/slidevideo/references/production.md +17 -12
  60. package/skills/slidevideo/references/storyboard.md +71 -38
  61. package/tools/powerpoint/powerpoint.ps1 +52 -41
  62. package/tools/powerpoint/preview.ps1 +5 -5
  63. package/schemas/schedule.v2.json +0 -496
  64. package/schemas/storyboard.v2.json +0 -802
@@ -0,0 +1,228 @@
1
+ # Deck compatibility and authoring
2
+
3
+ SlideVideo drives Slidev Markdown `.md` decks through Chromium and native `.pptx` decks through desktop PowerPoint on Windows. This reference defines what `slides.md` and `.pptx` files must provide so `slidevideo inspect`, `validate`, `play`, `record`, and `build` resolve targets cleanly and capture frames without clipping or layout drift.
4
+
5
+ Preserve existing supplied decks by default. Create or edit a deck only when the creator asks for slide authoring or edits, or approves adding slide names or element IDs required by requested storyboard actions or `annotations`. Run `slidevideo inspect --deck <file> --json` before writing `slidevideo.yaml` to list actual slide names, click counts, media IDs, highlight targets, and capability diagnostics.
6
+
7
+ ## Slide addressing
8
+
9
+ Every storyboard `scene.slide` and `slide.target` value must match `^[a-zA-Z][a-zA-Z0-9_-]*$`.
10
+
11
+ ### Slidev
12
+
13
+ - Set a unique frontmatter `name` on every slide across the expanded deck.
14
+ - Do not rely on `routeAlias`. SlideVideo ignores `routeAlias` when resolving storyboard targets.
15
+ - Slides without `name` fall back to `slide-<N>` using the one-based expanded slide order after Slidev expands `src` imports, applies range selections, and excludes `hide` or `disabled` slides. Adding, reordering, or importing slides shifts unnamed `slide-N` targets, so author explicit `name` values whenever you create or adapt a Slidev deck.
16
+
17
+ ### PowerPoint
18
+
19
+ - Set a unique native `Slide.Name` matching `^[a-zA-Z][a-zA-Z0-9_-]*$`, or use the unambiguous `slide-<SlideID>` alias returned by `slidevideo inspect --deck <file> --json`. `SlideID` is PowerPoint's internal identifier, not the one-based slide index.
20
+ - Every slide must use cut transitions, manual advancement, and visible slides. Native slide transitions, timed `AdvanceOnTime` settings, hidden slides, and interactive trigger sequences fail `POWERPOINT_CAPABILITY`.
21
+
22
+ ## Click reveals
23
+
24
+ ### Slidev
25
+
26
+ - Use Slidev click directives such as `v-click`, `v-clicks`, clicked code-block line highlights, or Magic Move steps driven by Slidev's click counter.
27
+ - `reveal.click` sets the target integer click step on the active slide rather than adding a relative delta. Reveals must advance in strictly increasing order until a `slide` action resets clicks to `0`.
28
+ - Set `reveal.duration_ms` to cover the full CSS transition or reveal animation duration. SlideVideo reserves that settling window in the schedule and does not rewrite CSS transition timings.
29
+
30
+ ### PowerPoint
31
+
32
+ - Use sequential finite click groups made of entrance `Appear` or `Fade` effects only.
33
+ - Automatic entry before the first click, repeats, exit effects, emphasis effects, motion paths, interactive triggers, and media animations fail `POWERPOINT_CAPABILITY`.
34
+ - Set `reveal.duration_ms` to at least the native click-group duration reported in `slides[].click_durations_ms` by `slidevideo inspect --deck <file> --json`. Each `reveal` must execute the next consecutive click step `1..N` on the active slide.
35
+
36
+ ## Managed media
37
+
38
+ ### Slidev
39
+
40
+ - Declare controllable media with literal lowercase `<video id="...">` or `<audio id="...">` HTML tags in `slides.md`. Component wrappers such as `<SlidevVideo>` are not discovered as storyboard media targets.
41
+ - Place local clip files in `public/` next to `slides.md`, reference `src="/clip.mp4"` on the `<video>` element with `preload="auto" muted playsinline`, and declare the same file under `media` in `slidevideo.yaml` as `src: ./public/clip.mp4`.
42
+ - During preparation, SlideVideo fetches the browser's resolved media URL and verifies that its SHA-256 digest matches `media[].src`. A re-encoded copy fails with `MEDIA_SOURCE_MISMATCH`.
43
+ - Browser audio, WebAudio, and iframe audio are muted during capture. Exported audio comes only from synthesized narration and scheduled `play` actions with `audio: source`.
44
+
45
+ ### PowerPoint
46
+
47
+ - Embed the local video file directly on the slide as an ungrouped shape and set `Shape.Name` to the storyboard `media[].id`. Linked or online video fails capability validation.
48
+ - Point `media[].src` in `slidevideo.yaml` at the exact file embedded into the `.pptx` package so its SHA-256 digest and duration match.
49
+ - Disable autoplay, loop, rewind, native trims, fullscreen playback, cropping, rotation, flipping, and shape animations on the video shape. PowerPoint `play` actions support full-source playback at `rate: 1` with `trim_start_ms` omitted or `0` and `trim_end_ms` omitted.
50
+
51
+ ## Annotation targets and canvas bounds
52
+
53
+ ### Slidev
54
+
55
+ - Slidev renders `#slide-container > #slide-content` at the deck's configured logical canvas, `980` by `552` at `16:9` by default unless headmatter or a theme overrides `canvasWidth` or `aspectRatio`, and scales that canvas to the output dimensions, defaulting to `1920` by `1080` and letterboxing when `--width` and `--height` use another aspect ratio.
56
+ - Element annotations (`highlight` and `underline`) use `target: { type: element, selector: "#card-id" }` and must match one visible, stationary, axis-aligned element inside the active audience slide.
57
+ - Keep annotated elements, highlight padding, and underline `offset` strokes wholly inside the deck's rendered `#slide-content` rectangle. Elements that overflow `#slide-content`, sit inside an ancestor whose `overflow` clips their bounds, use CSS `clip-path`, `mask-image`, rotation, skew, or negative scale, or sit inside an SVG `<g>` group fail geometry collection during playback.
58
+ - Add stable `id` attributes to cards, callouts, rows, or code containers when authoring or adapting `slides.md` so `annotations` do not depend on fragile tag-order selectors.
59
+
60
+ ### PowerPoint
61
+
62
+ - Shape annotations (`highlight` and `underline`) use `target: { type: shape, id: <number> }` with the integer shape ID reported by `slidevideo inspect --deck <file> --json`. Shape names are descriptive only and are not valid target identifiers.
63
+ - `--width` and `--height` must match the native PowerPoint slide aspect ratio. The native slideshow window caps at `1600` physical pixels wide and scales uniformly to the output dimensions.
64
+ - Grouped shapes, group members, cropped pictures, rotated or flipped shapes, paragraph-level text animations, and shapes hidden or dimmed after animation fail `ANNOTATION_TARGET`. Any entrance `Appear` or `Fade` on the target shape must finish settling before the annotation interval starts.
65
+ - Both Slidev and PowerPoint also accept `target: { type: region, units: normalized, x, y, width, height }` in `[0, 1]` slide coordinates without modifying the deck.
66
+
67
+ ### Contrast presets
68
+
69
+ On light slide backgrounds, use `blend: darken` with a darker `bottom_border` so dark body text stays crisp inside the highlight:
70
+
71
+ ```yaml
72
+ appearance:
73
+ color: "#D8FF69"
74
+ opacity: 0.55
75
+ blend: darken
76
+ bottom_border:
77
+ color: "#6B8B12"
78
+ opacity: 1
79
+ units: normalized
80
+ height: 0.004
81
+ padding:
82
+ units: normalized
83
+ x: 0.008
84
+ y: 0.006
85
+ ```
86
+
87
+ On dark slide backgrounds or dark code frames, keep the default `source-over` blend mode with lower fill opacity:
88
+
89
+ ```yaml
90
+ appearance:
91
+ color: "#D8FF69"
92
+ opacity: 0.22
93
+ bottom_border:
94
+ color: "#D8FF69"
95
+ opacity: 0.85
96
+ units: normalized
97
+ height: 0.004
98
+ padding:
99
+ units: normalized
100
+ x: 0.008
101
+ y: 0.006
102
+ ```
103
+
104
+ ## Watermark safe zone and Vite watch hygiene
105
+
106
+ - Unlicensed exports render a translucent `slidevideo.io` watermark in the lower-right corner of the video frame, sized from output height with font size `round(height * 0.024)`, box width `ceil(size * 8)`, and margin `round(min(width, height) * 0.018)`. On `16:9` widescreen exports, keeping slide footers, page numbers, source citations, and badges out of the lower-right `18%` width by `10%` height region leaves clearance for the mark. On narrower or portrait `--width` and `--height` aspect ratios, the mark spans a wider fraction of the frame width, so check lower-right clearance at the target dimensions.
107
+ - Bundle local `.woff2` fonts or set `fonts.provider: none` in Slidev headmatter when you want offline builds without external font requests. Avoid continuous CSS keyframe motion on annotated elements because target movement above `0.5` output pixels during an annotation interval fails `ANNOTATION_GEOMETRY`.
108
+ - When you store build runs under `runs/` inside a Slidev project that includes `vite.config.ts`, ignore generated directories so Vite does not watch run artifacts:
109
+
110
+ ```ts
111
+ export default {
112
+ server: {
113
+ watch: { ignored: ['**/.agents/**', '**/runs/**', '**/dist/**'] },
114
+ },
115
+ };
116
+ ```
117
+
118
+ ## Multi-feature Slidev and storyboard example
119
+
120
+ Place a silent or audio-bearing MP4 at `public/demo.mp4`, save `slides.md`, and pair it with `slidevideo.yaml`:
121
+
122
+ ```md
123
+ ---
124
+ theme: default
125
+ title: Deployment walkthrough
126
+ name: overview
127
+ fonts:
128
+ provider: none
129
+ transition: none
130
+ ---
131
+
132
+ # Ship deterministic releases
133
+
134
+ <div id="canary-card" style="padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px;">
135
+ Verify canary health before promoting production traffic.
136
+ </div>
137
+
138
+ <div v-click="1" style="margin-top: 16px;">
139
+ Automated rollback stays armed throughout the rollout window.
140
+ </div>
141
+
142
+ ---
143
+ name: rollout-clip
144
+ ---
145
+
146
+ # Live rollout capture
147
+
148
+ <video id="rollout-video" src="/demo.mp4" preload="auto" muted playsinline style="width: 80%;" />
149
+ ```
150
+
151
+ ```yaml
152
+ version: 1
153
+ deck: ./slides.md
154
+ voice:
155
+ provider: edge-tts
156
+ voice: en-US-AriaNeural
157
+ media:
158
+ - id: rollout-video
159
+ src: ./public/demo.mp4
160
+ narration:
161
+ - id: overview-narration
162
+ text: "Check canary health first, then arm automated rollback before shifting traffic."
163
+ - id: clip-narration
164
+ text: "Here is the recorded rollout sequence from staging."
165
+ scenes:
166
+ - id: intro
167
+ slide: overview
168
+ actions:
169
+ - id: speak-overview
170
+ type: speak
171
+ segment: overview-narration
172
+ - id: hold-overview
173
+ type: hold
174
+ duration_ms: 600
175
+ - id: demo
176
+ slide: rollout-clip
177
+ actions:
178
+ - id: speak-clip
179
+ type: speak
180
+ segment: clip-narration
181
+ - id: play-rollout
182
+ type: play
183
+ media: rollout-video
184
+ audio: muted
185
+ volume: 0
186
+ - id: hold-end
187
+ type: hold
188
+ duration_ms: 500
189
+ cues:
190
+ - id: reveal-rollback
191
+ at:
192
+ segment: overview-narration
193
+ phrase: "arm automated rollback"
194
+ boundary: start
195
+ offset_ms: 0
196
+ action:
197
+ type: reveal
198
+ click: 1
199
+ duration_ms: 300
200
+ annotations:
201
+ - id: highlight-canary
202
+ scene: intro
203
+ target:
204
+ type: element
205
+ selector: "#canary-card"
206
+ effect: highlight
207
+ appearance:
208
+ color: "#D8FF69"
209
+ opacity: 0.55
210
+ blend: darken
211
+ bottom_border:
212
+ color: "#6B8B12"
213
+ opacity: 1
214
+ units: normalized
215
+ height: 0.004
216
+ padding:
217
+ units: normalized
218
+ x: 0.008
219
+ y: 0.006
220
+ at:
221
+ segment: overview-narration
222
+ phrase: "canary health"
223
+ boundary: start
224
+ offset_ms: 0
225
+ duration_ms: 1600
226
+ ```
227
+
228
+ In the SlideVideo repository, `examples/slidev-theme-slidevideo/` provides a complete `16:9` Slidev theme with `<MonitorWindow>`, `<SvCard id="...">`, local `.woff2` fonts, and lower-right watermark clearance. Bundling a cleared starter deck and storyboard directly inside the published `@slidevideo/cli` npm package is tracked in https://github.com/bitbeamer/slidevideo/issues/53.
@@ -2,21 +2,25 @@
2
2
 
3
3
  ## Set up the host
4
4
 
5
- Use the installed `slidevideo` executable in the presentation folder. Run `slidevideo setup` to select your presentation format and speech provider, or `slidevideo setup --help` for setup options. Windows PowerShell can use `slidevideo.cmd` when execution policy blocks the generated `.ps1` launcher.
5
+ Use the installed `slidevideo` executable in the presentation folder. Check host readiness without prompts or changes by running `slidevideo setup --manual --json`. In non-interactive shells, `slidevideo setup` exits `3` when prerequisites are missing unless you pass `--install`. Run `slidevideo setup --install --json` to install supported missing tools, and pass `--presentation slidev` or `--presentation powerpoint` and `--provider edge-tts` or `--provider elevenlabs` to scope checks and installation. Run `slidevideo skill --install` to link the bundled skill into `~/.agents/skills/slidevideo`, or add `--project` for project-local registration. Windows PowerShell can use `slidevideo.cmd` when execution policy blocks the generated `.ps1` launcher.
6
6
 
7
- Slidev needs its browser runtime. Native PowerPoint needs installed desktop PowerPoint on Windows with an unlocked interactive desktop. Both use FFmpeg and ffprobe. Edge TTS uses the pinned local Python adapter. Provider credentials belong in environment variables or a local `.env`, never in storyboards or chat output.
7
+ Slidev needs its browser runtime. Native PowerPoint needs installed desktop PowerPoint on Windows with an unlocked interactive desktop. Both use FFmpeg and ffprobe. Edge TTS uses the pinned local Python adapter. Interactive `slidevideo setup` saves an ElevenLabs API key in the mode-`600` per-user config file reported as `config_file` by `slidevideo setup --manual --json`. In non-interactive environments, set `ELEVENLABS_API_KEY` in the environment or in a mode-`600` `.env` file in the working directory, or write `"elevenlabs_api_key"` in that mode-`600` per-user `config.json`. Never print credentials or `.env` values, and never place credentials in storyboards or chat output.
8
+
9
+ To discover valid Edge TTS voice names, run `<edge-python> -m edge_tts --list-voices` using the `python` path reported in `slidevideo setup --manual --json`. To discover ElevenLabs voice IDs, copy an ID from the ElevenLabs dashboard or query `https://api.elevenlabs.io/v1/voices` with the `xi-api-key` header and read `voices[].voice_id` and `voices[].name`.
8
10
 
9
11
  Keep the existing presentation as input. The production CLI does not require an AI agent to author intermediate files or an authoring script to recreate the deck. Narration text is authored in the storyboard, and the selected TTS service synthesizes its audio.
10
12
 
11
13
  ## Choose the operation
12
14
 
13
- For an authoring or explanation request, return the draft, revision or answer without starting production. When validation is requested, use `validate`; it checks syntax, references and capabilities without requesting speech or recording. Pending phrase alignment is checked later, during resolution.
15
+ Before drafting a storyboard for an existing presentation, run `slidevideo inspect --deck <file> --json` to list slide targets, click counts, media IDs, and highlight targets without generating speech or recording. For an authoring or explanation request, return the draft, revision, or answer without starting production. When validation is requested, use `validate`; it checks syntax, references, and capabilities without requesting speech or recording. Pending phrase alignment is checked later, during resolution.
16
+
17
+ For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Pass `--width` and `--height` together as even integers from `640` to `3840` wide and `360` to `2160` high to test a non-default viewport; the default is `1920` by `1080`. Add `--cache-dir <directory>` to use retained speech timing. The player estimates uncached narration duration and requires matching alignment for phrase cues. All audio stays silent. Keep the CLI running while the creator uses the browser controls. Stop and relaunch it after storyboard edits.
14
18
 
15
- For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Add `--cache-dir <directory>` to use retained speech timing. The player estimates uncached narration duration and requires matching alignment for phrase cues. All audio stays silent. Keep the CLI running while the creator uses the browser controls. Stop and relaunch it after storyboard edits.
19
+ For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation, and assembles the MP4 at `1920` by `1080` and `30 fps` by default. Pass `--width` and `--height` together and optional `--fps` of `15`, `24`, `30`, or `60` to `build` or `record` to select another resolution or frame rate. `record` and `build` bind `width`, `height`, and `fps` in the run manifest. `assemble` and `build --resume` inherit those settings and fail with `RUN_MODE_MISMATCH` when you pass conflicting values.
16
20
 
17
- For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation and assembles the MP4. Use a new run directory and pass `--cache-dir` when the creator has a speech cache.
21
+ `tts` and `resolve` reject `--width`, `--height`, and `--fps` because speech cache keys and millisecond schedules are independent of pixel dimensions. Changing from `1280` by `720` to `1920` by `1080` requires a new run directory for capture and assembly while reusing cached speech and alignment through `--cache-dir`. Scaling within the same aspect ratio preserves Slidev layout and frame-fixed `overlays[].box` placement, while changing aspect ratio alters Slidev letterboxing and fails `POWERPOINT_CAPABILITY` when it diverges from a `.pptx` deck's slide size.
18
22
 
19
- Use staged commands when an intermediate result is useful to the creator. `tts` prepares audio and alignment, `resolve` calculates the schedule, `record` captures from resolved inputs, and `assemble` produces the final MP4. A requested narration review can occur after `tts` and before capture. `record` does not generate speech implicitly.
23
+ Use staged commands when an intermediate result is useful to the creator. `tts` prepares audio and alignment, `resolve` calculates the schedule, `record` captures from resolved inputs, and `assemble` produces the final MP4. Begin with a new or empty run directory. Commands reject a nonempty directory without a run manifest before writing run artifacts. A requested narration review can occur after `tts` and before capture. `record` does not generate speech implicitly.
20
24
 
21
25
  Run `slidevideo --help` for command options. To record the presentation in the current folder, run the following command.
22
26
 
@@ -26,19 +30,19 @@ slidevideo build --storyboard slidevideo.yaml --run runs/video-001 --json
26
30
 
27
31
  That run directory must be new or empty. A nonzero exit, failed status or missing requested completed stages is failure. A completed normal build reports `status: completed` and `timing_status: not_evaluated`, with a video artifact path.
28
32
 
29
- ## Produce marker highlights
33
+ ## Produce marker highlights and underlines
30
34
 
31
- Use version 2 and follow the [marker field reference](storyboard.md#version-2-marker-highlights). Discover actual targets with `slidevideo inspect --storyboard <file> --json`. Existing Slidev selectors and native shape IDs belong to their adapters. Regions use normalized slide coordinates. Do not edit the source deck to introduce targets.
35
+ Follow the [marker reference](storyboard.md#marker-highlights) and [underline reference](storyboard.md#underline-annotations). Discover actual slide names, click counts, media declarations, and annotation targets with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json`. Pass `--width` and `--height` together with `inspect` to check a non-default viewport. Existing Slidev selectors and native shape IDs belong to their adapters. Regions use normalized slide coordinates. Preserve existing decks by default, and follow [deck compatibility](decks.md) when the creator asks to create or edit slides or add target IDs.
32
36
 
33
- Use the same `validate` and `build` commands for a storyboard with markers. The assembler draws highlights on the captured frames. A changed annotation needs a new run and can reuse matching speech.
37
+ Use the same `validate` and `build` commands for a storyboard with annotations. The assembler draws highlights and underlines on the captured frames. A changed annotation needs a new run and can reuse matching speech.
34
38
 
35
- Inspect geometry observations, `assembly/annotations-applied.json` and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks decoded final frames and retains `assembly/annotations-evidence.json`. Unobservable boundaries fail explicitly. [Marker limits and target types](storyboard.md#version-2-marker-highlights)
39
+ Inspect geometry observations, `assembly/annotations-applied.json`, and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks native-resolution decoded final frames, including interior wipe samples for animated underlines, and retains `assembly/annotations-evidence.json`. Unobservable strokes or boundaries fail explicitly. [Marker limits and target types](storyboard.md#marker-highlights)
36
40
 
37
41
  ## Reuse speech and preserve revisions
38
42
 
39
43
  Speech reuse depends on the segment text, provider, voice, options and adapter version. Keep generated speech in a cache to reuse matching audio and alignment on later recordings, including paid ElevenLabs narration.
40
44
 
41
- After feedback changes the storyboard, choose a new run and reuse compatible speech through the cache. `build --resume` is for unchanged inputs and intact completed stages. It cannot apply an edited storyboard to an old run. Never overwrite failed recording evidence. Follow an explicit user cleanup request separately from production.
45
+ After feedback changes the storyboard, choose a new run and reuse compatible speech through the cache. `build --resume` is for unchanged inputs and intact completed stages. It cannot apply an edited storyboard to an old run. An occupied destination does not bind a fresh assembly attempt. Retry `assemble` with another output filename and the same retained capture. Never overwrite failed recording evidence. Follow an explicit user cleanup request separately from production.
42
46
 
43
47
  Keep authored intent, actual alignment, resolved timing, observed execution and decoded-frame evidence separate. Do not estimate word timings from text length, edit generated alignment or stretch narration to hide drift. Capture follows timing resolved from the exact speech and media.
44
48
 
@@ -56,10 +60,11 @@ Staged `assemble` and resumed builds inherit the run's timing mode. Changing tha
56
60
 
57
61
  | Diagnostic | Relevant response |
58
62
  | --- | --- |
63
+ | `NEW_RUN_REQUIRED` | Preserve the existing files and choose a new or empty run directory. Use `build --resume` only for initialized runs with unchanged inputs. |
59
64
  | `SCHEMA`, `DUPLICATE_ID`, reference errors | Correct the authored fields or references against the storyboard reference. |
60
65
  | `CUE_ALIGNMENT_REQUIRED`, `CUE_PHRASE_MISSING`, `CUE_AMBIGUOUS`, `CUE_BOUNDARY` | Inspect the exact paired transcript and alignment. Revise the intended phrase or action with the creator. Do not invent timings. |
61
66
  | `REVEAL_TARGET`, `REVEAL_ORDER`, `ACTION_CONFLICT`, `MEDIA_NAVIGATION`, `SCENE_DURATION` | Check the merged sequence and cues, active slide, click order and reserved durations. |
62
- | `RUN_MISMATCH`, `SCHEDULE_MISMATCH` | Start a new run for the revised inputs. |
67
+ | `RUN_MISMATCH`, `RUN_MODE_MISMATCH`, `SCHEDULE_MISMATCH` | Start a new run for revised inputs, timing-verification mode, or output dimensions and frame rate. |
63
68
  | `RECORD_RETRY_NEW_RUN` | Preserve the failed capture and use a new run for another attempt. |
64
69
  | `MEDIA_SOURCE_MISMATCH` | Confirm the declaration matches the exact media bytes rendered by the deck. |
65
70
  | Browser preparation or capture failure | Read the run's `recording/slidev.log` and check the configured native Chromium executable. |
@@ -14,28 +14,17 @@ IDs and slide targets use `^[a-zA-Z][a-zA-Z0-9_-]*$`. They start with an ASCII l
14
14
 
15
15
  | Field | Required | Meaning |
16
16
  | --- | --- | --- |
17
- | `version` | Yes | `1` for the unchanged original contract; `2` adds required `annotations`. |
17
+ | `version` | Yes | Schema version. Always `1`. |
18
18
  | `deck` | Yes | Nonempty path to an existing Slidev `.md` or native PowerPoint `.pptx` input. |
19
19
  | `voice` | No | Default voice for narration. Every spoken segment needs either this default or its own voice. Silent productions can omit it. |
20
- | `output` | Yes | Requested video dimensions and frame rate. |
21
20
  | `media` | Yes | Array of declared source media. `[]` is valid when none is used. |
22
21
  | `narration` | Yes | Array of text segments. `[]` supports a silent or source-audio-only production. |
23
22
  | `scenes` | Yes | Ordered scenes and their sequential actions. Total resolved production duration must be positive. |
24
23
  | `cues` | Yes | Array of phrase-driven visual actions. `[]` is valid. |
25
- | `annotations` | Version 2 only | Array of phrase-triggered rectangular marker highlights; `[]` preserves ordinary production. Version 1 rejects this field. |
26
- | `overlays` | No, version 2 only | Frame-fixed image layers for the exported video. |
24
+ | `annotations` | Yes | Array of phrase-triggered slide annotations (`highlight` and `underline`). Use `[]` when none are needed. |
25
+ | `overlays` | No | Frame-fixed image layers for the exported video. |
27
26
 
28
- Required fields have no implicit root defaults. Examples commonly choose 1920 by 1080 at 30 fps, but those values must be authored.
29
-
30
- ## Output fields
31
-
32
- | Field | Required | Accepted values |
33
- | --- | --- | --- |
34
- | `output.width` | Yes | Even integer from 640 to 3840. |
35
- | `output.height` | Yes | Even integer from 360 to 2160. |
36
- | `output.fps` | Yes | `15`, `24`, `30` or `60`. |
37
-
38
- PowerPoint requires the output aspect ratio to match the deck. Its native slideshow window is capped at 1600 physical pixels wide. The recorder scales the captured slide to the requested output dimensions.
27
+ Configure video dimensions and frame rate on the CLI with `--width`, `--height`, and `--fps`, defaulting to `1920` by `1080` at `30 fps`.
39
28
 
40
29
  ## Voice fields and provider options
41
30
 
@@ -57,7 +46,7 @@ ElevenLabs option values are:
57
46
  | `similarity_boost` | Number from 0 to 1. | Provider default. |
58
47
  | `speed` | Number from 0.7 to 1.2. | Provider default. |
59
48
 
60
- Credentials come from the environment or local `.env`, never from YAML. ElevenLabs accepts `ELEVENLABS_API_KEY` or the legacy `ELEVENLABS_KEY`. Edge uses the pinned local Python adapter. Run `slidevideo setup` to configure your speech provider.
49
+ Credentials never belong in YAML. Run `slidevideo setup` in a terminal or `slidevideo setup --install --json` in a non-interactive shell to prepare speech providers. Interactive setup saves one ElevenLabs API key in the mode-`600` per-user config file reported by `slidevideo setup --manual --json`. In non-interactive shells, set `ELEVENLABS_API_KEY` in the environment or a mode-`600` `.env` file, or save `"elevenlabs_api_key"` in that mode-`600` `config.json`. Edge uses the pinned local Python adapter. List valid Edge voice names with `<edge-python> -m edge_tts --list-voices` using the `python` path from `slidevideo setup --manual --json`. List ElevenLabs voice IDs from the ElevenLabs dashboard or `https://api.elevenlabs.io/v1/voices` using the `xi-api-key` header. Provider and voice selection remain in the storyboard.
61
50
 
62
51
  ## Media declarations
63
52
 
@@ -147,8 +136,9 @@ The storyboard reserves intended durations. The resolved schedule establishes ex
147
136
  | Slide changes | Authored deck transition, with a matching settling allowance. | Cuts. Native slide transitions, timed advancement, hidden slides and interactive sequences are unsupported. |
148
137
  | Video | Managed media element with a matching declared source. Trims and rates follow the shared action contract. | Full embedded video at rate 1, with exact source-byte matching. No native trim, autoplay, loop, rewind or fullscreen transform. |
149
138
  | Runtime | Playwright-controlled Chromium and the playback addon. | Windows desktop PowerPoint and FFmpeg native window capture on an unlocked interactive desktop. |
139
+ | Viewport and aspect ratio | Scales the deck to `--width` and `--height`, letterboxing when the aspect ratio differs from the slide canvas. | `--width` and `--height` must match the native PowerPoint slide aspect ratio. The native slideshow window is capped at 1600 physical pixels wide and scaled to output dimensions. |
150
140
 
151
- Linked or online media and unsupported dynamic PowerPoint objects fail capability validation. Inspect the deck's existing animations and media before scheduling them in the storyboard.
141
+ Linked or online media and unsupported dynamic PowerPoint objects fail capability validation. Run `slidevideo inspect --deck <file> --json` to list slide targets, `slide-<SlideID>` aliases, click counts, native click-group durations, media IDs, and unsupported native features before scheduling them in the storyboard.
152
142
 
153
143
  ## Minimal authored example
154
144
 
@@ -160,10 +150,6 @@ deck: ./slides.pptx
160
150
  voice:
161
151
  provider: edge-tts
162
152
  voice: en-US-AriaNeural
163
- output:
164
- width: 1920
165
- height: 1080
166
- fps: 30
167
153
  media: []
168
154
  narration:
169
155
  - id: welcome
@@ -179,6 +165,7 @@ scenes:
179
165
  type: hold
180
166
  duration_ms: 1000
181
167
  cues: []
168
+ annotations: []
182
169
  ```
183
170
 
184
171
  For Slidev, set `deck` to your Markdown presentation path, such as `./slides.md`, and use its slide's frontmatter name as the scene's `slide` value.
@@ -189,11 +176,11 @@ Changing narration text, voice, provider options or adapter version invalidates
189
176
 
190
177
  Changing only a hold can reuse unchanged speech through a matching cache. A changed storyboard or deck requires a new run. Existing completed stages cannot be resumed against edited inputs.
191
178
 
192
- The YAML has no fields for output filenames, run directories, caches, credentials, timeouts or timing-verification mode. Those belong to CLI options or the environment. It also has no arbitrary absolute action timestamp or dedicated settings for captions, background music or automatic ducking. Extra fields are rejected rather than silently interpreted.
179
+ The YAML has no fields for output dimensions, frame rate, output filenames, run directories, caches, credentials, timeouts, or timing-verification mode. Those belong to CLI options or the environment. It also has no arbitrary absolute action timestamp or dedicated settings for captions, background music, or automatic ducking. Extra fields are rejected rather than silently interpreted.
193
180
 
194
- ## Version 2 marker highlights
181
+ ## Marker highlights
195
182
 
196
- Version 2 keeps all v1 fields and requires `annotations`. Its [schema](../../../schemas/storyboard.v2.json) accepts only the implemented `highlight` effect. Each annotation has globally unique `id`, `scene`, `target`, `effect`, `appearance`, `at` and `duration_ms` fields. The `at` object has exactly the phrase-cue semantics above, including occurrence, boundary and offset. The phrase must belong to narration scheduled in that scene.
183
+ The [storyboard schema](../../../schemas/storyboard.v1.json) requires `annotations` and accepts the `highlight` and `underline` effects. Each annotation has globally unique `id`, `scene`, `target`, `effect`, `appearance`, `at`, and `duration_ms` fields, plus optional `motion` where the effect defines it. The `at` object has the same phrase-cue rules described above, including occurrence, boundary, and offset. The phrase must belong to narration scheduled in that scene.
197
184
 
198
185
  ```yaml
199
186
  annotations:
@@ -215,33 +202,79 @@ annotations:
215
202
  duration_ms: 2000
216
203
  ```
217
204
 
218
- Run `slidevideo inspect --storyboard slidevideo.yaml --json` in your presentation folder to find targets in your deck before adapting this example.
205
+ Run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard slidevideo.yaml --json` in your presentation folder to find targets in your deck before adapting this example.
219
206
 
220
207
  | Target | Fields | Adapter |
221
208
  | --- | --- | --- |
222
- | Region | `type: region`, `units: normalized`, `x`, `y`, `width`, `height` | Both. Coordinates use the top-left slide origin, with x/width relative to slide width and y/height relative to slide height. |
223
- | Element | `type: element`, nonempty CSS `selector` | Slidev. Exactly one existing visible element in the active audience slide. |
224
- | Shape | `type: shape`, positive integer `id` | PowerPoint. Existing native shape ID within the active slide, returned by inspection. Names are descriptions, not identities. |
209
+ | Region | `type: region`, `units: normalized`, `x`, `y`, `width`, `height` | Both. Coordinates use the top-left slide origin, with `x` and `width` relative to slide width and `y` and `height` relative to slide height. |
210
+ | Element | `type: element`, nonempty CSS `selector` | Slidev. Matches one visible element in the active audience slide. |
211
+ | Shape | `type: shape`, positive integer `id` | PowerPoint. Matches one native shape ID on the active slide, returned by inspection. Names are descriptions, not identities. |
212
+
213
+ Regions require `x` and `y` in `[0,1]`, positive `width` and `height` at most one, and `x + width` and `y + height` at most one. Appearance color is `#RRGGBB`, and opacity is greater than zero and at most one. Highlight padding has explicit `units: normalized` and `x` and `y` from zero to one, applied on each side relative to slide width and height. Expanded rectangles clip to slide bounds. Pixel mapping uses the actual captured slide-content rectangle, including letterboxing, rather than assuming the slide fills the output. Edges round outward to captured pixels before clipping.
214
+
215
+ Optional `appearance.blend` accepts `source-over` or `darken`, with `source-over` as the default. `darken` combines each channel using the darker source or captured value before applying opacity, keeping dark lettering legible on light backgrounds.
225
216
 
226
- Regions require x/y in `[0,1]`, positive width/height at most one, and x+width/y+height at most one. Appearance color is `#RRGGBB`; opacity is greater than zero and at most one. Padding has explicit `units: normalized` and x/y from zero to one, applied on each side relative to slide width/height. Expanded rectangles clip to slide bounds. Pixel mapping uses the actual captured slide-content rectangle, including letterboxing, rather than assuming the slide fills the output. Edges round outward to captured pixels before clipping.
217
+ Optional `appearance.bottom_border` has required `color`, `opacity`, `units: normalized`, and `height` fields. Color and opacity use the fill ranges, and `height` is greater than zero and at most one, relative to actual slide-content height. The accent extends below the padded rectangle and clips to slide and viewport bounds. It uses normal alpha compositing and the fill's half-open interval. A height of `1/300` represents a 3-pixel accent in a 900-pixel-high source slide. Authored YAML must use the numeric value, such as `0.0033333333333333335`.
227
218
 
228
- Optional `appearance.blend` accepts `source-over` or `darken`, with `source-over` as the default. `darken` combines each channel using the darker source or captured value before applying opacity, retaining dark lettering on light backgrounds.
219
+ Requested final-frame verification reports fill and bottom-border checks separately. Thin accents below two output pixels are unobservable under `yuv420p` chroma subsampling and fail requested proof explicitly. Normal production leaves timing unevaluated.
229
220
 
230
- Optional `appearance.bottom_border` has required `color`, `opacity`, `units: normalized` and `height` fields. Color and opacity use the fill ranges; height is greater than zero and at most one, relative to actual slide-content height. The accent extends below the padded rectangle and clips to slide and viewport bounds. It uses normal alpha compositing and exactly the fill's half-open interval. A height of `1/300` represents a 3-pixel accent in a 900-pixel-high source slide. Authored YAML must use the numeric value, such as `0.0033333333333333335`.
221
+ The duration is positive milliseconds. An interval containing no output frame at the selected frame rate fails with `ANNOTATION_FRAME_RANGE`. Intervals are half-open `[start,end)` and do not extend scenes. They must fit one scene, slide visit, and settled reveal state. An annotation may end at a navigation or reveal boundary, and it cannot cross one or start during settling. Array order sets the drawing order, so later annotations draw above earlier ones. The first active frame is the first output frame at or after the resolved start, and removal begins on the first frame at or after the end.
231
222
 
232
- Requested final-frame verification reports fill and bottom-border checks separately. Thin accents may be unobservable at the analysis resolution and fail requested proof explicitly. Normal production still leaves timing unevaluated.
223
+ Targets are stationary, visible, and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, grouped, masked, clipped, or moving targets fail with annotation context. Slidev excludes navigation, notes, and duplicate hidden slide instances and samples geometry each animation frame. Native shape support excludes groups and members, cropped pictures, paragraph animations, and hide or dim-after-animation effects, and supported entrances must have settled. PowerPoint schedules native geometry samples 50 ms apart. Movement above 0.5 output pixels invalidates the target. Sampling checks the documented stationary subset rather than tracking moving targets or recognizing pixels.
224
+
225
+ For a PowerPoint shape, use a target such as `{ type: shape, id: 2 }` when `slidevideo inspect --deck slides.pptx --json` or `slidevideo inspect --storyboard slidevideo.yaml --json` lists that ID on the selected slide without unsupported shape diagnostics.
226
+
227
+ Raw captures contain no annotations. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification decodes final frames at native output resolution and checks the expected visible and clear states near interval boundaries. Tiny, low-contrast, or obscured regions, or an end with no following output frame, fail requested proof explicitly. Text-range discovery and word following are not implemented.
228
+
229
+ ## Underline annotations
230
+
231
+ Use `effect: underline` in `annotations` to draw a standalone horizontal stroke under a stationary `region`, Slidev `element`, or PowerPoint `shape` without drawing a box fill.
232
+
233
+ ```yaml
234
+ annotations:
235
+ - id: title-underline
236
+ scene: opening
237
+ target:
238
+ type: element
239
+ selector: h1
240
+ effect: underline
241
+ appearance:
242
+ color: '#2563eb'
243
+ opacity: 0.95
244
+ style: solid
245
+ units: normalized
246
+ width: 0.006
247
+ offset: 0.004
248
+ padding_x: 0.005
249
+ motion:
250
+ type: wipe
251
+ in_ms: 250
252
+ out_ms: 200
253
+ at:
254
+ segment: introduction
255
+ phrase: A storyboard
256
+ boundary: start
257
+ offset_ms: 0
258
+ duration_ms: 2000
259
+ ```
233
260
 
234
- The duration is positive milliseconds. An interval containing no output frame at the selected frame rate fails with `ANNOTATION_FRAME_RANGE`. Intervals are half-open `[start,end)` and do not extend scenes. They must fit one scene, slide visit and settled reveal state. A highlight may end exactly at a navigation/reveal boundary, but cannot cross it or start during settling. Array order is the drawing order; later annotations cover earlier ones. The first active frame is the first output frame at or after the resolved start, and removal begins on the first frame at or after the end.
261
+ Underline `appearance` accepts these fields:
235
262
 
236
- Targets are stationary, visible and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, grouped, masked, clipped or moving targets fail with annotation context. Slidev excludes navigation, notes and duplicate hidden slide instances and samples geometry each animation frame. Native shape support excludes groups and members, cropped pictures, paragraph animations and hide/dim-after-animation effects; supported entrances must have settled. PowerPoint schedules native geometry samples 50 ms apart. A change exceeding 0.5 output pixels invalidates the target. Sampling establishes the documented subset, not arbitrary moving-target tracking or pixel recognition.
263
+ - `color` is `#RRGGBB`, and `opacity` is greater than zero and at most one.
264
+ - Optional `blend` accepts `source-over` or `darken` and defaults to `source-over`.
265
+ - Optional `style` accepts `solid` or `dashed` and defaults to `solid`. Dashed underlines anchor dash positions to the left edge of each fragment so dashes do not slide during an exit wipe.
266
+ - `units` is `normalized`.
267
+ - `width` is greater than zero and at most one, scaled by the captured slide-content height to determine stroke thickness.
268
+ - Optional `offset` ranges from `-1` to `1` in normalized slide-height units and defaults to `0`, placing the top of the stroke along the target's bottom edge. Positive values move the stroke downward, and negative values pull it upward inside the target box.
269
+ - Optional `padding_x` ranges from `0` to `1` in normalized slide-width units and defaults to `0`, extending the stroke horizontally on both sides before slide-content clipping.
237
270
 
238
- For a PowerPoint shape, use a target such as `{ type: shape, id: 2 }` when inspection lists that ID on the selected slide. Inspect the deck in desktop PowerPoint on Windows to determine native layout and visibility.
271
+ Optional `motion` accepts `{ type: wipe, in_ms, out_ms }`. `in_ms` and `out_ms` are nonnegative durations in milliseconds and default to `0`. `in_ms` sweeps the right edge of the underline from left to right at the start of the interval, and `out_ms` sweeps the left edge from left to right at the end. When `in_ms + out_ms` exceeds `duration_ms`, validation fails with `ANNOTATION_MOTION`.
239
272
 
240
- Raw captures contain no highlights. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification also decodes final frames and checks the expected visible/clear state near both interval boundaries. Tiny, low-contrast or fully obscured regions, or an end with no following output frame, cannot establish this proof and fail explicitly. No extra effect, entrance/exit animation, text-range discovery or word following is accepted.
273
+ When a static `region` underline places the stroke completely outside `[0, 1]` vertically (`y + height + offset >= 1` or `y + height + offset + width <= 0`), validation fails with `ANNOTATION_BOUNDS`. When runtime slide-content clipping reduces an underline fragment's width or height to zero pixels, assembly fails with `ANNOTATION_GEOMETRY`. With `--verify-timing`, the analyzer checks native-resolution boundary frames and interior `wipe_in` and `wipe_out` progression frames. Strokes thinner than two output pixels or wipe durations with no observable partial frame at the selected frame rate fail requested timing verification explicitly.
241
274
 
242
- ## Version 2 image overlays
275
+ ## Image overlays
243
276
 
244
- Add these root fields to a version 2 storyboard. Use your own image paths and scene IDs.
277
+ Add these root fields to the storyboard. Use your own image paths and scene IDs.
245
278
 
246
279
  ```yaml
247
280
  annotations: []