@lingjingai/lj-awb-cli 0.5.25 → 0.5.26
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/package.json +1 -1
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/commands.js +12 -4
- package/packages/awb-core/src/output.js +3 -2
- package/packages/awb-core/src/services.js +35 -6
- package/packages/awb-core/src/standalone.js +2 -2
- package/skills/lj-awb/SKILL.md +2 -2
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create.md +3 -1
- package/skills/lj-awb/modules/video.md +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.26",
|
|
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.26"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -810,12 +810,20 @@ export function registerAwbCommands(cli) {
|
|
|
810
810
|
|
|
811
811
|
cli({
|
|
812
812
|
name: 'create video-subtitle-removal',
|
|
813
|
-
description: commandHelp('
|
|
814
|
-
examples: [
|
|
815
|
-
|
|
813
|
+
description: commandHelp('为来源视频任务、本地文件或视频地址去字幕', {
|
|
814
|
+
examples: [
|
|
815
|
+
'lj-awb create video-subtitle-removal --file ./clip.mp4 --duration 5 --yes',
|
|
816
|
+
'lj-awb create video-subtitle-removal --video-url https://example.com/clip.mp4 --dry-run',
|
|
817
|
+
'lj-awb create video-subtitle-removal --source-task-id <videoTaskId> --dry-run',
|
|
818
|
+
],
|
|
819
|
+
hint: '本地文件和视频地址默认使用火山标准版;提交需要 --yes。',
|
|
816
820
|
}),
|
|
817
821
|
args: [
|
|
818
|
-
{ name: 'source-task-id', valueName: 'id', description: '
|
|
822
|
+
{ name: 'source-task-id', valueName: 'id', description: 'Material 中已成功的来源视频任务 ID' },
|
|
823
|
+
{ name: 'file', valueName: 'path', description: '本地 MP4,确认后自动上传' },
|
|
824
|
+
{ name: 'video-url', valueName: 'url|path', description: 'HTTP(S) 视频 URL 或 COS 对象路径' },
|
|
825
|
+
MODEL_GROUP_ARG,
|
|
826
|
+
{ name: 'duration', valueName: 'seconds', description: '文件或 URL 的实际时长,向上取整;省略时由平台探测' },
|
|
819
827
|
PROJECT_GROUP_ARG,
|
|
820
828
|
TASK_RECORD_ARG,
|
|
821
829
|
DRY_RUN_ARG,
|
|
@@ -313,6 +313,7 @@ function normalizeSubtitleSubmission(data = {}) {
|
|
|
313
313
|
taskId: data.taskId,
|
|
314
314
|
taskType: data.taskType,
|
|
315
315
|
sourceTaskId: data.sourceTaskId,
|
|
316
|
+
modelGroupCode: data.modelGroupCode,
|
|
316
317
|
projectGroupNo: data.projectGroupNo,
|
|
317
318
|
pointCost: data.pointCost,
|
|
318
319
|
billingPointBalance: data.billingPointBalance ?? data.teamPointBalance,
|
|
@@ -1666,7 +1667,7 @@ const DETAIL_FIELDS_BY_KIND = {
|
|
|
1666
1667
|
subject_voice_create_result: ['created', 'name', 'voiceRecordId', 'reqTaskId', 'voiceId', 'externalId', 'status', 'taskStatus', 'errorMessage', 'nextVoiceArg'],
|
|
1667
1668
|
subject_voice_status: ['name', 'voiceRecordId', 'reqTaskId', 'voiceId', 'externalId', 'status', 'taskStatus', 'errorMessage', 'isTerminal', 'nextVoiceArg'],
|
|
1668
1669
|
subtitle_task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'projectGroupNo', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
|
|
1669
|
-
subtitle_task_submission: ['submitted', 'taskId', 'taskType', 'sourceTaskId', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'nextCommand'],
|
|
1670
|
+
subtitle_task_submission: ['submitted', 'taskId', 'taskType', 'sourceTaskId', 'modelGroupCode', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'nextCommand'],
|
|
1670
1671
|
task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'benefitsId', 'gmtCreate', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
|
|
1671
1672
|
task_submission: ['taskId', 'taskType', 'objectName', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'points', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'uploadCount', 'nextCommand', 'statusCommand'],
|
|
1672
1673
|
update_result: ['checked', 'updated', 'updateAvailable', 'packageName', 'installer', 'previousVersion', 'currentVersion', 'latestVersion', 'command', 'skillUpdated', 'restartRecommended', 'message'],
|
|
@@ -1690,7 +1691,7 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
|
|
|
1690
1691
|
'create video-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1691
1692
|
'create video-super-resolution-fee': ['dryRun', 'action', 'objectName', 'targetResolution', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
|
|
1692
1693
|
'create video-super-resolution': ['dryRun', 'action', 'objectName', 'targetResolution', 'projectGroupNo', 'taskId', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'nextCommand'],
|
|
1693
|
-
'create video-subtitle-removal': ['dryRun', 'action', 'sourceTaskId', 'projectGroupNo'],
|
|
1694
|
+
'create video-subtitle-removal': ['dryRun', 'action', 'sourceTaskId', 'videoUrl', 'modelGroupCode', 'duration', 'projectGroupNo'],
|
|
1694
1695
|
'create asset-group': ['dryRun', 'action', 'platform', 'name', 'projectName'],
|
|
1695
1696
|
'create asset-group-update': ['dryRun', 'action', 'groupId', 'platform', 'name', 'projectName'],
|
|
1696
1697
|
'create asset': ['dryRun', 'action', 'groupId', 'platform', 'assetType', 'name', 'assetPath', 'validationLegal', 'conversionRequired', 'converted', 'conversionReason', 'conversionTargetFormat', 'conversionTargetWidth', 'conversionTargetHeight', 'conversionTargetPixels', 'conversionTargetFps', 'conversionTargetDuration', 'localFileCount', 'fileCount'],
|
|
@@ -6902,8 +6902,12 @@ export async function subtitleRemove(kwargs = {}) {
|
|
|
6902
6902
|
}
|
|
6903
6903
|
ensureConfirmed(kwargs, '提交视频去字幕任务会通过 material 创建任务并消耗积分,需要确认', {
|
|
6904
6904
|
action: 'create video-subtitle-removal',
|
|
6905
|
-
sourceTaskId: built.sourceTaskId,
|
|
6905
|
+
sourceTaskId: built.request.sourceTaskId,
|
|
6906
6906
|
});
|
|
6907
|
+
if (built.file) {
|
|
6908
|
+
const upload = await uploadLocalFile(built.file, { sceneType: CLI_TEMP_UPLOAD_SCENE });
|
|
6909
|
+
built.request.videoUrl = upload.backendPath;
|
|
6910
|
+
}
|
|
6907
6911
|
const feePayload = await awbApi.fetchVideoSubtitleRemovalFee(built.request).catch(() => null);
|
|
6908
6912
|
const estimate = await pointEstimate(feePayload, built.projectGroupNo).catch(() => ({}));
|
|
6909
6913
|
const payload = await awbApi.createVideoSubtitleRemovalTask(built.request);
|
|
@@ -6911,14 +6915,14 @@ export async function subtitleRemove(kwargs = {}) {
|
|
|
6911
6915
|
...estimate,
|
|
6912
6916
|
submitted: true,
|
|
6913
6917
|
taskType: 'VIDEO_SUBTITLE_REMOVAL',
|
|
6914
|
-
sourceTaskId: built.sourceTaskId,
|
|
6918
|
+
...compactRecord({ sourceTaskId: built.request.sourceTaskId, modelGroupCode: built.request.modelGroupCode }),
|
|
6915
6919
|
projectGroupNo: built.projectGroupNo,
|
|
6916
6920
|
});
|
|
6917
6921
|
await appendTaskRecord(kwargs, {
|
|
6918
6922
|
taskId: result.taskId,
|
|
6919
6923
|
taskType: 'VIDEO_SUBTITLE_REMOVAL',
|
|
6920
6924
|
projectGroupNo: built.projectGroupNo,
|
|
6921
|
-
promptSummary: `去字幕 sourceTaskId=${built.sourceTaskId}`,
|
|
6925
|
+
promptSummary: built.request.sourceTaskId ? `去字幕 sourceTaskId=${built.request.sourceTaskId}` : `去字幕 ${built.request.modelGroupCode}`,
|
|
6922
6926
|
});
|
|
6923
6927
|
return {
|
|
6924
6928
|
...result,
|
|
@@ -6930,9 +6934,31 @@ export async function subtitleRemove(kwargs = {}) {
|
|
|
6930
6934
|
|
|
6931
6935
|
async function buildSubtitleRemovalRequest(kwargs = {}, options = {}) {
|
|
6932
6936
|
const sourceTaskId = trimToNull(kwargs.sourceTaskId);
|
|
6933
|
-
|
|
6934
|
-
|
|
6937
|
+
const file = trimToNull(kwargs.file);
|
|
6938
|
+
let videoUrl = trimToNull(kwargs.videoUrl);
|
|
6939
|
+
if ([sourceTaskId, file, videoUrl].filter(Boolean).length !== 1) {
|
|
6940
|
+
throw argumentError('请选择一种视频来源:--source-task-id、--file 或 --video-url。');
|
|
6941
|
+
}
|
|
6942
|
+
if (videoUrl && !(isHttpUrl(videoUrl) && URL.canParse(videoUrl))
|
|
6943
|
+
&& !/^\/?(?:[\w-]+\/)+[^?#]+$/.test(videoUrl)) {
|
|
6944
|
+
throw argumentError('--video-url 必须是 HTTP(S) URL 或 COS 对象路径。');
|
|
6945
|
+
}
|
|
6946
|
+
const duration = kwargs.duration == null ? undefined : Number(kwargs.duration);
|
|
6947
|
+
if (duration !== undefined && (sourceTaskId || !Number.isInteger(duration) || duration < 1 || duration > 2147483647)) {
|
|
6948
|
+
throw argumentError('--duration 仅适用于文件或 URL,须为正整数秒。');
|
|
6949
|
+
}
|
|
6950
|
+
if (file) {
|
|
6951
|
+
const stat = await fs.stat(file).catch((error) => {
|
|
6952
|
+
if (error.code !== 'ENOENT') throw error;
|
|
6953
|
+
return null;
|
|
6954
|
+
});
|
|
6955
|
+
if (!stat?.isFile() || !stat.size || path.extname(file).toLowerCase() !== '.mp4') {
|
|
6956
|
+
throw argumentError('--file 必须指向存在且非空的本地 MP4。');
|
|
6957
|
+
}
|
|
6958
|
+
if (options.dryRun) videoUrl = dryRunBackendPath(file, CLI_TEMP_UPLOAD_SCENE);
|
|
6935
6959
|
}
|
|
6960
|
+
const modelGroupCode = trimToNull(kwargs.modelGroupCode)
|
|
6961
|
+
?? (sourceTaskId ? undefined : 'Volcengine_Subtitle_Removal_Standard_Group');
|
|
6936
6962
|
const dryRun = Boolean(options.dryRun);
|
|
6937
6963
|
const projectGroupNo = await resolveProjectGroupNo(kwargs.projectGroupNo, {
|
|
6938
6964
|
allowNull: true,
|
|
@@ -6943,10 +6969,13 @@ async function buildSubtitleRemovalRequest(kwargs = {}, options = {}) {
|
|
|
6943
6969
|
throw error;
|
|
6944
6970
|
});
|
|
6945
6971
|
return {
|
|
6946
|
-
|
|
6972
|
+
file,
|
|
6947
6973
|
projectGroupNo,
|
|
6948
6974
|
request: compactRecord({
|
|
6949
6975
|
sourceTaskId,
|
|
6976
|
+
videoUrl,
|
|
6977
|
+
duration,
|
|
6978
|
+
modelGroupCode,
|
|
6950
6979
|
projectGroupNo,
|
|
6951
6980
|
}),
|
|
6952
6981
|
};
|
|
@@ -602,7 +602,7 @@ const COMMAND_REQUIRED_ANY_OPTIONS = {
|
|
|
602
602
|
'create video': [['prompt', 'resource', 'resourcesJson']],
|
|
603
603
|
'create video-super-resolution-fee': [['objectName'], ['targetResolution']],
|
|
604
604
|
'create video-super-resolution': [['objectName'], ['targetResolution']],
|
|
605
|
-
'create video-subtitle-removal': [['sourceTaskId']],
|
|
605
|
+
'create video-subtitle-removal': [['sourceTaskId', 'file', 'videoUrl']],
|
|
606
606
|
'create asset-group-update': [['name', 'description', 'projectName']],
|
|
607
607
|
'create asset': [['file', 'url', 'backendPath']],
|
|
608
608
|
'create subject': [['resource'], ['modelCode']],
|
|
@@ -751,7 +751,7 @@ const PREFLIGHTS_BY_COMMAND = {
|
|
|
751
751
|
'create video-super-resolution': ['doctor --verify', 'create video-super-resolution --object-name <objectName> --target-resolution 1080P --dry-run'],
|
|
752
752
|
'create subject': ['doctor --verify', 'create subject --model-code tx|vidu --dry-run'],
|
|
753
753
|
'create subject-batch': ['doctor --verify', 'prepare JSONL input with modelCode', 'create subject-batch --dry-run'],
|
|
754
|
-
'create video-subtitle-removal': ['doctor --verify', 'create video-subtitle-removal --
|
|
754
|
+
'create video-subtitle-removal': ['doctor --verify', 'create video-subtitle-removal --dry-run'],
|
|
755
755
|
'create asset-group': ['model asset-review-models', 'create asset-group --platform <platform> --dry-run'],
|
|
756
756
|
'create asset-group-update': ['create asset-group-update --platform <platform> --dry-run'],
|
|
757
757
|
'create asset': ['model asset-review-models', 'create asset --platform <platform> --dry-run'],
|
package/skills/lj-awb/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lj-awb
|
|
3
|
-
version: 0.5.
|
|
3
|
+
version: 0.5.26
|
|
4
4
|
description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分余额/明细/用量(含充值购买与兑换码兑换)、模型发现、上传、统一 create 创建域、任务查询、视频超分。用户说生图、生视频、生成音频、积分明细、积分流水、充值记录、消耗记录、主体、音色、素材加白、去字幕时使用。正式生成、切换项目组、清空认证、兑换码等写入或扣费动作前必须确认。"
|
|
5
5
|
metadata:
|
|
6
6
|
bootstrap:
|
|
7
7
|
package: "@lingjingai/lj-awb-cli"
|
|
8
|
-
version: "0.5.
|
|
8
|
+
version: "0.5.26"
|
|
9
9
|
bin: "lj-awb"
|
|
10
10
|
cliHelp: "lj-awb --help"
|
|
11
11
|
---
|
package/skills/lj-awb/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.26
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
| `lj-awb create audio-fee ...` | 音频生成估价;按生成时长计算 |
|
|
17
17
|
| `lj-awb create video-super-resolution ...` | 基于 objectName 提交视频超分任务 |
|
|
18
18
|
| `lj-awb create video-super-resolution-fee ...` | 视频超分估价;先确认 objectName |
|
|
19
|
-
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> ...` |
|
|
19
|
+
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> ...` | 基于已成功的视频任务提交去字幕 |
|
|
20
|
+
| `lj-awb create video-subtitle-removal --file ./clip.mp4 --duration 5 --yes` | 上传本地 MP4,默认使用火山标准版去字幕 |
|
|
21
|
+
| `lj-awb create video-subtitle-removal --video-url <url> --yes` | 对 HTTP(S) 视频或 COS 对象提交火山标准版去字幕 |
|
|
20
22
|
| `lj-awb create subject-list ...` | 查询可复用主体,避免重复发布 |
|
|
21
23
|
| `lj-awb create subject --model-code tx|vidu ...` | 创建可复用主体 element |
|
|
22
24
|
| `lj-awb create subject-wait ...` | 等待主体 externalId 回填 |
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
| `lj-awb create video-super-resolution --object-name <objectName> --target-resolution 1080P\|2K --yes` | 基于 material objectName 和目标分辨率提交视频超分任务 |
|
|
18
18
|
| `lj-awb create video-super-resolution-fee --object-name <objectName> --target-resolution 1080P\|2K` | 计算指定目标分辨率的视频超分预计积分 |
|
|
19
19
|
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> --yes` | 基于来源视频任务提交去字幕任务 |
|
|
20
|
+
| `lj-awb create video-subtitle-removal --file ./clip.mp4 --duration 5 --yes` | 直接上传 MP4,用火山标准版去字幕 |
|
|
20
21
|
| `lj-awb task status --task-id <taskId>` | 查询任务状态 |
|
|
21
22
|
| `lj-awb task wait --task-id <taskId> --wait-seconds 300` | 等待任务结果 |
|
|
22
23
|
|
|
@@ -89,7 +90,7 @@ lj-awb create video \
|
|
|
89
90
|
- 视频超分传 `objectName` 和必填的 `targetResolution`(`1080P` / `2K`),通常是 material backendPath 或 COS 对象路径;显式指定目标档位时允许同档和降档增强(如原视频短边 1088 像素,目标选 1080P)。正式提交前先跑 `create video-super-resolution-fee`,再 `--dry-run`,确认后 `--yes`,返回后按 `nextCommand` 或 `task status --task-id <id>` 查询。
|
|
90
91
|
- **多镜头 / 多分镜时主动建议并行**:用户一次给出 ≥2 个同模型同参数的视频任务(典型场景:分镜流水线、批量首尾帧动画)时,Agent 必须先告知"这批可以用 `create video-batch --concurrency N` 并行执行(n 个任务,预计耗时 / 单次估价 × n)",并询问用户是否要并行。用户同意 → 走 batch;用户希望逐条审稿 → 继续单条 create。**不要默认一条一条串行还不告知**。
|
|
91
92
|
- 视频超分不走 model options/create-spec;它是 material 的对象路径任务,和生视频模型选择链路分离。
|
|
92
|
-
-
|
|
93
|
+
- 去字幕通过 Material 提交,三种来源任选其一:`--file ./clip.mp4`、`--video-url <HTTP(S) URL 或 COS 对象路径>`、`--source-task-id <成功的视频任务 ID>`。文件和 URL 默认使用火山标准版,可通过 `--model-group-code` 指定去字幕模型组。文件和 URL 可传 `--duration <实际时长向上取整的秒数>`,省略时由平台探测。先用 `--dry-run` 预览,再带 `--yes` 提交。用响应中的 `nextCommand` 查询结果。
|
|
93
94
|
- 输出字段速查见 [`../references/output-fields.md`](../references/output-fields.md) 的"生图 / 生视频"小节;错误恢复(积分 / 模型 / 资源约束)见 [`../references/error-codes.md`](../references/error-codes.md)。
|
|
94
95
|
|
|
95
96
|
## 下一步
|