motionrender 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,26 @@
|
|
|
1
|
+
import { type Composition } from '../../core/src/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* assets: the supplied assets, id to src. srcs: other sources that are fine as they are (used when changing an existing composition).
|
|
4
|
+
* relativeInside: also allow relative paths that cannot leave the project folder (for pasted JSON, where nothing is supplied).
|
|
5
|
+
*/
|
|
6
|
+
export type AssetPolicy = {
|
|
7
|
+
assets: Map<string, string>;
|
|
8
|
+
srcs?: Set<string>;
|
|
9
|
+
relativeInside?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** Problems with the assets a composition declares or uses, in the wording used to ask the model to fix them. */
|
|
12
|
+
export declare function assetProblems(composition: Composition, policy: AssetPolicy): string[];
|
|
13
|
+
/**
|
|
14
|
+
* The policy for changing a composition that already exists: what it already declares and uses stays allowed (read both as written
|
|
15
|
+
* and with its templates expanded), plus anything newly supplied; anything else is new and refused.
|
|
16
|
+
*/
|
|
17
|
+
export declare function refinePolicy(current: unknown, supplied?: {
|
|
18
|
+
id: string;
|
|
19
|
+
src: string;
|
|
20
|
+
}[]): AssetPolicy;
|
|
21
|
+
/** A declared asset that is one of the supplied ones gets the supplied src, however the model spelled it. */
|
|
22
|
+
export declare function restoreSuppliedSources(raw: any, supplied?: {
|
|
23
|
+
id: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
src: string;
|
|
26
|
+
}[]): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Composition, type RenderMediaOptions } from '../../core/src/index.js';
|
|
2
|
+
export type BatchSettings = Pick<RenderMediaOptions, 'preset' | 'crf' | 'bitrate' | 'audioBitrate' | 'scale' | 'loudness' | 'format' | 'codec' | 'transparent' | 'concurrency' | 'motionBlur' | 'frameRange'>;
|
|
3
|
+
export type BatchJob = {
|
|
4
|
+
row: number;
|
|
5
|
+
values: Record<string, unknown>;
|
|
6
|
+
composition: Composition;
|
|
7
|
+
output: string;
|
|
8
|
+
};
|
|
9
|
+
export type BatchPlan = {
|
|
10
|
+
jobs: BatchJob[];
|
|
11
|
+
};
|
|
12
|
+
export declare function planBatch(composition: Composition, rows: Record<string, unknown>[], pattern: string, baseDir: string): Promise<BatchPlan>;
|
|
13
|
+
export declare function renderBatch(plan: BatchPlan, baseDir: string, settings: BatchSettings, options?: {
|
|
14
|
+
limit?: number;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
onProgress?: (message: string) => void;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
outputs: string[];
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Composition, type ReviewIssue } from '../../core/src/index.js';
|
|
2
|
+
import type { AiProvider } from './providers.js';
|
|
3
|
+
import { type PromptOptions } from './prompt.js';
|
|
4
|
+
export type ComposeOptions = PromptOptions & {
|
|
5
|
+
brief: string;
|
|
6
|
+
maxAttempts?: number;
|
|
7
|
+
/** Run `ove review`-style checks between attempts and feed design errors back. Slow; off by default. */
|
|
8
|
+
review?: boolean;
|
|
9
|
+
baseDir?: string;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
onProgress?: (message: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export type ComposeResult = {
|
|
14
|
+
composition: Composition;
|
|
15
|
+
attempts: number;
|
|
16
|
+
issues: ReviewIssue[];
|
|
17
|
+
warnings: string[];
|
|
18
|
+
};
|
|
19
|
+
export declare function composeVideo(provider: AiProvider, options: ComposeOptions): Promise<ComposeResult>;
|
|
20
|
+
export type RefineOptions = {
|
|
21
|
+
instruction: string;
|
|
22
|
+
maxAttempts?: number;
|
|
23
|
+
/** Run `ove review`-style checks between attempts and feed design errors back. */
|
|
24
|
+
review?: boolean;
|
|
25
|
+
/** Pictures, clips and sounds newly made available; what the composition already uses stays allowed. */
|
|
26
|
+
assets?: {
|
|
27
|
+
id: string;
|
|
28
|
+
src: string;
|
|
29
|
+
}[];
|
|
30
|
+
baseDir?: string;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
onProgress?: (message: string) => void;
|
|
33
|
+
};
|
|
34
|
+
export declare function refineVideo(provider: AiProvider, currentComposition: Composition | any, options: RefineOptions): Promise<ComposeResult>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type RevisionKind = 'baseline' | 'compose' | 'refine' | 'edit' | 'import' | 'restore';
|
|
2
|
+
export type Revision = {
|
|
3
|
+
n: number;
|
|
4
|
+
/** File name inside the history folder. */
|
|
5
|
+
file: string;
|
|
6
|
+
at: string;
|
|
7
|
+
kind: RevisionKind;
|
|
8
|
+
/** The brief or instruction, or a note such as "Before AI changes". */
|
|
9
|
+
label: string;
|
|
10
|
+
provider?: string;
|
|
11
|
+
model?: string;
|
|
12
|
+
template?: string;
|
|
13
|
+
attempts?: number;
|
|
14
|
+
frames: number;
|
|
15
|
+
scenes: number;
|
|
16
|
+
/** What differs from the previous revision, in a few short phrases. */
|
|
17
|
+
changes: string[];
|
|
18
|
+
restoredFrom?: number;
|
|
19
|
+
};
|
|
20
|
+
export type RevisionMeta = {
|
|
21
|
+
kind: RevisionKind;
|
|
22
|
+
label: string;
|
|
23
|
+
provider?: string;
|
|
24
|
+
model?: string;
|
|
25
|
+
template?: string;
|
|
26
|
+
attempts?: number;
|
|
27
|
+
restoredFrom?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function listRevisions(compositionFile: string): Promise<Revision[]>;
|
|
30
|
+
/** A few short phrases about what changed between two compositions. */
|
|
31
|
+
export declare function summarizeChange(previous: any, next: any): string[];
|
|
32
|
+
/** Keeps the composition file as it is now as the next revision. */
|
|
33
|
+
export declare function saveRevision(compositionFile: string, meta: RevisionMeta): Promise<Revision>;
|
|
34
|
+
/** Before an AI change replaces a composition that has no history yet, keeps what is there as revision 1. */
|
|
35
|
+
export declare function ensureBaseline(compositionFile: string): Promise<Revision | undefined>;
|
|
36
|
+
/** Makes revision n the current composition (and records that as a new revision, so nothing is lost). */
|
|
37
|
+
export declare function restoreRevision(compositionFile: string, n: number): Promise<Revision>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Composition } from '../../core/src/index.js';
|
|
2
|
+
import type { AiProvider } from './providers.js';
|
|
3
|
+
export type GenerateImageOptions = {
|
|
4
|
+
out: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
composition?: Composition;
|
|
8
|
+
compositionPath?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
};
|
|
12
|
+
export type GenerateImageResult = {
|
|
13
|
+
file: string;
|
|
14
|
+
id: string;
|
|
15
|
+
composition?: Composition;
|
|
16
|
+
};
|
|
17
|
+
export declare function imageSize(size?: string): string;
|
|
18
|
+
/** Generates one picture, writes it, and optionally registers it as an asset in a composition. */
|
|
19
|
+
export declare function generateImage(provider: AiProvider, options: GenerateImageOptions): Promise<GenerateImageResult>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './providers.js';
|
|
2
|
+
export * from './compose.js';
|
|
3
|
+
export * from './assets.js';
|
|
4
|
+
export * from './history.js';
|
|
5
|
+
export * from './template.js';
|
|
6
|
+
export { applyFixes, isFixReply, type Fix } from './patch.js';
|
|
7
|
+
export * from './narrate.js';
|
|
8
|
+
export * from './voiceover.js';
|
|
9
|
+
export * from './image.js';
|
|
10
|
+
export * from './batch.js';
|
|
11
|
+
export * from './project.js';
|
|
12
|
+
export { extractJson, sanitizeCompositionJson } from './json.js';
|
|
13
|
+
export { systemPrompt, userPrompt, refineUserPrompt, refineOutlinePrompt, compositionOutline, refineOutlineChars, ratioName, type PromptOptions } from './prompt.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Composition } from '../../core/src/index.js';
|
|
2
|
+
import type { AiProvider, Transcript } from './providers.js';
|
|
3
|
+
export type NarrateOptions = {
|
|
4
|
+
text?: string;
|
|
5
|
+
brief?: string;
|
|
6
|
+
outDir: string;
|
|
7
|
+
voice?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
/** Target length for a generated script, in seconds. */
|
|
10
|
+
durationSeconds?: number;
|
|
11
|
+
composition?: Composition;
|
|
12
|
+
compositionPath?: string;
|
|
13
|
+
tailSeconds?: number;
|
|
14
|
+
captions?: boolean;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
onProgress?: (message: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export type NarrateResult = {
|
|
19
|
+
audio: string;
|
|
20
|
+
captions?: string;
|
|
21
|
+
durationSeconds: number;
|
|
22
|
+
words: number;
|
|
23
|
+
composition?: Composition;
|
|
24
|
+
text: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function cleanScript(text: string): string;
|
|
27
|
+
export declare function writeNarrationScript(provider: AiProvider, brief: string, options?: {
|
|
28
|
+
durationSeconds?: number;
|
|
29
|
+
language?: string;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
}): Promise<string>;
|
|
32
|
+
export type SceneOptions = {
|
|
33
|
+
audioSrc?: string;
|
|
34
|
+
captionsSrc?: string;
|
|
35
|
+
sceneId?: string;
|
|
36
|
+
captionStartFrame?: number;
|
|
37
|
+
durationSeconds: number;
|
|
38
|
+
tailSeconds?: number;
|
|
39
|
+
};
|
|
40
|
+
export declare function narrationScene(composition: Composition, options: SceneOptions): Composition;
|
|
41
|
+
export declare function narrate(provider: AiProvider, options: NarrateOptions): Promise<NarrateResult>;
|
|
42
|
+
export type CaptionOptions = {
|
|
43
|
+
audio: string;
|
|
44
|
+
outDir?: string;
|
|
45
|
+
language?: string;
|
|
46
|
+
composition?: Composition;
|
|
47
|
+
compositionPath?: string;
|
|
48
|
+
/** Seconds into the video where the audio starts, so the captions line up. */
|
|
49
|
+
startSeconds?: number;
|
|
50
|
+
tailSeconds?: number;
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
onProgress?: (message: string) => void;
|
|
53
|
+
};
|
|
54
|
+
export type CaptionResult = {
|
|
55
|
+
captions: string;
|
|
56
|
+
durationSeconds: number;
|
|
57
|
+
words: number;
|
|
58
|
+
cues: number;
|
|
59
|
+
composition?: Composition;
|
|
60
|
+
transcript: Transcript;
|
|
61
|
+
};
|
|
62
|
+
/** Captions for audio that already exists (a recorded voiceover or a video's own sound). */
|
|
63
|
+
export declare function captionAudio(provider: AiProvider, options: CaptionOptions): Promise<CaptionResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Fix = {
|
|
2
|
+
path?: string;
|
|
3
|
+
value?: unknown;
|
|
4
|
+
remove?: boolean;
|
|
5
|
+
layer?: string;
|
|
6
|
+
set?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
/** A reply that holds fixes and not a composition of its own. */
|
|
9
|
+
export declare const isFixReply: (reply: any) => reply is {
|
|
10
|
+
fixes: Fix[];
|
|
11
|
+
};
|
|
12
|
+
/** Applies the fixes to a copy of the composition. A fix that cannot be placed is an error the model gets to read. */
|
|
13
|
+
export declare function applyFixes(previous: any, fixes: Fix[]): any;
|
|
14
|
+
/** What the model is told after a failed attempt, once there is a composition it can patch. */
|
|
15
|
+
export declare const patchFeedback: (intro: string) => string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Composition } from '../../core/src/index.js';
|
|
2
|
+
export declare const colorValue: RegExp;
|
|
3
|
+
export type FieldSpec = {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
example?: unknown;
|
|
8
|
+
};
|
|
9
|
+
/** Variables inferred from a batch file, so a generated template can be used with `ove render --batch` unchanged. */
|
|
10
|
+
export declare function fieldsFromRows(rows: Record<string, unknown>[]): FieldSpec[];
|
|
11
|
+
/** Writes a ready-to-use project: composition.json, the schema for editors, and an assets folder. */
|
|
12
|
+
export declare function writeCompositionProject(dir: string, composition: Composition, options?: {
|
|
13
|
+
force?: boolean; /** Written instead of the resolved composition: a template that is still a template (variables, components). */
|
|
14
|
+
source?: unknown;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
dir: string;
|
|
17
|
+
composition: string;
|
|
18
|
+
schema: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** A composition-relative path in the form OVE accepts (`./assets/x.png`, or `../shared/x.png`). */
|
|
21
|
+
export declare function compositionRelative(baseDir: string, file: string): string;
|
|
22
|
+
export declare const assetIdFromPath: (file: string) => string;
|
|
23
|
+
export declare const baseDirOf: (file: string) => string;
|
|
24
|
+
/** Values for a template's required variables, so a raw file can be checked without knowing real inputs. */
|
|
25
|
+
export declare function sampleValues(raw: any): Record<string, unknown>;
|
|
26
|
+
/** Validates a composition that may still contain template variables, without resolving them in the file. */
|
|
27
|
+
export declare function validateTemplate(raw: any): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type PromptOptions = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
fps: number;
|
|
5
|
+
durationSeconds: number;
|
|
6
|
+
kind?: string;
|
|
7
|
+
fields?: {
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
example?: unknown;
|
|
12
|
+
}[];
|
|
13
|
+
assets?: {
|
|
14
|
+
id: string;
|
|
15
|
+
type: string;
|
|
16
|
+
src: string;
|
|
17
|
+
}[];
|
|
18
|
+
includeSchema?: boolean;
|
|
19
|
+
narration?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare function systemPrompt(options?: Partial<PromptOptions>): string;
|
|
22
|
+
export declare function userPrompt(brief: string, options: PromptOptions): string;
|
|
23
|
+
export declare function refineUserPrompt(composition: any, instruction: string): string;
|
|
24
|
+
/** Compositions longer than this many characters are shown to the model as an outline, not in full (about 4000 tokens). */
|
|
25
|
+
export declare const refineOutlineChars = 16000;
|
|
26
|
+
/** One line per layer, with the path to it, so changes can be addressed exactly without sending animation and component bodies. */
|
|
27
|
+
export declare function compositionOutline(composition: any, maxLines?: number): string;
|
|
28
|
+
/** For a large composition: the outline, and a request for fixes by path instead of the whole composition back. */
|
|
29
|
+
export declare function refineOutlinePrompt(composition: any, instruction: string): string;
|
|
30
|
+
export declare function ratioName(width: number, height: number): string;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type ChatRole = 'system' | 'user' | 'assistant';
|
|
2
|
+
export type ChatMessage = {
|
|
3
|
+
role: ChatRole;
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export type ChatOptions = {
|
|
7
|
+
json?: boolean;
|
|
8
|
+
temperature?: number;
|
|
9
|
+
maxTokens?: number;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
};
|
|
12
|
+
export type ImageOptions = {
|
|
13
|
+
size?: string;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
};
|
|
16
|
+
export type ImageResult = {
|
|
17
|
+
data: Uint8Array;
|
|
18
|
+
extension: string;
|
|
19
|
+
};
|
|
20
|
+
export type SpeakOptions = {
|
|
21
|
+
voice?: string;
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
};
|
|
24
|
+
export type AudioResult = {
|
|
25
|
+
data: Uint8Array;
|
|
26
|
+
extension: string;
|
|
27
|
+
};
|
|
28
|
+
export type TranscriptWord = {
|
|
29
|
+
text: string;
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
};
|
|
33
|
+
export type TranscriptCue = {
|
|
34
|
+
text: string;
|
|
35
|
+
start: number;
|
|
36
|
+
end: number;
|
|
37
|
+
};
|
|
38
|
+
export type Transcript = {
|
|
39
|
+
text: string;
|
|
40
|
+
words: TranscriptWord[];
|
|
41
|
+
cues: TranscriptCue[];
|
|
42
|
+
};
|
|
43
|
+
/** A video model: chat is required; image, speech and transcription are optional capabilities. */
|
|
44
|
+
export type AiProvider = {
|
|
45
|
+
id: string;
|
|
46
|
+
model: string;
|
|
47
|
+
baseUrl: string;
|
|
48
|
+
chat(messages: ChatMessage[], options?: ChatOptions): Promise<string>;
|
|
49
|
+
image?(prompt: string, options?: ImageOptions): Promise<ImageResult>;
|
|
50
|
+
speak?(text: string, options?: SpeakOptions): Promise<AudioResult>;
|
|
51
|
+
transcribe?(audio: Uint8Array, filename: string, options?: {
|
|
52
|
+
language?: string;
|
|
53
|
+
signal?: AbortSignal;
|
|
54
|
+
}): Promise<Transcript>;
|
|
55
|
+
};
|
|
56
|
+
export type ProviderId = 'groq' | 'mock';
|
|
57
|
+
export type ProviderConfig = {
|
|
58
|
+
provider?: string;
|
|
59
|
+
model?: string;
|
|
60
|
+
baseUrl?: string;
|
|
61
|
+
apiKey?: string;
|
|
62
|
+
/** The model used for images, speech and transcription; chat uses `model`. */
|
|
63
|
+
imageModel?: string;
|
|
64
|
+
speechModel?: string;
|
|
65
|
+
transcriptionModel?: string;
|
|
66
|
+
};
|
|
67
|
+
export declare const providerCapabilities: (provider: AiProvider) => {
|
|
68
|
+
chat: boolean;
|
|
69
|
+
image: boolean;
|
|
70
|
+
speech: boolean;
|
|
71
|
+
transcription: boolean;
|
|
72
|
+
};
|
|
73
|
+
export declare const requestTimeoutMs = 180000;
|
|
74
|
+
/** Aborts when the caller's signal does or when the timeout passes, whichever comes first (a caller's signal does not remove the timeout). */
|
|
75
|
+
export declare const timeoutSignal: (signal?: AbortSignal | null, ms?: number) => AbortSignal;
|
|
76
|
+
/** The longest wait before a retry, whatever Retry-After or the error text asks for. */
|
|
77
|
+
export declare const maxRetryDelayMs = 30000;
|
|
78
|
+
export declare function request(url: string, init: RequestInit, what: string): Promise<Response>;
|
|
79
|
+
export declare function transcriptFrom(data: any): Transcript;
|
|
80
|
+
/** Converts raw 16-bit mono/stereo PCM to a standard WAV container. */
|
|
81
|
+
export declare function pcmToWav(pcmData: Uint8Array, sampleRate?: number, numChannels?: number, bitsPerSample?: number): Uint8Array;
|
|
82
|
+
export declare function splitSpeech(text: string, limit?: number): string[];
|
|
83
|
+
/** Joins WAV files that share one format (sample rate, channels, bit depth). */
|
|
84
|
+
export declare function concatWav(parts: Uint8Array[]): Uint8Array;
|
|
85
|
+
export declare class GroqProvider implements AiProvider {
|
|
86
|
+
id: string;
|
|
87
|
+
model: string;
|
|
88
|
+
baseUrl: string;
|
|
89
|
+
apiKey: string;
|
|
90
|
+
speechModel: string;
|
|
91
|
+
transcriptionModel: string;
|
|
92
|
+
constructor(config?: ProviderConfig);
|
|
93
|
+
private headers;
|
|
94
|
+
chat(messages: ChatMessage[], options?: ChatOptions): Promise<string>;
|
|
95
|
+
speak(text: string, options?: SpeakOptions): Promise<AudioResult>;
|
|
96
|
+
transcribe(audio: Uint8Array, filename: string, options?: {
|
|
97
|
+
language?: string;
|
|
98
|
+
signal?: AbortSignal;
|
|
99
|
+
}): Promise<Transcript>;
|
|
100
|
+
}
|
|
101
|
+
export declare class MockProvider implements AiProvider {
|
|
102
|
+
id: string;
|
|
103
|
+
model: string;
|
|
104
|
+
baseUrl: string;
|
|
105
|
+
chat(messages: ChatMessage[]): Promise<string>;
|
|
106
|
+
image(): Promise<ImageResult>;
|
|
107
|
+
}
|
|
108
|
+
export declare function createProvider(config?: ProviderConfig): AiProvider;
|
|
109
|
+
export declare function describeProvider(provider: AiProvider): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type Composition } from '../../core/src/index.js';
|
|
2
|
+
import type { AiProvider } from './providers.js';
|
|
3
|
+
export type TemplateVariableInfo = {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
default?: unknown;
|
|
7
|
+
description?: string;
|
|
8
|
+
items?: Record<string, {
|
|
9
|
+
type: string;
|
|
10
|
+
default?: unknown;
|
|
11
|
+
description?: string;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export type ThemeChoice = {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
variables: Record<string, string | number>;
|
|
19
|
+
};
|
|
20
|
+
/** `themed` templates read colour variables (bg, text, accent…) that a theme can set. */
|
|
21
|
+
export type TemplateChoice = {
|
|
22
|
+
themed?: boolean;
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
durationSeconds: number;
|
|
29
|
+
variables: TemplateVariableInfo[];
|
|
30
|
+
composition: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
export type TemplateOptions = {
|
|
33
|
+
brief: string;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
/** Pictures the user supplied; picture variables (image, photo…) may name one of them. */
|
|
37
|
+
assets?: {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
src: string;
|
|
41
|
+
}[];
|
|
42
|
+
/** Themes the model may choose for a themed template. */
|
|
43
|
+
themes?: ThemeChoice[];
|
|
44
|
+
maxAttempts?: number;
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
onProgress?: (message: string) => void;
|
|
47
|
+
};
|
|
48
|
+
export type TemplateResult = {
|
|
49
|
+
source: Record<string, unknown>;
|
|
50
|
+
composition: Composition;
|
|
51
|
+
attempts: number;
|
|
52
|
+
template: string;
|
|
53
|
+
theme?: string;
|
|
54
|
+
values: Record<string, unknown>;
|
|
55
|
+
warnings: string[];
|
|
56
|
+
};
|
|
57
|
+
/** Variables that hold a picture (an asset id or nothing): image, image2, photo, heroImage… */
|
|
58
|
+
export declare const isPictureVariable: (name: string) => boolean;
|
|
59
|
+
/** The templates whose shape matches the wanted video, so a vertical reel is never filled into a landscape layout. */
|
|
60
|
+
export declare const templatesFor: (templates: TemplateChoice[], size: {
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
}) => TemplateChoice[];
|
|
64
|
+
/** The template with the given values as the variables' defaults, checked and resolved like any composition. */
|
|
65
|
+
export declare function fillTemplate(template: TemplateChoice, values: Record<string, unknown>, theme?: ThemeChoice, assets?: {
|
|
66
|
+
id: string;
|
|
67
|
+
type: string;
|
|
68
|
+
src: string;
|
|
69
|
+
}[]): Composition;
|
|
70
|
+
/** The template with the values and theme written in, still a template (variables, components): what is saved so it stays editable. */
|
|
71
|
+
export declare function fillTemplateSource(template: TemplateChoice, values: Record<string, unknown>, theme?: ThemeChoice, assets?: {
|
|
72
|
+
id: string;
|
|
73
|
+
type: string;
|
|
74
|
+
src: string;
|
|
75
|
+
}[]): any;
|
|
76
|
+
/**
|
|
77
|
+
* Asks the model for a template and its values. Returns undefined when no template has the wanted shape or the model says
|
|
78
|
+
* none suits the brief, so the caller can fall back to writing a whole composition.
|
|
79
|
+
*/
|
|
80
|
+
export declare function composeFromTemplate(provider: AiProvider, templates: TemplateChoice[], options: TemplateOptions): Promise<TemplateResult | undefined>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Composition } from '../../core/src/index.js';
|
|
2
|
+
import type { AiProvider } from './providers.js';
|
|
3
|
+
export type VoiceoverOptions = {
|
|
4
|
+
brief: string;
|
|
5
|
+
outDir: string;
|
|
6
|
+
compositionPath?: string;
|
|
7
|
+
voice?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
/** Frames of picture before a line starts, and of pause after it. */
|
|
10
|
+
leadFrames?: number;
|
|
11
|
+
padFrames?: number;
|
|
12
|
+
tailFrames?: number;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
onProgress?: (message: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export type VoiceoverResult = {
|
|
17
|
+
composition: Composition;
|
|
18
|
+
audio: string;
|
|
19
|
+
captions?: string;
|
|
20
|
+
durationSeconds: number;
|
|
21
|
+
words: number;
|
|
22
|
+
lines: string[];
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Carries a narration (scene timings, the narration scene, its assets and the new length) from the resolved composition back into the
|
|
27
|
+
* template source it came from, so the video stays editable. Undefined when the scenes do not line up (then save the resolved one).
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeNarration(source: Record<string, any>, resolved: Composition): Record<string, any> | undefined;
|
|
30
|
+
/** Format of a canonical PCM WAV: channels, sample rate, bits, and the length of its audio in seconds. */
|
|
31
|
+
export declare function wavInfo(data: Uint8Array): {
|
|
32
|
+
channels: number;
|
|
33
|
+
sampleRate: number;
|
|
34
|
+
bits: number;
|
|
35
|
+
seconds: number;
|
|
36
|
+
};
|
|
37
|
+
/** One spoken line per scene, written from what the scene shows. */
|
|
38
|
+
export declare function writeSceneLines(provider: AiProvider, brief: string, scenes: {
|
|
39
|
+
texts: string[];
|
|
40
|
+
seconds: number;
|
|
41
|
+
}[], options?: {
|
|
42
|
+
language?: string;
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
}): Promise<string[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Speaks one line per scene and resizes the scenes to fit, then adds the narration scene (audio and captions). The composition
|
|
47
|
+
* must have its scenes laid out one after another with their transitions (as the template videos are).
|
|
48
|
+
*/
|
|
49
|
+
export declare function narrateScenes(provider: AiProvider, composition: Composition, options: VoiceoverOptions): Promise<VoiceoverResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Animation } from '../../schema/src/index.js';
|
|
2
|
+
export declare const easingNames: readonly ["linear", "easeIn", "easeOut", "easeInOut", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInBack", "easeOutBack", "spring", "hold", "land", "snap", "glide", "pop", "move", "exit", "drift"];
|
|
3
|
+
export type Easing = typeof easingNames[number] | readonly [number, number, number, number];
|
|
4
|
+
export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number, t: number): number;
|
|
5
|
+
export declare function ease(t: number, kind?: Easing): number;
|
|
6
|
+
export declare function parseColor(value: string): [number, number, number, number];
|
|
7
|
+
export declare function mixColors(from: string, to: string, t: number): string;
|
|
8
|
+
export declare function interpolate(frame: number, input: readonly number[], output: readonly number[], easing?: Easing): number;
|
|
9
|
+
export declare function animationSegment(animation: {
|
|
10
|
+
keyframes: readonly {
|
|
11
|
+
frame: number;
|
|
12
|
+
value: unknown;
|
|
13
|
+
easing?: Easing;
|
|
14
|
+
}[];
|
|
15
|
+
repeat?: number;
|
|
16
|
+
reverse?: boolean;
|
|
17
|
+
}, frame: number): {
|
|
18
|
+
from: unknown;
|
|
19
|
+
to: unknown;
|
|
20
|
+
t: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function evaluateAnimation(animation: Animation, frame: number): number | string;
|
|
23
|
+
export declare function spring(frame: number, fps: number, config?: {
|
|
24
|
+
damping?: number;
|
|
25
|
+
stiffness?: number;
|
|
26
|
+
mass?: number;
|
|
27
|
+
}): number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const cacheKinds: readonly ["media", "video", "sfx"];
|
|
2
|
+
export type CacheKind = typeof cacheKinds[number];
|
|
3
|
+
export declare const cacheRoot: () => string;
|
|
4
|
+
export declare const cacheDir: (kind: CacheKind) => string;
|
|
5
|
+
/** Marks an entry as used now (its modification time), for cleaning by age. Missing entries are ignored. */
|
|
6
|
+
export declare const touchCacheEntry: (path: string) => Promise<void>;
|
|
7
|
+
type Listed = CacheKind | 'other';
|
|
8
|
+
export type CacheUsage = {
|
|
9
|
+
root: string;
|
|
10
|
+
kinds: {
|
|
11
|
+
kind: Listed;
|
|
12
|
+
entries: number;
|
|
13
|
+
bytes: number;
|
|
14
|
+
}[];
|
|
15
|
+
bytes: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function cacheUsage(): Promise<CacheUsage>;
|
|
18
|
+
/** Removes cache entries last used before `olderThanMs` ago (all of them when not given). Returns what was freed. */
|
|
19
|
+
export declare function cleanCache(options?: {
|
|
20
|
+
olderThanMs?: number;
|
|
21
|
+
kinds?: readonly Listed[];
|
|
22
|
+
}): Promise<{
|
|
23
|
+
entries: number;
|
|
24
|
+
bytes: number;
|
|
25
|
+
}>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Composition } from '../../schema/src/index.js';
|
|
2
|
+
export declare const supportedAssetTypes: readonly ["png", "jpeg", "webp", "svg", "mp4", "webm", "mp3", "wav", "woff", "woff2"];
|
|
3
|
+
export declare function validateAssetPath(src: string): void;
|
|
4
|
+
export declare const isUrl: (src: string) => boolean;
|
|
5
|
+
export declare function resolveAssetSource(composition: Composition, src: string, baseDir: string): string;
|
|
6
|
+
export declare function toDataUrl(source: string): Promise<string>;
|
|
7
|
+
export declare function resolveAudio(composition: Composition, baseDir: string): string | undefined;
|
|
8
|
+
export * from './cache.js';
|