@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
@@ -1,48 +1,56 @@
1
- import type { Schedule, SpeechManifest, Storyboard, VisualArtifact, ProductionOptions } from './contracts.js';
1
+ import { type Schedule, type SpeechManifest, type VisualArtifact, type ProductionOptions } from './contracts.js';
2
2
  type AssemblyOptions = ProductionOptions & {
3
3
  licensed?: boolean;
4
4
  inputHashes?: Record<string, string>;
5
+ onOutputReserved?: () => Promise<void>;
5
6
  };
6
- export declare function assemble(story: Storyboard, schedule: Schedule, speech: SpeechManifest, visual: VisualArtifact, directory: string, output: string, options?: AssemblyOptions): Promise<{
7
- output_origin_delta_ms: number;
8
- audio_origin_ms: number;
9
- picture_lead_hold_ms: number;
10
- final_hold: string;
11
- trim_start_ms: number;
12
- trim_end_ms: number;
13
- mapping: import("./contracts.js").CaptureMapping;
14
- transformations: unknown[];
15
- editorial_review: string;
16
- compositor?: {
17
- renderer: string;
18
- version: string;
19
- frames: number;
20
- } | undefined;
21
- base_capture_timing?: "accepted" | "not_evaluated" | undefined;
22
- applied_annotations?: import("./annotations.js").AppliedAnnotation[] | undefined;
23
- final_composite?: {
24
- source: string;
25
- target_ms: number;
26
- checks: Record<string, unknown>[];
27
- gaps: string[];
28
- sha256: string;
29
- base: {
7
+ export declare function assemble(schedule: Schedule, speech: SpeechManifest, visual: VisualArtifact, directory: string, output: string, options?: AssemblyOptions): Promise<{
8
+ report: {
9
+ output_origin_delta_ms: number;
10
+ audio_origin_ms: number;
11
+ picture_lead_hold_ms: number;
12
+ final_hold: string;
13
+ trim_start_ms: number;
14
+ trim_end_ms: number;
15
+ mapping: import("./contracts.js").CaptureMapping;
16
+ transformations: unknown[];
17
+ editorial_review: string;
18
+ compositor?: {
19
+ renderer: string;
20
+ version: string;
21
+ frames: number;
22
+ composited_frames: number;
23
+ readback_frames: number;
24
+ mode: string;
25
+ } | undefined;
26
+ base_capture_timing?: "accepted" | "not_evaluated" | undefined;
27
+ applied_annotations?: import("./annotations.js").AppliedAnnotation[] | undefined;
28
+ final_composite?: {
29
+ source: string;
30
+ target_ms: number;
31
+ coverage: string[];
32
+ checks: Record<string, unknown>[];
33
+ gaps: string[];
34
+ sha256: string;
35
+ base: {
36
+ file: string;
37
+ filter: string;
38
+ };
39
+ version: number;
40
+ status: string;
30
41
  file: string;
31
- filter: string;
32
- };
42
+ } | {
43
+ status: string;
44
+ gaps: string[];
45
+ } | undefined;
46
+ decode: string;
47
+ timing_status: "accepted" | "not_evaluated";
48
+ image_overlays?: import("./contracts.js").ResolvedOverlay[] | undefined;
33
49
  version: number;
34
- status: string;
35
- file: string;
36
- } | {
37
- status: string;
38
- gaps: string[];
39
- } | undefined;
40
- decode: string;
41
- timing_status: "accepted" | "not_evaluated";
42
- image_overlays?: import("./contracts.js").ResolvedOverlay[] | undefined;
43
- version: number;
44
- output: string;
45
- properties: import("./contracts.js").MediaProperties;
46
- watermark: boolean;
50
+ output: string;
51
+ properties: import("./contracts.js").MediaProperties;
52
+ watermark: boolean;
53
+ };
54
+ outputSha256: string;
47
55
  }>;
48
56
  export {};
package/dist/assembly.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { join, dirname } from 'node:path';
2
- import { lstat, mkdir, mkdtemp, link, rm, copyFile } from 'node:fs/promises';
3
- import { execute, probe, decode, saveJson } from './media.js';
2
+ import { lstat, mkdir, mkdtemp, link, rm, copyFile, writeFile } from 'node:fs/promises';
3
+ import { defaultVideoOutput } from './contracts.js';
4
+ import { execute, ffmpegFilterScriptFlags, hashFile, probe, decode, saveJson } from './media.js';
4
5
  import { requireCondition } from './errors.js';
5
6
  import { configuredLicense } from './executables.js';
6
7
  import { annotationApplications, verifyAnnotations } from './annotations.js';
7
- export async function assemble(story, schedule, speech, visual, directory, output, options = { verify_timing: false }) {
8
+ export async function assemble(schedule, speech, visual, directory, output, options = { verify_timing: false, output: defaultVideoOutput }) {
9
+ const video = options.output;
8
10
  const licensed = options.licensed ?? configuredLicense();
9
11
  requireCondition(visual.timing.status !== 'failed' && (!options.verify_timing || visual.timing.status === 'accepted'), 'TIMING_REQUIRED', 'Assembly cannot use failed or missing requested timing proof', 6);
10
12
  const mapping = visual.origin?.mapping ?? (visual.timing.status === 'accepted' ? visual.timing.mapping : undefined);
@@ -32,6 +34,7 @@ export async function assemble(story, schedule, speech, visual, directory, outpu
32
34
  }
33
35
  let temporaryDirectory;
34
36
  try {
37
+ await options.onOutputReserved?.();
35
38
  temporaryDirectory = await mkdtemp(`${output}.partial-`);
36
39
  const temporary = join(temporaryDirectory, 'video.mp4');
37
40
  const args = ['-v', 'error', '-xerror', '-y'];
@@ -45,27 +48,61 @@ export async function assemble(story, schedule, speech, visual, directory, outpu
45
48
  const audioOrigin = Math.max(0, originDelta);
46
49
  const pictureLeadHold = Math.max(0, -originDelta);
47
50
  const duration = (schedule.duration_ms + audioOrigin) / 1000;
48
- const baseFilter = `trim=start=${trim_start_ms / 1000}:end=${trim_end_ms / 1000},setpts=PTS-STARTPTS,tpad=start_mode=clone:start_duration=${pictureLeadHold / 1000},fps=${story.output.fps},tpad=stop_mode=clone:stop_duration=${duration},trim=duration=${duration},format=yuv420p`;
49
- const annotations = annotationApplications(story, schedule, visual, audioOrigin);
51
+ const baseFilter = `trim=start=${trim_start_ms / 1000}:end=${trim_end_ms / 1000},setpts=PTS-STARTPTS,tpad=start_mode=clone:start_duration=${pictureLeadHold / 1000},fps=${video.fps},tpad=stop_mode=clone:stop_duration=${duration},trim=duration=${duration},format=yuv420p`;
52
+ const frameCount = Math.ceil(duration * video.fps - 1e-9);
53
+ const annotations = annotationApplications(video, schedule, visual, audioOrigin);
50
54
  const renderer = annotations.length || schedule.overlays?.length || !licensed ? await import('./compositor.js') : undefined;
51
- const layers = await renderer?.frameLayers(story.output, schedule, licensed, options.inputHashes) ?? [];
52
- const streamCompositor = annotations.length > 0 || layers.some(layer => layer.opacityAt !== undefined);
53
- let input = 1;
54
- if (streamCompositor) {
55
- args.push('-f', 'rawvideo', '-pixel_format', 'rgba', '-video_size', `${story.output.width}x${story.output.height}`, '-framerate', String(story.output.fps), '-i', 'pipe:0');
56
- filters.push('[0:v]format=yuv420p[v]');
55
+ const layers = await renderer?.frameLayers(video, schedule, licensed, options.inputHashes) ?? [];
56
+ const { canvasLayers, staticTopLayers } = renderer ? renderer.splitFrameLayers(layers) : { canvasLayers: [], staticTopLayers: [] };
57
+ const plan = renderer ? renderer.planCompositor(frameCount, video.fps, audioOrigin, annotations, canvasLayers) : { kind: 'none' };
58
+ let layerImage;
59
+ if (staticTopLayers.length) {
60
+ layerImage = join(temporaryDirectory, 'overlays.png');
61
+ await renderer.writeStaticFrameLayers(layerImage, video, staticTopLayers);
57
62
  }
58
- else {
59
- args.push('-i', visual.file);
60
- if (layers.length) {
61
- const layerImage = join(temporaryDirectory, 'overlays.png');
62
- await renderer.writeStaticFrameLayers(layerImage, story.output, layers);
63
- args.push('-i', layerImage);
64
- filters.push(`[0:v]${baseFilter}[base]`, '[base][1:v]overlay=eof_action=repeat[v]');
65
- input++;
63
+ let input = 1;
64
+ switch (plan.kind) {
65
+ case 'none':
66
+ args.push('-i', visual.file);
67
+ if (layerImage) {
68
+ args.push('-i', layerImage);
69
+ filters.push(`[0:v]${baseFilter}[base]`, '[base][1:v]overlay=eof_action=repeat,format=yuv420p[v]');
70
+ input = 2;
71
+ }
72
+ else {
73
+ filters.push(`[0:v]${baseFilter}[v]`);
74
+ input = 1;
75
+ }
76
+ break;
77
+ case 'sparse':
78
+ args.push('-i', visual.file);
79
+ args.push('-f', 'rawvideo', '-pixel_format', 'rgba', '-video_size', `${video.width}x${video.height}`, '-framerate', String(video.fps), '-i', 'pipe:0');
80
+ if (layerImage) {
81
+ args.push('-i', layerImage);
82
+ filters.push(`[0:v]${baseFilter}[base]`, `[1:v]setpts='${plan.ptsExpr}'[comp_in]`, `[base][comp_in]overlay=eof_action=pass:format=rgb:enable='${plan.betweenExpr}'[comp]`, '[comp][2:v]overlay=eof_action=repeat,format=yuv420p[v]');
83
+ input = 3;
84
+ }
85
+ else {
86
+ filters.push(`[0:v]${baseFilter}[base]`, `[1:v]setpts='${plan.ptsExpr}'[comp_in]`, `[base][comp_in]overlay=eof_action=pass:format=rgb:enable='${plan.betweenExpr}',format=yuv420p[v]`);
87
+ input = 2;
88
+ }
89
+ break;
90
+ case 'full':
91
+ args.push('-f', 'rawvideo', '-pixel_format', 'rgba', '-video_size', `${video.width}x${video.height}`, '-framerate', String(video.fps), '-i', 'pipe:0');
92
+ if (layerImage) {
93
+ args.push('-i', layerImage);
94
+ filters.push('[0:v]format=yuv420p[base]', '[base][1:v]overlay=eof_action=repeat,format=yuv420p[v]');
95
+ input = 2;
96
+ }
97
+ else {
98
+ filters.push('[0:v]format=yuv420p[v]');
99
+ input = 1;
100
+ }
101
+ break;
102
+ default: {
103
+ const _exhaustive = plan;
104
+ throw new Error(`Unhandled compositor plan: ${String(_exhaustive)}`);
66
105
  }
67
- else
68
- filters.push(`[0:v]${baseFilter}[v]`);
69
106
  }
70
107
  if (annotations.length)
71
108
  await saveJson(join(directory, 'annotations-applied.json'), { version: 1, annotations });
@@ -91,24 +128,31 @@ export async function assemble(story, schedule, speech, visual, directory, outpu
91
128
  }
92
129
  if (tracks.length)
93
130
  filters.push(`${tracks.join('')}amix=inputs=${tracks.length}:normalize=0,apad,atrim=duration=${duration}[a]`);
94
- args.push('-filter_complex', filters.join(';'), '-map', '[v]');
131
+ const filterScript = join(temporaryDirectory, 'filter-complex.txt');
132
+ await writeFile(filterScript, filters.join(';'));
133
+ const filterFlags = await ffmpegFilterScriptFlags();
134
+ args.push(filterFlags.complex, filterScript, '-map', '[v]');
95
135
  if (tracks.length)
96
136
  args.push('-map', '[a]', '-c:a', 'aac', '-b:a', '192k', '-ar', '48000');
97
137
  args.push('-c:v', 'libx264', '-preset', 'fast', '-crf', '18', '-t', String(duration), '-movflags', '+faststart');
98
138
  let compositor;
99
- if (streamCompositor) {
100
- compositor = await renderer.compositeFrames(visual.file, baseFilter, [...args, temporary], story.output, annotations, layers, Math.ceil(duration * story.output.fps - 1e-9), audioOrigin);
139
+ if (plan.kind !== 'none') {
140
+ compositor = await renderer.compositeFrames(visual.file, baseFilter, [...args, temporary], video, annotations, plan, frameCount, audioOrigin, temporaryDirectory);
101
141
  }
102
- else
142
+ else {
103
143
  await execute('ffmpeg', [...args, temporary]);
144
+ if (annotations.length)
145
+ compositor = { renderer: 'canvas-skia', version: '1.1.1', frames: frameCount, composited_frames: 0, readback_frames: 0, mode: 'none' };
146
+ }
104
147
  if (options.verify_timing)
105
148
  await decode(temporary);
106
149
  const properties = await probe(temporary);
107
- requireCondition(properties.width === story.output.width && properties.height === story.output.height && properties.has_audio === (tracks.length > 0) && Math.abs(properties.duration_ms - duration * 1000) <= 100, 'OUTPUT_MEDIA', 'Final media properties do not match the schedule', 7);
150
+ requireCondition(properties.width === video.width && properties.height === video.height && properties.has_audio === (tracks.length > 0) && Math.abs(properties.duration_ms - duration * 1000) <= 100, 'OUTPUT_MEDIA', 'Final media properties do not match the schedule', 7);
151
+ const outputSha256 = await hashFile(temporary);
108
152
  let annotationEvidence;
109
153
  if (annotations.length && options.verify_timing) {
110
154
  try {
111
- annotationEvidence = await verifyAnnotations(temporary, visual.file, baseFilter, annotations, story, directory, output, frame => renderer.visibleFrameLayerBounds(layers, frame, story.output.fps, audioOrigin));
155
+ annotationEvidence = await verifyAnnotations(temporary, visual.file, baseFilter, annotations, video, directory, output, frame => renderer.visibleFrameLayerBounds(layers, frame, video.fps, audioOrigin), outputSha256);
112
156
  }
113
157
  catch (error) {
114
158
  await copyFile(temporary, join(directory, 'failed-composite.mp4'));
@@ -124,7 +168,7 @@ export async function assemble(story, schedule, speech, visual, directory, outpu
124
168
  }
125
169
  const report = { version: 1, output, properties, watermark: !licensed, ...(schedule.overlays?.length ? { image_overlays: schedule.overlays } : {}), decode: options.verify_timing ? 'passed' : 'not_evaluated', timing_status: visual.timing.status, ...(annotations.length ? { compositor, base_capture_timing: visual.timing.status, applied_annotations: annotations, final_composite: annotationEvidence ?? { status: 'not_evaluated', gaps: ['Final annotation frames were not verified. The user reviews the video.'] } } : {}), output_origin_delta_ms: originDelta, audio_origin_ms: audioOrigin, picture_lead_hold_ms: pictureLeadHold, final_hold: 'clone last content frame to scheduled end', trim_start_ms, trim_end_ms, mapping, transformations, editorial_review: 'user' };
126
170
  await saveJson(join(directory, 'report.json'), report);
127
- return report;
171
+ return { report, outputSha256 };
128
172
  }
129
173
  finally {
130
174
  try {
@@ -1,6 +1,6 @@
1
1
  import { join } from 'node:path';
2
2
  import { spawn } from 'node:child_process';
3
- import { execute, executionScope, saveJson } from './media.js';
3
+ import { execute, executionSignal, hasStageDeadline, saveJson } from './media.js';
4
4
  import { executable } from './executables.js';
5
5
  import { ProductionError } from './errors.js';
6
6
  const analysisWidth = 640;
@@ -18,7 +18,8 @@ async function* decodedFrames(file, range) {
18
18
  if (range)
19
19
  args.push('-frames:v', String(range.last - range.first + 1));
20
20
  args.push('-f', 'rawvideo', '-');
21
- const child = spawn(executable('ffmpeg'), args, { stdio: ['ignore', 'pipe', 'pipe'], signal: executionScope.getStore(), killSignal: 'SIGKILL', windowsHide: true });
21
+ const signal = executionSignal();
22
+ const child = spawn(executable('ffmpeg'), args, { stdio: ['ignore', 'pipe', 'pipe'], signal, killSignal: 'SIGKILL', windowsHide: true });
22
23
  let error = '';
23
24
  child.stderr.on('data', data => { error = (error + data.toString()).slice(-4000); });
24
25
  const completion = new Promise((resolve, reject) => {
@@ -26,7 +27,7 @@ async function* decodedFrames(file, range) {
26
27
  child.once('close', code => code === 0 ? resolve() : reject(new ProductionError('SUBPROCESS', `ffmpeg exited ${code}: ${error}`, 3)));
27
28
  });
28
29
  void completion.catch(() => { });
29
- const timer = setTimeout(() => child.kill('SIGKILL'), 120000);
30
+ const timer = hasStageDeadline() ? undefined : setTimeout(() => child.kill('SIGKILL'), 120000);
30
31
  const frame = Buffer.alloc(bytes);
31
32
  let filled = 0;
32
33
  let index = range?.first ?? 0;
@@ -332,7 +333,7 @@ export async function calibrate(file, markers, references, duration, directory)
332
333
  await checkpoint();
333
334
  }
334
335
  }
335
- executionScope.getStore()?.throwIfAborted();
336
+ executionSignal()?.throwIfAborted();
336
337
  report.status = failed || pending.size ? 'failed' : 'accepted';
337
338
  await checkpoint();
338
339
  return report;
package/dist/cli.js CHANGED
@@ -7,10 +7,11 @@ import { produce } from './pipeline.js';
7
7
  import { resolve, join } from 'node:path';
8
8
  import { json } from './media.js';
9
9
  import { ProductionError, requireCondition } from './errors.js';
10
- import { packagePath } from './installation.js';
11
- import { withExecutables } from './executables.js';
10
+ import { packagePath, userConfigFile } from './installation.js';
11
+ import { configuredLicense, withExecutables } from './executables.js';
12
12
  import { setup } from './setup.js';
13
13
  import { setupLicense } from './setup-license.js';
14
+ import { installSkill } from './skill-install.js';
14
15
  import { notifyUpdate } from './update-check.js';
15
16
  const commands = ['inspect', 'validate', 'play', 'tts', 'resolve', 'record', 'assemble', 'build'];
16
17
  const documents = new Map([
@@ -19,30 +20,90 @@ const documents = new Map([
19
20
  ['skill', 'skills/slidevideo/SKILL.md'],
20
21
  ['skill storyboard', 'skills/slidevideo/references/storyboard.md'],
21
22
  ['skill production', 'skills/slidevideo/references/production.md'],
23
+ ['skill decks', 'skills/slidevideo/references/decks.md'],
22
24
  ]);
23
- const setupHelp = `slidevideo setup [--presentation slidev|powerpoint] [--provider edge-tts|elevenlabs]
25
+ const setupHelp = `slidevideo setup [options]
26
+ Check this installation and configure tools and speech providers.
24
27
 
25
- --voice-id <id> Voice ID for the storyboard. Required for ElevenLabs readiness.
26
- --install Install supported missing tools.
27
- --manual Check tools and print manual instructions without installing.
28
- --browser/--python/--ffmpeg/--ffprobe <path> Check and save a custom executable.
29
- --json Print the readiness report as JSON. Pass the workflow choices as options.
30
- --license Manage activation in a terminal without checking dependencies.
28
+ --manual Show status and next steps without prompts or installation.
29
+ --install Install supported missing tools (required in non-interactive shells).
30
+ --presentation <slidev|powerpoint> Scope checks and --install to one presentation runtime.
31
+ --provider <edge-tts|elevenlabs> Scope checks and setup to one speech provider.
32
+ --voice-id <id> Include a selected voice ID in --json output with --provider.
33
+ --license Manage license activation in an interactive terminal.
34
+ --json Print detailed status as JSON.
35
+ --quiet Suppress progress on stderr.
31
36
 
32
- Run without options in a terminal to choose the workflow interactively.
33
- Setup exits 3 if the selected workflow is missing required dependencies.
37
+ Custom tool paths:
38
+ --browser <path> --python <path> --ffmpeg <path> --ffprobe <path>
39
+
40
+ Non-interactive ElevenLabs credentials:
41
+ Set ELEVENLABS_API_KEY in the environment or a mode-600 .env file, or set
42
+ "elevenlabs_api_key" in the per-user config file reported by setup --manual --json.
43
+
44
+ Coding-agent skill:
45
+ Run slidevideo skill --install to register the bundled skill in ~/.agents/skills/slidevideo.
46
+
47
+ Exit codes: 0 ready, 3 missing prerequisites.
48
+ `;
49
+ const skillHelp = `slidevideo skill [storyboard|production|decks] [options]
50
+ Display or register the bundled SlideVideo skill for coding agents.
51
+
52
+ skill Print the main SKILL.md authoring and production instructions.
53
+ skill storyboard Print the storyboard YAML field and timing reference.
54
+ skill production Print the CLI operation, caching, and diagnostics reference.
55
+ skill decks Print the Slidev and PowerPoint deck-compatibility reference.
56
+
57
+ --install Link the bundled skill into ~/.agents/skills/slidevideo
58
+ (and ~/.claude/skills/slidevideo when Claude Code is detected).
59
+ --project With --install, link into ./.agents/skills/slidevideo in the
60
+ current directory (and ./.claude/skills/slidevideo if .claude exists).
61
+ --json Print document metadata or installation results as JSON.
34
62
  `;
63
+ function setupChecklist(report, licensed) {
64
+ const labels = {
65
+ ffmpeg: 'FFmpeg', ffprobe: 'ffprobe', browser: 'Chromium', python: 'Python environment',
66
+ 'elevenlabs-key': 'API key',
67
+ powershell: 'Windows PowerShell 5.1', powerpoint: 'desktop PowerPoint', desktop: 'unlocked desktop',
68
+ 'ffmpeg-gdigrab': 'FFmpeg gdigrab input', platform: 'supported platform',
69
+ };
70
+ const lines = report.shared_checks.map(check => ` [${check.ready ? '✓' : 'X'}] ${labels[check.name] ?? check.name}`);
71
+ const group = (name, readiness, deferred = false) => {
72
+ if (!readiness)
73
+ return;
74
+ if (readiness.status === 'unavailable')
75
+ lines.push(` [-] ${name}: ${readiness.checks[0].detail}`);
76
+ else {
77
+ const missing = readiness.checks.filter(check => !check.ready).map(check => labels[check.name] ?? check.name);
78
+ lines.push(` [${readiness.status === 'ready' ? '✓' : 'X'}] ${name}${missing.length ? `: needs ${missing.join(', ')}` : ''}${deferred ? ', setup deferred' : ''}`);
79
+ }
80
+ };
81
+ group('Slidev / Chromium', report.presentations.slidev);
82
+ group('Native PowerPoint', report.presentations.powerpoint);
83
+ group('Edge TTS', report.providers['edge-tts'], report.providers['edge-tts']?.deferred);
84
+ group('ElevenLabs', report.providers.elevenlabs, report.providers.elevenlabs?.deferred);
85
+ const skillState = report.skill.status === 'installed'
86
+ ? 'installed'
87
+ : report.skill.targets.some(target => target.status === 'broken' || target.status === 'outdated')
88
+ ? 'needs refresh'
89
+ : 'not installed';
90
+ lines.push(` [${report.skill.status === 'installed' ? '✓' : 'X'}] Agent skill ${skillState}`);
91
+ lines.push(` [${licensed ? '✓' : 'X'}] License ${licensed ? 'active' : 'not active'}`);
92
+ return lines.join('\n');
93
+ }
35
94
  let command = process.argv[2] ?? 'help';
36
95
  const jsonMode = process.argv.includes('--json');
37
96
  let previewReady = false;
97
+ let runDirectory;
38
98
  try {
39
99
  const { values, positionals } = parseArgs({ options: {
40
- storyboard: { type: 'string' }, port: { type: 'string' }, run: { type: 'string' }, 'cache-dir': { type: 'string' }, output: { type: 'string' }, export: { type: 'string' }, 'timeout-ms': { type: 'string' },
100
+ storyboard: { type: 'string' }, deck: { type: 'string' }, width: { type: 'string' }, height: { type: 'string' }, fps: { type: 'string' }, port: { type: 'string' }, run: { type: 'string' }, 'cache-dir': { type: 'string' }, output: { type: 'string' }, export: { type: 'string' }, 'timeout-minutes': { type: 'string' },
41
101
  browser: { type: 'string' }, python: { type: 'string' }, ffmpeg: { type: 'string' }, ffprobe: { type: 'string' },
42
- presentation: { type: 'string' }, provider: { type: 'string' }, 'voice-id': { type: 'string' }, install: { type: 'boolean' }, manual: { type: 'boolean' },
102
+ presentation: { type: 'string' }, provider: { type: 'string' }, 'voice-id': { type: 'string' }, install: { type: 'boolean' }, project: { type: 'boolean' }, manual: { type: 'boolean' },
43
103
  license: { type: 'boolean' },
44
104
  json: { type: 'boolean' }, quiet: { type: 'boolean' }, resume: { type: 'boolean' }, 'verify-timing': { type: 'boolean' }, help: { type: 'boolean', short: 'h' }, version: { type: 'boolean' },
45
105
  }, allowPositionals: true });
106
+ runDirectory = values.run;
46
107
  command = positionals[0] ?? 'help';
47
108
  notifyUpdate(Boolean(values.json), Boolean(values.quiet));
48
109
  if (values.version) {
@@ -50,9 +111,12 @@ try {
50
111
  console.log(values.json ? JSON.stringify({ version: 1, package_version: version }) : version);
51
112
  }
52
113
  else if (values.help || command === 'help') {
53
- const help = command === 'setup' ? setupHelp : `slidevideo <setup|inspect|validate|play|tts|resolve|record|assemble|build|skill|license|impressum>
114
+ const help = command === 'setup' ? setupHelp : command === 'skill' ? skillHelp : `slidevideo <setup|inspect|validate|play|tts|resolve|record|assemble|build|skill|license|impressum>
54
115
 
55
- --storyboard <file> Required for presentation commands except assemble.
116
+ --storyboard <file> Required for presentation commands except assemble; inspect also accepts --deck.
117
+ --deck <file> Inspect a .md or .pptx deck directly before a storyboard exists.
118
+ --width/--height <px> Even viewport or output size (default: 1920x1080; PPTX inspect --deck uses slide size).
119
+ --fps <15|24|30|60> Output frame rate for record, assemble, or build (default: 30).
56
120
  --run <directory> Required for artifact-producing commands.
57
121
  --cache-dir <dir> Speech cache for tts or build, read-only timing metadata for play.
58
122
  --port <number> Local play server port (default: auto).
@@ -60,26 +124,38 @@ try {
60
124
  --resume Reuse intact build stages with matching inputs and mode.
61
125
  --verify-timing Opt in to decoded timing proof for build or record; assemble checks the recorded mode.
62
126
  --export <file> Optional resolved schedule export.
63
- --timeout-ms <ms> Bounded stage timeout, default 180000.
127
+ --timeout-minutes <min> Stage timeout override in minutes; defaults scale with project duration.
64
128
  --browser/--python/--ffmpeg/--ffprobe <path> Override a tool for this command.
65
129
  --json One JSON result on stdout (play reports its URL at readiness).
66
130
  --quiet Suppress progress on stderr.
67
131
  --version Package version.
68
132
 
69
- setup checks and configures the dependencies for your presentation format and speech provider.
133
+ setup prepares shared tools and speech providers, and detects Slidev and native PowerPoint support (see setup --help).
70
134
  Normal production leaves timing unevaluated and the video for user review.
71
- inspect lists existing annotation targets without recording.
135
+ inspect lists slide targets, click counts, media IDs and annotation targets from --deck or --storyboard without recording.
72
136
  validate checks inputs without recording.
73
137
  play --storyboard <file> serves silent slides and annotations with Play, Pause and Replay. Ctrl+C stops the server.
74
- skill displays the bundled storyboard skill. Use skill storyboard or skill production for its references.
138
+ skill displays or registers (--install) the bundled coding-agent skill; see skill --help for references and options.
75
139
  license displays the bundled license terms. Use setup --license to manage activation.
76
140
  impressum displays the provider's contact details.
77
141
  `;
78
142
  console.log(values.json ? JSON.stringify({ version: 1, command, help }) : help);
79
143
  }
144
+ else if (command === 'skill' && values.install) {
145
+ requireCondition(positionals.length === 1 && Object.keys(values).every(key => ['install', 'project', 'json', 'quiet'].includes(key)), 'OPTION', 'Use slidevideo skill --install [--project] [--json].');
146
+ const report = await installSkill(values.project ? 'project' : 'user');
147
+ if (values.json)
148
+ console.log(JSON.stringify(report));
149
+ else {
150
+ console.log(`Skill source: ${report.source}`);
151
+ for (const item of report.targets)
152
+ console.log(` [✓] ${item.path} (${item.action})`);
153
+ }
154
+ }
80
155
  else if (command === 'skill' || command === 'license' || command === 'impressum') {
156
+ requireCondition(!values.project, 'OPTION', '--project requires slidevideo skill --install.');
81
157
  const file = documents.get(positionals.join(' '));
82
- const usage = command === 'skill' ? 'skill [storyboard|production]' : command;
158
+ const usage = command === 'skill' ? 'skill [storyboard|production|decks] or slidevideo skill --install' : command;
83
159
  requireCondition(file && Object.keys(values).every(key => key === 'json'), 'OPTION', `Use slidevideo ${usage} [--json].`);
84
160
  const path = packagePath(file);
85
161
  const document = await readFile(path, 'utf8');
@@ -91,45 +167,111 @@ impressum displays the provider's contact details.
91
167
  await withExecutables({}, setupLicense);
92
168
  }
93
169
  else if (command === 'setup') {
94
- requireCondition(positionals.length === 1 && !['storyboard', 'port', 'run', 'cache-dir', 'output', 'export', 'timeout-ms', 'resume', 'verify-timing'].some(key => key in values), 'OPTION', 'Run slidevideo setup --help for setup options');
95
- const report = await withExecutables(values, () => setup(values));
170
+ requireCondition(positionals.length === 1 && !['storyboard', 'deck', 'width', 'height', 'fps', 'port', 'run', 'cache-dir', 'output', 'export', 'timeout-minutes', 'resume', 'verify-timing', 'project'].some(key => key in values), 'OPTION', 'Run slidevideo setup --help for setup options');
171
+ let initialChecklist;
172
+ const report = await withExecutables(values, () => setup(values, current => {
173
+ initialChecklist = setupChecklist(current, configuredLicense());
174
+ console.error(`Current setup\n${initialChecklist}`);
175
+ console.error(`Config: ${userConfigFile()}\n`);
176
+ }));
96
177
  if (values.json)
97
178
  console.log(JSON.stringify(report));
98
179
  else {
99
- if (report.browser_requirement)
100
- console.log(report.browser_requirement);
101
- for (const browser of report.browsers)
102
- console.log(`${browser.name} at ${browser.path}`);
103
- for (const check of report.checks)
104
- console.log(`${check.ready ? 'Ready' : 'Required'} ${check.name}: ${check.detail}`);
180
+ const checklist = setupChecklist(report, configuredLicense());
181
+ if (initialChecklist !== checklist) {
182
+ console.log(`Setup status\n${checklist}`);
183
+ if (initialChecklist === undefined) {
184
+ console.log(`Config: ${report.config_file}`);
185
+ }
186
+ }
187
+ const missing = (name) => report.checks.some(check => check.name === name && !check.ready);
188
+ const next = [];
189
+ if (missing('ffmpeg') || missing('ffprobe'))
190
+ next.push(process.platform === 'darwin'
191
+ ? 'FFmpeg: install with brew install ffmpeg (or run setup --install), or pass --ffmpeg and --ffprobe with their paths.'
192
+ : 'Install FFmpeg with libx264 and ffprobe, or pass --ffmpeg and --ffprobe with their paths.');
193
+ if (missing('browser'))
194
+ next.push('Chromium: run setup --presentation slidev --install, or pass --browser <path>.');
195
+ if (missing('python') && !report.providers['edge-tts']?.deferred)
196
+ next.push('Edge TTS: run setup --provider edge-tts --install, or pass --python <venv-python>.');
197
+ if (missing('elevenlabs-key') && !report.providers.elevenlabs?.deferred)
198
+ next.push('ElevenLabs: run setup --provider elevenlabs to save your API key for all projects.');
199
+ for (const check of report.presentations.powerpoint?.checks ?? []) {
200
+ if (!check.ready && check.name !== 'platform')
201
+ next.push(check.detail);
202
+ }
203
+ if (report.skill.status !== 'installed') {
204
+ const conflict = report.skill.targets.find(target => target.status === 'conflict');
205
+ next.push(conflict
206
+ ? `Agent skill: remove or move ${conflict.conflict_path ?? conflict.path}, then run slidevideo skill --install.`
207
+ : 'Agent skill: run slidevideo skill --install to register the bundled skill for coding agents.');
208
+ }
209
+ if (next.length)
210
+ console.log(`\nNext steps\n${next.map(step => ` ${step}`).join('\n')}`);
105
211
  for (const error of report.installation_errors)
106
212
  console.log(error);
107
213
  if (Object.keys(report.saved_paths).length)
108
214
  console.log(`Saved executable paths to ${report.config_file}`);
109
- console.log(`Storyboard voice settings\nvoice:\n provider: ${report.voice.provider}\n voice: ${JSON.stringify(report.voice.voice)}`);
110
- console.log(report.status === 'ready' ? 'The selected workflow is ready.' : 'The selected workflow needs the dependencies listed above.');
215
+ console.log(report.status === 'ready' ? '\nSetup ready.' : '\nSetup incomplete.');
111
216
  }
112
217
  if (report.status !== 'ready')
113
218
  process.exitCode = 3;
114
219
  }
115
220
  else {
116
221
  requireCondition(commands.includes(command) && positionals.length === 1, 'COMMAND', 'Run slidevideo --help for available commands');
222
+ requireCondition(!values.project, 'OPTION', '--project requires slidevideo skill --install');
117
223
  requireCondition(!['presentation', 'provider', 'voice-id', 'install', 'manual', 'license'].some(key => key in values), 'OPTION', 'Presentation, provider, voice ID, install and license options require setup');
118
- const timeout = Number(values['timeout-ms'] ?? 180000);
119
- requireCondition(Number.isInteger(timeout) && timeout >= 1000 && timeout <= 3600000, 'TIMEOUT', '--timeout-ms must be between 1000 and 3600000');
224
+ let timeout;
225
+ if (values['timeout-minutes'] !== undefined) {
226
+ const raw = values['timeout-minutes'].trim();
227
+ const minutes = Number(raw);
228
+ requireCondition(/^(?:\d+(?:\.\d+)?|\.\d+)$/.test(raw) && Number.isFinite(minutes) && minutes > 0 && minutes <= 180, 'TIMEOUT', '--timeout-minutes must be a positive number up to 180');
229
+ timeout = Math.ceil(minutes * 60_000);
230
+ }
120
231
  requireCondition(!values.output || ['assemble', 'build'].includes(command), 'OPTION', '--output requires assemble or build');
121
232
  requireCondition(!values.resume || command === 'build', 'OPTION', '--resume requires build');
122
233
  requireCondition(!values['cache-dir'] || ['tts', 'build', 'play'].includes(command), 'OPTION', '--cache-dir requires play, tts or build');
123
234
  requireCondition(!values.export || ['resolve', 'build'].includes(command), 'OPTION', '--export requires resolve or build');
124
235
  requireCondition(!values['verify-timing'] || ['record', 'assemble', 'build'].includes(command), 'OPTION', '--verify-timing requires record, assemble or build');
125
236
  requireCondition(values.port === undefined || command === 'play', 'OPTION', '--port requires play');
237
+ requireCondition((values.width === undefined) === (values.height === undefined), 'OPTION', 'Pass --width and --height together');
238
+ requireCondition((values.width === undefined && values.height === undefined) || ['inspect', 'validate', 'play', 'record', 'assemble', 'build'].includes(command), 'OPTION', '--width and --height require inspect, validate, play, record, assemble or build');
239
+ requireCondition(values.fps === undefined || ['record', 'assemble', 'build'].includes(command), 'OPTION', '--fps requires record, assemble or build');
240
+ let viewport;
241
+ if (values.width !== undefined && values.height !== undefined) {
242
+ const parseEvenDimension = (raw, name, min, max) => {
243
+ const trimmed = raw.trim();
244
+ const parsed = Number(trimmed);
245
+ requireCondition(/^\d+$/.test(trimmed) && Number.isInteger(parsed) && parsed >= min && parsed <= max && parsed % 2 === 0, 'OPTION', `--${name} must be an even integer from ${min} to ${max}`);
246
+ return parsed;
247
+ };
248
+ viewport = { width: parseEvenDimension(values.width, 'width', 640, 3840), height: parseEvenDimension(values.height, 'height', 360, 2160) };
249
+ }
250
+ let fps;
251
+ if (values.fps !== undefined) {
252
+ const trimmed = values.fps.trim();
253
+ const parsed = Number(trimmed);
254
+ requireCondition(/^\d+$/.test(trimmed) && (parsed === 15 || parsed === 24 || parsed === 30 || parsed === 60), 'OPTION', '--fps must be 15, 24, 30 or 60');
255
+ fps = parsed;
256
+ }
257
+ let inspectInput;
258
+ if (command === 'inspect') {
259
+ requireCondition(!(values.storyboard && values.deck), 'OPTION', 'Pass either --storyboard or --deck to inspect, not both');
260
+ requireCondition(values.storyboard !== undefined || values.deck !== undefined, 'STORYBOARD_REQUIRED', 'inspect requires --storyboard or --deck');
261
+ inspectInput = values.deck !== undefined
262
+ ? { kind: 'deck', deck: values.deck, ...(viewport ? { viewport } : {}) }
263
+ : { kind: 'storyboard', storyboard: values.storyboard, ...(viewport ? { viewport } : {}) };
264
+ }
265
+ else {
266
+ requireCondition(values.deck === undefined, 'OPTION', '--deck requires inspect');
267
+ }
126
268
  await withExecutables(values, async () => {
127
269
  if (command === 'play') {
128
270
  requireCondition(values.storyboard, 'STORYBOARD_REQUIRED', 'play requires --storyboard');
129
- requireCondition(values.run === undefined && values['timeout-ms'] === undefined, 'OPTION', 'play takes --storyboard, --cache-dir and --port; Ctrl+C stops the server');
271
+ requireCondition(values.run === undefined && values['timeout-minutes'] === undefined, 'OPTION', 'play takes --storyboard, --cache-dir, --port, --width and --height; Ctrl+C stops the server');
130
272
  const port = Number(values.port ?? 0);
131
273
  requireCondition(values.port === undefined || /^\d+$/.test(values.port) && Number.isInteger(port) && port <= 65535, 'PREVIEW_PORT', '--port must be between 0 and 65535');
132
- await servePreview(values.storyboard, values['cache-dir'], port, (url, approximate) => {
274
+ await servePreview(values.storyboard, values['cache-dir'], port, viewport, (url, approximate) => {
133
275
  previewReady = true;
134
276
  console.log(values.json ? JSON.stringify({ version: 1, command, status: 'ready', url, approximate, timing_status: 'not_evaluated' }) : `Open ${url} to preview the storyboard. Press Ctrl+C to stop.`);
135
277
  });
@@ -147,7 +289,7 @@ impressum displays the provider's contact details.
147
289
  progress?.(operation);
148
290
  const heartbeat = progress ? setInterval(() => process.stderr.write(`[slidevideo] ${operation} (${Math.floor((Date.now() - started) / 1000)}s elapsed)\n`), 5000) : undefined;
149
291
  try {
150
- const result = await produce({ command, storyboard: values.storyboard, run: values.run, cache: values['cache-dir'], output: values.output, export: values.export, resume: values.resume, verify_timing: values['verify-timing'], timeout_ms: timeout, progress });
292
+ const result = await produce({ command, storyboard: values.storyboard, inspect: inspectInput, viewport, fps, run: values.run, cache: values['cache-dir'], output: values.output, export: values.export, resume: values.resume, verify_timing: values['verify-timing'], timeout_ms: timeout, progress });
151
293
  progress?.(`${command} completed`);
152
294
  console.log(values.json || command === 'inspect' ? JSON.stringify(result) : `${command} completed${result.artifacts.video ? `: ${result.artifacts.video}` : ''}`);
153
295
  }
@@ -165,14 +307,13 @@ impressum displays the provider's contact details.
165
307
  catch (error) {
166
308
  const failure = error instanceof ProductionError ? error : new ProductionError('INTERNAL', error instanceof Error ? error.message : String(error), error instanceof TypeError ? 2 : 1);
167
309
  let run;
168
- const runIndex = process.argv.indexOf('--run');
169
- if (runIndex >= 0 && process.argv[runIndex + 1]) {
310
+ if (runDirectory) {
170
311
  try {
171
- run = await json(join(resolve(process.argv[runIndex + 1]), 'manifest.json'));
312
+ run = await json(join(resolve(runDirectory), 'manifest.json'));
172
313
  }
173
314
  catch { }
174
315
  }
175
- const result = { version: 1, command, status: 'failed', run_id: run?.run_id, completed_stages: Object.entries(run?.stages ?? {}).filter(([, stage]) => stage?.status === 'completed').map(([name]) => name), artifacts: run ? { manifest: join(resolve(process.argv[runIndex + 1]), 'manifest.json') } : {}, timing_status: 'not_accepted', warnings: [], errors: [{ stage: command, code: failure.code, message: failure.message, ...failure.context }] };
316
+ const result = { version: 1, command, status: 'failed', run_id: run?.run_id, completed_stages: Object.entries(run?.stages ?? {}).filter(([, stage]) => stage?.status === 'completed').map(([name]) => name), artifacts: run ? { manifest: join(resolve(runDirectory), 'manifest.json') } : {}, timing_status: 'not_accepted', warnings: [], errors: [{ stage: command, code: failure.code, message: failure.message, ...failure.context }] };
176
317
  const diagnostic = jsonMode ? JSON.stringify(result) : `${failure.code}: ${failure.message}`;
177
318
  if (previewReady)
178
319
  console.error(diagnostic);