@slidevideo/cli 0.3.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: slidevideo
3
- description: Draft, explain, review, and revise slidevideo.yaml storyboards for Slidev or PowerPoint presentations, create or adapt SlideVideo-compatible slides when requested, and operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, underlines, spotlights, zoom and pan, laser pointers, stamps and badges, image overlays, pauses, media, voice settings, deck compatibility, and production feedback.
3
+ description: Draft, explain, review, and revise slidevideo.yaml storyboards for Slidev or PowerPoint presentations, create or adapt SlideVideo-compatible slides when requested, and operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, underlines, spotlights, zoom and pan, laser pointers, stamps and badges, arrows, image overlays, pauses, media, voice settings, deck compatibility, and production feedback.
4
4
  ---
5
5
 
6
6
  # Author and produce a SlideVideo
@@ -19,7 +19,7 @@ Run `slidevideo skill production` for the [production workflow](references/produ
19
19
 
20
20
  Read the supplied deck, existing storyboard, brief and supporting material. Identify the intended audience, narration language, tone, length and voice from the request. Ask only for missing information that affects a useful draft. Keep reasonable draft assumptions visible for review.
21
21
 
22
- Inspect actual slide targets, reveal steps, effect durations, and embedded-media names with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json` when revising one. For Slidev, account for imports and the effective slide order. For PowerPoint, use native slide names or actual SlideID aliases, native click-group durations, and video `Shape.Name` values. Do not invent targets or claim unknown animation bounds are verified.
22
+ Inspect actual slide targets, reveal steps, speaker notes (`slides[].notes`), effect durations, and embedded-media names with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json` when revising one. For Slidev, account for imports and the effective slide order. For PowerPoint, use native slide names or actual SlideID aliases, native click-group durations, speaker notes, and video `Shape.Name` values. Do not invent targets or claim unknown animation bounds are verified.
23
23
 
24
24
  Preserve an existing supplied `.md` or `.pptx` deck by default so storyboard work never rewrites the creator's slides unprompted. Create or edit slides when the creator asks to build a deck from notes, screenshots, or clips, requests slide changes, or approves adding stable `name` fields or element `id` attributes needed by requested storyboard actions or `annotations`. Follow the [deck compatibility reference](references/decks.md) when creating or editing slides, and never overwrite a supplied deck with an unrelated example script.
25
25
 
@@ -37,7 +37,7 @@ Use stable IDs and paths relative to the storyboard. Include all required root f
37
37
 
38
38
  For marker highlights, underlines, spotlights, and zoom/pan, run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard <file> --json` to discover existing audience-slide selectors, native shape IDs, and shape text previews. Inspect the deck and returned visibility/click information before choosing a target. Use `target: { type: text, text, container?, occurrence? }` to target visible slide phrases or words directly without wrapping Slidev copy in `<span>` tags. Regions need no element metadata. Never reference a nonexistent element ID in `slidevideo.yaml`, infer words inside an image, or claim whole-shape bounds establish word geometry. When a Slidev slide lacks a stable selector for a whole-card highlight and normalized regions are a poor fit, add a targeted `id` attribute only when slide creation or editing is part of the request or approved by the creator.
39
39
 
40
- Use the `annotations` array for `highlight`, `underline`, `spotlight`, `zoom`, `laser`, and `stamp` effects. The [marker reference](references/storyboard.md#marker-highlights), [underline reference](references/storyboard.md#underline-annotations), [spotlight reference](references/storyboard.md#spotlight-annotations), [zoom reference](references/storyboard.md#zoom-and-pan), [laser pointer reference](references/storyboard.md#laser-pointer), and [stamp and badge reference](references/storyboard.md#stamp-and-badge-annotations) cover Slidev and PowerPoint. Bind each annotation to a scene using either `at` (a phrase cue or an explicit scene-relative millisecond offset) with an explicit positive `duration_ms` or `follow` against retained speech alignment (`mode: words` for word-by-word read-along on `type: text` targets, or `mode: phrase` for exact spoken-span lifetimes), keeping every resolved interval inside one settled slide visit and reveal state. Choose visible `text` targets, normalized regions, normalized points (for `stamp`), Slidev element selectors, native PowerPoint shape IDs, or slide-relative `path` waypoints (for `laser`) as appropriate. Keep highlight padding and optional `bottom_border` under `highlight`, use `underline` for standalone solid or dashed strokes with normalized `width`, optional `offset` and `padding_x`, and optional `motion: { type: wipe }`, use `spotlight` to dim the surrounding slide while keeping `rounded-rect` or `ellipse` apertures bright (with optional `padding`, `radius`, `softness`, and `motion: { type: fade }`), use `zoom` to smoothly pan and magnify a target (with optional `fit`, `scale`, `max_scale`, `padding`, and `motion: { type: ease }`) while keeping attached annotations locked to slide content and `overlays`/watermarks frame-fixed, use `laser` to move a glowing pointer with optional dwell and decaying trail along normalized or target-anchored waypoints without clicking or mutating the deck, and use `stamp` to place reproducible bundled-font text and/or vector symbols (`check`, `cross`, `warning`, `star`, `info`, `arrow-right`) with optional background, border, rotation, multiline wrapping, and `fade` or `pop` motion. Moving targets, overlapping `zoom` intervals, and unimplemented effects are unsupported.
40
+ Use the `annotations` array for `highlight`, `underline`, `spotlight`, `zoom`, `laser`, `stamp`, and `arrow` effects. The [marker reference](references/storyboard.md#marker-highlights), [underline reference](references/storyboard.md#underline-annotations), [spotlight reference](references/storyboard.md#spotlight-annotations), [zoom reference](references/storyboard.md#zoom-and-pan), [laser pointer reference](references/storyboard.md#laser-pointer), [stamp and badge reference](references/storyboard.md#stamp-and-badge-annotations), and [arrow reference](references/storyboard.md#arrow-annotations) cover Slidev and PowerPoint. Bind each annotation to a scene using either `at` (a phrase cue or an explicit scene-relative millisecond offset) with an explicit positive `duration_ms` or `follow` against retained speech alignment (`mode: words` for word-by-word read-along on `type: text` targets, or `mode: phrase` for exact spoken-span lifetimes), keeping every resolved interval inside one settled slide visit and reveal state. Choose visible `text` targets, normalized regions, normalized points (for `stamp`), Slidev element selectors, native PowerPoint shape IDs, slide-relative `path` waypoints (for `laser`), or slide-relative `connector` endpoints (`from`/`to` with explicit `anchor` on target attachments for `arrow`) as appropriate. Keep highlight padding and optional `bottom_border` under `highlight`, use `underline` for standalone solid or dashed strokes with normalized `width`, optional `offset` and `padding_x`, and optional `motion: { type: wipe }`, use `spotlight` to dim the surrounding slide while keeping `rounded-rect` or `ellipse` apertures bright (with optional `padding`, `radius`, `softness`, and `motion: { type: fade }`), use `zoom` to smoothly pan and magnify a target (with optional `fit`, `scale`, `max_scale`, `padding`, and `motion: { type: ease }`) while keeping attached annotations locked to slide content and `overlays`/watermarks frame-fixed, use `laser` to move a glowing pointer with optional dwell and decaying trail along normalized or target-anchored waypoints without clicking or mutating the deck, use `stamp` to place reproducible bundled-font text and/or vector symbols (`check`, `cross`, `warning`, `star`, `info`, `arrow-right`) with optional background, border, rotation, multiline wrapping, and `fade` or `pop` motion, and use `arrow` to draw straight solid or dashed arrows with `filled` or `open` arrowheads, endpoint padding, and optional `fade` or `draw` motion. Moving targets, overlapping `zoom` intervals, curved arrows, and unimplemented effects are unsupported.
41
41
 
42
42
  Add, change or remove only the requested annotation and preserve unrelated annotations, narration, scene actions, media, IDs and settings. A new video after an annotation-only edit needs a new run and can reuse matching speech. Validate the draft through the real CLI. Required phrase alignment and actual target geometry are checked during resolution and capture. Highlights are composited into the final MP4, so ordinary deck playback and the raw recording remain unannotated.
43
43
 
@@ -12,7 +12,7 @@ Keep the existing presentation as input. The production CLI does not require an
12
12
 
13
13
  ## Choose the operation
14
14
 
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.
15
+ Before drafting a storyboard for an existing presentation, run `slidevideo inspect --deck <file> --json` to list slide targets, click counts, speaker notes (`slides[].notes`), media IDs, and highlight targets without generating speech or recording. You can also run `slidevideo init --deck <file>` to scaffold a starter `slidevideo.yaml` directly from slide structure, speaker notes, and reveal clicks. 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
16
 
17
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`. `play` automatically reads retained speech timing and synchronized cached narration audio (with a Mute/Unmute toggle) from `.slidevideo/speech` beside the storyboard; pass `--cache-dir <directory>` to override the cache path or `--no-cache` to ignore cached speech. Uncached segments estimate duration and stay silent while embedded media stays muted. Phrase cues and `follow` annotations require matching alignment. Keep the CLI running while the creator uses the browser controls, timeline scrubber, and scene selector. Stop and relaunch it after storyboard edits.
18
18
 
@@ -533,7 +533,63 @@ Stamp `appearance` requires at least one of `text` or `symbol` and accepts these
533
533
  - Optional `rotation_deg` rotates the stamp in degrees (`[-180, 180]`, default `0`).
534
534
  - Optional `max_width` (`(0, 1]` normalized slide width) enables word wrapping; optional `align` (`left`, `center` default, `right`) aligns multiline text; optional `overflow` selects `error` (default, fails with `STAMP_OVERFLOW` if an unbreakable word exceeds `max_width` or the rotated box extends outside slide bounds) or `clip`.
535
535
 
536
- Optional `motion` accepts `{ type: fade, in_ms?, out_ms? }` or `{ type: pop, in_ms?, out_ms?, start_scale? }` (`start_scale` in `[0.2, 2.5]`, default `1.35`). `in_ms + out_ms` must fit within the resolved duration (`ANNOTATION_MOTION`). Active stamps clip to the slide-content rectangle, render above `spotlight`, `highlight`, and `underline` annotations (and beneath `laser` pointers), follow any active `zoom` view transform, and stay beneath frame-fixed `overlays` and the watermark. With `--verify-timing`, the analyzer checks stamp appearance and clearance at interval boundaries.
536
+ Optional `motion` accepts `{ type: fade, in_ms?, out_ms? }` or `{ type: pop, in_ms?, out_ms?, start_scale? }` (`start_scale` in `[0.2, 2.5]`, default `1.35`). `in_ms + out_ms` must fit within the resolved duration (`ANNOTATION_MOTION`). Active stamps clip to the slide-content rectangle, render above `spotlight`, `highlight`, `underline`, and `arrow` annotations (and beneath `laser` pointers), follow any active `zoom` view transform, and stay beneath frame-fixed `overlays` and the watermark. With `--verify-timing`, the analyzer checks stamp appearance and clearance at interval boundaries.
537
+
538
+ ## Arrow annotations
539
+
540
+ Use `effect: arrow` in `annotations` to point to a target or connect two declared endpoints with a straight arrow (with phrase-aligned `at` + `duration_ms`, explicit scene-relative numeric `at` + `duration_ms`, or `follow` with `mode: phrase`). Curved or routed arrows are not supported in this first delivery.
541
+
542
+ ```yaml
543
+ annotations:
544
+ - id: point-to-metric
545
+ scene: opening
546
+ target:
547
+ type: connector
548
+ units: normalized
549
+ from:
550
+ x: 0.22
551
+ y: 0.35
552
+ to:
553
+ target:
554
+ type: element
555
+ selector: '#key-metric'
556
+ anchor: left
557
+ padding: 0.015
558
+ effect: arrow
559
+ appearance:
560
+ color: '#ff2d2d'
561
+ opacity: 0.95
562
+ width: 0.006
563
+ style: solid
564
+ head: filled
565
+ head_size: 0.024
566
+ motion:
567
+ type: draw
568
+ in_ms: 250
569
+ out_ms: 200
570
+ follow:
571
+ segment: introduction
572
+ phrase: key metric
573
+ mode: phrase
574
+ ```
575
+
576
+ `target` uses `{ type: connector, units: normalized, from, to }`. Each endpoint (`from` and `to`) is either:
577
+
578
+ - Normalized slide coordinates `{ x, y, padding? }` with `x` and `y` in `[0, 1]`.
579
+ - Target-attached `{ target, anchor, padding? }` where `target` is any `region`, Slidev `element`, PowerPoint `shape`, or `text` target, and `anchor` is **required** (`center`, `top-left`, `top`, `top-right`, `left`, `right`, `bottom-left`, `bottom`, or `bottom-right` on the target's bounding box; attachment points are never chosen silently).
580
+
581
+ Optional `padding` on either endpoint (`[0, 0.25]` in normalized slide-height units, default `0`) trims the start forward along the arrow direction (`from.padding`) or trims the tip back from the target (`to.padding`). Coincident endpoints or padding that collapses the arrow to zero length fail explicitly with `ANNOTATION_GEOMETRY`.
582
+
583
+ Optional arrow `appearance` accepts these fields:
584
+
585
+ - Optional `color` is `#RRGGBB` and defaults to `'#ff2d2d'`.
586
+ - Optional `opacity` is greater than zero and at most one (default `0.95`).
587
+ - Optional `width` is the stroke width in normalized slide-height units (`(0, 0.05]`, default `0.006`).
588
+ - Optional `style` accepts `solid` (default) or `dashed`.
589
+ - Optional `head` accepts `filled` (default, solid triangle) or `open` (chevron).
590
+ - Optional `head_size` is the arrowhead length in normalized slide-height units (`(0, 0.15]`, default `0.024`).
591
+
592
+ Optional `motion` accepts `{ type: fade, in_ms?, out_ms? }` or `{ type: draw, in_ms?, out_ms? }` (draws progressively from `from` to `to` during `in_ms` and fades out during `out_ms`). `in_ms + out_ms` must fit within the resolved duration (`ANNOTATION_MOTION`). Active arrows clip to the slide-content rectangle, render above `spotlight`, `highlight`, and `underline` annotations (and beneath `stamp` and `laser` annotations), follow any active `zoom` view transform, and stay beneath frame-fixed `overlays` and the watermark. With `--verify-timing`, the analyzer checks arrow appearance and clearance at interval boundaries and interior `draw_in` progression when `motion.type: draw` is used.
537
593
 
538
594
  ## Image overlays
539
595
 
@@ -150,11 +150,41 @@ function Part-Hash($zip, [string]$name) {
150
150
  try { return [BitConverter]::ToString($sha.ComputeHash($stream)).Replace('-', '').ToLowerInvariant() }
151
151
  finally { $sha.Dispose(); $stream.Dispose() }
152
152
  }
153
+ function Read-SlideNotes($zip, [string]$slidePart, $slideRelations) {
154
+ $notesRelation = $null
155
+ foreach ($relationship in $slideRelations.Values) {
156
+ if ($relationship.GetAttribute('TargetMode') -ne 'External' -and $relationship.GetAttribute('Type').EndsWith('/notesSlide')) {
157
+ $notesRelation = $relationship
158
+ break
159
+ }
160
+ }
161
+ if ($null -eq $notesRelation) { return $null }
162
+ $notesPart = Part-Name $slidePart $notesRelation.GetAttribute('Target')
163
+ if ($null -eq $zip.GetEntry($notesPart)) { return $null }
164
+ $notesXml = Read-Part $zip $notesPart
165
+ $paragraphs = [Collections.Generic.List[string]]::new()
166
+ foreach ($shape in $notesXml.SelectNodes('//*[local-name()="sp"]')) {
167
+ $placeholder = $shape.SelectSingleNode('./*[local-name()="nvSpPr"]/*[local-name()="nvPr"]/*[local-name()="ph"][@type="body"]')
168
+ if ($null -eq $placeholder) { continue }
169
+ foreach ($paragraph in $shape.SelectNodes('./*[local-name()="txBody"]/*[local-name()="p"]')) {
170
+ $line = [Text.StringBuilder]::new()
171
+ foreach ($node in $paragraph.SelectNodes('.//*[local-name()="t" or local-name()="br"]')) {
172
+ if ($node.LocalName -eq 'br') { [void]$line.Append("`n") }
173
+ else { [void]$line.Append($node.InnerText) }
174
+ }
175
+ $paragraphs.Add($line.ToString())
176
+ }
177
+ }
178
+ $text = ([string]::Join("`n", $paragraphs.ToArray()) -replace "`r`n?", "`n").Trim()
179
+ if ($text.Length -eq 0) { return $null }
180
+ return $text
181
+ }
153
182
  function Read-Package([string]$file) {
154
183
  $zip = [IO.Compression.ZipFile]::OpenRead($file)
155
184
  $media = [Collections.Generic.List[object]]::new()
156
185
  $unsupported = [Collections.Generic.List[object]]::new()
157
186
  $targets = [Collections.Generic.List[object]]::new()
187
+ $notes = @{}
158
188
  try {
159
189
  foreach ($entry in $zip.Entries) {
160
190
  if ($entry.FullName.EndsWith('.rels')) {
@@ -216,6 +246,8 @@ function Read-Package([string]$file) {
216
246
  $slideRels = Read-Part $zip $relationPart
217
247
  foreach ($relationship in $slideRels.DocumentElement.ChildNodes) { $slideRelations[$relationship.GetAttribute('Id')] = $relationship }
218
248
  }
249
+ $slideNotes = Read-SlideNotes $zip $part $slideRelations
250
+ if ($null -ne $slideNotes) { $notes[$nativeId] = $slideNotes }
219
251
  foreach ($picture in $slideXml.SelectNodes('//*[local-name()="pic"]')) {
220
252
  $video = $picture.SelectSingleNode('.//*[local-name()="videoFile"]')
221
253
  $audio = $picture.SelectSingleNode('.//*[local-name()="audioFile"]')
@@ -259,7 +291,7 @@ function Read-Package([string]$file) {
259
291
  if (($node.HasAttribute('repeatCount') -and $node.GetAttribute('repeatCount') -eq 'indefinite') -or ($node.HasAttribute('repeatDur') -and $node.GetAttribute('repeatDur') -eq 'indefinite')) { $unsupported.Add(@{ slide = [string]$nativeId; reason = 'Unbounded native animation repeats are unsupported.' }) }
260
292
  }
261
293
  }
262
- return @{ media = @($media.ToArray()); unsupported = @($unsupported.ToArray()); targets = @($targets.ToArray()) }
294
+ return @{ media = @($media.ToArray()); unsupported = @($unsupported.ToArray()); targets = @($targets.ToArray()); notes = $notes }
263
295
  } finally { $zip.Dispose() }
264
296
  }
265
297
  function Open-PrivateDeck([bool]$visible) {
@@ -408,7 +440,9 @@ function Inspect-Native($package) {
408
440
  $shapes = @(Inspect-Shapes $slideId $slideWidth $slideHeight $slide.Shapes $targetsByKey $effectsByShape $false)
409
441
  $transitionEffect = [int]$slide.SlideShowTransition.EntryEffect
410
442
  $transitionDurationMs = $(if ($transitionEffect -ne 0) { [Math]::Round([double]$slide.SlideShowTransition.Duration * 1000) } else { 0 })
411
- $slides.Add(@{ id = $slideName; native_id = $slideId; index = [int]$slide.SlideIndex; effects = @($effects.ToArray()); shapes = $shapes; transition = $transitionEffect; transition_duration_ms = $transitionDurationMs; auto_advance = [int]$slide.SlideShowTransition.AdvanceOnTime; hidden = [int]$slide.SlideShowTransition.Hidden; interactive = [int]$slide.TimeLine.InteractiveSequences.Count })
443
+ $slideEntry = @{ id = $slideName; native_id = $slideId; index = [int]$slide.SlideIndex; effects = @($effects.ToArray()); shapes = $shapes; transition = $transitionEffect; transition_duration_ms = $transitionDurationMs; auto_advance = [int]$slide.SlideShowTransition.AdvanceOnTime; hidden = [int]$slide.SlideShowTransition.Hidden; interactive = [int]$slide.TimeLine.InteractiveSequences.Count }
444
+ if ($package.notes.ContainsKey($slideId)) { $slideEntry.notes = $package.notes[$slideId] }
445
+ $slides.Add($slideEntry)
412
446
  foreach ($shape in $slide.Shapes) {
413
447
  if ([int]$shape.Type -eq 16) {
414
448
  $videoShapeId = [int]$shape.Id