rushes 0.6.3 → 0.7.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.6.3",
4
+ "version": "0.7.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
@@ -103,6 +103,10 @@ The user drags to mark a region on the picture, clicks for a point, or adds a no
103
103
 
104
104
  To answer feedback, change the marked pictures and register the result as a new version of the same visual: call `rushes_add_visual` with `visual` (its id or name) and `pages` listing only the pages that changed or are new, each with its `n`; every other page, and any ratio of a listed page you leave out, carries over from the version before. Pages can be added at the end and never removed. Then `rushes_reply` to each note you fixed with `status: "done"`, a one-line `reply` and `fixVersion` set to that version, as on every other tab. A note you did not fix stays `todo`, with the reason in `reply`. The user can open a note again with the tick. Rushes keeps each note on the version it was made on, and shows it as "from v1" beside the newer one.
105
105
 
106
+ ## Shelved films
107
+
108
+ The user can shelve a film they have set aside (the **Film actions** menu in the dashboard). `rushes_status` returns `films`, each with `shelved`: the time it was shelved, or null. A shelved film is the user's decision: leave it alone, make no new cuts of it and fix none of its notes unless the user asks. Its open notes are not counted in the tabs or sent in batches, and `rushes_list_notes` leaves them out. A new cut of a shelved film brings it back (the reply has `restored: true`), so make one only when the user wants that film worked on again. You never shelve or restore a film: that is the user's to do.
109
+
106
110
  ## The loop
107
111
 
108
112
  1. **Register what you made.**
package/README.md CHANGED
@@ -111,6 +111,12 @@ The **Visuals** tab (key `7`) is for the stills, standalone images and carousels
111
111
 
112
112
  **Drag** on the picture to mark a region, click to drop a point, or press **Whole image** for a note about all of it. The composer always says where the note will go ("Adding to: Launch carousel · page 3 · 4:5 · v2"), and a draft stays with the visual you began it on. Notes belong to a page, a ratio and a version, never to where you have scrolled, so every mark is still there when you come back. The notes column lists the whole tab, grouped by visual and page, with the visual you are looking at highlighted and the rest faded; click a note to jump to it. When your agent registers a new version, your old notes stay with the version they were made on ("from v1"), marked until you tick them done.
113
113
 
114
+ ### Shelve a film
115
+
116
+ A film that went nowhere can be set aside without losing it. Open the **⋯** button beside the Change Log ("Film actions · Hero") and choose **Shelve film**, or press **Shift+S**. The film leaves the bar, a toast offers **Undo**, and its open notes stop counting: they leave the Send to agent count, the tab to-do counts, batches and Export notes, and they come back when you restore the film. Nothing is deleted: its cuts, notes, picks and files stay as they were.
117
+
118
+ Pills only switch films. When the films still in play do not fit the bar, the rest fold into a **+N** list (the film you are on is always shown). **Shelved (N)** at the end of the bar lists the shelved films: choose one to look at it, view-only, under a "Shelved" banner, and **Restore** it from the list or the banner. A new cut from your agent also brings a shelved film back. Your agent can see which films are shelved, but never shelves or restores one.
119
+
114
120
  ### Sound effects: layers by sound
115
121
 
116
122
  <img src="docs/assets/screens/sound-effects.jpg" alt="The Sound effects tab with one pass open into its layers. There is one row per sound (tick, thud, blip, chime, whoosh, counter, thump, snap), each with a count and a mark wherever it plays." width="880">
@@ -264,7 +270,8 @@ In the Voiceover, Music, Sound effects and Mix tabs:
264
270
  Anywhere:
265
271
 
266
272
  - **1–8** switch tab (1: Planning, which opens the page you used last; 7: Visuals; 8: Assets)
267
- - **[ / ]** previous/next film
273
+ - **[ / ]** previous/next film in play
274
+ - **Shift+S** shelve the current film, or restore it if it is shelved
268
275
  - **Alt+←/→** previous/next format (Picture)
269
276
  - **?** shortcuts
270
277
  - **Esc** close
package/dist/cli/main.js CHANGED
@@ -47,7 +47,7 @@ Usage
47
47
  register a doc, image, caption, export, delivery or edit file
48
48
  rushes lock <video> <version> lock the picture at a cut
49
49
  rushes unlock <video> unlock the picture
50
- rushes notes [--stage S] [--status todo|done] [--batch ID] [--json]
50
+ rushes notes [--stage S] [--status todo|done] [--batch ID] [--include-shelved] [--json]
51
51
  rushes reply <note-id> <text> [--done] [--fix-t SECONDS] [--fix-version V]
