@lingjingai/lj-awb-cli 0.3.14 → 0.4.0
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 +36 -28
- package/build/_shared.mjs +130 -0
- package/build/build.mjs +3 -0
- package/build/pre-publish.mjs +57 -0
- package/build/pre.mjs +15 -51
- package/build/prod.mjs +25 -68
- package/install.mjs +1 -0
- package/package.json +10 -3
- package/packages/awb-cli/README.md +0 -3
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +7 -2
- package/packages/awb-core/src/api.js +33 -64
- package/packages/awb-core/src/artifact.js +936 -0
- package/packages/awb-core/src/auth.js +1 -1
- package/packages/awb-core/src/commands.js +668 -97
- package/packages/awb-core/src/common.js +3 -2
- package/packages/awb-core/src/output.js +2380 -106
- package/packages/awb-core/src/services.js +868 -114
- package/packages/awb-core/src/standalone.js +985 -235
- package/skills/lj-awb/SKILL.md +84 -73
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/account.md +20 -7
- package/skills/lj-awb/modules/artifact/asset.md +64 -0
- package/skills/lj-awb/modules/artifact/clip.md +65 -0
- package/skills/lj-awb/modules/artifact/script.md +37 -0
- package/skills/lj-awb/modules/artifact/video.md +65 -0
- package/skills/lj-awb/modules/artifact.md +65 -0
- package/skills/lj-awb/modules/asset.md +50 -11
- package/skills/lj-awb/modules/auth.md +12 -5
- package/skills/lj-awb/modules/create-contract.md +23 -14
- package/skills/lj-awb/modules/create.md +37 -0
- package/skills/lj-awb/modules/credits.md +6 -0
- package/skills/lj-awb/modules/driver.md +125 -0
- package/skills/lj-awb/modules/evals.md +84 -36
- package/skills/lj-awb/modules/image.md +19 -10
- package/skills/lj-awb/modules/model.md +31 -31
- package/skills/lj-awb/modules/project.md +7 -0
- package/skills/lj-awb/modules/subject.md +28 -7
- package/skills/lj-awb/modules/task-manual.md +40 -28
- package/skills/lj-awb/modules/task.md +70 -8
- package/skills/lj-awb/modules/upload.md +18 -2
- package/skills/lj-awb/modules/video.md +30 -26
- package/skills/lj-awb/modules/workflows.md +274 -145
- package/skills/lj-awb/references/error-codes.md +109 -0
- package/skills/lj-awb/references/model-options-read.md +19 -12
- package/skills/lj-awb/references/output-fields.md +118 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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.
|
|
16
|
+
"@lingjingai/awb-core": "0.4.0"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Shared core runtime for Lingjing AWB CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
"./common.js": "./src/common.js",
|
|
9
9
|
"./api.js": "./src/api.js",
|
|
10
|
+
"./artifact.js": "./src/artifact.js",
|
|
10
11
|
"./auth.js": "./src/auth.js",
|
|
11
12
|
"./output.js": "./src/output.js",
|
|
12
13
|
"./services.js": "./src/services.js",
|
|
@@ -16,5 +17,9 @@
|
|
|
16
17
|
"files": [
|
|
17
18
|
"src",
|
|
18
19
|
"README.md"
|
|
19
|
-
]
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"chalk": "^5.6.2",
|
|
23
|
+
"cli-table3": "^0.6.5"
|
|
24
|
+
}
|
|
20
25
|
}
|
|
@@ -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
|
}
|