rushes 0.2.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.
Files changed (77) hide show
  1. package/.claude-plugin/marketplace.json +14 -0
  2. package/.claude-plugin/plugin.json +10 -0
  3. package/.mcp.json +8 -0
  4. package/AGENTS.md +110 -0
  5. package/LICENSE +21 -0
  6. package/README.md +204 -0
  7. package/dist/cli/demo.js +339 -0
  8. package/dist/cli/doctor.js +307 -0
  9. package/dist/cli/index.js +11 -0
  10. package/dist/cli/main.js +469 -0
  11. package/dist/core/batches.js +58 -0
  12. package/dist/core/errors.js +37 -0
  13. package/dist/core/exportNotes.js +132 -0
  14. package/dist/core/ids.js +42 -0
  15. package/dist/core/media.js +128 -0
  16. package/dist/core/notes.js +117 -0
  17. package/dist/core/paths.js +17 -0
  18. package/dist/core/project.js +200 -0
  19. package/dist/core/schema.js +220 -0
  20. package/dist/core/script.js +113 -0
  21. package/dist/core/store.js +132 -0
  22. package/dist/core/tabs.js +24 -0
  23. package/dist/mcp/client.js +50 -0
  24. package/dist/mcp/ensure.js +69 -0
  25. package/dist/mcp/stdio.js +47 -0
  26. package/dist/mcp/tools.js +191 -0
  27. package/dist/server/app.js +710 -0
  28. package/dist/server/assets.js +234 -0
  29. package/dist/server/files.js +170 -0
  30. package/dist/server/lock.js +148 -0
  31. package/dist/server/loudness.js +331 -0
  32. package/dist/server/proxy.js +575 -0
  33. package/dist/server/reveal.js +71 -0
  34. package/dist/server/start.js +125 -0
  35. package/dist/server/watch.js +133 -0
  36. package/dist/setup/env.js +42 -0
  37. package/dist/setup/harnesses.js +93 -0
  38. package/dist/setup/setup.js +92 -0
  39. package/package.json +54 -0
  40. package/skills/rushes/SKILL.md +30 -0
  41. package/web-dist/assets/figtree-latin-400-normal-BD4aNku5.woff +0 -0
  42. package/web-dist/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  43. package/web-dist/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  44. package/web-dist/assets/figtree-latin-500-normal-B_yy1phn.woff +0 -0
  45. package/web-dist/assets/figtree-latin-600-normal-BM_oTo4n.woff +0 -0
  46. package/web-dist/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  47. package/web-dist/assets/figtree-latin-700-normal-BCCt2T1q.woff +0 -0
  48. package/web-dist/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  49. package/web-dist/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
  50. package/web-dist/assets/figtree-latin-ext-400-normal-Gbh-3PTk.woff +0 -0
  51. package/web-dist/assets/figtree-latin-ext-500-normal-BOEJvrb_.woff +0 -0
  52. package/web-dist/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
  53. package/web-dist/assets/figtree-latin-ext-600-normal-CQqsimlV.woff +0 -0
  54. package/web-dist/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
  55. package/web-dist/assets/figtree-latin-ext-700-normal-BoDi4KL2.woff +0 -0
  56. package/web-dist/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
  57. package/web-dist/assets/index-BjDIT_wL.css +1 -0
  58. package/web-dist/assets/index-DF6Rl-Ac.js +3 -0
  59. package/web-dist/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  60. package/web-dist/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  61. package/web-dist/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
  62. package/web-dist/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  63. package/web-dist/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  64. package/web-dist/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  65. package/web-dist/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
  66. package/web-dist/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  67. package/web-dist/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  68. package/web-dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  69. package/web-dist/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  70. package/web-dist/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  71. package/web-dist/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  72. package/web-dist/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  73. package/web-dist/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  74. package/web-dist/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
  75. package/web-dist/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  76. package/web-dist/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
  77. package/web-dist/index.html +14 -0
@@ -0,0 +1,191 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { ApiError, dashboardUrlFor } from "./client.js";
4
+ import { VERSION } from "../server/app.js";
5
+ const project = z.string().optional().describe("Project folder. Defaults to the current working directory.");
6
+ const stage = z.enum(["script", "picture", "voice", "music", "sfx", "mix"]);
7
+ const fileKind = z.enum(["doc", "image", "caption", "export", "delivery", "edit"]);
8
+ const assetKind = z.enum(["screenshot", "cut", "proxy", "take", "music", "sfx", "voice", "doc", "image", "caption", "export", "delivery", "edit"]);
9
+ function ok(data) {
10
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
11
+ }
12
+ function fail(e) {
13
+ const message = e instanceof ApiError ? `${e.message} (${e.body.error ?? e.status})` : e.message;
14
+ return { content: [{ type: "text", text: message }], isError: true };
15
+ }
16
+ /** Wrap a handler so API errors come back as tool errors the agent can read. */
17
+ function safe(fn) {
18
+ return async (args) => {
19
+ try {
20
+ return ok(await fn(args));
21
+ }
22
+ catch (e) {
23
+ return fail(e);
24
+ }
25
+ };
26
+ }
27
+ export function createMcpServer(ctx) {
28
+ const server = new McpServer({ name: "rushes", version: VERSION });
29
+ server.registerTool("rushes_open", {
30
+ title: "Open Rushes",
31
+ description: "Start the Rushes review desk for a project (if it isn't running) and open it in the browser. Returns the URL.",
32
+ inputSchema: { project, browser: z.boolean().optional().describe("Open the browser. Default true.") },
33
+ }, safe(async ({ project, browser }) => {
34
+ const c = await ctx.client(project);
35
+ const url = await dashboardUrlFor(c.baseUrl);
36
+ if (browser !== false)
37
+ ctx.openBrowser(url);
38
+ return { url };
39
+ }));
40
+ server.registerTool("rushes_set_shots", {
41
+ title: "Set shots",
42
+ description: "Set the storyboard shot list for a cut. Shots are numbered by start time; a new cut copies the previous cut's shots until you send new ones.",
43
+ inputSchema: {
44
+ project,
45
+ video: z.string().describe("Video id or name, e.g. \"Hero 60s\"."),
46
+ version: z.string().optional().describe("Defaults to the latest cut."),
47
+ shots: z.array(z.object({
48
+ name: z.string().describe("Shot name, e.g. \"Logo reveal\"."),
49
+ start: z.number().nonnegative().describe("Start time in seconds."),
50
+ tag: z.string().optional(),
51
+ })),
52
+ },
53
+ }, safe(async ({ project, video, ...b }) => (await ctx.client(project)).put(`/api/videos/${encodeURIComponent(video)}/shots`, b)));
54
+ server.registerTool("rushes_lock_picture", {
55
+ title: "Lock picture",
56
+ description: "Lock a video's picture at a version (the dashboard then opens on it, and audio review plays against it), or unlock with version null.",
57
+ inputSchema: {
58
+ project,
59
+ video: z.string().describe("Video id or name, e.g. \"Hero 60s\"."),
60
+ version: z.string().nullable().describe("Version id to lock at, or null to unlock."),
61
+ },
62
+ }, safe(async ({ project, video, version }) => (await ctx.client(project)).put(`/api/videos/${encodeURIComponent(video)}/lock`, { version })));
63
+ server.registerTool("rushes_status", {
64
+ title: "Rushes status",
65
+ description: "Which tabs are unlocked and how many open items each has.",
66
+ inputSchema: { project },
67
+ }, safe(async ({ project }) => (await ctx.client(project)).get("/api/tabs")));
68
+ server.registerTool("rushes_add_version", {
69
+ title: "Add a cut",
70
+ 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.",
71
+ inputSchema: {
72
+ project,
73
+ video: z.string().describe("Video id or name, e.g. \"Hero 60s\"."),
74
+ file: z.string().describe("Path to the rendered file, absolute or relative to the project."),
75
+ note: z.string().optional().describe("What changed in this cut."),
76
+ },
77
+ }, safe(async ({ project, ...b }) => (await ctx.client(project)).post("/api/versions", b)));
78
+ server.registerTool("rushes_add_variant", {
79
+ title: "Add an audio variant",
80
+ description: "Add a voice read (in a round), music bed or SFX pass for side-by-side review. Returns its lane and variant ids: a note on it is `on` \"<lane id>/<variant id>\".",
81
+ inputSchema: {
82
+ project,
83
+ stage: z.enum(["voice", "music", "sfx"]),
84
+ name: z.string().describe("Shown on the lane, e.g. \"Deep house\"."),
85
+ file: z.string(),
86
+ lane: z.string().optional().describe("Lane id. Defaults to `round` slugged, else the stage. Wins over `round`: give a lane only to add to an existing lane by its id."),
87
+ round: z
88
+ .string()
89
+ .min(1)
90
+ .max(64)
91
+ .optional()
92
+ .describe('Round name for voice reads (up to 64 characters), e.g. "Round 2 · Gerald, tone". Reads in one round are compared side by side; a new direction gets a new round.'),
93
+ meta: z.record(z.string(), z.union([z.string(), z.number()])).optional().describe("e.g. {\"bpm\": 120, \"key\": \"A minor\"}"),
94
+ description: z
95
+ .string()
96
+ .min(1)
97
+ .max(200)
98
+ .optional()
99
+ .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."),
100
+ cues: z.array(z.object({ name: z.string(), t: z.number().nonnegative() })).optional().describe("SFX cues with times in seconds."),
101
+ },
102
+ }, safe(async ({ project, ...b }) => (await ctx.client(project)).post("/api/variants", b)));
103
+ server.registerTool("rushes_set_script", {
104
+ title: "Set the VO script",
105
+ 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.",
106
+ inputSchema: {
107
+ project,
108
+ sections: z.array(z.object({ id: z.string().min(1).optional(), start: z.number().nonnegative(), end: z.number().nonnegative(), current: z.string() })),
109
+ wordsPerSecond: z.number().positive().optional(),
110
+ replace: z.boolean().optional().describe("replace the whole script; default merges by id"),
111
+ },
112
+ }, safe(async ({ project, ...b }) => (await ctx.client(project)).put("/api/script", b)));
113
+ server.registerTool("rushes_get_script", {
114
+ title: "Get the VO script",
115
+ description: "The whole script: every section with its current line, the user's proposed line, direction, status and takes, plus wordsPerSecond.",
116
+ inputSchema: { project },
117
+ }, safe(async ({ project }) => (await ctx.client(project)).get("/api/script")));
118
+ server.registerTool("rushes_add_take", {
119
+ title: "Add a VO take",
120
+ description: "Compatibility only: attaches a file to a script section as a take, but the Voiceover tab and the mix ignore takes. For voiceover, register each whole read with rushes_add_variant (stage \"voice\", round).",
121
+ inputSchema: { project, section: z.string(), file: z.string() },
122
+ }, safe(async ({ project, section, file }) => (await ctx.client(project)).post(`/api/script/${encodeURIComponent(section)}/takes`, { file })));
123
+ server.registerTool("rushes_list_notes", {
124
+ title: "List notes",
125
+ 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.",
126
+ inputSchema: {
127
+ project,
128
+ stage: stage.optional(),
129
+ status: z.enum(["todo", "done"]).optional(),
130
+ batch: z.string().optional(),
131
+ version: z.string().optional(),
132
+ },
133
+ }, safe(async ({ project, ...f }) => {
134
+ const q = new URLSearchParams(Object.entries(f).filter(([, v]) => v !== undefined));
135
+ return (await ctx.client(project)).get(`/api/notes${q.size ? `?${q}` : ""}`);
136
+ }));
137
+ server.registerTool("rushes_get_batch", {
138
+ title: "Get a batch",
139
+ description: "The batch the user sent with Send to agent (latest by default), with its notes and script sections. A note's `on` says what it's about: null on Picture or for the whole mix, \"<lane>/<variant>\" for a music bed, SFX pass or voice variant, \"<lane>/<variant>:<cue>\" for an SFX cue, \"vo\" for the VO lane on Mix. Older notes may carry a bare variant id, \"vo\" for the assembled read, \"<section>:<take>\" for a take, or a section id.",
140
+ inputSchema: { project, id: z.string().optional() },
141
+ }, safe(async ({ project, id }) => (await ctx.client(project)).get(`/api/batches/${encodeURIComponent(id ?? "latest")}`)));
142
+ server.registerTool("rushes_reply", {
143
+ title: "Reply to notes",
144
+ description: "Reply to one or more notes. Set status \"done\" when fixed, fixT to the time the fix is visible in the new cut, and fixVersion to that cut.",
145
+ inputSchema: {
146
+ project,
147
+ replies: z
148
+ .array(z.object({
149
+ id: z.string(),
150
+ reply: z.string().optional(),
151
+ status: z.enum(["todo", "done"]).optional(),
152
+ fixT: z.number().nonnegative().optional(),
153
+ fixVersion: z.string().optional(),
154
+ }))
155
+ .min(1),
156
+ },
157
+ }, safe(async ({ project, replies }) => (await ctx.client(project)).post("/api/replies", { replies })));
158
+ server.registerTool("rushes_list_assets", {
159
+ title: "List assets",
160
+ description: "Every file in the project: cuts, voice reads, older VO takes, music, SFX and screenshots, with absolute paths. Use it to find a screenshot the user grabbed.",
161
+ inputSchema: { project, kind: assetKind.optional() },
162
+ }, safe(async ({ project, kind }) => (await ctx.client(project)).get(`/api/assets${kind ? `?kind=${encodeURIComponent(kind)}` : ""}`)));
163
+ server.registerTool("rushes_get_picks", {
164
+ title: "Get picks",
165
+ description: "Which variant is in use per audio lane (per round on Voiceover), and each Mix lane's level in dB (where the user wants voice, music and sfx to sit). Section take picks are kept for older projects but not used.",
166
+ inputSchema: { project },
167
+ }, safe(async ({ project }) => (await ctx.client(project)).get("/api/picks")));
168
+ server.registerTool("rushes_add_file", {
169
+ title: "Add a file to the library",
170
+ description: "Register a project file (a doc, image, caption, export, delivery or edit file) in the Assets library, so it's listed, can be revealed, downloaded and opened. Docs, text and PDFs at the project root, captions at the root, and anything in exports/ are found automatically; other files need this.",
171
+ inputSchema: {
172
+ project,
173
+ kind: fileKind,
174
+ file: z.string().describe("Path to the file, absolute or relative to the project."),
175
+ name: z.string().optional().describe("Shown in the library. Defaults to the file's name."),
176
+ note: z.string().optional(),
177
+ video: z.string().optional().describe("Video id or name this file belongs to, e.g. a delivery or export for a specific film."),
178
+ },
179
+ }, safe(async ({ project, ...b }) => (await ctx.client(project)).post("/api/files", b)));
180
+ server.registerTool("rushes_export_notes", {
181
+ title: "Export notes",
182
+ description: "Write every note to exports/<project-slug>-notes-<date>.md, grouped by stage and, for Picture, by film and version. Exporting again the same day overwrites it. Returns the path.",
183
+ inputSchema: { project },
184
+ }, safe(async ({ project }) => (await ctx.client(project)).post("/api/exports/notes", {})));
185
+ server.registerTool("rushes_doctor", {
186
+ title: "Rushes doctor",
187
+ description: "Health check (§19.3): Node version, ffmpeg/ffprobe on PATH, which agent harnesses have the Rushes MCP server registered, and this project's files, server and disk space. Read-only -- doesn't start a server or change anything.",
188
+ inputSchema: { project },
189
+ }, safe(async ({ project }) => ctx.doctor(project)));
190
+ return server;
191
+ }