motionrender 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +61 -2
- package/blocks/badge.json +68 -0
- package/blocks/big-stat.json +240 -0
- package/blocks/cta-end.json +283 -0
- package/blocks/feature-list.json +286 -0
- package/blocks/footage.json +43 -0
- package/blocks/fx-background-swap.json +170 -0
- package/blocks/fx-before-after.json +212 -0
- package/blocks/fx-captions.json +34 -0
- package/blocks/fx-chat.json +368 -0
- package/blocks/fx-checklist.json +609 -0
- package/blocks/fx-clone-wall.json +181 -0
- package/blocks/fx-color-pop.json +92 -0
- package/blocks/fx-command-bridge.json +358 -0
- package/blocks/fx-counter-hero.json +206 -0
- package/blocks/fx-cta-card.json +337 -0
- package/blocks/fx-day-to-night.json +174 -0
- package/blocks/fx-duo-title.json +245 -0
- package/blocks/fx-duotone.json +95 -0
- package/blocks/fx-extruded-title.json +309 -0
- package/blocks/fx-gallery.json +239 -0
- package/blocks/fx-glass-cards.json +921 -0
- package/blocks/fx-glitch-title.json +373 -0
- package/blocks/fx-grade-look.json +91 -0
- package/blocks/fx-highlighter.json +53 -0
- package/blocks/fx-icon-orbit.json +2694 -0
- package/blocks/fx-lens-flare.json +325 -0
- package/blocks/fx-letterbox.json +105 -0
- package/blocks/fx-light-leak.json +140 -0
- package/blocks/fx-map-journey.json +443 -0
- package/blocks/fx-neon-outline.json +743 -0
- package/blocks/fx-notifications.json +456 -0
- package/blocks/fx-progress-ring.json +143 -0
- package/blocks/fx-pull-out.json +68 -0
- package/blocks/fx-punch-in.json +81 -0
- package/blocks/fx-rgb-flash.json +166 -0
- package/blocks/fx-shake-hit.json +120 -0
- package/blocks/fx-split-reveal.json +110 -0
- package/blocks/fx-spotlight.json +1383 -0
- package/blocks/fx-stats-split.json +500 -0
- package/blocks/fx-step-tracker.json +528 -0
- package/blocks/fx-sticker-freeze.json +584 -0
- package/blocks/fx-strike-rewrite.json +79 -0
- package/blocks/fx-ticker.json +179 -0
- package/blocks/fx-timeline.json +1287 -0
- package/blocks/fx-tracked-label.json +167 -0
- package/blocks/fx-typewriter-quote.json +164 -0
- package/blocks/handle.json +43 -0
- package/blocks/icon-row.json +404 -0
- package/blocks/image-caption.json +248 -0
- package/blocks/lower-third.json +106 -0
- package/blocks/phone-mockup.json +459 -0
- package/blocks/progress-bar.json +51 -0
- package/blocks/quote.json +347 -0
- package/blocks/section-title.json +240 -0
- package/blocks/split-screen.json +283 -0
- package/blocks/stat-grid.json +315 -0
- package/blocks/steps.json +266 -0
- package/blocks/title-hero.json +287 -0
- package/dist/builder.d.ts +1 -0
- package/dist/builder.js +169 -0
- package/dist/cli.js +9301 -0
- package/dist/fonts/LICENSE-Inter.txt +93 -0
- package/dist/fonts/inter-cyrillic-ext-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-greek-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-opsz-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-opsz-italic.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-opsz-normal.woff2 +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2330 -0
- package/dist/player.d.ts +1 -0
- package/dist/player.js +80 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +140 -0
- package/dist/runtime/canvas-runtime.js +261 -0
- package/dist/runtime/lottie_light_canvas.min.js +1 -0
- package/dist/runtime/text-layout.js +50 -0
- package/dist/sfx/click.wav +0 -0
- package/dist/sfx/ding.wav +0 -0
- package/dist/sfx/pop.wav +0 -0
- package/dist/sfx/riser.wav +0 -0
- package/dist/sfx/thump.wav +0 -0
- package/dist/sfx/tick.wav +0 -0
- package/dist/sfx/whoosh.wav +0 -0
- package/dist/types/packages/ai/src/assets.d.ts +26 -0
- package/dist/types/packages/ai/src/batch.d.ts +19 -0
- package/dist/types/packages/ai/src/compose.d.ts +34 -0
- package/dist/types/packages/ai/src/history.d.ts +37 -0
- package/dist/types/packages/ai/src/image.d.ts +19 -0
- package/dist/types/packages/ai/src/index.d.ts +13 -0
- package/dist/types/packages/ai/src/json.d.ts +2 -0
- package/dist/types/packages/ai/src/narrate.d.ts +63 -0
- package/dist/types/packages/ai/src/patch.d.ts +15 -0
- package/dist/types/packages/ai/src/project.d.ts +27 -0
- package/dist/types/packages/ai/src/prompt.d.ts +30 -0
- package/dist/types/packages/ai/src/providers.d.ts +109 -0
- package/dist/types/packages/ai/src/template.d.ts +80 -0
- package/dist/types/packages/ai/src/voiceover.d.ts +49 -0
- package/dist/types/packages/animation/src/index.d.ts +27 -0
- package/dist/types/packages/assets/src/cache.d.ts +26 -0
- package/dist/types/packages/assets/src/index.d.ts +8 -0
- package/dist/types/packages/builder/src/index.d.ts +270 -0
- package/dist/types/packages/cli/src/ai-studio-page.d.ts +1 -0
- package/dist/types/packages/cli/src/ai-studio.d.ts +35 -0
- package/dist/types/packages/cli/src/ai.d.ts +3 -0
- package/dist/types/packages/cli/src/args.d.ts +9 -0
- package/dist/types/packages/cli/src/blocks-cli.d.ts +3 -0
- package/dist/types/packages/cli/src/blocks.d.ts +50 -0
- package/dist/types/packages/cli/src/build.d.ts +1 -0
- package/dist/types/packages/cli/src/dev-page.d.ts +1 -0
- package/dist/types/packages/cli/src/dev.d.ts +13 -0
- package/dist/types/packages/cli/src/index.d.ts +2 -0
- package/dist/types/packages/cli/src/init.d.ts +10 -0
- package/dist/types/packages/cli/src/serve.d.ts +2 -0
- package/dist/types/packages/cli/src/studio.d.ts +36 -0
- package/dist/types/packages/cli/src/templates.d.ts +63 -0
- package/dist/types/packages/cli/src/thumbnail.d.ts +20 -0
- package/dist/types/packages/cli/src/track.d.ts +35 -0
- package/dist/types/packages/cli/src/worker.d.ts +13 -0
- package/dist/types/packages/contracts/src/index.d.ts +377 -0
- package/dist/types/packages/core/src/audio.d.ts +14 -0
- package/dist/types/packages/core/src/distributed.d.ts +50 -0
- package/dist/types/packages/core/src/index.d.ts +63 -0
- package/dist/types/packages/core/src/media.d.ts +11 -0
- package/dist/types/packages/core/src/review.d.ts +29 -0
- package/dist/types/packages/ffmpeg/src/index.d.ts +68 -0
- package/dist/types/packages/graphics/src/fonts.d.ts +3 -0
- package/dist/types/packages/graphics/src/index.d.ts +121 -0
- package/dist/types/packages/graphics/src/runtime.d.ts +10 -0
- package/dist/types/packages/jobs/src/env.d.ts +78 -0
- package/dist/types/packages/jobs/src/handlers.d.ts +17 -0
- package/dist/types/packages/jobs/src/index.d.ts +5 -0
- package/dist/types/packages/jobs/src/input.d.ts +18 -0
- package/dist/types/packages/jobs/src/queue.d.ts +70 -0
- package/dist/types/packages/jobs/src/redis.d.ts +42 -0
- package/dist/types/packages/player/src/bundle.d.ts +4 -0
- package/dist/types/packages/player/src/canvas-runtime.d.ts +11 -0
- package/dist/types/packages/player/src/index.d.ts +29 -0
- package/dist/types/packages/react/src/index.d.ts +76 -0
- package/dist/types/packages/renderer/src/index.d.ts +35 -0
- package/dist/types/packages/renderer/src/pool.d.ts +7 -0
- package/dist/types/packages/renderer/src/video.d.ts +9 -0
- package/dist/types/packages/schema/src/captions.d.ts +24 -0
- package/dist/types/packages/schema/src/expression.d.ts +1 -0
- package/dist/types/packages/schema/src/index.d.ts +1213 -0
- package/dist/types/packages/schema/src/variables.d.ts +115 -0
- package/dist/types/packages/storage/src/index.d.ts +78 -0
- package/dist/types/packages/timeline/src/index.d.ts +104 -0
- package/package.json +78 -4
- package/skills/ove/SKILL.md +356 -0
- package/skills/ove-ai-compose/SKILL.md +36 -0
- package/skills/ove-batch-videos/SKILL.md +23 -0
- package/skills/ove-code-video/SKILL.md +68 -0
- package/skills/ove-effects/SKILL.md +65 -0
- package/skills/ove-make-reel/SKILL.md +30 -0
- package/skills/ove-voiceover-captions/SKILL.md +31 -0
- package/studio/assets/index-CzOvWv9w.css +1 -0
- package/studio/assets/index-J_fvKgng.js +11 -0
- package/studio/index.html +16 -0
- package/templates/case-study/composition.json +358 -0
- package/templates/case-study/template.json +8 -0
- package/templates/event-invite/composition.json +245 -0
- package/templates/event-invite/template.json +8 -0
- package/templates/explainer-square/composition.json +1335 -0
- package/templates/explainer-square/template.json +13 -0
- package/templates/keynote-wide/composition.json +1458 -0
- package/templates/keynote-wide/template.json +13 -0
- package/templates/launch-wide/composition.json +1306 -0
- package/templates/launch-wide/template.json +13 -0
- package/templates/product-card/composition.json +196 -0
- package/templates/product-card/data.example.json +5 -0
- package/templates/product-card/template.json +8 -0
- package/templates/product-wide/composition.json +1609 -0
- package/templates/product-wide/template.json +14 -0
- package/templates/quote-card/composition.json +123 -0
- package/templates/quote-card/template.json +8 -0
- package/templates/sale-promo/composition.json +290 -0
- package/templates/sale-promo/template.json +8 -0
- package/templates/showcase-tall/composition.json +1646 -0
- package/templates/showcase-tall/template.json +14 -0
- package/templates/slideshow/composition.json +167 -0
- package/templates/slideshow/template.json +8 -0
- package/templates/social-reel/composition.json +252 -0
- package/templates/social-reel/template.json +8 -0
- package/templates/starter/assets/logo.svg +4 -0
- package/templates/starter/composition.json +84 -0
- package/templates/story-tall/composition.json +1379 -0
- package/templates/story-tall/template.json +13 -0
- package/themes/espresso.json +15 -0
- package/themes/midnight.json +15 -0
- package/themes/neon.json +15 -0
- package/themes/paper.json +15 -0
- package/themes/signal.json +15 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const starterTemplate: string;
|
|
2
|
+
export declare const skillDir: string;
|
|
3
|
+
/** Every skill folder: the main `ove` guide and the task guides (reels, voiceover, batches, AI). */
|
|
4
|
+
export declare const skillsRoot: string;
|
|
5
|
+
export type InitOptions = {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
skill?: boolean;
|
|
8
|
+
template?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function initProject(dir: string, options?: InitOptions): Promise<string[]>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Composition } from '../../schema/src/index.js';
|
|
2
|
+
export type TimelineLayer = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
scene: string;
|
|
6
|
+
depth: number;
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
editable: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function findRawLayers(raw: unknown, id: string): Record<string, any>[];
|
|
12
|
+
export declare function layerTimeline(composition: Composition, raw: unknown): TimelineLayer[];
|
|
13
|
+
export type LayerEdit = {
|
|
14
|
+
id: string;
|
|
15
|
+
set?: Record<string, unknown>;
|
|
16
|
+
unset?: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function applyLayerEdit(raw: unknown, edit: LayerEdit): unknown;
|
|
19
|
+
export type SceneEdit = {
|
|
20
|
+
id: string;
|
|
21
|
+
set: {
|
|
22
|
+
startFrame?: number;
|
|
23
|
+
durationFrames?: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** Moves or resizes a scene written directly in the file's scenes list (not one made by repeat or a variable). */
|
|
27
|
+
export declare function applySceneEdit(raw: unknown, edit: SceneEdit): unknown;
|
|
28
|
+
export type KeyframeEdit = {
|
|
29
|
+
id: string;
|
|
30
|
+
animation: number;
|
|
31
|
+
keyframe: number;
|
|
32
|
+
frame: number;
|
|
33
|
+
};
|
|
34
|
+
/** Retimes one keyframe of a layer's animation (its frame counts from the layer's own start), keeping the keyframes in order. */
|
|
35
|
+
export declare function applyKeyframeEdit(raw: unknown, edit: KeyframeEdit): unknown;
|
|
36
|
+
export declare function formatLike(previous: string, value: unknown): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type NarrateOptions, type NarrateResult, type AiProvider, type ComposeOptions, type ComposeResult, type TemplateChoice } from '../../ai/src/index.js';
|
|
2
|
+
export declare const templatesDir: string;
|
|
3
|
+
export type TemplateVariable = {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
default?: unknown;
|
|
7
|
+
description?: string;
|
|
8
|
+
/** list variables: the fields each item has, so a form can show one input per field */
|
|
9
|
+
items?: Record<string, {
|
|
10
|
+
type: string;
|
|
11
|
+
default?: unknown;
|
|
12
|
+
description?: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export type TemplateInfo = {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
tags: string[];
|
|
20
|
+
brief?: string;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
fps: number;
|
|
24
|
+
durationFrames: number;
|
|
25
|
+
durationSeconds: number;
|
|
26
|
+
previewFrame: number;
|
|
27
|
+
variables: TemplateVariable[];
|
|
28
|
+
order: number;
|
|
29
|
+
};
|
|
30
|
+
export type TemplateFile = {
|
|
31
|
+
dir: string;
|
|
32
|
+
info: TemplateInfo;
|
|
33
|
+
composition: Record<string, unknown>;
|
|
34
|
+
};
|
|
35
|
+
/** Template ids name a folder, so anything with a separator or a dot is refused before it can reach the filesystem. */
|
|
36
|
+
export declare function assertTemplateId(id: string): string;
|
|
37
|
+
/** Reads one template. `template.json` is required, so the starter project (which has none) is not listed as a template. */
|
|
38
|
+
export declare function readTemplate(id: string, root?: string): Promise<TemplateFile>;
|
|
39
|
+
/** Every template folder that has a template.json, in catalogue order. */
|
|
40
|
+
export declare function listTemplates(root?: string): Promise<TemplateInfo[]>;
|
|
41
|
+
/** Every template with its composition, in the shape `composeFromTemplate` reads. */
|
|
42
|
+
export declare function templateChoices(root?: string): Promise<TemplateChoice[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Compose by filling a ready-made template (a few hundred tokens), and write the whole composition only when that cannot
|
|
45
|
+
* work: `full` was asked for, assets or batch fields were supplied (templates use neither), no template has the wanted shape,
|
|
46
|
+
* or the model finds none that suits the brief.
|
|
47
|
+
*/
|
|
48
|
+
export declare function composeSmart(provider: AiProvider, options: ComposeOptions, mode?: {
|
|
49
|
+
full?: boolean;
|
|
50
|
+
}): Promise<ComposeResult & {
|
|
51
|
+
template?: string;
|
|
52
|
+
source?: Record<string, unknown>;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Narrate a composed video. A template video is cut to the voiceover (one spoken line per scene, scenes as long as their line);
|
|
56
|
+
* a free-form composition gets one script over the whole video, as before.
|
|
57
|
+
*/
|
|
58
|
+
export declare function narrateSmart(provider: AiProvider, composed: {
|
|
59
|
+
template?: string;
|
|
60
|
+
}, options: NarrateOptions & {
|
|
61
|
+
brief: string;
|
|
62
|
+
composition: NonNullable<NarrateOptions['composition']>;
|
|
63
|
+
}): Promise<NarrateResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ThumbnailOptions = {
|
|
2
|
+
frame?: number;
|
|
3
|
+
title?: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
allowCode?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type ThumbnailResult = {
|
|
8
|
+
png: Buffer;
|
|
9
|
+
frame: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
/** The frame used when none is given: well into the first scene, once its entrance has played. */
|
|
14
|
+
export declare function defaultThumbnailFrame(scenes: {
|
|
15
|
+
startFrame: number;
|
|
16
|
+
durationFrames: number;
|
|
17
|
+
id: string;
|
|
18
|
+
}[], durationFrames: number): number;
|
|
19
|
+
export declare function makeThumbnail(raw: any, values: Record<string, unknown>, baseDir: string, options?: ThumbnailOptions): Promise<ThumbnailResult>;
|
|
20
|
+
export declare function runThumbnail(argv: string[], raw: any, values: Record<string, unknown>, baseDir: string): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type TrackPoint = {
|
|
2
|
+
frame: number;
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
cx: number;
|
|
8
|
+
cy: number;
|
|
9
|
+
};
|
|
10
|
+
/** The box around the white of each frame of a matte (video or picture), at `fps` frames a second. Frames with no speaker repeat the last box. */
|
|
11
|
+
export declare function trackMatte(file: string, options?: {
|
|
12
|
+
fps?: number;
|
|
13
|
+
threshold?: number;
|
|
14
|
+
}): Promise<TrackPoint[]>;
|
|
15
|
+
/** Keyframes for a box of `labelWidth` x `labelHeight` pixels that stays beside the speaker: on the right when there is room, else on the left. Smoothed. */
|
|
16
|
+
export declare function labelKeyframes(points: TrackPoint[], canvas: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}, label: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}, options?: {
|
|
23
|
+
step?: number;
|
|
24
|
+
gap?: number;
|
|
25
|
+
}): {
|
|
26
|
+
xKeys: {
|
|
27
|
+
frame: number;
|
|
28
|
+
value: number;
|
|
29
|
+
}[];
|
|
30
|
+
yKeys: {
|
|
31
|
+
frame: number;
|
|
32
|
+
value: number;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
export declare function runTrack(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type WorkerOptions = {
|
|
2
|
+
port?: number;
|
|
3
|
+
host?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
concurrency?: number;
|
|
6
|
+
log?: (line: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export type WorkerServer = {
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
close(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export declare function startWorker(options?: WorkerOptions): Promise<WorkerServer>;
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const errorSchema: z.ZodObject<{
|
|
3
|
+
error: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type ApiError = z.infer<typeof errorSchema>;
|
|
6
|
+
export declare const projectModeSchema: z.ZodEnum<{
|
|
7
|
+
template: "template";
|
|
8
|
+
finished: "finished";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const projectSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
width: z.ZodNumber;
|
|
14
|
+
height: z.ZodNumber;
|
|
15
|
+
fps: z.ZodNumber;
|
|
16
|
+
durationFrames: z.ZodNumber;
|
|
17
|
+
seconds: z.ZodNumber;
|
|
18
|
+
scenes: z.ZodNumber;
|
|
19
|
+
modified: z.ZodNumber;
|
|
20
|
+
revisions: z.ZodNumber;
|
|
21
|
+
mode: z.ZodEnum<{
|
|
22
|
+
template: "template";
|
|
23
|
+
finished: "finished";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type Project = z.infer<typeof projectSchema>;
|
|
27
|
+
export declare const projectListSchema: z.ZodObject<{
|
|
28
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
width: z.ZodNumber;
|
|
32
|
+
height: z.ZodNumber;
|
|
33
|
+
fps: z.ZodNumber;
|
|
34
|
+
durationFrames: z.ZodNumber;
|
|
35
|
+
seconds: z.ZodNumber;
|
|
36
|
+
scenes: z.ZodNumber;
|
|
37
|
+
modified: z.ZodNumber;
|
|
38
|
+
revisions: z.ZodNumber;
|
|
39
|
+
mode: z.ZodEnum<{
|
|
40
|
+
template: "template";
|
|
41
|
+
finished: "finished";
|
|
42
|
+
}>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const variableSchema: z.ZodObject<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
type: z.ZodEnum<{
|
|
48
|
+
string: "string";
|
|
49
|
+
number: "number";
|
|
50
|
+
boolean: "boolean";
|
|
51
|
+
color: "color";
|
|
52
|
+
list: "list";
|
|
53
|
+
}>;
|
|
54
|
+
description: z.ZodOptional<z.ZodString>;
|
|
55
|
+
items: z.ZodOptional<z.ZodUnknown>;
|
|
56
|
+
value: z.ZodUnknown;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type Variable = z.infer<typeof variableSchema>;
|
|
59
|
+
export declare const textLayerSchema: z.ZodObject<{
|
|
60
|
+
path: z.ZodString;
|
|
61
|
+
scene: z.ZodString;
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
content: z.ZodString;
|
|
64
|
+
fontSize: z.ZodNumber;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type TextLayer = z.infer<typeof textLayerSchema>;
|
|
67
|
+
export declare const assetSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
path: z.ZodString;
|
|
70
|
+
kind: z.ZodString;
|
|
71
|
+
bytes: z.ZodNumber;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type Asset = z.infer<typeof assetSchema>;
|
|
74
|
+
export declare const sceneSummarySchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
startFrame: z.ZodNumber;
|
|
78
|
+
durationFrames: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type Scene = z.infer<typeof sceneSummarySchema>;
|
|
81
|
+
export declare const detailSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
width: z.ZodNumber;
|
|
85
|
+
height: z.ZodNumber;
|
|
86
|
+
fps: z.ZodNumber;
|
|
87
|
+
durationFrames: z.ZodNumber;
|
|
88
|
+
mode: z.ZodEnum<{
|
|
89
|
+
template: "template";
|
|
90
|
+
finished: "finished";
|
|
91
|
+
}>;
|
|
92
|
+
scenes: z.ZodArray<z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
startFrame: z.ZodNumber;
|
|
96
|
+
durationFrames: z.ZodNumber;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
type: z.ZodEnum<{
|
|
101
|
+
string: "string";
|
|
102
|
+
number: "number";
|
|
103
|
+
boolean: "boolean";
|
|
104
|
+
color: "color";
|
|
105
|
+
list: "list";
|
|
106
|
+
}>;
|
|
107
|
+
description: z.ZodOptional<z.ZodString>;
|
|
108
|
+
items: z.ZodOptional<z.ZodUnknown>;
|
|
109
|
+
value: z.ZodUnknown;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
theme: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
112
|
+
texts: z.ZodArray<z.ZodObject<{
|
|
113
|
+
path: z.ZodString;
|
|
114
|
+
scene: z.ZodString;
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
content: z.ZodString;
|
|
117
|
+
fontSize: z.ZodNumber;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
path: z.ZodString;
|
|
122
|
+
kind: z.ZodString;
|
|
123
|
+
bytes: z.ZodNumber;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
revisions: z.ZodNumber;
|
|
126
|
+
source: z.ZodObject<{
|
|
127
|
+
raw: z.ZodUnknown;
|
|
128
|
+
media: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
129
|
+
base: z.ZodString;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
export type Detail = z.infer<typeof detailSchema>;
|
|
133
|
+
export declare const revisionSchema: z.ZodObject<{
|
|
134
|
+
n: z.ZodNumber;
|
|
135
|
+
file: z.ZodString;
|
|
136
|
+
at: z.ZodString;
|
|
137
|
+
kind: z.ZodEnum<{
|
|
138
|
+
baseline: "baseline";
|
|
139
|
+
compose: "compose";
|
|
140
|
+
refine: "refine";
|
|
141
|
+
edit: "edit";
|
|
142
|
+
import: "import";
|
|
143
|
+
restore: "restore";
|
|
144
|
+
}>;
|
|
145
|
+
label: z.ZodString;
|
|
146
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
147
|
+
model: z.ZodOptional<z.ZodString>;
|
|
148
|
+
template: z.ZodOptional<z.ZodString>;
|
|
149
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
frames: z.ZodNumber;
|
|
151
|
+
scenes: z.ZodNumber;
|
|
152
|
+
changes: z.ZodArray<z.ZodString>;
|
|
153
|
+
restoredFrom: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type Revision = z.infer<typeof revisionSchema>;
|
|
156
|
+
export declare const historySchema: z.ZodObject<{
|
|
157
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
158
|
+
n: z.ZodNumber;
|
|
159
|
+
file: z.ZodString;
|
|
160
|
+
at: z.ZodString;
|
|
161
|
+
kind: z.ZodEnum<{
|
|
162
|
+
baseline: "baseline";
|
|
163
|
+
compose: "compose";
|
|
164
|
+
refine: "refine";
|
|
165
|
+
edit: "edit";
|
|
166
|
+
import: "import";
|
|
167
|
+
restore: "restore";
|
|
168
|
+
}>;
|
|
169
|
+
label: z.ZodString;
|
|
170
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
171
|
+
model: z.ZodOptional<z.ZodString>;
|
|
172
|
+
template: z.ZodOptional<z.ZodString>;
|
|
173
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
frames: z.ZodNumber;
|
|
175
|
+
scenes: z.ZodNumber;
|
|
176
|
+
changes: z.ZodArray<z.ZodString>;
|
|
177
|
+
restoredFrom: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export declare const blockSchema: z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
description: z.ZodString;
|
|
184
|
+
category: z.ZodString;
|
|
185
|
+
kind: z.ZodEnum<{
|
|
186
|
+
overlay: "overlay";
|
|
187
|
+
scene: "scene";
|
|
188
|
+
}>;
|
|
189
|
+
durationFrames: z.ZodNumber;
|
|
190
|
+
}, z.core.$loose>;
|
|
191
|
+
export type Block = z.infer<typeof blockSchema>;
|
|
192
|
+
export declare const themeSchema: z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
description: z.ZodString;
|
|
196
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
export type Theme = z.infer<typeof themeSchema>;
|
|
199
|
+
export declare const librarySchema: z.ZodObject<{
|
|
200
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
description: z.ZodString;
|
|
204
|
+
category: z.ZodString;
|
|
205
|
+
kind: z.ZodEnum<{
|
|
206
|
+
overlay: "overlay";
|
|
207
|
+
scene: "scene";
|
|
208
|
+
}>;
|
|
209
|
+
durationFrames: z.ZodNumber;
|
|
210
|
+
}, z.core.$loose>>;
|
|
211
|
+
themes: z.ZodArray<z.ZodObject<{
|
|
212
|
+
id: z.ZodString;
|
|
213
|
+
name: z.ZodString;
|
|
214
|
+
description: z.ZodString;
|
|
215
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
templates: z.ZodArray<z.ZodObject<{
|
|
218
|
+
id: z.ZodString;
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
description: z.ZodString;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
export type Library = z.infer<typeof librarySchema>;
|
|
224
|
+
export declare const jobKindSchema: z.ZodEnum<{
|
|
225
|
+
image: "image";
|
|
226
|
+
compose: "compose";
|
|
227
|
+
refine: "refine";
|
|
228
|
+
import: "import";
|
|
229
|
+
thumbnail: "thumbnail";
|
|
230
|
+
render: "render";
|
|
231
|
+
review: "review";
|
|
232
|
+
narrate: "narrate";
|
|
233
|
+
transcribe: "transcribe";
|
|
234
|
+
batch: "batch";
|
|
235
|
+
}>;
|
|
236
|
+
export type JobKind = z.infer<typeof jobKindSchema>;
|
|
237
|
+
export declare const jobSchema: z.ZodObject<{
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
kind: z.ZodEnum<{
|
|
240
|
+
image: "image";
|
|
241
|
+
compose: "compose";
|
|
242
|
+
refine: "refine";
|
|
243
|
+
import: "import";
|
|
244
|
+
thumbnail: "thumbnail";
|
|
245
|
+
render: "render";
|
|
246
|
+
review: "review";
|
|
247
|
+
narrate: "narrate";
|
|
248
|
+
transcribe: "transcribe";
|
|
249
|
+
batch: "batch";
|
|
250
|
+
}>;
|
|
251
|
+
status: z.ZodEnum<{
|
|
252
|
+
error: "error";
|
|
253
|
+
done: "done";
|
|
254
|
+
queued: "queued";
|
|
255
|
+
running: "running";
|
|
256
|
+
}>;
|
|
257
|
+
messages: z.ZodArray<z.ZodString>;
|
|
258
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
259
|
+
error: z.ZodOptional<z.ZodString>;
|
|
260
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
261
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
export type Job = z.infer<typeof jobSchema>;
|
|
264
|
+
export declare const jobEnvelopeSchema: z.ZodObject<{
|
|
265
|
+
job: z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
kind: z.ZodEnum<{
|
|
268
|
+
image: "image";
|
|
269
|
+
compose: "compose";
|
|
270
|
+
refine: "refine";
|
|
271
|
+
import: "import";
|
|
272
|
+
thumbnail: "thumbnail";
|
|
273
|
+
render: "render";
|
|
274
|
+
review: "review";
|
|
275
|
+
narrate: "narrate";
|
|
276
|
+
transcribe: "transcribe";
|
|
277
|
+
batch: "batch";
|
|
278
|
+
}>;
|
|
279
|
+
status: z.ZodEnum<{
|
|
280
|
+
error: "error";
|
|
281
|
+
done: "done";
|
|
282
|
+
queued: "queued";
|
|
283
|
+
running: "running";
|
|
284
|
+
}>;
|
|
285
|
+
messages: z.ZodArray<z.ZodString>;
|
|
286
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
287
|
+
error: z.ZodOptional<z.ZodString>;
|
|
288
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
export declare const statusSchema: z.ZodObject<{
|
|
293
|
+
outDir: z.ZodString;
|
|
294
|
+
jobs: z.ZodArray<z.ZodObject<{
|
|
295
|
+
id: z.ZodString;
|
|
296
|
+
kind: z.ZodEnum<{
|
|
297
|
+
image: "image";
|
|
298
|
+
compose: "compose";
|
|
299
|
+
refine: "refine";
|
|
300
|
+
import: "import";
|
|
301
|
+
thumbnail: "thumbnail";
|
|
302
|
+
render: "render";
|
|
303
|
+
review: "review";
|
|
304
|
+
narrate: "narrate";
|
|
305
|
+
transcribe: "transcribe";
|
|
306
|
+
batch: "batch";
|
|
307
|
+
}>;
|
|
308
|
+
status: z.ZodEnum<{
|
|
309
|
+
error: "error";
|
|
310
|
+
done: "done";
|
|
311
|
+
queued: "queued";
|
|
312
|
+
running: "running";
|
|
313
|
+
}>;
|
|
314
|
+
messages: z.ZodArray<z.ZodString>;
|
|
315
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
316
|
+
error: z.ZodOptional<z.ZodString>;
|
|
317
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
}, z.core.$strip>>;
|
|
320
|
+
error: z.ZodNullable<z.ZodString>;
|
|
321
|
+
provider: z.ZodNullable<z.ZodObject<{
|
|
322
|
+
id: z.ZodString;
|
|
323
|
+
model: z.ZodString;
|
|
324
|
+
baseUrl: z.ZodString;
|
|
325
|
+
capabilities: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
export type Status = z.infer<typeof statusSchema>;
|
|
329
|
+
/** What a finished job that wrote a file reports. */
|
|
330
|
+
export declare const resultFileSchema: z.ZodObject<{
|
|
331
|
+
file: z.ZodString;
|
|
332
|
+
relative: z.ZodString;
|
|
333
|
+
url: z.ZodString;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
export type ResultFile = z.infer<typeof resultFileSchema>;
|
|
336
|
+
export declare const newProjectRequest: z.ZodObject<{
|
|
337
|
+
name: z.ZodString;
|
|
338
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
339
|
+
aspect: z.ZodOptional<z.ZodString>;
|
|
340
|
+
duration: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
341
|
+
fps: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
export declare const renameRequest: z.ZodObject<{
|
|
344
|
+
id: z.ZodString;
|
|
345
|
+
name: z.ZodString;
|
|
346
|
+
}, z.core.$strip>;
|
|
347
|
+
export declare const idRequest: z.ZodObject<{
|
|
348
|
+
id: z.ZodString;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
export declare const variablesRequest: z.ZodObject<{
|
|
351
|
+
id: z.ZodString;
|
|
352
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
export declare const themeRequest: z.ZodObject<{
|
|
355
|
+
id: z.ZodString;
|
|
356
|
+
theme: z.ZodString;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
export declare const textRequest: z.ZodObject<{
|
|
359
|
+
id: z.ZodString;
|
|
360
|
+
path: z.ZodString;
|
|
361
|
+
content: z.ZodString;
|
|
362
|
+
}, z.core.$strip>;
|
|
363
|
+
export declare const addBlockRequest: z.ZodObject<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
block: z.ZodString;
|
|
366
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
367
|
+
frames: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
368
|
+
scene: z.ZodOptional<z.ZodString>;
|
|
369
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
export declare const restoreRequest: z.ZodObject<{
|
|
372
|
+
file: z.ZodString;
|
|
373
|
+
n: z.ZodNumber;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
export type NewProjectRequest = z.infer<typeof newProjectRequest>;
|
|
376
|
+
/** The first problem in a request, in the words the studio shows. */
|
|
377
|
+
export declare function parseRequest<T extends z.ZodType>(schema: T, body: unknown): z.infer<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Composition } from '../../schema/src/index.js';
|
|
2
|
+
import { type AudioMix } from '../../ffmpeg/src/index.js';
|
|
3
|
+
export declare function sfxFile(name: string): Promise<string>;
|
|
4
|
+
export declare const sourceOf: (composition: Composition, src: string, baseDir: string) => Promise<string>;
|
|
5
|
+
export declare function planAudio(composition: Composition, baseDir: string, probe?: (source: string) => Promise<boolean>): Promise<AudioMix | undefined>;
|
|
6
|
+
export declare function measureMix(mix: AudioMix): Promise<{
|
|
7
|
+
integrated: number;
|
|
8
|
+
truePeak: number;
|
|
9
|
+
} | undefined>;
|
|
10
|
+
export declare function masterAudio(composition: Composition, baseDir: string): Promise<AudioMix | undefined>;
|
|
11
|
+
export declare function measureLoudness(composition: Composition, baseDir: string): Promise<{
|
|
12
|
+
integrated: number;
|
|
13
|
+
truePeak: number;
|
|
14
|
+
} | undefined>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Composition } from '../../schema/src/index.js';
|
|
2
|
+
import { type X264Preset } from '../../ffmpeg/src/index.js';
|
|
3
|
+
import type { RenderMediaResult, RenderProgress } from './index.js';
|
|
4
|
+
export type ChunkFormat = 'mp4' | 'webm' | 'mov';
|
|
5
|
+
export type ChunkSettings = {
|
|
6
|
+
format: ChunkFormat;
|
|
7
|
+
codec: 'h264' | 'h265';
|
|
8
|
+
transparent: boolean;
|
|
9
|
+
preset: X264Preset;
|
|
10
|
+
crf?: number;
|
|
11
|
+
bitrate?: string;
|
|
12
|
+
scale?: number;
|
|
13
|
+
};
|
|
14
|
+
export type ChunkJob = {
|
|
15
|
+
index: number;
|
|
16
|
+
frameRange: [number, number];
|
|
17
|
+
};
|
|
18
|
+
export type RenderWorker = {
|
|
19
|
+
name: string;
|
|
20
|
+
renderChunk(composition: Composition, job: ChunkJob, settings: ChunkSettings, signal: AbortSignal): Promise<Buffer>;
|
|
21
|
+
};
|
|
22
|
+
export declare function planChunks(first: number, last: number, chunkSize: number): ChunkJob[];
|
|
23
|
+
export declare function absolutizeSources(composition: Composition, baseDir: string): Composition;
|
|
24
|
+
export type RenderDistributedOptions = {
|
|
25
|
+
output: string;
|
|
26
|
+
baseDir?: string;
|
|
27
|
+
workers: RenderWorker[];
|
|
28
|
+
chunkSize?: number;
|
|
29
|
+
frameRange?: [number, number];
|
|
30
|
+
format?: ChunkFormat;
|
|
31
|
+
codec?: 'h264' | 'h265';
|
|
32
|
+
transparent?: boolean;
|
|
33
|
+
preset?: X264Preset;
|
|
34
|
+
crf?: number;
|
|
35
|
+
bitrate?: string;
|
|
36
|
+
audioBitrate?: string;
|
|
37
|
+
scale?: number;
|
|
38
|
+
loudness?: number;
|
|
39
|
+
motionBlur?: boolean;
|
|
40
|
+
/** Attempts per chunk beyond the first, each on the next free worker. */ retries?: number;
|
|
41
|
+
onProgress?: (progress: RenderProgress & {
|
|
42
|
+
chunk: number;
|
|
43
|
+
worker: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
onWorkerError?: (worker: string, error: Error) => void;
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
};
|
|
48
|
+
export declare function renderDistributed(composition: Composition, options: RenderDistributedOptions): Promise<RenderMediaResult>;
|
|
49
|
+
export declare function httpWorker(url: string, token: string): RenderWorker;
|
|
50
|
+
export declare const tokensMatch: (given: string, expected: string) => boolean;
|