rushes 0.7.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.3",
4
+ "version": "0.8.0",
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
@@ -115,7 +115,7 @@ The user can shelve a film they have set aside (the **Film actions** menu in the
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
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
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
+ - Every voice read, music bed and SFX pass belongs to one film or several: pass its `video` (an id or name, or a list of them when one bed is fitted to several films) to `rushes_add_variant`, and the Voiceover, Music, Sound effects and Mix tabs list it only on those films. In a project with more than one film, one without a `video` is on no film: it waits, folded, under "Not on this film" on each film's tab (with the ones on other films) until someone puts it on one. `rushes_set_films` (`lane`, `variant`, `videos`) moves an existing one; the user does the same from the **Films** button on its card. `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).
119
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.
120
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.
121
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.
@@ -153,7 +153,7 @@ Rushes keeps a log of what happened in the project, written as it happens (`.rus
153
153
 
154
154
  ## Tools
155
155
 
156
- The MCP server has twenty-three tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor`. Each takes an optional `project` folder, which defaults to the folder the harness started in.
156
+ The MCP server has twenty-four tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_films`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor`. Each takes an optional `project` folder, which defaults to the folder the harness started in.
157
157
 
158
158
  ## Rules
159
159
 
package/README.md CHANGED
@@ -186,7 +186,7 @@ If your user asked you to use Rushes, do this:
186
186
  2. If it added anything, tell the user to restart the app (or start a new session) so the `rushes_*` tools load.
187
187
  3. From then on, follow [AGENTS.md](AGENTS.md). If the user wants a new film, start with **Starting a film** in AGENTS.md: plan it with them first, then build. Otherwise, in short: register what you made, call `rushes_open`, wait for the user to press **Send to agent**, then `rushes_get_batch`, fix the notes, and `rushes_reply`.
188
188
 
189
- The MCP server has twenty-three tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor`.
189
+ The MCP server has twenty-four tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_films`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor`.
190
190
 
191
191
  If you can't run commands, give the user the matching line from **Manual setup** below.
192
192
 
@@ -96,7 +96,7 @@ export function formatEvent(films, video, versionId, format) {
96
96
  },
97
97
  };
98
98
  }
99
- /** `Music: “Night drive, driving drop” added to night-drive`; a voice read is a "read". */
99
+ /** `Music: “Night drive, driving drop” added to deep-house`; a voice read is a "read". */
100
100
  export function variantEvent(lane, variant) {
101
101
  const word = STAGE_WORDS[lane.stage];
102
102
  const [one, many] = lane.stage === "voice" ? ["read", "reads"] : ["variant", "variants"];
@@ -147,6 +147,16 @@ export function lockEvent(films, video) {
147
147
  return { area: "picture", kind: "lock", merge: "replace", subject: video.id, text, video: video.id, version: video.lockedVersion };
148
148
  }
149
149
  /** §26: "Film “Key” shelved", "Film “Key” restored". One line per change; the last state wins, as a lock does. */
150
+ /** "Music: “Deep house” on Hero 60s and Teaser 15s"; with no film, "… on no film". */
151
+ export function variantFilmsEvent(lane, variant, films) {
152
+ const word = STAGE_WORDS[lane.stage];
153
+ const on = films.length === 0 ? "no film" : films.length === 1 ? films[0] : `${films.slice(0, -1).join(", ")} and ${films[films.length - 1]}`;
154
+ return {
155
+ area: lane.stage, kind: "variant", merge: "replace", subject: `${lane.id}/${variant.id}`,
156
+ text: `${word}: ${quoted(variant.name, lane.stage === "voice" ? "a read" : "a variant")} on ${on}`,
157
+ ref: `${lane.id}/${variant.id}`,
158
+ };
159
+ }
150
160
  export function filmEvent(video, shelved) {
151
161
  const text = ["Film", quoted(video.name, ""), shelved ? "shelved" : "restored"].filter(Boolean).join(" ");
152
162
  return { area: "picture", kind: "film", merge: "replace", subject: video.id, text, video: video.id, version: null };
@@ -1,4 +1,5 @@
1
1
  import { basename } from "node:path";
2
+ import { variantFilms } from "./schema.js";
2
3
  import { newProjectId, slugify, uniqueId } from "./ids.js";
3
4
  import { InvalidError, NotFoundError, RushesError } from "./errors.js";
4
5
  import { checkCueFile } from "./cues.js";
@@ -113,7 +114,7 @@ const firstWord = (text) => text.replace(/\.[a-z0-9]{2,4}$/i, "").toLowerCase().
113
114
  /**
114
115
  * The film a variant is for when nobody said: the one film in play whose name starts with the same
115
116
  * word as the variant's name or its file's name ("f3a One phone, four buttons" and "f3a SFX pass 3").
116
- * With none matching, or more than one, no film: the variant then shows on every film, as it always has.
117
+ * With none matching, or more than one, no film: the variant is then on no film until someone puts it on one.
117
118
  */
118
119
  export function inferFilm(p, name, file) {
119
120
  const words = new Set([firstWord(name), firstWord(basename(file))].filter((w) => w.length >= 2));
@@ -124,7 +125,7 @@ const LANE_NAMES = { voice: "Voiceover", music: "Music", sfx: "Sound effects" };
124
125
  export function addVariant(p, input) {
125
126
  // The film and (§23) the cues first, so an unknown film or a cue refused for its file leaves the
126
127
  // project untouched.
127
- const video = input.video === undefined ? inferFilm(p, input.name, input.file) : resolveVideo(p, input.video).id;
128
+ const videos = input.video === undefined ? [inferFilm(p, input.name, input.file)].filter((v) => v !== undefined) : filmIds(p, input.video);
128
129
  const cues = [];
129
130
  for (const c of input.cues ?? []) {
130
131
  const cue = { id: uniqueId(slugify(c.name), cues.map((x) => x.id)), name: c.name, t: c.t };
@@ -148,11 +149,33 @@ export function addVariant(p, input) {
148
149
  meta: input.description === undefined ? { ...input.meta } : { ...input.meta, description: input.description },
149
150
  cues,
150
151
  };
151
- if (video !== undefined)
152
- variant.video = video;
152
+ if (videos.length > 0)
153
+ variant.videos = videos;
153
154
  lane.variants.push(variant);
154
155
  return { lane, variant };
155
156
  }
157
+ /** Film ids for one ref or several (id or name each), each once, in the order given. Throws on an unknown film. */
158
+ function filmIds(p, refs) {
159
+ return [...new Set((Array.isArray(refs) ? refs : [refs]).map((r) => resolveVideo(p, r).id))];
160
+ }
161
+ /**
162
+ * Put a read, bed or pass on exactly these films (ids or names); an empty list puts it on none.
163
+ * Returns the films it left, so the caller can drop those films' picks of it.
164
+ */
165
+ export function setVariantFilms(p, laneId, variantId, refs) {
166
+ const lane = p.lanes.find((l) => l.id === laneId);
167
+ const variant = lane?.variants.find((v) => v.id === variantId);
168
+ if (!lane || !variant)
169
+ throw new NotFoundError("variant", `${laneId}/${variantId}`);
170
+ const videos = filmIds(p, refs);
171
+ const left = variantFilms(variant).filter((v) => !videos.includes(v));
172
+ delete variant.video;
173
+ if (videos.length > 0)
174
+ variant.videos = videos;
175
+ else
176
+ delete variant.videos;
177
+ return { lane, variant, left };
178
+ }
156
179
  const FILE_NAME_MAX = 120;
157
180
  // Leaves room for uniqueId's "-2", "-3" ... suffix and the odd longer one, well inside the
158
181
  // schema's 64-character id cap.
@@ -101,9 +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.
104
+ // The films (video ids) this read, bed or pass is on: only those films' tabs list it. One bed is
105
+ // often fitted to several films. Absent on a variant on no film yet, and on every older one.
106
+ videos: z.array(id).optional(),
107
+ // The one film an older project named (0.7.x). Read as `videos: [video]`; set films replace it.
107
108
  video: id.optional(),
108
109
  });
109
110
  export const LaneSchema = fileObject({
@@ -297,13 +298,25 @@ export function picksForVideo(picks, videoId) {
297
298
  const own = picks.videos[videoId];
298
299
  return { ...picks, lanes: { ...(own?.lanes ?? {}) }, levels: { ...(own?.levels ?? {}) }, sections: {}, videos: {} };
299
300
  }
300
- /** The lanes one film hears: each keeps only the variants made for it or for every film, and a lane
301
+ /** The films a read, bed or pass is on: its `videos`, or an older project's one `video`, or none. */
302
+ export function variantFilms(v) {
303
+ return v.videos ?? (v.video === undefined ? [] : [v.video]);
304
+ }
305
+ /**
306
+ * Whether a read, bed or pass is on a film. One on no film is on it only in a project with one film
307
+ * (there is nowhere else for it to be); with several, it is on none until it is put on one.
308
+ */
309
+ export function onFilm(v, videoId, filmCount) {
310
+ const films = variantFilms(v);
311
+ return films.length === 0 ? filmCount <= 1 : films.includes(videoId);
312
+ }
313
+ /** The lanes one film hears: each keeps only the variants on that film (see onFilm), and a lane
301
314
  * left with none is dropped. With no film named, every lane as it is. */
302
- export function lanesForVideo(lanes, videoId) {
315
+ export function lanesForVideo(lanes, videoId, filmCount) {
303
316
  if (!videoId)
304
317
  return lanes;
305
318
  return lanes
306
- .map((l) => ({ ...l, variants: l.variants.filter((v) => v.video === undefined || v.video === videoId) }))
319
+ .map((l) => ({ ...l, variants: l.variants.filter((v) => onFilm(v, videoId, filmCount)) }))
307
320
  .filter((l) => l.variants.length > 0);
308
321
  }
309
322
  export const BatchSchema = fileObject({
package/dist/mcp/tools.js CHANGED
@@ -248,10 +248,9 @@ export function createMcpServer(ctx) {
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
250
  video: z
251
- .string()
252
- .min(1)
251
+ .union([z.string().min(1), z.array(z.string().min(1)).min(1)])
253
252
  .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. Rushes works the film out when the read, bed or pass's name or file name starts with the film's first word (\"f3a SFX pass 3\" for \"f3a One phone\"), but always give it in a project with more than one film. The reply carries a `warning` when it ended up on every film."),
253
+ .describe("The film (id or name) this read, bed or pass is for, or a list of films when one bed is fitted to several: only those films' Voiceover, Music, Sound effects and Mix list it. Rushes works out one film when the name or file name starts with the film's first word (\"f3a SFX pass 3\" for \"f3a One phone\"), but always give it in a project with more than one film: one on no film is listed on none of their tabs (it waits, folded, under \"Not on this film\"), and the reply carries a `warning`. To move one later, use rushes_set_films."),
255
254
  cues: z
256
255
  .array(z.object({
257
256
  name: z.string(),
@@ -267,6 +266,16 @@ export function createMcpServer(ctx) {
267
266
  .describe("SFX cues with times in seconds, each optionally with the `file` of its sample. Give a sound the same name every time it comes back: the tab groups cues by name."),
268
267
  },
269
268
  }, safe(async ({ project, ...b }) => (await ctx.client(project)).post("/api/variants", b)));
269
+ server.registerTool("rushes_set_films", {
270
+ title: "Put a read, bed or pass on films",
271
+ description: "Put an existing voice read, music bed or SFX pass on exactly these films: only their tabs list it, and a film it leaves drops its pick of it. An empty list puts it on no film. The user can do the same from the Films button on its card.",
272
+ inputSchema: {
273
+ project,
274
+ lane: z.string().min(1).describe("Lane id, from rushes_status or rushes_add_variant."),
275
+ variant: z.string().min(1).describe("Variant id within the lane."),
276
+ videos: z.array(z.string().min(1)).max(100).describe("Film ids or names, e.g. [\"Hero 60s\", \"Teaser 15s\"]."),
277
+ },
278
+ }, safe(async ({ project, lane, variant, videos }) => (await ctx.client(project)).put(`/api/variants/${encodeURIComponent(lane)}/${encodeURIComponent(variant)}/films`, { videos })));
270
279
  server.registerTool("rushes_set_script", {
271
280
  title: "Set the VO script",
272
281
  description: "Add or update VO script sections. By default this merges by id: send only the sections you changed, with their ids, and new sections without one. Sections you leave out stay as they are. A section that keeps its id keeps the user's edits, direction and takes. Returns the full list.",
@@ -2,7 +2,7 @@ import { Hono } from "hono";
2
2
  import { streamSSE } from "hono/streaming";
3
3
  import { z } from "zod";
4
4
  import { RushesError, InvalidError, NotFoundError } from "../core/errors.js";
5
- import { addFile, addFormat, addVariant, addVersion, ensureProjectIdOnce, inPlay, lockPicture, noteInPlay, resolveCut, resolveVideo, setShots, shelveFilm, shotAt } from "../core/project.js";
5
+ import { addFile, addFormat, addVariant, addVersion, ensureProjectIdOnce, lockPicture, noteInPlay, resolveCut, resolveVideo, setShots, setVariantFilms, shelveFilm, shotAt } from "../core/project.js";
6
6
  import { addTake, editSection, setSections } from "../core/script.js";
7
7
  import { addNote, applyReply, applyUserEdit, checkNoteFormat, filterNotes } from "../core/notes.js";
8
8
  import { FORMAT_ID_RE, MAX_FORMATS, isPictureSize, labelOfId, versionFormats } from "../core/formats.js";
@@ -24,16 +24,16 @@ 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, lanesForVideo, picksForVideo } from "../core/schema.js";
27
+ import { LaneStageSchema, SectionStatusSchema, StageSchema, BoxSchema, PinSchema, FileKindSchema, MarkSchema, ProjectIdSchema, ShotSchema, LEVEL_MIN, LEVEL_MAX, LEVEL_STEP, lanesForVideo, picksForVideo, variantFilms } 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";
31
31
  import { StoryboardService } from "./storyboard.js";
32
32
  import { buildState, planWarning } from "../core/plan.js";
33
- import { broughtInEvent, cutEvent, fileEvent, filmEvent, formatEvent, lineEvent, lockEvent, notesSentEvent, picksEvent, repliesEvent, scriptEvent, takeEvent, variantEvent, visualEvent, } from "../core/logEvents.js";
33
+ import { broughtInEvent, cutEvent, fileEvent, filmEvent, formatEvent, lineEvent, lockEvent, notesSentEvent, picksEvent, repliesEvent, scriptEvent, takeEvent, variantEvent, variantFilmsEvent, 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.3";
36
+ export const VERSION = "0.8.0";
37
37
  async function body(c, schema) {
38
38
  let json;
39
39
  try {
@@ -135,11 +135,13 @@ 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
+ // One film or several: a bed is often fitted to more than one.
139
+ video: z.union([z.string().min(1).max(200), z.array(z.string().min(1).max(200)).min(1).max(100)]).optional(),
139
140
  // §23.6: a cue's file has no length cap here. The 1024 limit applies to the stored (manifest) form,
140
141
  // which checkCueFile enforces with a 400 naming the cue.
141
142
  cues: z.array(z.object({ name: z.string().min(1), t, file: z.string().min(1).optional() })).optional(),
142
143
  });
144
+ const VariantFilmsBody = z.object({ videos: z.array(z.string().min(1).max(200)).max(100) });
143
145
  const ScriptBody = z.object({
144
146
  wordsPerSecond: z.number().positive().optional(),
145
147
  replace: z.boolean().optional(),
@@ -1132,16 +1134,32 @@ export function createApp(store, opts = {}) {
1132
1134
  const cues = b.cues?.map((q) => (q.file === undefined ? q : { ...q, file: toManifestPath(store.root, q.file) }));
1133
1135
  const { result } = await store.update("project", (p) => {
1134
1136
  const added = addVariant(p, { ...b, cues, file: toManifestPath(store.root, b.file) });
1135
- // With several films in play, a variant with no film shows on all of them: say so, so the agent names one.
1136
- const films = p.videos.filter(inPlay).length;
1137
- const warning = added.variant.video === undefined && films > 1
1138
- ? `No film was named, and none could be told from the names, so this ${added.lane.stage === "voice" ? "read" : added.lane.stage === "music" ? "bed" : "pass"} shows on all ${films} films. Pass \`video\` (the film's id or name) to put it on one.`
1137
+ // With more than one film, a variant on no film is listed on none of their tabs: say so, so the agent names one.
1138
+ const warning = variantFilms(added.variant).length === 0 && p.videos.length > 1
1139
+ ? `No film was named, and none could be told from the names, so this ${added.lane.stage === "voice" ? "read" : added.lane.stage === "music" ? "bed" : "pass"} is on no film: it waits, folded, under "Not on this film" on each film's tab. Pass \`video\` (a film's id or name, or a list of them) to put it on films.`
1139
1140
  : undefined;
1140
1141
  return { ...added, ...(warning ? { warning } : {}) };
1141
1142
  });
