@lingjingai/lj-awb-cli 0.3.12 → 0.3.14
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 -8
- package/build/build.mjs +47 -0
- package/build/pre.mjs +78 -0
- package/build/prod.mjs +95 -0
- package/install.mjs +9 -3
- package/package.json +2 -1
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/commands.js +21 -8
- package/packages/awb-core/src/common.js +1 -1
- package/packages/awb-core/src/output.js +160 -23
- package/packages/awb-core/src/services.js +907 -128
- package/packages/awb-core/src/standalone.js +46 -12
- package/skills/lj-awb/SKILL.md +15 -10
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create-contract.md +23 -17
- package/skills/lj-awb/modules/credits.md +6 -4
- package/skills/lj-awb/modules/evals.md +42 -8
- package/skills/lj-awb/modules/image.md +10 -2
- package/skills/lj-awb/modules/model.md +16 -9
- package/skills/lj-awb/modules/project.md +1 -1
- package/skills/lj-awb/modules/task-manual.md +48 -13
- package/skills/lj-awb/modules/video.md +24 -14
- package/skills/lj-awb/modules/workflows.md +26 -14
- package/skills/lj-awb/references/model-options-read.md +15 -9
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ CLI 本身只负责平台调用、参数校验、精简输出和安全确认;
|
|
|
19
19
|
| 认证 | `auth` | access key 状态、校验、保存、清空 |
|
|
20
20
|
| 账号 | `account` | 用户、团队和登录上下文 |
|
|
21
21
|
| 项目 | `project` | 项目组查询、切换、创建和更新 |
|
|
22
|
-
| 积分 | `credits` |
|
|
22
|
+
| 积分 | `credits` | 可扣积分余额、项目组预算、任务用量统计 |
|
|
23
23
|
| 模型 | `model` | 生图 / 生视频模型发现、模型参数白名单 |
|
|
24
24
|
| 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
|
|
25
25
|
| 图片 | `image` | 生图估价、提交、批量提交、状态查询 |
|
|
@@ -37,7 +37,7 @@ CLI 本身只负责平台调用、参数校验、精简输出和安全确认;
|
|
|
37
37
|
默认 API 地址由代码内置,也可以通过环境变量覆盖:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
export LINGJING_AWB_API_ORIGIN=https://animeworkbench
|
|
40
|
+
export LINGJING_AWB_API_ORIGIN=https://animeworkbench.lingjingai.cn
|
|
41
41
|
export LINGJING_AWB_ACCESS_KEY=<access_key>
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -60,7 +60,9 @@ lj-awb auth status
|
|
|
60
60
|
~/.codex/skills/lj-awb
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
如果设置了 `CODEX_HOME`,Codex skill 会安装到 `$CODEX_HOME/skills/lj-awb`。
|
|
64
|
+
|
|
65
|
+
可用 `LINGJING_AWB_SKILL_INSTALL_DIR` 指定单一安装目录;如果传入的是以 `skills` 结尾的根目录,安装器会自动追加 `lj-awb`。也可用 `LINGJING_AWB_SKIP_SKILL_INSTALL=1` 跳过 skill 安装。
|
|
64
66
|
|
|
65
67
|
源码运行:
|
|
66
68
|
|
|
@@ -120,6 +122,7 @@ lj-awb credits balance
|
|
|
120
122
|
lj-awb credits usage --project-group-no <no> --last-hours 24
|
|
121
123
|
lj-awb model image-models --model Banana
|
|
122
124
|
lj-awb model video-models --model Seedance
|
|
125
|
+
lj-awb model input-guide
|
|
123
126
|
lj-awb model options --model-group-code <modelGroupCode>
|
|
124
127
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
125
128
|
```
|
|
@@ -160,20 +163,22 @@ lj-awb doctor --verify
|
|
|
160
163
|
- `safety.supportsDryRun`:正式执行前是否可以先 `--dry-run`。
|
|
161
164
|
- `workflow.recommendedPreflight`:推荐前置步骤,例如 `doctor`、模型查询、估价和 dry-run。
|
|
162
165
|
|
|
163
|
-
|
|
166
|
+
创作任务前按三层读取模型信息:
|
|
164
167
|
|
|
165
168
|
```bash
|
|
169
|
+
lj-awb model input-guide
|
|
166
170
|
lj-awb model options --model-group-code <modelGroupCode>
|
|
167
171
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
168
172
|
```
|
|
169
173
|
|
|
170
|
-
`model options`
|
|
174
|
+
`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 create` / `video create`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
171
175
|
|
|
172
176
|
## 示例:参考图生成视频
|
|
173
177
|
|
|
174
178
|
```bash
|
|
175
179
|
lj-awb project current
|
|
176
180
|
lj-awb model video-models --model Seedance
|
|
181
|
+
lj-awb model input-guide -f json
|
|
177
182
|
lj-awb model options --model-group-code <modelGroupCode> -f json
|
|
178
183
|
lj-awb model create-spec --model-group-code <modelGroupCode> -f json
|
|
179
184
|
|
|
@@ -204,7 +209,7 @@ lj-awb task wait \
|
|
|
204
209
|
--wait-seconds 300
|
|
205
210
|
```
|
|
206
211
|
|
|
207
|
-
|
|
212
|
+
帧素材也可以直接使用平台资产 ID;是否可传尾帧以 `model options.resources[].usage` 是否包含 `last_frame` 为准:
|
|
208
213
|
|
|
209
214
|
```bash
|
|
210
215
|
lj-awb video create \
|
|
@@ -249,7 +254,7 @@ lj-awb video create \
|
|
|
249
254
|
"meta": {
|
|
250
255
|
"command": "auth status",
|
|
251
256
|
"elapsed_ms": 12,
|
|
252
|
-
"api_origin": "https://animeworkbench
|
|
257
|
+
"api_origin": "https://animeworkbench.lingjingai.cn"
|
|
253
258
|
}
|
|
254
259
|
}
|
|
255
260
|
```
|
|
@@ -267,7 +272,7 @@ lj-awb video create \
|
|
|
267
272
|
"meta": {
|
|
268
273
|
"command": "account info",
|
|
269
274
|
"elapsed_ms": 1,
|
|
270
|
-
"api_origin": "https://animeworkbench
|
|
275
|
+
"api_origin": "https://animeworkbench.lingjingai.cn"
|
|
271
276
|
}
|
|
272
277
|
}
|
|
273
278
|
```
|
package/build/build.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
7
|
+
const rawArgs = process.argv.slice(2);
|
|
8
|
+
const target = rawArgs[0] && !rawArgs[0].startsWith('-') ? rawArgs[0] : 'pre';
|
|
9
|
+
const passthroughArgs = target === rawArgs[0] ? rawArgs.slice(1) : rawArgs;
|
|
10
|
+
|
|
11
|
+
const scriptByTarget = {
|
|
12
|
+
pre: 'pre.mjs',
|
|
13
|
+
prod: 'prod.mjs',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function printUsage() {
|
|
17
|
+
process.stderr.write([
|
|
18
|
+
'Usage:',
|
|
19
|
+
' npm run build -- pre',
|
|
20
|
+
' npm run build -- pre --dry-run',
|
|
21
|
+
' npm run build -- prod',
|
|
22
|
+
' npm run build -- prod --dry-run',
|
|
23
|
+
'',
|
|
24
|
+
].join('\n'));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const script = scriptByTarget[target];
|
|
28
|
+
if (!script) {
|
|
29
|
+
printUsage();
|
|
30
|
+
process.exit(2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const result = spawnSync(process.execPath, [
|
|
34
|
+
path.join(repoRoot, 'build', script),
|
|
35
|
+
...passthroughArgs,
|
|
36
|
+
], {
|
|
37
|
+
cwd: repoRoot,
|
|
38
|
+
env: process.env,
|
|
39
|
+
stdio: 'inherit',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (result.error) {
|
|
43
|
+
process.stderr.write(`${result.error.message}\n`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
process.exit(result.status || 0);
|
package/build/pre.mjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
const dryRun = process.env.NPM_INSTALL_DRY_RUN === '1' || process.argv.slice(2).includes('--dry-run');
|
|
10
|
+
const forceInstall = process.env.NPM_INSTALL_FORCE === '1' || process.argv.slice(2).includes('--force');
|
|
11
|
+
|
|
12
|
+
function run(command, args, options = {}) {
|
|
13
|
+
process.stderr.write(`$ ${[command, ...args].join(' ')}\n`);
|
|
14
|
+
const result = spawnSync(command, args, {
|
|
15
|
+
cwd: repoRoot,
|
|
16
|
+
env: process.env,
|
|
17
|
+
stdio: 'inherit',
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
if (result.error) {
|
|
22
|
+
process.stderr.write(`${result.error.message}\n`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
if (result.status !== 0) {
|
|
26
|
+
process.exit(result.status || 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function packToTempDir(packDir) {
|
|
31
|
+
process.stderr.write(`$ npm pack --pack-destination ${packDir} --silent\n`);
|
|
32
|
+
const result = spawnSync('npm', ['pack', '--pack-destination', packDir, '--silent'], {
|
|
33
|
+
cwd: repoRoot,
|
|
34
|
+
env: process.env,
|
|
35
|
+
encoding: 'utf8',
|
|
36
|
+
stdio: ['inherit', 'pipe', 'inherit'],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (result.error) {
|
|
40
|
+
process.stderr.write(`${result.error.message}\n`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
if (result.status !== 0) {
|
|
44
|
+
process.exit(result.status || 1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const tarball = result.stdout.trim().split(/\r?\n/).filter(Boolean).at(-1);
|
|
48
|
+
if (!tarball) {
|
|
49
|
+
process.stderr.write('npm pack did not return a tarball name.\n');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
return path.join(packDir, tarball);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (process.env.SKIP_CHECK !== '1') {
|
|
56
|
+
run('npm', ['run', 'check']);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const packDir = mkdtempSync(path.join(tmpdir(), 'lj-awb-pack-'));
|
|
60
|
+
try {
|
|
61
|
+
const tarballPath = packToTempDir(packDir);
|
|
62
|
+
run('npm', [
|
|
63
|
+
'install',
|
|
64
|
+
'-g',
|
|
65
|
+
tarballPath,
|
|
66
|
+
'--registry=https://registry.npmjs.org/',
|
|
67
|
+
...(forceInstall ? ['--force'] : []),
|
|
68
|
+
...(dryRun ? ['--dry-run'] : []),
|
|
69
|
+
]);
|
|
70
|
+
if (dryRun) {
|
|
71
|
+
process.stderr.write('Validated local pre build install plan from packed tarball.\n');
|
|
72
|
+
} else {
|
|
73
|
+
run('lj-awb', ['--version']);
|
|
74
|
+
process.stderr.write('Installed local pre build globally from packed tarball.\n');
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
rmSync(packDir, { recursive: true, force: true });
|
|
78
|
+
}
|
package/build/prod.mjs
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
+
const pkg = JSON.parse(readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
|
|
9
|
+
const passthroughArgs = process.argv.slice(2);
|
|
10
|
+
const registry = findArgValue(passthroughArgs, '--registry') || process.env.NPM_CONFIG_REGISTRY || 'https://registry.npmjs.org/';
|
|
11
|
+
const dryRun = process.env.NPM_PUBLISH_DRY_RUN === '1' || passthroughArgs.includes('--dry-run');
|
|
12
|
+
|
|
13
|
+
function findArgValue(args, name) {
|
|
14
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
15
|
+
const arg = args[index];
|
|
16
|
+
if (arg === name) return args[index + 1];
|
|
17
|
+
if (arg.startsWith(`${name}=`)) return arg.slice(name.length + 1);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function run(command, args, options = {}) {
|
|
23
|
+
process.stderr.write(`$ ${[command, ...args].join(' ')}\n`);
|
|
24
|
+
const result = spawnSync(command, args, {
|
|
25
|
+
cwd: repoRoot,
|
|
26
|
+
env: process.env,
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
...options,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (result.error) {
|
|
32
|
+
process.stderr.write(`${result.error.message}\n`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
if (result.status !== 0) {
|
|
36
|
+
process.exit(result.status || 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function capture(command, args) {
|
|
41
|
+
return spawnSync(command, args, {
|
|
42
|
+
cwd: repoRoot,
|
|
43
|
+
env: process.env,
|
|
44
|
+
encoding: 'utf8',
|
|
45
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function ensureLoggedIn() {
|
|
50
|
+
const result = capture('npm', ['whoami', `--registry=${registry}`]);
|
|
51
|
+
if (result.status === 0) {
|
|
52
|
+
process.stderr.write(`npm user: ${result.stdout.trim()}\n`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
process.stderr.write([
|
|
57
|
+
`npm is not logged in for ${registry}.`,
|
|
58
|
+
`Run: npm login --registry=${registry}`,
|
|
59
|
+
'',
|
|
60
|
+
].join('\n'));
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ensureVersionNotPublished() {
|
|
65
|
+
const spec = `${pkg.name}@${pkg.version}`;
|
|
66
|
+
const result = capture('npm', ['view', spec, 'version', `--registry=${registry}`]);
|
|
67
|
+
if (result.status === 0) {
|
|
68
|
+
process.stderr.write(`${spec} already exists on npm. Bump the version before publishing.\n`);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
if (!/E404|404 Not Found|Not found/i.test(`${result.stderr}\n${result.stdout}`)) {
|
|
72
|
+
process.stderr.write(`Could not verify whether ${spec} exists on npm.\n`);
|
|
73
|
+
process.stderr.write(result.stderr || result.stdout || '');
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
process.stderr.write(`Preparing ${pkg.name}@${pkg.version} for npm ${dryRun ? 'dry-run' : 'publish'}.\n`);
|
|
79
|
+
|
|
80
|
+
if (process.env.SKIP_CHECK !== '1') {
|
|
81
|
+
run('npm', ['run', 'check']);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
ensureVersionNotPublished();
|
|
85
|
+
if (!dryRun) {
|
|
86
|
+
ensureLoggedIn();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
run('npm', [
|
|
90
|
+
'publish',
|
|
91
|
+
'--access',
|
|
92
|
+
'public',
|
|
93
|
+
`--registry=${registry}`,
|
|
94
|
+
...passthroughArgs,
|
|
95
|
+
]);
|
package/install.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { cpSync, existsSync, mkdirSync, readdirSync, rmSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
|
-
import { dirname, join } from 'node:path';
|
|
4
|
+
import { basename, dirname, join } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
|
|
7
7
|
const log = (message) => process.stderr.write(`${message}\n`);
|
|
@@ -23,11 +23,17 @@ function copyDirectory(sourceDir, targetDir) {
|
|
|
23
23
|
const packageDir = dirname(fileURLToPath(import.meta.url));
|
|
24
24
|
const skillSourceDir = join(packageDir, 'skills', 'lj-awb');
|
|
25
25
|
const explicitSkillTargetDir = process.env.LINGJING_AWB_SKILL_INSTALL_DIR || process.env.ANIME_SKILL_INSTALL_DIR;
|
|
26
|
+
const codexHomeDir = process.env.CODEX_HOME || join(homedir(), '.codex');
|
|
27
|
+
|
|
28
|
+
function normalizeSkillTargetDir(targetDir) {
|
|
29
|
+
return basename(targetDir) === 'skills' ? join(targetDir, 'lj-awb') : targetDir;
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
const skillTargetDirs = explicitSkillTargetDir
|
|
27
|
-
? [explicitSkillTargetDir]
|
|
33
|
+
? [normalizeSkillTargetDir(explicitSkillTargetDir)]
|
|
28
34
|
: [
|
|
29
35
|
join(homedir(), '.cc-switch', 'skills', 'lj-awb'),
|
|
30
|
-
join(
|
|
36
|
+
join(codexHomeDir, 'skills', 'lj-awb'),
|
|
31
37
|
];
|
|
32
38
|
|
|
33
39
|
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",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"version:sync": "node scripts/sync-versions.mjs"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
+
"build",
|
|
27
28
|
"install.mjs",
|
|
28
29
|
"packages/awb-core",
|
|
29
30
|
"packages/awb-cli",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
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.14"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
listModels,
|
|
23
23
|
modelOptions,
|
|
24
24
|
modelCreateSpec,
|
|
25
|
+
modelInputGuide,
|
|
25
26
|
listProjectGroups,
|
|
26
27
|
normalizeRows,
|
|
27
28
|
normalizeUserInfo,
|
|
@@ -234,7 +235,7 @@ export function registerAwbCommands(cli) {
|
|
|
234
235
|
|
|
235
236
|
cli({
|
|
236
237
|
name: 'project current',
|
|
237
|
-
description: commandHelp('
|
|
238
|
+
description: commandHelp('查看云端当前项目组和项目组预算', {
|
|
238
239
|
examples: ['lj-awb project current'],
|
|
239
240
|
}),
|
|
240
241
|
args: [PROJECT_GROUP_ARG],
|
|
@@ -321,7 +322,7 @@ export function registerAwbCommands(cli) {
|
|
|
321
322
|
|
|
322
323
|
cli({
|
|
323
324
|
name: 'credits balance',
|
|
324
|
-
description: commandHelp('
|
|
325
|
+
description: commandHelp('查看可扣积分余额和项目组预算', {
|
|
325
326
|
examples: ['lj-awb credits balance', 'lj-awb credits balance --project-group-no <no>'],
|
|
326
327
|
}),
|
|
327
328
|
args: [PROJECT_GROUP_ARG],
|
|
@@ -369,12 +370,12 @@ export function registerAwbCommands(cli) {
|
|
|
369
370
|
|
|
370
371
|
cli({
|
|
371
372
|
name: 'model options',
|
|
372
|
-
description: commandHelp('查询指定模型支持的 CLI
|
|
373
|
+
description: commandHelp('查询指定模型支持的 CLI 参数、枚举值、素材约束和条件约束', {
|
|
373
374
|
examples: [
|
|
374
375
|
'lj-awb model options --model-group-code <code>',
|
|
375
376
|
'lj-awb model options --model-group-code <code> --selected-configs-json \'{"quality":"720"}\'',
|
|
376
377
|
],
|
|
377
|
-
hint: '用 options 判断 values、fileTypes、maxFiles、duration 等约束;如何组装 create 命令看 model create-spec。',
|
|
378
|
+
hint: '用 options 判断 values、fileTypes、maxFiles、duration、constraints 等约束;如何组装 create 命令看 model create-spec。',
|
|
378
379
|
}),
|
|
379
380
|
args: [
|
|
380
381
|
MODEL_GROUP_ARG,
|
|
@@ -386,11 +387,11 @@ export function registerAwbCommands(cli) {
|
|
|
386
387
|
|
|
387
388
|
cli({
|
|
388
389
|
name: 'model create-spec',
|
|
389
|
-
description: commandHelp('
|
|
390
|
+
description: commandHelp('查看指定模型如何创建任务:输入模式、素材绑定规则、示例和前置步骤', {
|
|
390
391
|
examples: [
|
|
391
392
|
'lj-awb model create-spec --model-group-code <code>',
|
|
392
393
|
],
|
|
393
|
-
hint: '创建前先用 model options
|
|
394
|
+
hint: '创建前先用 model input-guide 理解统一参数,再用 model options 查具体枚举和素材限制,最后按 create-spec 组装 image create / video create。',
|
|
394
395
|
}),
|
|
395
396
|
args: [
|
|
396
397
|
MODEL_GROUP_ARG,
|
|
@@ -399,6 +400,18 @@ export function registerAwbCommands(cli) {
|
|
|
399
400
|
func: async (_ctx, kwargs) => modelCreateSpec(kwargs),
|
|
400
401
|
});
|
|
401
402
|
|
|
403
|
+
cli({
|
|
404
|
+
name: 'model input-guide',
|
|
405
|
+
description: commandHelp('查看统一创建参数和 resources 素材绑定的通用说明', {
|
|
406
|
+
examples: [
|
|
407
|
+
'lj-awb model input-guide',
|
|
408
|
+
],
|
|
409
|
+
hint: '这是跨模型的统一参数说明;具体枚举值、文件类型、数量和条件约束仍以 model options 为准。',
|
|
410
|
+
}),
|
|
411
|
+
args: [],
|
|
412
|
+
func: async () => modelInputGuide(),
|
|
413
|
+
});
|
|
414
|
+
|
|
402
415
|
cli({
|
|
403
416
|
name: 'upload files',
|
|
404
417
|
description: commandHelp('上传本地图片 / 视频 / 音频到平台 COS,并返回 backendPath / URL', {
|
|
@@ -506,7 +519,7 @@ export function registerAwbCommands(cli) {
|
|
|
506
519
|
{ name: 'ratio', valueName: 'ratio', description: '视频比例' },
|
|
507
520
|
{ name: 'quality', valueName: 'quality', description: '清晰度,如 720' },
|
|
508
521
|
{ name: 'duration', valueName: 'seconds', description: '生成时长秒数' },
|
|
509
|
-
{ name: 'need-audio', valueName: 'bool', description: '
|
|
522
|
+
{ name: 'need-audio', valueName: 'bool', description: '是否需要输出音效;不是上传音频入口,音频素材用 --resource audio:reference=...' },
|
|
510
523
|
RESOURCE_ARG,
|
|
511
524
|
RESOURCES_JSON_ARG,
|
|
512
525
|
FEE_DRY_RUN_ARG,
|
|
@@ -532,7 +545,7 @@ export function registerAwbCommands(cli) {
|
|
|
532
545
|
{ name: 'ratio', valueName: 'ratio', description: '视频比例' },
|
|
533
546
|
{ name: 'quality', valueName: 'quality', description: '清晰度' },
|
|
534
547
|
{ name: 'duration', valueName: 'seconds', description: '生成时长秒数' },
|
|
535
|
-
{ name: 'need-audio', valueName: 'bool', description: '
|
|
548
|
+
{ name: 'need-audio', valueName: 'bool', description: '是否需要输出音效;不是上传音频入口,音频素材用 --resource audio:reference=...' },
|
|
536
549
|
RESOURCE_ARG,
|
|
537
550
|
RESOURCES_JSON_ARG,
|
|
538
551
|
TASK_RECORD_ARG,
|
|
@@ -4,7 +4,7 @@ import crypto from 'node:crypto';
|
|
|
4
4
|
import os from 'node:os';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
|
|
7
|
-
export const DEFAULT_API_ORIGIN = 'https://animeworkbench
|
|
7
|
+
export const DEFAULT_API_ORIGIN = 'https://animeworkbench.lingjingai.cn';
|
|
8
8
|
export const API_ORIGIN = (
|
|
9
9
|
process.env.LINGJING_AWB_API_ORIGIN
|
|
10
10
|
|| process.env.ANIME_API_ORIGIN
|