@mindscraft/branch-video-agent-cli 0.3.2 → 0.3.3
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 +25 -8
- package/dist/commands/aiGateway.js +24 -0
- package/dist/lib/flags.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -127,20 +127,37 @@ AI Gateway 图片生成示例:
|
|
|
127
127
|
'@ | npm exec --yes --package=@mindscraft/branch-video-agent-cli branch-video-agent -- ai-gateway image-generate -- --raw
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
AI Gateway 视频生成并等待示例:
|
|
131
|
-
|
|
132
|
-
```powershell
|
|
133
|
-
@'
|
|
130
|
+
AI Gateway 视频生成并等待示例:
|
|
131
|
+
|
|
132
|
+
```powershell
|
|
133
|
+
@'
|
|
134
134
|
{
|
|
135
135
|
"model": "doubao-seedance-2-0-260128",
|
|
136
136
|
"input": {
|
|
137
137
|
"prompt": "镜头推进到实验台,卡通猫老师点亮一个小灯泡"
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
'@ | npm exec --yes --package=@mindscraft/branch-video-agent-cli branch-video-agent -- ai-gateway video-create -- --wait --raw
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
'@ | npm exec --yes --package=@mindscraft/branch-video-agent-cli branch-video-agent -- ai-gateway video-create -- --wait --raw
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
AI Gateway Seed Audio 音频生成并等待示例:
|
|
144
|
+
|
|
145
|
+
```powershell
|
|
146
|
+
@'
|
|
147
|
+
{
|
|
148
|
+
"model": "seed-audio-1.0",
|
|
149
|
+
"text_prompt": "温柔的女声朗读:欢迎使用豆包语音合成服务。背景加入轻柔科技感铺底音乐。",
|
|
150
|
+
"audio_config": {
|
|
151
|
+
"format": "mp3",
|
|
152
|
+
"sample_rate": 24000
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
'@ | npm exec --yes --package=@mindscraft/branch-video-agent-cli branch-video-agent -- ai-gateway seed-audio-create -- --wait --raw
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`tts-create` / `tts-get` 是 Seed Audio 的历史兼容别名;新脚本优先使用 `seed-audio-create` / `seed-audio-get`。
|
|
159
|
+
|
|
160
|
+
## 在仓库内构建发布包
|
|
144
161
|
|
|
145
162
|
从仓库根目录执行:
|
|
146
163
|
|
|
@@ -97,6 +97,26 @@ async function getMusicStatus(context, operation, id) {
|
|
|
97
97
|
query: { id },
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
async function createSeedAudio(context) {
|
|
101
|
+
const result = await context.client.request('/api/agent/ai-gateway/tts/create', {
|
|
102
|
+
method: 'POST',
|
|
103
|
+
body: context.payload,
|
|
104
|
+
});
|
|
105
|
+
if (!context.flags.wait) {
|
|
106
|
+
return { data: result.data, requestId: result.requestId };
|
|
107
|
+
}
|
|
108
|
+
const taskId = extractTaskId(result.data);
|
|
109
|
+
const query = pickDefined(context.payload, ['model']);
|
|
110
|
+
return waitForGatewayTask(context, result.data, () => context.client.request(`/api/agent/ai-gateway/tts/query/${encodeURIComponent(taskId)}`, { method: 'GET', query }));
|
|
111
|
+
}
|
|
112
|
+
async function getSeedAudio({ client, payload }) {
|
|
113
|
+
const taskId = getRequiredString(payload, 'taskId');
|
|
114
|
+
const result = await client.request(`/api/agent/ai-gateway/tts/query/${encodeURIComponent(taskId)}`, {
|
|
115
|
+
method: 'GET',
|
|
116
|
+
query: pickDefined(payload, ['model']),
|
|
117
|
+
});
|
|
118
|
+
return { data: result.data, requestId: result.requestId };
|
|
119
|
+
}
|
|
100
120
|
export const aiGatewayCommands = {
|
|
101
121
|
capabilities: async ({ client }) => {
|
|
102
122
|
const result = await client.request('/api/agent/ai-gateway/capabilities', {
|
|
@@ -153,6 +173,10 @@ export const aiGatewayCommands = {
|
|
|
153
173
|
});
|
|
154
174
|
return { data: result.data, requestId: result.requestId };
|
|
155
175
|
},
|
|
176
|
+
'seed-audio-create': createSeedAudio,
|
|
177
|
+
'seed-audio-get': getSeedAudio,
|
|
178
|
+
'tts-create': createSeedAudio,
|
|
179
|
+
'tts-get': getSeedAudio,
|
|
156
180
|
'music-submit': async (context) => {
|
|
157
181
|
const operation = normalizeOperation(getRequiredString(context.payload, 'operation'));
|
|
158
182
|
const body = context.payload.body === undefined
|
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 | music-submit | music-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',
|
|
104
104
|
'',
|
|
105
105
|
'Config precedence:',
|
|
106
106
|
' AIHUB_AGENT_TOKEN / BRANCH_VIDEO_AGENT_BASE_URL > stdin JSON or --token-file > command flags',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindscraft/branch-video-agent-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Published CLI for branch-video and AIHub agent APIs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
"prepack": "npm run build",
|
|
34
34
|
"smoke:help": "npm run build && node dist/bin.js --help"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|