1142
1143
  await log.add(() => variantEvent(result.lane, result.variant), by(c));
1143
1144
  return c.json(result, 201);
1144
1145
  });
1146
+ // Put a read, bed or pass on exactly these films. A film it leaves drops its pick of it.
1147
+ app.put("/api/variants/:lane/:variant/films", async (c) => {
1148
+ const b = await body(c, VariantFilmsBody);
1149
+ const { result, data } = await store.update("project", (p) => setVariantFilms(p, c.req.param("lane"), c.req.param("variant"), b.videos));
1150
+ if (result.left.length > 0) {
1151
+ await store.update("picks", (k) => {
1152
+ for (const film of result.left) {
1153
+ const own = k.videos[film];
1154
+ if (own?.lanes[result.lane.id] === result.variant.id)
1155
+ delete own.lanes[result.lane.id];
1156
+ }
1157
+ });
1158
+ }
1159
+ const names = variantFilms(result.variant).map((id) => data.videos.find((v) => v.id === id)?.name ?? id);
1160
+ await log.add(() => variantFilmsEvent(result.lane, result.variant, names), by(c));
1161
+ return c.json({ lane: result.lane, variant: result.variant });
1162
+ });
1145
1163
  // ---- script ----
1146
1164
  app.get("/api/script", async (c) => c.json({ script: await store.read("script") }));
