@phil65/demoreel 0.6.0 → 0.7.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.
- package/README.md +8 -5
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/args.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/compose.d.ts +9 -1
- package/dist/compose.js +34 -2
- package/dist/idle.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mcp.js +2 -2
- package/dist/project.d.ts +247 -11
- package/dist/project.js +244 -8
- package/dist/record.js +8 -0
- package/dist/renderer/assets/{CanvasPool-PBu3bHFZ.js → CanvasPool-SkgMbnEH.js} +1 -1
- package/dist/renderer/assets/{CanvasRenderer-HmF-4gyW.js → CanvasRenderer-CEGuSdsG.js} +1 -1
- package/dist/renderer/assets/{RenderTargetSystem-Dk1U4wDJ.js → RenderTargetSystem-um8Nv1HQ.js} +1 -1
- package/dist/renderer/assets/{WebGLRenderer-C0v9HBel.js → WebGLRenderer-BnY2xfDL.js} +1 -1
- package/dist/renderer/assets/{WebGPURenderer-Ce0-U9Q1.js → WebGPURenderer-D9KI_sD9.js} +1 -1
- package/dist/renderer/assets/{browserAll-DhvWQ7nM.js → browserAll-vQt6iTAv.js} +1 -1
- package/dist/renderer/assets/{canvasUtils-KRroregW.js → canvasUtils-CZLntkW8.js} +1 -1
- package/dist/renderer/assets/{getTexelRangeRects-D3pwCyRt.js → getTexelRangeRects-CRAnqulP.js} +1 -1
- package/dist/renderer/assets/{index-CE-lli1m.js → index-41-d13J1.js} +4 -4
- package/dist/renderer/assets/{init-DfmWKarH.js → init-D6nA7FlC.js} +1 -1
- package/dist/renderer/assets/webworkerAll-BEIrFubI.js +1 -0
- package/dist/renderer/index.html +1 -1
- package/dist/scene.d.ts +87 -1
- package/dist/scene.js +151 -1
- package/dist/types.d.ts +71 -1
- package/dist/voice.d.ts +8 -5
- package/dist/voice.js +43 -6
- package/package.json +2 -2
- package/skills/demoreel/SKILL.md +5 -1
- package/dist/renderer/assets/webworkerAll-B41hok0-.js +0 -1
package/README.md
CHANGED
|
@@ -106,10 +106,13 @@ Each run writes into `out/<name>/`:
|
|
|
106
106
|
| `scroll(target \| { by: px })` | smooth scroll (the page's or the target's scroll container) |
|
|
107
107
|
| `press(key, { show, duration })` | keyboard shortcut (Playwright syntax); optional keycap HUD pill |
|
|
108
108
|
| `pause(ms)` | wait |
|
|
109
|
-
| `caption(text, { duration, wait })` | caption overlay (an OpenScreen text annotation, sharp at any zoom) |
|
|
110
|
-
| `say(text, [opts], [fn])` | voiceover narration via `@phil65/anyvoice` (free Edge TTS by default, OpenAI, ElevenLabs); supports `say(text, async (cue) => { await cue.at("word"); ... })` + `.vtt` subtitles |
|
|
109
|
+
| `caption(text, { duration, wait, animation })` | caption overlay (an OpenScreen text annotation, sharp at any zoom; optional `fade` / `rise` / `pop` / `typewriter` animation) |
|
|
110
|
+
| `say(text, [opts], [fn])` | voiceover narration via `@phil65/anyvoice` (free Edge TTS by default, OpenAI, ElevenLabs, Gemini, Cartesia, Deepgram); supports `say(text, async (cue) => { await cue.at("word"); ... })` + `.vtt` subtitles |
|
|
111
111
|
| `zoom(target, { depth, duration, context, wait })` | explicit zoom (integer tier `1..6`: 1.25x..5x) overriding auto zooms |
|
|
112
112
|
| `highlight(target, { duration, color, dim, badge, zoom })` | outline with optional spotlight dim backdrop and callout badge |
|
|
113
|
+
| `blur(target, { type, shape, intensity, duration })` | blur or pixelate (`type: "mosaic"`) sensitive UI elements (alias `redact()`; defaults to blurring until video end) |
|
|
114
|
+
| `arrow(target, { direction, color, duration })` | draw a crisp OpenScreen vector arrow pointing at an element |
|
|
115
|
+
| `image(src, { x, y, width, height, duration })` | overlay a local PNG/JPG/SVG/WebP image or `data:image/...` URL on the rendered canvas |
|
|
113
116
|
|
|
114
117
|
`target` is a structured accessibility-first spec (`{ role, name?, exact?, nth? }`,
|
|
115
118
|
`{ label, exact?, nth? }`, `{ placeholder, exact?, nth? }`, `{ text, exact?, nth? }`,
|
|
@@ -122,10 +125,10 @@ Scenario options: `viewport`, `cssZoom` (crisper text: lay out at a smaller size
|
|
|
122
125
|
up), `serve` (static dir served at `ctx.baseUrl`), `storageState` (Playwright storageState
|
|
123
126
|
JSON, relative to the scenario file), `colorScheme`, `seed`, `pacing`
|
|
124
127
|
(`speed`, `beforeAction`, `afterClick`, `typeDelay`, ...), `zoom` (see below), `look`
|
|
125
|
-
(`wallpaper`, `padding`, `borderRadius`, `shadowIntensity`, `aspectRatio`,
|
|
126
|
-
`captionPosition`, `showKeys`), `cursor` (`size`, `clickBounce`, `smoothing`, `motionBlur`,
|
|
128
|
+
(`wallpaper`, `padding`, `borderRadius`, `shadowIntensity`, `showBlur`, `crop`, `aspectRatio`,
|
|
129
|
+
`captionPosition`, `captionFontSize`, `captionAnimation`, `showKeys`, `watermark`), `cursor` (`size`, `clickBounce`, `smoothing`, `motionBlur`,
|
|
127
130
|
`show`), `clickRipple`, `trimIdle` (`true` or `{ minMs, keepMs, mode, speed, ignoreFrames }`),
|
|
128
|
-
`voice` (`{ provider: "edge" | "openai" | "elevenlabs", voice, model, speed, pitch, volume, instructions, gapMs, padMs, captions: "vtt" | "burned" | "off", cacheDir }`).
|
|
131
|
+
`voice` (`{ provider: "edge" | "openai" | "elevenlabs" | "gemini" | "cartesia" | "deepgram", voice, model, language, speed, pitch, volume, instructions, gapMs, padMs, captions: "vtt" | "burned" | "off", cacheDir }`).
|
|
129
132
|
|
|
130
133
|
### Voiceover narration (`scene.say`)
|
|
131
134
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -14,7 +14,7 @@ are listed in `vendor/openscreen/VENDORED.md` in the demoreel repository.
|
|
|
14
14
|
|
|
15
15
|
| package | version | license | text | source |
|
|
16
16
|
| --- | --- | --- | --- | --- |
|
|
17
|
-
| colord | 2.14.
|
|
17
|
+
| colord | 2.14.1 | MIT | [licenses/colord.txt](licenses/colord.txt) | https://github.com/omgovich/colord |
|
|
18
18
|
| earcut | 3.2.4 | ISC | [licenses/earcut.txt](licenses/earcut.txt) | git://github.com/mapbox/earcut |
|
|
19
19
|
| eventemitter3 | 5.0.4 | MIT | [licenses/eventemitter3.txt](licenses/eventemitter3.txt) | git://github.com/primus/eventemitter3 |
|
|
20
20
|
| gif.js | 0.2.0 | MIT | [licenses/gif.js.txt](licenses/gif.js.txt) | https://github.com/jnordberg/gif.js |
|
package/dist/args.js
CHANGED
|
@@ -24,7 +24,7 @@ export const COMMANDS = {
|
|
|
24
24
|
viewport: { type: "string", value: "WxH", description: "override the scenario viewport, e.g. 1280x720" },
|
|
25
25
|
state: { type: "string", value: "FILE", description: "Playwright storageState JSON (overrides scenario.storageState)" },
|
|
26
26
|
"dry-run": { type: "boolean", description: "run the scenario fast without ffmpeg, recording, or writing files" },
|
|
27
|
-
"voice-provider": { type: "string", value: "NAME", description: "override voiceover TTS provider: edge (free) | openai | elevenlabs" },
|
|
27
|
+
"voice-provider": { type: "string", value: "NAME", description: "override voiceover TTS provider: edge (free) | openai | elevenlabs | gemini | cartesia | deepgram" },
|
|
28
28
|
voice: { type: "string", value: "ID", description: "override voiceover voice ID" },
|
|
29
29
|
"no-voice": { type: "boolean", description: "skip voiceover TTS synthesis for this run" },
|
|
30
30
|
headed: { type: "boolean", description: "show the browser while recording" },
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { PACKAGE_ROOT } from "./openscreen.js";
|
|
|
13
13
|
import { dryRunScenario, recordScenario, resolveStorageState } from "./record.js";
|
|
14
14
|
import { renderProject, validateProject } from "./render.js";
|
|
15
15
|
import { extractFrame, findFramesheet, reviewSheet } from "./sheet.js";
|
|
16
|
-
import { formatDryRunVoiceSummary, formatVoiceSummary } from "./voice.js";
|
|
16
|
+
import { formatDryRunVoiceSummary, formatVoiceSummary, VOICE_PROVIDERS } from "./voice.js";
|
|
17
17
|
const fmt = (ms) => `${(ms / 1000).toFixed(1)}s`;
|
|
18
18
|
const log = (msg) => console.error(msg);
|
|
19
19
|
function progressPrinter(enabled) {
|
|
@@ -69,8 +69,8 @@ async function cmdRun({ positionals, flags }) {
|
|
|
69
69
|
const voice = { ...scenario.voice };
|
|
70
70
|
if (flags["voice-provider"] !== undefined) {
|
|
71
71
|
const p = String(flags["voice-provider"]);
|
|
72
|
-
if (!
|
|
73
|
-
throw new UsageError(
|
|
72
|
+
if (!VOICE_PROVIDERS.includes(p)) {
|
|
73
|
+
throw new UsageError(`--voice-provider must be ${VOICE_PROVIDERS.join(", ")}`);
|
|
74
74
|
}
|
|
75
75
|
voice.provider = p;
|
|
76
76
|
}
|
package/dist/compose.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type IdleOptions } from "./idle.ts";
|
|
|
2
2
|
import { type Marks } from "./marks.ts";
|
|
3
3
|
import { buildProject, type LookOptions } from "./project.ts";
|
|
4
4
|
import type { CursorStyle } from "./render.ts";
|
|
5
|
-
import type { ActionRecord, Caption, CursorSample, SpeedRegion, TrimRegion, Viewport, VoiceCue, ZoomRegion } from "./types.ts";
|
|
5
|
+
import type { ActionRecord, ArrowAnnotation, BlurAnnotation, Caption, CursorSample, ImageAnnotation, SpeedRegion, TrimRegion, Viewport, VoiceCue, ZoomRegion } from "./types.ts";
|
|
6
6
|
import type { VoiceConfig } from "./voice.ts";
|
|
7
7
|
import { type ZoomOptions } from "./zoom.ts";
|
|
8
8
|
export declare const TIMELINE_VERSION = 1;
|
|
@@ -29,6 +29,9 @@ export interface Timeline {
|
|
|
29
29
|
trimRegions: TrimRegion[];
|
|
30
30
|
speedRegions: SpeedRegion[];
|
|
31
31
|
captions: Caption[];
|
|
32
|
+
blurs?: BlurAnnotation[];
|
|
33
|
+
arrows?: ArrowAnnotation[];
|
|
34
|
+
images?: ImageAnnotation[];
|
|
32
35
|
voiceCues?: VoiceCue[];
|
|
33
36
|
timings: Record<string, number>;
|
|
34
37
|
files: {
|
|
@@ -45,6 +48,8 @@ export interface Timeline {
|
|
|
45
48
|
export interface ComposeInput {
|
|
46
49
|
name: string;
|
|
47
50
|
outDir: string;
|
|
51
|
+
/** Base directory for resolving relative image/watermark paths (scenario file directory). */
|
|
52
|
+
baseDir?: string;
|
|
48
53
|
videoPath: string;
|
|
49
54
|
durationMs: number;
|
|
50
55
|
frameCount: number;
|
|
@@ -52,6 +57,9 @@ export interface ComposeInput {
|
|
|
52
57
|
frameSize: Viewport;
|
|
53
58
|
actions: ActionRecord[];
|
|
54
59
|
captions: Caption[];
|
|
60
|
+
blurs?: BlurAnnotation[];
|
|
61
|
+
arrows?: ArrowAnnotation[];
|
|
62
|
+
images?: ImageAnnotation[];
|
|
55
63
|
voiceCues?: VoiceCue[];
|
|
56
64
|
samples: CursorSample[];
|
|
57
65
|
frameTimes: number[];
|
package/dist/compose.js
CHANGED
|
@@ -30,14 +30,35 @@ export function compose(input, opts = {}) {
|
|
|
30
30
|
}, idleOpts)
|
|
31
31
|
: { trimRegions: [], speedRegions: [] };
|
|
32
32
|
const projectPath = path.join(input.outDir, `${input.name}.openscreen`);
|
|
33
|
+
const resolvedImages = (input.images ?? []).map((img) => ({
|
|
34
|
+
...img,
|
|
35
|
+
src: img.src.startsWith("data:") || path.isAbsolute(img.src) ? img.src : path.resolve(input.baseDir ?? process.cwd(), img.src),
|
|
36
|
+
}));
|
|
37
|
+
const resolvedLook = look.watermark
|
|
38
|
+
? {
|
|
39
|
+
...look,
|
|
40
|
+
watermark: {
|
|
41
|
+
...look.watermark,
|
|
42
|
+
src: look.watermark.src.startsWith("data:") || path.isAbsolute(look.watermark.src)
|
|
43
|
+
? look.watermark.src
|
|
44
|
+
: path.resolve(input.baseDir ?? process.cwd(), look.watermark.src),
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
: look;
|
|
33
48
|
let project = buildProject({
|
|
34
49
|
videoPath: input.videoPath,
|
|
35
50
|
zoomRegions,
|
|
36
51
|
captions,
|
|
52
|
+
blurs: input.blurs,
|
|
53
|
+
arrows: input.arrows,
|
|
54
|
+
images: resolvedImages,
|
|
37
55
|
actions: input.actions,
|
|
38
56
|
trimRegions,
|
|
39
57
|
speedRegions,
|
|
40
|
-
look,
|
|
58
|
+
look: resolvedLook,
|
|
59
|
+
viewport: input.viewport,
|
|
60
|
+
durationMs: input.durationMs,
|
|
61
|
+
baseDir: input.baseDir,
|
|
41
62
|
});
|
|
42
63
|
if (opts.keepProjectFrom && fs.existsSync(opts.keepProjectFrom)) {
|
|
43
64
|
// rezoom: keep edits made in OpenScreen, replace only the derived regions.
|
|
@@ -77,7 +98,12 @@ export function compose(input, opts = {}) {
|
|
|
77
98
|
frameSize: input.frameSize,
|
|
78
99
|
options: {
|
|
79
100
|
zoom: input.zoom ?? {},
|
|
80
|
-
look: input.look
|
|
101
|
+
look: input.look
|
|
102
|
+
? {
|
|
103
|
+
...input.look,
|
|
104
|
+
...(resolvedLook.watermark ? { watermark: resolvedLook.watermark } : {}),
|
|
105
|
+
}
|
|
106
|
+
: {},
|
|
81
107
|
trimIdle: idleOpts ?? false,
|
|
82
108
|
...(input.cursor ? { cursor: input.cursor } : {}),
|
|
83
109
|
...(safeVoice ? { voice: safeVoice } : {}),
|
|
@@ -87,6 +113,9 @@ export function compose(input, opts = {}) {
|
|
|
87
113
|
trimRegions,
|
|
88
114
|
speedRegions,
|
|
89
115
|
captions: captions.map((c) => ({ ...c, startMs: Math.round(c.startMs), endMs: Math.round(c.endMs) })),
|
|
116
|
+
...(input.blurs?.length ? { blurs: input.blurs } : {}),
|
|
117
|
+
...(input.arrows?.length ? { arrows: input.arrows } : {}),
|
|
118
|
+
...(resolvedImages.length ? { images: resolvedImages } : {}),
|
|
90
119
|
...(voiceCues.length
|
|
91
120
|
? { voiceCues: voiceCues.map((c) => ({ ...c, startMs: Math.round(c.startMs), endMs: Math.round(c.endMs) })) }
|
|
92
121
|
: {}),
|
|
@@ -147,6 +176,9 @@ export function rezoom(dir, overrides = {}) {
|
|
|
147
176
|
frameSize: tl.frameSize,
|
|
148
177
|
actions: tl.actions,
|
|
149
178
|
captions: tl.captions,
|
|
179
|
+
blurs: tl.blurs,
|
|
180
|
+
arrows: tl.arrows,
|
|
181
|
+
images: tl.images,
|
|
150
182
|
voiceCues: tl.voiceCues,
|
|
151
183
|
samples,
|
|
152
184
|
frameTimes: tl.frameTimes ?? [],
|
package/dist/idle.js
CHANGED
|
@@ -19,7 +19,7 @@ function mergeIntervals(list) {
|
|
|
19
19
|
export function busyIntervals(input, opts = {}) {
|
|
20
20
|
const busy = [];
|
|
21
21
|
for (const a of input.actions) {
|
|
22
|
-
if (a.kind === "pause" || a.kind === "caption" || a.kind === "say")
|
|
22
|
+
if (a.kind === "pause" || a.kind === "caption" || a.kind === "say" || a.kind === "blur")
|
|
23
23
|
continue;
|
|
24
24
|
busy.push([a.startMs - 150, a.endMs + 250]);
|
|
25
25
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** demoreel: scripted product demo videos (videos as code), rendered by OpenScreen's exporter. */
|
|
2
2
|
export { type DryRunError, type DryRunOptions, type DryRunResult, type RecordOptions, type RecordResult, type Scenario, type ScenarioContext, defineScenario, dryRunScenario, recordScenario, resolveStorageState, } from "./record.ts";
|
|
3
|
-
export { type ActionOptions, applyZoomAnchor, type ClickRippleOptions, DEFAULT_PACING, describeTarget, type HighlightOptions, type PacingOptions, type PressOptions, resolveTarget, type SayOptions, Scene, type SceneClock, type Target, type TargetSpec, type VoiceCueHandle, ZOOM_ATTRIBUTE, type ZoomOptions as SceneZoomOptions, } from "./scene.ts";
|
|
4
|
-
export { buildVoiceVtt, createVoiceSynthesizer, DEFAULT_VOICE_GAP_MS, DEFAULT_VOICE_PAD_MS, findWordTiming, formatDryRunVoiceSummary, formatVoiceSummary, lintVoiceCues, muxVoiceTrack, type SayDeliveryOptions, type SynthesizedCue, type VoiceConfig, type VoiceFinding, type VoiceProviderName, type VoiceSynthesizer, } from "./voice.ts";
|
|
3
|
+
export { type ActionOptions, applyZoomAnchor, type ArrowOptions, type BlurOptions, type ClickRippleOptions, DEFAULT_PACING, describeTarget, type HighlightOptions, type ImageOptions, type PacingOptions, type PressOptions, resolveTarget, type SayOptions, Scene, type SceneClock, type Target, type TargetSpec, type VoiceCueHandle, ZOOM_ATTRIBUTE, type ZoomOptions as SceneZoomOptions, } from "./scene.ts";
|
|
4
|
+
export { buildVoiceVtt, createVoiceSynthesizer, DEFAULT_VOICE_GAP_MS, DEFAULT_VOICE_PAD_MS, findWordTiming, formatDryRunVoiceSummary, formatVoiceSummary, lintVoiceCues, muxVoiceTrack, type SayDeliveryOptions, type SynthesizedCue, type VoiceConfig, type VoiceFinding, VOICE_PROVIDERS, type VoiceProviderName, type VoiceSynthesizer, } from "./voice.ts";
|
|
5
5
|
export { DEFAULT_ZOOM_OPTIONS, DEPTH_SCALES, deriveZoomRegions, depthForBox, normalizeDepth, type ZoomOptions } from "./zoom.ts";
|
|
6
6
|
export { DEFAULT_IDLE_OPTIONS, deriveIdleRegions, idleIntervals, type IdleOptions, sourceToOutputMs } from "./idle.ts";
|
|
7
|
-
export { buildCursorData, buildProject, type BuildProjectOptions, captionAnnotations, DEFAULT_LOOK, formatKeycap, keycapAnnotations, type KeyHudOptions, type KeyHudPosition, keycapRect, type LookOptions, normalizeSamples, type OpenScreenProject, writeProject, } from "./project.ts";
|
|
7
|
+
export { arrowAnnotations, blurAnnotations, buildCursorData, buildProject, type BuildProjectOptions, captionAnnotations, DEFAULT_LOOK, formatKeycap, imageAnnotations, keycapAnnotations, type KeyHudOptions, type KeyHudPosition, keycapRect, type LookOptions, normalizeSamples, type OpenScreenProject, resolveImageDataUrl, type WatermarkOptions, type WatermarkPosition, writeProject, } from "./project.ts";
|
|
8
8
|
export { exportGif, type GifOptions, type GifResult } from "./gif.ts";
|
|
9
9
|
export { buildMarks, type Marks, type MarkPoint, type MarkRegion, type MarkSpan, type MarksInput } from "./marks.ts";
|
|
10
10
|
export { stageLayout, type StageLayout } from "./layout.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** demoreel: scripted product demo videos (videos as code), rendered by OpenScreen's exporter. */
|
|
2
2
|
export { defineScenario, dryRunScenario, recordScenario, resolveStorageState, } from "./record.js";
|
|
3
3
|
export { applyZoomAnchor, DEFAULT_PACING, describeTarget, resolveTarget, Scene, ZOOM_ATTRIBUTE, } from "./scene.js";
|
|
4
|
-
export { buildVoiceVtt, createVoiceSynthesizer, DEFAULT_VOICE_GAP_MS, DEFAULT_VOICE_PAD_MS, findWordTiming, formatDryRunVoiceSummary, formatVoiceSummary, lintVoiceCues, muxVoiceTrack, } from "./voice.js";
|
|
4
|
+
export { buildVoiceVtt, createVoiceSynthesizer, DEFAULT_VOICE_GAP_MS, DEFAULT_VOICE_PAD_MS, findWordTiming, formatDryRunVoiceSummary, formatVoiceSummary, lintVoiceCues, muxVoiceTrack, VOICE_PROVIDERS, } from "./voice.js";
|
|
5
5
|
export { DEFAULT_ZOOM_OPTIONS, DEPTH_SCALES, deriveZoomRegions, depthForBox, normalizeDepth } from "./zoom.js";
|
|
6
6
|
export { DEFAULT_IDLE_OPTIONS, deriveIdleRegions, idleIntervals, sourceToOutputMs } from "./idle.js";
|
|
7
|
-
export { buildCursorData, buildProject, captionAnnotations, DEFAULT_LOOK, formatKeycap, keycapAnnotations, keycapRect, normalizeSamples, writeProject, } from "./project.js";
|
|
7
|
+
export { arrowAnnotations, blurAnnotations, buildCursorData, buildProject, captionAnnotations, DEFAULT_LOOK, formatKeycap, imageAnnotations, keycapAnnotations, keycapRect, normalizeSamples, resolveImageDataUrl, writeProject, } from "./project.js";
|
|
8
8
|
export { exportGif } from "./gif.js";
|
|
9
9
|
export { buildMarks } from "./marks.js";
|
|
10
10
|
export { stageLayout } from "./layout.js";
|
package/dist/mcp.js
CHANGED
|
@@ -175,7 +175,7 @@ export function createMcpServer() {
|
|
|
175
175
|
scenarioPath: z.string().describe("Path to the scenario file (*.scenario.ts/.mts/.mjs)."),
|
|
176
176
|
viewport: z.string().optional().describe("Optional WxH viewport override."),
|
|
177
177
|
state: z.string().optional().describe("Optional Playwright storageState JSON file path."),
|
|
178
|
-
voiceProvider: z.enum(["edge", "openai", "elevenlabs"]).optional().describe("Override voiceover TTS provider."),
|
|
178
|
+
voiceProvider: z.enum(["edge", "openai", "elevenlabs", "gemini", "cartesia", "deepgram"]).optional().describe("Override voiceover TTS provider."),
|
|
179
179
|
voice: z.string().optional().describe("Override voiceover voice ID."),
|
|
180
180
|
noVoice: z.boolean().optional().describe("Skip TTS synthesis during dry-run."),
|
|
181
181
|
}),
|
|
@@ -245,7 +245,7 @@ export function createMcpServer() {
|
|
|
245
245
|
frames: z.number().int().min(4).max(32).optional().default(12).describe("Number of contact-sheet tiles (default 12)."),
|
|
246
246
|
state: z.string().optional().describe("Optional Playwright storageState JSON file path."),
|
|
247
247
|
render: z.boolean().optional().default(true).describe("Render MP4 after recording (default true)."),
|
|
248
|
-
voiceProvider: z.enum(["edge", "openai", "elevenlabs"]).optional().describe("Override voiceover TTS provider."),
|
|
248
|
+
voiceProvider: z.enum(["edge", "openai", "elevenlabs", "gemini", "cartesia", "deepgram"]).optional().describe("Override voiceover TTS provider."),
|
|
249
249
|
voice: z.string().optional().describe("Override voiceover voice ID."),
|
|
250
250
|
noVoice: z.boolean().optional().describe("Disable voiceover synthesis for this run."),
|
|
251
251
|
}),
|
package/dist/project.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type StageLayout } from "./layout.ts";
|
|
2
|
+
import type { ActionRecord, ArrowAnnotation, ArrowDirection, BlurAnnotation, Caption, CaptionAnimation, CropRegion, CursorSample, ImageAnnotation, SpeedRegion, TrimRegion, Viewport, ZoomRegion } from "./types.ts";
|
|
2
3
|
export declare const PROJECT_VERSION = 2;
|
|
3
4
|
export declare const CURSOR_TELEMETRY_VERSION = 2;
|
|
4
5
|
export type KeyHudPosition = "bottom-right" | "top-right" | "bottom-left" | "top-left";
|
|
6
|
+
export type WatermarkPosition = "bottom-right" | "top-right" | "bottom-left" | "top-left" | {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
export interface WatermarkOptions {
|
|
11
|
+
/** Local image path (PNG/JPG/SVG/WebP, resolved relative to the scenario file) or `data:image/...` URL. */
|
|
12
|
+
src: string;
|
|
13
|
+
/** Corner preset or stage-percent coordinates (default `"bottom-right"`). */
|
|
14
|
+
position?: WatermarkPosition;
|
|
15
|
+
/** Width in percent of canvas width (default `10`). */
|
|
16
|
+
width?: number;
|
|
17
|
+
/** Height in percent of canvas height (default `8`). */
|
|
18
|
+
height?: number;
|
|
19
|
+
}
|
|
5
20
|
export interface KeyHudOptions {
|
|
6
21
|
/** Corner where shortcut keycap badges appear (default "bottom-right"). */
|
|
7
22
|
position?: KeyHudPosition;
|
|
@@ -17,14 +32,22 @@ export interface LookOptions {
|
|
|
17
32
|
padding: number;
|
|
18
33
|
borderRadius: number;
|
|
19
34
|
shadowIntensity: number;
|
|
35
|
+
/** Blur the wallpaper backdrop behind the rounded video frame (default `false`). */
|
|
36
|
+
showBlur?: boolean;
|
|
20
37
|
motionBlurAmount: number;
|
|
38
|
+
/** Normalized crop region (`0..1`) applied to the recorded frame (default full frame `{ x: 0, y: 0, width: 1, height: 1 }`). */
|
|
39
|
+
crop?: CropRegion;
|
|
21
40
|
/** "16:9", "9:16", "1:1", "4:3", "4:5", "16:10", "10:16" or "native". */
|
|
22
41
|
aspectRatio: string;
|
|
23
42
|
/** Where captions sit; "auto" (default) = bottom, unless that covers an active target. */
|
|
24
43
|
captionPosition: "auto" | "bottom" | "top";
|
|
25
44
|
captionFontSize: number;
|
|
45
|
+
/** Entrance/exit text animation for captions (`"none" | "fade" | "rise" | "pop" | "slide-left" | "typewriter" | "pulse"`). */
|
|
46
|
+
captionAnimation?: CaptionAnimation;
|
|
26
47
|
/** Show floating keycap pills for `scene.press()` shortcuts (default false). */
|
|
27
48
|
showKeys?: boolean | KeyHudOptions;
|
|
49
|
+
/** Persistent image/logo watermark rendered across the whole video. */
|
|
50
|
+
watermark?: WatermarkOptions;
|
|
28
51
|
}
|
|
29
52
|
export declare const DEFAULT_LOOK: LookOptions;
|
|
30
53
|
/** Caption box in percent of the output canvas (OpenScreen annotation position/size). */
|
|
@@ -72,11 +95,11 @@ export declare function keycapAnnotations(actions: ActionRecord[], look?: LookOp
|
|
|
72
95
|
};
|
|
73
96
|
zIndex: number;
|
|
74
97
|
}[];
|
|
75
|
-
export declare function captionAnnotations(captions: Caption[], look?: LookOptions): {
|
|
98
|
+
export declare function captionAnnotations(captions: Caption[], look?: LookOptions, startZIndex?: number): {
|
|
76
99
|
id: string;
|
|
77
100
|
startMs: number;
|
|
78
101
|
endMs: number;
|
|
79
|
-
type:
|
|
102
|
+
type: "text";
|
|
80
103
|
content: string;
|
|
81
104
|
textContent: string;
|
|
82
105
|
position: {
|
|
@@ -87,6 +110,123 @@ export declare function captionAnnotations(captions: Caption[], look?: LookOptio
|
|
|
87
110
|
width: number;
|
|
88
111
|
height: number;
|
|
89
112
|
};
|
|
113
|
+
style: {
|
|
114
|
+
color: string;
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
fontSize: number;
|
|
117
|
+
fontFamily: string;
|
|
118
|
+
fontWeight: string;
|
|
119
|
+
fontStyle: string;
|
|
120
|
+
textDecoration: string;
|
|
121
|
+
textAlign: string;
|
|
122
|
+
textAnimation: CaptionAnimation;
|
|
123
|
+
};
|
|
124
|
+
zIndex: number;
|
|
125
|
+
}[];
|
|
126
|
+
/** Resolves a `data:image/...` URL or reads a local image file and encodes it as a data URL. */
|
|
127
|
+
export declare function resolveImageDataUrl(src: string, baseDir?: string): string;
|
|
128
|
+
/** Converts recorded `BlurAnnotation`s into OpenScreen `type: "blur"` regions. */
|
|
129
|
+
export declare function blurAnnotations(blurs: BlurAnnotation[], opts: {
|
|
130
|
+
viewport: Viewport;
|
|
131
|
+
layout: StageLayout;
|
|
132
|
+
durationMs: number;
|
|
133
|
+
startZIndex?: number;
|
|
134
|
+
}): {
|
|
135
|
+
id: string;
|
|
136
|
+
startMs: number;
|
|
137
|
+
endMs: number;
|
|
138
|
+
type: "blur";
|
|
139
|
+
content: string;
|
|
140
|
+
position: {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
};
|
|
144
|
+
size: {
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
};
|
|
148
|
+
style: {
|
|
149
|
+
color: string;
|
|
150
|
+
backgroundColor: string;
|
|
151
|
+
fontSize: number;
|
|
152
|
+
fontFamily: string;
|
|
153
|
+
fontWeight: string;
|
|
154
|
+
fontStyle: string;
|
|
155
|
+
textDecoration: string;
|
|
156
|
+
textAlign: string;
|
|
157
|
+
textAnimation: string;
|
|
158
|
+
};
|
|
159
|
+
zIndex: number;
|
|
160
|
+
blurData: {
|
|
161
|
+
type: "blur" | "mosaic";
|
|
162
|
+
shape: "oval" | "rectangle";
|
|
163
|
+
color: "black" | "white";
|
|
164
|
+
intensity: number;
|
|
165
|
+
blockSize: number;
|
|
166
|
+
freehandPoints: {
|
|
167
|
+
x: number;
|
|
168
|
+
y: number;
|
|
169
|
+
}[];
|
|
170
|
+
};
|
|
171
|
+
}[];
|
|
172
|
+
/** Converts recorded `ArrowAnnotation`s into OpenScreen `type: "figure"` arrow regions. */
|
|
173
|
+
export declare function arrowAnnotations(arrows: ArrowAnnotation[], opts: {
|
|
174
|
+
viewport: Viewport;
|
|
175
|
+
layout: StageLayout;
|
|
176
|
+
startZIndex?: number;
|
|
177
|
+
}): {
|
|
178
|
+
id: string;
|
|
179
|
+
startMs: number;
|
|
180
|
+
endMs: number;
|
|
181
|
+
type: "figure";
|
|
182
|
+
content: string;
|
|
183
|
+
position: {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
};
|
|
187
|
+
size: {
|
|
188
|
+
width: number;
|
|
189
|
+
height: number;
|
|
190
|
+
};
|
|
191
|
+
style: {
|
|
192
|
+
color: string;
|
|
193
|
+
backgroundColor: string;
|
|
194
|
+
fontSize: number;
|
|
195
|
+
fontFamily: string;
|
|
196
|
+
fontWeight: string;
|
|
197
|
+
fontStyle: string;
|
|
198
|
+
textDecoration: string;
|
|
199
|
+
textAlign: string;
|
|
200
|
+
textAnimation: string;
|
|
201
|
+
};
|
|
202
|
+
zIndex: number;
|
|
203
|
+
figureData: {
|
|
204
|
+
arrowDirection: ArrowDirection;
|
|
205
|
+
color: string;
|
|
206
|
+
strokeWidth: number;
|
|
207
|
+
};
|
|
208
|
+
}[];
|
|
209
|
+
/** Converts recorded `ImageAnnotation`s (and optional `look.watermark`) into OpenScreen `type: "image"` regions. */
|
|
210
|
+
export declare function imageAnnotations(images: ImageAnnotation[], opts: {
|
|
211
|
+
durationMs: number;
|
|
212
|
+
baseDir?: string;
|
|
213
|
+
watermark?: WatermarkOptions;
|
|
214
|
+
startZIndex?: number;
|
|
215
|
+
}): {
|
|
216
|
+
id: string;
|
|
217
|
+
startMs: number;
|
|
218
|
+
endMs: number;
|
|
219
|
+
type: "image";
|
|
220
|
+
content: string;
|
|
221
|
+
imageContent: string;
|
|
222
|
+
position: {
|
|
223
|
+
x: number;
|
|
224
|
+
y: number;
|
|
225
|
+
};
|
|
226
|
+
size: {
|
|
227
|
+
width: number;
|
|
228
|
+
height: number;
|
|
229
|
+
};
|
|
90
230
|
style: {
|
|
91
231
|
color: string;
|
|
92
232
|
backgroundColor: string;
|
|
@@ -104,10 +244,16 @@ export interface BuildProjectOptions {
|
|
|
104
244
|
videoPath: string;
|
|
105
245
|
zoomRegions: ZoomRegion[];
|
|
106
246
|
captions: Caption[];
|
|
247
|
+
blurs?: BlurAnnotation[];
|
|
248
|
+
arrows?: ArrowAnnotation[];
|
|
249
|
+
images?: ImageAnnotation[];
|
|
107
250
|
actions?: ActionRecord[];
|
|
108
251
|
trimRegions?: TrimRegion[];
|
|
109
252
|
speedRegions?: SpeedRegion[];
|
|
110
253
|
look?: Partial<LookOptions>;
|
|
254
|
+
viewport?: Viewport;
|
|
255
|
+
durationMs?: number;
|
|
256
|
+
baseDir?: string;
|
|
111
257
|
}
|
|
112
258
|
export type OpenScreenProject = ReturnType<typeof buildProject>;
|
|
113
259
|
export declare function buildProject(opts: BuildProjectOptions): {
|
|
@@ -125,18 +271,13 @@ export declare function buildProject(opts: BuildProjectOptions): {
|
|
|
125
271
|
motionBlurAmount: number;
|
|
126
272
|
borderRadius: number;
|
|
127
273
|
padding: number;
|
|
128
|
-
cropRegion:
|
|
129
|
-
x: number;
|
|
130
|
-
y: number;
|
|
131
|
-
width: number;
|
|
132
|
-
height: number;
|
|
133
|
-
};
|
|
274
|
+
cropRegion: CropRegion;
|
|
134
275
|
zoomRegions: ZoomRegion[];
|
|
135
276
|
autoZoomEnabled: boolean;
|
|
136
277
|
autoFocusAll: boolean;
|
|
137
278
|
trimRegions: TrimRegion[];
|
|
138
279
|
speedRegions: SpeedRegion[];
|
|
139
|
-
annotationRegions: {
|
|
280
|
+
annotationRegions: ({
|
|
140
281
|
id: string;
|
|
141
282
|
startMs: number;
|
|
142
283
|
endMs: number;
|
|
@@ -163,7 +304,102 @@ export declare function buildProject(opts: BuildProjectOptions): {
|
|
|
163
304
|
textAnimation: string;
|
|
164
305
|
};
|
|
165
306
|
zIndex: number;
|
|
166
|
-
}
|
|
307
|
+
} | {
|
|
308
|
+
id: string;
|
|
309
|
+
startMs: number;
|
|
310
|
+
endMs: number;
|
|
311
|
+
type: "blur";
|
|
312
|
+
content: string;
|
|
313
|
+
position: {
|
|
314
|
+
x: number;
|
|
315
|
+
y: number;
|
|
316
|
+
};
|
|
317
|
+
size: {
|
|
318
|
+
width: number;
|
|
319
|
+
height: number;
|
|
320
|
+
};
|
|
321
|
+
style: {
|
|
322
|
+
color: string;
|
|
323
|
+
backgroundColor: string;
|
|
324
|
+
fontSize: number;
|
|
325
|
+
fontFamily: string;
|
|
326
|
+
fontWeight: string;
|
|
327
|
+
fontStyle: string;
|
|
328
|
+
textDecoration: string;
|
|
329
|
+
textAlign: string;
|
|
330
|
+
textAnimation: string;
|
|
331
|
+
};
|
|
332
|
+
zIndex: number;
|
|
333
|
+
blurData: {
|
|
334
|
+
type: "blur" | "mosaic";
|
|
335
|
+
shape: "oval" | "rectangle";
|
|
336
|
+
color: "black" | "white";
|
|
337
|
+
intensity: number;
|
|
338
|
+
blockSize: number;
|
|
339
|
+
freehandPoints: {
|
|
340
|
+
x: number;
|
|
341
|
+
y: number;
|
|
342
|
+
}[];
|
|
343
|
+
};
|
|
344
|
+
} | {
|
|
345
|
+
id: string;
|
|
346
|
+
startMs: number;
|
|
347
|
+
endMs: number;
|
|
348
|
+
type: "figure";
|
|
349
|
+
content: string;
|
|
350
|
+
position: {
|
|
351
|
+
x: number;
|
|
352
|
+
y: number;
|
|
353
|
+
};
|
|
354
|
+
size: {
|
|
355
|
+
width: number;
|
|
356
|
+
height: number;
|
|
357
|
+
};
|
|
358
|
+
style: {
|
|
359
|
+
color: string;
|
|
360
|
+
backgroundColor: string;
|
|
361
|
+
fontSize: number;
|
|
362
|
+
fontFamily: string;
|
|
363
|
+
fontWeight: string;
|
|
364
|
+
fontStyle: string;
|
|
365
|
+
textDecoration: string;
|
|
366
|
+
textAlign: string;
|
|
367
|
+
textAnimation: string;
|
|
368
|
+
};
|
|
369
|
+
zIndex: number;
|
|
370
|
+
figureData: {
|
|
371
|
+
arrowDirection: ArrowDirection;
|
|
372
|
+
color: string;
|
|
373
|
+
strokeWidth: number;
|
|
374
|
+
};
|
|
375
|
+
} | {
|
|
376
|
+
id: string;
|
|
377
|
+
startMs: number;
|
|
378
|
+
endMs: number;
|
|
379
|
+
type: "image";
|
|
380
|
+
content: string;
|
|
381
|
+
imageContent: string;
|
|
382
|
+
position: {
|
|
383
|
+
x: number;
|
|
384
|
+
y: number;
|
|
385
|
+
};
|
|
386
|
+
size: {
|
|
387
|
+
width: number;
|
|
388
|
+
height: number;
|
|
389
|
+
};
|
|
390
|
+
style: {
|
|
391
|
+
color: string;
|
|
392
|
+
backgroundColor: string;
|
|
393
|
+
fontSize: number;
|
|
394
|
+
fontFamily: string;
|
|
395
|
+
fontWeight: string;
|
|
396
|
+
fontStyle: string;
|
|
397
|
+
textDecoration: string;
|
|
398
|
+
textAlign: string;
|
|
399
|
+
textAnimation: string;
|
|
400
|
+
};
|
|
401
|
+
zIndex: number;
|
|
402
|
+
})[];
|
|
167
403
|
aspectRatio: string;
|
|
168
404
|
webcamLayoutPreset: string;
|
|
169
405
|
webcamMaskShape: string;
|