rushes 0.7.0 → 0.7.2
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/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +6 -5
- package/README.md +1 -1
- package/dist/cli/main.js +2 -2
- package/dist/core/batches.js +52 -14
- package/dist/core/errors.js +1 -1
- package/dist/core/logEvents.js +10 -6
- package/dist/core/project.js +5 -1
- package/dist/core/schema.js +32 -1
- package/dist/core/store.js +1 -1
- package/dist/mcp/tools.js +9 -4
- package/dist/server/app.js +39 -18
- package/dist/server/found.js +15 -2
- package/package.json +1 -1
- package/skills/rushes/SKILL.md +2 -2
- package/web-dist/assets/index-CaOchMcJ.js +11 -0
- package/web-dist/assets/{index-BH66xs4n.css → index-D0PeJ_Di.css} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/index-DqsLz9v7.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rushes",
|
|
3
3
|
"description": "A local review desk for video made with AI agents: timecoded notes, script edits and audio picks your agent reads and acts on.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"author": { "name": "Red Morley Hewitt" },
|
|
6
6
|
"homepage": "https://github.com/iamredmh/rushes",
|
|
7
7
|
"repository": "https://github.com/iamredmh/rushes",
|
package/AGENTS.md
CHANGED
|
@@ -113,15 +113,16 @@ The user can shelve a film they have set aside (the **Film actions** menu in the
|
|
|
113
113
|
- A render: `rushes_add_version` with `video` and `file`. Run it again for each new cut. Give every cut a short `label` (48 characters at most) that says what changed, e.g. `"launch 1.45x slower"`, and put the detail in `note`: the version list shows the label, and a longer one is refused. When the cut is likely to play badly in a browser (4K or larger, over 1.5 GB, or a codec such as ProRes), the reply carries `proxySuggested: true` and `proxyReason`; Picture then offers the user a proxy. Prefer H.264 MP4 to begin with and this won't come up.
|
|
114
114
|
- Other shapes of the same cut (a 9:16, 1:1 or 4:5 of the 16:9: same edit, same length): register every shape you rendered, main one first. `rushes_add_version` with `file` (the main one) and `formats: [{ file }, …]` registers them all in one call; `rushes_add_format` (`file`, optional `video`, `version` and `label`) adds one to a cut already registered. Rushes measures each ratio with ffprobe; here `label` is only a ratio hint for an unusual shape such as 2.39:1 (not the cut's short label, which belongs to `rushes_add_version`). A second render with a ratio the cut already has is refused: a re-render is a new version. A shape more than 0.1 s off the cut's length is still registered, with a warning: `rushes_add_format` returns it as `warning`, and `rushes_add_version` returns a list as `formatWarnings` (there, `warning` means "Picture is locked").
|
|
115
115
|
- A VO script: `rushes_set_script` with sections `{start, end, current}` in seconds. It merges by `id`: send only the sections you changed, with their ids, plus any new ones without an id. Sections you leave out are kept, with their takes. Pass `replace: true` only when you mean to replace the whole script. `rushes_get_script` reads the whole script back.
|
|
116
|
-
- A voice read: `rushes_add_variant` with `stage: "voice"` and `round` (the round's name, e.g. "Round 2 · Gerald, tone" — reads in one round are compared side by side; a new direction gets a new round, a small fix to a marked word can stay in the current one). Say in `description` what the read is, or what changed from the one it's based on. `rushes_add_take` stays in the file format and API for compatibility only; voiceover work doesn't use it.
|
|
117
|
-
- Music beds or SFX passes: `rushes_add_variant` with `stage` `music` or `sfx`. Give it `meta: {description: "..."}`, shown on its lane card in place of `bpm`/`key`; SFX passes also take `cues` (`{name, t, file?}`: `t` in seconds, and `file` the sample you placed there, an audio file, optional), labelled on the waveform. Give a sound the same name every time it comes back (`thud`, not `thud 2`): the Sound effects tab groups cues by name into layers, one per sound, and shows a cue's `file` on its card, where the user can play that sample on its own.
|
|
116
|
+
- A voice read: `rushes_add_variant` with `stage: "voice"`, `video` (the film it is for) and `round` (the round's name, e.g. "Round 2 · Gerald, tone" — reads in one round are compared side by side; a new direction gets a new round, a small fix to a marked word can stay in the current one). Say in `description` what the read is, or what changed from the one it's based on. `rushes_add_take` stays in the file format and API for compatibility only; voiceover work doesn't use it.
|
|
117
|
+
- Music beds or SFX passes: `rushes_add_variant` with `stage` `music` or `sfx`, and `video`. Give it `meta: {description: "..."}`, shown on its lane card in place of `bpm`/`key`; SFX passes also take `cues` (`{name, t, file?}`: `t` in seconds, and `file` the sample you placed there, an audio file, optional), labelled on the waveform. Give a sound the same name every time it comes back (`thud`, not `thud 2`): the Sound effects tab groups cues by name into layers, one per sound, and shows a cue's `file` on its card, where the user can play that sample on its own.
|
|
118
|
+
- Every voice read, music bed and SFX pass belongs to a film: pass its `video` (id or name) to `rushes_add_variant`, and the Voiceover, Music, Sound effects and Mix tabs list it only on that film. One without a `video` is listed on every film, so leave it out only for audio that really is for every film. `rushes_bring_in` and `rushes_open` give the files they bring in the `film` you name (or, for the files they match to the newest cut, that cut's film).
|
|
118
119
|
- The storyboard's shots, once you have the first cut: `rushes_set_shots` with `video`, optional `version` (defaults to the newest) and `shots` as `{start, name, tag?}`. Send new timings whenever a later cut moves them.
|
|
119
120
|
2. **Open it for the user:** `rushes_open`. It also looks through the project folder and brings in the files that go with the cut (next section). Each project's dashboard lives at its own address, `/p/<id>/` — safe to run more than one project at once. A tab unlocks as soon as it has something in it.
|
|
120
|
-
3. **Wait for feedback.** The user presses **Send to agent**, which saves a batch and gives them a prompt to paste to you. Call `rushes_get_batch` to read the latest batch, its notes and any changed script sections.
|
|
121
|
+
3. **Wait for feedback.** The user presses **Send to agent**, which saves a batch and gives them a prompt to paste to you. Whichever tab they press it on, the batch holds every open note from every tab and every film in play, plus any changed script sections; its `stage` is the tab when everything came from one, or `null` when it spans tabs. Each note carries its own `stage` and `video`: fix each one on its own tab and film. Call `rushes_get_batch` to read the latest batch, its notes and any changed script sections. When the brief or the storyboard changed too, the prompt the user pastes ends with a line about each.
|
|
121
122
|
4. **Fix each note.** A note has `stage`, `scope` (`point`, `range` or `whole` — Voiceover only ever uses `point` or `whole`; it has no Range scope), `t`, `tOut`, `on` (the lane, variant, take, cue or section it's about), `text`, and optionally `box` (normalised 0 to 1), `grab` (a PNG path in `screenshots/`; older notes may point to `.rushes/grabs/`), `shot` (the shot it falls in, `{n, name}`, worked out by the server from the version's shots — not yours to set) and, on Picture, `format` (`null` when the note is for every format, or a format id such as `"9x16"` when it's for that shape only). When a note's `format` is not null, fix only that format and leave the others alone; an all-format note is for every shape, so fix each and say in `reply` which formats you fixed. `rushes_list_notes` takes `format` (an id such as `9x16`, or its label `9:16`: that format's Picture notes plus the all-format ones) and `onlyThisFormat: true` (only that format's). On an audio stage, `on` is `"<laneId>/<variantId>"` for a music bed, SFX pass or voice read (the lane and variant ids `rushes_add_variant` returns) — on Voiceover the lane id is the round's slugged name, so `on` names the round and the read together — or `"<laneId>/<variantId>:<cueId>"` for an SFX cue. On Mix it's `null` for the whole mix, `"vo"` for the VO lane (the newest round with a pick), or `"<laneId>/<variantId>"` for the music or SFX lane. Older notes may carry a bare variant id, `"vo"` on Voiceover itself, a section id, `"<sectionId>:<takeId>"` for a take, `"<variantId>:<cueId>"` or a bare cue id; Rushes still lists these with a sensible label, but none of them name a read any more. On Music, Sound effects and Mix, a note can also carry `marks` — short feedback like `Fall` (bring the level down over the range) or `Quieter 3 dB` (3 dB lower over the range). `rushes_list_notes`, `rushes_get_batch` and exported notes all show them. Marks are the user's, like a note's text and times — you read and act on them, you don't set them. Voiceover notes carry no marks: a note there is **Whole** (`Speaker`, `Pacing`, `Tone` or `Overall` — about the read as a whole) or **Point** (`Fix this` or `Keep this`, marked at the playhead).
|
|
122
123
|
5. **Register the new cut** with `rushes_add_version`, with a short `label` and the detail in `note`. If the video is locked, the reply carries `warning: "Picture is locked at vN"`; the version is still added.
|
|
123
124
|
6. **Reply to every note** in one `rushes_reply` call. For each, set `status: "done"`, a one-line `reply`, `fixT` (when the fix is visible in the new cut, in seconds) and `fixVersion`. If you didn't fix a note, leave it `todo` and say why in `reply`.
|
|
124
|
-
7. **Audio batches.** On Voiceover, Music, Sound effects or Mix, call `rushes_get_picks` first, so you know which read or variant is in use before you fix anything. On Mix, it also returns `levels: { voice?, music?, sfx? }` in dB — where the user wants each lane to sit. Don't try to change these; they're set from the dashboard's sliders and only tell you the balance the user has already chosen. Then fix each note:
|
|
125
|
+
7. **Audio batches.** On Voiceover, Music, Sound effects or Mix, call `rushes_get_picks` first (pass the note's film as `video`: picks and levels are per film), so you know which read or variant is in use before you fix anything. On Mix, it also returns `levels: { voice?, music?, sfx? }` in dB — where the user wants each lane to sit. Don't try to change these; they're set from the dashboard's sliders and only tell you the balance the user has already chosen. Then fix each note:
|
|
125
126
|
- **Voiceover:** register a new whole read with `rushes_add_variant` (`stage: "voice"`) — a new round for a new direction (another voice, a different tone), or the current round for a small fix to a marked word. Say in `description` what changed.
|
|
126
127
|
- **Music or Sound effects:** make the new bed or pass the text and marks ask for, and register it as in step 1.
|
|
127
128
|
|
|
@@ -157,7 +158,7 @@ The MCP server has twenty-three tools: `rushes_open`, `rushes_status`, `rushes_a
|
|
|
157
158
|
## Rules
|
|
158
159
|
|
|
159
160
|
- Never edit `.rushes/*.json` by hand while the server is running. Use the tools, or the CLI (`rushes add`, `rushes notes`, `rushes reply`).
|
|
160
|
-
- Picks — which variant is in use per lane — are set from the dashboard only (**Use** / **Unpick**). No tool or CLI command sets one; read them with `rushes_get_picks`. Section take picks remain in the file format for compatibility only; nothing sets them any more.
|
|
161
|
+
- Picks — which variant is in use per lane, for each film on its own — are set from the dashboard only (**Use** / **Unpick**). No tool or CLI command sets one; read them with `rushes_get_picks`. Section take picks remain in the file format for compatibility only; nothing sets them any more.
|
|
161
162
|
- A project whose voiceover exists only as takes from before rounds keeps Voiceover locked until a voice read exists, but open notes on those takes still count towards Send to agent and can be answered with `rushes_reply`.
|
|
162
163
|
- You own a note's `reply`, `fixT` and `fixVersion`. The user owns its text, times and box. Either of you can set `status`.
|
|
163
164
|
- After the first cut, send the storyboard's shots with `rushes_set_shots`; when a new cut moves them, send new timings.
|
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ Rushes keeps a running log of what happened: each cut, read, bed and pass as it
|
|
|
138
138
|
## Why Rushes
|
|
139
139
|
|
|
140
140
|
- **Notes your agent can act on.** Each one carries its stage, a timecode or range, an optional box on the frame, a frame grab, and the shot it falls in.
|
|
141
|
-
- **
|
|
141
|
+
- **Everything in one batch.** **Send to agent** sends every open note from every tab and every film, whichever tab you press it on, so nothing waits behind.
|
|
142
142
|
- **Versions keep their history.** Notes follow the work from cut to cut, and you can lock picture when it's done.
|
|
143
143
|
- **Local, with no sign-up.** No account, no API key, nothing uploaded. It runs on your machine.
|
|
144
144
|
- **Works with the agent you already use.** One MCP server for Claude Code, Codex, Cursor, Claude Desktop and Gemini CLI, a plugin and skill for Claude Code, and a command line for anything else.
|
package/dist/cli/main.js
CHANGED
|
@@ -41,7 +41,7 @@ Usage
|
|
|
41
41
|
rushes add format <file> [--video NAME] [--version V] [--label RATIO]
|
|
42
42
|
register another shape (aspect ratio) of a cut;
|
|
43
43
|
--label here is only a ratio hint such as 2.39:1, not the cut's label
|
|
44
|
-
rushes add variant <music|sfx|voice> <file> --name NAME [--lane ID] [--round NAME] [--description TEXT]
|
|
44
|
+
rushes add variant <music|sfx|voice> <file> --name NAME [--video NAME] [--lane ID] [--round NAME] [--description TEXT]
|
|
45
45
|
rushes add shots <file.json> --video NAME [--version V]
|
|
46
46
|
rushes add file <path> --kind K [--name NAME] [--note TEXT] [--video V]
|
|
47
47
|
register a doc, image, caption, export, delivery or edit file
|
|
@@ -408,7 +408,7 @@ export async function main(argv, io) {
|
|
|
408
408
|
if (what === "variant") {
|
|
409
409
|
if (!a || !b || !o.name)
|
|
410
410
|
return usage(io, "rushes add variant <music|sfx|voice> <file> --name NAME");
|
|
411
|
-
const r = await (await client()).post("/api/variants", { stage: a, file: resolve(io.cwd, b), name: o.name, lane: o.lane, round: o.round, description: o.description });
|
|
411
|
+
const r = await (await client()).post("/api/variants", { stage: a, file: resolve(io.cwd, b), name: o.name, lane: o.lane, round: o.round, description: o.description, video: o.video });
|
|
412
412
|
io.out(`Added ${r.lane.name}: ${r.variant.name}`);
|
|
413
413
|
return 0;
|
|
414
414
|
}
|
package/dist/core/batches.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { chipOrder, versionFormats } from "./formats.js";
|
|
2
|
+
import { STAGES } from "./schema.js";
|
|
2
3
|
import { EmptyBatchError } from "./errors.js";
|
|
3
4
|
import { noteInPlay } from "./project.js";
|
|
4
5
|
import { isChanged } from "./script.js";
|
|
6
|
+
import { TAB_NAMES } from "./logEvents.js";
|
|
5
7
|
const STAGE_NAMES = {
|
|
6
8
|
script: "script",
|
|
7
9
|
picture: "picture",
|
|
@@ -12,25 +14,33 @@ const STAGE_NAMES = {
|
|
|
12
14
|
visuals: "visuals",
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
|
-
* Gather
|
|
16
|
-
*
|
|
17
|
+
* Gather open, unsent items into a batch: to-do notes with no batch yet, and changed or flagged
|
|
18
|
+
* script sections. With a stage, only that tab's; with none (Send to agent), every tab's, on every
|
|
19
|
+
* film in play. A batch whose items all come from one tab is that tab's batch; one that spans tabs
|
|
20
|
+
* has no stage.
|
|
17
21
|
*/
|
|
18
22
|
export function createBatch(ctx, stage, now = new Date()) {
|
|
19
23
|
// §26: a shelved film is never asked about; its open notes stay unsent.
|
|
20
|
-
const notes = ctx.notes.notes.filter((n) => n.stage === stage && n.status === "todo" && n.batch === null && noteInPlay(n, ctx.project));
|
|
21
|
-
const sections = stage === "script" ? ctx.script.sections.filter((s) => isChanged(s) || s.status === "flagged") : [];
|
|
24
|
+
const notes = ctx.notes.notes.filter((n) => (stage === undefined || n.stage === stage) && n.status === "todo" && n.batch === null && noteInPlay(n, ctx.project));
|
|
25
|
+
const sections = stage === undefined || stage === "script" ? ctx.script.sections.filter((s) => isChanged(s) || s.status === "flagged") : [];
|
|
22
26
|
if (notes.length === 0 && sections.length === 0)
|
|
23
27
|
throw new EmptyBatchError(stage);
|
|
24
28
|
const id = `b_${ctx.batches.batches.length + 1}`;
|
|
25
29
|
for (const n of notes)
|
|
26
30
|
n.batch = id;
|
|
31
|
+
// The tabs it covers, in tab order.
|
|
32
|
+
const stages = STAGES.filter((st) => (st === "script" && sections.length > 0) || notes.some((n) => n.stage === st));
|
|
33
|
+
const only = stages.length === 1 ? stages[0] : null;
|
|
34
|
+
const picture = notes.filter((n) => n.stage === "picture");
|
|
27
35
|
const batch = {
|
|
28
36
|
id,
|
|
29
|
-
stage,
|
|
37
|
+
stage: only,
|
|
30
38
|
noteIds: notes.map((n) => n.id),
|
|
31
39
|
sectionIds: sections.map((s) => s.id),
|
|
32
40
|
sentAt: now.toISOString(),
|
|
33
|
-
prompt:
|
|
41
|
+
prompt: only
|
|
42
|
+
? buildPrompt(ctx.project.name, only, id, notes.length, sections.length, only === "picture" ? formatLines(ctx.project, picture) : [])
|
|
43
|
+
: buildWidePrompt(ctx.project, id, notes, sections.length),
|
|
34
44
|
};
|
|
35
45
|
ctx.batches.batches.push(batch);
|
|
36
46
|
return batch;
|
|
@@ -70,13 +80,9 @@ export function formatLines(project, notes) {
|
|
|
70
80
|
lines.push(FORMAT_STEPS);
|
|
71
81
|
return lines;
|
|
72
82
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
parts.push(`${notes} note${notes === 1 ? "" : "s"}`);
|
|
77
|
-
if (sections)
|
|
78
|
-
parts.push(`${sections} script section${sections === 1 ? "" : "s"}`);
|
|
79
|
-
const steps = stage === "script"
|
|
83
|
+
/** What the agent does with one tab's notes (or, on Script, its changed sections). */
|
|
84
|
+
function stepsFor(stage) {
|
|
85
|
+
return stage === "script"
|
|
80
86
|
? "Use rushes_get_batch, take each section's proposed line, then rushes_set_script with just those sections (it merges by id). If voiceover already exists, re-record the picked voice with the corrected script and register it with rushes_add_variant as a new read in a new round."
|
|
81
87
|
: stage === "voice"
|
|
82
88
|
? "Use rushes_get_batch and rushes_get_picks. Answer the notes with new whole reads (rushes_add_variant with stage voice and round): a new round for a new direction, or the current round for a small fix to a marked word. Say in each read's description what changed. Then rushes_reply."
|
|
@@ -89,7 +95,39 @@ export function buildPrompt(project, stage, batchId, notes, sections, extra = []
|
|
|
89
95
|
: AUDIO_STAGES.includes(stage)
|
|
90
96
|
? 'Use rushes_get_batch and rushes_get_picks, fix each note (marks such as "Fall" or "Quieter 3 dB" are part of the note), register the new variant, then rushes_reply.'
|
|
91
97
|
: "Use rushes_get_batch, fix each note, then rushes_reply with a fixT for each and rushes_add_version for the new cut.";
|
|
92
|
-
|
|
98
|
+
}
|
|
99
|
+
export function buildPrompt(project, stage, batchId, notes, sections, extra = []) {
|
|
100
|
+
const parts = [];
|
|
101
|
+
if (notes)
|
|
102
|
+
parts.push(`${notes} note${notes === 1 ? "" : "s"}`);
|
|
103
|
+
if (sections)
|
|
104
|
+
parts.push(`${sections} script section${sections === 1 ? "" : "s"}`);
|
|
105
|
+
return `Work through ${STAGE_NAMES[stage]} batch ${batchId} on ${project}: ${parts.join(" and ")}.\n${[...extra, stepsFor(stage)].join("\n")}`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The prompt for a batch that spans tabs: what is in it, tab by tab with the films each tab's notes
|
|
109
|
+
* are on, then what to do on each tab.
|
|
110
|
+
*/
|
|
111
|
+
export function buildWidePrompt(project, batchId, notes, sections) {
|
|
112
|
+
const lines = [];
|
|
113
|
+
const counts = [];
|
|
114
|
+
for (const stage of STAGES) {
|
|
115
|
+
const here = notes.filter((n) => n.stage === stage);
|
|
116
|
+
const k = here.length + (stage === "script" ? sections : 0);
|
|
117
|
+
if (k === 0)
|
|
118
|
+
continue;
|
|
119
|
+
const what = stage === "script" && sections > 0
|
|
120
|
+
? [here.length ? `${here.length} note${here.length === 1 ? "" : "s"}` : "", `${sections} script section${sections === 1 ? "" : "s"}`].filter(Boolean).join(" and ")
|
|
121
|
+
: `${here.length} note${here.length === 1 ? "" : "s"}`;
|
|
122
|
+
// The films a tab's notes are on, by name, so the agent passes the right one to rushes_get_picks.
|
|
123
|
+
const films = [...new Set(here.map((n) => n.video).filter((v) => !!v))].map((v) => project.videos.find((x) => x.id === v)?.name ?? v);
|
|
124
|
+
counts.push(`${TAB_NAMES[stage]}: ${what}${films.length ? ` (${films.join(", ")})` : ""}`);
|
|
125
|
+
const extra = stage === "picture" ? formatLines(project, here) : [];
|
|
126
|
+
lines.push(`${TAB_NAMES[stage]}: ${[...extra, stepsFor(stage)].join(" ")}`);
|
|
127
|
+
}
|
|
128
|
+
const total = notes.length + sections;
|
|
129
|
+
const head = `Work through batch ${batchId} on ${project.name}: ${total} item${total === 1 ? "" : "s"} across ${counts.length} tabs. Each note says its tab (stage) and film (video); on an audio tab, pass that film to rushes_get_picks.`;
|
|
130
|
+
return [head, ...counts.map((c) => `- ${c}`), ...lines].join("\n");
|
|
93
131
|
}
|
|
94
132
|
export function latestBatch(file) {
|
|
95
133
|
return file.batches[file.batches.length - 1];
|
package/dist/core/errors.js
CHANGED
|
@@ -32,6 +32,6 @@ export class CorruptFileError extends RushesError {
|
|
|
32
32
|
}
|
|
33
33
|
export class EmptyBatchError extends RushesError {
|
|
34
34
|
constructor(stage) {
|
|
35
|
-
super(`Nothing open on the ${stage} tab to send`, 409, "empty_batch", { stage });
|
|
35
|
+
super(stage === undefined ? "Nothing open to send" : `Nothing open on the ${stage} tab to send`, 409, "empty_batch", stage === undefined ? {} : { stage });
|
|
36
36
|
}
|
|
37
37
|
}
|
package/dist/core/logEvents.js
CHANGED
|
@@ -126,15 +126,19 @@ export function takeEvent(section, take, number) {
|
|
|
126
126
|
export function scriptEvent(sections) {
|
|
127
127
|
return { area: "script", kind: "script", merge: "replace", text: `Script set: ${plural(sections, "section", "sections")}` };
|
|
128
128
|
}
|
|
129
|
-
/** `Picks: voice “Vo Jules, full read”, music “Night drive, held back”`, the whole set after the change
|
|
130
|
-
export function picksEvent(project, lanes) {
|
|
129
|
+
/** `Picks: voice “Vo Jules, full read”, music “Night drive, held back”`, the whole set after the change; for one film, `Picks for “Key”: …`. */
|
|
130
|
+
export function picksEvent(project, lanes, video) {
|
|
131
131
|
const parts = [];
|
|
132
132
|
for (const lane of project.lanes) {
|
|
133
133
|
const v = lane.variants.find((x) => x.id === lanes[lane.id]);
|
|
134
134
|
if (v)
|
|
135
135
|
parts.push(`${PICK_WORDS[lane.stage]} ${quoted(v.name, lane.stage === "voice" ? "a read" : "a variant")}`);
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
const film = video ? named(video.name, PLACE_MAX) : "";
|
|
138
|
+
const head = film ? `Picks for ${quoted(film, "")}` : "Picks";
|
|
139
|
+
// Per film, so one film's picks never replace another's line in the log.
|
|
140
|
+
const scope = video ? { subject: video.id, video: video.id, version: null } : {};
|
|
141
|
+
return { area: "mix", kind: "picks", merge: "replace", windowMs: PICKS_MERGE_MS, ...scope, text: parts.length ? `${head}: ${parts.join(", ")}` : `${video ? `${head} cleared` : "Picks cleared"}` };
|
|
138
142
|
}
|
|
139
143
|
/** "Picture locked at v6", "Picture unlocked". */
|
|
140
144
|
export function lockEvent(films, video) {
|
|
@@ -147,9 +151,9 @@ export function filmEvent(video, shelved) {
|
|
|
147
151
|
const text = ["Film", quoted(video.name, ""), shelved ? "shelved" : "restored"].filter(Boolean).join(" ");
|
|
148
152
|
return { area: "picture", kind: "film", merge: "replace", subject: video.id, text, video: video.id, version: null };
|
|
149
153
|
}
|
|
150
|
-
/** "3 notes sent from Picture"; on Script, "1 note and 2 script edits sent from Script". */
|
|
154
|
+
/** "3 notes sent from Picture"; on Script, "1 note and 2 script edits sent from Script"; from more than one tab, "5 notes sent from several tabs". */
|
|
151
155
|
export function notesSentEvent(batch) {
|
|
152
|
-
const tab = TAB_NAMES[batch.stage];
|
|
156
|
+
const tab = batch.stage === null ? "" : TAB_NAMES[batch.stage];
|
|
153
157
|
const notes = batch.noteIds.length;
|
|
154
158
|
const edits = batch.sectionIds.length;
|
|
155
159
|
const what = notes && edits
|
|
@@ -157,7 +161,7 @@ export function notesSentEvent(batch) {
|
|
|
157
161
|
: edits ? plural(edits, "script edit", "script edits") : plural(notes, "note", "notes");
|
|
158
162
|
return {
|
|
159
163
|
area: "notes", kind: "notes-sent", merge: "count", count: Math.max(1, notes + edits), subject: tab, tab: batch.stage,
|
|
160
|
-
text: `${what} sent from ${tab}`,
|
|
164
|
+
text: `${what} sent from ${tab || "several tabs"}`,
|
|
161
165
|
many: (n, subject) => `${plural(n, "note", "notes")} sent from ${subject || "several tabs"}`,
|
|
162
166
|
};
|
|
163
167
|
}
|
package/dist/core/project.js
CHANGED
|
@@ -110,7 +110,9 @@ function resolveVersion(video, versionId) {
|
|
|
110
110
|
}
|
|
111
111
|
const LANE_NAMES = { voice: "Voiceover", music: "Music", sfx: "Sound effects" };
|
|
112
112
|
export function addVariant(p, input) {
|
|
113
|
-
// §23
|
|
113
|
+
// The film and (§23) the cues first, so an unknown film or a cue refused for its file leaves the
|
|
114
|
+
// project untouched.
|
|
115
|
+
const video = input.video === undefined ? undefined : resolveVideo(p, input.video).id;
|
|
114
116
|
const cues = [];
|
|
115
117
|
for (const c of input.cues ?? []) {
|
|
116
118
|
const cue = { id: uniqueId(slugify(c.name), cues.map((x) => x.id)), name: c.name, t: c.t };
|
|
@@ -134,6 +136,8 @@ export function addVariant(p, input) {
|
|
|
134
136
|
meta: input.description === undefined ? { ...input.meta } : { ...input.meta, description: input.description },
|
|
135
137
|
cues,
|
|
136
138
|
};
|
|
139
|
+
if (video !== undefined)
|
|
140
|
+
variant.video = video;
|
|
137
141
|
lane.variants.push(variant);
|
|
138
142
|
return { lane, variant };
|
|
139
143
|
}
|
package/dist/core/schema.js
CHANGED
|
@@ -101,6 +101,10 @@ export const VariantSchema = fileObject({
|
|
|
101
101
|
file: z.string().min(1),
|
|
102
102
|
meta: z.record(z.string(), z.union([z.string(), z.number()])).default({}),
|
|
103
103
|
cues: z.array(CueSchema).default([]),
|
|
104
|
+
// The film (video id) this read, bed or pass was made for: only that film's tabs list it. Absent
|
|
105
|
+
// on a variant made for every film, and on every older one, so an older project loads and writes
|
|
106
|
+
// back unchanged.
|
|
107
|
+
video: id.optional(),
|
|
104
108
|
});
|
|
105
109
|
export const LaneSchema = fileObject({
|
|
106
110
|
id,
|
|
@@ -268,17 +272,44 @@ export const LEVEL_MIN = -24;
|
|
|
268
272
|
export const LEVEL_MAX = 6;
|
|
269
273
|
export const LEVEL_STEP = 0.5;
|
|
270
274
|
export const LevelsSchema = fileObject({ voice: z.number(), music: z.number(), sfx: z.number() }).partial().default({});
|
|
275
|
+
// What one film hears: its own pick per lane and its own Mix levels. Music, sound effects, the
|
|
276
|
+
// voiceover read and the levels belong to a film, so a second film never inherits the first's.
|
|
277
|
+
export const VideoPicksSchema = fileObject({
|
|
278
|
+
lanes: z.record(z.string(), z.string()).default({}),
|
|
279
|
+
levels: LevelsSchema,
|
|
280
|
+
});
|
|
271
281
|
export const PicksSchema = fileObject({
|
|
272
282
|
schema: z.literal(1),
|
|
273
283
|
rev: z.number().int().nonnegative(),
|
|
284
|
+
// The project-wide picks of a project from before picks were per film. Nothing reads them for a
|
|
285
|
+
// film any more; a write that names no film (an old client, a test) still lands here.
|
|
274
286
|
lanes: z.record(z.string(), z.string()).default({}),
|
|
275
287
|
sections: z.record(z.string(), z.string()).default({}),
|
|
276
288
|
// §19.6: each Mix lane's level in dB, defaulting to 0 (absent). Keyed the same as LaneStage.
|
|
277
289
|
levels: LevelsSchema,
|
|
290
|
+
// Each film's own picks and levels, keyed by video id. A film with no entry has picked nothing.
|
|
291
|
+
videos: z.record(z.string(), VideoPicksSchema).default({}),
|
|
278
292
|
});
|
|
293
|
+
/** The picks one film plays: its own entry, or nothing picked. With no film named, the project-wide set. */
|
|
294
|
+
export function picksForVideo(picks, videoId) {
|
|
295
|
+
if (!videoId)
|
|
296
|
+
return picks;
|
|
297
|
+
const own = picks.videos[videoId];
|
|
298
|
+
return { ...picks, lanes: { ...(own?.lanes ?? {}) }, levels: { ...(own?.levels ?? {}) }, sections: {}, videos: {} };
|
|
299
|
+
}
|
|
300
|
+
/** The lanes one film hears: each keeps only the variants made for it or for every film, and a lane
|
|
301
|
+
* left with none is dropped. With no film named, every lane as it is. */
|
|
302
|
+
export function lanesForVideo(lanes, videoId) {
|
|
303
|
+
if (!videoId)
|
|
304
|
+
return lanes;
|
|
305
|
+
return lanes
|
|
306
|
+
.map((l) => ({ ...l, variants: l.variants.filter((v) => v.video === undefined || v.video === videoId) }))
|
|
307
|
+
.filter((l) => l.variants.length > 0);
|
|
308
|
+
}
|
|
279
309
|
export const BatchSchema = fileObject({
|
|
280
310
|
id,
|
|
281
|
-
|
|
311
|
+
// The tab the batch's items all come from, or null when it spans tabs (Send to agent sends every tab).
|
|
312
|
+
stage: StageSchema.nullable(),
|
|
282
313
|
noteIds: z.array(z.string()).default([]),
|
|
283
314
|
sectionIds: z.array(z.string()).default([]),
|
|
284
315
|
sentAt: z.string(),
|
package/dist/core/store.js
CHANGED
|
@@ -14,7 +14,7 @@ function defaults(key, name) {
|
|
|
14
14
|
case "notes":
|
|
15
15
|
return { schema: 1, rev: 0, notes: [] };
|
|
16
16
|
case "picks":
|
|
17
|
-
return { schema: 1, rev: 0, lanes: {}, sections: {}, levels: {} };
|
|
17
|
+
return { schema: 1, rev: 0, lanes: {}, sections: {}, levels: {}, videos: {} };
|
|
18
18
|
case "batches":
|
|
19
19
|
return { schema: 1, rev: 0, batches: [] };
|
|
20
20
|
case "found":
|
package/dist/mcp/tools.js
CHANGED
|
@@ -247,6 +247,11 @@ export function createMcpServer(ctx) {
|
|
|
247
247
|
.max(200)
|
|
248
248
|
.optional()
|
|
249
249
|
.describe("One line on what this read, bed or pass is, shown on its lane card. Stored as meta.description, and wins over one given in meta."),
|
|
250
|
+
video: z
|
|
251
|
+
.string()
|
|
252
|
+
.min(1)
|
|
253
|
+
.optional()
|
|
254
|
+
.describe("The film (id or name) this read, bed or pass is for: only that film's Voiceover, Music, Sound effects and Mix list it. Leave it out only when it is for every film. In a project with more than one film, always give it."),
|
|
250
255
|
cues: z
|
|
251
256
|
.array(z.object({
|
|
252
257
|
name: z.string(),
|
|
@@ -311,7 +316,7 @@ export function createMcpServer(ctx) {
|
|
|
311
316
|
}));
|
|
312
317
|
server.registerTool("rushes_get_batch", {
|
|
313
318
|
title: "Get a batch",
|
|
314
|
-
description: "The batch the user sent with Send to agent (latest by default), with its notes and script sections. A note's `on` says what it's about: null on Picture or for the whole mix, \"<lane>/<variant>\" for a music bed, SFX pass or voice variant, \"<lane>/<variant>:<cue>\" for an SFX cue, \"vo\" for the VO lane on Mix. Older notes may carry a bare variant id, \"vo\" for the assembled read, \"<section>:<take>\" for a take, or a section id.",
|
|
319
|
+
description: "The batch the user sent with Send to agent (latest by default), with its notes and script sections. It holds every open note from every tab and every film in play: `stage` is the tab when they all came from one, or null when it spans tabs, and each note carries its own `stage` and `video`. A note's `on` says what it's about: null on Picture or for the whole mix, \"<lane>/<variant>\" for a music bed, SFX pass or voice variant, \"<lane>/<variant>:<cue>\" for an SFX cue, \"vo\" for the VO lane on Mix. Older notes may carry a bare variant id, \"vo\" for the assembled read, \"<section>:<take>\" for a take, or a section id.",
|
|
315
320
|
inputSchema: { project, id: z.string().optional() },
|
|
316
321
|
}, safe(async ({ project, id }) => (await ctx.client(project)).get(`/api/batches/${encodeURIComponent(id ?? "latest")}`)));
|
|
317
322
|
server.registerTool("rushes_reply", {
|
|
@@ -337,9 +342,9 @@ export function createMcpServer(ctx) {
|
|
|
337
342
|
}, safe(async ({ project, kind }) => (await ctx.client(project)).get(`/api/assets${kind ? `?kind=${encodeURIComponent(kind)}` : ""}`)));
|
|
338
343
|
server.registerTool("rushes_get_picks", {
|
|
339
344
|
title: "Get picks",
|
|
340
|
-
description: "Which variant is in use per audio lane (per round on Voiceover), and each Mix lane's level in dB (where the user wants voice, music and sfx to sit). Section take picks are kept for older projects but not used.",
|
|
341
|
-
inputSchema: { project },
|
|
342
|
-
}, safe(async ({ project }) => (await ctx.client(project)).get(
|
|
345
|
+
description: "Which variant is in use per audio lane (per round on Voiceover), and each Mix lane's level in dB (where the user wants voice, music and sfx to sit). Picks and levels belong to one film: pass `video` (the film's id, as in the note you are fixing) to read that film's own; without it you get the whole file, each film's under `videos`. Section take picks are kept for older projects but not used.",
|
|
346
|
+
inputSchema: { project, video: z.string().optional().describe("The film's id. Picks and levels are per film.") },
|
|
347
|
+
}, safe(async ({ project, video }) => (await ctx.client(project)).get(`/api/picks${video ? `?video=${encodeURIComponent(video)}` : ""}`)));
|
|
343
348
|
server.registerTool("rushes_add_file", {
|
|
344
349
|
title: "Add a file to the library",
|
|
345
350
|
description: "Register a project file (a doc, image, caption, export, delivery or edit file) in the Assets library, so it's listed, can be revealed, downloaded and opened. Docs, text and PDFs at the project root, captions at the root, and anything in exports/ are found automatically; other files need this.",
|
package/dist/server/app.js
CHANGED
|
@@ -24,7 +24,7 @@ import { GRAB_PATH, OUTSIDE_CUT_EXT, OUTSIDE_MEDIA_EXT, SCREENSHOT_PATH, content
|
|
|
24
24
|
import { BRING_IN_MAX, FoundScanner, ffprobeDuration, foundAnnouncer } from "./found.js";
|
|
25
25
|
import { candidatePaths, listAssets, fpsFor, screenshotName } from "./assets.js";
|
|
26
26
|
import { osRevealer, osOpener, OPEN_SAFE_EXT } from "./reveal.js";
|
|
27
|
-
import { LaneStageSchema, SectionStatusSchema, StageSchema, BoxSchema, PinSchema, FileKindSchema, MarkSchema, ProjectIdSchema, ShotSchema, LEVEL_MIN, LEVEL_MAX, LEVEL_STEP } from "../core/schema.js";
|
|
27
|
+
import { LaneStageSchema, SectionStatusSchema, StageSchema, BoxSchema, PinSchema, FileKindSchema, MarkSchema, ProjectIdSchema, ShotSchema, LEVEL_MIN, LEVEL_MAX, LEVEL_STEP, lanesForVideo, picksForVideo } from "../core/schema.js";
|
|
28
28
|
import { LABEL_MAX, oneLineOf } from "../core/labels.js";
|
|
29
29
|
import { byOf, logBookFor } from "./logbook.js";
|
|
30
30
|
import { BriefService } from "./brief.js";
|
|
@@ -33,7 +33,7 @@ import { buildState, planWarning } from "../core/plan.js";
|
|
|
33
33
|
import { broughtInEvent, cutEvent, fileEvent, filmEvent, formatEvent, lineEvent, lockEvent, notesSentEvent, picksEvent, repliesEvent, scriptEvent, takeEvent, variantEvent, visualEvent, } from "../core/logEvents.js";
|
|
34
34
|
import { LOG_AREAS, LOG_MAX, changeLogFileName, logText, recentChanges } from "../core/logText.js";
|
|
35
35
|
import { defaultRunner, measureMix } from "./loudness.js";
|
|
36
|
-
export const VERSION = "0.7.
|
|
36
|
+
export const VERSION = "0.7.2";
|
|
37
37
|
async function body(c, schema) {
|
|
38
38
|
let json;
|
|
39
39
|
try {
|
|
@@ -135,6 +135,7 @@ const VariantBody = z.object({
|
|
|
135
135
|
file: z.string().min(1),
|
|
136
136
|
meta: z.record(z.string(), z.union([z.string(), z.number()])).optional(),
|
|
137
137
|
description: z.string().min(1).max(200).optional(),
|
|
138
|
+
video: z.string().min(1).max(200).optional(),
|
|
138
139
|
// §23.6: a cue's file has no length cap here. The 1024 limit applies to the stored (manifest) form,
|
|
139
140
|
// which checkCueFile enforces with a 400 naming the cue.
|
|
140
141
|
cues: z.array(z.object({ name: z.string().min(1), t, file: z.string().min(1).optional() })).optional(),
|
|
@@ -168,8 +169,9 @@ const PickMap = z.record(z.string(), z.string().nullable());
|
|
|
168
169
|
// §19.6: a level is −24..6 dB in 0.5 dB steps; null resets it to 0 (removes the key).
|
|
169
170
|
const LevelValue = z.number().min(LEVEL_MIN).max(LEVEL_MAX).multipleOf(LEVEL_STEP);
|
|
170
171
|
const LevelsBody = z.object({ voice: LevelValue.nullable(), music: LevelValue.nullable(), sfx: LevelValue.nullable() }).partial();
|
|
171
|
-
const PicksBody = z.object({ lanes: PickMap.optional(), sections: PickMap.optional(), levels: LevelsBody.optional() });
|
|
172
|
-
|
|
172
|
+
const PicksBody = z.object({ video: z.string().min(1).max(200).optional(), lanes: PickMap.optional(), sections: PickMap.optional(), levels: LevelsBody.optional() });
|
|
173
|
+
// No stage: every tab's open notes (Send to agent). A stage: that tab's only.
|
|
174
|
+
const BatchBody = z.object({ stage: StageSchema.optional() });
|
|
173
175
|
const NoteQuery = z.object({
|
|
174
176
|
stage: StageSchema.optional(),
|
|
175
177
|
status: z.enum(["todo", "done"]).optional(),
|
|
@@ -188,7 +190,7 @@ const ShotsBody = z.object({
|
|
|
188
190
|
});
|
|
189
191
|
const LockBody = z.object({ version: z.string().nullable() });
|
|
190
192
|
const ShelveBody = z.object({ shelved: z.boolean() });
|
|
191
|
-
const MixLoudnessBody = z.object({ lanes: z.array(LaneStageSchema).min(1) });
|
|
193
|
+
const MixLoudnessBody = z.object({ lanes: z.array(LaneStageSchema).min(1), video: z.string().min(1).max(200).optional() });
|
|
192
194
|
const SettingsBody = z.object({ autoProxy: z.boolean() }).strict();
|
|
193
195
|
// A time in seconds, 0 to 24 h: an empty value, NaN, Infinity or anything huge is a 400.
|
|
194
196
|
const FrameQuery = z.object({
|
|
@@ -669,7 +671,7 @@ export function createApp(store, opts = {}) {
|
|
|
669
671
|
...v,
|
|
670
672
|
versions: await Promise.all(v.versions.map(async (ver) => ({ ...ver, proxyNeed: await jobs.needNow(fromManifestPath(store.root, ver.file)) }))),
|
|
671
673
|
})));
|
|
672
|
-
return c.json({ project: { ...project, videos }, script, notes, picks, batches, tabs, visuals, proxies: { ffmpeg, jobs: jobs.list() }, found: foundSummary, log: logHead, brief: briefView, storyboard: storyboardView, build: buildState({ brief: briefView, script: script.sections, storyboard: storyboardView }) });
|
|
674
|
+
return c.json({ version: VERSION, project: { ...project, videos }, script, notes, picks, batches, tabs, visuals, proxies: { ffmpeg, jobs: jobs.list() }, found: foundSummary, log: logHead, brief: briefView, storyboard: storyboardView, build: buildState({ brief: briefView, script: script.sections, storyboard: storyboardView }) });
|
|
673
675
|
});
|
|
674
676
|
// ---- found: the project's other files (§20) ----
|
|
675
677
|
app.get("/api/found", async (c) => {
|
|
@@ -1161,7 +1163,12 @@ export function createApp(store, opts = {}) {
|
|
|
1161
1163
|
return c.json({ take: result }, 201);
|
|
1162
1164
|
});
|
|
1163
1165
|
// ---- picks ----
|
|
1164
|
-
|
|
1166
|
+
// ?video=<id> reads one film's picks as a plain picks file (lanes and levels are that film's own).
|
|
1167
|
+
app.get("/api/picks", async (c) => {
|
|
1168
|
+
const picks = await store.read("picks");
|
|
1169
|
+
const video = c.req.query("video");
|
|
1170
|
+
return c.json(video ? picksForVideo(picks, video) : picks);
|
|
1171
|
+
});
|
|
1165
1172
|
app.put("/api/picks", async (c) => {
|
|
1166
1173
|
const b = await body(c, PicksBody);
|
|
1167
1174
|
// Merged key by key: a string sets that pick, null removes it, anything not named is kept.
|
|
@@ -1173,11 +1180,7 @@ export function createApp(store, opts = {}) {
|
|
|
1173
1180
|
into[k] = v;
|
|
1174
1181
|
}
|
|
1175
1182
|
};
|
|
1176
|
-
|
|
1177
|
-
const { data } = await store.update("picks", (p) => {
|
|
1178
|
-
before = { ...p.lanes };
|
|
1179
|
-
merge(p.lanes, b.lanes);
|
|
1180
|
-
merge(p.sections, b.sections);
|
|
1183
|
+
const mergeLevels = (into) => {
|
|
1181
1184
|
// §19.6: same merge rule as lanes/sections -- a number sets the level, null resets it to 0
|
|
1182
1185
|
// (deletes the key), anything not named is kept.
|
|
1183
1186
|
for (const stage of ["voice", "music", "sfx"]) {
|
|
@@ -1185,29 +1188,47 @@ export function createApp(store, opts = {}) {
|
|
|
1185
1188
|
if (v === undefined)
|
|
1186
1189
|
continue;
|
|
1187
1190
|
if (v === null)
|
|
1188
|
-
delete
|
|
1191
|
+
delete into[stage];
|
|
1189
1192
|
else
|
|
1190
|
-
|
|
1193
|
+
into[stage] = v;
|
|
1191
1194
|
}
|
|
1195
|
+
};
|
|
1196
|
+
let before = {};
|
|
1197
|
+
const { data } = await store.update("picks", (p) => {
|
|
1198
|
+
merge(p.sections, b.sections);
|
|
1199
|
+
if (b.video) {
|
|
1200
|
+
// A film's picks and levels are its own: another film's are never touched.
|
|
1201
|
+
const own = (p.videos[b.video] ??= { lanes: {}, levels: {} });
|
|
1202
|
+
before = { ...own.lanes };
|
|
1203
|
+
merge(own.lanes, b.lanes);
|
|
1204
|
+
mergeLevels(own.levels);
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
before = { ...p.lanes };
|
|
1208
|
+
merge(p.lanes, b.lanes);
|
|
1209
|
+
mergeLevels(p.levels);
|
|
1192
1210
|
});
|
|
1211
|
+
const now = b.video ? (data.videos[b.video]?.lanes ?? {}) : data.lanes;
|
|
1193
1212
|
// §22.5: a change of what's picked is logged; levels alone aren't (R10).
|
|
1194
|
-
const changed = Object.keys({ ...before, ...
|
|
1213
|
+
const changed = Object.keys({ ...before, ...now }).some((k) => before[k] !== now[k]);
|
|
1195
1214
|
if (changed) {
|
|
1196
1215
|
// The names come from project.json; if it can't be read now, the pick still stands (ruling e).
|
|
1197
1216
|
const project = await store.read("project").catch(() => null);
|
|
1198
1217
|
if (project)
|
|
1199
|
-
await log.add(() => picksEvent(project,
|
|
1218
|
+
await log.add(() => picksEvent(project, now, project.videos.find((v) => v.id === b.video)), by(c));
|
|
1200
1219
|
else
|
|
1201
1220
|
log.failures += 1;
|
|
1202
1221
|
}
|
|
1203
|
-
return c.json(data);
|
|
1222
|
+
return c.json(b.video ? picksForVideo(data, b.video) : data);
|
|
1204
1223
|
});
|
|
1205
1224
|
// ---- mix loudness (§17.6) ----
|
|
1206
1225
|
app.post("/api/mix/loudness", async (c) => {
|
|
1207
1226
|
const b = await body(c, MixLoudnessBody);
|
|
1208
1227
|
const [project, picks] = await Promise.all([store.read("project"), store.read("picks")]);
|
|
1209
1228
|
const run = opts.loudnessRunner ?? defaultRunner;
|
|
1210
|
-
|
|
1229
|
+
// A film hears only its own reads, beds and passes, as its Mix tab plays them.
|
|
1230
|
+
const heard = { ...project, lanes: lanesForVideo(project.lanes, b.video) };
|
|
1231
|
+
const result = await measureMix(heard, picksForVideo(picks, b.video), b.lanes, store.root, run, opts.loudnessTimeoutMs);
|
|
1211
1232
|
return c.json(result);
|
|
1212
1233
|
});
|
|
1213
1234
|
// ---- batches ----
|
package/dist/server/found.js
CHANGED
|
@@ -181,6 +181,18 @@ export function anchorCut(p, film) {
|
|
|
181
181
|
}
|
|
182
182
|
return best;
|
|
183
183
|
}
|
|
184
|
+
/** The film found audio is for: the named film, when it is one of this project's. Otherwise none, so
|
|
185
|
+
* every film lists it. */
|
|
186
|
+
function audioFilm(p, film) {
|
|
187
|
+
if (film === undefined)
|
|
188
|
+
return undefined;
|
|
189
|
+
try {
|
|
190
|
+
return resolveVideo(p, film).id;
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
184
196
|
/** The film a found cut joins: the anchor cut's film, else the first film. Null with no films. */
|
|
185
197
|
function filmFor(p, film) {
|
|
186
198
|
return anchorCut(p, film)?.video.id ?? p.videos[0]?.id ?? null;
|
|
@@ -564,7 +576,8 @@ export class FoundScanner {
|
|
|
564
576
|
if (picked.length === 0)
|
|
565
577
|
return none();
|
|
566
578
|
const reasons = new Map(picked.map((f) => [f.path, byPath.get(f.path)?.reasons ?? []]));
|
|
567
|
-
|
|
579
|
+
// The current set was matched to the anchor cut, so it comes in for that cut's film.
|
|
580
|
+
const result = await this.bringInNow(picked.map((f) => ({ path: f.path, kind: f.kind })), { reasons, film: film ?? anchor?.video.id, origin: "auto" });
|
|
568
581
|
// §22.5: what the current set brought in is one line, by Rushes (R8, R9); its variants are dated (R5).
|
|
569
582
|
// Built inside add's guard, so a line that can't be made never undoes the bring-in (M1).
|
|
570
583
|
const cut = anchor;
|
|
@@ -789,7 +802,7 @@ export class FoundScanner {
|
|
|
789
802
|
return { reason: clash };
|
|
790
803
|
const description = it.reasons.length > 0 ? it.reasons.join(" · ") : undefined;
|
|
791
804
|
try {
|
|
792
|
-
const { lane, variant } = addVariant(p, { stage: it.kind, round, name, file: it.rel, description });
|
|
805
|
+
const { lane, variant } = addVariant(p, { stage: it.kind, round, name, file: it.rel, description, video: audioFilm(p, film) });
|
|
793
806
|
return { path: it.rel, kind: it.kind, lane: lane.id, variant: variant.id };
|
|
794
807
|
}
|
|
795
808
|
catch (e) {
|
package/package.json
CHANGED
package/skills/rushes/SKILL.md
CHANGED
|
@@ -61,10 +61,10 @@ For stills, standalone images and carousels, register one visual per post with `
|
|
|
61
61
|
- `rushes_add_version` for a render. Give every cut a short `label` (48 characters at most) saying what changed, and put the detail in `note`. If the cut is likely to play badly in a browser, the reply carries `proxySuggested: true` and `proxyReason`; Picture offers the user a proxy. Prefer H.264 MP4 to avoid this;
|
|
62
62
|
- `rushes_add_format` for each other shape of a cut (a 9:16, 1:1 or 4:5 of the same edit): register every shape you rendered, main one first, or pass `formats: [{ file }]` to `rushes_add_version`. Its `label` is only a ratio hint such as 2.39:1, never the cut's short label;
|
|
63
63
|
- `rushes_set_script` for the VO script. It merges by `id`, so send only the sections you changed; sections you leave out are kept. `rushes_get_script` reads the whole script;
|
|
64
|
-
- `rushes_add_variant` for each voice read, music bed or SFX pass. Voice reads carry `stage: "voice"` and a `round` (its name — reads in one round are compared side by side; a new direction gets a new round); say what the read is, or what changed, in `description`. Music and SFX carry `meta.description` for their lane card, and SFX passes carry `cues` as `{name, t, file?}`: the same name each time a sound comes back, and `file` (an audio file) when you know which sample you placed;
|
|
64
|
+
- `rushes_add_variant` for each voice read, music bed or SFX pass, with `video` set to the film it is for (only that film's tabs list it; leave `video` out only for audio that is for every film). Voice reads carry `stage: "voice"` and a `round` (its name — reads in one round are compared side by side; a new direction gets a new round); say what the read is, or what changed, in `description`. Music and SFX carry `meta.description` for their lane card, and SFX passes carry `cues` as `{name, t, file?}`: the same name each time a sound comes back, and `file` (an audio file) when you know which sample you placed;
|
|
65
65
|
- `rushes_set_shots` for the storyboard's shots, once you have the first cut; send new timings when a later cut moves them.
|
|
66
66
|
2. Call `rushes_open` and tell the user it's ready, with what it brought in and what it left (below). Each project's dashboard lives at its own address, `/p/<id>/`.
|
|
67
|
-
3. When the user sends a batch, call `rushes_get_batch` and fix every note in it. A note carries the `shot` it falls in; on an audio stage, call `rushes_get_picks` first — on Mix it also returns `levels` (dB per lane), which you read, not set. Its `on` says what it's about: `"<lane>/<variant>"` for a bed, pass or voice read (on Voiceover the lane names the round), `"<lane>/<variant>:<cue>"` for an SFX cue, `"vo"` for the Mix VO lane, or `null` for the whole mix; older notes may carry a section id or `"<section>:<take>"`. On Music, Sound effects and Mix treat `marks` (e.g. "Fall", "Quieter 3 dB") as part of the note; Voiceover notes carry none — they're Whole (`Speaker`, `Pacing`, `Tone`, `Overall`) or Point (`Fix this`, `Keep this`) instead. A Picture note's `format` is null for every format, or a format id such as `"9x16"`: when it isn't null, fix only that format. Picks are set from the dashboard only — no tool or CLI command sets one.
|
|
67
|
+
3. When the user sends a batch, call `rushes_get_batch` and fix every note in it. A batch holds every open note from every tab and film, so each note's own `stage` and `video` say where it belongs. A note carries the `shot` it falls in; on an audio stage, call `rushes_get_picks` first — on Mix it also returns `levels` (dB per lane), which you read, not set. Its `on` says what it's about: `"<lane>/<variant>"` for a bed, pass or voice read (on Voiceover the lane names the round), `"<lane>/<variant>:<cue>"` for an SFX cue, `"vo"` for the Mix VO lane, or `null` for the whole mix; older notes may carry a section id or `"<section>:<take>"`. On Music, Sound effects and Mix treat `marks` (e.g. "Fall", "Quieter 3 dB") as part of the note; Voiceover notes carry none — they're Whole (`Speaker`, `Pacing`, `Tone`, `Overall`) or Point (`Fix this`, `Keep this`) instead. A Picture note's `format` is null for every format, or a format id such as `"9x16"`: when it isn't null, fix only that format. Picks are set from the dashboard only — no tool or CLI command sets one.
|
|
68
68
|
4. Register the new cut with `rushes_add_version`. On a locked video the reply carries a `warning`.
|
|
69
69
|
5. Reply to all the notes in one `rushes_reply` call. For each note set `status: "done"`, a one-line `reply`, `fixT` (when the fix is visible in the new cut, in seconds) and `fixVersion`.
|
|
70
70
|
6. For script batches: when a section's `proposed` differs from `current`, adopt it with `rushes_set_script`, sending just that section with its `id`. If voiceover already exists, re-record the picked voice with the corrected script and register it with `rushes_add_variant` as a new read in a new round.
|