@lingjingai/lj-awb-cli 0.4.8 → 0.5.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 +13 -2
- package/build/volta-pre.mjs +64 -0
- package/package.json +3 -3
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/api.js +10 -9
- package/packages/awb-core/src/commands.js +53 -46
- package/packages/awb-core/src/common.js +3 -5
- package/packages/awb-core/src/output.js +88 -20
- package/packages/awb-core/src/services.js +226 -59
- package/packages/awb-core/src/standalone.js +21 -25
- package/packages/awb-core/src/update.js +74 -3
- package/skills/lj-awb/SKILL.md +13 -4
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +2 -2
- package/skills/lj-awb/modules/asset.md +1 -1
- package/skills/lj-awb/modules/create-contract.md +10 -8
- package/skills/lj-awb/modules/create.md +1 -1
- package/skills/lj-awb/modules/credits.md +18 -1
- package/skills/lj-awb/modules/driver.md +3 -0
- package/skills/lj-awb/modules/evals.md +2 -2
- package/skills/lj-awb/modules/image.md +6 -6
- package/skills/lj-awb/modules/model.md +50 -1
- package/skills/lj-awb/modules/task-manual.md +3 -3
- package/skills/lj-awb/modules/task.md +6 -5
- package/skills/lj-awb/modules/upload.md +10 -10
- package/skills/lj-awb/modules/video.md +11 -13
- package/skills/lj-awb/modules/workflows.md +2 -2
- package/skills/lj-awb/references/error-codes.md +1 -1
- package/skills/lj-awb/references/output-fields.md +8 -5
package/README.md
CHANGED
|
@@ -250,8 +250,6 @@ lj-awb create video \
|
|
|
250
250
|
|
|
251
251
|
lj-awb task wait \
|
|
252
252
|
--task-id <taskId> \
|
|
253
|
-
--task-type VIDEO_GROUP \
|
|
254
|
-
--project-group-no <projectGroupNo> \
|
|
255
253
|
--wait-seconds 300
|
|
256
254
|
```
|
|
257
255
|
|
|
@@ -365,6 +363,19 @@ npm run version:sync -- 0.3.5
|
|
|
365
363
|
|
|
366
364
|
`npm run check:local` 会做 Node 语法检查、shell wrapper 检查、skill 元数据和 schema 校验,不需要 access key。`npm run check` 会额外执行真实平台契约校验,需要本地或环境变量中有可用 access key。`npm run build:pre` / `npm run build:prod` 发布构建只自动执行 `check:local`,避免被本机过期平台凭据阻断;需要真实平台回归时单独运行 `npm run check:real`。`npm run smoke` 会运行帮助命令和无网络写入风险的认证状态检查。
|
|
367
365
|
|
|
366
|
+
### 用 Volta 管理 Node 的机器
|
|
367
|
+
|
|
368
|
+
`lj-awb update` 会检测当前 CLI 是否由 [Volta](https://volta.sh) 管理;如果是,会使用 `volta install` 更新包并刷新 shim,否则沿用 `npm install -g`。
|
|
369
|
+
|
|
370
|
+
`npm run build:pre` 走的是 `npm install -g`。在用 Volta 管理 Node/npm 的机器上,`npm install -g` **不会**在 `~/.volta/bin` 生成 shim(软链接只落在 `~/.volta/tools/image/node/<ver>/bin/`,该目录不在 `PATH` 中),安装后会出现 `lj-awb: command not found`。这类机器请改用:
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
npm run build:volta-pre # 用 volta install 安装本地 pre 构建,正确生成 shim
|
|
374
|
+
npm run build:volta-pre -- --dry-run # 只查看安装计划,不实际安装
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
`build:volta-pre` 缺少 volta 时会直接报错退出。其余环境变量(`SKIP_CHECK=1` 等)与 `build:pre` 一致。
|
|
378
|
+
|
|
368
379
|
## 文档索引
|
|
369
380
|
|
|
370
381
|
- [`docs/TECHNICAL.md`](docs/TECHNICAL.md):架构、运行时、数据契约、发布维护说明。
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import {
|
|
6
|
+
capture,
|
|
7
|
+
copyPackageFiles,
|
|
8
|
+
packTarball,
|
|
9
|
+
patchDefaultApiOrigin,
|
|
10
|
+
run,
|
|
11
|
+
} from './_shared.mjs';
|
|
12
|
+
|
|
13
|
+
const PRE_API_ORIGIN = 'https://animeworkbench-pre.lingjingai.cn';
|
|
14
|
+
const PACKAGE_NAME = '@lingjingai/lj-awb-cli';
|
|
15
|
+
const dryRun = process.env.NPM_INSTALL_DRY_RUN === '1' || process.argv.slice(2).includes('--dry-run');
|
|
16
|
+
|
|
17
|
+
function ensureVolta() {
|
|
18
|
+
if (!process.env.VOLTA_HOME) {
|
|
19
|
+
process.stderr.write(
|
|
20
|
+
'Volta is required for this script but VOLTA_HOME is not set.\n'
|
|
21
|
+
+ 'Install Volta (https://volta.sh) or use `npm run build:pre` instead.\n',
|
|
22
|
+
);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const result = capture('volta', ['--version']);
|
|
26
|
+
if (result.status !== 0) {
|
|
27
|
+
process.stderr.write(
|
|
28
|
+
'Volta is required for this script but the `volta` command is not available.\n'
|
|
29
|
+
+ 'Install Volta (https://volta.sh) or use `npm run build:pre` instead.\n',
|
|
30
|
+
);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
process.stderr.write(`Using Volta ${result.stdout.trim()} for global install.\n`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function installTarball(tarballPath) {
|
|
37
|
+
const spec = `${PACKAGE_NAME}@file:${tarballPath}`;
|
|
38
|
+
if (dryRun) {
|
|
39
|
+
process.stderr.write(`$ volta install ${spec} (dry-run)\n`);
|
|
40
|
+
process.stderr.write('Validated local pre build Volta install plan from packed tarball.\n');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
run('volta', ['install', spec]);
|
|
45
|
+
run('lj-awb', ['--version']);
|
|
46
|
+
process.stderr.write('Installed local pre build with Volta from packed tarball.\n');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ensureVolta();
|
|
50
|
+
|
|
51
|
+
if (process.env.SKIP_CHECK !== '1') {
|
|
52
|
+
run('npm', ['run', 'check:local']);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const stageDir = mkdtempSync(path.join(tmpdir(), 'lj-awb-pre-src-'));
|
|
56
|
+
try {
|
|
57
|
+
process.stderr.write(`Preparing local pre build with default API origin ${PRE_API_ORIGIN}.\n`);
|
|
58
|
+
copyPackageFiles(stageDir);
|
|
59
|
+
patchDefaultApiOrigin(stageDir, PRE_API_ORIGIN);
|
|
60
|
+
const tarballPath = packTarball(stageDir);
|
|
61
|
+
installTarball(tarballPath);
|
|
62
|
+
} finally {
|
|
63
|
+
rmSync(stageDir, { recursive: true, force: true });
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/lj-awb-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"lj-awb": "packages/awb-cli/bin/lj-awb"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@lingjingai/lj-awb-cli-pre": "^0.4.8",
|
|
12
11
|
"chalk": "^5.6.2",
|
|
13
12
|
"cli-table3": "^0.6.5"
|
|
14
13
|
},
|
|
@@ -21,10 +20,11 @@
|
|
|
21
20
|
"scripts": {
|
|
22
21
|
"build": "node build/build.mjs",
|
|
23
22
|
"build:pre": "node build/pre.mjs",
|
|
23
|
+
"build:volta-pre": "node build/volta-pre.mjs",
|
|
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/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",
|
|
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",
|
|
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.
|
|
3
|
+
"version": "0.5.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.5.0"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -133,6 +133,14 @@ export async function fetchPoints() {
|
|
|
133
133
|
return await apiFetch('/api/anime/member/benefits/queryGroupPoint', { body: {} });
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
export async function fetchPointRecords(payload = {}) {
|
|
137
|
+
return await apiFetch('/api/anime/member/benefits/queryPointRecord', { body: payload });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export async function fetchPointDetailStatus(payload = {}) {
|
|
141
|
+
return await apiFetch('/api/anime/member/benefits/queryPointDetailStatus', { body: payload });
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
export async function redeemCode(code) {
|
|
137
145
|
// 后端 redeemCode 的 code 是无注解 Spring 参数(按 query / form 绑定,不读 JSON body),
|
|
138
146
|
// 且必须带 userId / groupId 请求头(由 buildHeaders 从环境变量注入)。
|
|
@@ -218,13 +226,6 @@ export async function createImageTask(payload = {}) {
|
|
|
218
226
|
return await apiFetch('/api/material/creation/imageCreate', { body: payload });
|
|
219
227
|
}
|
|
220
228
|
|
|
221
|
-
export async function fetchImageTask(taskId) {
|
|
222
|
-
return await apiFetch('/api/material/creation/imageCreateGet', {
|
|
223
|
-
method: 'GET',
|
|
224
|
-
query: { taskId },
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
229
|
export async function fetchVideoFee(payload = {}) {
|
|
229
230
|
return await apiFetch('/api/material/creation/videoCreateFeeCalc', { body: payload });
|
|
230
231
|
}
|
|
@@ -233,8 +234,8 @@ export async function createVideoTask(payload = {}) {
|
|
|
233
234
|
return await apiFetch('/api/material/creation/videoCreate', { body: payload });
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
export async function
|
|
237
|
-
return await apiFetch('/api/material/creation/
|
|
237
|
+
export async function fetchTaskInfo(taskId) {
|
|
238
|
+
return await apiFetch('/api/material/creation/task/info', {
|
|
238
239
|
method: 'GET',
|
|
239
240
|
query: { taskId },
|
|
240
241
|
});
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
authLogout,
|
|
15
15
|
creditsBalance,
|
|
16
16
|
creditsBuy,
|
|
17
|
+
creditsDetailStatus,
|
|
18
|
+
creditsRecords,
|
|
17
19
|
creditsRedeem,
|
|
18
20
|
creditsUsageSummary,
|
|
19
21
|
createProjectGroupCommand,
|
|
@@ -42,10 +44,8 @@ import {
|
|
|
42
44
|
subjectVoiceWait,
|
|
43
45
|
subjectWait,
|
|
44
46
|
subtitleRemove,
|
|
45
|
-
subtitleStatus,
|
|
46
47
|
videoSuperResolution,
|
|
47
48
|
videoSuperResolutionFee,
|
|
48
|
-
videoSuperResolutionStatus,
|
|
49
49
|
taskList,
|
|
50
50
|
taskRecordPoll,
|
|
51
51
|
taskRecords,
|
|
@@ -85,6 +85,14 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
|
|
|
85
85
|
const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
|
|
86
86
|
const MODEL_LIST_ARGS = [
|
|
87
87
|
{ name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
|
|
88
|
+
{ name: 'usage', valueName: 'usage', description: '模型用途:image 可选 IMAGE_CREATE(默认)/IMAGE_EDIT;video 为 VIDEO_CREATE。取值大小写不敏感' },
|
|
89
|
+
{ name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
|
|
90
|
+
{ name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
|
|
91
|
+
{ name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
|
|
92
|
+
{ name: 'quality', valueName: 'value', description: '按分辨率取值过滤(模型真实支持该 quality 才返回,如 4k / 2k / 1080;大小写不敏感)' },
|
|
93
|
+
{ name: 'ratio', valueName: 'value', description: '按画面比例取值过滤(模型真实支持该 ratio 才返回,如 9:16 / 16:9 / 1:1)' },
|
|
94
|
+
{ name: 'duration', valueName: 'sec', description: '按时长取值过滤(video,模型真实支持该秒数才返回,如 10 / 15)' },
|
|
95
|
+
{ name: 'need-audio', description: '只返回支持音效 / 音频的模型(video,按 audio 能力)' },
|
|
88
96
|
{ name: 'limit', valueName: 'n', description: '默认文本最多展示 N 条,默认 8;JSON 输出始终返回全部匹配' },
|
|
89
97
|
{ name: 'all', description: '默认文本展示全部匹配模型(覆盖 --limit)' },
|
|
90
98
|
INCLUDE_RAW_ARG,
|
|
@@ -398,6 +406,38 @@ export function registerAwbCommands(cli) {
|
|
|
398
406
|
func: async (_ctx, kwargs) => creditsUsageSummary(kwargs),
|
|
399
407
|
});
|
|
400
408
|
|
|
409
|
+
cli({
|
|
410
|
+
name: 'credits records',
|
|
411
|
+
description: commandHelp('查询当前用户积分明细,默认按时间倒序展示精简字段', {
|
|
412
|
+
examples: [
|
|
413
|
+
'lj-awb credits records',
|
|
414
|
+
'lj-awb credits records --query-type 2 --page 1 --size 20',
|
|
415
|
+
'lj-awb credits records --query-type 3',
|
|
416
|
+
],
|
|
417
|
+
hint: 'query-type:1=全部明细,2=支出明细,3=收入明细;输出默认只保留时间、标题、操作、积分、项目组和用户。',
|
|
418
|
+
}),
|
|
419
|
+
args: [
|
|
420
|
+
{ name: 'query-type', valueName: '1|2|3', description: '明细类型:1=全部,2=支出,3=收入;默认 1' },
|
|
421
|
+
{ name: 'page', valueName: 'n', description: '页码,默认 1' },
|
|
422
|
+
{ name: 'size', valueName: 'n', description: '每页条数,默认 10,最大 100' },
|
|
423
|
+
],
|
|
424
|
+
func: async (_ctx, kwargs) => creditsRecords(kwargs),
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
cli({
|
|
428
|
+
name: 'credits detail-status',
|
|
429
|
+
description: commandHelp('查询单个积分明细的最终状态、锁定 / 核销 / 返还时间和积分', {
|
|
430
|
+
examples: [
|
|
431
|
+
'lj-awb credits detail-status --detail-id <detailId>',
|
|
432
|
+
],
|
|
433
|
+
hint: '只返回精简字段:detailId、状态、锁定 / 核销 / 返还时间与积分;statusText 会把 lock/use/reget 映射为 锁定/核销/返还。',
|
|
434
|
+
}),
|
|
435
|
+
args: [
|
|
436
|
+
{ name: 'detail-id', valueName: 'id', description: '积分明细 detailId' },
|
|
437
|
+
],
|
|
438
|
+
func: async (_ctx, kwargs) => creditsDetailStatus(kwargs),
|
|
439
|
+
});
|
|
440
|
+
|
|
401
441
|
cli({
|
|
402
442
|
name: 'credits buy',
|
|
403
443
|
description: commandHelp('引导购买 / 充值:按当前环境(预发 / 正式)输出充值页面链接', {
|
|
@@ -511,7 +551,6 @@ export function registerAwbCommands(cli) {
|
|
|
511
551
|
examples: [
|
|
512
552
|
'lj-awb upload files --files ./a.png,./b.mp4 --dry-run',
|
|
513
553
|
'lj-awb upload files --file ./ref.png',
|
|
514
|
-
'lj-awb upload files --file ./first-frame.png --scene-type material-video-create',
|
|
515
554
|
],
|
|
516
555
|
hint: '不会暴露 COS 临时密钥;skill 只使用返回的 backendPath / url。',
|
|
517
556
|
}),
|
|
@@ -519,7 +558,7 @@ export function registerAwbCommands(cli) {
|
|
|
519
558
|
{ name: 'file', valueName: 'path', description: '单个文件路径' },
|
|
520
559
|
{ name: 'files', valueName: 'paths', description: '多个文件路径,逗号分隔' },
|
|
521
560
|
{ name: 'files-json', valueName: 'path|json', description: '文件数组 JSON 或 JSON 文件路径' },
|
|
522
|
-
{ name: 'scene-type', valueName: 'scene', description: '
|
|
561
|
+
{ name: 'scene-type', valueName: 'scene', description: '(保留向后兼容)已无作用;upload files 一律走临时隔离场景 cli-upload-temp' },
|
|
523
562
|
{ name: 'project-no', valueName: 'no', description: '可选项目组编号;不传时读取当前项目组 / 环境变量 / 本地状态' },
|
|
524
563
|
DRY_RUN_ARG,
|
|
525
564
|
],
|
|
@@ -600,17 +639,6 @@ export function registerAwbCommands(cli) {
|
|
|
600
639
|
func: async (_ctx, kwargs) => imageCreateBatch(kwargs),
|
|
601
640
|
});
|
|
602
641
|
|
|
603
|
-
cli({
|
|
604
|
-
name: 'task image-status',
|
|
605
|
-
description: commandHelp('查询生图任务状态', {
|
|
606
|
-
examples: ['lj-awb task image-status --task-id <id>'],
|
|
607
|
-
}),
|
|
608
|
-
args: [
|
|
609
|
-
{ name: 'task-id', valueName: 'id', description: '任务 ID' },
|
|
610
|
-
],
|
|
611
|
-
func: async (_ctx, kwargs) => taskStatus({ ...kwargs, taskType: 'IMAGE_CREATE' }),
|
|
612
|
-
});
|
|
613
|
-
|
|
614
642
|
cli({
|
|
615
643
|
name: 'create video-fee',
|
|
616
644
|
description: commandHelp('计算生视频预计积分(--prompt / --resource / --resources-json 至少传一个)', {
|
|
@@ -689,15 +717,6 @@ export function registerAwbCommands(cli) {
|
|
|
689
717
|
func: async (_ctx, kwargs) => videoCreateBatch(kwargs),
|
|
690
718
|
});
|
|
691
719
|
|
|
692
|
-
cli({
|
|
693
|
-
name: 'task video-status',
|
|
694
|
-
description: commandHelp('查询生视频任务状态', {
|
|
695
|
-
examples: ['lj-awb task video-status --task-id <id>'],
|
|
696
|
-
}),
|
|
697
|
-
args: [{ name: 'task-id', valueName: 'id', description: '任务 ID' }],
|
|
698
|
-
func: async (_ctx, kwargs) => taskStatus({ ...kwargs, taskType: 'VIDEO_GROUP' }),
|
|
699
|
-
});
|
|
700
|
-
|
|
701
720
|
cli({
|
|
702
721
|
name: 'create video-subtitle-removal',
|
|
703
722
|
description: commandHelp('基于 material 来源视频任务提交去字幕任务', {
|
|
@@ -744,27 +763,17 @@ export function registerAwbCommands(cli) {
|
|
|
744
763
|
});
|
|
745
764
|
|
|
746
765
|
cli({
|
|
747
|
-
name: 'task
|
|
748
|
-
description: commandHelp('
|
|
749
|
-
examples: [
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
PROJECT_GROUP_ARG,
|
|
754
|
-
],
|
|
755
|
-
func: async (_ctx, kwargs) => subtitleStatus(kwargs),
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
cli({
|
|
759
|
-
name: 'task video-super-resolution-status',
|
|
760
|
-
description: commandHelp('查询 material 视频超分任务状态', {
|
|
761
|
-
examples: ['lj-awb task video-super-resolution-status --task-id <superResolutionTaskId>'],
|
|
766
|
+
name: 'task status',
|
|
767
|
+
description: commandHelp('根据 taskId 查询任务状态(生图 / 生视频 / 去字幕 / 视频超分统一返回结构)', {
|
|
768
|
+
examples: [
|
|
769
|
+
'lj-awb task status --task-id <taskId>',
|
|
770
|
+
],
|
|
771
|
+
hint: '状态查询只依赖 taskId。',
|
|
762
772
|
}),
|
|
763
773
|
args: [
|
|
764
|
-
{ name: 'task-id', valueName: 'id', description: '
|
|
765
|
-
PROJECT_GROUP_ARG,
|
|
774
|
+
{ name: 'task-id', valueName: 'id', description: '任务 ID' },
|
|
766
775
|
],
|
|
767
|
-
func: async (_ctx, kwargs) =>
|
|
776
|
+
func: async (_ctx, kwargs) => taskStatus(kwargs),
|
|
768
777
|
});
|
|
769
778
|
|
|
770
779
|
cli({
|
|
@@ -783,14 +792,12 @@ export function registerAwbCommands(cli) {
|
|
|
783
792
|
|
|
784
793
|
cli({
|
|
785
794
|
name: 'task wait',
|
|
786
|
-
description: commandHelp('
|
|
787
|
-
examples: ['lj-awb task wait --task-id <id> --
|
|
795
|
+
description: commandHelp('等待任务进入终态', {
|
|
796
|
+
examples: ['lj-awb task wait --task-id <id> --wait-seconds 180'],
|
|
788
797
|
hint: '超时返回 task_still_running / exit code 20,不代表远端失败。',
|
|
789
798
|
}),
|
|
790
799
|
args: [
|
|
791
800
|
{ name: 'task-id', valueName: 'id', description: '任务 ID' },
|
|
792
|
-
{ name: 'task-type', valueName: 'type', description: 'IMAGE_CREATE / VIDEO_GROUP;material 扩展任务优先用 task video-subtitle-status / task video-super-resolution-status' },
|
|
793
|
-
PROJECT_GROUP_ARG,
|
|
794
801
|
...TASK_WAIT_ARGS,
|
|
795
802
|
],
|
|
796
803
|
func: async (_ctx, kwargs) => waitTask(kwargs),
|
|
@@ -36,6 +36,9 @@ export const TASK_UPLOAD_SCENE = {
|
|
|
36
36
|
ASSET_REVIEW: 'asset-review',
|
|
37
37
|
DEFAULT: 'material-image-draw',
|
|
38
38
|
};
|
|
39
|
+
// upload files(用户手动上传)专用场景:仅此命令走临时隔离区,后端据此下发独立、可定期清理的 tmp/cli-upload/ 路径。
|
|
40
|
+
// create 系列(生图 / 生视频 / 主体 / 素材加白)的自动上传不使用本场景,走上面各自的业务场景、长期保留。
|
|
41
|
+
export const CLI_TEMP_UPLOAD_SCENE = 'cli-upload-temp';
|
|
39
42
|
export const TERMINAL_TASK_STATES = new Set([
|
|
40
43
|
'SUCCESS',
|
|
41
44
|
'COMPLETED',
|
|
@@ -316,11 +319,6 @@ export function isSuccessTaskStatus(value) {
|
|
|
316
319
|
return SUCCESS_TASK_STATES.has(taskStatusText(value));
|
|
317
320
|
}
|
|
318
321
|
|
|
319
|
-
export function taskTypeToStatusKind(taskType) {
|
|
320
|
-
const normalized = normalizeFeedTaskType(taskType);
|
|
321
|
-
return normalized.startsWith('VIDEO') ? 'video' : 'image';
|
|
322
|
-
}
|
|
323
|
-
|
|
324
322
|
export function guessMimeType(filePath) {
|
|
325
323
|
const ext = path.extname(String(filePath ?? '')).toLowerCase();
|
|
326
324
|
switch (ext) {
|
|
@@ -213,8 +213,9 @@ function normalizeDryRun(data = {}) {
|
|
|
213
213
|
|
|
214
214
|
function submissionStatusCommand(commandName, data = {}) {
|
|
215
215
|
if (!data?.taskId) return null;
|
|
216
|
-
if (commandName === 'create image'
|
|
217
|
-
|
|
216
|
+
if (commandName === 'create image' || commandName === 'create video') {
|
|
217
|
+
return `${commandPrefix()} task status --task-id ${data.taskId}`;
|
|
218
|
+
}
|
|
218
219
|
return null;
|
|
219
220
|
}
|
|
220
221
|
|
|
@@ -296,6 +297,44 @@ function normalizeCredits(data = {}) {
|
|
|
296
297
|
});
|
|
297
298
|
}
|
|
298
299
|
|
|
300
|
+
function normalizeCreditsRecords(data = {}) {
|
|
301
|
+
const rows = Array.isArray(data.creditRecords)
|
|
302
|
+
? data.creditRecords
|
|
303
|
+
: (Array.isArray(data.records) ? data.records : []);
|
|
304
|
+
return compactRecord({
|
|
305
|
+
remainPoint: data.remainPoint,
|
|
306
|
+
dataPlanPoint: data.dataPlanPoint,
|
|
307
|
+
topUpPoint: data.topUpPoint,
|
|
308
|
+
queryType: data.queryType,
|
|
309
|
+
total: data.total,
|
|
310
|
+
page: data.page,
|
|
311
|
+
size: data.size,
|
|
312
|
+
pages: data.pages,
|
|
313
|
+
creditRecords: rows.map((row) => compactRecord({
|
|
314
|
+
operationTime: row.operationTime,
|
|
315
|
+
title: row.title,
|
|
316
|
+
point: row.point,
|
|
317
|
+
projectGroupName: row.projectGroupName,
|
|
318
|
+
projectGroupNo: row.projectGroupNo,
|
|
319
|
+
userName: row.userName,
|
|
320
|
+
})),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function normalizeCreditDetailStatus(data = {}) {
|
|
325
|
+
return compactRecord({
|
|
326
|
+
detailId: data.detailId,
|
|
327
|
+
status: data.status,
|
|
328
|
+
statusText: data.statusText,
|
|
329
|
+
lockTime: data.lockTime,
|
|
330
|
+
lockPoint: data.lockPoint,
|
|
331
|
+
useTime: data.useTime,
|
|
332
|
+
usePoint: data.usePoint,
|
|
333
|
+
regetTime: data.regetTime,
|
|
334
|
+
regetPoint: data.regetPoint,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
299
338
|
function normalizeProjectSummary(data = {}) {
|
|
300
339
|
return compactRecord({
|
|
301
340
|
selected: data.selected,
|
|
@@ -345,6 +384,7 @@ function normalizeTaskStatus(data = {}) {
|
|
|
345
384
|
modelGroupCode: data.modelGroupCode,
|
|
346
385
|
projectGroupNo: data.projectGroupNo,
|
|
347
386
|
pointNo: data.pointNo,
|
|
387
|
+
benefitsId: data.benefitsId,
|
|
348
388
|
gmtCreate: data.gmtCreate,
|
|
349
389
|
resultCount: data.resultCount,
|
|
350
390
|
resultUrls: data.resultUrls,
|
|
@@ -464,6 +504,10 @@ export function normalizeOutputData(commandName, data) {
|
|
|
464
504
|
return normalizeAccountInfo(data);
|
|
465
505
|
case 'credits balance':
|
|
466
506
|
return normalizeCredits(data);
|
|
507
|
+
case 'credits records':
|
|
508
|
+
return normalizeCreditsRecords(data);
|
|
509
|
+
case 'credits detail-status':
|
|
510
|
+
return normalizeCreditDetailStatus(data);
|
|
467
511
|
case 'project current':
|
|
468
512
|
case 'project switch':
|
|
469
513
|
case 'project create':
|
|
@@ -472,11 +516,8 @@ export function normalizeOutputData(commandName, data) {
|
|
|
472
516
|
return normalizeProjectSummary(data);
|
|
473
517
|
case 'credits usage':
|
|
474
518
|
return normalizeCreditsUsage(data);
|
|
475
|
-
case 'task
|
|
476
|
-
case 'task video-status':
|
|
519
|
+
case 'task status':
|
|
477
520
|
case 'task wait':
|
|
478
|
-
case 'task video-subtitle-status':
|
|
479
|
-
case 'task video-super-resolution-status':
|
|
480
521
|
return normalizeTaskStatus(data);
|
|
481
522
|
case 'create subject':
|
|
482
523
|
case 'create subject-wait':
|
|
@@ -655,6 +696,7 @@ function rowSummary(row) {
|
|
|
655
696
|
'status',
|
|
656
697
|
'message',
|
|
657
698
|
'title',
|
|
699
|
+
'point',
|
|
658
700
|
'description',
|
|
659
701
|
'groupId',
|
|
660
702
|
'groupName',
|
|
@@ -1156,12 +1198,11 @@ function modelListAgentHint(commandName) {
|
|
|
1156
1198
|
|
|
1157
1199
|
function statusNextCommand(commandName, normalized) {
|
|
1158
1200
|
if (!isPlainObject(normalized) || normalized.isTerminal !== false || !normalized.taskId) return null;
|
|
1159
|
-
|
|
1160
|
-
return `${commandPrefix()} task wait --task-id ${normalized.taskId} --task-type ${taskType} --wait-seconds 180`;
|
|
1201
|
+
return `${commandPrefix()} task wait --task-id ${normalized.taskId} --wait-seconds 180`;
|
|
1161
1202
|
}
|
|
1162
1203
|
|
|
1163
1204
|
function subtitleRemoveNextCommand(commandName, normalized) {
|
|
1164
|
-
if (commandName !== 'task
|
|
1205
|
+
if (commandName !== 'task status' && commandName !== 'task wait') return null;
|
|
1165
1206
|
if (!normalized.taskId || normalized.taskStatus !== 'SUCCESS') return null;
|
|
1166
1207
|
const taskType = String(normalized.taskType || '');
|
|
1167
1208
|
if (taskType && taskType !== 'VIDEO_GROUP' && !taskType.startsWith('VIDEO_') && !taskType.startsWith('LIP_SYNC')) return null;
|
|
@@ -1187,6 +1228,8 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1187
1228
|
'project update': 'generic',
|
|
1188
1229
|
'project ensure': 'generic',
|
|
1189
1230
|
'credits balance': 'credits_balance',
|
|
1231
|
+
'credits records': 'credits_records',
|
|
1232
|
+
'credits detail-status': 'credit_detail_status',
|
|
1190
1233
|
'credits usage': 'credits_usage',
|
|
1191
1234
|
'credits buy': 'purchase_guide',
|
|
1192
1235
|
'credits redeem': 'redeem_result',
|
|
@@ -1200,16 +1243,13 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1200
1243
|
'create image-fee': 'fee_estimate',
|
|
1201
1244
|
'create image': 'task_submission',
|
|
1202
1245
|
'create image-batch': 'batch_task_submission',
|
|
1203
|
-
'task image-status': 'task_status',
|
|
1204
1246
|
'create video-fee': 'fee_estimate',
|
|
1205
1247
|
'create video': 'task_submission',
|
|
1206
1248
|
'create video-batch': 'batch_task_submission',
|
|
1207
1249
|
'create video-super-resolution-fee': 'fee_estimate',
|
|
1208
1250
|
'create video-super-resolution': 'task_submission',
|
|
1209
|
-
'task video-status': 'task_status',
|
|
1210
1251
|
'create video-subtitle-removal': 'subtitle_task_submission',
|
|
1211
|
-
'task
|
|
1212
|
-
'task video-super-resolution-status': 'task_status',
|
|
1252
|
+
'task status': 'task_status',
|
|
1213
1253
|
'task list': 'task_list',
|
|
1214
1254
|
'task wait': 'task_status',
|
|
1215
1255
|
'task records': 'local_task_records',
|
|
@@ -1244,7 +1284,9 @@ const KIND_TITLES = {
|
|
|
1244
1284
|
batch_task_status: '批量任务状态',
|
|
1245
1285
|
batch_task_submission: '批量任务提交结果',
|
|
1246
1286
|
command_schema: '命令 Schema',
|
|
1287
|
+
credit_detail_status: '积分明细状态',
|
|
1247
1288
|
credits_balance: '积分余额',
|
|
1289
|
+
credits_records: '积分明细',
|
|
1248
1290
|
credits_usage: '积分用量',
|
|
1249
1291
|
environment_report: '环境体检',
|
|
1250
1292
|
fee_estimate: '费用预估',
|
|
@@ -1393,6 +1435,7 @@ const FIELD_LABELS = {
|
|
|
1393
1435
|
point: '预算点数',
|
|
1394
1436
|
pointCost: '预计消耗积分',
|
|
1395
1437
|
pointNo: '积分规格',
|
|
1438
|
+
benefitsId: '积分明细 ID',
|
|
1396
1439
|
pointTotal: '积分合计',
|
|
1397
1440
|
projectBudgetBalance: '项目预算余额',
|
|
1398
1441
|
projectBudgetMax: '项目预算上限',
|
|
@@ -1495,7 +1538,9 @@ const DETAIL_FIELDS_BY_KIND = {
|
|
|
1495
1538
|
batch_subject_publish_result: ['dryRun', 'submitted', 'count', 'successCount', 'failureCount', 'modelCode', 'projectGroupNo'],
|
|
1496
1539
|
batch_task_status: ['count', 'taskCount', 'successTaskCount', 'resultCount', 'pointTotal', 'timedOut', 'waitedMs'],
|
|
1497
1540
|
batch_task_submission: ['dryRun', 'submitted', 'count', 'taskCount', 'successCount', 'failureCount', 'modelGroupCode', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'projectBudgetBalance'],
|
|
1541
|
+
credit_detail_status: ['detailId', 'status', 'statusText', 'lockTime', 'lockPoint', 'useTime', 'usePoint', 'regetTime', 'regetPoint'],
|
|
1498
1542
|
credits_balance: ['billingPointBalance', 'currentProjectGroupNo', 'currentProjectGroupName', 'projectBudgetBalance', 'projectBudgetMax'],
|
|
1543
|
+
credits_records: ['remainPoint', 'dataPlanPoint', 'topUpPoint', 'queryType', 'total', 'page', 'size', 'pages'],
|
|
1499
1544
|
credits_usage: ['projectGroupNo', 'sinceText', 'untilText', 'scannedTaskCount', 'pointTotal'],
|
|
1500
1545
|
environment_report: ['doctorStatus', 'verify'],
|
|
1501
1546
|
fee_estimate: ['objectName', 'modelGroupCode', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
|
|
@@ -1510,9 +1555,9 @@ const DETAIL_FIELDS_BY_KIND = {
|
|
|
1510
1555
|
subject_voice_status: ['name', 'voiceRecordId', 'reqTaskId', 'voiceId', 'externalId', 'status', 'taskStatus', 'errorMessage', 'isTerminal', 'nextVoiceArg'],
|
|
1511
1556
|
subtitle_task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'projectGroupNo', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
|
|
1512
1557
|
subtitle_task_submission: ['submitted', 'taskId', 'taskType', 'sourceTaskId', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'nextCommand'],
|
|
1513
|
-
task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'gmtCreate', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
|
|
1558
|
+
task_status: ['taskId', 'publicId', 'remoteTaskId', 'taskType', 'taskStatus', 'isTerminal', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'benefitsId', 'gmtCreate', 'resultCount', 'errorMessage', 'timedOut', 'waitedMs'],
|
|
1514
1559
|
task_submission: ['taskId', 'taskType', 'objectName', 'modelGroupCode', 'projectGroupNo', 'pointNo', 'points', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter', 'uploadCount', 'nextCommand', 'statusCommand'],
|
|
1515
|
-
update_result: ['checked', 'updated', 'updateAvailable', 'packageName', 'previousVersion', 'currentVersion', 'latestVersion', 'command', 'skillUpdated', 'restartRecommended', 'message'],
|
|
1560
|
+
update_result: ['checked', 'updated', 'updateAvailable', 'packageName', 'installer', 'previousVersion', 'currentVersion', 'latestVersion', 'command', 'skillUpdated', 'restartRecommended', 'message'],
|
|
1516
1561
|
upload_result: ['dryRun', 'fileCount', 'assetCount', 'localFileCount', 'resourceConversionCount'],
|
|
1517
1562
|
};
|
|
1518
1563
|
|
|
@@ -1549,6 +1594,7 @@ const LIST_KEY_BY_KIND = {
|
|
|
1549
1594
|
batch_task_status: 'records',
|
|
1550
1595
|
batch_task_submission: 'results',
|
|
1551
1596
|
command_schema: 'commands',
|
|
1597
|
+
credits_records: 'creditRecords',
|
|
1552
1598
|
credits_usage: 'buckets',
|
|
1553
1599
|
local_task_records: 'records',
|
|
1554
1600
|
model_list: 'models',
|
|
@@ -1569,8 +1615,13 @@ const PRETTY_KIND_PROFILES = Object.fromEntries(Object.keys(KIND_TITLES).map((ki
|
|
|
1569
1615
|
|
|
1570
1616
|
export const PRETTY_OUTPUT_KIND_COVERAGE = Object.freeze(Object.keys(PRETTY_KIND_PROFILES));
|
|
1571
1617
|
|
|
1572
|
-
function outputKindForCommand(commandName, context = {}) {
|
|
1573
|
-
|
|
1618
|
+
function outputKindForCommand(commandName, context = {}, data = null) {
|
|
1619
|
+
if (context.outputKind) return context.outputKind;
|
|
1620
|
+
if (commandName === 'task status') {
|
|
1621
|
+
const taskType = String(data?.taskType || '').trim().toUpperCase();
|
|
1622
|
+
return taskType === 'VIDEO_SUBTITLE_REMOVAL' ? 'subtitle_task_status' : 'task_status';
|
|
1623
|
+
}
|
|
1624
|
+
return OUTPUT_KIND_BY_COMMAND[commandName] || 'generic';
|
|
1574
1625
|
}
|
|
1575
1626
|
|
|
1576
1627
|
function prettyTitle(commandName, kind, data) {
|
|
@@ -1868,6 +1919,13 @@ const TABLE_COLUMNS = {
|
|
|
1868
1919
|
column('安全', (row) => (row.safety?.safeToAutoRun ? '可自动运行' : '需确认/写入'), { maxWidth: 14 }),
|
|
1869
1920
|
column('说明', 'summary', { maxWidth: 44 }),
|
|
1870
1921
|
],
|
|
1922
|
+
creditRecords: [
|
|
1923
|
+
column('时间', 'operationTime', { maxWidth: 20 }),
|
|
1924
|
+
column('标题', 'title', { maxWidth: 18 }),
|
|
1925
|
+
column('积分', 'point', { maxWidth: 10 }),
|
|
1926
|
+
column('项目组', 'projectGroupName', { maxWidth: 20 }),
|
|
1927
|
+
column('用户', 'userName', { maxWidth: 16 }),
|
|
1928
|
+
],
|
|
1871
1929
|
domains: [
|
|
1872
1930
|
column('领域', 'name', { maxWidth: 14 }),
|
|
1873
1931
|
column('命令数', 'commandCount', { maxWidth: 10 }),
|
|
@@ -2771,7 +2829,7 @@ function formatPrettyModelInputGuide(data = {}, context = {}) {
|
|
|
2771
2829
|
|
|
2772
2830
|
function formatPrettyGeneric(commandName, data, context = {}) {
|
|
2773
2831
|
const normalized = normalizeOutputData(commandName, data);
|
|
2774
|
-
const kind = outputKindForCommand(commandName, context);
|
|
2832
|
+
const kind = outputKindForCommand(commandName, context, normalized);
|
|
2775
2833
|
if (!isPlainObject(normalized)) {
|
|
2776
2834
|
const lines = [prettyTitle(commandName, kind, data), ''];
|
|
2777
2835
|
renderDetails(lines, '结果', { value: normalized }, ['value']);
|
|
@@ -2861,7 +2919,7 @@ function csvColumnsForRows(rows = []) {
|
|
|
2861
2919
|
|
|
2862
2920
|
export function formatCsvOutput(commandName, data, context = {}) {
|
|
2863
2921
|
const normalized = normalizeJsonData(commandName, data);
|
|
2864
|
-
const kind = outputKindForCommand(commandName, context);
|
|
2922
|
+
const kind = outputKindForCommand(commandName, context, normalized);
|
|
2865
2923
|
const primaryKey = LIST_KEY_BY_KIND[kind];
|
|
2866
2924
|
const list = primaryKey && Array.isArray(normalized?.[primaryKey])
|
|
2867
2925
|
? { key: primaryKey, rows: normalized[primaryKey] }
|
|
@@ -2921,6 +2979,7 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
2921
2979
|
'publicId',
|
|
2922
2980
|
'remoteTaskId',
|
|
2923
2981
|
'pointNo',
|
|
2982
|
+
'benefitsId',
|
|
2924
2983
|
'taskType',
|
|
2925
2984
|
'taskStatus',
|
|
2926
2985
|
'modelCode',
|
|
@@ -2983,7 +3042,15 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
2983
3042
|
'projectBudgetBalance',
|
|
2984
3043
|
'projectBudgetMax',
|
|
2985
3044
|
'projectBudgetRemainingAfter',
|
|
3045
|
+
'remainPoint',
|
|
3046
|
+
'dataPlanPoint',
|
|
3047
|
+
'topUpPoint',
|
|
3048
|
+
'queryType',
|
|
2986
3049
|
'pointTotal',
|
|
3050
|
+
'total',
|
|
3051
|
+
'page',
|
|
3052
|
+
'pages',
|
|
3053
|
+
'size',
|
|
2987
3054
|
'dryRun',
|
|
2988
3055
|
'action',
|
|
2989
3056
|
],
|
|
@@ -2993,9 +3060,10 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
2993
3060
|
if (list) {
|
|
2994
3061
|
const total = list.rows.length;
|
|
2995
3062
|
lines.push(`${list.key}.count=${total}`);
|
|
3063
|
+
const defaultListLimit = commandName === 'credits records' ? list.rows.length : 8;
|
|
2996
3064
|
const configuredLimit = context.listLimit === Number.POSITIVE_INFINITY
|
|
2997
3065
|
? list.rows.length
|
|
2998
|
-
: (Number.isFinite(context.listLimit) ? context.listLimit :
|
|
3066
|
+
: (Number.isFinite(context.listLimit) ? context.listLimit : defaultListLimit);
|
|
2999
3067
|
const visibleLimit = Math.max(0, configuredLimit);
|
|
3000
3068
|
const visibleRows = list.rows.slice(0, visibleLimit);
|
|
3001
3069
|
for (const [index, row] of visibleRows.entries()) {
|