rushes 0.5.2 → 0.6.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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +9 -1
- package/README.md +10 -4
- package/dist/core/batches.js +7 -3
- package/dist/core/exportNotes.js +35 -2
- package/dist/core/imageSize.js +62 -0
- package/dist/core/logEvents.js +17 -1
- package/dist/core/logText.js +3 -3
- package/dist/core/notes.js +1 -1
- package/dist/core/schema.js +49 -2
- package/dist/core/store.js +3 -1
- package/dist/core/tabs.js +3 -1
- package/dist/core/visualWords.js +31 -0
- package/dist/core/visuals.js +165 -0
- package/dist/mcp/tools.js +24 -1
- package/dist/server/app.js +57 -20
- package/dist/server/files.js +7 -1
- package/dist/server/links.js +20 -0
- package/dist/server/storyboard.js +3 -19
- package/dist/server/visuals.js +52 -0
- package/package.json +1 -1
- package/skills/rushes/SKILL.md +5 -1
- package/web-dist/assets/{index-DvA6CDxP.css → index-Cisbx2Ld.css} +1 -1
- package/web-dist/assets/index-CzNlYcI9.js +7 -0
- package/web-dist/index.html +2 -2
- package/web-dist/assets/index-g2XP_slY.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.
|
|
4
|
+
"version": "0.6.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
|
@@ -95,6 +95,14 @@ Every tab is visible from the start, in workflow order, even before it has anyth
|
|
|
95
95
|
|
|
96
96
|
> In Rushes project "Launch", make two or three music beds for "Hero" and add each with rushes_add_variant (stage "music") with a one-line description.
|
|
97
97
|
|
|
98
|
+
## Visuals: stills and carousels
|
|
99
|
+
|
|
100
|
+
When the user makes stills, standalone images or carousels (posts), register them so they can mark them up in the **Visuals** tab, the way they mark a cut in Picture. Call `rushes_add_visual` with one visual per post: a `name` and `pages`, each page with its pictures, one per aspect ratio it comes in (a png, jpg, webp or gif inside the project; Rushes reads each ratio from the picture's own size, so never name one). A still is a visual with one page; a carousel has many. Every page must come in the same ratios, and every page needs a picture in every aspect ratio.
|
|
101
|
+
|
|
102
|
+
The user drags to mark a region on the picture, clicks for a point, or adds a note for the whole image, and sends a batch. `rushes_get_batch` and `rushes_list_notes` return each Visuals note with a `visual` object: the visual's id and name, its `version`, the `page`, the `ratio` as a label (null when the note is for every ratio), the `shape` (`region`, `pin` or `image`), the `region` or `pin` as fractions of the picture, `words` saying where it is ("left third, top third"), and the `file` to open. A note with no ratio is for every ratio: say in your reply which ratios you fixed.
|
|
103
|
+
|
|
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 with `fixVersion` set to that version. You never mark a note done: the user does, 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
|
+
|
|
98
106
|
## The loop
|
|
99
107
|
|
|
100
108
|
1. **Register what you made.**
|
|
@@ -140,7 +148,7 @@ Rushes keeps a log of what happened in the project, written as it happens (`.rus
|
|
|
140
148
|
|
|
141
149
|
## Tools
|
|
142
150
|
|
|
143
|
-
The MCP server has twenty-
|
|
151
|
+
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.
|
|
144
152
|
|
|
145
153
|
## Rules
|
|
146
154
|
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ It runs on your machine. There's no account, no API key and no server to sign up
|
|
|
59
59
|
|
|
60
60
|
No project to hand? `npx -y rushes demo` builds an example on your machine and opens it.
|
|
61
61
|
|
|
62
|
-
> Status: early. The Script, Picture, Voiceover, Music, Sound effects and
|
|
62
|
+
> Status: early. The Script, Picture, Voiceover, Music, Sound effects, Mix and Visuals tabs, the MCP tools and the CLI all work today.
|
|
63
63
|
|
|
64
64
|
## How it works
|
|
65
65
|
|
|
@@ -105,6 +105,12 @@ Reads of the same script sit side by side in rounds. Switch between them with no
|
|
|
105
105
|
|
|
106
106
|
Switch beds instantly while the picture plays. Mark a range as **Rise**, **Fall**, **Louder** or **Quieter**, and your agent gets it as a note it can act on.
|
|
107
107
|
|
|
108
|
+
### Visuals: mark up stills and carousels
|
|
109
|
+
|
|
110
|
+
The **Visuals** tab (key `7`) is for the stills, standalone images and carousels your agent makes next to a video. Each is a visual: one post, in the aspect ratios it comes in, shown one page at a time in a large frame. The tab scrolls from one visual to the next, and whichever visual crosses the middle of the view is the current one: it gets the outline, and it is the only one you can add a note to. A carousel has Previous and Next, a count, **Full screen** (for looking closely; you mark in the tab) and a strip of its pages with the open notes on each.
|
|
111
|
+
|
|
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
|
+
|
|
108
114
|
### Sound effects: layers by sound
|
|
109
115
|
|
|
110
116
|
<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">
|
|
@@ -174,7 +180,7 @@ If your user asked you to use Rushes, do this:
|
|
|
174
180
|
2. If it added anything, tell the user to restart the app (or start a new session) so the `rushes_*` tools load.
|
|
175
181
|
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`.
|
|
176
182
|
|
|
177
|
-
The MCP server has twenty-
|
|
183
|
+
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`.
|
|
178
184
|
|
|
179
185
|
If you can't run commands, give the user the matching line from **Manual setup** below.
|
|
180
186
|
|
|
@@ -257,7 +263,7 @@ In the Voiceover, Music, Sound effects and Mix tabs:
|
|
|
257
263
|
|
|
258
264
|
Anywhere:
|
|
259
265
|
|
|
260
|
-
- **1–
|
|
266
|
+
- **1–8** switch tab (1: Planning, which opens the page you used last; 7: Visuals; 8: Assets)
|
|
261
267
|
- **[ / ]** previous/next film
|
|
262
268
|
- **Alt+←/→** previous/next format (Picture)
|
|
263
269
|
- **?** shortcuts
|
|
@@ -332,7 +338,7 @@ npx -y rushes bring-in <file>... [--kind voice|music|sfx|cut|doc] [--round NAME]
|
|
|
332
338
|
|
|
333
339
|
Press **G**, or the camera button, to grab the current frame. It's saved as a PNG to `screenshots/`, named for the film, version and timecode (and, on a cut with several formats, the ratio on screen) — grabbing the same frame twice overwrites the same file.
|
|
334
340
|
|
|
335
|
-
The **Assets** tab (key `
|
|
341
|
+
The **Assets** tab (key `8`) is a library with a folder sidebar: Screenshots, Cuts, Voiceover, Music, Sound effects, Scripts & docs, Images, Captions, Exports, Delivery, Edit files and Proxies. Each folder has search and a sort order; Screenshots, Images, Cuts and Delivery also get a grid/list toggle, and Screenshots, Cuts and Delivery get a film filter — every other folder is list-only. Audio plays inline, one at a time, and Markdown or text files get a read-only preview. Every item has five actions: Download, Save as (Chrome and Edge only — other browsers just get Download), Open, Show in Finder and Copy path. A file your agent registered from outside the project folder (or reached through a link out of it) plays and downloads only if it is a media or document type (audio, video, images, PDF, Markdown, text, captions), and a cut or a format only if it is video or audio; for anything else, such as an editor project file on another drive, use Show in Finder or Copy path. **Open** appears, and is accepted, only for a fixed list of safe, non-executable types — never scripts, apps or archives. Top-level `.md`, `.txt`, `.pdf`, `.srt` and `.vtt` files, plus anything in `exports/`, are picked up automatically; everything else your agent registers with `rushes_add_file`. The Exports folder also has an **Export notes** button, which writes every note to a dated Markdown file there.
|
|
336
342
|
|
|
337
343
|
Rushes recommends this layout for a project folder:
|
|
338
344
|
|
package/dist/core/batches.js
CHANGED
|
@@ -8,6 +8,7 @@ const STAGE_NAMES = {
|
|
|
8
8
|
music: "music",
|
|
9
9
|
sfx: "sound effects",
|
|
10
10
|
mix: "mix",
|
|
11
|
+
visuals: "visuals",
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Gather this tab's open, unsent items into a batch: to-do notes with no
|
|
@@ -80,9 +81,12 @@ export function buildPrompt(project, stage, batchId, notes, sections, extra = []
|
|
|
80
81
|
: stage === "mix"
|
|
81
82
|
? // §19.6: rushes_get_picks also carries each lane's level -- where the user wants it sitting.
|
|
82
83
|
'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. The picks\' levels say where the user wants each lane to sit.'
|
|
83
|
-
:
|
|
84
|
-
?
|
|
85
|
-
|
|
84
|
+
: stage === "visuals"
|
|
85
|
+
? // §25.5: the note's picture is named in the batch; the new picture goes in as a new version of the visual.
|
|
86
|
+
"Use rushes_get_batch: each note names its visual, version, page and aspect ratio, where on the picture it is (a region or a point, as fractions and in words) and the file to open. Change each marked picture, register the result as a new version with rushes_add_visual (send only the pages that changed), then rushes_reply to each note with fixVersion set to that version. A note with no ratio is for every ratio: say in your reply which ratios you fixed."
|
|
87
|
+
: AUDIO_STAGES.includes(stage)
|
|
88
|
+
? '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.'
|
|
89
|
+
: "Use rushes_get_batch, fix each note, then rushes_reply with a fixT for each and rushes_add_version for the new cut.";
|
|
86
90
|
return `Work through ${STAGE_NAMES[stage]} batch ${batchId} on ${project}: ${parts.join(" and ")}.\n${[...extra, steps].join("\n")}`;
|
|
87
91
|
}
|
|
88
92
|
export function latestBatch(file) {
|
package/dist/core/exportNotes.js
CHANGED
|
@@ -2,15 +2,18 @@ import { formatTag } from "./formats.js";
|
|
|
2
2
|
import { slugify } from "./ids.js";
|
|
3
3
|
import { onLabel } from "./notes.js";
|
|
4
4
|
import { markLabel } from "./schema.js";
|
|
5
|
+
import { labelOfId } from "./formats.js";
|
|
6
|
+
import { pinWords, regionWords } from "./visuals.js";
|
|
5
7
|
// Picture notes are grouped by film and version; the other stages list straight through.
|
|
6
8
|
// Script isn't included here -- script edits live in script.json, not notes.json.
|
|
7
|
-
const STAGE_ORDER = ["picture", "voice", "music", "sfx", "mix"];
|
|
9
|
+
const STAGE_ORDER = ["picture", "voice", "music", "sfx", "mix", "visuals"];
|
|
8
10
|
const STAGE_TITLES = {
|
|
9
11
|
picture: "Picture",
|
|
10
12
|
voice: "Voiceover",
|
|
11
13
|
music: "Music",
|
|
12
14
|
sfx: "Sound effects",
|
|
13
15
|
mix: "Mix",
|
|
16
|
+
visuals: "Visuals",
|
|
14
17
|
};
|
|
15
18
|
function pad(n) {
|
|
16
19
|
return String(n).padStart(2, "0");
|
|
@@ -60,6 +63,17 @@ function noteLines(n, ctx, videos) {
|
|
|
60
63
|
lines.push(` - Screenshot: ${n.grab}`);
|
|
61
64
|
return lines;
|
|
62
65
|
}
|
|
66
|
+
/** §25.5: "**Page 2** · 4:5 · region (left third, top third) · to do — text". An image has no time; the page leads. */
|
|
67
|
+
function visualNoteLines(n) {
|
|
68
|
+
const page = n.on?.slice(n.on.lastIndexOf("/") + 1) ?? "?";
|
|
69
|
+
const ratio = n.format === null ? "all ratios" : labelOfId(n.format);
|
|
70
|
+
const shape = n.box ? `region (${regionWords(n.box)})` : n.pin ? `point (${pinWords(n.pin)})` : "whole image";
|
|
71
|
+
const lines = [`- **Page ${page}** · ${ratio} · ${shape} · ${n.status === "done" ? "done" : "to do"} — ${continued(n.text, " ")}`];
|
|
72
|
+
if (n.reply)
|
|
73
|
+
lines.push(` - Reply: ${continued(n.reply, " ")}`);
|
|
74
|
+
return lines;
|
|
75
|
+
}
|
|
76
|
+
const pageOf = (n) => Number(n.on?.slice(n.on.lastIndexOf("/") + 1)) || 0;
|
|
63
77
|
// By timecode within a film and version, a whole-track note (t === null) last -- notes were
|
|
64
78
|
// otherwise listed in whatever order they happened to be created in, which usually isn't where
|
|
65
79
|
// they land on the timeline.
|
|
@@ -77,7 +91,7 @@ function byTimecode(a, b) {
|
|
|
77
91
|
* "S2 · Take 1"), resolved against `script` and `picks` as the dashboard resolves it. Nothing is
|
|
78
92
|
* escaped (this is a file, not HTML), and the same input always produces the same string.
|
|
79
93
|
*/
|
|
80
|
-
export function notesMarkdown(project, notes, now, script = { sections: [] }, picks) {
|
|
94
|
+
export function notesMarkdown(project, notes, now, script = { sections: [] }, picks, visuals) {
|
|
81
95
|
const ctx = { project, script, picks };
|
|
82
96
|
const lines = [`# ${project.name} — notes`, `Exported ${localDateTime(now)}`];
|
|
83
97
|
for (const stage of STAGE_ORDER) {
|
|
@@ -123,6 +137,25 @@ export function notesMarkdown(project, notes, now, script = { sections: [] }, pi
|
|
|
123
137
|
lines.push(...noteLines(n, ctx, project.videos));
|
|
124
138
|
}
|
|
125
139
|
}
|
|
140
|
+
else if (stage === "visuals") {
|
|
141
|
+
// §25.5: grouped by visual and version, in page order; a visual that is gone keeps its notes, under (removed).
|
|
142
|
+
const groups = new Map();
|
|
143
|
+
const visualOf = (n) => n.on?.slice(0, n.on.lastIndexOf("/")) ?? "";
|
|
144
|
+
for (const n of stageNotes) {
|
|
145
|
+
const id = visualOf(n);
|
|
146
|
+
const found = visuals?.visuals.find((v) => v.id === id);
|
|
147
|
+
const exists = found?.versions.some((v) => v.id === n.version) ?? false;
|
|
148
|
+
const label = `${found?.name ?? id} · ${n.version ?? "no version"}${exists ? "" : " (removed)"}`;
|
|
149
|
+
const g = groups.get(label) ?? { label, notes: [] };
|
|
150
|
+
g.notes.push(n);
|
|
151
|
+
groups.set(label, g);
|
|
152
|
+
}
|
|
153
|
+
for (const g of groups.values()) {
|
|
154
|
+
lines.push("", `### ${g.label}`);
|
|
155
|
+
for (const n of [...g.notes].sort((a, b) => pageOf(a) - pageOf(b)))
|
|
156
|
+
lines.push(...visualNoteLines(n));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
126
159
|
else {
|
|
127
160
|
for (const n of stageNotes)
|
|
128
161
|
lines.push(...noteLines(n, ctx, project.videos));
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// §25.3: the size of a picture, read from the start of its file. Pure: it is given the bytes, so it needs no ffmpeg and
|
|
2
|
+
// no decoder, and it only has to be right about the four kinds of picture a browser shows inline in a post.
|
|
3
|
+
const ascii = (b, at, s) => b.length >= at + s.length && [...s].every((c, i) => b[at + i] === c.charCodeAt(0));
|
|
4
|
+
const u16be = (b, at) => (b[at] << 8) | b[at + 1];
|
|
5
|
+
const u16le = (b, at) => b[at] | (b[at + 1] << 8);
|
|
6
|
+
const u24le = (b, at) => b[at] | (b[at + 1] << 8) | (b[at + 2] << 16);
|
|
7
|
+
const u32be = (b, at) => ((b[at] << 24) | (b[at + 1] << 16) | (b[at + 2] << 8) | b[at + 3]) >>> 0;
|
|
8
|
+
function sized(width, height, type) {
|
|
9
|
+
return Number.isInteger(width) && Number.isInteger(height) && width > 0 && height > 0 ? { width, height, type } : null;
|
|
10
|
+
}
|
|
11
|
+
function png(b) {
|
|
12
|
+
// The 8-byte signature, then the IHDR chunk: length, "IHDR", width, height.
|
|
13
|
+
if (b.length < 24 || !ascii(b, 12, "IHDR"))
|
|
14
|
+
return null;
|
|
15
|
+
return sized(u32be(b, 16), u32be(b, 20), "png");
|
|
16
|
+
}
|
|
17
|
+
function gif(b) {
|
|
18
|
+
return b.length < 10 ? null : sized(u16le(b, 6), u16le(b, 8), "gif");
|
|
19
|
+
}
|
|
20
|
+
/** The start-of-frame markers, which carry the size: every one from C0 to CF except the three that are not frames. */
|
|
21
|
+
const isFrame = (m) => m >= 0xc0 && m <= 0xcf && m !== 0xc4 && m !== 0xc8 && m !== 0xcc;
|
|
22
|
+
function jpeg(b) {
|
|
23
|
+
let at = 2;
|
|
24
|
+
while (at + 4 <= b.length) {
|
|
25
|
+
if (b[at] !== 0xff)
|
|
26
|
+
return null;
|
|
27
|
+
const marker = b[at + 1];
|
|
28
|
+
if (marker === 0xff) {
|
|
29
|
+
at++;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (isFrame(marker))
|
|
33
|
+
return b.length >= at + 9 ? sized(u16be(b, at + 7), u16be(b, at + 5), "jpeg") : null;
|
|
34
|
+
at += 2 + u16be(b, at + 2);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function webp(b) {
|
|
39
|
+
if (ascii(b, 12, "VP8 "))
|
|
40
|
+
return b.length >= 30 && b[23] === 0x9d && b[24] === 0x01 && b[25] === 0x2a ? sized(u16le(b, 26) & 0x3fff, u16le(b, 28) & 0x3fff, "webp") : null;
|
|
41
|
+
if (ascii(b, 12, "VP8L")) {
|
|
42
|
+
if (b.length < 25 || b[20] !== 0x2f)
|
|
43
|
+
return null;
|
|
44
|
+
const bits = (b[21] | (b[22] << 8) | (b[23] << 16) | (b[24] << 24)) >>> 0;
|
|
45
|
+
return sized((bits & 0x3fff) + 1, ((bits >>> 14) & 0x3fff) + 1, "webp");
|
|
46
|
+
}
|
|
47
|
+
if (ascii(b, 12, "VP8X"))
|
|
48
|
+
return b.length >= 30 ? sized(u24le(b, 24) + 1, u24le(b, 27) + 1, "webp") : null;
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
/** The size and type of a png, jpeg, gif or webp from its first bytes, or null for anything else or a file cut short. */
|
|
52
|
+
export function imageSize(bytes) {
|
|
53
|
+
if (bytes.length >= 8 && bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71)
|
|
54
|
+
return png(bytes);
|
|
55
|
+
if (ascii(bytes, 0, "GIF8"))
|
|
56
|
+
return gif(bytes);
|
|
57
|
+
if (bytes.length >= 4 && bytes[0] === 0xff && bytes[1] === 0xd8)
|
|
58
|
+
return jpeg(bytes);
|
|
59
|
+
if (ascii(bytes, 0, "RIFF") && ascii(bytes, 8, "WEBP"))
|
|
60
|
+
return webp(bytes);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
package/dist/core/logEvents.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { clip, oneLineOf, shortLabel } from "./labels.js";
|
|
4
4
|
import { PICKS_MERGE_MS } from "./logText.js";
|
|
5
5
|
/** The tabs' own names, as the dashboard shows them. */
|
|
6
|
-
export const TAB_NAMES = { script: "Script", picture: "Picture", voice: "Voiceover", music: "Music", sfx: "Sound effects", mix: "Mix" };
|
|
6
|
+
export const TAB_NAMES = { script: "Script", picture: "Picture", voice: "Voiceover", music: "Music", sfx: "Sound effects", mix: "Mix", visuals: "Visuals" };
|
|
7
7
|
/** How a lane's stage starts a line. It's also its default lane's name (project.ts LANE_NAMES), which "to <lane>" leaves out. */
|
|
8
8
|
export const STAGE_WORDS = { voice: "Voiceover", music: "Music", sfx: "Sound effects" };
|
|
9
9
|
/** §16.1's Assets folders, by the kind of file they hold (web/src/lib.ts FOLDERS; test/core/log.test.ts keeps them equal). */
|
|
@@ -33,6 +33,22 @@ export function cutName(films, video, versionId) {
|
|
|
33
33
|
function andList(items) {
|
|
34
34
|
return items.length <= 1 ? (items[0] ?? "") : `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* §25.5: "“Launch carousel” v2 added: shorter headline". Named by the visual, never by a note. Versions of one visual in a
|
|
38
|
+
* burst are one line, as cuts are.
|
|
39
|
+
*/
|
|
40
|
+
export function visualEvent(visual, version) {
|
|
41
|
+
const name = quoted(visual.name, "A visual");
|
|
42
|
+
// A version with no label of its own says only that it was added: its id is not a description.
|
|
43
|
+
const label = (version.label ?? "").trim() === "" ? "" : shortLabel(version);
|
|
44
|
+
const tail = label ? `: ${label}` : "";
|
|
45
|
+
return {
|
|
46
|
+
area: "visuals", kind: "visual", merge: "count", subject: visual.id,
|
|
47
|
+
text: `${name} ${version.id} added${tail}`,
|
|
48
|
+
ref: visual.id, version: version.id,
|
|
49
|
+
many: (n, subject) => `${n} versions added${subject ? ` to ${name}` : ""}, the latest ${version.id}${tail}`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
36
52
|
/** A format's ratio label as stored ("9:16", "2.39:1"): never a free text, so nothing else gets in. */
|
|
37
53
|
const RATIO_LABEL = /^\d+(\.\d+)?:\d+(\.\d+)?$/;
|
|
38
54
|
const ratioLabels = (labels = []) => labels.map((l) => oneLineOf(l)).filter((l) => RATIO_LABEL.test(l));
|
package/dist/core/logText.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Pure; its only import is labels.ts, which has none, because the dashboard bundles this file
|
|
3
3
|
// (test/core/logText.test.ts checks it).
|
|
4
4
|
import { oneLine, oneLineOf } from "./labels.js";
|
|
5
|
-
export const LOG_AREAS = ["script", "picture", "voice", "music", "sfx", "mix", "notes", "assets", "project"];
|
|
6
|
-
export const LOG_KINDS = ["cut", "variant", "take", "script", "picks", "notes-sent", "replies", "lock", "files", "entry", "format"];
|
|
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"];
|
|
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;
|
|
@@ -15,7 +15,7 @@ export const MERGE_MS = 2 * 60_000;
|
|
|
15
15
|
export const PICKS_MERGE_MS = 10 * 60_000;
|
|
16
16
|
/** The words for an area: the filter chips, the row tags, the Markdown and the CLI (the mockup's labels). */
|
|
17
17
|
export const AREA_LABELS = {
|
|
18
|
-
script: "Script", picture: "Picture", voice: "Voice", music: "Music", sfx: "Sound effects", mix: "Mix", notes: "Notes", assets: "Files", project: "Project",
|
|
18
|
+
script: "Script", picture: "Picture", voice: "Voice", music: "Music", sfx: "Sound effects", mix: "Mix", visuals: "Visuals", notes: "Notes", assets: "Files", project: "Project",
|
|
19
19
|
};
|
|
20
20
|
/** Who wrote a line, in the Markdown and the CLI. */
|
|
21
21
|
export const BY_WORDS = { user: "you", agent: "agent", rushes: "Rushes" };
|
package/dist/core/notes.js
CHANGED
|
@@ -41,7 +41,7 @@ export function applyReply(file, r) {
|
|
|
41
41
|
export function applyUserEdit(file, e, check) {
|
|
42
42
|
const n = find(file, e.id);
|
|
43
43
|
const next = { ...n };
|
|
44
|
-
for (const k of ["text", "box", "grab", "scope", "t", "tOut", "marks", "status", "format"]) {
|
|
44
|
+
for (const k of ["text", "box", "pin", "grab", "scope", "t", "tOut", "marks", "status", "format"]) {
|
|
45
45
|
if (e[k] !== undefined)
|
|
46
46
|
next[k] = e[k];
|
|
47
47
|
}
|
package/dist/core/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { FORMAT_ID_RE, isPictureSize, labelOfId, ratioId, ratioLabel } from "./formats.js";
|
|
2
|
+
import { FORMAT_ID_RE, MAX_FORMATS, isPictureSize, labelOfId, ratioId, ratioLabel } from "./formats.js";
|
|
3
3
|
import { oneLineOf } from "./labels.js";
|
|
4
4
|
import { LOG_AREAS, LOG_BY, LOG_KINDS, LOG_MAX, LOG_TEXT_MAX } from "./logText.js";
|
|
5
5
|
/**
|
|
@@ -12,7 +12,7 @@ import { LOG_AREAS, LOG_BY, LOG_KINDS, LOG_MAX, LOG_TEXT_MAX } from "./logText.j
|
|
|
12
12
|
function fileObject(shape) {
|
|
13
13
|
return z.looseObject(shape);
|
|
14
14
|
}
|
|
15
|
-
export const STAGES = ["script", "picture", "voice", "music", "sfx", "mix"];
|
|
15
|
+
export const STAGES = ["script", "picture", "voice", "music", "sfx", "mix", "visuals"];
|
|
16
16
|
export const StageSchema = z.enum(STAGES);
|
|
17
17
|
export const LaneStageSchema = z.enum(["voice", "music", "sfx"]);
|
|
18
18
|
const id = z.string().min(1).max(64);
|
|
@@ -163,6 +163,11 @@ export const BoxSchema = fileObject({
|
|
|
163
163
|
w: z.number().min(0).max(1),
|
|
164
164
|
h: z.number().min(0).max(1),
|
|
165
165
|
});
|
|
166
|
+
// §25.4: a point on an image, as fractions of it. Only a note on a visual has one.
|
|
167
|
+
export const PinSchema = fileObject({
|
|
168
|
+
x: z.number().min(0).max(1),
|
|
169
|
+
y: z.number().min(0).max(1),
|
|
170
|
+
});
|
|
166
171
|
// §14.5/§17.1: a range note on an audio tab can carry up to four quick marks. Louder/quieter
|
|
167
172
|
// need a dB amount (chosen from 1, 2, 3, 6 or 9 in the UI, 3 the default); rise/fall never carry
|
|
168
173
|
// one. Both rules, plus "no duplicate kinds" and "only on audio-ish stages", are enforced on the
|
|
@@ -199,6 +204,7 @@ export const NoteSchema = z
|
|
|
199
204
|
frame: z.number().int().nonnegative().nullable().default(null),
|
|
200
205
|
text: z.string().trim().min(1).max(4000),
|
|
201
206
|
box: BoxSchema.nullable().default(null),
|
|
207
|
+
pin: PinSchema.nullable().default(null),
|
|
202
208
|
grab: z.string().nullable().default(null),
|
|
203
209
|
shot: fileObject({ n: z.number().int().positive(), name: z.string() }).nullable().default(null),
|
|
204
210
|
marks: z.array(MarkSchema).max(4).default([]),
|
|
@@ -224,6 +230,13 @@ export const NoteSchema = z
|
|
|
224
230
|
}
|
|
225
231
|
if (n.scope === "whole" && (n.t !== null || n.tOut !== null))
|
|
226
232
|
ctx.addIssue({ code: "custom", path: ["scope"], message: "a whole-track note has no t or tOut" });
|
|
233
|
+
// §25.4: an image has no time, and a note on one is a region, a point or the whole image.
|
|
234
|
+
if (n.pin !== null && n.stage !== "visuals")
|
|
235
|
+
ctx.addIssue({ code: "custom", path: ["pin"], message: "a point on an image belongs to a note on a visual" });
|
|
236
|
+
if (n.pin !== null && n.box !== null)
|
|
237
|
+
ctx.addIssue({ code: "custom", path: ["pin"], message: "a note is a region or a point, not both" });
|
|
238
|
+
if (n.stage === "visuals" && n.scope !== "whole")
|
|
239
|
+
ctx.addIssue({ code: "custom", path: ["scope"], message: "a note on a visual has no time" });
|
|
227
240
|
if (n.marks.length > 0 && !MARK_STAGES.includes(n.stage)) {
|
|
228
241
|
ctx.addIssue({ code: "custom", path: ["marks"], message: `marks don't apply to the ${n.stage} stage` });
|
|
229
242
|
}
|
|
@@ -385,6 +398,38 @@ export const BriefStateSchema = fileObject({
|
|
|
385
398
|
baseline: z.string().max(1_000_000).default(""),
|
|
386
399
|
seen: z.string().max(64).default(""),
|
|
387
400
|
});
|
|
401
|
+
// §25.3: a visual is one post: a still, or a carousel of pages. A version holds every page it shows, the ones it
|
|
402
|
+
// inherited from the version before included, so nothing downstream has to work inheritance out.
|
|
403
|
+
export const VisualImageSchema = fileObject({
|
|
404
|
+
/** A format id such as "4x5": the shape of the picture, read from its size. */
|
|
405
|
+
ratio: z.string().max(16).regex(FORMAT_ID_RE),
|
|
406
|
+
file: z.string().min(1),
|
|
407
|
+
width: z.number().int().positive(),
|
|
408
|
+
height: z.number().int().positive(),
|
|
409
|
+
});
|
|
410
|
+
export const VisualPageSchema = fileObject({
|
|
411
|
+
n: z.number().int().positive(),
|
|
412
|
+
images: z.array(VisualImageSchema).min(1).max(MAX_FORMATS),
|
|
413
|
+
});
|
|
414
|
+
export const MAX_VISUAL_PAGES = 100;
|
|
415
|
+
export const VisualVersionSchema = fileObject({
|
|
416
|
+
id,
|
|
417
|
+
addedAt: z.string(),
|
|
418
|
+
label: z.string().default(""),
|
|
419
|
+
pages: z.array(VisualPageSchema).min(1).max(MAX_VISUAL_PAGES),
|
|
420
|
+
});
|
|
421
|
+
export const VisualSchema = fileObject({
|
|
422
|
+
id,
|
|
423
|
+
name: z.string().trim().min(1).max(80),
|
|
424
|
+
kind: z.enum(["still", "carousel"]),
|
|
425
|
+
addedAt: z.string(),
|
|
426
|
+
versions: z.array(VisualVersionSchema).min(1),
|
|
427
|
+
});
|
|
428
|
+
export const VisualsFileSchema = fileObject({
|
|
429
|
+
schema: z.literal(1),
|
|
430
|
+
rev: z.number().int().nonnegative(),
|
|
431
|
+
visuals: z.array(VisualSchema).default([]),
|
|
432
|
+
});
|
|
388
433
|
export const FILES = {
|
|
389
434
|
project: { name: "project.json", schema: ProjectSchema },
|
|
390
435
|
script: { name: "script.json", schema: ScriptSchema },
|
|
@@ -396,4 +441,6 @@ export const FILES = {
|
|
|
396
441
|
brief: { name: "brief.json", schema: BriefStateSchema },
|
|
397
442
|
// §24.12: the storyboard is kept the same way as the brief: its file, plus the agent's last text and the hash last seen.
|
|
398
443
|
storyboard: { name: "storyboard.json", schema: BriefStateSchema },
|
|
444
|
+
// §25.3: created by its first write, like the brief's.
|
|
445
|
+
visuals: { name: "visuals.json", schema: VisualsFileSchema },
|
|
399
446
|
};
|
package/dist/core/store.js
CHANGED
|
@@ -24,13 +24,15 @@ function defaults(key, name) {
|
|
|
24
24
|
case "brief":
|
|
25
25
|
case "storyboard":
|
|
26
26
|
return { schema: 1, rev: 0, baseline: "", seen: "" };
|
|
27
|
+
case "visuals":
|
|
28
|
+
return { schema: 1, rev: 0, visuals: [] };
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* Files `init` doesn't write (found.json, log.json, brief.json, storyboard.json). Each is created by its first write, and reads
|
|
31
33
|
* as its default until then, so a project made before the file existed needs nothing done to it.
|
|
32
34
|
*/
|
|
33
|
-
const CREATED_ON_WRITE = new Set(["found", "log", "brief", "storyboard"]);
|
|
35
|
+
const CREATED_ON_WRITE = new Set(["found", "log", "brief", "storyboard", "visuals"]);
|
|
34
36
|
/**
|
|
35
37
|
* The only writer of a project's .rushes folder. Every write is validated,
|
|
36
38
|
* serialised per file, written atomically (tmp + rename) and announced with
|
package/dist/core/tabs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isChanged } from "./script.js";
|
|
|
3
3
|
function laneHasVariants(p, stage) {
|
|
4
4
|
return p.lanes.some((l) => l.stage === stage && l.variants.length > 0);
|
|
5
5
|
}
|
|
6
|
-
export function tabStates(p, s, n) {
|
|
6
|
+
export function tabStates(p, s, n, v = { visuals: [] }) {
|
|
7
7
|
const picture = p.videos.some((v) => v.versions.length > 0);
|
|
8
8
|
const voice = laneHasVariants(p, "voice");
|
|
9
9
|
const music = laneHasVariants(p, "music");
|
|
@@ -15,6 +15,8 @@ export function tabStates(p, s, n) {
|
|
|
15
15
|
music,
|
|
16
16
|
sfx,
|
|
17
17
|
mix: picture && (voice || music || sfx),
|
|
18
|
+
// §25.7: Visuals unlocks when one is registered.
|
|
19
|
+
visuals: v.visuals.length > 0,
|
|
18
20
|
};
|
|
19
21
|
return STAGES.map((stage) => {
|
|
20
22
|
const notes = n.notes.filter((x) => x.stage === stage && x.status === "todo").length;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// §25.5: where a mark on a picture is, in words, for an agent that cannot see it and for the dashboard's tooltips. Pure, with no
|
|
2
|
+
// imports, because the dashboard bundles this file (test/core/visuals.test.ts checks it).
|
|
3
|
+
/** The thirds of an axis a span covers: those it overlaps by at least 40% of a third; if none, the one its middle is in. */
|
|
4
|
+
function covered(start, size) {
|
|
5
|
+
const t = [0, 1, 2].map((i) => Math.max(0, Math.min(start + size, (i + 1) / 3) - Math.max(start, i / 3)) * 3 >= 0.4);
|
|
6
|
+
if (t.some(Boolean))
|
|
7
|
+
return t;
|
|
8
|
+
const mid = Math.min(2, Math.max(0, Math.floor((start + size / 2) * 3)));
|
|
9
|
+
return [mid === 0, mid === 1, mid === 2];
|
|
10
|
+
}
|
|
11
|
+
const key = (t) => t.map((x) => (x ? "1" : "0")).join("");
|
|
12
|
+
const COLUMN = { "100": "left third", "010": "centre", "001": "right third", "110": "left two thirds", "011": "right two thirds", "111": "full width", "101": "full width" };
|
|
13
|
+
const ROW = { "100": "top third", "010": "middle", "001": "bottom third", "110": "top two thirds", "011": "bottom two thirds", "111": "full height", "101": "full height" };
|
|
14
|
+
/** "left third, top third", "the centre", "the whole picture": where a region is, for an agent that cannot see the mark. */
|
|
15
|
+
export function regionWords(box) {
|
|
16
|
+
const c = key(covered(box.x, box.w));
|
|
17
|
+
const r = key(covered(box.y, box.h));
|
|
18
|
+
if (c === "111" && r === "111")
|
|
19
|
+
return "the whole picture";
|
|
20
|
+
if (c === "010" && r === "010")
|
|
21
|
+
return "the centre";
|
|
22
|
+
return `${COLUMN[c]}, ${ROW[r]}`;
|
|
23
|
+
}
|
|
24
|
+
/** "left, bottom", "the centre": where a point is. */
|
|
25
|
+
export function pinWords(pin) {
|
|
26
|
+
const col = Math.min(2, Math.max(0, Math.floor(pin.x * 3)));
|
|
27
|
+
const row = Math.min(2, Math.max(0, Math.floor(pin.y * 3)));
|
|
28
|
+
if (col === 1 && row === 1)
|
|
29
|
+
return "the centre";
|
|
30
|
+
return `${["left", "centre", "right"][col]}, ${["top", "middle", "bottom"][row]}`;
|
|
31
|
+
}
|