@mindscraft/branch-video-agent-cli 0.3.6 → 0.4.1
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 +21 -6
- package/dist/commands/aiGateway.js +23 -0
- package/dist/lib/flags.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,9 @@ branch-video-agent --version
|
|
|
31
31
|
- `AIHUB_AGENT_TOKEN`
|
|
32
32
|
- `BRANCH_VIDEO_AGENT_BASE_URL`
|
|
33
33
|
|
|
34
|
-
AI Gateway 调用同样只传 `AIHUB_AGENT_TOKEN`;CLI 不读取、不传递 `AiGatewayKey` 或 AIHub `projectKey`,上游鉴权由服务端处理。
|
|
34
|
+
AI Gateway 调用同样只传 `AIHUB_AGENT_TOKEN`;CLI 不读取、不传递 `AiGatewayKey` 或 AIHub `projectKey`,上游鉴权由服务端处理。
|
|
35
|
+
|
|
36
|
+
AI Gateway 生产媒体验收使用 `ai-gateway media-understand --raw`。P0 模型固定为 `doubao-seed-2-0-mini-260215`,输入为带 SHA-256 的公共 HTTPS 图片/视频 URL、一个 candidate、可选 reference、prompt 与 criteria;输出为 `media_acceptance_review.v1`。该能力只判断可见画面,不声称分析视频音轨。`kimi-k3` 和 `MiniMax-M3` 在真实 payload Canary 通过前不可调用。
|
|
35
37
|
|
|
36
38
|
最小调用示例:
|
|
37
39
|
|
|
@@ -69,7 +71,7 @@ AIHub 导入公共库示例:
|
|
|
69
71
|
"name": "判断题-增强版",
|
|
70
72
|
"defaultThemeId": "cat",
|
|
71
73
|
"urlsByTheme": {
|
|
72
|
-
"cat": "https://aic-view.sdp.
|
|
74
|
+
"cat": "https://aic-view.sdp.cn.ndhy.com/view/judge-base-v2"
|
|
73
75
|
},
|
|
74
76
|
"configTemplate": {
|
|
75
77
|
"waitForPageReady": true
|
|
@@ -142,17 +144,30 @@ Banana Pro 图片编辑继续使用 `ai-gateway image-edit`,请求体为 JSON
|
|
|
142
144
|
|
|
143
145
|
AI Gateway 视频生成并等待示例:
|
|
144
146
|
|
|
147
|
+
Seedance 2.5 必须使用完整模型名 `doubao-seedance-2-5-260628`。使用 `--wait --raw` 时,CLI 会始终轮询创建响应中的 task ID,并原样保留最终 `video_url` 与 `last_frame_url`。
|
|
148
|
+
|
|
145
149
|
```powershell
|
|
146
150
|
@'
|
|
147
151
|
{
|
|
148
|
-
"model": "doubao-seedance-2-
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
"model": "doubao-seedance-2-5-260628",
|
|
153
|
+
"content": [
|
|
154
|
+
{
|
|
155
|
+
"type": "text",
|
|
156
|
+
"text": "镜头推进到实验台,卡通猫老师点亮一个小灯泡"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"omni_reference_task_type": "auto",
|
|
160
|
+
"duration": 4,
|
|
161
|
+
"resolution": "720p",
|
|
162
|
+
"output_format": "mp4",
|
|
163
|
+
"return_last_frame": true,
|
|
164
|
+
"generate_audio": false
|
|
152
165
|
}
|
|
153
166
|
'@ | npm exec --yes --package=@mindscraft/branch-video-agent-cli branch-video-agent -- ai-gateway video-create -- --wait --raw
|
|
154
167
|
```
|
|
155
168
|
|
|
169
|
+
Seedance 2.5 支持 480p、720p、1080p 和 4–30 秒生成;在播放器兼容性完成验证前,推荐 480p/720p + MP4。完整的多图片/视频/音频参考数量限制,以及 `reference`、`edit`、`extend` 的差异,见仓库 Skill 的 `references/ai-gateway-parameters.md`。
|
|
170
|
+
|
|
156
171
|
AI Gateway Seed Audio 音频生成并等待示例:
|
|
157
172
|
|
|
158
173
|
```powershell
|
|
@@ -8,6 +8,21 @@ function ensureObject(value, fieldName) {
|
|
|
8
8
|
}
|
|
9
9
|
return value;
|
|
10
10
|
}
|
|
11
|
+
function validateMediaUnderstandingPayload(payload) {
|
|
12
|
+
for (const field of ['production_task_id', 'model', 'profile', 'prompt']) {
|
|
13
|
+
getRequiredString(payload, field);
|
|
14
|
+
}
|
|
15
|
+
if (!Array.isArray(payload.media) || payload.media.length === 0) {
|
|
16
|
+
throw new CliCommandError('media must be a non-empty JSON array', 'VALIDATION_ERROR');
|
|
17
|
+
}
|
|
18
|
+
if (!Array.isArray(payload.criteria) || payload.criteria.length === 0) {
|
|
19
|
+
throw new CliCommandError('criteria must be a non-empty JSON array', 'VALIDATION_ERROR');
|
|
20
|
+
}
|
|
21
|
+
const candidates = payload.media.filter((item) => isJsonRecord(item) && item.role === 'candidate');
|
|
22
|
+
if (candidates.length !== 1) {
|
|
23
|
+
throw new CliCommandError('media must contain exactly one candidate', 'VALIDATION_ERROR');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
11
26
|
function normalizeOperation(value) {
|
|
12
27
|
return value.trim().replace(/^\/+/, '');
|
|
13
28
|
}
|
|
@@ -174,6 +189,14 @@ export const aiGatewayCommands = {
|
|
|
174
189
|
});
|
|
175
190
|
return { data: result.data, requestId: result.requestId };
|
|
176
191
|
},
|
|
192
|
+
'media-understand': async ({ client, payload }) => {
|
|
193
|
+
validateMediaUnderstandingPayload(payload);
|
|
194
|
+
const result = await client.request('/api/agent/ai-gateway/media/understand', {
|
|
195
|
+
method: 'POST',
|
|
196
|
+
body: payload,
|
|
197
|
+
});
|
|
198
|
+
return { data: result.data, requestId: result.requestId };
|
|
199
|
+
},
|
|
177
200
|
'image-generate': async ({ client, payload }) => {
|
|
178
201
|
const result = await client.request('/api/agent/ai-gateway/images/generations', {
|
|
179
202
|
method: 'POST',
|
package/dist/lib/flags.js
CHANGED
|
@@ -100,7 +100,7 @@ export function getCliHelpText() {
|
|
|
100
100
|
' agent-production create | status | cancel | finalize | autopilot-binding | events | metrics | multica-comment-payload | node claim|inputs|complete|submit|block|fail|retry|expire | blocker resolve | artifact submit|list | asset-job poll|retry|revise|attach-artifact|fail | gate evaluate|results',
|
|
101
101
|
' aihub-production schema | start | status | retry',
|
|
102
102
|
' character search | create | get',
|
|
103
|
-
' ai-gateway capabilities | request | image-generate | image-edit | video-create | video-get | seed-audio-create | seed-audio-get | music-submit | music-get | tts-create | tts-get',
|
|
103
|
+
' ai-gateway capabilities | request | media-understand | image-generate | image-edit | video-create | video-get | seed-audio-create | seed-audio-get | music-submit | music-get | tts-create | tts-get',
|
|
104
104
|
'',
|
|
105
105
|
'Config precedence:',
|
|
106
106
|
' AIHUB_AGENT_TOKEN / BRANCH_VIDEO_AGENT_BASE_URL > stdin JSON or --token-file > command flags',
|