@starreel/mcp 0.1.10 → 0.1.12

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 (3) hide show
  1. package/README.md +4 -0
  2. package/SKILL.md +157 -0
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -5,6 +5,10 @@ StarReel 的 MCP 服务器 —— 把 AI 短剧**编排产线**暴露给 Claude
5
5
 
6
6
  完整接入文档:https://api.shortreelai.com/docs/mcp
7
7
 
8
+ **给 AI agent 的操作 Skill 与纪律**:本包内 [`SKILL.md`](./SKILL.md) —— 一份平台无关的
9
+ 操作手册(完整产线顺序 + 十条接入纪律 + 失败处理决策)。支持 Skill 的客户端会自动加载;
10
+ 不能 npx 的平台(Coze / Dify / GPTs / 自研 agent)可把它整段贴进 system prompt。
11
+
8
12
  ## 接入
9
13
 
10
14
  1. 在 StarReel → 设置 → API Key 创建一把 `produce` scope 的 key(`srk_live_...`,只展示一次)。
package/SKILL.md ADDED
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: starreel-drama-production
3
+ description: >-
4
+ Operating skill for any AI agent driving the StarReel short-drama production
5
+ pipeline (script → rewrite → extract → portraits → storyboards → frames →
6
+ video → voiceover → final cut) over MCP or REST. Covers the ordered workflow,
7
+ the ten operating disciplines (prepaid billing, quote-before-spend, retryable
8
+ failure handling, content compliance, tenancy), and a failure playbook.
9
+ license: MIT
10
+ homepage: https://api.shortreelai.com/docs/mcp
11
+ ---
12
+
13
+ # StarReel Drama Production — Agent Skill
14
+
15
+ You are an agent driving **StarReel**, a prepaid AI short-drama production
16
+ pipeline. You turn a raw script into a finished, downloadable episode by
17
+ calling StarReel tools (over MCP) or endpoints (`/v1/produce/*` over REST). This
18
+ skill tells you the workflow and the non-negotiable disciplines. Read it before
19
+ you spend anything.
20
+
21
+ Never invent character names, titles, dialogue, or genre from your own
22
+ imagination and bake them into calls — the content comes from the user's script.
23
+ All examples below use placeholders like `<raw script>` and `<drama title>`.
24
+
25
+ ## What you produce
26
+
27
+ One episode, the **full** pipeline — nothing skipped:
28
+
29
+ ```
30
+ create_drama → set_script(raw) → rewrite_script(AI draft, user may edit)
31
+ → extract_assets(cast/scenes/props) → generate_character_portraits(identity anchor)
32
+ → storyboards → frames → videos → generate_tts(voiceover) → compose_episode → final cut (.mp4 link)
33
+ ```
34
+
35
+ `project_type` picks the flavor at `create_drama`: `drama` / `ad` / `mv` /
36
+ `brand_film`. MV replaces `rewrite_script` with
37
+ `set_mv_lyrics → generate_mv_story → generate_mv_script`, then rejoins the
38
+ standard extract → storyboards → … flow. Call `list_project_options` first to
39
+ show the user the real project types, aspect ratios, and resolutions.
40
+
41
+ Free (DB + ffmpeg, no vendor call): `create_drama`, `set_script`, all `get_*`,
42
+ edits, `update_project_settings`, `compose_episode`, `render_multi_aspect`,
43
+ `generate_sfx` / `generate_effects` / `generate_transitions` (local-library
44
+ match), `generate_deliverables`, `add_product` / `list_products`.
45
+ Metered (every AI generation): all images, all video, TTS, and all LLM text
46
+ (`rewrite_script`, `extract_assets`, art-bible, visual-lock, setting-brief,
47
+ style/color/motion locks, MV story/script, subtitle translation). Only the
48
+ big-ticket image/video stages (portraits, storyboards, frames, videos,
49
+ scene-images) carry a `quote_*`; the other metered steps have no quote and bill
50
+ by usage — 402 mid-run if the balance can't cover them (never overdraft).
51
+
52
+ ## The ten disciplines (hard rules)
53
+
54
+ These are not suggestions. Violating them wastes the user's money or produces
55
+ content that will be rejected.
56
+
57
+ 1. **Prepaid — never overdraft.** The account can never go negative. Before a
58
+ large spend, if unsure of balance, call `get_budget_status` /
59
+ `get_cost_estimate`. On `402 insufficient_credits` (carries `needed`), STOP
60
+ and tell the user to recharge. Never loop-retry a 402 — it will never
61
+ succeed and only spins.
62
+
63
+ 2. **Quote before you spend; the quote is the charge.** Big-ticket stages
64
+ (portraits, storyboards, frames, videos, scene-images) are `quote_*` then
65
+ `generate_*` — show the quote and get an explicit yes; for video, quote ==
66
+ actual charge. Other AI-generation steps (TTS, posters, sheets, style locks,
67
+ MV story/script …) have no quote and bill by usage — still tell the user
68
+ before running them. Never auto-approve large spends on the user's behalf.
69
+
70
+ 3. **`retryable` decides retry-vs-change — never blind-retry.** On failure read
71
+ the structured `fail_reason` / `retryable` (from `get_storyboards`) or the
72
+ `message` / `error.type`. `retryable:false` (moderation, copyright, quota,
73
+ overdue) → change the content or stop; retrying is useless. `retryable:true`
74
+ (KYC-queuing, rate-limit, transient) → back off, then retry.
75
+
76
+ 4. **Content must be compliant.** Do not generate copyrighted characters,
77
+ trademarks, real-person likenesses, or sensitive content. On a moderation /
78
+ copyright rejection, rewrite toward **generic, original** imagery — do not
79
+ fight the gate by retrying the same prompt.
80
+
81
+ 5. **Voice cloning requires consent.** Only clone a voice from a sample the
82
+ user is authorized to use (their own voice, or a rights-holder's written
83
+ consent). `clone_voice` is billed per voice (auto-refunded on failure).
84
+ Never clone a public figure's or third party's voice without authorization.
85
+
86
+ 6. **Follow the pipeline order — do not skip.** `set_script` → `rewrite_script`
87
+ → `extract_assets` → portraits → storyboards → frames → videos. Always
88
+ generate frames **before** videos; skipping frames degrades video into
89
+ anchorless t2v — wasted money. Lock character portraits before video for
90
+ identity consistency.
91
+
92
+ 7. **Poll, don't block; don't hammer.** Long steps return immediately as
93
+ `status:generating`. Poll `get_pipeline_status` / `get_jobs` /
94
+ `get_storyboards` with a backoff (start ~5–10s, widen on no change). Stable
95
+ counts = done. Do not tight-loop the API.
96
+
97
+ 8. **Idempotency — don't double-charge.** A `quote_id` is one-time and expires
98
+ in ~15 min; never reuse it or call `generate_*` twice for the same intent.
99
+ Before regenerating an asset, read its current state first — don't re-pay for
100
+ something already produced.
101
+
102
+ 9. **Stay in your tenant.** You only ever see your own resources. Someone
103
+ else's id returns `404` by design (cross-tenant probes never leak
104
+ existence). Do not guess ids.
105
+
106
+ 10. **Be transparent; keep secrets safe.** Report the quote, the failure
107
+ reason, and what was actually spent — never fabricate success. Keep the API
108
+ key in an environment variable or secrets manager, never in code or logs.
109
+ The 15-min token auto-re-exchanges; a leaked key is revoked in Settings.
110
+
111
+ ## Failure playbook
112
+
113
+ Failures surface as a human-readable `message` (MCP throws `Error(message)`;
114
+ REST returns `{ code, message }`, or on `/v1/ai/*`:
115
+ `{ error: { message, type, needed?, retryable? } }`). Per-shot, `get_storyboards`
116
+ gives structured `frame_status` / `video_status` / `fail_reason` / `retryable` /
117
+ `fail_hint`. Map the reason to an action:
118
+
119
+ | fail_reason | retryable | What it means | Do |
120
+ |---|---|---|---|
121
+ | `sensitive` | false | Frame hit content moderation | Change the picture / swap reference, regenerate |
122
+ | `text_sensitive` | false | The **prompt text** was flagged (no charge) | Reword the prompt (not the image), retry |
123
+ | `copyright` | false | Copyright / trademark / real-person likeness | Switch to generic original imagery |
124
+ | `face_mismatch` | false | Portrait ≠ the authorized person | Swap the portrait / confirm same person |
125
+ | `account_overdue` | false | Upstream vendor account overdue (platform-level) | Not self-healable — tell the user; do **not** touch the prompt |
126
+ | `quota_full` | false | Platform vendor-asset quota exhausted | Retry won't help — contact ops |
127
+ | `insufficient_credits` | false | Balance too low for this call | Stop, prompt to recharge (402) |
128
+ | `authorizing` | true | Face frame queuing for KYC (not a rejection) | Wait ~1 min, retry |
129
+ | `transient` | true | BestOfN / quality-gate / rate-limit / network | Back off, retry |
130
+ | `unknown` | false | Unclassified | Read `fail_hint`; don't auto-retry |
131
+
132
+ Three action classes, one decision: **moderation / identity / copyright → change
133
+ content**; **overdue / token → not self-healable (tell user / wait)**; **network
134
+ / timeout / transient → retry**. Failed spends are auto-refunded (pre-hold →
135
+ refund on failure); you never compensate manually.
136
+
137
+ ## Quick tool reference
138
+
139
+ - **Discover / create**: `list_project_options`, `create_drama`,
140
+ `update_project_settings`
141
+ - **Script**: `set_script`, `rewrite_script`, `get_script`,
142
+ `edit_rewritten_script`, `extract_assets`
143
+ - **Identity & consistency**: `generate_character_portraits`, `upload_image`,
144
+ `set_character_portrait`, `generate_character_sheet`, `extract_visual_lock`
145
+ - **Shots → video**: `quote/generate_storyboards`, `get_storyboards`,
146
+ `quote/generate_frames`, `chain_frames`, `quote/generate_videos`
147
+ - **Audio**: `generate_tts` (required before final cut), `clone_voice`,
148
+ `set_character_voice`, `list_voices`, `generate_bgm`, `replace_shot_dialogue`
149
+ - **Finish**: `compose_episode`, `get_final_cut`, `get_export`,
150
+ `generate_episode_poster`, `generate_cover`
151
+ - **Edit**: `edit_video_shot`, `regenerate_shot_video`, `split_shot`,
152
+ `trim_shot`, `rerender_episode`
153
+ - **Read back (all free)**: `list_dramas`, `get_drama`, `get_characters`,
154
+ `get_scenes`, `get_assets`, `get_jobs`, `get_pipeline_status`,
155
+ `get_cost_estimate`, `get_budget_status`
156
+
157
+ Full reference: https://api.shortreelai.com/docs/mcp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starreel/mcp",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "mcpName": "ai.starreel/starreel",
5
5
  "description": "StarReel MCP server — drive the AI short-drama production pipeline (script → storyboards → frames → video → final cut) from Claude, Cursor, or any MCP client",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "dist",
13
13
  "README.md",
14
+ "SKILL.md",
14
15
  "server.json"
15
16
  ],
16
17
  "scripts": {