@lingjingai/lj-awb-cli 0.5.5 → 0.5.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/lj-awb-cli",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
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/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",
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 --check tests/test-project-members.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 tests/test-project-members.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.5.5",
3
+ "version": "0.5.7",
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.5"
16
+ "@lingjingai/awb-core": "0.5.7"
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-core",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Shared core runtime for Lingjing AWB CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -163,8 +163,10 @@ export async function fetchGroupAccessKey({ userId, groupId }) {
163
163
  });
164
164
  }
165
165
 
166
- export async function fetchProjectGroupUsers() {
167
- return await apiFetch('/api/anime/workbench/projectGroup/getGroupAllUser', { method: 'GET' });
166
+ export async function fetchProjectGroupUsers(projectGroupNo) {
167
+ return await apiFetch('/api/anime/workbench/projectGroup/getGroupAllUser', {
168
+ method: 'GET', query: { projectGroupNo },
169
+ });
168
170
  }
169
171
 
170
172
  export async function fetchProjectGroupIntegral(projectGroupNo) {
@@ -84,7 +84,7 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
84
84
  const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
85
85
  const MODEL_LIST_ARGS = [
86
86
  { name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
87
- { name: 'usage', valueName: 'usage', description: '模型用途:image 可选 IMAGE_CREATE(默认)/IMAGE_EDIT;video 为 VIDEO_CREATE。取值大小写不敏感' },
87
+ { name: 'usage', valueName: 'usage', description: '模型用途:image 仅支持 IMAGE_CREATE(默认);video 仅支持 VIDEO_CREATE。取值大小写不敏感' },
88
88
  { name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
89
89
  { name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
90
90
  { name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
@@ -312,11 +312,11 @@ export function registerAwbCommands(cli) {
312
312
 
313
313
  cli({
314
314
  name: 'project users',
315
- description: commandHelp('列出创建项目组时可选成员', {
316
- examples: ['lj-awb project users'],
315
+ description: commandHelp('列出团队可选成员;指定项目组时返回该组成员选中状态', {
316
+ examples: ['lj-awb project users', 'lj-awb project users --project-group-no <no>'],
317
317
  }),
318
- args: [],
319
- func: async () => ({ users: normalizeRows(await fetchProjectGroupUsers()) }),
318
+ args: [PROJECT_GROUP_ARG],
319
+ func: async (_ctx, kwargs) => ({ users: normalizeRows(await fetchProjectGroupUsers(kwargs.projectGroupNo)) }),
320
320
  });
321
321
 
322
322
  cli({
@@ -340,16 +340,18 @@ export function registerAwbCommands(cli) {
340
340
 
341
341
  cli({
342
342
  name: 'project update',
343
- description: commandHelp('修改项目组名称或积分上限', {
343
+ description: commandHelp('修改项目组名称、积分上限或追加成员', {
344
344
  examples: [
345
345
  'lj-awb project update --project-group-no <no> --point 1000 --dry-run',
346
346
  'lj-awb project update --project-group-no <no> --name "新名称" --yes',
347
+ 'lj-awb project update --project-group-no <no> --add-user-ids <id1,id2> --dry-run',
347
348
  ],
348
349
  }),
349
350
  args: [
350
351
  PROJECT_GROUP_ARG,
351
352
  { name: 'name', valueName: 'name', description: '新的项目组名称' },
352
353
  { name: 'point', valueName: 'num', description: '新的项目组积分上限' },
354
+ { name: 'add-user-ids', valueName: 'ids', description: '追加成员 userId,逗号分隔;保留已有成员和角色' },
353
355
  DRY_RUN_ARG,
354
356
  YES_ARG,
355
357
  ],
@@ -358,7 +360,7 @@ export function registerAwbCommands(cli) {
358
360
 
359
361
  cli({
360
362
  name: 'project ensure',
361
- description: commandHelp('确保项目组存在:先查找同名项目组,找不到再创建', {
363
+ description: commandHelp('确保项目组存在:找到同名项目组时补齐指定成员,否则创建', {
362
364
  examples: [
363
365
  'lj-awb project ensure --name "短剧项目A" --point 1000 --dry-run',
364
366
  'lj-awb project ensure --name "短剧项目A" --point 1000 --yes',
@@ -802,6 +802,10 @@ export async function createProjectGroupCommand(kwargs = {}) {
802
802
  });
803
803
  const before = normalizeRows(await awbApi.fetchProjectGroups().catch(() => []));
804
804
  const allUsers = await awbApi.fetchProjectGroupUsers();
805
+ const missing = parseListArg(kwargs.userIds).filter((id) => !allUsers.some((user) => user.userId === id));
806
+ if (missing.length) {
807
+ throw argumentError(`成员不在当前团队中:${missing.join(', ')}`, '请先把成员加入项目所属团队。');
808
+ }
805
809
  const groupUser = buildProjectGroupUsersFromArgs(kwargs, allUsers);
806
810
  if (!groupUser.length) {
807
811
  throw argumentError('未解析到项目组成员', '请先运行 project users,或传 --members-json / --user-ids。');
@@ -843,8 +847,21 @@ export async function updateProjectGroupCommand(kwargs = {}) {
843
847
  if (kwargs.point != null && String(kwargs.point).trim() !== '') {
844
848
  body.point = toInt(kwargs.point, 0);
845
849
  }
850
+ if (kwargs.addUserIds != null) {
851
+ const selectedIds = new Set(parseListArg(kwargs.addUserIds));
852
+ if (!selectedIds.size) throw argumentError('追加成员不能为空', '请传 --add-user-ids <id1,id2>。');
853
+ const users = normalizeRows(await awbApi.fetchProjectGroupUsers(projectGroupNo));
854
+ const availableIds = new Set(users.map((user) => user.userId));
855
+ const missing = [...selectedIds].filter((id) => !availableIds.has(id));
856
+ if (missing.length) {
857
+ throw argumentError(`成员不在当前团队中:${missing.join(', ')}`, '请先把成员加入项目所属团队。');
858
+ }
859
+ body.groupUser = users
860
+ .filter((user) => user.isCheck || selectedIds.has(user.userId))
861
+ .map((user) => ({ userId: user.userId, role: user.isCheck ? user.role : 'USER' }));
862
+ }
846
863
  if (Object.keys(body).length === 1) {
847
- throw argumentError('缺少项目组更新字段', '至少传 --name 或 --point。');
864
+ throw argumentError('缺少项目组更新字段', '至少传 --name、--point 或 --add-user-ids。');
848
865
  }
849
866
  if (toBool(kwargs.dryRun)) {
850
867
  return {
@@ -875,6 +892,7 @@ export async function ensureProjectGroupCommand(kwargs = {}) {
875
892
  projectGroupName: name,
876
893
  point: toInt(kwargs.point, 0),
877
894
  selectExisting: kwargs.selectExisting !== false,
895
+ userIds: parseListArg(kwargs.userIds),
878
896
  },
879
897
  note: 'dry-run 不联网判断是否已存在;正式执行会先查找同名项目组。',
880
898
  };
@@ -886,6 +904,13 @@ export async function ensureProjectGroupCommand(kwargs = {}) {
886
904
  action: 'project ensure',
887
905
  projectGroupNo: existing.projectGroupNo,
888
906
  });
907
+ if (parseListArg(kwargs.userIds).length) {
908
+ await updateProjectGroupCommand({
909
+ projectGroupNo: existing.projectGroupNo,
910
+ addUserIds: kwargs.userIds,
911
+ yes: kwargs.yes,
912
+ });
913
+ }
889
914
  await awbApi.selectProjectGroup(existing.projectGroupNo).catch(() => {});
890
915
  return {
891
916
  ...(await fetchProjectGroupSummary(existing.projectGroupNo)),
@@ -1169,7 +1194,7 @@ function normalizeModelRows(payload, kind, options = {}) {
1169
1194
  }
1170
1195
 
1171
1196
  const MODEL_USAGE_FAMILY = {
1172
- image: { default: 'IMAGE_CREATE', allow: new Set(['IMAGE_CREATE', 'IMAGE_EDIT']) },
1197
+ image: { default: 'IMAGE_CREATE', allow: new Set(['IMAGE_CREATE']) },
1173
1198
  video: { default: 'VIDEO_CREATE', allow: new Set(['VIDEO_CREATE']) },
1174
1199
  };
1175
1200
 
@@ -573,7 +573,7 @@ const COMMAND_REQUIRED_OPTIONS = {
573
573
  };
574
574
 
575
575
  const COMMAND_REQUIRED_ANY_OPTIONS = {
576
- 'project update': [['name', 'point']],
576
+ 'project update': [['name', 'point', 'addUserIds']],
577
577
  'upload files': [['file', 'files', 'filesJson']],
578
578
  'create video-fee': [['prompt', 'resource', 'resourcesJson']],
579
579
  'create video': [['prompt', 'resource', 'resourcesJson']],
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: lj-awb
3
- version: 0.5.5
3
+ version: 0.5.7
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.5"
8
+ version: "0.5.7"
9
9
  bin: "lj-awb"
10
10
  cliHelp: "lj-awb --help"
11
11
  ---
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.5.7
@@ -1,6 +1,6 @@
1
1
  {
2
- "skillVersion": "0.5.5",
3
- "minCliVersion": "0.5.5",
2
+ "skillVersion": "0.5.7",
3
+ "minCliVersion": "0.5.7",
4
4
  "preferredCommand": "lj-awb",
5
- "updatedAt": "2026-07-08"
5
+ "updatedAt": "2026-09-08"
6
6
  }
@@ -109,7 +109,7 @@ Agent 读取这些字段:
109
109
 
110
110
  `model image-models` / `model video-models` 支持在数据源头收窄候选,避免把全量拉回再自己筛:
111
111
 
112
- - `--usage IMAGE_EDIT`:查图片编辑模型池(image 默认 `IMAGE_CREATE`)。
112
+ - `--usage`:图片模型仅支持 `IMAGE_CREATE`(默认);不要传 `IMAGE_EDIT`。图片编辑场景也从 `IMAGE_CREATE` 模型池选择支持参考图的模型。
113
113
  - `--provider 字节`:按厂商过滤(大小写不敏感子串)。
114
114
  - `--input-mode reference`:只要支持参考图 / 对应输入方式的模型。
115
115
  - `--supports quality`:只要**能调**该参数的模型(只看参数是否存在,不看取值)。
@@ -145,7 +145,7 @@ Agent 读取这些字段:
145
145
 
146
146
  ### 各 flag 可传值速查
147
147
 
148
- - `--usage`:image 可选 `IMAGE_CREATE`(默认) / `IMAGE_EDIT`;video 为 `VIDEO_CREATE`。
148
+ - `--usage`:image 仅支持 `IMAGE_CREATE`(默认);video 仅支持 `VIDEO_CREATE`。
149
149
  - `--input-mode`(归一化值,非原始 paramKey):image `prompt_only` / `reference`;video `prompt_only` / `reference` / `frames` / `storyboard`。
150
150
  - `--supports`(归一化值):image `ratio` / `quality`;video `ratio` / `quality` / `duration` / `needAudio`。
151
151
  - `--quality`(真实取值,大小写不敏感):image `1k` / `2k` / `4k`;video `480` / `720` / `768` / `1080` / `4K`。
@@ -11,8 +11,10 @@
11
11
  | `lj-awb project current` | 查看云端当前项目组和项目预算 |
12
12
  | `lj-awb project switch --project-group-no <no> --yes` | 切换项目组 |
13
13
  | `lj-awb project users` | 列出创建项目组可选成员 |
14
+ | `lj-awb project users --project-group-no <no>` | 查询指定项目的候选成员及 `isCheck` 选中状态 |
14
15
  | `lj-awb project create --name "<name>" --point 1000 --yes` | 创建并切换项目组 |
15
16
  | `lj-awb project update --project-group-no <no> --name "<name>" --yes` | 修改项目组 |
17
+ | `lj-awb project update --project-group-no <no> --add-user-ids <id1,id2> --yes` | 追加成员,保留原成员和角色 |
16
18
  | `lj-awb project ensure --name "<name>" --point 1000 --yes` | 确保项目组存在 |
17
19
 
18
20
  ## 规则
@@ -29,3 +31,15 @@
29
31
  - 项目组选定后 → [`credits.md`](credits.md) 查 `billingPointBalance` + `projectBudgetBalance`,判断是否够跑下一批任务。
30
32
  - 项目组不存在但用户想要 → `project create` 比 `project ensure` 更明确;`ensure` 适合脚本场景(已存在则复用)。
31
33
  - 创建项目组前用户想拉人 → `project users` 列出当前团队可选成员(userId + 姓名),把选中的 userId 用逗号拼成 `--user-ids id1,id2` 传给 `project create`。也可以用 `--members-json '[{"userId":"..."}]'` 直接传 JSON。**不要让用户手敲 userId**,先跑 `project users` 取列表。
34
+
35
+ ## 已有项目追加成员
36
+
37
+ 先用 `project users --project-group-no <no>` 核对目标项目的候选人员,按 userId 选择成员,不只按同名昵称判断。追加前预览:
38
+
39
+ ```sh
40
+ lj-awb project update --project-group-no <no> --add-user-ids <id1,id2> --dry-run
41
+ ```
42
+
43
+ 预览会联网读取目标组成员,但不写入。确认后以 `--yes` 执行;提交完整合并名单,保留已选成员及 CREATOR、ADMIN、USER 角色,新增成员使用 USER。重复 userId 不重复加入;找不到请求成员时在提交前报错。
44
+
45
+ 仅追加成员不会改名、重设预算或切换当前项目组。`project ensure --name "<name>" --user-ids <id1,id2> --yes` 找到同名组时先补齐成员,再按原行为切换到该组,保留原预算;找不到时创建包含这些成员的新组。`ensure --dry-run` 保持离线预览,展示请求的 userId,不读取或展示合并后名单;需要核对已有组的完整合并名单时使用上面的 `update --dry-run`。