52
52
  rushes assets [--kind K] [--json] cuts, takes, variants, screenshots and library files
53
53
  rushes scan [--film NAME] [--json] look through the folder for the files that go with the cut; also brings in the current set
@@ -85,6 +85,7 @@ const OPTIONS = {
85
85
  area: { type: "string" },
86
86
  md: { type: "boolean" },
87
87
  json: { type: "boolean" },
88
+ "include-shelved": { type: "boolean" },
88
89
  done: { type: "boolean" },
89
90
  "fix-t": { type: "string" },
90
91
  "fix-version": { type: "string" },
@@ -339,7 +340,7 @@ export async function main(argv, io) {
339
340
  return 0;
340
341
  case "status": {
341
342
  const root = rest[0] ? resolve(io.cwd, rest[0]) : dir;
342
- const { tabs, brief, storyboard, build } = await (await ensureServer(root, io.ensure)).get("/api/tabs");
343
+ const { tabs, brief, storyboard, build, films } = await (await ensureServer(root, io.ensure)).get("/api/tabs");
343
344
  // The second column starts in the same place on every line: as wide as the longest label shown.
344
345
  const w = storyboard?.exists ? "storyboard".length : 8;
345
346
  for (const t of tabs) {
@@ -353,6 +354,10 @@ export async function main(argv, io) {
353
354
  io.out(`${"storyboard".padEnd(w)} ${storyboard.approved} of ${storyboard.shots} approved${storyboard.changed ? `, ${storyboard.changed} changed` : ""}`);
354
355
  if (build?.started)
355
356
  io.out(`${"build".padEnd(w)} ${build.ready ? "ready" : `waiting on ${build.waitingOn.join(", ")}`}`);
357
+ // §26: the films the user has set aside, so an agent leaves them alone. Nothing is printed when none are.
358
+ const shelved = (films ?? []).filter((f) => f.shelved).map((f) => f.name);
359
+ if (shelved.length)
360
+ io.out(`${"shelved".padEnd(w)} ${shelved.join(", ")}`);
356
361
  return 0;
357
362
  }
358
363
  case "doctor": {
@@ -380,7 +385,7 @@ export async function main(argv, io) {
380
385
  return 2;
381
386
  }
382
387
  const r = await (await client()).post("/api/versions", { video: o.video, file: resolve(io.cwd, a), note: o.note, label: o.label });
383
- io.out(`Added ${r.video.name} ${r.version.id}`);
388
+ io.out(`Added ${r.video.name} ${r.version.id}${r.restored ? " (it was shelved: restored)" : ""}`);
384
389
  // A Rushes started by an older version ignores `label` and its reply has none.
385
390
  if (o.label?.trim() && r.version.label === undefined)
386
391
  io.err("An older Rushes is running and dropped the label: the cut was added without it. Run `rushes stop`, then open again.");
@@ -465,6 +470,8 @@ export async function main(argv, io) {
465
470
  for (const k of ["stage", "status", "batch"])
466
471
  if (o[k])
467
472
  q.set(k, o[k]);
473
+ if (o["include-shelved"])
474
+ q.set("includeShelved", "true");
468
475
  const c = await client();
469
476
  const { notes } = await c.get(`/api/notes${q.size ? `?${q}` : ""}`);
470
477
  if (o.json)
@@ -1,5 +1,6 @@
1
1
  import { chipOrder, versionFormats } from "./formats.js";
2
2
  import { EmptyBatchError } from "./errors.js";
3
+ import { noteInPlay } from "./project.js";
3
4
  import { isChanged } from "./script.js";
4
5
  const STAGE_NAMES = {
5
6
  script: "script",
@@ -15,7 +16,8 @@ const STAGE_NAMES = {
15
16
  * batch yet, and (on the script tab) changed or flagged sections.
16
17
  */
17
18
  export function createBatch(ctx, stage, now = new Date()) {
18
- const notes = ctx.notes.notes.filter((n) => n.stage === stage && n.status === "todo" && n.batch === null);
19
+ // §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));
19
21
  const sections = stage === "script" ? ctx.script.sections.filter((s) => isChanged(s) || s.status === "flagged") : [];
20
22
  if (notes.length === 0 && sections.length === 0)
21
23
  throw new EmptyBatchError(stage);
@@ -1,6 +1,7 @@
1
1
  import { formatTag } from "./formats.js";
2
2
  import { slugify } from "./ids.js";
3
3
  import { onLabel } from "./notes.js";
4
+ import { noteInPlay } from "./project.js";
4
5
  import { markLabel } from "./schema.js";
5
6
  import { labelOfId } from "./formats.js";
6
7
  import { pinWords, regionWords } from "./visuals.js";
@@ -93,6 +94,8 @@ function byTimecode(a, b) {
93
94
  */
94
95
  export function notesMarkdown(project, notes, now, script = { sections: [] }, picks, visuals) {
95
96
  const ctx = { project, script, picks };
97
+ // §26: a shelved film has no section; its notes are kept in the project and come back when it is restored.
98
+ notes = notes.filter((n) => noteInPlay(n, project));
96
99
  const lines = [`# ${project.name} — notes`, `Exported ${localDateTime(now)}`];
97
100
  for (const stage of STAGE_ORDER) {
98
101
  const stageNotes = notes.filter((n) => n.stage === stage);
@@ -142,6 +142,11 @@ export function lockEvent(films, video) {
142
142
  const text = video.lockedVersion ? `Picture locked at ${cutName(films, video, video.lockedVersion)}` : `Picture unlocked${films > 1 && film ? ` for ${film}` : ""}`;
143
143
  return { area: "picture", kind: "lock", merge: "replace", subject: video.id, text, video: video.id, version: video.lockedVersion };
144
144
  }
145
+ /** §26: "Film “Key” shelved", "Film “Key” restored". One line per change; the last state wins, as a lock does. */
146
+ export function filmEvent(video, shelved) {
147
+ const text = ["Film", quoted(video.name, ""), shelved ? "shelved" : "restored"].filter(Boolean).join(" ");
148
+ return { area: "picture", kind: "film", merge: "replace", subject: video.id, text, video: video.id, version: null };
149
+ }
145
150
  /** "3 notes sent from Picture"; on Script, "1 note and 2 script edits sent from Script". */
146
151
  export function notesSentEvent(batch) {
147
152
  const tab = TAB_NAMES[batch.stage];
@@ -3,7 +3,7 @@
3
3
  // (test/core/logText.test.ts checks it).
4
4
  import { oneLine, oneLineOf } from "./labels.js";
5
5
  export const LOG_AREAS = ["script", "picture", "voice", "music", "sfx", "mix", "visuals", "notes", "assets", "project"];
6
- export const LOG_KINDS = ["cut", "variant", "take", "script", "picks", "notes-sent", "replies", "lock", "files", "entry", "format", "visual"];
6
+ export const LOG_KINDS = ["cut", "variant", "take", "script", "picks", "notes-sent", "replies", "lock", "files", "entry", "format", "visual", "film"];
7
7
  export const LOG_BY = ["user", "agent", "rushes"];
8
8
  /** The most lines log.json keeps; past it the oldest go (§22.3). */
9
9
  export const LOG_MAX = 5000;
@@ -33,9 +33,37 @@ export function ensureProjectIdOnce(store) {
33
33
  }
34
34
  return p;
35
35
  }
36
+ /** §26: a film is in play unless it has been shelved. */
37
+ export const inPlay = (video) => !video.shelved;
38
+ /** §26: a note is in play unless it is on a shelved film. A note on no film, or on a film that is gone, always is. */
39
+ export function noteInPlay(note, project) {
40
+ if (!note.video)
41
+ return true;
42
+ const film = project.videos.find((v) => v.id === note.video);
43
+ return !film || inPlay(film);
44
+ }
45
+ /**
46
+ * §26: shelves a film (keeping the time it was first shelved), or restores it by removing the mark. Nothing else about the
47
+ * film changes: its cuts, notes, picks, takes and lock stay as they were. The same call twice is the same as once.
48
+ */
49
+ export function shelveFilm(p, videoRef, shelved, now = new Date()) {
50
+ const video = resolveVideo(p, videoRef);
51
+ if (shelved) {
52
+ if (!video.shelved)
53
+ video.shelved = now.toISOString();
54
+ }
55
+ else {
56
+ delete video.shelved;
57
+ }
58
+ return video;
59
+ }
60
+ /** `restored` is true when the cut brought a shelved film back (§26): new work means the film is in play again. */
36
61
  export function addVersion(p, input, now = new Date()) {
37
62
  const vid = slugify(input.video);
38
63
  let video = p.videos.find((v) => v.id === input.video || v.id === vid);
64
+ const restored = !!video?.shelved;
65
+ if (video)
66
+ delete video.shelved;
39
67
  if (!video) {
40
68
  video = { id: uniqueId(vid, p.videos.map((v) => v.id)), name: input.video, versions: [], lockedVersion: null };
41
69
  p.videos.push(video);
@@ -62,7 +90,7 @@ export function addVersion(p, input, now = new Date()) {
62
90
  formats: [],
63
91
  };
64
92
  video.versions.push(version);
65
- return { video, version };
93
+ return { video, version, restored };
66
94
  }
67
95
  export function latestVersion(video) {
68
96
  return video.versions[video.versions.length - 1];
@@ -84,6 +84,8 @@ export const VideoSchema = fileObject({
84
84
  name: z.string().min(1),
85
85
  versions: z.array(VersionSchema).default([]),
86
86
  lockedVersion: z.string().nullable().default(null),
87
+ // §26: the time a film was shelved. Absent (or null) means it is in play; restoring removes the key.
88
+ shelved: z.string().max(40).nullable().optional(),
87
89
  });
88
90
  export const CueSchema = fileObject({
89
91
  id,
package/dist/core/tabs.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { STAGES } from "./schema.js";
2
+ import { noteInPlay } from "./project.js";
2
3
  import { isChanged } from "./script.js";
3
4
  function laneHasVariants(p, stage) {
4
5
  return p.lanes.some((l) => l.stage === stage && l.variants.length > 0);
@@ -19,7 +20,8 @@ export function tabStates(p, s, n, v = { visuals: [] }) {
19
20
  visuals: v.visuals.length > 0,
20
21
  };
21
22
  return STAGES.map((stage) => {
22
- const notes = n.notes.filter((x) => x.stage === stage && x.status === "todo").length;
23
+ // §26: a shelved film's open notes are kept but do not count.
24
+ const notes = n.notes.filter((x) => x.stage === stage && x.status === "todo" && noteInPlay(x, p)).length;
23
25
  const rows = stage === "script" ? s.sections.filter((x) => isChanged(x) || x.status === "flagged").length : 0;
24
26
  return { stage, unlocked: unlocked[stage], todo: notes + rows };
25
27
  });
package/dist/mcp/tools.js CHANGED
@@ -114,7 +114,7 @@ export function createMcpServer(ctx) {
114
114
  }));
115
115
  server.registerTool("rushes_bring_in", {
116
116
  title: "Bring files in",
117
- description: "Registers files from inside the project folder: voice reads, music and sfx as unpicked variants, video as cuts, md, txt and pdf as docs. Nothing is picked. Returns what was added and, for each file that couldn't come in, why (a path outside the project folder is refused). Up to 60 files, 12 of a kind.",
117
+ description: "Registers files from inside the project folder: voice reads, music and sfx as unpicked variants, video as cuts, md, txt and pdf as docs. Nothing is picked. Returns what was added and, for each file that couldn't come in, why (a path outside the project folder is refused). Up to 60 files, 12 of a kind. A cut with no `film` joins a film in play, never one the user shelved; naming a shelved film (or having only shelved films) brings it back, and the reply lists it in `restored`.",
118
118
  inputSchema: {
119
119
  project,
120
120
  files: z.array(bringInItem).min(1).max(BRING_IN_MAX).describe("Each: path (absolute or relative to the project), kind when the name doesn't say, round for a voice read."),
@@ -146,12 +146,12 @@ export function createMcpServer(ctx) {
146
146
  }, safe(async ({ project, video, version }) => (await ctx.client(project)).put(`/api/videos/${encodeURIComponent(video)}/lock`, { version })));
147
147
  server.registerTool("rushes_status", {
148
148
  title: "Rushes status",
149
- description: "Which tabs are unlocked and how many open items each has. Also `brief`: whether brief.md exists, its status (draft or approved, set when the user presses Approve) and how many sections the user changed; `storyboard`: whether storyboard.md exists, how many shots there are, how many are approved and how many the user changed; and `build`: whether planning has begun (`started`), whether the brief, every script section (when there is a script) and every shot are approved (`ready`), and what it is `waitingOn`.",
149
+ description: "Which tabs are unlocked and how many open items each has. Also `brief`: whether brief.md exists, its status (draft or approved, set when the user presses Approve) and how many sections the user changed; `storyboard`: whether storyboard.md exists, how many shots there are, how many are approved and how many the user changed; and `build`: whether planning has begun (`started`), whether the brief, every script section (when there is a script) and every shot are approved (`ready`), and what it is `waitingOn`. Also `films`: every film with `shelved` (the time the user shelved it, or null). A shelved film is one the user has set aside: leave it alone, make no new cuts of it and fix none of its notes unless the user says to. Its open notes are not counted in the tabs.",
150
150
  inputSchema: { project },
151
151
  }, safe(async ({ project }) => (await ctx.client(project)).get("/api/tabs")));
152
152
  server.registerTool("rushes_add_version", {
153
153
  title: "Add a cut",
154
- description: "Register a new cut of a video. The first cut creates the video. Returns the new version id (v1, v2 ...). When the cut is likely to play badly in a browser (4K, over 1.5 GB, or a codec such as ProRes), it also returns proxySuggested: true and proxyReason; Picture offers the user a proxy. If the project has autoProxy on, proxyJob is the proxy already being made. Give every cut a short `label` (" + LABEL_MAX + " characters at most) saying what changed, e.g. \"launch 1.45x slower\", and put the detail in `note`: the version list shows the label. Pass `formats` to register the other shapes of the same cut in one call; the reply then carries `formatWarnings` (a list, one entry for each shape more than 0.1 s off the cut's length; `warning` here means Picture is locked). When the plan (brief, script, storyboard) has been started but is not all approved, it carries `planWarning` saying what is outstanding: a nudge, never a refusal. A film's first cut also starts with the storyboard's shots.",
154
+ description: "Register a new cut of a video. The first cut creates the video. Returns the new version id (v1, v2 ...). When the cut is likely to play badly in a browser (4K, over 1.5 GB, or a codec such as ProRes), it also returns proxySuggested: true and proxyReason; Picture offers the user a proxy. If the project has autoProxy on, proxyJob is the proxy already being made. Give every cut a short `label` (" + LABEL_MAX + " characters at most) saying what changed, e.g. \"launch 1.45x slower\", and put the detail in `note`: the version list shows the label. Pass `formats` to register the other shapes of the same cut in one call; the reply then carries `formatWarnings` (a list, one entry for each shape more than 0.1 s off the cut's length; `warning` here means Picture is locked). When the plan (brief, script, storyboard) has been started but is not all approved, it carries `planWarning` saying what is outstanding: a nudge, never a refusal. A film's first cut also starts with the storyboard's shots. A cut of a shelved film brings it back (the reply has `restored: true`), so make one only when the user wants that film worked on again.",
155
155
  inputSchema: {
156
156
  project,
157
157
  video: z.string().describe("Video id or name, e.g. \"Hero 60s\"."),
@@ -284,7 +284,7 @@ export function createMcpServer(ctx) {
284
284
  }, safe(async ({ project, section, file }) => (await ctx.client(project)).post(`/api/script/${encodeURIComponent(section)}/takes`, { file })));
285
285
  server.registerTool("rushes_list_notes", {
286
286
  title: "List notes",
287
- description: "Notes left in Rushes, filtered by tab, status, batch or version. 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. On Picture, a note's `format` is null when it's for every format, or a format id such as \"9x16\" when it's for that shape only.",
287
+ description: "Notes left in Rushes, filtered by tab, status, batch or version. 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. On Picture, a note's `format` is null when it's for every format, or a format id such as \"9x16\" when it's for that shape only. Notes on a shelved film (one the user has set aside) are left out.",
288
288
  inputSchema: {
289
289
  project,
290
290
  stage: stage.optional(),
@@ -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, lockPicture, resolveCut, resolveVideo, setShots, shotAt } from "../core/project.js";
5
+ import { addFile, addFormat, addVariant, addVersion, ensureProjectIdOnce, lockPicture, noteInPlay, resolveCut, resolveVideo, setShots, 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";
@@ -30,10 +30,10 @@ 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, 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, 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.6.3";
36
+ export const VERSION = "0.7.0";
37
37
  async function body(c, schema) {
38
38
  let json;
39
39
  try {
@@ -178,6 +178,8 @@ const NoteQuery = z.object({
178
178
  // §21.4: a format's notes, with the all-format notes unless onlyThisFormat (R14: Picture only).
179
179
  format: formatId.optional(),
180
180
  onlyThisFormat: z.enum(["true", "false"]).optional(),
181
+ // §26: the notes of a shelved film are left out unless asked for (or a batch is: it lists what it sent).
182
+ includeShelved: z.enum(["true", "false"]).optional(),
181
183
  });
182
184
  // ShotSchema's own limits (name trimmed 1-80 chars, tag at most 24) apply at the boundary; `n` is server-assigned.
183
185
  const ShotsBody = z.object({
@@ -185,6 +187,7 @@ const ShotsBody = z.object({
185
187
  shots: z.array(ShotSchema.omit({ n: true })).max(200),
186
188
  });
187
189
  const LockBody = z.object({ version: z.string().nullable() });
190
+ const ShelveBody = z.object({ shelved: z.boolean() });
188
191
  const MixLoudnessBody = z.object({ lanes: z.array(LaneStageSchema).min(1) });
189
192
  const SettingsBody = z.object({ autoProxy: z.boolean() }).strict();
190
193
  // A time in seconds, 0 to 24 h: an empty value, NaN, Infinity or anything huge is a 400.
@@ -692,6 +695,8 @@ export function createApp(store, opts = {}) {
692
695
  let skipKinds = kinds;
693
696
  if (b.include?.length) {
694
697
  const included = await found.bringIn(b.include, { film: b.film, origin: "include" });
698
+ for (const f of included.restored ?? [])
699
+ await log.add(() => filmEvent(f, false), by(c));
695
700
  if (included.added.length)
696
701
  await log.add(() => broughtInEvent(included.added, null), by(c));
697
702
  // An included cut becomes the cut the scoring is matched to, and a project with no cut
@@ -737,6 +742,8 @@ export function createApp(store, opts = {}) {
737
742
  app.post("/api/found/bring-in", async (c) => {
738
743
  const b = await body(c, FoundBringInBody);
739
744
  const r = await found.bringIn(b.files, { film: b.film });
745
+ for (const f of r.restored ?? [])
746
+ await log.add(() => filmEvent(f, false), by(c));
740
747
  if (r.added.length)
741
748
  await log.add(() => broughtInEvent(r.added, null), by(c));
742
749
  return c.json(r);
@@ -756,6 +763,8 @@ export function createApp(store, opts = {}) {
756
763
  const [b, sb] = await Promise.all([brief.view(), storyboard.view()]);
757
764
  return c.json({
758
765
  tabs: tabStates(project, script, notes, visuals),
766
+ // §26: every film and whether it is shelved, so an agent leaves the shelved ones alone.
767
+ films: project.videos.map((v) => ({ id: v.id, name: v.name, shelved: v.shelved ?? null })),
759
768
  brief: { exists: b.exists, status: b.status, changed: b.changed },
760
769
  storyboard: { exists: sb.exists, shots: sb.total, approved: sb.approved, changed: sb.changed },
761
770
  build: buildState({ brief: b, script: script.sections, storyboard: sb }),
@@ -786,8 +795,9 @@ export function createApp(store, opts = {}) {
786
795
  const q = NoteQuery.safeParse(c.req.query());
787
796
  if (!q.success)
788
797
  throw new InvalidError("Query is invalid", q.error.issues);
789
- const [{ notes }, visuals] = await Promise.all([store.read("notes"), store.read("visuals")]);
790
- return c.json({ notes: withVisualViews(filterNotes(notes, { ...q.data, onlyThisFormat: q.data.onlyThisFormat === "true" }), visuals) });
798
+ const [{ notes }, visuals, project] = await Promise.all([store.read("notes"), store.read("visuals"), store.read("project")]);
799
+ const listed = filterNotes(notes, { ...q.data, onlyThisFormat: q.data.onlyThisFormat === "true" }).filter((n) => q.data.includeShelved === "true" || q.data.batch !== undefined || noteInPlay(n, project));
800
+ return c.json({ notes: withVisualViews(listed, visuals) });
791
801
  });
792
802
  app.post("/api/notes", async (c) => {
793
803
  const b = await body(c, NewNoteBody);
@@ -875,6 +885,7 @@ export function createApp(store, opts = {}) {
875
885
  let lockedVersion = null;
876
886
  let autoProxy = false;
877
887
  let films = 1;
888
+ let restored = false;
878
889
  const { result } = await store.update("project", (p) => {
879
890
  const out = addVersion(p, {
880
891
  video: b.video, file, note: b.note, label: b.label, duration: info.duration ?? read?.duration ?? null, fps: info.fps ?? read?.fps ?? null,
@@ -904,6 +915,7 @@ export function createApp(store, opts = {}) {
904
915
  setShots(p, out.video.id, out.version.id, reachable);
905
916
  }
906
917
  lockedVersion = out.video.lockedVersion;
918
+ restored = out.restored;
907
919
  autoProxy = p.autoProxy;
908
920
  films = p.videos.length;
909
921
  if (info.fps && p.videos.length === 1 && p.videos[0].versions.length === 1)
@@ -912,6 +924,9 @@ export function createApp(store, opts = {}) {
912
924
  });
913
925
  // One write, one line (R4): a cut that comes with its other shapes says so on its own line
914
926
  // ("v2 and its 9:16 added: …"), rather than a line per shape.
927
+ // §26: a cut on a shelved film brings it back; the Change Log says so, then says what was added.
928
+ if (restored)
929
+ await log.add(() => filmEvent(result.video, false), by(c));
915
930
  await log.add(() => cutEvent(films, result.video, result.version, result.version.formats.map((f) => f.label)), by(c));
916
931
  // §19.5: say when the cut is likely to play badly, and start its proxy straight away when the
917
932
  // project asks for that. Without ffmpeg, nothing is offered (needFor is null).
@@ -928,9 +943,10 @@ export function createApp(store, opts = {}) {
928
943
  // §24.12: a soft nudge, never a refusal: the plan (brief, script, storyboard) is not all approved yet.
929
944
  const planNote = planWarning(await planBuild());
930
945
  const warnings = { ...(formatWarnings.length ? { formatWarnings } : {}), ...(planNote ? { planWarning: planNote } : {}) };
946
+ const reply = { video: result.video, version: result.version, ...(restored ? { restored: true } : {}) };
931
947
  if (lockedVersion)
932
- return c.json({ ...result, ...proxy, ...warnings, warning: `Picture is locked at ${lockedVersion}` }, 201);
933
- return c.json({ ...result, ...proxy, ...warnings }, 201);
948
+ return c.json({ ...reply, ...proxy, ...warnings, warning: `Picture is locked at ${lockedVersion}` }, 201);
949
+ return c.json({ ...reply, ...proxy, ...warnings }, 201);
934
950
  });
935
951
  // ---- formats (§21.4) ----
936
952
  app.post("/api/formats", async (c) => {
@@ -1096,6 +1112,18 @@ export function createApp(store, opts = {}) {
1096
1112
  await log.add(() => lockEvent(films, result), by(c));
1097
1113
  return c.json({ video: result });
1098
1114
  });
1115
+ // §26: shelve a film, or restore it. The same call twice is the same as once, and only a change is logged.
1116
+ app.put("/api/videos/:video/shelve", async (c) => {
1117
+ const b = await body(c, ShelveBody);
1118
+ let before = false;
1119
+ const { result } = await store.update("project", (p) => {
1120
+ before = !!resolveVideo(p, c.req.param("video")).shelved;
1121
+ return shelveFilm(p, c.req.param("video"), b.shelved);
1122
+ });
1123
+ if (!!result.shelved !== before)
1124
+ await log.add(() => filmEvent(result, b.shelved), by(c));
1125
+ return c.json({ video: result });
1126
+ });
1099
1127
  app.post("/api/variants", async (c) => {
1100
1128
  const b = await body(c, VariantBody);
1101
1129
  // §23: a cue's file is stored as a manifest path, like the variant's own.
@@ -6,10 +6,10 @@ import { InvalidError, RevConflictError, RushesError } from "../core/errors.js";
6
6
  import { slugify } from "../core/ids.js";
7
7
  import { AUDIO_FORMATS, probe as ffprobe } from "../core/media.js";
8
8
  import { fromManifestPath, toManifestPath } from "../core/paths.js";
9
- import { addFile, addVariant, addVersion, resolveVideo } from "../core/project.js";
9
+ import { addFile, addVariant, addVersion, inPlay, resolveVideo } from "../core/project.js";
10
10
  import { cueFiles } from "../core/cues.js";
11
11
  import { logBookFor } from "./logbook.js";
12
- import { broughtInEvent, cutName } from "../core/logEvents.js";
12
+ import { broughtInEvent, cutName, filmEvent } from "../core/logEvents.js";
13
13
  /** The audio kinds, which an include can settle. */
14
14
  const AUDIO_KINDS = new Set(["voice", "music", "sfx"]);
15
15
  /** The most cuts' settled kinds found.json keeps (the newest). */
@@ -156,7 +156,8 @@ function addedTime(v) {
156
156
  }
157
157
  /**
158
158
  * §20.4's cut: the named film's newest version when it has one, otherwise the newest registered
159
- * cut of any film (latest `addedAt`; on a tie, the later one in the project).
159
+ * cut of any film (latest `addedAt`; on a tie, the later one in the project). §26: a shelved film is
160
+ * passed over while any film is in play, so a file nobody named a film for never restores one.
160
161
  */
161
162
  export function anchorCut(p, film) {
162
163
  if (film !== undefined) {
@@ -171,7 +172,8 @@ export function anchorCut(p, film) {
171
172
  }
172
173
  }
173
174
  let best = null;
174
- for (const video of p.videos) {
175
+ const candidates = p.videos.some(inPlay) ? p.videos.filter(inPlay) : p.videos;
176
+ for (const video of candidates) {
175
177
  for (const version of video.versions) {
176
178
  if (!best || addedTime(version) >= addedTime(best.version))
177
179
  best = { video, version };
@@ -566,6 +568,8 @@ export class FoundScanner {
566
568
  // §22.5: what the current set brought in is one line, by Rushes (R8, R9); its variants are dated (R5).
567
569
  // Built inside add's guard, so a line that can't be made never undoes the bring-in (M1).
568
570
  const cut = anchor;
571
+ for (const f of result.restored ?? [])
572
+ await logBookFor(this.store).add(() => filmEvent(f, false), "rushes");
569
573
  if (result.added.length)
570
574
  await logBookFor(this.store).add(() => broughtInEvent(result.added, cut ? cutName(films, cut.video, cut.version.id) : null), "rushes");
571
575
  return result;
@@ -738,7 +742,7 @@ export class FoundScanner {
738
742
  this.current.delete(a.path);
739
743
  }
740
744
  this.announce();
741
- return { added: result.ok, failed: [...failed, ...result.refused] };
745
+ return { added: result.ok, failed: [...failed, ...result.refused], ...(result.restored.length ? { restored: result.restored } : {}) };
742
746
  }
743
747
  catch (e) {
744
748
  if (e instanceof NothingAdded)
@@ -753,6 +757,7 @@ export class FoundScanner {
753
757
  /** Registers the plan in the project draft, in order. The cap counts only what goes in. */
754
758
  applyPlan(p, plan, film) {
755
759
  const ok = [];
760
+ const restored = [];
756
761
  const refused = [];
757
762
  const perKind = new Map();
758
763
  for (const it of plan) {
@@ -760,7 +765,7 @@ export class FoundScanner {
760
765
  refused.push(refusal(it.item.path, R.cap));
761
766
  continue;
762
767
  }
763
- const out = this.register(p, it, film);
768
+ const out = this.register(p, it, film, restored);
764
769
  if ("reason" in out) {
765
770
  refused.push(refusal(it.item.path, out.reason));
766
771
  continue;
@@ -768,10 +773,10 @@ export class FoundScanner {
768
773
  ok.push(out);
769
774
  perKind.set(it.kind, (perKind.get(it.kind) ?? 0) + 1);
770
775
  }
771
- return { ok, refused };
776
+ return { ok, refused, restored };
772
777
  }
773
778
  /** Registers one planned item in the project draft, or says why it can't, changing nothing. */
774
- register(p, it, film) {
779
+ register(p, it, film, restored) {
775
780
  const stem = basename(it.rel, extname(it.rel));
776
781
  const name = fitName(stem);
777
782
  switch (it.kind) {
@@ -793,7 +798,10 @@ export class FoundScanner {
793
798
  }
794
799
  case "cut": {
795
800
  const duration = this.durations.get(revKey(it)) ?? null;
796
- const { video, version } = addVersion(p, { video: filmFor(p, film) ?? (film ? fitName(film) : name), file: it.rel, duration });
801
+ const out = addVersion(p, { video: filmFor(p, film) ?? (film ? fitName(film) : name), file: it.rel, duration });
802
+ const { video, version } = out;
803
+ if (out.restored)
804
+ restored.push({ id: video.id, name: video.name });
797
805
  return { path: it.rel, kind: it.kind, video: video.id, version: version.id };
798
806
  }
799
807
  case "doc":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rushes",
3
- "version": "0.6.3",
3
+ "version": "0.7.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",
@@ -51,6 +51,10 @@ When a user starts briefing in the chat, offer to keep `brief.md` up to date as
51
51
 
52
52
  For stills, standalone images and carousels, register one visual per post with `rushes_add_visual`: a `name` and `pages`, each page with its pictures, one per aspect ratio, in every aspect ratio the post comes in (Rushes reads each ratio from the picture). The user marks a region, a point or the whole image in the Visuals tab and sends a batch; each note names its visual, version, page, ratio, where on the picture it is (`words`) and the `file` to open. A note with no ratio is for every ratio. Fix the pictures, register a new version with `rushes_add_visual` (`visual` and only the pages that changed, each with `n`), then `rushes_reply` to each note you fixed with `status: "done"` and `fixVersion` set to it (a note you did not fix stays `todo`, with the reason in `reply`). The full contract is in `AGENTS.md`.
53
53
 
54
+ ## Shelved films
55
+
56
+ `rushes_status` returns `films`, each with `shelved` (the time the user shelved it, or null). A shelved film is one the user has set aside: leave it alone, make no new cuts of it and fix none of its notes unless they ask. A new cut of a shelved film brings it back (`restored: true` in the reply), so make one only when they want that film worked on again. You never shelve or restore a film.
57
+
54
58
  ## Reviewing and fixing
55
59
 
56
60
  1. Register what you made: