@dawnwood/cli 0.8.2 → 0.12.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/README.md CHANGED
@@ -31,10 +31,15 @@ npx @dawnwood/cli whoami
31
31
  | Asset pack | `generate_pack`, `update_pack`, `commit_pack` |
32
32
  | Art and render | `art_estimate`, `generate_art`, `art_status`, `upload_character_ref` |
33
33
  | Covers | `covers_estimate`, `generate_covers`, `regen_cover`, `set_cover_theme` |
34
+ | Render mode | `set_render_mode` (native 720p, Seedance 2.5 480p + AI upscale after the paywall, or Draft: 480p previews you turn into a 1080p final) |
35
+ | Shot templates | `list_shot_templates`, `apply_shot_template` (bind a 4–15 s reference clip to a render group: the next render copies its choreography, timing and camera move; your cast and set stay), `import_shot_template_video` + `get_shot_template_import` (turn your own fight video into private templates) |
36
+ | Action Remake | `action_remake` + `action_remake_status` (your characters doing an exact fight move, no series needed; 6 cr per second counting the move and the result, first short clip free); whole runs of moves: `list_shot_template_sets` + `action_remake_sequence` (one cast across a set, charged once at the same per-second price) and `apply_shot_template_set` (bind a set onto consecutive storyboard groups) |
37
+ | Frame | `set_aspect` (9:16 vertical, default; or 16:9 landscape for YouTube long-form, subjects kept in the centre 9:16 safe area) |
34
38
  | Storyboard tools | `flashback_montage`, `reclone_voice`, `likeness_reroll`, `import_clip`, `job_status` |
35
39
  | Sign-off and delivery | `signoff_episode`, `build_delivery_pack` |
36
40
  | Account | `credits_balance`, `get_review_url` |
37
41
  | Review & rework | loaded at startup from the console agent: `render_status`, `update_shot`, `render_shot`, `rerender_group`, `retake_range`, `propose_fix`, `adopt_take`, … (spending tools need `user_message`) |
42
+ | Parallel universes | also loaded from the console agent: `list_universes`, `create_universe`, `universe_own_episode`, `set_universe_episodes`, `version_to_universe`, `set_current_universe`, `trim_group`, `insert_card`, `move_group_to_episode`, `pull_group` (universe episodes are written `U1·05`) |
38
43
  | Clips | `upload_video`, `upload_image`, `clips_create`, `clips_get_job`, `clips_edit_clip`, `clips_send_to_matrix`, `clips_list_jobs`, `clips_series_episodes`, `clips_retry` |
39
44
  | Drama Center | `dramacenter_check`, `dramacenter_get`, `dramacenter_update`, `dramacenter_package`, `dramacenter_delete`, `dramacenter_list` |
40
45
  | Matrix (posting) | `matrix_status`, `matrix_accounts`, `matrix_update_account`, `matrix_lanes`, `matrix_update_lane`, `matrix_media`, `matrix_add_media`, `matrix_update_media`, `matrix_plan_posts`, `matrix_schedule_posts`, `matrix_posts`, `matrix_cancel_post`, `matrix_comments`, `matrix_report` |
package/dist/mcp.js CHANGED
@@ -13,7 +13,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
13
13
  import { z } from "zod";
14
14
  import { apiCall } from "./api.js";
15
15
  import { CONSOLE_BASE_DEFAULT, getApiBase } from "./config.js";
16
- import { registerOpsTools } from "./ops.js";
16
+ import { registerOpsTools, uploadVideo } from "./ops.js";
17
17
  import { fetchAgentTools, registerBridgeTools } from "./bridge.js";
18
18
  const AGENT = process.env.DAWNWOOD_AGENT || "mcp";
19
19
  function consoleBase() {
@@ -35,12 +35,33 @@ async function call(path, tool, method, body) {
35
35
  return fail(e);
36
36
  }
37
37
  }
38
+ /** create_run 的 lead_actor_id/lead_name + cast[] → POST /runs cast_pins;lead 在前,同 actor_id 只留第一次(后端对重复 pin 报 400)。 */
39
+ export function castPins(a) {
40
+ const raw = [
41
+ ...(a.lead_actor_id ? [{ actor_id: a.lead_actor_id, role_name: a.lead_name }] : []),
42
+ ...(a.cast ?? []),
43
+ ];
44
+ const seen = new Set();
45
+ const pins = [];
46
+ for (const p of raw) {
47
+ const id = (p.actor_id || "").trim();
48
+ if (!id || seen.has(id))
49
+ continue;
50
+ seen.add(id);
51
+ pins.push({
52
+ actor_id: id,
53
+ ...(p.role_name?.trim() ? { name: p.role_name.trim() } : {}),
54
+ ...(p.gender ? { gender: p.gender } : {}),
55
+ });
56
+ }
57
+ return pins;
58
+ }
38
59
  export function buildServer() {
39
- const server = new McpServer({ name: "dawnwood", version: "0.8.2" });
60
+ const server = new McpServer({ name: "dawnwood", version: "0.12.0" });
40
61
  // ---- runs 生命周期 ---------------------------------------------------------
41
62
  server.tool("list_runs", "List your runs (drafts and in progress). For browsing only — **never poll status with it**; use get_run for a single run.", async () => call("/runs", "list_runs"));
42
63
  server.tool("get_run", "Read one run's full state (wizard step, bible, scripts, pack, art progress). This is the right tool for polling (O(1) lookup); poll at most every 10 seconds (10s).", { run_id: z.string().describe("run id (snake_case)") }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}`, "get_run"));
43
- server.tool("create_run", "Create a new series run (wizard step 1: brief). premise is 100–6000 characters; titles must include the primary_locale; compliance_ack=true is required (no real-person likeness, no third-party IP). Episode count defaults to 10 (changing it is an operator privilege).", {
64
+ server.tool("create_run", "Create a new series run (wizard step 1: brief). premise is 100–6000 characters; titles must include the primary_locale; compliance_ack=true is required (no real-person likeness, no third-party IP). Episode count defaults to 10 (changing it is an operator privilege). aspect 16:9 makes a landscape YouTube long-form movie (default 9:16 vertical). production_mode automatic means Dawnwood writes, renders and signs off every episode without waiting for approvals and spends credits as it goes, so get the user's go-ahead first. cast pins saved actor faces (from list_actors or save_actor) to roles, for example the lead and the villain.", {
44
65
  run_id: z.string().describe("snake_case ASCII id, globally unique"),
45
66
  titles: z.record(z.string(), z.string()).describe('title per locale, e.g. {"en": "..."}'),
46
67
  primary_locale: z.string().default("en"),
@@ -53,6 +74,17 @@ export function buildServer() {
53
74
  lead_actor_id: z.string().optional()
54
75
  .describe("optional: id of a reusable actor (your roster or the shared library) who must play the lead"),
55
76
  lead_name: z.string().optional().describe("optional: the lead's name, used to match the role"),
77
+ cast: z.array(z.object({
78
+ actor_id: z.string().describe("id of a saved or library actor (list_actors)"),
79
+ role_name: z.string().optional().describe("the character's name, used to match the role"),
80
+ gender: z.enum(["male", "female"]).optional(),
81
+ })).optional().describe("optional: pin actor faces to roles, for example the lead and the villain"),
82
+ aspect: z.enum(["9:16", "16:9"]).optional()
83
+ .describe("16:9 = landscape YouTube long-form movie; default 9:16 vertical"),
84
+ production_mode: z.enum(["manual", "automatic"]).optional()
85
+ .describe("automatic = Dawnwood writes, renders and signs off every episode without waiting for approvals; costs credits as it goes. Default manual"),
86
+ private: z.boolean().optional()
87
+ .describe("client or brand-pitch work: never auto-published to the watch shelf, highlights or YC, even on internal accounts"),
56
88
  parent: z.object({
57
89
  wid: z.string().describe("id of one of your existing shows"),
58
90
  inherit: z.object({
@@ -66,8 +98,11 @@ export function buildServer() {
66
98
  premise: a.premise, lang: a.lang, render_style: a.render_style,
67
99
  compliance_ack: a.compliance_ack,
68
100
  ...(a.episodes != null ? { episodes: a.episodes } : {}),
101
+ ...(a.private ? { private: true } : {}),
69
102
  ...(a.parent ? { parent: a.parent } : {}),
70
- ...(a.lead_actor_id ? { cast_pins: [{ actor_id: a.lead_actor_id, ...(a.lead_name ? { name: a.lead_name } : {}) }] } : {}),
103
+ ...(a.aspect ? { aspect: a.aspect } : {}),
104
+ ...(a.production_mode ? { production_mode: a.production_mode } : {}),
105
+ ...((pins) => (pins.length ? { cast_pins: pins } : {}))(castPins(a)),
71
106
  }));
72
107
  server.tool("delete_run", "Discard a draft run (irreversible; self-serve runs only).", { run_id: z.string() }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}`, "delete_run", "DELETE"));
73
108
  // ---- 圣经(Step 2) ---------------------------------------------------------
@@ -80,6 +115,10 @@ export function buildServer() {
80
115
  server.tool("generate_scripts", "Run the script chain (episode by episode, each with a recap of what came before). Long operation; poll progress with get_run (≥10s). " +
81
116
  "By default it **resumes**: episodes already ready or approved are skipped, so re-calling after a killed or stuck chain is safe. " +
82
117
  "force=true regenerates everything (e.g. rewriting the whole chain after bible feedback; every episode becomes a new version).", { run_id: z.string(), force: z.boolean().optional().describe("regenerate every episode (use with care)") }, async ({ run_id, force }) => call(`/runs/${encodeURIComponent(run_id)}/scripts/generate`, "generate_scripts", "POST", force ? { force: true } : {}));
118
+ server.tool("punch_up_script", "Punch up one episode's existing script without changing its story: every plot event, scene order, reveal and the ending stay; " +
119
+ "only character flavour, 2-3 payoff (satisfaction) beats, sharper dialogue and a one-line look at each first appearance change. " +
120
+ "Use it for licensed or imported scripts that play flat. Produces a new version that must be re-approved; rewriting an approved script is billed. " +
121
+ "notes = optional character flavour direction (e.g. 'the lead never begs; the alpha is awkward around his daughter'). Poll get_script for the new version.", { run_id: z.string(), ep: z.number().int().min(1), notes: z.string().optional().describe("character flavour direction") }, async ({ run_id, ep, notes }) => call(`/runs/${encodeURIComponent(run_id)}/scripts/generate`, "punch_up_script", "POST", { ep, punchup: true, ...(notes ? { notes } : {}) }));
83
122
  server.tool("get_script", "Read one episode's script. ep looks like '0001'. The response carries render_lock: {locked, reason} — while locked=true the episode cannot be storyboarded or rendered: " +
84
123
  "reason=proposal_pending means a rewrite proposal is waiting for the user (Apply/Reject); reason=unapproved means the new version has not been approved yet. " +
85
124
  "When locked, tell the user plainly to resolve it on the console's Script page (or call approve_script only with their explicit consent); never work around it.", { run_id: z.string(), ep: z.string().describe("episode number, e.g. 0001") }, async ({ run_id, ep }) => call(`/runs/${encodeURIComponent(run_id)}/scripts/${encodeURIComponent(ep)}`, "get_script"));
@@ -91,7 +130,15 @@ export function buildServer() {
91
130
  server.tool("update_pack", "Edit the asset-pack draft (full PUT).", { run_id: z.string(), pack: z.record(z.string(), z.unknown()) }, async ({ run_id, pack }) => call(`/runs/${encodeURIComponent(run_id)}/pack`, "update_pack", "PUT", pack));
92
131
  server.tool("commit_pack", "Lock the asset pack and move on to art/rendering (a gate action).", { run_id: z.string() }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}/pack/commit`, "commit_pack", "POST"));
93
132
  // ---- 美术/渲染(Step 5) ----------------------------------------------------
94
- server.tool("art_estimate", "Credits quote for art/rendering (check it before starting).", { run_id: z.string() }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}/art/estimate`, "art_estimate"));
133
+ server.tool("art_estimate", "Credits quote for art/rendering (check it before starting). Returns groups with subtotals: now (generated if you start " +
134
+ "art now), unlocked (generated when a render first needs them), locked (free account: unlocks with any top-up or " +
135
+ "subscription). items lists only the chosen scope (default now; scope=all for every row).", { run_id: z.string(), scope: z.enum(["now", "unlocked", "locked", "all"]).optional() }, async ({ run_id, scope }) => {
136
+ const q = new URLSearchParams();
137
+ if (scope)
138
+ q.set("scope", scope);
139
+ const qs = q.toString();
140
+ return call(`/runs/${encodeURIComponent(run_id)}/art/estimate${qs ? `?${qs}` : ""}`, "art_estimate");
141
+ });
95
142
  server.tool("generate_art", "Start art/rendering (this step spends credits; run art_estimate first). Poll progress with art_status (≥10s). " +
96
143
  "409 with code=script_proposal_pending / script_unapproved = an episode's script is waiting on the user (a proposal not applied/rejected, or a new version not approved): relay the reason and send them to the Script page; do not retry.", { run_id: z.string() }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}/art/generate`, "generate_art", "POST"));
97
144
  server.tool("art_status", "Art/rendering progress (single-run lookup — use this to poll, at most every 10 seconds).", { run_id: z.string() }, async ({ run_id }) => call(`/runs/${encodeURIComponent(run_id)}/art/status`, "art_status"));
@@ -111,6 +158,182 @@ export function buildServer() {
111
158
  wordmark: z.string().optional().describe("series wordmark, ≤24 characters"),
112
159
  ep_badge: z.string().optional().describe("episode-line format string, e.g. 'EP {n}'"),
113
160
  }, async ({ run_id, ...t }) => call(`/works/${encodeURIComponent(run_id)}`, "set_cover_theme", "PUT", { cover_theme: Object.fromEntries(Object.entries(t).filter(([, v]) => v != null)) }));
161
+ server.tool("set_art_direction", "Choose this series' character/scene art direction. 'glam_fantasy' = Western high-fantasy beauty: striking leads, medieval noble costume " +
162
+ "described piece by piece (fabric, embroidery, metalwork), grand scenes — for werewolf/royal/fantasy shows set in a kingdom. " +
163
+ "'glam_modern' = the same beauty bar for present-day genre shows (modern werewolf, billionaire, mafia): a signature luxury look per lead " +
164
+ "and full camera-ready makeup. 'realistic' = believable real people. " +
165
+ "'auto' (default) picks from the bible's genre. Affects art generated from now on; reroll existing portraits/scenes to update them.", { run_id: z.string(), direction: z.enum(["glam_fantasy", "glam_modern", "realistic", "auto"]) }, async ({ run_id, direction }) => call(`/works/${encodeURIComponent(run_id)}`, "set_art_direction", "PUT", { art_direction: direction }));
166
+ server.tool("set_music", "Choose this series' episode-master music. 'ai' = an instrumental AI score (ElevenLabs Music) generated per episode from the storyboard's " +
167
+ "emotional arc, ending on a suspense sting; mixed audibly under dialogue and gently ducked when people speak. 'basic' = the procedural ambient bed. " +
168
+ "Applies the next time an episode master is built; re-master existing episodes to add it. Private beta (internal series only for now).", { run_id: z.string(), music: z.enum(["ai", "basic"]) }, async ({ run_id, music }) => call(`/works/${encodeURIComponent(run_id)}`, "set_music", "PUT", { bgm_source: music === "ai" ? "ai" : "sine" }));
169
+ server.tool("set_ambience", "Choose how an episode master handles ambience. 'scene' = dialogue is isolated and cleaned, each scene (SEG) gets ONE continuous " +
170
+ "ambience bed (reused from the library for the same location), and only meaningful native sound effects are kept — removes the " +
171
+ "audible jumps between shot groups. 'native' = keep each shot group's own audio. Applies on the next episode master (re-master to hear it).", { run_id: z.string(), mode: z.enum(["scene", "native"]) }, async ({ run_id, mode }) => call(`/works/${encodeURIComponent(run_id)}`, "set_ambience", "PUT", { ambience_mode: mode }));
172
+ server.tool("find_music", "Search the account's music library (score cues shared by all of this account's series, plus the public house library). " +
173
+ "mood: tension | battle | confrontation | romance | sorrow | mystery | triumph | sting. query: free text (English or Chinese), ranked by mood + prompt similarity. " +
174
+ "Each cue has a signed preview url and used_in (which series:episode used it). Prefer reusing a cue over generating a new one.", { run_id: z.string(), mood: z.string().optional(), query: z.string().optional() }, async ({ run_id, mood, query }) => {
175
+ const q = new URLSearchParams();
176
+ if (mood)
177
+ q.set("mood", mood);
178
+ if (query)
179
+ q.set("q", query);
180
+ return call(`/works/${encodeURIComponent(run_id)}/music?${q}`, "find_music");
181
+ });
182
+ server.tool("get_music_plan", "Read one episode's score plan: the storyboard's emotional arc split into sections, and which library cue each section uses " +
183
+ "(plus the end-of-episode cliffhanger sting). Sections are indexed for use_music.", { run_id: z.string(), ep: z.string().describe("episode number, e.g. 1001") }, async ({ run_id, ep }) => call(`/works/${encodeURIComponent(run_id)}/chapters/${encodeURIComponent(ep)}/music`, "get_music_plan"));
184
+ server.tool("use_music", "Pick which library cue an episode section uses (section index from get_music_plan, or 'sting' for the cliffhanger sting); " +
185
+ "empty cue_id reverts to automatic. Takes effect when the episode master is rebuilt (re-master the episode).", { run_id: z.string(), ep: z.string(), section: z.string().describe("section index or 'sting'"), cue_id: z.string().optional() }, async ({ run_id, ep, section, cue_id }) => call(`/works/${encodeURIComponent(run_id)}/chapters/${encodeURIComponent(ep)}/music`, "use_music", "PUT", { section, cue_id: cue_id || "" }));
186
+ server.tool("generate_music", "Generate a NEW score cue into the music library (ElevenLabs Music, about a minute, costs money — only when find_music has nothing that fits). " +
187
+ "mood as in find_music; prompt adds direction (e.g. 'slower, solo violin').", { run_id: z.string(), mood: z.string(), prompt: z.string().optional() }, async ({ run_id, mood, prompt }) => call(`/works/${encodeURIComponent(run_id)}/music`, "generate_music", "POST", { mood, ...(prompt ? { prompt } : {}) }));
188
+ server.tool("refine_look", "Rewrite a character's appearance_traits in character-sheet style (face feature by feature → each garment's colour, material and craft → presence), " +
189
+ "following the series' art direction. Returns {draft}; apply=true writes it back (old text kept as appearance_traits_pre_refine). " +
190
+ "After applying, reroll the character's portrait and four-view for it to show.", { character_id: z.string(), note: z.string().optional().describe("direction, e.g. 'closer to the poster face'"), apply: z.boolean().optional() }, async ({ character_id, note, apply }) => call(`/characters/${encodeURIComponent(character_id)}/refine-look`, "refine_look", "POST", { ...(note ? { note } : {}), ...(apply ? { apply: true } : {}) }));
191
+ server.tool("set_render_mode", "Choose this series' video render mode. 'native720' (default) renders every group at native 720p. " +
192
+ "'480_seedvr' renders Seedance 2.5 groups after the paywall episode at 480p and AI-upscales them (SeedVR) to 1080p, " +
193
+ "about 2/3 of the 720p cost; wide shots, groups with 3+ characters and the free episodes before the paywall stay at 720p. " +
194
+ "'720_seedvr' renders every Seedance 2.5 group at 720p and AI-upscales it to 1080p: the sharpest option, for showcase episodes. " +
195
+ "'card_sr' (default for new self-serve series) renders the first card (episodes up to the paywall, or the first 10) at 720p + upscale, " +
196
+ "then close and medium shots at 480p + upscale. Seedance 2.5 groups rendered at 480p bill at 7 cr/s instead of 10. " +
197
+ "'draft' renders every Seedance 2.5 group as cheap 480p Draft previews (4 cr/s, billed even if you discard them); " +
198
+ "pick one in the console and turn it into the 1080p final (18 cr/s) with the same composition and motion. Best for fights and effects shots that need many tries. " +
199
+ "A single group can override this with render_res_mode on rerender_group / render_shot.", {
200
+ run_id: z.string().describe("run/work id (snake_case)"),
201
+ mode: z.enum(["native720", "480_seedvr", "720_seedvr", "card_sr", "draft"]).describe("render mode"),
202
+ }, async ({ run_id, mode }) => call(`/works/${encodeURIComponent(run_id)}`, "set_render_mode", "PUT", { render_res_mode: mode }));
203
+ // ---- 镜头模板库(2026-11-13):4–15s 动作参考片,按组套用,出片时只借动作编排 ------------------
204
+ server.tool("list_shot_templates", "Browse the shot template library: published 4–15 s reference clips of common shot types (fights first). " +
205
+ "Each has roles (A, B…), a per-second choreography description and a preview_url. All filters are optional: " +
206
+ "category (fight), people (1v1 | 1v2 | 1vN | group), location (indoor | outdoor), weapon (unarmed | sword | polearm | dagger | gun | magic | beast | mixed), " +
207
+ "camera (static | handheld | tracking | orbit | push), tempo (fast | slowmo_finish | mixed), framing (medium | close). " +
208
+ "Your own imported (private) templates are listed too; mine=true lists only those.", {
209
+ category: z.enum(["fight", "chase", "ride", "fall", "embrace"]).optional(),
210
+ people: z.enum(["1v1", "1v2", "1vN", "group"]).optional(),
211
+ location: z.enum(["indoor", "outdoor", "any"]).optional(),
212
+ weapon: z.enum(["unarmed", "sword", "polearm", "dagger", "gun", "magic", "beast", "mixed"]).optional(),
213
+ camera: z.enum(["static", "handheld", "tracking", "orbit", "push"]).optional(),
214
+ tempo: z.enum(["fast", "slowmo_finish", "mixed"]).optional(),
215
+ framing: z.enum(["medium", "close"]).optional(),
216
+ mine: z.boolean().optional().describe("only your own imported templates"),
217
+ }, async (f) => {
218
+ const q = new URLSearchParams();
219
+ for (const [k, v] of Object.entries(f))
220
+ if (v && v !== "any")
221
+ q.set(k, v === true ? "1" : String(v));
222
+ const s = q.toString();
223
+ return call(`/v1/shot-templates${s ? `?${s}` : ""}`, "list_shot_templates");
224
+ });
225
+ server.tool("apply_shot_template", "Bind a shot template to one render group so its next render copies the clip's choreography, timing, blocking and camera move " +
226
+ "(people, costumes and set still come from the series' own references). roles maps every template role key to a character id " +
227
+ "in that group's cast, e.g. {\"A\": \"<cid>\", \"B\": \"<cid>\"}. seg_id is optional (the group is found by id). " +
228
+ "Set template_id to null to remove the template. Binding is free; re-render the group (rerender_group) to use it.", {
229
+ run_id: z.string().describe("run/work id"),
230
+ episode: z.number().int().describe("episode (chapter) number"),
231
+ group_id: z.string().describe("render group id"),
232
+ seg_id: z.string().optional().describe("segment id (optional)"),
233
+ template_id: z.string().nullable().describe("template id from list_shot_templates; null removes it"),
234
+ roles: z.record(z.string(), z.string()).optional().describe("role key → character id in this group's cast"),
235
+ }, async ({ run_id, episode, group_id, seg_id, template_id, roles }) => {
236
+ const path = `/works/${encodeURIComponent(run_id)}/chapters/${episode}/storyboard/segments/` +
237
+ `${encodeURIComponent(seg_id || "_")}/groups/${encodeURIComponent(group_id)}/template`;
238
+ return template_id
239
+ ? call(path, "apply_shot_template", "PUT", { template_id, template_roles: roles || {} })
240
+ : call(path, "apply_shot_template", "DELETE");
241
+ });
242
+ server.tool("import_shot_template_video", "Turn a local fight video (.mp4/.mov, ≤10 min, ≤500 MB; vertical or landscape — landscape candidates are center-cropped to 9:16) " +
243
+ "into PRIVATE shot templates only you can see and use: the server finds the fight passages, cuts 4–15 s candidates on shot " +
244
+ "boundaries, removes small watermarks and writes a per-second choreography description for each. Runs in the background " +
245
+ "(minutes); poll get_shot_template_import every ≥15 s. Candidates then show up in list_shot_templates (mine=true) and can be " +
246
+ "applied with apply_shot_template. Only use footage you have the rights to.", { path: z.string().describe("absolute path of a local .mp4/.mov file") }, async ({ path }) => {
247
+ try {
248
+ const up = await uploadVideo(path, AGENT);
249
+ if (up.bytes > 500 * 1024 * 1024)
250
+ throw new Error("the video is over 500 MB — trim it first");
251
+ return ok(await apiCall("/v1/shot-templates/imports", {
252
+ method: "POST", tool: "import_shot_template_video", agent: AGENT, body: { asset_id: up.asset_id, filename: up.name },
253
+ }));
254
+ }
255
+ catch (e) {
256
+ return fail(e);
257
+ }
258
+ });
259
+ server.tool("get_shot_template_import", "Status of a video import (queued → analyzing → cutting → done | failed), progress, and when done its candidate templates " +
260
+ "(auto tags, score, motion_desc, preview_url). Poll at most every 15 s.", { import_id: z.string() }, async ({ import_id }) => call(`/v1/shot-templates/imports/${encodeURIComponent(import_id)}`, "get_shot_template_import"));
261
+ server.tool("action_remake", "Action Remake: render your characters doing an exact fight move, with no series needed. template_id = a move from " +
262
+ "list_shot_templates (a 3D mocap move; your own imported candidates must be converted to 3D first). cast maps each role " +
263
+ "(A = hero, B = the others, C = a second fighter) to {asset_id} of a character image (upload_image) or {character_id} of a " +
264
+ "character from your series, plus optional name and props (e.g. 'a longsword on his hip'). others_desc describes the other " +
265
+ "fighters, setting describes the location. Costs 6 credits per second, counting the move and the result (a 6 second move is " +
266
+ "about 72 credits); the first clip with a library move up to 6 seconds is free; refunded if it fails. Returns a job; poll " +
267
+ "action_remake_status every >=15 s (usually 2 to 5 minutes).", {
268
+ template_id: z.string().describe("move id from list_shot_templates"),
269
+ cast: z.record(z.string(), z.object({
270
+ asset_id: z.string().optional().describe("character image asset id (upload_image)"),
271
+ character_id: z.string().optional().describe("a character from one of your series"),
272
+ name: z.string().optional(),
273
+ props: z.string().optional().describe("weapon or props they carry"),
274
+ })).describe("role key (A/B/C) → character; A is required"),
275
+ others_desc: z.string().optional().describe("what the other fighters look like"),
276
+ setting: z.string().optional().describe("the location"),
277
+ scene_asset_id: z.string().optional().describe("optional location reference image"),
278
+ ratio: z.enum(["9:16", "16:9"]).optional(),
279
+ }, async (a) => call("/tools/action-remake", "action_remake", "POST", a));
280
+ server.tool("action_remake_status", "Status of an Action Remake job (PENDING / RUNNING / DONE / FAILED); when DONE it carries the video asset and a download URL " +
281
+ "(the clip is also saved to your media library for the editor). With sequence_id: a full-set render — every move's card in " +
282
+ "order, the overall status (RUNNING / DONE / PARTIAL / FAILED) and, once all moves are done, the stitched video " +
283
+ "(stitched_asset). Poll at most every 15 s. Without either id: prices, free clips left and your recent clips and sets.", { job_id: z.string().optional(), sequence_id: z.string().optional().describe("id from action_remake_sequence") }, async ({ job_id, sequence_id }) => call(sequence_id ? `/tools/action-remake/sequence/${encodeURIComponent(sequence_id)}`
284
+ : job_id ? `/tools/action-remake/${encodeURIComponent(job_id)}` : "/tools/action-remake", "action_remake_status"));
285
+ // ---- 模版组(2026-11-17):几招连成一场连续打戏,整组搜索 / 整组出片 / 整组绑分镜 -----------------------
286
+ server.tool("list_shot_template_sets", "Browse template sets: curated runs of 2+ consecutive moves (same place, same people) that play as one continuous fight. " +
287
+ "Each set lists its moves in play order (with preview_url, duration, roles), total seconds, output seconds and billed seconds. " +
288
+ "q is a case-insensitive text search over set and move titles and choreography; people / location / weapon must hold for every move.", {
289
+ q: z.string().optional().describe("search words, e.g. 'corridor flying kick'"),
290
+ people: z.enum(["1v1", "1v2", "1vN", "group"]).optional(),
291
+ location: z.enum(["indoor", "outdoor", "any"]).optional(),
292
+ weapon: z.enum(["unarmed", "sword", "polearm", "dagger", "gun", "magic", "beast", "mixed"]).optional(),
293
+ }, async (f) => {
294
+ const q = new URLSearchParams();
295
+ for (const [k, v] of Object.entries(f))
296
+ if (v && v !== "any")
297
+ q.set(k, String(v));
298
+ const s = q.toString();
299
+ return call(`/v1/shot-template-sets${s ? `?${s}` : ""}`, "list_shot_template_sets");
300
+ });
301
+ server.tool("action_remake_sequence", "Action Remake for a whole run of moves: give set_id (from list_shot_template_sets) or template_ids (2 to 8 moves in play " +
302
+ "order, your own pick) and ONE cast (same as action_remake; the union of the moves' roles). Every move renders with the same " +
303
+ "character references, setting, setting image and frame, and is told it is part N of one continuous fight. Charged once: the " +
304
+ "sum of each move's billed seconds at the normal 6 credits per second (no free clip); any move that fails is refunded on its " +
305
+ "own. Returns a sequence; poll action_remake_status with sequence_id every >=15 s. When all moves are done a stitched video is added.", {
306
+ set_id: z.string().optional().describe("template set id"),
307
+ template_ids: z.array(z.string()).optional().describe("or: 2–8 move ids in play order"),
308
+ cast: z.record(z.string(), z.object({
309
+ asset_id: z.string().optional(),
310
+ character_id: z.string().optional(),
311
+ name: z.string().optional(),
312
+ props: z.string().optional(),
313
+ })).describe("role key (A/B/C) → character; A is required"),
314
+ others_desc: z.string().optional(),
315
+ setting: z.string().optional(),
316
+ scene_asset_id: z.string().optional(),
317
+ ratio: z.enum(["9:16", "16:9"]).optional(),
318
+ }, async (a) => call("/tools/action-remake/sequence", "action_remake_sequence", "POST", a));
319
+ server.tool("apply_shot_template_set", "Bind a template set (set_id) or your own run of moves (template_ids) onto consecutive render groups of an episode, starting at " +
320
+ "group_id: move 1 → that group, move 2 → the next group in episode order, and so on. roles maps role keys to character ids " +
321
+ "(the same mapping is used for every move; each group must have those characters in its cast). All-or-nothing; free; " +
322
+ "re-render the groups to use it.", {
323
+ run_id: z.string(),
324
+ episode: z.number().int(),
325
+ group_id: z.string().describe("first render group"),
326
+ set_id: z.string().optional(),
327
+ template_ids: z.array(z.string()).optional(),
328
+ roles: z.record(z.string(), z.string()).describe("role key → character id"),
329
+ }, async ({ run_id, episode, group_id, set_id, template_ids, roles }) => call(`/works/${encodeURIComponent(run_id)}/chapters/${episode}/storyboard/segments/_/groups/${encodeURIComponent(group_id)}/template-set`, "apply_shot_template_set", "PUT", { ...(set_id ? { set_id } : { template_ids: template_ids || [] }), template_roles: roles }));
330
+ server.tool("set_aspect", "Choose this series' frame. '9:16' (default) = vertical short drama for TikTok/Reels/Shorts. " +
331
+ "'16:9' = landscape widescreen for YouTube long-form (an 'AI movie'): videos, storyboard stills, scene references, " +
332
+ "episode masters (1920x1080) and covers are all made landscape, with faces and key action kept in the centre 9:16 safe area " +
333
+ "so vertical clips are a clean centre crop. Applies to renders and masters made from now on; already rendered groups keep their frame.", {
334
+ run_id: z.string().describe("run/work id (snake_case)"),
335
+ aspect: z.enum(["9:16", "16:9"]).describe("frame aspect ratio"),
336
+ }, async ({ run_id, aspect }) => call(`/works/${encodeURIComponent(run_id)}`, "set_aspect", "PUT", { aspect }));
114
337
  server.tool("import_clip", "Cut a clip from an earlier finished work into this series (straight reuse or a flashback): source_asset_id is the source work's video asset " +
115
338
  "(segment cut / master); [start_ms, end_ms] is cut out and stored as this series' archival_clip asset (with provenance). " +
116
339
  "treatment='flashback' burns in a memory grade at extraction. Optional splice={chapter, seg_id, position} " +
@@ -195,7 +418,7 @@ export function buildServer() {
195
418
  // 版本 = 用已出镜头重排 / 重新分集 / 压缩 / 字卡 / 补拍出来的整剧剪辑;原版(v0)和旧版本永远不动,改 = 另存新版本。
196
419
  server.tool("list_versions", "List this series' versions: v0 is the original episodes; v1, v2… are re-edits built from already-rendered footage. Each has notes (what changed and why), per-episode build status/duration and a timeline showing which original episode/group every piece comes from. Read before creating a new one.", { run_id: z.string() }, async ({ run_id }) => call(`/works/${encodeURIComponent(run_id)}/versions`, "list_versions"));
197
420
  server.tool("version_inventory", "The parts list for a new version: every rendered group of the given episodes — ep, seg, gid, start/end inside the segment cut, position in the original episode, beats and spoken lines. eps like '1-5' or '1,3,901' (901+ are patch-shot episodes). Build version specs only from these ids.", { run_id: z.string(), eps: z.string().default("1-5") }, async ({ run_id, eps }) => call(`/works/${encodeURIComponent(run_id)}/versions/inventory?eps=${encodeURIComponent(eps)}`, "version_inventory"));
198
- server.tool("create_version", "Create a NEW version from existing footage and queue its cloud build (free; minutes per episode). spec = {title, notes, episodes:[{title, hook, notes, items:[{kind:'clip', ep, gid, trim_head?, trim_tail?} | {kind:'clip', ep, seg, from, to} | {kind:'card', text, secs 0.5–6}]}], then_original_from? (continue with original episode N after these)}. Keep episodes 60–110 s, end each on a hook, keep continuity. The original and older versions are never changed.", { run_id: z.string(), spec: z.record(z.string(), z.unknown()), based_on: z.string().optional() }, async ({ run_id, spec, based_on }) => call(`/works/${encodeURIComponent(run_id)}/versions`, "create_version", "POST", { spec, based_on: based_on || "", build: true }));
421
+ server.tool("create_version", "Create a NEW version from existing footage and queue its cloud build (free; minutes per episode). spec = {title, notes, episodes:[{title, hook, notes, items:[{kind:'clip', ep, gid, trim_head?, trim_tail?} | {kind:'clip', ep, seg, from, to} | {kind:'card', text, secs 0.5–6}]}], then_original_from? (continue with original episode N after these)}. Keep episodes 60–90 s (over 90 s hurts completion — split at a hook), end each on a hook, keep continuity. The original and older versions are never changed.", { run_id: z.string(), spec: z.record(z.string(), z.unknown()), based_on: z.string().optional() }, async ({ run_id, spec, based_on }) => call(`/works/${encodeURIComponent(run_id)}/versions`, "create_version", "POST", { spec, based_on: based_on || "", build: true }));
199
422
  server.tool("build_version", "Re-run the cloud build of a version (all episodes or eps:[n…]) — after a failed build, or once a patch shot it uses is ready. Poll with list_versions at most every 30 s.", { run_id: z.string(), version_id: z.string(), eps: z.array(z.number().int()).optional() }, async ({ run_id, version_id, eps }) => call(`/works/${encodeURIComponent(run_id)}/versions/${encodeURIComponent(version_id)}/build`, "build_version", "POST", { eps: eps || null }));
200
423
  server.tool("patch_shot", "Shoot a NEW group a version needs but the footage lacks (a character entrance, a bridge, a key reaction). Renders in a hidden patch episode (901+) next to an anchor group of the original, inheriting its scene/outfits/staging — the original episode is not changed. shots = [{desc, blocking, dialogue?, cast[] (ids from version_inventory), duration ≤8}], ≤15 s total; for a shot with no dialogue add 'AUDIO: quiet room tone only — no music' to blocking. Costs render credits. When ready, reference it as {kind:'clip', ep:<patch_ep>, gid:<group_id>}.", {
201
424
  run_id: z.string(), ep: z.number().int(), gid: z.string(),
package/dist/ops.js CHANGED
@@ -56,6 +56,15 @@ export function registerOpsTools(server, call, ok, fail, agent) {
56
56
  catch (e) {
57
57
  return fail(e);
58
58
  } });
59
+ // ---- 自动配声(Sound Pass)--------------------------------------------------
60
+ server.tool("auto_sound", "Auto sound for any video: watches the picture, keeps the sounds already in the audio, adds the missing sound effects (hits, doors, glass, footsteps, creatures, off-screen sounds), a looping ambience bed and a music bed from the shared library. Source = asset_id from upload_video. intensity 'subtle' | 'standard' | 'punchy'; layers {sfx, amb, music} (all on by default). Creates an editor project with the result. Charged 5 cr per started minute of video, refunded if it fails. Poll auto_sound_status every >=10 s, then auto_sound_export renders the finished video.", {
61
+ asset_id: z.string().describe("video asset id from upload_video"),
62
+ intensity: z.enum(["subtle", "standard", "punchy"]).default("standard"),
63
+ layers: z.object({ sfx: z.boolean().optional(), amb: z.boolean().optional(), music: z.boolean().optional() }).optional(),
64
+ name: z.string().optional().describe("project name"),
65
+ }, async (a) => call("/tools/auto-sound", "auto_sound", "POST", a));
66
+ server.tool("auto_sound_status", "Status of an auto_sound (or editor auto-sound) job: status, and when DONE the sound list (each cue: time, kind, sound, chosen library sound, state auto|native|locked|rejected) plus ambience and music picks. Poll every >=10 s.", { job_id: z.string() }, async ({ job_id }) => call(`/jobs/${enc(job_id)}`, "auto_sound_status"));
67
+ server.tool("auto_sound_export", "Render the auto-sound project to a finished video (1 cr). Returns a job_id; poll auto_sound_status — when DONE the job carries the finished asset and a download URL. Fix individual sounds in the console editor (Tools → Editor) before exporting if needed.", { project_id: z.string() }, async ({ project_id }) => call(`/projects/${enc(project_id)}/render`, "auto_sound_export", "POST", {}));
59
68
  // ---- Clips ----------------------------------------------------------------
60
69
  server.tool("clips_list_jobs", "List your clip jobs (newest first, summary only) and the price: per_min cr per started source minute, min cr per job, max upload minutes.", async () => call("/v1/clips/jobs", "clips_list_jobs"));
61
70
  server.tool("clips_series_episodes", "For a series you own: the finished episodes you can clip, with each episode's length in seconds (to estimate cost: 1 cr per started minute, 3 cr minimum).", { work_id: z.string() }, async ({ work_id }) => call(`/v1/clips/series/${enc(work_id)}`, "clips_series_episodes"));
@@ -84,8 +93,8 @@ export function registerOpsTools(server, call, ok, fail, agent) {
84
93
  server.tool("clips_retry", "Retry a failed clip job from where it stopped (a job that produced nothing was already refunded and is charged again on retry).", { job_id: z.string() }, async ({ job_id }) => call(`/v1/clips/jobs/${enc(job_id)}/retry`, "clips_retry", "POST", {}));
85
94
  server.tool("clips_send_to_matrix", "Put every kept, finished clip of a job into the Matrix library (optionally under lane_id); sending twice does not duplicate. Then schedule them with matrix_plan_posts / matrix_schedule_posts.", { job_id: z.string(), lane_id: z.string().optional() }, async ({ job_id, lane_id }) => call(`/v1/clips/jobs/${enc(job_id)}/send`, "clips_send_to_matrix", "POST", lane_id ? { lane_id } : {}));
86
95
  // ---- Drama Center Ready ---------------------------------------------------
87
- server.tool("dramacenter_check", "Check a season before uploading it to TikTok Drama Center. source = {kind:'series', work_id} (your own series, every finished episode) or {kind:'upload', assets:[{asset_id, name}]} (from upload_video, ordered by the episode number in the name). level 'light' is free (specs, dark edges = code 4, end-card web text = code 6, subtitle area = code 7, cover frame, metadata); 'full' adds picture safety and story risks for 2 cr per episode. meta = {title <=35, description <=1500, free_preview, genres <=3, audience, creation_type, music_source}. Poll with dramacenter_get every >=10 s.", {
88
- source: z.object({ kind: z.enum(["series", "upload"]), work_id: z.string().optional(), chapters: z.array(z.number().int()).optional(),
96
+ server.tool("dramacenter_check", "Check a season before uploading it to TikTok Drama Center. source = {kind:'series', work_id} (your own series, every finished episode; follows the current delivery universe if one is set; universe=<id> or chapters=[…] picks a version, renumbered 1..N in that order) or {kind:'upload', assets:[{asset_id, name}]} (from upload_video, ordered by the episode number in the name). level 'light' is free (specs, dark edges = code 4, end-card web text = code 6, subtitle area = code 7, cover frame, metadata); 'full' adds picture safety and story risks for 2 cr per episode. meta = {title <=35, description <=1500, free_preview, genres <=3, audience, creation_type, music_source}. Poll with dramacenter_get every >=10 s.", {
97
+ source: z.object({ kind: z.enum(["series", "upload"]), work_id: z.string().optional(), chapters: z.array(z.number().int()).optional(), universe: z.string().optional(),
89
98
  assets: z.array(z.object({ asset_id: z.string(), name: z.string().optional() })).optional() }),
90
99
  level: z.enum(["light", "full"]).default("light"),
91
100
  meta: z.record(z.string(), z.unknown()).optional(), poster_asset_id: z.string().optional().describe("9:16 or 3:4 poster from upload_image"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dawnwood/cli",
3
- "version": "0.8.2",
3
+ "version": "0.12.0",
4
4
  "description": "Dawnwood for agents — CLI + MCP server. Your agent drives the full short-drama pipeline (bible → scripts → pack → renders) against console.dawnwood.ai.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",