1147
1165
  app.put("/api/script", async (c) => {
@@ -1235,7 +1253,7 @@ export function createApp(store, opts = {}) {
1235
1253
  const [project, picks] = await Promise.all([store.read("project"), store.read("picks")]);
1236
1254
  const run = opts.loudnessRunner ?? defaultRunner;
1237
1255
  // A film hears only its own reads, beds and passes, as its Mix tab plays them.
1238
- const heard = { ...project, lanes: lanesForVideo(project.lanes, b.video) };
1256
+ const heard = { ...project, lanes: lanesForVideo(project.lanes, b.video, project.videos.length) };
1239
1257
  const result = await measureMix(heard, picksForVideo(picks, b.video), b.lanes, store.root, run, opts.loudnessTimeoutMs);
1240
1258
  return c.json(result);
1241
1259
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rushes",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "A local review desk for video made with AI agents: timecoded notes, script edits and audio picks your agent can read and act on.",
5
5
  "keywords": [
6
6
  "video",
@@ -61,7 +61,7 @@ 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, 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;
64
+ - `rushes_add_variant` for each voice read, music bed or SFX pass, with `video` set to the film it is for, or a list of films when one bed is fitted to several (only those films' tabs list it; with more than one film, one without `video` is on no film until it is put on one, and `rushes_set_films` moves an existing one). 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
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.
@@ -80,4 +80,4 @@ When asked to open or review work in Rushes, call `rushes_open`, then tell the u
80
80
 
81
81
  No project to show yet? Run `npx -y rushes demo <folder> --no-browser`, then `rushes_open` with `project: "<folder>"`. The demo builds a complete working example on the user's machine, with a cut, script, voice reads, music and notes already in place. Always pass `--no-browser`: without it the command stays running as the server and never returns.
82
82
 
83
- Rushes has twenty-three tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor` (environment and project health check) — `rushes_add_take` stays only for compatibility and isn't used for voiceover. The full contract is in `AGENTS.md` at the package root.
83
+ Rushes has twenty-four tools: `rushes_open`, `rushes_status`, `rushes_add_version`, `rushes_add_format`, `rushes_add_visual`, `rushes_add_variant`, `rushes_set_films`, `rushes_set_script`, `rushes_get_script`, `rushes_add_take`, `rushes_list_notes`, `rushes_list_assets`, `rushes_get_batch`, `rushes_reply`, `rushes_get_picks`, `rushes_set_shots`, `rushes_lock_picture`, `rushes_add_file`, `rushes_export_notes`, `rushes_log`, `rushes_get_log`, `rushes_scan`, `rushes_bring_in` and `rushes_doctor` (environment and project health check) — `rushes_add_take` stays only for compatibility and isn't used for voiceover. The full contract is in `AGENTS.md` at the package root.