@lingjingai/lj-awb-cli 0.5.6 → 0.5.9
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 +6 -3
- package/package.json +2 -2
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/api.js +12 -2
- package/packages/awb-core/src/commands.js +81 -7
- package/packages/awb-core/src/common.js +6 -0
- package/packages/awb-core/src/output.js +26 -8
- package/packages/awb-core/src/services.js +319 -18
- package/packages/awb-core/src/standalone.js +28 -9
- package/skills/lj-awb/SKILL.md +6 -5
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create.md +5 -2
- package/skills/lj-awb/modules/driver.md +7 -7
- package/skills/lj-awb/modules/model.md +6 -3
- package/skills/lj-awb/modules/project.md +14 -0
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@ CLI 本身只负责平台调用、参数校验、人类友好输出、机器可
|
|
|
20
20
|
| 账号 | `account` | 用户、团队和登录上下文 |
|
|
21
21
|
| 项目 | `project` | 项目组查询、切换、创建和更新 |
|
|
22
22
|
| 积分 | `credits` | 可扣积分余额、项目组预算、任务用量统计 |
|
|
23
|
-
| 模型 | `model` | 生图 /
|
|
23
|
+
| 模型 | `model` | 生图 / 生视频 / 音频模型发现、模型参数白名单 |
|
|
24
24
|
| 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
|
|
25
|
-
| 创建 | `create` |
|
|
25
|
+
| 创建 | `create` | 生图、生视频、音频、主体、音色、素材和去字幕提交 |
|
|
26
26
|
| 任务 | `task` | 任务列表、等待、任务台账和台账轮询 |
|
|
27
27
|
|
|
28
28
|
## 环境要求
|
|
@@ -165,6 +165,7 @@ lj-awb credits balance
|
|
|
165
165
|
lj-awb credits usage --project-group-no <no> --last-hours 24
|
|
166
166
|
lj-awb model image-models --model Banana
|
|
167
167
|
lj-awb model video-models --model Seedance
|
|
168
|
+
lj-awb model audio-models --model "Seed Audio"
|
|
168
169
|
lj-awb model input-guide
|
|
169
170
|
lj-awb model options --model-group-code <modelGroupCode>
|
|
170
171
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
@@ -175,6 +176,8 @@ lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
|
175
176
|
```bash
|
|
176
177
|
lj-awb create image ... --dry-run
|
|
177
178
|
lj-awb create image ... --yes
|
|
179
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --dry-run
|
|
180
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --yes
|
|
178
181
|
```
|
|
179
182
|
|
|
180
183
|
缺少 `--yes` 时,CLI 返回 `confirmation_required`,退出码为 `10`。`task wait` 超时返回 `task_still_running`,退出码为 `20`。
|
|
@@ -217,7 +220,7 @@ lj-awb model options --model-group-code <modelGroupCode>
|
|
|
217
220
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
218
221
|
```
|
|
219
222
|
|
|
220
|
-
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
223
|
+
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video` / `create audio`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
221
224
|
|
|
222
225
|
## 示例:参考图生成视频
|
|
223
226
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/lj-awb-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build:pre-publish": "node build/pre-publish.mjs",
|
|
25
25
|
"build:prod": "node build/prod.mjs",
|
|
26
26
|
"check": "npm run check:local && npm run check:real",
|
|
27
|
-
"check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs",
|
|
27
|
+
"check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node --check tests/test-project-members.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs tests/test-project-members.mjs",
|
|
28
28
|
"check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
|
|
29
29
|
"test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
|
|
30
30
|
"smoke": "packages/awb-cli/bin/lj-awb --help && packages/awb-cli/bin/lj-awb auth status -f json && packages/awb-cli/bin/lj-awb system && packages/awb-cli/bin/lj-awb auth && packages/awb-cli/bin/lj-awb account && packages/awb-cli/bin/lj-awb project && packages/awb-cli/bin/lj-awb credits && packages/awb-cli/bin/lj-awb upload && packages/awb-cli/bin/lj-awb model && packages/awb-cli/bin/lj-awb create && packages/awb-cli/bin/lj-awb task && packages/awb-cli/bin/lj-awb schema -f json >/dev/null",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Standalone CLI for Lingjing AWB",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@lingjingai/awb-core": "0.5.
|
|
16
|
+
"@lingjingai/awb-core": "0.5.9"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -163,8 +163,10 @@ export async function fetchGroupAccessKey({ userId, groupId }) {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
export async function fetchProjectGroupUsers() {
|
|
167
|
-
return await apiFetch('/api/anime/workbench/projectGroup/getGroupAllUser', {
|
|
166
|
+
export async function fetchProjectGroupUsers(projectGroupNo) {
|
|
167
|
+
return await apiFetch('/api/anime/workbench/projectGroup/getGroupAllUser', {
|
|
168
|
+
method: 'GET', query: { projectGroupNo },
|
|
169
|
+
});
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
export async function fetchProjectGroupIntegral(projectGroupNo) {
|
|
@@ -234,6 +236,14 @@ export async function createVideoTask(payload = {}) {
|
|
|
234
236
|
return await apiFetch('/api/material/creation/videoCreate', { body: payload });
|
|
235
237
|
}
|
|
236
238
|
|
|
239
|
+
export async function fetchAudioFee(payload = {}) {
|
|
240
|
+
return await apiFetch('/api/material/creation/audioCreateFeeCalc', { body: payload });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export async function createAudioTask(payload = {}) {
|
|
244
|
+
return await apiFetch('/api/material/creation/audioCreate', { body: payload });
|
|
245
|
+
}
|
|
246
|
+
|
|
237
247
|
export async function fetchTaskInfo(taskId) {
|
|
238
248
|
return await apiFetch('/api/material/creation/task/info', {
|
|
239
249
|
method: 'GET',
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
assetGroupUpdate,
|
|
10
10
|
assetMatchActor,
|
|
11
11
|
assetReviewModels,
|
|
12
|
+
audioCreate,
|
|
13
|
+
audioFee,
|
|
12
14
|
assetRegister,
|
|
13
15
|
authLogin,
|
|
14
16
|
authLogout,
|
|
@@ -84,7 +86,7 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
|
|
|
84
86
|
const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
|
|
85
87
|
const MODEL_LIST_ARGS = [
|
|
86
88
|
{ name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
|
|
87
|
-
{ name: 'usage', valueName: 'usage', description: '模型用途:image
|
|
89
|
+
{ name: 'usage', valueName: 'usage', description: '模型用途:image=IMAGE_CREATE,video=VIDEO_CREATE,audio=AUDIO_CREATE。取值大小写不敏感' },
|
|
88
90
|
{ name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
|
|
89
91
|
{ name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
|
|
90
92
|
{ name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
|
|
@@ -312,11 +314,11 @@ export function registerAwbCommands(cli) {
|
|
|
312
314
|
|
|
313
315
|
cli({
|
|
314
316
|
name: 'project users',
|
|
315
|
-
description: commandHelp('
|
|
316
|
-
examples: ['lj-awb project users'],
|
|
317
|
+
description: commandHelp('列出团队可选成员;指定项目组时返回该组成员选中状态', {
|
|
318
|
+
examples: ['lj-awb project users', 'lj-awb project users --project-group-no <no>'],
|
|
317
319
|
}),
|
|
318
|
-
args: [],
|
|
319
|
-
func: async () => ({ users: normalizeRows(await fetchProjectGroupUsers()) }),
|
|
320
|
+
args: [PROJECT_GROUP_ARG],
|
|
321
|
+
func: async (_ctx, kwargs) => ({ users: normalizeRows(await fetchProjectGroupUsers(kwargs.projectGroupNo)) }),
|
|
320
322
|
});
|
|
321
323
|
|
|
322
324
|
cli({
|
|
@@ -340,16 +342,18 @@ export function registerAwbCommands(cli) {
|
|
|
340
342
|
|
|
341
343
|
cli({
|
|
342
344
|
name: 'project update',
|
|
343
|
-
description: commandHelp('
|
|
345
|
+
description: commandHelp('修改项目组名称、积分上限或追加成员', {
|
|
344
346
|
examples: [
|
|
345
347
|
'lj-awb project update --project-group-no <no> --point 1000 --dry-run',
|
|
346
348
|
'lj-awb project update --project-group-no <no> --name "新名称" --yes',
|
|
349
|
+
'lj-awb project update --project-group-no <no> --add-user-ids <id1,id2> --dry-run',
|
|
347
350
|
],
|
|
348
351
|
}),
|
|
349
352
|
args: [
|
|
350
353
|
PROJECT_GROUP_ARG,
|
|
351
354
|
{ name: 'name', valueName: 'name', description: '新的项目组名称' },
|
|
352
355
|
{ name: 'point', valueName: 'num', description: '新的项目组积分上限' },
|
|
356
|
+
{ name: 'add-user-ids', valueName: 'ids', description: '追加成员 userId,逗号分隔;保留已有成员和角色' },
|
|
353
357
|
DRY_RUN_ARG,
|
|
354
358
|
YES_ARG,
|
|
355
359
|
],
|
|
@@ -358,7 +362,7 @@ export function registerAwbCommands(cli) {
|
|
|
358
362
|
|
|
359
363
|
cli({
|
|
360
364
|
name: 'project ensure',
|
|
361
|
-
description: commandHelp('
|
|
365
|
+
description: commandHelp('确保项目组存在:找到同名项目组时补齐指定成员,否则创建', {
|
|
362
366
|
examples: [
|
|
363
367
|
'lj-awb project ensure --name "短剧项目A" --point 1000 --dry-run',
|
|
364
368
|
'lj-awb project ensure --name "短剧项目A" --point 1000 --yes',
|
|
@@ -482,6 +486,15 @@ export function registerAwbCommands(cli) {
|
|
|
482
486
|
func: async (_ctx, kwargs) => listModels('video', kwargs),
|
|
483
487
|
});
|
|
484
488
|
|
|
489
|
+
cli({
|
|
490
|
+
name: 'model audio-models',
|
|
491
|
+
description: commandHelp('查询 CLI 可用音频生成模型', {
|
|
492
|
+
examples: ['lj-awb model audio-models', 'lj-awb model audio-models --all'],
|
|
493
|
+
}),
|
|
494
|
+
args: MODEL_LIST_ARGS,
|
|
495
|
+
func: async (_ctx, kwargs) => listModels('audio', kwargs),
|
|
496
|
+
});
|
|
497
|
+
|
|
485
498
|
cli({
|
|
486
499
|
name: 'model asset-review-models',
|
|
487
500
|
description: commandHelp('查询支持素材加白的模型组与平台平铺关系', {
|
|
@@ -714,6 +727,67 @@ export function registerAwbCommands(cli) {
|
|
|
714
727
|
func: async (_ctx, kwargs) => videoCreateBatch(kwargs),
|
|
715
728
|
});
|
|
716
729
|
|
|
730
|
+
cli({
|
|
731
|
+
name: 'create audio-fee',
|
|
732
|
+
description: commandHelp('计算音频生成预计积分', {
|
|
733
|
+
examples: [
|
|
734
|
+
'lj-awb create audio-fee --model-group-code <code> --prompt "海浪与钢琴" --duration 12',
|
|
735
|
+
],
|
|
736
|
+
hint: '积分按时长向上取整:每 1-6 秒 1 积分。默认输出 mp3。',
|
|
737
|
+
}),
|
|
738
|
+
args: [
|
|
739
|
+
MODEL_GROUP_ARG,
|
|
740
|
+
PROJECT_GROUP_ARG,
|
|
741
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
742
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
743
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
744
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
745
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
746
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
747
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
748
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
749
|
+
...MODEL_PARAM_ARGS,
|
|
750
|
+
RESOURCE_ARG,
|
|
751
|
+
RESOURCES_JSON_ARG,
|
|
752
|
+
FEE_DRY_RUN_ARG,
|
|
753
|
+
],
|
|
754
|
+
allowDynamicModelParams: true,
|
|
755
|
+
func: async (_ctx, kwargs) => audioFee(kwargs),
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
cli({
|
|
759
|
+
name: 'create audio',
|
|
760
|
+
description: commandHelp('提交音频生成任务;正式执行需要 --yes', {
|
|
761
|
+
examples: [
|
|
762
|
+
'lj-awb create audio --model-group-code <code> --prompt "海浪与钢琴" --duration 12 --dry-run',
|
|
763
|
+
'lj-awb create audio --model-group-code <code> --prompt "延续参考音频氛围" --duration 12 --resource audio:reference=./ref.mp3 --yes',
|
|
764
|
+
'lj-awb create audio --model-group-code <code> --prompt "根据画面生成环境声" --duration 8 --resource image:reference=./scene.png --yes',
|
|
765
|
+
],
|
|
766
|
+
hint: '最多 3 个参考音频或 1 张参考图,两类素材不能混用;默认输出 mp3。',
|
|
767
|
+
}),
|
|
768
|
+
args: [
|
|
769
|
+
MODEL_GROUP_ARG,
|
|
770
|
+
PROJECT_GROUP_ARG,
|
|
771
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
772
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
773
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
774
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
775
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
776
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
777
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
778
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
779
|
+
...MODEL_PARAM_ARGS,
|
|
780
|
+
RESOURCE_ARG,
|
|
781
|
+
RESOURCES_JSON_ARG,
|
|
782
|
+
TASK_RECORD_ARG,
|
|
783
|
+
...CREATE_WAIT_ARGS,
|
|
784
|
+
DRY_RUN_ARG,
|
|
785
|
+
YES_ARG,
|
|
786
|
+
],
|
|
787
|
+
allowDynamicModelParams: true,
|
|
788
|
+
func: async (_ctx, kwargs) => audioCreate(kwargs),
|
|
789
|
+
});
|
|
790
|
+
|
|
717
791
|
cli({
|
|
718
792
|
name: 'create video-subtitle-removal',
|
|
719
793
|
description: commandHelp('基于 material 来源视频任务提交去字幕任务', {
|
|
@@ -32,6 +32,7 @@ export const TASK_UPLOAD_SCENE = {
|
|
|
32
32
|
IMAGE_EDIT: 'material-image-edit',
|
|
33
33
|
VIDEO_CREATE: 'material-video-create',
|
|
34
34
|
VIDEO_GROUP: 'material-video-create',
|
|
35
|
+
AUDIO_CREATE: 'material-video-create',
|
|
35
36
|
SUBJECT: 'material-video-create',
|
|
36
37
|
ASSET_REVIEW: 'asset-review',
|
|
37
38
|
DEFAULT: 'material-image-draw',
|
|
@@ -345,6 +346,11 @@ export function guessMimeType(filePath) {
|
|
|
345
346
|
return 'audio/mpeg';
|
|
346
347
|
case '.wav':
|
|
347
348
|
return 'audio/wav';
|
|
349
|
+
case '.ogg':
|
|
350
|
+
case '.oga':
|
|
351
|
+
return 'audio/ogg';
|
|
352
|
+
case '.pcm':
|
|
353
|
+
return 'audio/L16';
|
|
348
354
|
case '.m4a':
|
|
349
355
|
return 'audio/mp4';
|
|
350
356
|
case '.mp4':
|
|
@@ -212,7 +212,7 @@ function normalizeDryRun(data = {}) {
|
|
|
212
212
|
|
|
213
213
|
function submissionStatusCommand(commandName, data = {}) {
|
|
214
214
|
if (!data?.taskId) return null;
|
|
215
|
-
if (commandName === 'create image' || commandName === 'create video') {
|
|
215
|
+
if (commandName === 'create image' || commandName === 'create video' || commandName === 'create audio') {
|
|
216
216
|
return `${commandPrefix()} task status --task-id ${data.taskId}`;
|
|
217
217
|
}
|
|
218
218
|
return null;
|
|
@@ -530,12 +530,14 @@ export function normalizeOutputData(commandName, data) {
|
|
|
530
530
|
switch (commandName) {
|
|
531
531
|
case 'create image':
|
|
532
532
|
case 'create video':
|
|
533
|
+
case 'create audio':
|
|
533
534
|
case 'create video-super-resolution':
|
|
534
535
|
return normalizeTaskSubmission(commandName, data);
|
|
535
536
|
case 'create video-subtitle-removal':
|
|
536
537
|
return normalizeSubtitleSubmission(data);
|
|
537
538
|
case 'create image-fee':
|
|
538
539
|
case 'create video-fee':
|
|
540
|
+
case 'create audio-fee':
|
|
539
541
|
case 'create video-super-resolution-fee':
|
|
540
542
|
return normalizeFee(data);
|
|
541
543
|
case 'account info':
|
|
@@ -569,6 +571,7 @@ export function normalizeOutputData(commandName, data) {
|
|
|
569
571
|
return normalizeAsset(data);
|
|
570
572
|
case 'model image-models':
|
|
571
573
|
case 'model video-models':
|
|
574
|
+
case 'model audio-models':
|
|
572
575
|
case 'model asset-review-models':
|
|
573
576
|
return normalizeList(data, ['models', 'items', 'rows']);
|
|
574
577
|
case 'account teams':
|
|
@@ -1234,6 +1237,7 @@ function formatModelInputGuideOutput(data = {}) {
|
|
|
1234
1237
|
lines.push('next:');
|
|
1235
1238
|
pushSectionKeyValue(lines, 'imageModels', `${commandPrefix()} model image-models --model <keyword>`);
|
|
1236
1239
|
pushSectionKeyValue(lines, 'videoModels', `${commandPrefix()} model video-models --model <keyword>`);
|
|
1240
|
+
pushSectionKeyValue(lines, 'audioModels', `${commandPrefix()} model audio-models --model <keyword>`);
|
|
1237
1241
|
pushSectionKeyValue(lines, 'options', `${commandPrefix()} model options --model-group-code <modelGroupCode>`);
|
|
1238
1242
|
return `${lines.join('\n')}\n`;
|
|
1239
1243
|
}
|
|
@@ -1243,7 +1247,7 @@ function defaultJsonCommand(commandName) {
|
|
|
1243
1247
|
}
|
|
1244
1248
|
|
|
1245
1249
|
function modelListNextCommand(commandName) {
|
|
1246
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') {
|
|
1250
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') {
|
|
1247
1251
|
return `${commandPrefix()} model options --model-group-code <modelGroupCode>`;
|
|
1248
1252
|
}
|
|
1249
1253
|
if (commandName === 'model asset-review-models') {
|
|
@@ -1253,7 +1257,7 @@ function modelListNextCommand(commandName) {
|
|
|
1253
1257
|
}
|
|
1254
1258
|
|
|
1255
1259
|
function modelListAgentHint(commandName) {
|
|
1256
|
-
if (commandName !== 'model image-models' && commandName !== 'model video-models') return null;
|
|
1260
|
+
if (commandName !== 'model image-models' && commandName !== 'model video-models' && commandName !== 'model audio-models') return null;
|
|
1257
1261
|
return '对每个候选运行 model options,并把候选模型、参数取值、默认值和资源能力展示给用户后再推荐或进入 fee/dry-run。';
|
|
1258
1262
|
}
|
|
1259
1263
|
|
|
@@ -1296,6 +1300,7 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1296
1300
|
'credits redeem': 'redeem_result',
|
|
1297
1301
|
'model image-models': 'model_list',
|
|
1298
1302
|
'model video-models': 'model_list',
|
|
1303
|
+
'model audio-models': 'model_list',
|
|
1299
1304
|
'model asset-review-models': 'asset_review_model_list',
|
|
1300
1305
|
'model options': 'model_options',
|
|
1301
1306
|
'model create-spec': 'model_create_spec',
|
|
@@ -1306,6 +1311,8 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1306
1311
|
'create image-batch': 'batch_task_submission',
|
|
1307
1312
|
'create video-fee': 'fee_estimate',
|
|
1308
1313
|
'create video': 'task_submission',
|
|
1314
|
+
'create audio-fee': 'fee_estimate',
|
|
1315
|
+
'create audio': 'task_submission',
|
|
1309
1316
|
'create video-batch': 'batch_task_submission',
|
|
1310
1317
|
'create video-super-resolution-fee': 'fee_estimate',
|
|
1311
1318
|
'create video-super-resolution': 'task_submission',
|
|
@@ -1391,6 +1398,7 @@ const COMMAND_TITLES = {
|
|
|
1391
1398
|
'project ensure': '项目组确保结果',
|
|
1392
1399
|
'create image': '生图任务提交结果',
|
|
1393
1400
|
'create video': '生视频任务提交结果',
|
|
1401
|
+
'create audio': '音频任务提交结果',
|
|
1394
1402
|
'create image-batch': '批量生图提交结果',
|
|
1395
1403
|
'create video-batch': '批量生视频提交结果',
|
|
1396
1404
|
'create video-super-resolution-fee': '视频超分积分预估',
|
|
@@ -1636,6 +1644,7 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
|
|
|
1636
1644
|
'upload files': ['dryRun', 'fileCount', 'localFileCount', 'resourceConversionCount'],
|
|
1637
1645
|
'create image': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'ratio', 'quality', 'generateNum', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1638
1646
|
'create video': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'ratio', 'quality', 'needAudio', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1647
|
+
'create audio': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'audioFormat', 'resourceCount', 'localFileCount'],
|
|
1639
1648
|
'create image-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1640
1649
|
'create video-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1641
1650
|
'create video-super-resolution-fee': ['dryRun', 'action', 'objectName', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
|
|
@@ -2275,15 +2284,17 @@ function namedListTitle(listKey) {
|
|
|
2275
2284
|
function localizedTaskKind(value) {
|
|
2276
2285
|
if (value === 'image' || value === 'IMAGE_CREATE') return '图片生成';
|
|
2277
2286
|
if (value === 'video' || value === 'VIDEO_CREATE') return '视频生成';
|
|
2287
|
+
if (value === 'audio' || value === 'AUDIO_CREATE') return '音频生成';
|
|
2278
2288
|
return prettyValue(value);
|
|
2279
2289
|
}
|
|
2280
2290
|
|
|
2281
2291
|
function localizedInputMode(value, taskKind = '') {
|
|
2282
2292
|
const mode = String(value || '');
|
|
2283
2293
|
const isVideo = taskKind === 'video' || taskKind === 'VIDEO_CREATE';
|
|
2294
|
+
const isAudio = taskKind === 'audio' || taskKind === 'AUDIO_CREATE';
|
|
2284
2295
|
const labels = {
|
|
2285
|
-
prompt_only: isVideo ? '文本生成视频' : '文本生成图片',
|
|
2286
|
-
reference: isVideo ? '参考素材生成' : '参考图生成',
|
|
2296
|
+
prompt_only: isAudio ? '文本生成音频' : (isVideo ? '文本生成视频' : '文本生成图片'),
|
|
2297
|
+
reference: isAudio ? '参考素材生成音频' : (isVideo ? '参考素材生成' : '参考图生成'),
|
|
2287
2298
|
frames: '首帧/尾帧生成',
|
|
2288
2299
|
storyboard: '分镜多镜头',
|
|
2289
2300
|
keyframe: '关键帧生成',
|
|
@@ -2302,6 +2313,12 @@ function localizedParamKey(value) {
|
|
|
2302
2313
|
needAudio: '生成音频',
|
|
2303
2314
|
need_audio: '生成音频',
|
|
2304
2315
|
prompt_optimizer: '提示词增强',
|
|
2316
|
+
audio_format: '音频格式',
|
|
2317
|
+
sample_rate: '采样率',
|
|
2318
|
+
speech_rate: '语速',
|
|
2319
|
+
loudness_rate: '响度',
|
|
2320
|
+
pitch_rate: '音高',
|
|
2321
|
+
enable_subtitle: '生成字幕',
|
|
2305
2322
|
};
|
|
2306
2323
|
return labels[value] || value;
|
|
2307
2324
|
}
|
|
@@ -2589,7 +2606,7 @@ function pushReadableRecord(lines, record = {}, fields = [], options = {}) {
|
|
|
2589
2606
|
function formatPrettyModelList(commandName, data = {}, context = {}) {
|
|
2590
2607
|
const normalized = normalizeOutputData(commandName, data);
|
|
2591
2608
|
const rows = Array.isArray(normalized.models) ? normalized.models : [];
|
|
2592
|
-
const taskKind = commandName === 'model video-models' ? 'video' : 'image';
|
|
2609
|
+
const taskKind = commandName === 'model video-models' ? 'video' : (commandName === 'model audio-models' ? 'audio' : 'image');
|
|
2593
2610
|
const limit = listLimitFor(commandName, context, rows);
|
|
2594
2611
|
const visibleRows = rows.slice(0, Number.isFinite(limit) ? limit : rows.length);
|
|
2595
2612
|
const lines = [prettyTitle(commandName, 'model_list', normalized), ''];
|
|
@@ -2889,6 +2906,7 @@ function formatPrettyModelInputGuide(data = {}, context = {}) {
|
|
|
2889
2906
|
renderNextActions(lines, [
|
|
2890
2907
|
{ label: '生图模型', value: `${commandPrefix()} model image-models --model <keyword>` },
|
|
2891
2908
|
{ label: '生视频模型', value: `${commandPrefix()} model video-models --model <keyword>` },
|
|
2909
|
+
{ label: '音频模型', value: `${commandPrefix()} model audio-models --model <keyword>` },
|
|
2892
2910
|
{ label: '模型参数', value: `${commandPrefix()} model options --model-group-code <modelGroupCode>` },
|
|
2893
2911
|
...(context.textCommand ? [{ label: 'Agent 读取', value: context.textCommand }] : []),
|
|
2894
2912
|
...(context.jsonCommand ? [{ label: '完整 JSON', value: context.jsonCommand }] : []),
|
|
@@ -2929,7 +2947,7 @@ function formatPrettyGeneric(commandName, data, context = {}) {
|
|
|
2929
2947
|
export function formatPrettyOutput(commandName, data, context = {}) {
|
|
2930
2948
|
if (commandName === 'schema') return formatPrettySchema(data, context);
|
|
2931
2949
|
if (commandName === 'doctor') return formatPrettyEnvironment(data, context);
|
|
2932
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') return formatPrettyModelList(commandName, data, context);
|
|
2950
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') return formatPrettyModelList(commandName, data, context);
|
|
2933
2951
|
if (commandName === 'model options') return formatPrettyModelOptions(data, context);
|
|
2934
2952
|
if (commandName === 'model create-spec') return formatPrettyModelCreateSpec(data, context);
|
|
2935
2953
|
if (commandName === 'model input-guide') return formatPrettyModelInputGuide(data, context);
|
|
@@ -3032,7 +3050,7 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
3032
3050
|
if (!isPlainObject(normalized)) return `ok ${commandName}\nvalue=${shortValue(normalized)}\n`;
|
|
3033
3051
|
const lines = [`ok ${commandName}`];
|
|
3034
3052
|
const list = firstList(normalized);
|
|
3035
|
-
const isModelList = commandName === 'model image-models' || commandName === 'model video-models';
|
|
3053
|
+
const isModelList = commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models';
|
|
3036
3054
|
const scalarLine = renderRecord(
|
|
3037
3055
|
normalized,
|
|
3038
3056
|
[
|