@lingjingai/lj-awb-cli-pre 0.3.15 → 0.3.17
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 +13 -16
- package/install.mjs +1 -0
- 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 +33 -64
- package/packages/awb-core/src/commands.js +147 -67
- package/packages/awb-core/src/common.js +2 -1
- package/packages/awb-core/src/output.js +74 -25
- package/packages/awb-core/src/services.js +645 -104
- package/packages/awb-core/src/standalone.js +207 -116
- package/skills/lj-awb/SKILL.md +78 -131
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/asset.md +29 -22
- package/skills/lj-awb/modules/create-contract.md +20 -11
- package/skills/lj-awb/modules/create.md +37 -0
- package/skills/lj-awb/modules/driver.md +109 -0
- package/skills/lj-awb/modules/evals.md +84 -36
- package/skills/lj-awb/modules/image.md +14 -14
- package/skills/lj-awb/modules/model.md +11 -29
- package/skills/lj-awb/modules/project.md +1 -0
- package/skills/lj-awb/modules/subject.md +24 -13
- package/skills/lj-awb/modules/task-manual.md +31 -28
- package/skills/lj-awb/modules/task.md +22 -3
- package/skills/lj-awb/modules/upload.md +10 -9
- package/skills/lj-awb/modules/video.md +25 -32
- package/skills/lj-awb/modules/workflows.md +81 -199
- package/skills/lj-awb/references/error-codes.md +13 -6
- package/skills/lj-awb/references/model-options-read.md +2 -2
- package/skills/lj-awb/references/output-fields.md +23 -18
package/README.md
CHANGED
|
@@ -22,12 +22,9 @@ CLI 本身只负责平台调用、参数校验、精简输出和安全确认;
|
|
|
22
22
|
| 积分 | `credits` | 可扣积分余额、项目组预算、任务用量统计 |
|
|
23
23
|
| 模型 | `model` | 生图 / 生视频模型发现、模型参数白名单 |
|
|
24
24
|
| 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
|
|
25
|
-
|
|
|
26
|
-
| 视频 | `video` | 生视频估价、提交、批量提交、状态查询、去字幕 |
|
|
25
|
+
| 创建 | `create` | 生图、生视频、主体、音色、素材和去字幕提交 |
|
|
27
26
|
| 任务 | `task` | 任务列表、等待、任务台账和台账轮询 |
|
|
28
|
-
| 资产 | `asset` | 素材库匹配、素材组、素材注册 |
|
|
29
27
|
| 最终产物 | `artifact` | Workbench 剧本、资产、视频最终产物 CRUD 与本地 JSON 导入 |
|
|
30
|
-
| 主体 | `subject` | 可复用主体资产发布与查询 |
|
|
31
28
|
|
|
32
29
|
## 环境要求
|
|
33
30
|
|
|
@@ -114,7 +111,7 @@ lj-awb account info
|
|
|
114
111
|
lj-awb doctor
|
|
115
112
|
lj-awb doctor --verify
|
|
116
113
|
lj-awb schema -f json
|
|
117
|
-
lj-awb schema --domain
|
|
114
|
+
lj-awb schema --domain create -f json
|
|
118
115
|
lj-awb auth status
|
|
119
116
|
lj-awb auth verify
|
|
120
117
|
lj-awb account info
|
|
@@ -136,8 +133,8 @@ lj-awb artifact video import-storyboard --project-id <projectId> --input-file 3_
|
|
|
136
133
|
正式写入、切换上下文、批量和扣费命令都支持安全确认:
|
|
137
134
|
|
|
138
135
|
```bash
|
|
139
|
-
lj-awb image
|
|
140
|
-
lj-awb image
|
|
136
|
+
lj-awb create image ... --dry-run
|
|
137
|
+
lj-awb create image ... --yes
|
|
141
138
|
```
|
|
142
139
|
|
|
143
140
|
缺少 `--yes` 时,CLI 返回 `confirmation_required`,退出码为 `10`。`task wait` 超时返回 `task_still_running`,退出码为 `20`。
|
|
@@ -148,8 +145,8 @@ Agent 不应该靠记忆猜命令参数。进入任务前推荐先读取机器
|
|
|
148
145
|
|
|
149
146
|
```bash
|
|
150
147
|
lj-awb schema -f json
|
|
151
|
-
lj-awb schema --domain
|
|
152
|
-
lj-awb schema --domain
|
|
148
|
+
lj-awb schema --domain create -f json
|
|
149
|
+
lj-awb schema --domain create --command video -f json
|
|
153
150
|
```
|
|
154
151
|
|
|
155
152
|
正式创作前推荐做一次体检:
|
|
@@ -177,7 +174,7 @@ lj-awb model options --model-group-code <modelGroupCode>
|
|
|
177
174
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
178
175
|
```
|
|
179
176
|
|
|
180
|
-
`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` 组装 `image
|
|
177
|
+
`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`。
|
|
181
178
|
|
|
182
179
|
## 示例:参考图生成视频
|
|
183
180
|
|
|
@@ -188,7 +185,7 @@ lj-awb model input-guide -f json
|
|
|
188
185
|
lj-awb model options --model-group-code <modelGroupCode> -f json
|
|
189
186
|
lj-awb model create-spec --model-group-code <modelGroupCode> -f json
|
|
190
187
|
|
|
191
|
-
lj-awb video
|
|
188
|
+
lj-awb create video-fee \
|
|
192
189
|
--model-group-code <modelGroupCode> \
|
|
193
190
|
--prompt "参考女主首帧,在雨夜街头奔跑,电影感运镜" \
|
|
194
191
|
--resource image:first_frame=./actor.png \
|
|
@@ -197,7 +194,7 @@ lj-awb video fee \
|
|
|
197
194
|
--duration 5 \
|
|
198
195
|
--project-group-no <projectGroupNo>
|
|
199
196
|
|
|
200
|
-
lj-awb video
|
|
197
|
+
lj-awb create video \
|
|
201
198
|
--model-group-code <modelGroupCode> \
|
|
202
199
|
--prompt "参考女主首帧,在雨夜街头奔跑,电影感运镜" \
|
|
203
200
|
--resource image:first_frame=./actor.png \
|
|
@@ -218,7 +215,7 @@ lj-awb task wait \
|
|
|
218
215
|
帧素材也可以直接使用平台资产 ID;是否可传尾帧以 `model options.resources[].usage` 是否包含 `last_frame` 为准:
|
|
219
216
|
|
|
220
217
|
```bash
|
|
221
|
-
lj-awb video
|
|
218
|
+
lj-awb create video \
|
|
222
219
|
--model-group-code <modelGroupCode> \
|
|
223
220
|
--prompt "参考首帧生成一段镜头推进视频" \
|
|
224
221
|
--resource image:first_frame=asset:<assetId> \
|
|
@@ -235,9 +232,9 @@ lj-awb video create \
|
|
|
235
232
|
如果参考图会复用,推荐先发布主体资产:
|
|
236
233
|
|
|
237
234
|
```bash
|
|
238
|
-
lj-awb subject
|
|
239
|
-
lj-awb subject
|
|
240
|
-
lj-awb video
|
|
235
|
+
lj-awb create subject --model-code tx --name 女主 --resource primary:./actor.png --yes
|
|
236
|
+
lj-awb create subject-wait --element-id <elementId> --wait-seconds 300
|
|
237
|
+
lj-awb create video \
|
|
241
238
|
--model-group-code <modelGroupCode> \
|
|
242
239
|
--prompt "<<<女主>>> 在雨夜街头奔跑,电影感运镜" \
|
|
243
240
|
--resource subject:reference:女主=asset:<externalId> \
|
package/install.mjs
CHANGED
|
@@ -34,6 +34,7 @@ const skillTargetDirs = explicitSkillTargetDir
|
|
|
34
34
|
: [
|
|
35
35
|
join(homedir(), '.cc-switch', 'skills', 'lj-awb'),
|
|
36
36
|
join(codexHomeDir, 'skills', 'lj-awb'),
|
|
37
|
+
join(homedir(), '.claude', 'skills', 'lj-awb'),
|
|
37
38
|
];
|
|
38
39
|
|
|
39
40
|
if (process.env.LINGJING_AWB_SKIP_SKILL_INSTALL === '1' || process.env.ANIME_SKIP_SKILL_INSTALL === '1') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/lj-awb-cli-pre",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills (pre-release build pointing to https://animeworkbench-pre.lingjingai.cn)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"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/artifact.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.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 && 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/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 scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs",
|
|
23
23
|
"check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
|
|
24
24
|
"test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
|
|
25
|
-
"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
|
|
25
|
+
"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 artifact && packages/awb-cli/bin/lj-awb schema -f json >/dev/null",
|
|
26
26
|
"postinstall": "node install.mjs",
|
|
27
27
|
"version:sync": "node scripts/sync-versions.mjs"
|
|
28
28
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
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.3.
|
|
16
|
+
"@lingjingai/awb-core": "0.3.17"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { API_ORIGIN, LingjingAwbCliError } from './common.js';
|
|
2
2
|
import { resolveAuthContext } from './auth.js';
|
|
3
3
|
|
|
4
|
-
export const ASSET_EDIT_ORIGIN = (
|
|
5
|
-
process.env.LINGJING_AWB_ASSET_EDIT_ORIGIN
|
|
6
|
-
|| process.env.ASSET_EDIT_ORIGIN
|
|
7
|
-
|| 'https://asset-edit.lingjingai.cn'
|
|
8
|
-
).replace(/\/+$/, '');
|
|
9
|
-
|
|
10
4
|
function buildHeaders(authContext, extraHeaders = {}) {
|
|
11
5
|
const contextHeaders = {};
|
|
12
6
|
for (const [headerName, envNames] of Object.entries({
|
|
@@ -183,6 +177,10 @@ export async function fetchModelGroupInfoAll(modelGroupCode) {
|
|
|
183
177
|
return await apiFetch(`/api/resource/model/info/group/${encodeURIComponent(modelGroupCode)}/all`, { method: 'GET' });
|
|
184
178
|
}
|
|
185
179
|
|
|
180
|
+
export async function fetchAssetReviewModels() {
|
|
181
|
+
return await apiFetch('/api/material/creation/model/asset-review/list', { method: 'GET' });
|
|
182
|
+
}
|
|
183
|
+
|
|
186
184
|
export async function fetchUploadSecret(payload = {}) {
|
|
187
185
|
return await apiFetch('/api/anime/workbench/TencentCloud/getSecret', { body: payload });
|
|
188
186
|
}
|
|
@@ -224,6 +222,14 @@ export async function fetchVideoTask(taskId) {
|
|
|
224
222
|
});
|
|
225
223
|
}
|
|
226
224
|
|
|
225
|
+
export async function fetchVideoSubtitleRemovalFee(payload = {}) {
|
|
226
|
+
return await apiFetch('/api/material/creation/videoSubtitleRemovalFeeCalc', { body: payload });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export async function createVideoSubtitleRemovalTask(payload = {}) {
|
|
230
|
+
return await apiFetch('/api/material/creation/videoSubtitleRemoval', { body: payload });
|
|
231
|
+
}
|
|
232
|
+
|
|
227
233
|
export async function fetchTaskFeed(payload = {}) {
|
|
228
234
|
return await apiFetch('/api/material/creation/task/feedPull', {
|
|
229
235
|
query: payload,
|
|
@@ -239,8 +245,11 @@ export async function listAssetGroups(payload = {}) {
|
|
|
239
245
|
return await apiFetch('/api/material/asset-groups/list', { body: payload });
|
|
240
246
|
}
|
|
241
247
|
|
|
242
|
-
export async function getAssetGroup(groupId) {
|
|
243
|
-
return await apiFetch(`/api/material/asset-groups/${encodeURIComponent(groupId)}`, {
|
|
248
|
+
export async function getAssetGroup(groupId, payload = {}) {
|
|
249
|
+
return await apiFetch(`/api/material/asset-groups/${encodeURIComponent(groupId)}`, {
|
|
250
|
+
method: 'GET',
|
|
251
|
+
query: payload,
|
|
252
|
+
});
|
|
244
253
|
}
|
|
245
254
|
|
|
246
255
|
export async function createAssetGroup(payload = {}) {
|
|
@@ -283,67 +292,27 @@ export async function listElementsByName(elementName) {
|
|
|
283
292
|
});
|
|
284
293
|
}
|
|
285
294
|
|
|
286
|
-
export async function
|
|
287
|
-
|
|
288
|
-
method
|
|
289
|
-
body,
|
|
295
|
+
export async function listVoices(query = {}) {
|
|
296
|
+
return await apiFetch('/api/material/creation/listVoices', {
|
|
297
|
+
method: 'GET',
|
|
290
298
|
query,
|
|
291
|
-
|
|
292
|
-
} = options;
|
|
293
|
-
const url = new URL(pathname, ASSET_EDIT_ORIGIN);
|
|
294
|
-
for (const [key, value] of Object.entries(query || {})) {
|
|
295
|
-
if (value === undefined || value === null || value === '') continue;
|
|
296
|
-
url.searchParams.set(key, String(value));
|
|
297
|
-
}
|
|
298
|
-
let response;
|
|
299
|
-
try {
|
|
300
|
-
response = await fetch(url, {
|
|
301
|
-
method,
|
|
302
|
-
headers: {
|
|
303
|
-
'content-type': 'application/json',
|
|
304
|
-
...headers,
|
|
305
|
-
},
|
|
306
|
-
body: method.toUpperCase() === 'GET' || body === undefined ? undefined : stringifyJsonBody(body),
|
|
307
|
-
});
|
|
308
|
-
} catch (error) {
|
|
309
|
-
throw new LingjingAwbCliError(`请求去字幕服务失败:${error.message}`, {
|
|
310
|
-
type: 'network_error',
|
|
311
|
-
exitCode: 30,
|
|
312
|
-
details: { url: url.toString() },
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
const rawText = await response.text();
|
|
316
|
-
let payload = null;
|
|
317
|
-
try {
|
|
318
|
-
payload = rawText ? JSON.parse(rawText) : null;
|
|
319
|
-
} catch {
|
|
320
|
-
throw new LingjingAwbCliError('去字幕服务返回了无效 JSON', {
|
|
321
|
-
type: 'invalid_json',
|
|
322
|
-
exitCode: 30,
|
|
323
|
-
details: { status: response.status, body: rawText.slice(0, 500) },
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
if (!response.ok) {
|
|
327
|
-
throw new LingjingAwbCliError(payload?.message || payload?.msg || `${response.status} ${response.statusText}`, {
|
|
328
|
-
type: 'http_error',
|
|
329
|
-
exitCode: 30,
|
|
330
|
-
details: { status: response.status, payload },
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
return payload && typeof payload === 'object' && 'data' in payload ? payload.data : payload;
|
|
299
|
+
});
|
|
334
300
|
}
|
|
335
301
|
|
|
336
|
-
export async function
|
|
337
|
-
return await
|
|
338
|
-
method: 'POST',
|
|
339
|
-
body: payload,
|
|
340
|
-
});
|
|
302
|
+
export async function createVoice(payload = {}) {
|
|
303
|
+
return await apiFetch('/api/material/creation/createVoice', { body: payload });
|
|
341
304
|
}
|
|
342
305
|
|
|
343
|
-
export async function
|
|
344
|
-
return await
|
|
306
|
+
export async function getVoiceByReqTaskId(reqTaskId) {
|
|
307
|
+
return await apiFetch('/api/material/creation/getVoiceByReqTaskId', {
|
|
308
|
+
method: 'GET',
|
|
309
|
+
query: { reqTaskId },
|
|
310
|
+
});
|
|
345
311
|
}
|
|
346
312
|
|
|
347
|
-
export async function
|
|
348
|
-
return await
|
|
313
|
+
export async function listVoicesByName(voiceName) {
|
|
314
|
+
return await apiFetch('/api/material/creation/listVoicesByName', {
|
|
315
|
+
method: 'GET',
|
|
316
|
+
query: { voiceName },
|
|
317
|
+
});
|
|
349
318
|
}
|