//! The agent's cheat sheet: the `edith://help` resource, the `help` tool, and the
//! first lines of the initialize `instructions`. The tool list and the edit op
//! list are read from the live tool table, so the sheet cannot drift from what
//! the server accepts. The edit op manual is the `edit` tool's description, so the
//! per-op entries are parsed from it rather than copied.
use serde_json::{Value, json};
use crate::server::{self, Reply, Server, Tool};
/// The fixed topics, besides the edit op names and the tool names.
const TOPICS: [&str; 20] = [
"ops",
"times",
"recipes",
"first_video",
"podcast",
"lanes",
"ripple",
"export",
"subtitles",
"captions",
"project",
"burn_captions",
"visualizer",
"looks",
"overlays",
"vertical",
"sequences",
"multicam",
"stretch",
"unsupported",
];
/// Tool groups in the order the sheet lists them. A registered tool that is in no
/// group lands under `other`, and a test fails if that happens.
const GROUPS: &[(&str, &[&str])] = &[
("project", &["project_new", "templates", "project_open", "project_save", "project_collect", "project_export_timeline", "project_import_timeline", "project_status", "project_settings"]),
("media", &["media_probe", "media_import", "media_list", "media_remove", "media_relink", "media_bin", "proxies"]),
("look", &["timeline", "clip_info"]),
("see", &["frame", "contact_sheet", "scopes"]),
("scan", &["scenes", "stabilize_status", "track", "track_status"]),
("hear", &["levels", "silence", "cut_silence", "loudness", "normalize", "clean_voice"]),
("edit", &["edit", "sequence", "multicam_create", "multicam_flatten", "effect", "undo", "redo", "checkpoint", "restore", "checkpoints"]),
("export", &["export_start", "export_presets", "export_status", "export_cancel", "export_queue", "export_captions", "render_preview"]),
("listen", &["transcript", "find_words", "auto_captions", "speech_model"]),
("captions", &["captions"]),
("speak", &["voices", "voiceover"]),
("record", &["record"]),
("help", &["help"]),
];
/// The opening line of the sheet. Its topic list is `TOPICS`, so it cannot drift from what `section` answers.
fn header() -> String {
format!(
"edith help: one page for driving the editor over MCP. Tool descriptions carry the full argument lists. Topics: {}.",
TOPICS.join(", ")
)
}
const ADDRESSES: &str = "\
ADDRESSES
V1@450 clip: the clip on lane V1 that starts at frame 450 (starts are unique in a lane)
V1#0 clip by index, 0-based: V1#0 is the first clip on V1, V1#2 the third; resolved at once, so do not hold it across edits
V1 A1 S1 lanes, named as the GUI names them (S1 holds captions)
src:2 a source, as media_import reports it (src:2 interview_a.mp4)
C@450 / C#1 chapter: C@450 the chapter that starts at frame 450, C#1 the first chapter in the list
M@450 / M#1 comment marker: M@450 the first marker on frame 450, M#1 the first marker in the list
Every edit reply lists the NEW addresses of what it touched. Use those, not old ones.
Addresses in one batch refer to the timeline as the previous op left it.";
const TIMES: &str = "\
TIMES
450f frames (the model works in frames; replies show 450f (15.000s))
15.0s or 15 seconds
00:00:15:00 timecode at the project fps, HH:MM:SS:FF
02:14.300 minutes, seconds, milliseconds (MM:SS.fff)
end the end of the timeline: the latest end of any lane, not the end of one lane
Seconds round to the nearest frame: 2.5 s at 25 fps is frame 63 (62.5 rounds up).
A distance (`by` of roll, slip and slide) takes these forms with a sign: -15f, +0.5s, -00:00:01:00. A bare number is seconds.";
const VALUES: &str = "\
VALUES
color: brightness -1..1 (0 is none), contrast 0..2 (1 is none), saturation 0..2 (1 is none), tint -1..1 (0 is none)
gain db -60..24 · lane_gain db -60..12 · speed 0.25..4
A still image is placed 5 s long unless the project says otherwise (project_settings still_secs, 0.5 to 600 s), and a trim can take it up to 600 s.";
const GROUPS_AND_LINKS: &str = "\
GROUPS AND LINKS
Clips that share a link (a take, such as V1+A1) are one unit in the GUI.
The ops tagged [group] follow the whole take: trim, roll, slip, slide, move, delete, speed, sub_move. trim scope:\"clip\" unlinks the edge's clip first.
fade, dissolve and transition reach the linked sound too (linked:false keeps them on the one clip).
Every other op acts on the one clip alone: lift leaves a gap on that clip's lane only. group and ungroup set and clear a take.";
const UNDO: &str = "\
UNDO
One edit call is one undo step. Its ops run in order; if one fails, the earlier ones roll back and the error names it.
undo {steps} and redo {steps} take back or re-apply whole batches. dry_run:true reports, then rolls back.
A batch with no label is named after its first op (\"place V1\", \"trim V1@0\"); edit {label:\"…\", ops} names it.
media_remove {source} of a source other than the last one renumbers the sources after it, which clears undo: refused unless force:true.
checkpoint {name} saves the whole project under a name; restore {name} returns to it (it clears undo history).";
/// `help {topic:"first_video"}`: the order to build a first video in, saving as it goes.
const FIRST_VIDEO: &str = "\
FIRST VIDEO: a first cut from nothing, one stage at a time. Save after every stage (project_save), and before you end a run: nothing is on disk until you do.
1. project_new {path:\"
/talk.edith\", fps:30, resolution:\"1920x1080\"} — an empty project at a new path (nothing is written yet).
2. media_import {paths:[\".mp4\", \".mp3\"]} — the files become src:0, src:1 ...; nothing is placed. A file already imported says \"already imported as src:N\" and adds nothing. project_save.
3. Each extra sound lane (music on A2, narration on A3) needs its own lane_add, one op per lane. For this recipe that is two: edit {ops:[{op:\"lane_add\", kind:\"audio\"}, {op:\"lane_add\", kind:\"audio\"}]} adds A2, then A3. A place or append to a lane that does not exist refuses; lane_add it first. project_save.
4. edit {ops:[{op:\"place\", source:\"src:0\", at:\"0s\"}]} puts the picture on V1 and its sound on A1; edit {ops:[{op:\"append\", source:\"src:0\"}]} adds after the last clip. length:\"5s\" sets the duration from in instead of out. Music bed: edit {ops:[{op:\"append\", source:\"src:1\", lane:\"A2\", until:\"30s\"}]} (A2 comes from step 3; src:1 is a song of 30 s or more, so the bed is one clip; until LOOPS a shorter source into one clip per repeat, and trims a longer one to the span). project_save.
5. voiceover {text:\"...\", pause:0.4, place:{lane:\"A3\", at:\"0s\"}} needs a project path (project_new or project_open); the WAV is written beside the .edith file in voiceover/, even before project_save. It imports the WAV as a source and places it when place is given. record {action:\"start\", lane:\"A3\"} then record {action:\"stop\"} is the microphone version: it records from the audio input and places the take the same way. voiceover speaks text with Piper and never records. The voiceover is unsaved until project_save: the project file does not name its WAV before then. project_save.
6. auto_captions {target:\"A3\"} transcribes the narration lane and writes the words to S1. project_save. (A1 is the picture's own sound: it has no words to caption here.)
7. export_start {out:\"/talk.mp4\"} returns job:1 at once; export_status {job:1} reports progress until it is done.
Length: a picture shorter than the music bed leaves black at the end, since the bed plays on over nothing. Trim the bed to the picture: edit {ops:[{op:\"trim\", clip:\"A2@0\", edge:\"out\", to:\"\"}]}. Or make the picture longer: for a still, edit {ops:[{op:\"trim\", clip:\"V1@0\", edge:\"out\", to:\"\"}]}; for video, append more picture after it. timeline shows where each lane ends.
Peaks: export_status warns when the job finishes if the file's true peak is above -1 dBTP (exactly -1 is within spec); the ceiling to aim at is -1 dBTP for lossless (wav, flac) and -2 dBTP for lossy (mp4, mkv, webm, mp3, ogg, m4a), since encoding can overshoot the mix; a true peak over 0 dBTP clips. Add the master limiter before export with project_settings {limiter:{on:true, ceiling_db:-1}} (ceiling_db:-2 for a lossy export); or normalize {target:\"mix\", allow_limiter:true, true_peak:-2} (-1 for lossless) sets the level in one undo step, and turns the limiter on at that ceiling only when the peak would otherwise hold the gain back (its reply says so).
After each stage, read the result with timeline (or frame / contact_sheet for a picture check). A reply that says \"no change\" or names a refusal means that step did not happen: fix it, then go on.";
const PODCAST: &str = "\
PODCAST: two speakers on A1 and A2, a music bed on A3 ducked under both, each speaker levelled on its own, then captions from both. Save after each stage (project_save).
1. project_new {path:\"/show.edith\", fps:30, resolution:\"1920x1080\"}, then media_import {paths:[\".wav\", \".wav\", \".mp3\"]}.
2. Speakers: edit {ops:[{op:\"place\", source:\"src:0\", lane:\"A1\", at:\"0s\"}]} puts the host on A1. A2 does not exist yet, so add it first: edit {ops:[{op:\"lane_add\", kind:\"audio\"}]}; then edit {ops:[{op:\"place\", source:\"src:1\", lane:\"A2\", at:\"0s\"}]} puts the guest there. Both start at 0 s, because each was recorded on its own track for the whole conversation: the two files play together, not one after the other.
Cut their silences together: cut_silence {lanes:[\"A1\",\"A2\"], dry_run:true}, then the same without dry_run. A joint cut (lanes with no target) removes a pause only where every listed lane is quiet at once, and a lane with no sound there (a gap between its clips, or no clip) counts as quiet. So while one speaker talks, the other lane is quiet but the talker's is not, and nothing is cut; only the stretches where both are quiet, the gaps between turns, are shortened, and the same span comes out of both lanes, so the turns stay in step. The reply's \"pauses now\" is measured on that joint quiet. Caption lanes ripple with the cut; locked caption lanes stay.
3. Bed: edit {ops:[{op:\"lane_add\", kind:\"audio\"}]} adds A3, then edit {ops:[{op:\"append\", source:\"src:2\", lane:\"A3\", until:\"\"}]} lays the bed there. Lay it after the cuts in step 2, so is where the talk now ends (timeline shows each lane's end). A cut made after the bed is placed (the step 5 fillers, or a later cut_silence) leaves the bed running past the talk: trim it to the new end with edit {ops:[{op:\"trim\", clip:\"A3@0\", edge:\"out\", to:\"\"}]}. Duck it under each speaker: edit {ops:[{op:\"duck\", lane:\"A3\", under:\"A1\"}, {op:\"duck\", lane:\"A3\", under:\"A2\"}]}.
4. Level each speaker alone: normalize {lanes:[\"A1\",\"A2\"], each:true, lufs:-16}. Its reply gives each lane's loudness before and after. A speaker with high peaks often cannot reach -16 LUFS under the -1 dBTP ceiling: the reply holds that lane to the true-peak ceiling (structuredContent carries it as capped_by: true_peak), and the lane stops short. This is expected for speech. A quiet speaker needs no manual clip gain: normalize takes the lane up to its +12 dB lane gain limit and puts the rest on that lane's clips (each up to +24 dB of clip gain), all in the same undo step. Only when even that is not enough does the reply say so with capped_by: clip_gain_limit; then raise that speaker's clip gain yourself (edit {ops:[{op:\"gain\", clip:\"A1@0\", add_db:3}]}) and normalize the lanes again. Then the whole mix: normalize {target:\"mix\", lufs:-16, allow_limiter:true, true_peak:-1} for a lossless or WAV export, true_peak:-2 for m4a or mp3 (lossy encoding overshoots the mix); the limiter is what lets the mix reach the target when the peak alone would hold it back. If the mix still falls short (its reply gives short_by_lu), the reply names the cap that holds it (capped_by): accept a target the peaks allow (-18 LUFS, say), or raise the quiet lane's clip gain as above. dry_run:true on either shows the plan first.
5. Fillers (optional, before the captions): do not cut a filler on one speaker's lane with find_words {cut:true} alone. A ripple moves only that lane, so the other speaker's lane falls out of step. Use the no-ripple form instead: find_words {query:\"um\", target:\"A1\", cut:\"lift\"} removes each match and leaves a hole where it was, and nothing moves. Pass the step 6 hint here too (hint:\"Jane Doe, LUFS\"): names and jargon come out spelt as the talk spells them, so the search reads them right. Or cut both lanes together, only at a joint pause (cut_silence with no target, step 2).
6. Captions from both speakers into one lane: auto_captions {target:\"A1\", lane:\"S1\", hint:\"Jane Doe, LUFS\"}, then auto_captions {target:\"A2\", lane:\"S1\", hint:\"Jane Doe, LUFS\"}. Each call transcribes its own lane and adds its cues to S1, so the two speakers' captions sit in one track. hint lists the names and words the talk uses; it may get their spelling and casing right, but that is not guaranteed, so check the names in the captions. A re-run on the same lane replaces the captions that lane made before; replace:true also removes overlapping captions that differ from what was heard now (a hand edit, or the other speaker's), so use it only when those are meant to go.
7. Check with timeline. A project with no picture (only A lanes) exports an .mp4 as sound alone, and its captions are dropped: export_start {out:\"/show.m4a\"} for the sound, or, for a captioned video, place a still on V1 and trim its out edge to the end of the talk (the still recipe in help {topic:\"recipes\"}). Then export_start {out:\"/show.mp4\"} (or the .m4a) and export_status {job:1} until it is done.";
const RECIPES: &str = "\
RECIPES
Rough cut from ranges: keep lays source ranges end to end (one undo step).
edit {ops:[{op:\"keep\", source:\"src:0\", ranges:[[\"10.0s\",\"22.5s\"],[\"40.0s\",\"52.0s\"]], lane:\"V1\"}]}
edit {ops:[{op:\"assemble\", items:[{source, in?, out?}]}]} does the same, one item per range, across several sources; each item is laid end to end after the last.
Trim: edit {ops:[{op:\"trim\", clip, edge, to}]} moves that edge to a timeline time. `to` is absolute (where the edge lands), not a length: edit {ops:[{op:\"trim\", clip:\"V1@0\", edge:\"out\", to:\"2s\"}]} makes the clip 2 s long from 0. There is no delta form. Add ripple:true to close the hole the edge leaves and move what follows with it (Premiere's ripple trim, Q and W in the editor).
edit {ops:[{op:\"trim\", clip, edge, to, scope:\"clip\"}]} on a take of three or more lanes: the other members stay linked to each other only if they have matching bounds. A 60 s picture with a 30 s bed cannot stay linked, so that trim is refused (\"its partners could not stay linked\") and nothing changes: give the members that stay together the same bounds first, or trim with the default scope (the whole take moves). A locked partner refuses (unlinking changes it).
Append to a lane that does not exist yet: add the lane first, edit {ops:[{op:\"lane_add\", kind:\"audio\"}]}. An append op naming A2 does not make A2: edit {ops:[{op:\"append\", source:\"src:1\", lane:\"A2\"}]} refuses until A2 exists.
assemble refuses a still image (src:N is a still): add a still with edit {ops:[{op:\"append\", source}]}, which puts it at the end of V1 with no hole, or edit {ops:[{op:\"place\", source, at:\"end\"}]}, which puts it at the timeline end (the latest end of any lane). They are not alternatives for one job: append extends V1, and place at:\"end\" goes to the timeline end, which leaves a hole on V1 when V1 ends sooner (a bed running on past it, say). Then trim its out edge (edit {ops:[{op:\"trim\", clip, edge:\"out\", to}]}) to change its length (5 s by default).
Countdown leader: edit {ops:[{op:\"generator_add\", kind:\"countdown\", from:5, at:\"0s\"}]} puts a 5 s countdown on V1 at 0 (add `lane`, `at` to put it elsewhere); insert_time first if the programme should start after it.
Tint everything under with an adjustment layer: edit {ops:[{op:\"adjustment_add\", at:\"0s\", duration:\"30s\"}, {op:\"color\", clip:\"V2@0\", tint:0.3, saturation:0.8}]} grades every lane below V2 for those 30 s; effect add on the layer does the same for blur or a vignette. enable {clip:\"V2@0\", on:false} switches it off without removing it. A transform on an adjustment layer moves the whole composite below it (uncovered area goes black); crop only limits where the layer reaches, so cropped-away areas keep the untouched picture. Adjacent adjustment layers hard-cut.
Reverse a clip: edit {ops:[{op:\"reverse\", clip:\"V1@0\"}]} toggles it (on:true or on:false sets it), picture and sound together with its take. It keeps its place and length and composes with speed: reverse, then speed x:2 plays it backward at double rate. clip_info and timeline say reversed.
Cut silence: read the regions, preview the cut, then cut.
silence {target:\"A1\"}, or {target:\"src:2\"} to scan a source (threshold_db, min_silence, padding, min_keep)
cut_silence {target:\"A1\", dry_run:true}, then cut_silence {target:\"A1\"}. It cuts only pauses of min_silence or longer. When none qualifies, the reply names the longest quiet it found and cuts nothing, so lower min_silence (or padding) and run it again.
min_silence (default 0.5 s, judged before padding) is the shortest quiet run it cuts: shorter ones are ignored.
keep:N is the total pause left in each silence, padding included (default 0.4). The padding at each end is never cut; under 2 × padding the pause is 2 × padding. The reply says \"pauses now X s\". A silence at or under keep is left alone, and when none is longer the reply says nothing was cut. lanes: with a target, it is the ripple scope, judged on the target alone (the target's lane is added if missing); by default the target's lane and its linked lanes, and a mix target cuts every lane. Without a target, two or more audio lanes are cut jointly where all are quiet: lanes:[\"A1\",\"A2\"] makes a joint cut with no target: the silence is where every listed lane is quiet at once, and the listed lanes are cut together, so their turns stay in step. Locked lanes: a locked lane named in lanes, or linked to the target, refuses the cut (unlock it with lane_flags); a mix's default scope (every lane) refuses the same way, naming each locked lane, and changes nothing. Unlisted audio lanes the cut runs through are reported as out of step.
silence: judged inside clips only; the timeline gaps between a lane's clips are structure and are reported, never listed or cut. Default threshold: 30 dB under the target's median speech level (−90..−10 dBFS); the reply names the value used. min_silence is judged before padding.
cut_silence: a silence that runs to the end of its clip keeps `keep` in all after the last speech, its end padding included. Gaps between clips are never cut.
Caption lanes ripple with the cut; locked caption lanes stay (a locked caption lane in the scope is skipped with a note).
mode:\"speed_up\" plays each silence faster instead of cutting it (rate 1.05–4, default 4); mode:\"keep_silence\" cuts the speech and keeps the silence (one target, no joint cut). Both take dry_run and undo like the cut.
Normalize loudness: measure the mix, then set it.
loudness {target:\"mix\"}, then normalize {target:\"mix\", lufs:-14}; its reply leads with whether the target was reached.
When the true-peak ceiling holds the gain back (the reply's capped_by is true_peak), add allow_limiter:true with true_peak set to the ceiling (-1 for lossless, -2 for lossy): the limiter then lets the mix reach the target, and the reply says it switched the limiter on.
dry_run:true reports the planned gain per lane and changes nothing.
Each lane alone: normalize {lanes:[\"A1\",\"A2\"], each:true, lufs:-16} sets each listed audio lane on its own, so each one alone measures lufs over its clips (two speakers at different levels come out even). Each lane's gain moves by itself, with the true-peak ceiling checked per lane; one undo step for all of them. Needs lanes, not target, and no allow_limiter.
Targets (lufs): streaming, YouTube and Spotify -14; Apple -16; podcasts -16 (stereo); broadcast (EBU R128) -23; TikTok and Instagram about -14.
Copy a look: edit {ops:[{op:\"copy_look\", from, to:[addrs] | to_lane, what?}]} copies the look of clip `from` onto each clip in `to` (or every clip on
`to_lane`) in one undo step. what is a list of \"color\" (the default), \"transform\", \"fit\", \"effects\" (picture clips only), \"eq\", \"gain\" (sound
clips only) or \"speed\" (rate, ramp and reverse, from and to any media clip); a target the part does not fit is named as skipped. from must carry a look: a plain clip has none, so copying it onto a plain clip replies \"nothing to copy\" (no change). e.g. edit {ops:[{op:\"copy_look\", from:\"V1@0\", to:[\"V1@30\"], what:[\"color\",\"transform\"]}]} Prerequisite: V1@0 is a picture clip with a look (a colour grade from the color op, or a transform) and V1@30 a second picture clip starting at frame 30; both must already exist.
Effects: vignette plus soft blur. effect {op:\"add\", clip:\"V1#0\", kind:\"vignette\", params:{amount:0.6}}, then effect {op:\"add\", clip:\"V1#0\", kind:\"blur\", params:{radius:4}}; effect {op:\"list\", clip:\"V1#0\"} shows the stack, effect {op:\"set\", clip:\"V1#0\", index:1, on:false} switches the blur off. The stack runs in order on the placed picture, in preview and export; distances are pixels at 1080 lines. Each op is one undo step. Prerequisite: V1#0 is a picture clip.
Green screen over a background: put the background on V1 and the green-screen take on V2, then effect {op:\"add\", clip:\"V2#0\", kind:\"chroma_key\", color:\"#00ff00\", params:{tolerance:0.35, softness:0.1, spill:0.5}}; the keyed-out part shows V1. effect {op:\"list\"} gives every kind with its ranges; masks (rect_mask, ellipse_mask) and blend {mode:\"screen\"} work the same way. pixelate {size} mosaics the picture (size is the block in pixels at 1080 lines); after a mask it censors only that shape, e.g. effect {op:\"add\", clip:\"V1#0\", kind:\"pixelate\", size:24} then an ellipse_mask. A mask moves with effect {op:\"mask_keys\"} (the ops topic lists its arguments).
Grade a clip: wheels to balance, curves to shape, a LUT for the look, the sliders to trim; read the scopes between steps.
edit {ops:[{op:\"wheels\", clip:\"V1@0\", lift:[0, 0.05, 0, -0.03]}, {op:\"curves\", clip:\"V1@0\", master:[[0.25, 0.2], [0.75, 0.8]]}, {op:\"lut\", clip:\"V1@0\", path:\"~/luts/warm.cube\", mix:0.7}]}
scopes {at:\"2s\"} gives the waveform, the RGB parade and the vectorscope of that frame as numbers: crushed and clipped shares, each channel's spread, the cast.
Check a cut before exporting it.
timeline {range:{from:\"10s\", to:\"30s\"}}, contact_sheet {range:{from:\"10s\", to:\"30s\"}, count:12}, frame {at:\"450f\"}
Cut by transcript: read the words, find the filler or phrase, then cut its spans. The filler list is um, uh, er, ah, hmm and
like, but like is a real word too often: check each hit with its context before cutting it, or search a phrase instead.
The transcript usually leaves fillers out but not always. A filler query runs with the prompt that keeps disfluencies, so a plain find_words {query:\"um\"} still finds the ones that remain, with no flag.
transcript {target:\"A1\"}, then find_words {query:\"um\", target:\"A1\"} lists each match with its span; cut the spans with edit {ops:[{op:\"cut_regions\", regions:[[\"450f\",\"512f\"]]}]}
or find_words {query:\"um\", target:\"A1\", cut:true} removes every match in one step (which:\"first\" or which:[0,2] picks some; dry_run:true reports only). keep:\"first\" or \"last\" keeps one word of a repeat such as \"I I\". The cut takes the target's lane and its linked lanes, or every lane for a mix or src target; help {topic:\"ripple\"} says which lanes move. On one speaker's lane of a two-speaker show, cut:true ripples only that lane and desyncs the other: use cut:\"lift\" instead, which leaves a hole and moves nothing (podcast has the joint-pause option). Caption lanes ripple with the cut; locked caption lanes stay (a locked caption lane in the scope is skipped with a note). A locked lane the cut would move refuses it, dry runs too (unlock it with lane_flags); a mix's default scope skips its locked lanes with a note. With cut, each edge snaps to a pause within 150 ms of Whisper's time, so a cut lands in quiet; snap:false cuts at Whisper's times.
Auto captions: transcribe and place captions, then adjust the caption track.
auto_captions {target:\"A1\"} writes the cues to S1; hint:\"Jane Doe, LUFS\" lists the words the talk uses; it may help their spelling and casing, and near-miss spellings of them are corrected after transcription (the reply names each one), but that is not guaranteed. help {topic:\"captions\"} covers the rest of the workflow.
Shorts captions: animated, a few words at a time, the word being spoken highlighted.
auto_captions {target:\"A1\"}, then project_settings {captions:{animation:\"karaoke\", words_per_line:3, uppercase:true, highlight:\"#ffd600\"}} (saved with the project; one undo step),
check a frame mid-word: frame {at:\"2s\", burn_captions:{size:70, place:\"centre\", outline:\"thick\", boxed:false}}, then export_start {out, burn_captions:{size:70, place:\"centre\", outline:\"thick\", boxed:false}}.
Or per call, without touching the project: burn_captions:{animation:\"karaoke\", words_per_line:3, box:true}. animation word is the one-big-word style; pop and bounce are the others. help {topic:\"burn_captions\"}.
Cut to the beat: mark the music's beats, then cut on the markers (cuts snap to markers).
edit {ops:[{op:\"beats\", clip:\"A2@0\"}]} finds the tempo of that clip's sound and marks every beat as a yellow comment marker noted \"Beat\"; every:2 or every:4 marks every second or fourth beat for bars. The reply gives the BPM, the count and the M@ addresses. Running it again replaces the earlier beat markers of that clip. A picture-only clip has no sound and is refused.
Intro title and a lower third: a centred card over black, then a boxed caption over the picture.
edit {ops:[{op:\"title_add\", at:\"0\", duration:3, text:\"Episode 17\", place:\"centre\", fade_in:12, fade_out:12}, {op:\"title_add\", at:\"5.0s\", duration:4, text:\"Jane Doe, director\", place:\"bottom\", boxed:true, fade_in:12, fade_out:12}]}
A title past the last clip extends the timeline; edit {ops:[{op:\"title_set\", title:\"T2\", size:60}]} changes one, edit {ops:[{op:\"title_remove\", title:\"T1\"}]} takes it off (the titles after it renumber: T2 becomes T1), and timeline lists them as T lines.
A title can start in one of the app's looks with preset (lower_third, centered or caption_bar): edit {ops:[{op:\"title_add\", at:\"5.0s\", duration:4, text:\"Jane Doe\", preset:\"lower_third\"}]}; fields given with it win. A title can carry a look: color (\"#ffcc00\"), weight (regular|bold; Latin letters, other scripts keep their one weight), hplace (centre|left|right: the side the block sits against, the margin from the edge), align (centre|left|right: how its lines line up inside the block), box_color (\"#000000\" keeps the opacity, \"#000000c8\" sets it) and box_opacity (0..1). A lower third: edit {ops:[{op:\"title_add\", at:\"5.0s\", duration:4, text:\"Jane Doe\\nDirector\", place:\"bottom\", hplace:\"left\", align:\"left\", weight:\"bold\", boxed:true, box_color:\"#112233\", box_opacity:0.8}]}. A project that uses one saves as format v49 (an older edith refuses it by name). A title can animate in and out: in_anim and out_anim are none, fade, typewriter (letters appear one by one), slide_up, slide_left, pop (grows from 60% with a slight overshoot) or word_by_word; anim_secs is how long each takes (a bare number is seconds, default 0.5). An exit is the entrance played backwards. Example: edit {ops:[{op:\"title_add\", at:\"0\", duration:4, text:\"Episode 17\", in_anim:\"typewriter\", out_anim:\"fade\", anim_secs:0.6}]}. An animated title saves as format v54 (a titleanim line; an older edith refuses it by name). A title can also carry its own keys, which move, scale and fade it over its length: title_add keys:[{at:\"0s\", opacity:0}, {at:\"1s\", opacity:1, x:0.1, scale:1.2}] (at counts from the title's first frame; x and y are a share of the picture, scale multiplies its size, opacity its alpha; missing fields are 0, 0, 1, 1; keys:[] takes them off). Keys save as format v56 (a ttkeys line).
Black lead-in for an intro title: edit {ops:[{op:\"insert_time\", at:\"0\", duration:\"3s\"}]} opens black before the picture, then title_add at 0 sits over that black.
edit {ops:[{op:\"insert_time\", at:\"0\", duration:\"3s\"}, {op:\"title_add\", at:\"0\", duration:3, text:\"Episode 17\", place:\"centre\", fade_in:12, fade_out:12}]}
Speed a clip that has narration over it (the examples need a picture clip at V1@0, and the narration lane A3 from first_video): narration on its own lane (A3, as in first_video) is outside the ripple by default, so edit {ops:[{op:\"speed\", clip:\"V1@0\", x:0.5, ripple:true}]} changes the picture's length and the narration keeps its times.
The reply lists each clip left in place: a clip on another lane that spans the change (the music bed on A2, a narration clip on A3) stays where it is.
To move the narration with the picture, name its lane (prerequisite: A3 exists and holds the narration clip): edit {ops:[{op:\"speed\", clip:\"V1@0\", x:0.5, ripple:true, lanes:[\"V1\",\"A1\",\"A3\"]}]}. A lane named in lanes refuses a clip that spans the change, so move or trim that narration clip first (edit {ops:[{op:\"move\", clip, at}]}, or a trim).
Clips that start after the sped clip move by the length change on the lanes in scope. lanes:[\"V1\",\"A1\"] is the same as the default.
Dip music under a voice line: a volume envelope on the music clip, over the line's span. The span must lie inside that one clip: a file shorter than the span
loops into several clips under until, and a dip cannot cross them, so use a song at least as long as the span (the first_video bed is one clip).
Prerequisite: A2@0 is the music clip and runs to at least 25 s.
edit {ops:[{op:\"gain_dip\", clip:\"A2@0\", from:\"10s\", to:\"25s\", db:-18, ramp:\"0.5s\"}]}
The ramps start from the level there now; clip_info lists the points as timeline times. gain_key and gain_key_remove adjust one point, gain_ramp draws a single ramp, gain_keys replaces the whole envelope. For a dip that follows the speech by itself, edit {ops:[{op:\"duck\", lane:\"A2\", under:\"A1\"}]} is the automatic alternative.
Export: start, then poll until done.
export_start {out:\"~/cut.mp4\"} returns job:1; export_status {job:1} until it reports the outcome.";
const LANES: &str = "\
LANES
V1.. are picture lanes, A1.. sound lanes, S1.. caption lanes. Names are the GUI's.
lane_add {kind: video|audio|subtitle} adds one; lane_remove {lane}; lane_move {lane, to}: to is the 1-based position in the lane list as timeline prints it, and the reply maps every moved clip old → new.
Lanes are named by position, so a lane_move renumbers the lanes between its two places: lane_move {lane:\"V2\", to:1} makes the old V1 into V2. The reply lists each rename; use the new names after a move.
place {lane} sets where the picture goes; its sound still goes to A1 (or audio_lane) and stays linked to it, as with no lane (V1 and A1). audio:false places the picture alone.
place overwrite:true replaces only the span the new clip covers: a clip it partly covers keeps the part outside that span.
insert {source, in?, out?, at, to?, length?, lanes?} and overwrite {…}: the three-point edit. The source range in..out (the whole file when none) goes at `at`; `to` (a timeline out mark) or `length` sets the duration from in instead of out. It lands on `lanes` (one video lane, one audio lane), else the first unlocked V and A lanes the source has, linked as one take (a still on a video lane, a song on an audio lane). insert cuts the clip `at` falls inside and moves what follows later on those lanes only; it refuses, by name, when that would pull a linked take apart (add the partner lane to `lanes`). overwrite replaces what is there, trimming or splitting it, and moves nothing. A locked lane refuses; each is one undo step.
lane_name {lane, name}: the display label of a lane (like a track name), at most 40 characters; \"\" clears it. The address stays V1/A2: every op still takes V1, never the name. timeline shows the name on the lane's header line. One undo step; a locked lane refuses it.
lane_flags {lane, hidden?, muted?, locked?}: hidden applies to picture lanes, muted to sound
lanes (the other flag is refused there). A locked lane is never changed: an op that would change
it refuses, except that the titles and captions a ripple carries past it skip it with a note.
levels {target:\"A1\"} on a muted lane shows the lane's own sound, with a note that it is silent in the mix and export.
A sound-only source (a song, a WAV) goes on an A lane: edit {ops:[{op:\"place\", source, lane:\"A2\", at}]} or edit {ops:[{op:\"append\", source, lane:\"A2\"}]}.
An mp4 with no picture is sound-only too: placed with no lane, it goes to A1 alone.
A source with more than two sound channels (5.1, say) is mixed to stereo on export. media_probe lists each audio track's
channels and sample rate, and media_list names a chosen track that is not the first (\"audio 1 (fra)\").
audio_track:N on place and append picks which of the file's sound tracks plays (0-based, the numbers media_probe lists as \"audio track N\"); the first track is the default. An N past the last track is refused, and the reply lists the tracks. edit {ops:[{op:\"place\", source:\"src:0\", at:\"0s\", audio_track:1}]}.
lane_gain {lane, db} sets a lane's level, -60..12 dB. Each clip's own gain adds on top.
pan {clip, pan} and lane_pan {lane, pan} place sound between the speakers, -1 (left) to 1 (right), 0 the middle; a balance, so
the far side is turned down and the near one stays. A clip's pan and its lane's stack. Stereo mixes only. edit {ops:[{op:\"pan\", clip:\"A1@0\", pan:-0.5}]}
pitch {clip, semitones (-12..12)} shifts an audio clip's pitch in semitones, fractions too (0.37), and keeps its length (12 an octave up). edit {ops:[{op:\"pitch\", clip:\"A1@0\", semitones:12}]}
Ducks stack: a lane can carry one duck per key lane (`under`), so several keys can pull it down. edit {ops:[{op:\"duck\", lane, under, off:true}]}
removes that one; edit {ops:[{op:\"duck\", lane, off:true}]} with no under clears every duck on the lane.
Not supported (help {topic:\"unsupported\"}): custom transition shapes.
Do not search the tools for them.
close_gaps {lane} removes the gaps on a lane. The timeline's gaps line counts them per lane.
timeline {lanes:[\"V1\",\"A2\"]} shows only those lanes; timeline {range:{from,to}} only the clips that overlap it.
The brief timeline shows up to 40 clips per lane, within a text cap of about 4 KB, and says how many more there are; timeline {lanes:[\"V1\"], page:N} pages one lane at 40 clips per page, and a lane header counts its graded clips past the cut.
Source times on a clip are the source's own clock: `src 0.0s–4.0s` is the part of the file it plays.";
const EXPORT: &str = "\
EXPORT
export_start {out, preset?, loudness?, format?, range?, size?, fit?, bitrate_kbps?, qp?, keyframe_s?, faststart?, audio_kbps?, bit_depth?, prores_profile?, hevc_speed?, hdr?, audio_bit_depth?, chapters?, intra_only?, seat?, subtitles?, burn_captions?, overwrite?}
returns job: at once. Poll it with export_status {job?}; export_cancel {job} stops it and deletes the partial file.
out: the file to write; ~/ is expanded and its folder must exist. The extension picks the format:
.mp4 mp4 · .mkv av1 · .webm · .wav · .flac · .mp3 · .ogg · .m4a · .opus · .mov prores. Refuses an existing file unless overwrite:true.
format (overrides the extension): mp4 (H.264) · av1 (AV1 in mkv) · av1-mp4 · hevc (I+P GOPs, mkv) · hevc-mp4 ·
webm · wav and flac (lossless audio) · mp3, ogg and m4a (audio only; m4a is AAC in an mp4 box) · opus (audio only; Opus in Ogg at 48 kHz) · prores (Apple ProRes in a QuickTime .mov with PCM sound) ·
png_sequence (a folder of PNG pictures, one per frame, named _00001.png; out is the folder, which may not already hold files unless overwrite:true; the project's size, no sound) · still (one PNG: the frame at the start of range, the poster frame) · gif (animated GIF of range, at most 30 s and 720 px wide: gif_width (default 480), gif_fps 1-60 (default 15), gif_loop (default true); pictures are composed at the project size and the GIF is refused by name for a range or width past those).
loudness: a number of LUFS from -30 to -5, the whole mix's integrated loudness target (-14 for streaming, -16 for podcasts). It takes one gain, cut back where the true peak would pass the preset's ceiling or -1 dBTP; never a limiter. Beside preset it replaces the preset's own loudness. export_captions {format:\"srt\"|\"vtt\", path?, overwrite?} writes the timeline's captions (every cue on the subtitle lanes, in start order) to a text file: SRT or WebVTT, with picture cues left out. Without path it is ` edit.` in the Videos folder.
preset: an id from export_presets (youtube_1080p, youtube_1080p60, youtube_1080p_hevc, youtube_4k, youtube_4k60, youtube_4k_hevc, shorts_reels, podcast, podcast_ogg, podcast_opus, archive, archive_prores, hdr10_hevc, archive_flac, archive_wav). It fills format, bitrate_kbps, audio_kbps, size, bit_depth, prores_profile, hdr and, for the podcast rows, a -16 LUFS / -1 dBTP loudness target applied to the exported sound. Anything you pass beside it overrides the preset's value; out's extension must match the preset's format. export_presets {} lists the rows.
range {from, to}: that part of the timeline, to excluded. Times as in TIMES.
seat: auto (the GPU for H.264 and HEVC where this machine has a GPU encoder, else the CPU; AV1 is always the CPU) · hardware (GPU or refuse) · software.
size: this export's picture size, WIDTHxHEIGHT (1280x720) or a height with p (720p, 1080p, 2160p, 16:9 at that height); 1080x1920 is vertical. Both sides even. Omitted: the project's resolution, which stays as it is.
fit: how every picture clip meets this export's canvas: keep (the default: each clip's own fit), fit (whole picture, bars) or fill (the canvas covered, the picture cropped). It changes this export's copy only; the project's clips keep their fit. Captions and titles keep their place on the canvas.
A 16:9 timeline as 9:16: export_start {out, size:\"1080x1920\", fit:\"fill\"}. The reply names the size and the fit, and the clip count they applied to.
bitrate_kbps: video, chosen from the picture size and frame rate when omitted. qp: a constant quantiser 0..51 instead of a bitrate (not with bitrate_kbps): the hardware seat for H.264, HEVC and AV1, and the software HEVC encoder; the software H.264 and AV1 encoders refuse it. keyframe_s: seconds between key frames, 0.1 to 10 (not with intra_only). faststart: mp4, hevc-mp4, av1-mp4 and m4a only, moov before mdat so it plays before it is fully read. audio_kbps: 128, 192, 256 or 320, and 384 for AAC only.
intra_only: hevc and hevc-mp4: true codes every picture as an IDR (intra only, large files, every frame a cut point). false, the default, codes I+P GOPs (an IDR a second, P pictures between). h264 mp4 uses it the same way.
Captions: burn_captions draws one track into the picture, so every player and WebM show it. subtitles adds soft
tracks a player can switch off (WebM has none). Both together: burned and soft. burn_captions alone: no soft track.
subtitles (off unless given): true for every subtitle track, placed or not, or an array of track indices (0-based, as the
captions tool lists them) for just those, soft, in the order given. Omitted or [] adds none. A picked track that is not placed
on a caption lane is still written whole (all its cues). In mp4, overlapping cues are merged into one line each; mkv keeps them as they are.
Still and picture-sequence exports draw each frame as the export would (titles and burnt captions included). They write no sound, so a subtitle track or a sound setting does not apply to them.
An .mp4 of a timeline with no picture is the sound alone (AAC, no picture track); it is not refused. burn_captions is refused for it, and for the audio-only formats (m4a, mp3, ogg, opus, wav, flac): it draws into the picture, so drop burn_captions or add a picture.
chapters (default true): the project's chapter markers are written into the file, timed from the start of the range. Written to mp4, av1-mp4, hevc-mp4, m4a, webm, opus and Matroska (.mkv: av1, hevc); wav, flac, mp3 and ogg say they are not written. chapters:false leaves them out, and chapters:\"markers\" writes the comment markers as the chapter list instead. The reply counts them, e.g. \"3 chapters\".
bit_depth: 8 or 10 for the picture. 10 writes a 10-bit AV1 or HEVC (Main 10) file: format av1 (.mkv), av1-mp4, hevc (.mkv) or hevc-mp4; H.264 and every other format refuse it. Omitted: a 10-bit source gives a 10-bit AV1 or HEVC file, an 8-bit source 8-bit. The reply says which (\"output 10-bit, from the source\").
prores_profile (format prores): proxy, lt, standard, hq (the default) or 4444, 4444xq. The profile is the quality and sets the rate; bitrate_kbps means nothing to ProRes. proxy, lt, standard and hq are 4:2:2, 4444 and 4444xq are 4:4:4. ProRes is always 10-bit. A ProRes .mov carries no subtitles.
hevc_speed (hevc and hevc-mp4): default (the full search), fast (about 1.2-1.6x quicker, 0-3% more bits) or faster (about 1.5-2x quicker, up to 27% more bits). Other formats refuse it.
audio_bit_depth (format prores): 16 or 24 (the default), the bits per sample of the PCM sound.
hdr (hevc and hevc-mp4): off (the default), pq (HDR10) or hlg. The file is 10-bit BT.2020 tagged with that transfer, HDR sources are not tone-mapped, and bit_depth 8 is refused. Other formats refuse it.
Pictures are 8-bit 4:2:0 except in a 10-bit AV1 or HEVC export. (ProRes is always 10-bit.) A 10-bit export still composes edits (grades, titles, captions, transitions, layers) at 8-bit precision and shifts them up. A stream copy keeps the source's own bits.
The sound is as wide as its widest clip: a mono clip alone exports mono, and a mono clip beside a stereo one is widened to stereo.
A burn-only export reports \"subtitles: burned into the picture (no soft track)\".
The export keeps running while you do other things. If the client closes the server's input, the server waits for running exports to finish before it exits. A stop signal (SIGTERM or SIGINT) cancels them and deletes their partial files. Poll export_status until it finishes; export_cancel {job} stops one.
export_status reports progress, ETA, the encoder and the outcome; a done export reports its file size.
Queue: export_start {queue:true} lines an export up. It keeps its own copy of the timeline as it is at that moment (later edits do not change it) and starts when every earlier export has finished, one encode at a time, with no polling needed; export_status shows it as `waiting` with the number of exports ahead. export_cancel {job} on a waiting job removes it from the queue. Without queue the export starts at once, beside any others.
export_queue {action:\"pause\"} pauses the queue: the running export finishes, and the queued ones stay waiting until export_queue {action:\"start\"}, which lifts the pause and starts the next one now if nothing is running. export_queue {action:\"status\"} (the default) says whether the queue is paused, the running export and the queued ones in order. A pause holds only queued exports; a direct export starts at once. export_status says when the queue is paused.
Render preview: render_preview {range?} pre-renders a stretch (default: the whole timeline) so playback over the heavy parts of a cut reads finished frames instead of compositing them. It runs in the background; project_status shows the progress and the cached ranges. An edit inside a cached range drops that render. render_preview {cancel:true} stops it.
export_status {out} for a file this session did not write reports whether it is there, its size and its time; the progress
of a job from an earlier session is not known.
A finished file whose true peak is above -1 dBTP warns (exactly -1 is within spec, for every format); over 0 dBTP its samples clip, and that warning is the stronger one. The fix is the master limiter:
project_settings {limiter:{on:true, ceiling_db:-1}} for lossless, ceiling_db:-2 for lossy. The ceiling is -1 dBTP for lossless (wav, flac) and -2 dBTP for lossy (mp4, mkv, webm, mp3, ogg, m4a), since a lossy encoder can add about a dB of overshoot above the mix. The warning fires above -1 dBTP for every format, lossy ones included, since a true peak there clips on some players; the -2 figure is the limiter target that keeps a lossy encode clear of it. The mix is held to the same ceiling by normalize {target:\"mix\", allow_limiter:true, true_peak:-1} (-2 for lossy).";
const SUBTITLES: &str = "\
SUBTITLES
A subtitle track is a list of cues (text with a start and an end), kept in the project. Nothing shows until
a track is placed on a caption lane (S1..) or exported. Tracks are numbered from 0; the captions tool's footer lists them.
Import: edit {ops:[{op:\"subtitles_import\", path:\"talk.srt\"}]} adds the tracks of a subtitle file, or a video's
own subtitle tracks. They wait off the timeline until edit {ops:[{op:\"captions_place\", track:0, lane?:\"S1\", at?:\"0\"}]}
puts one on a caption lane (S1 by default, at frame 0 by default).
Language: subtitles_import {path, lang?} takes an optional language: an ISO 639-2 code (fra, deu, eng; fr or French also work). Without one, it is guessed from the file name (talk.fr.srt, fra.srt, talk_en.srt, eng.srt); a name that says none leaves it unset, written as und. subtitles_lang {track, lang} sets it later. The mp4 and MKV exports carry the language, and an MKV track's title is the language name.
Reading: in WebVTT and SRT, is a line break; ASS is read as UTF-8. An unreadable or reversed cue, a wrong arrow (`->`) or a cue with no timing line is skipped, and the subtitles_import reply names it with its line number.
Placed captions, by address: the edit ops sub_move {clip, at, to_lane?} (its group follows), sub_trim {clip, edge:\"in\"|\"out\", to}
(moves its start or end: edge is \"in\" or \"out\") and sub_delete {clip} (a lone caption lifts and leaves a gap; a grouped one takes its group).
Cue text, by track and cue number: edit {ops:[{op:\"cue_text\", track:0, index:3, text:\"Hello\\nthere\"}]} rewrites one
(\\n is a line break; empty text removes it). edit {ops:[{op:\"cue_delete\", track:0, index:3}]} removes one and moves nothing.
edit {ops:[{op:\"cue_replace\", find:\"Jon\", replace:\"John\"}]} changes words in one track, or in every track when
track is left out; it is case-insensitive unless case_sensitive is true.
edit {ops:[{op:\"cue_time\", track:0, index:3, at?:\"12s\", to?:\"14s\"}]} trims or moves one cue (timeline times; give at, to or both); it stays inside its neighbours and at least 0.1 s long.
edit {ops:[{op:\"cue_merge\", track:0, index:3}]} joins a cue with the next one; edit {ops:[{op:\"cue_split\", track:0, index:3, at:\"12s\"}]} divides one in two at a time.
edit {ops:[{op:\"cue_add\", track:0, at:\"12s\", to:\"14s\", text:\"Hello\"}]} adds a cue at timeline times (track_clock:true for the track's own); an overlap is refused unless overwrite is true.
The captions tool lists the placed cues as \"track T cue C\": the track and cue numbers the cue ops take.";
const CAPTIONS: &str = "\
CAPTIONS
Captions are the words drawn over the picture. Three steps make them.
1. Put the words on a caption lane (S1..).
auto_captions {target:\"A1\"} transcribes a sound lane (A1 by default) and writes its cues to S1 at frame 0, as one
undo step. Cues are cut at pauses, sentence ends, max_chars and max_secs; the .srt is saved beside the project and
imported as a track. lane names another caption lane. A path that already holds a track is refused.
Words move between neighbouring cues to hold 0.8 s; cues the limits force shorter are named in the reply.
A lane with no speech is refused, \"no speech to caption in A2: the transcript has no words\", and nothing is written.
A lane that already holds captions takes the new run merged in; a mix splits cues at speaker changes.
or edit {ops:[{op:\"subtitles_import\", path}]}, then edit {ops:[{op:\"captions_place\", track, lane?, at?}]} (see SUBTITLES).
hint:\"Edith, LUFS\" may help spelling and vocabulary, but is not guaranteed: after transcription, a near-miss spelling of a hinted word is corrected to it, and the reply names each correction (\"hint corrected: 'Jane Dough' → 'Jane Doe'\"); numbers come out as digits (\"40 years\"). cue_replace fixes words after the fact.
2. Fix them. The captions tool lists the cues as track T cue C [S1@F] (its range is from inclusive, to exclusive, in exact seconds).
[S1@F] is the placement that shows the cue, the address sub_move, sub_trim and sub_delete take. Cues inside one placement share its
address, and a cue that a cut split lists one line per part. The edit ops cue_text rewrites one, cue_delete removes one,
and cue_replace fixes a word in every cue.
Time edits (insert_time, remove_time, cut_regions and the other cuts) split a cue that a cut runs through, at the word boundary
nearest the cut; words inside a removed span are dropped. A one-word cue keeps its word on the longer piece only (ties: the earlier one).
Caption lanes ripple with the cut; locked caption lanes stay (cut_silence, find_words cut and delete all cut).
3. Show them in the file. export_start with burn_captions draws the text into the picture, so every player and WebM
shows it. With subtitles it adds soft tracks a player can switch off (WebM has none). Both is fine too.
frame and contact_sheet take burn_captions as well, so a check frame shows what the export will draw.
The burn options (track, size, outline, boxed, place, family, animation, highlight, box, uppercase, words_per_line) are in help {topic:\"burn_captions\"}; the export keys in help {topic:\"export\"}.";
const RIPPLE: &str = "\
RIPPLE
A ripple moves the items after a cut or a length change, so the timeline closes up (or opens) without a gap.
The ripple ops: delete, ripple_delete, speed with ripple:true, cut_regions, insert_time, remove_time, and the cut
tools find_words with cut:true and cut_silence. Each takes lanes:[\"V1\",\"A2\"] to name the lanes it may move.
Default scope (no lanes): the edited lane, plus the lanes of clips linked or grouped to it (a take moves whole),
closed over what the ripple reaches. On a picture lane, captions and titles over the moved picture move too.
find_words cut: the target's lane and its linked lanes, or every lane for a mix or src target.
lanes replaces that default and must name the edited lane. cut_regions, insert_time and remove_time default to
every unlocked lane, so lanes narrows them.
Lanes outside the scope never move and are never split. Titles move only when a picture lane is in scope. A locked caption lane in the default scope is skipped with
a note; any other locked lane the ripple must move refuses the op.
Replies list the clips a ripple shifted, as old → new addresses. Addresses in one batch refer to the timeline as
the previous op left it, so use the new address from that reply before naming the clip again.
ripple_delete also lists the caption cues it removes or trims.
lift is not a ripple: it removes one clip alone and leaves its gap, so nothing after it moves.
A dissolve or crossfade next to a gap fades the sound to or from silence.
A linked trim moves every member's edge to one time. Each reply carries an effects: line for side effects
(clips split, holes left, takes unlinked).
A separate narration lane (its own A lane, not linked to the picture) is outside the default scope: a ripple that
lengthens, shortens or closes the picture leaves its clips at their times. Name it in lanes to move it too (see the
speed recipe in help {topic:\"recipes\"}).
split {at, lanes?} is a cut, not a ripple: it cuts the lanes it names at one time and moves nothing.";
const PROJECT: &str = "\
PROJECT
project_new {path, template?, resolution?, fps?, overwrite?, discard?} starts an empty project at a new path, creating its folder if it is missing; nothing is written
until project_save, and project_save needs at least one source in the project (media_import first). template:\"\" starts from a template (see templates): the canvas, rate, lanes and caption style come with it, so resolution and fps are refused with it.
templates {} lists the built-in templates (YouTube 1080p 30, Vertical 1080×1920 30, Square 1080 30) and the saved ones, each marked as keeping clips or not. Saved ones come from File > Save as template in the window. overwrite:true lets the later project_save replace a file already at path, since project_new makes that file this project's (without it a save refuses
to replace one). discard:true drops the open project's unsaved edits to start this one (its autosave keeps them when
one can be written); without it a dirty open project refuses.
A path with an earlier session's unsaved autosave is refused before anything is created, unless overwrite:true: the reply names the autosave and offers project_open {recover:true} to continue from it; overwrite:true sets the autosave aside as a dated copy (the newest three dated copies and any from the last 7 days are kept; older ones are deleted).
project_open {path, recover?, discard_autosave?, search?, discard?} opens a .edith file, or a media file as a new project.
An autosave beside the project that holds an earlier session's unsaved edits refuses the open, and nothing is loaded: the refusal names the edits and both choices. recover:true opens the saved file with the autosave's edits on top as one undo step, so undo takes them back
(with this session's own unsaved edits open it needs discard:true, which drops those edits; the recovered edits are unsaved until project_save). A never-saved project has no saved file under them, so undo has nothing earlier to return to.
discard_autosave:true opens the saved file and sets the autosave aside (.autosave-.edith; the newest three dated copies and any from the last 7 days are kept, older ones are deleted). recover:\"\" loads one of the dated autosaves the reply
lists (.autosave-.edith; the stamp is local time, e.g. 20261016-223636), and the newest autosave stays unloaded.
search:[folders] relinks offline sources by file name; the project is then unsaved until project_save writes the new paths.
project_save {path?, force?, discard_autosave?} saves, or saves as a new path; it needs at least one source in the project (media_import first). It refuses to overwrite a file that changed on
disk since the project was opened, unless force is true (force also replaces a file at path that this session did not open). project_save takes no overwrite key. It also refuses while an autosave that appeared after the open holds edits this
project lacks (\"an autosave from