Skip to content

Open source CapCut alternative.

TypeScript

feat(site): the chat sets word effects [rebuild]

David Le50b42809a64d
diff --git a/site/src/cut/components/AnimationTiles.tools.ts b/site/src/cut/components/AnimationTiles.tools.ts
index 28f2801b..93f39d50 100644
--- a/site/src/cut/components/AnimationTiles.tools.ts
+++ b/site/src/cut/components/AnimationTiles.tools.ts
@@ -16,8 +16,8 @@ import {
GLYPH_LOOP_STYLE_IDS,
OVERLAY_ANIM_STYLE_IDS,
OVERLAY_LOOP_STYLE_IDS,
- WORD_ACCENT_MODE_IDS,
- WORD_ACCENT_NOTES,
+ wordEffectCatalog,
+ WORD_EFFECT_IDS,
WORD_POP_SCALE,
WORD_SWELL_MAX,
WORD_SWELL_MIN,
@@ -36,7 +36,7 @@ export const OVERLAY_ANIMATION_TOOLS = [
{
name: "set_overlay_animation",
description:
- `Animate an overlay element (title, shape, or sticker): preset In/Out ramps, a Loop that runs its whole duration, and a Move that says what the element does WHILE it holds. Omitted slots keep their setting; pass "none" to clear one. In/Out styles: ${OVERLAY_ANIM_STYLE_IDS.join(", ")} — slide names are the motion direction; typewriter animates titles only; ${GLYPH_ANIM_STYLE_IDS.join(", ")} move a title's letters one at a time, and move any other kind as one piece. Loop styles: ${OVERLAY_LOOP_STYLE_IDS.join(", ")} — ${GLYPH_LOOP_STYLE_IDS.join(", ")} carry a title's letters on their own delays, and carry any other kind as one piece. A move is a slot like the others and never touches the element's keyframe track; use set_overlay_keyframes when no named move fits, and both compose together. Word emphasis — words_style, titles only — keeps the whole line on screen and lights each word as it is said, timed against the cut's transcript when there is one and spread across the element's own span when there is not; it is the slot for "make each word pop as I say it".`,
+ `Animate an overlay element (title, shape, or sticker): preset In/Out ramps, a Loop that runs its whole duration, and a Move that says what the element does WHILE it holds. Omitted slots keep their setting; pass "none" to clear one. In/Out styles: ${OVERLAY_ANIM_STYLE_IDS.join(", ")} — slide names are the motion direction; typewriter animates titles only; ${GLYPH_ANIM_STYLE_IDS.join(", ")} move a title's letters one at a time, and move any other kind as one piece. Loop styles: ${OVERLAY_LOOP_STYLE_IDS.join(", ")} — ${GLYPH_LOOP_STYLE_IDS.join(", ")} carry a title's letters on their own delays, and carry any other kind as one piece. A move is a slot like the others and never touches the element's keyframe track; use set_overlay_keyframes when no named move fits, and both compose together. Word effects — words_style, titles only — play the line word by word, timed against the cut's transcript when there is one and spread across the element's own span when there is not: an emphasis travels along a line that is fully up, and a build assembles the line as it is spoken. It is the slot for "make each word pop as I say it" and for "have the words appear one by one".`,
inputSchema: obj({
id: str("Overlay element id"),
move: {
@@ -67,12 +67,15 @@ export const OVERLAY_ANIMATION_TOOLS = [
loop_speed: num("Loop rate multiplier 0.25..4 (default 1)"),
words_style: {
type: "string",
- enum: [...WORD_ACCENT_MODE_IDS, "none"],
- description: `How each word is emphasized as it is said, or "none" to clear — ${WORD_ACCENT_MODE_IDS.map((id) => `${id}: ${WORD_ACCENT_NOTES[id]}`).join("; ")}`,
+ enum: [...WORD_EFFECT_IDS, "none"],
+ description: `What each word does as it is said, or "none" to clear.\n${wordEffectCatalog()}`,
},
- words_color: str("Word emphasis accent color (hex)"),
+ words_color: str("Word effect accent color (hex)"),
words_scale: num(
- `How far the emphasized word swells, ${WORD_SWELL_MIN}..${WORD_SWELL_MAX} (pop defaults to ${WORD_POP_SCALE}, the others to 1). The swollen word takes its new width in the line, so its neighbours move aside and settle back as the emphasis travels on.`
+ `How far a word swells at its moment, ${WORD_SWELL_MIN}..${WORD_SWELL_MAX} (pop defaults to ${WORD_POP_SCALE}, the effects that do not resize stay at 1). The swollen word takes its new width in the line, so its neighbours move aside and settle back as the emphasis travels on.`
+ ),
+ words_dim: num(
+ "How opaque a word is off its moment, 0..1 — 0 means it is not there yet (build), a fraction leaves the line faintly visible (fill, spotlight). Effects that do not fade their words ignore it."
),
}, ["id"]),
},
diff --git a/site/src/cut/components/SubtitlesPanel.tools.ts b/site/src/cut/components/SubtitlesPanel.tools.ts
index 2145e44e..48f9a836 100644
--- a/site/src/cut/components/SubtitlesPanel.tools.ts
+++ b/site/src/cut/components/SubtitlesPanel.tools.ts
@@ -7,7 +7,13 @@
*/
import { bool, num, obj, str, type AiToolDef } from "@/cut/lib/aiToolDef";
-import { CAPTION_STYLES, WORD_ACCENT_MODES } from "@/cut/lib/subtitles";
+import { CAPTION_STYLES } from "@/cut/lib/subtitles";
+import {
+ WORD_EFFECT_MENU,
+ WORD_POP_SCALE,
+ WORD_SWELL_MAX,
+ WORD_SWELL_MIN,
+} from "@donkeycut/effects-kit";
export const SUBTITLES_TOOLS = [
{
@@ -79,18 +85,24 @@ export const SUBTITLES_TOOLS = [
{
name: "set_caption_look",
description:
- "Style the caption track: a text-videos look id in `look` sets everything at once (preset, size, font, karaoke highlight, accent color, frame background), or set the pieces yourself. Restyling captions is a change the user asks for — leave the track as it is when they only asked for the words. Karaoke — word_highlight — keeps the whole line up and emphasizes each word as it is spoken or sung, in the preview and the export burn-in; it needs word timings, which transcription and sync_lyrics leave on the cues. Naming an accent_mode turns it on, so \"make the words pop as I say them\" is one call with accent_mode: pop.",
+ "Style the caption track: a text-videos look id in `look` sets everything at once (preset, size, font, word effect, accent color, frame background), or set the pieces yourself. Restyling captions is a change the user asks for — leave the track as it is when they only asked for the words. Word effects — word_highlight — play the caption word by word as it is spoken or sung, in the preview and the export burn-in; they need word timings, which transcription and sync_lyrics leave on the cues. An emphasis travels along a line that is fully up; a build assembles the line as it is spoken. Naming an accent_mode turns it on, so \"make the words pop as I say them\" is one call with accent_mode: pop, and \"have the caption appear word by word\" is accent_mode: build.",
inputSchema: obj({
look: str("Text-videos look id — sets the whole caption look"),
style: str(`Caption preset: ${Object.keys(CAPTION_STYLES).join(", ")}`),
size: num("Caption size in px at a 1080-wide frame"),
font: str("Font id"),
- word_highlight: bool("Emphasize each word as it lands (karaoke)"),
- accent_color: str("Highlight color"),
+ word_highlight: bool("Play the caption word by word as it lands"),
+ accent_color: str("Word effect accent color"),
+ accent_scale: num(
+ `How far a word swells at its moment, ${WORD_SWELL_MIN}..${WORD_SWELL_MAX} (pop defaults to ${WORD_POP_SCALE}); the effects that do not resize ignore it`
+ ),
+ accent_dim: num(
+ "How opaque a word is off its moment, 0..1 — 0 means it is not there yet (build), a fraction leaves the caption faintly up (fill, spotlight); the effects that do not fade their words ignore it"
+ ),
accent_mode: {
type: "string",
- enum: WORD_ACCENT_MODES.map((m) => m.id),
- description: `How the spoken word is emphasized — ${WORD_ACCENT_MODES.map((m) => `${m.id}: ${m.hint}`).join("; ")}`,
+ enum: WORD_EFFECT_MENU.map((m) => m.id),
+ description: `What each word does as it is said — ${WORD_EFFECT_MENU.map((m) => `${m.id}: ${m.note}`).join("; ")}`,
},
x: num("Caption center x 0..1"),
y: num("Caption center y 0..1"),
diff --git a/site/src/cut/lib/aiTools.ts b/site/src/cut/lib/aiTools.ts
index 76711e45..652041e9 100644
--- a/site/src/cut/lib/aiTools.ts
+++ b/site/src/cut/lib/aiTools.ts
@@ -23,7 +23,7 @@ import {
OVERLAY_ANIM_STYLE_IDS,
OVERLAY_LOOP_STYLE_IDS,
hasOverlayAnim,
- WORD_ACCENT_MODE_IDS,
+ WORD_EFFECT_IDS,
WORD_SWELL_MAX,
WORD_SWELL_MIN,
type OverlayAnim,
@@ -96,7 +96,7 @@ import { renderStageFrame, storeStageStill } from "./stageFrame";
import { createRasterCanvas, decodeRasterImageUrl, rasterCanvasToDataUrl } from "./raster";
import { buildAiContext } from "./aiContext";
import { sampleClipFrameData } from "./previewCanvas";
-import { CAPTION_STYLES, laneCues, subtitleLaneCount, WORD_ACCENT_MODES } from "./subtitles";
+import { CAPTION_STYLES, laneCues, subtitleLaneCount } from "./subtitles";
import { fuseTimeline, renderFusedTimeline } from "./watch/fuse";
import { mergeWatch, mergeWatchNotes, uncoveredSeconds, unnotedSpans } from "./watch/merge";
import { syncLines } from "./lyricSync";
@@ -152,7 +152,7 @@ import {
type AnimStyle,
type AssetWatch,
type CaptionStyleId,
- type WordAccentMode,
+ type WordEffectId,
type AudioClip,
type ClipShadow,
type ColorGrade,
@@ -474,31 +474,35 @@ const toolRuns: Record<BrowserToolName, ToolRun> = {
const wordScale = isNum(input.words_scale)
? clamp(input.words_scale, WORD_SWELL_MIN, WORD_SWELL_MAX)
: undefined;
+ const wordDim = isNum(input.words_dim) ? clamp(input.words_dim, 0, 1) : undefined;
if (typeof rawWords === "string") {
if (rawWords === "none") delete anim.words;
- else if (!(WORD_ACCENT_MODE_IDS as string[]).includes(rawWords))
- throw new ToolError(`Unknown word emphasis: ${rawWords}`);
+ else if (!(WORD_EFFECT_IDS as string[]).includes(rawWords))
+ throw new ToolError(`Unknown word effect: ${rawWords}`);
else if ((o.kind ?? "text") !== "text")
- throw new ToolError("Word emphasis lights up a title's words; it needs a title.");
+ throw new ToolError("Word effects play a title's words; they need a title.");
else {
const color = wordColor ?? anim.words?.color;
const scale = wordScale ?? anim.words?.scale;
- // The transcript is the clock the emphasis follows. It is read now,
+ const dim = wordDim ?? anim.words?.dim;
+ // The transcript is the clock the effect follows. It is read now,
// against whatever the cut has been transcribed to say; with nothing
// to read, the words share the element's own span.
const times = isTextOverlay(o) ? wordTimesFor(o, s.subtitles.cues) : undefined;
anim.words = {
- style: rawWords as WordAccentMode,
+ style: rawWords as WordEffectId,
...(color ? { color } : {}),
...(scale !== undefined ? { scale } : {}),
+ ...(dim !== undefined ? { dim } : {}),
...(times ? { times } : {}),
};
}
- } else if ((wordColor || wordScale !== undefined) && anim.words) {
+ } else if ((wordColor || wordScale !== undefined || wordDim !== undefined) && anim.words) {
anim.words = {
...anim.words,
...(wordColor ? { color: wordColor } : {}),
...(wordScale !== undefined ? { scale: wordScale } : {}),
+ ...(wordDim !== undefined ? { dim: wordDim } : {}),
};
}
s.updateOverlay(o.id, { anim: hasOverlayAnim(anim) ? anim : undefined });
@@ -1658,10 +1662,13 @@ const toolRuns: Record<BrowserToolName, ToolRun> = {
patch.font = input.font;
if (typeof input.word_highlight === "boolean") patch.wordHighlight = input.word_highlight;
if (typeof input.accent_color === "string") patch.accentColor = input.accent_color;
- if (WORD_ACCENT_MODES.some((m) => m.id === input.accent_mode)) {
- patch.accentMode = input.accent_mode as WordAccentMode;
- // Naming a treatment is asking for the emphasis, so it comes on with
- // the mode unless this same call turned it off.
+ if (isNum(input.accent_scale))
+ patch.accentScale = clamp(input.accent_scale, WORD_SWELL_MIN, WORD_SWELL_MAX);
+ if (isNum(input.accent_dim)) patch.accentDim = clamp(input.accent_dim, 0, 1);
+ if ((WORD_EFFECT_IDS as string[]).includes(input.accent_mode as string)) {
+ patch.accentMode = input.accent_mode as WordEffectId;
+ // Naming an effect is asking for it, so it comes on with the pick
+ // unless this same call turned it off.
if (patch.wordHighlight === undefined && !s.subtitles.wordHighlight)
patch.wordHighlight = true;
}
@@ -1677,6 +1684,8 @@ const toolRuns: Record<BrowserToolName, ToolRun> = {
wordHighlight: cur.wordHighlight === true,
accentColor: cur.accentColor,
accentMode: cur.accentMode,
+ accentScale: cur.accentScale,
+ accentDim: cur.accentDim,
};
},
diff --git a/site/src/cut/server/ai/catalog.ts b/site/src/cut/server/ai/catalog.ts
index fbbf1ea5..9e882784 100644
--- a/site/src/cut/server/ai/catalog.ts
+++ b/site/src/cut/server/ai/catalog.ts
@@ -12,8 +12,8 @@
import { AI_PANEL_TOOLS } from "@/cut/components/AiPanel.tools";
import { TEXT_LAYOUT_IDS, TEXT_LAYOUT_NOTES } from "@/cut/lib/textCompose";
import { textLookCatalog } from "@/cut/lib/textLooks";
-import { CAPTION_STYLES, WORD_ACCENT_MODES } from "@/cut/lib/subtitles";
-import { WORD_ACCENT_MODE_IDS } from "@donkeycut/effects-kit";
+import { CAPTION_STYLES } from "@/cut/lib/subtitles";
+import { wordEffectCatalog, WORD_EFFECT_IDS } from "@donkeycut/effects-kit";
import { textMoveCatalog } from "@/cut/lib/textMotion";
import { OVERLAY_ANIMATION_TOOLS } from "@/cut/components/AnimationTiles.tools";
import { AUDIO_TOOLS } from "@/cut/components/AudioPanel.tools";
@@ -176,7 +176,7 @@ Stickers (add_sticker): a project image asset (generated cutouts in the Elements
Custom stickers (create_sticker): one call generates the image, removes the background, adds the die-cut outline, and places it — use it when the user asks for a sticker of something they don't have (it spends credits like image generation).
Effects (add_effect): time-ranged treatments over the finished cut. Three families, one list: the picture treatments (${EFFECT_TREATMENTS.join(", ")}), the graded looks (${LOOK_EFFECTS.join(", ")}), and the audio treatments (${AUDIO_EFFECT_IDS.join(", ")}). A picture effect treats the footage and everything laid over it; an audio effect treats everything audible under its window at once — clip sound, upper-track sound and the soundtrack — so "make this bit sound like a phone call", "put an echo on that line", or "muffle the music here" is an effect element over that stretch, and a per-clip volume, fade or duck is the audio tools instead. A handover on the sound at a cut belongs to the transition on that cut — the audiocross style — not here. Placed like any element and tuned with \`amount\` (update_overlay), and trims like anything else: a picture effect dropped over a clip opens covering that clip, while an audio effect opens at the standard length wherever it was placed — a treatment on the sound is aimed at a moment, so give it the window you mean. One effect at a time reads best, amounts under ~0.5. Effects are stylized post treatments on a stretch of timeline; pure color — exposure, warmth, a cinematic or film palette on one clip — is the per-clip grading tools instead (color-grading skill), whose preset catalog is separate from the look effects.
Advanced text (update_overlay): italic, align (multi-line), letter_spacing (em), line_height, stretch_x/stretch_y (glyph stretch multipliers, the side grips' axis-only resize), stroke_color/stroke_width (em outline behind the fill), and richer shadows. Bundled Google families join the system set — ${GOOGLE_FONT_IDS.join(", ")} — and so do the user's own: a .ttf/.otf/.woff/.woff2 file dropped on the Library is offered in every project under a font id like "font:<id>". Editor_state lists the ones this account has under \`fonts\` — use an id from there instead of guessing at a family name, and when someone asks for a typeface that is not in the list, tell them the Library takes font files.
-Animation (set_overlay_animation): every element takes preset In/Out ramps (${OVERLAY_ANIM_STYLE_IDS.join(", ")} — typewriter for titles only; the per-letter styles sweep a title character by character), a Loop (${OVERLAY_LOOP_STYLE_IDS.join(", ")}) that runs its whole duration, and a Move that says what it does WHILE it holds. A title takes one more: Words (${WORD_ACCENT_MODE_IDS.join(", ")}), which holds the whole line on screen and lights each word as it is said. Entrances 0.3–0.6s read well; one loop per scene, sparingly; a move on the lines that matter. All of them are slots on the element, applied internally; the keyframe track (set_overlay_keyframes) is the separate power tier for motion the names do not cover, and slots compose over it.
+Animation (set_overlay_animation): every element takes preset In/Out ramps (${OVERLAY_ANIM_STYLE_IDS.join(", ")} — typewriter for titles only; the per-letter styles sweep a title character by character), a Loop (${OVERLAY_LOOP_STYLE_IDS.join(", ")}) that runs its whole duration, and a Move that says what it does WHILE it holds. A title takes one more: Words (${WORD_EFFECT_IDS.join(", ")}), which plays the line word by word — an emphasis travelling along a line that is fully up, or a build assembling the line as it is spoken. Entrances 0.3–0.6s read well; one loop per scene, sparingly; a move on the lines that matter. All of them are slots on the element, applied internally; the keyframe track (set_overlay_keyframes) is the separate power tier for motion the names do not cover, and slots compose over it.
Keyframes (set_overlay_keyframes): for motion no preset covers — a path across the frame, a slow push in, a drift that holds first. A key is a whole pose (position, scale, rotation, opacity) at a time in seconds from the element's start; the pose moves linearly between keys and holds outside them, and presets still compose on top. Two or three keys carry almost everything; reach for a preset first and keyframes when the user describes a specific path or timing. In the UI the diamond in the inspector adds a key at the playhead, and dragging the element then records into it. set_clip_keyframes is the same track on a video clip (any track): pans, push-ins, picture-in-picture flights, spins, and fades on the footage itself.
Masks (set_mask): trim any element or video clip to a shape — rect, square, circle, linear, mirror — with feather, invert, and its own keyframe track for reveals and wipes. The subject kind trims by the person in the shot (on-device segmentation; preview and export match): inverted sits the item behind the speaker, plain keeps it only on the speaker. Behind-speaker reads well when the speaker is clearly separated from the background; with no detectable person it degrades to the plain picture. Groups: the user can group elements (select several, Group in the inspector) — selecting one selects all, and moves/resize/rotate/timing ride together.
Composite builds: these primitives compose. Stacked overlay video copies, masks and their keys, pose keyframes, staggered starts, and shapes construct effects beyond any preset list. Given a reference (a screenshot or clip of an effect the user wants), reverse-engineer it:
@@ -195,7 +195,7 @@ A video whose picture is words. Three pieces: the frame behind them (set_backgro
**Design is something the user asks for.** "Add the text", "put what he says on screen", "add text from the audio" is a plain job: get the words and their times — the cues already in editor_state, a source's transcript, listen_audio, or subtitles_generate when the user wants a caption track — then place them with add_text_sequence and no \`look\`. That lays one readable face at one spot with a short fade, no cards, no moves, no tilts, and no repaint of the frame. Then align_to_audio: the times you placed came from a transcript, and that pass measures them against the mix's own waveform and moves each edge onto the speech. Reach for a look, cards, moves, or a variation only when the ask carries a design in it: a lyric video, kinetic type, a named style or vibe, "make it fun", a reference to match. A cut that comes back restyled when the user asked for words on screen is the failure this default exists to prevent.
-**Two ways to carry the words.** A caption track is one styled row of text that follows a voice — it holds word timings, and one call restyles every line. Elements are separate titles and cards on the timeline — per-line face, per-line placement, per-glyph motion, a color card behind each line — which is what kinetic typography and lyric cards are made of. Captions for a song you want to sing along to; elements when each line is its own picture. Both burn into the export, and both light each word as it is said: word_highlight on the caption track, the words slot of set_overlay_animation on a title.
+**Two ways to carry the words.** A caption track is one styled row of text that follows a voice — it holds word timings, and one call restyles every line. Elements are separate titles and cards on the timeline — per-line face, per-line placement, per-glyph motion, a color card behind each line — which is what kinetic typography and lyric cards are made of. Captions for a song you want to sing along to; elements when each line is its own picture. Both burn into the export, and both play their words as they are said: word_highlight on the caption track, the words slot of set_overlay_animation on a title. Two families to pick from — an emphasis travels along a line that is fully up (the word lights, swells, or takes a card), and a build assembles the line as it is spoken (words appearing one by one, or a faint line going solid word by word).
**The looks.** A look is opt-in, and it is not one line's styling — it is the design of a whole run. It sets the frame color, the cards it cycles, the type, the entrance, the caption equivalent, AND the ensemble the run walks across its length: the faces it rotates through, the entrances, where successive lines land, and what each line does while it holds. So one add_text_sequence call already produces a composed, varied run:
${textLookCatalog()}
@@ -212,7 +212,7 @@ Never lay a run at variation "none" and then repair it with a hundred update_ove
**A lyric video, from an audio track and the words.** The user has the song and the lyrics.
1. The song is in the cut (a soundtrack clip). \`get_state\` confirms it and gives the duration.
2. sync_lyrics with the lyrics text, one line per screen. It transcribes the cut, aligns the user's words to what it recognized, and writes the user's text — verbatim — onto a caption track with per-word times. Singing defeats recognizers; that is why the wording comes from the user and only the clock comes from the transcript.
-3. Dress it: set_caption_look with a look id (karaoke-glow for words lighting up, neon-club, serif-mood…), or accent_mode on its own to pick how the sung word is emphasized — pop swells it, box puts a card behind it, or add_text_sequence from_captions to turn the same timed lines into full-frame cards. Going the element route, re-send the lines yourself with emphasis and section on them rather than from_captions — from_captions carries the timing but knows nothing about which line is the hook.
+3. Dress it: set_caption_look with a look id (karaoke-glow for words lighting up, neon-club, serif-mood…), or accent_mode on its own to pick what each sung word does — pop swells it, box puts a card behind it, build has the line appear a word at a time, fill leaves it faintly up and solidifies each word as it lands — or add_text_sequence from_captions to turn the same timed lines into full-frame cards. Going the element route, re-send the lines yourself with emphasis and section on them rather than from_captions — from_captions carries the timing but knows nothing about which line is the hook.
4. Check it: sync_lyrics already snaps its lines to the mix, and align_to_audio re-runs that pass any time (on the caption track, or on the elements of a run with target elements). Then seek + capture_frame at three or four lines that landed on DIFFERENT rota steps, and listen_audio across one of them. A single line still sitting early or late retimes with update_cue.
With no lyrics text, transcribe with subtitles_generate and work from the cues it wrote.
@@ -299,7 +299,7 @@ ${textMoveCatalog()}
**How to use this list.** Pick a look for the base design, one composition device, one rhythm device and one motion device, and hold them for the whole video. Then break the pattern exactly once, on the hook. That single break is what a viewer remembers.`,
"audio-and-subtitles": `# Audio, voiceover & subtitles
-Lyrics and scripts the user already has: sync_lyrics times their exact words against the audio (transcribing first when needed) and writes them to a caption track with per-word timings; set_caption_look then dresses the track — preset, size, font, karaoke word highlight, accent color — from a text-videos look id or field by field. The text-videos skill has the whole flow, including turning the same timed lines into full-frame cards.
+Lyrics and scripts the user already has: sync_lyrics times their exact words against the audio (transcribing first when needed) and writes them to a caption track with per-word timings; set_caption_look then dresses the track — preset, size, font, word effect, accent color — from a text-videos look id or field by field. The text-videos skill has the whole flow, including turning the same timed lines into full-frame cards.
Soundtrack clips: volume 0..1.5, fadeIn/fadeOut seconds (max half the clip), start = timeline position, in/out = trim inside the source; clips can spread across several soundtrack lanes (the \`lane\` field), new sounds slide to free space in their lane. Fades render with ffmpeg afade on export.
Ducking: a soundtrack clip's \`duck\` (0..1, via update_audio) lowers ALL other audio — video-clip sound and other music — to that gain while the clip plays; 1 clears it. Voiceovers set this so narration sits over quieter music. It applies in both the preview and the export.
Audio effects (add_effect): the treatments over the sound — ${AUDIO_EFFECT_IDS.join(", ")} — placed on the timeline as elements, each treating everything audible under its window at once. Reach for one when the ask is how a stretch SOUNDS ("make this line sound like a phone call", "echo on that word", "muffle the music behind the voiceover"); \`amount\` says how far the treatment goes, and the effect trims and moves like any element. Loudness, fades and ducking on one clip stay with the audio tools; a dissolve across a cut stays with the transition on that cut (the audiocross style).
@@ -313,7 +313,7 @@ Generating: subtitles_generate transcribes the cut's audio on-device (Apple spee
captions_generate rewrites a track's cues into punchy social captions (emoji, curiosity-hook opener) in a style (clean/hook/punchy), keeping timings — use it when the ask is social/TikTok captions rather than a plain transcript.
Editing: update_cue (text or retime), delete_cue, merge_cue (joins into the previous cue on the same track). In the panel, Return splits a caption at the cursor onto real word timings; hand-edited text drops its word timings.
subtitles_set_view: showOnVideo (preview + export burn-in), showOnTimeline (amber cue rows).
-Caption look: set_caption_look carries the whole look — the visual presets (${Object.keys(CAPTION_STYLES).join(", ")}), size, font, and the karaoke emphasis with its accent overrides; the Subtitles panel offers the same, and each track's caption drags to a new spot in the preview. The emphasis keeps the whole line readable and lights the word being said: ${WORD_ACCENT_MODES.map((m) => `${m.id} (${m.hint})`).join(", ")}. captions_generate's clean/hook/punchy choice shapes the caption text it writes; the visual preset is separate.`,
+Caption look: set_caption_look carries the whole look — the visual presets (${Object.keys(CAPTION_STYLES).join(", ")}), size, font, and the word effect with its color, swell and fade settings; the Subtitles panel offers the same, and each track's caption drags to a new spot in the preview. The word effects play the caption as it is said:\n${wordEffectCatalog()}\ncaptions_generate's clean/hook/punchy choice shapes the caption text it writes; the visual preset is separate.`,
"ai-generation": `# Stock media & AI generation
Three ways to get footage the user doesn't have: bundled stock (local, free), a URL they point at (import_url downloads TikTok / YouTube / Instagram / direct links, free), and hosted generation (signed in, spends credits). Prefer stock when it genuinely fits; generate when the shot needs to be specific.
@@ -375,7 +375,7 @@ Rules:
- Edits are undoable (unlimited undo), so prefer doing over asking; only ask when the request is genuinely ambiguous. Ambiguous means the target itself is unresolvable — "shorten that clip" with nothing selected and several clips gets "Which clip?" and no edit; guessing a target and editing it is worse than the question. The existing cut is the user's work: adding media adds — never delete, trim, or reorder a timeline clip unless the user said to. Read "change it / make it X / try again / closer to the original" as a fresh take that lands on its own card beside the old, never as license to delete the old clip first; only an explicit "replace / delete / remove this" clears what's already there. Items you placed yourself while working the current ask are your own scaffolding: revise, retime, or delete them freely until the result matches the ask — tearing down your own misstep and rebuilding is part of doing the job. The guardrail covers the user's media and the settled work of earlier turns. Generation is different: undo removes the clip but the credits stay spent, so be certain the user asked for the media before calling a generation tool. Removing media is different too — delete_asset and library_organize deletes don't come back with undo, so they take an explicit ask naming the media.
- Times are seconds. The frame follows project.aspect in editor_state — any "W:H" ratio, short side 1080px; project.frame has the exact pixels. The frame is the user's setting: work within the shape they chose, and change it only when they ask for a different one. A generation that renders in another shape letterboxes inside their frame — mention that if it matters, and leave the choice to them.
- Exercise judgment on details the user left open, and state the choice you made. Judgment fills in the parameters of the asked-for change (style, length, placement); the scope stays the ask, and extra tools, tracks, or treatments beyond it wait for the user to ask. Editing defaults: a hard cut at every joint; when transitions are asked for, one style family per video at 0.4–0.6s. The editing-taste skill carries the full doctrine.
-- Styling is part of the ask, never a bonus. Words the user asked to put on screen — a title, the lines from the audio, a caption run — go on in one plain readable face at one place, timed to what they are for. Per-line typefaces, tilts, color cards, moves, karaoke highlights and a repainted frame are a design, and a design is something the user asks for: a lyric video, kinetic type, a named style or vibe, a reference to match, "make it fun". Call add_text_sequence with no \`look\` for the plain job, and leave the caption styling and the background as you found them.
+- Styling is part of the ask, never a bonus. Words the user asked to put on screen — a title, the lines from the audio, a caption run — go on in one plain readable face at one place, timed to what they are for. Per-line typefaces, tilts, color cards, moves, word effects and a repainted frame are a design, and a design is something the user asks for: a lyric video, kinetic type, a named style or vibe, a reference to match, "make it fun". Call add_text_sequence with no \`look\` for the plain job, and leave the caption styling and the background as you found them.
- Read list_skills / read_skill before working in an area you're unsure about — they document every setting. A tool whose description already answers the ask goes straight through.
- A reference image or clip the user attaches ("do this", "put our video in this style") carries one of two asks — decide which before acting. When its footage's look is the point (color, lighting, film grade), route to color grading — match_color_grade computes the grade from the reference's own pixels, then the grading tools refine (color-grading skill) — or to look effects or restyle when the reference is a stylized treatment. When it demonstrates an editing device — a tile grid, a mosaic reveal, a split layout, an animated title treatment — the ask is to construct that device on the user's own footage: read the graphics skill's composite-builds section and build it with overlay tracks, masks, and keyframes. Your tools compose into effects far beyond the preset lists, so reach for construction before declaring something out of reach. Construction is free and undoable; a whole-look re-render (restyle_scene) spends credits — when the reading is ambiguous, say what each path would do and let the user pick.
- Captions that sit off the speech are re-timed, never re-transcribed: align_to_audio measures the cut's own waveform and moves each edge onto the voice, on a caption track or on the elements of a text run. Re-transcribing to fix timing throws away the user's wording, and hand-retiming with update_cue guesses at what the audio already says.