@lingjingai/lj-awb-cli-pre 0.4.6 → 0.4.8

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 CHANGED
@@ -24,7 +24,6 @@ CLI 本身只负责平台调用、参数校验、人类友好输出、机器可
24
24
  | 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
25
25
  | 创建 | `create` | 生图、生视频、主体、音色、素材和去字幕提交 |
26
26
  | 任务 | `task` | 任务列表、等待、任务台账和台账轮询 |
27
- | 最终产物 | `artifact` | Workbench 剧本、资产、视频最终产物 CRUD 与本地 JSON 导入 |
28
27
 
29
28
  ## 环境要求
30
29
 
@@ -161,7 +160,7 @@ lj-awb auth verify
161
160
  lj-awb account info
162
161
  lj-awb account teams
163
162
  lj-awb project list
164
- lj-awb project use --project-group-no <no> --yes
163
+ lj-awb project switch --project-group-no <no> --yes
165
164
  lj-awb credits balance
166
165
  lj-awb credits usage --project-group-no <no> --last-hours 24
167
166
  lj-awb model image-models --model Banana
@@ -169,9 +168,6 @@ lj-awb model video-models --model Seedance
169
168
  lj-awb model input-guide
170
169
  lj-awb model options --model-group-code <modelGroupCode>
171
170
  lj-awb model create-spec --model-group-code <modelGroupCode>
172
- lj-awb artifact script import --project-id <projectId> --input-file 1_script/output/script.json --dry-run
173
- lj-awb artifact asset import --project-id <projectId> --input-dir 2_asset/output --dry-run
174
- lj-awb artifact video import-storyboard --project-id <projectId> --input-file 3_footage/output/ep001/ep001_storyboard.json --dry-run
175
171
  ```
176
172
 
177
173
  正式写入、切换上下文、批量和扣费命令都支持安全确认:
package/install.mjs CHANGED
@@ -48,7 +48,15 @@ if (!existsSync(skillSourceDir)) {
48
48
  }
49
49
 
50
50
  for (const skillTargetDir of [...new Set(skillTargetDirs)]) {
51
- rmSync(skillTargetDir, { recursive: true, force: true });
52
- copyDirectory(skillSourceDir, skillTargetDir);
53
- log(`Installed lj-awb skill -> ${skillTargetDir}`);
51
+ try {
52
+ // 目标目录可能正被运行中的 agent(如 Claude Code)实时占用、并发重建子目录,
53
+ // 普通 rmSync 删父目录时会撞上 ENOTEMPTY/EBUSY。maxRetries/retryDelay 让其自动重试规避竞态。
54
+ rmSync(skillTargetDir, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
55
+ copyDirectory(skillSourceDir, skillTargetDir);
56
+ log(`Installed lj-awb skill -> ${skillTargetDir}`);
57
+ } catch (error) {
58
+ // 单个目标被占用不应中断整个 postinstall(否则 npm install 失败并留下半删目录);
59
+ // 跳过该目标并提示用户:重启 agent 后重新安装即可刷新。
60
+ log(`Warning: skipped lj-awb skill refresh at ${skillTargetDir} (${error.code || error.message}). It may be in use by a running agent; restart it and reinstall to refresh.`);
61
+ }
54
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/lj-awb-cli-pre",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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",
@@ -8,6 +8,7 @@
8
8
  "lj-awb": "packages/awb-cli/bin/lj-awb"
9
9
  },
10
10
  "dependencies": {
11
+ "@lingjingai/lj-awb-cli-pre": "^0.4.8",
11
12
  "chalk": "^5.6.2",
12
13
  "cli-table3": "^0.6.5"
13
14
  },
@@ -23,10 +24,10 @@
23
24
  "build:pre-publish": "node build/pre-publish.mjs",
24
25
  "build:prod": "node build/prod.mjs",
25
26
  "check": "npm run check:local && npm run check:real",
26
- "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/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/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
28
  "check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
28
29
  "test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
29
- "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",
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",
30
31
  "postinstall": "node install.mjs",
31
32
  "version:sync": "node scripts/sync-versions.mjs"
32
33
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-cli-bin",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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.4.6"
16
+ "@lingjingai/awb-core": "0.4.8"
17
17
  }
18
18
  }
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@lingjingai/awb-core",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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",
11
10
  "./auth.js": "./src/auth.js",
12
11
  "./output.js": "./src/output.js",
13
12
  "./services.js": "./src/services.js",
@@ -148,9 +148,10 @@ export async function selectProjectGroup(projectGroupNo) {
148
148
  });
149
149
  }
150
150
 
151
- export async function updateCurrentTeam(groupId) {
152
- return await apiFetch('/api/anime/user/group/updateCurrentGroup', {
153
- body: { groupId },
151
+ export async function fetchGroupAccessKey({ userId, groupId }) {
152
+ // 切换团队:用当前用户的 userId + 目标 groupId 换取该团队的 accessKey,再刷新本地认证文件。
153
+ return await apiFetch('/api/anime/user/account/groupAccessKey', {
154
+ body: { userId, groupId },
154
155
  });
155
156
  }
156
157
 
@@ -1,5 +1,4 @@
1
1
  import { fetchProjectGroupUsers, fetchTeams, fetchUserInfo } from './api.js';
2
- import * as artifact from './artifact.js';
3
2
  import { clearAuth, loadAuth, saveAccessKey, summarizeAuth } from './auth.js';
4
3
  import { LingjingAwbCliError, maskSecret, toBool, trimSecret } from './common.js';
5
4
  import { runCliUpdate } from './update.js';
@@ -116,7 +115,6 @@ const BODY_INPUT_ARGS = [
116
115
  { name: 'body-json', valueName: 'json', description: '直接传接口 body JSON' },
117
116
  { name: 'input-file', valueName: 'path', description: '从本地 JSON 文件读取接口 body' },
118
117
  ];
119
- const ARTIFACT_WRITE_ARGS = [DRY_RUN_ARG, YES_ARG];
120
118
 
121
119
  export function registerAwbCommands(cli) {
122
120
  cli({
@@ -293,9 +291,9 @@ export function registerAwbCommands(cli) {
293
291
  });
294
292
 
295
293
  cli({
296
- name: 'project use',
294
+ name: 'project switch',
297
295
  description: commandHelp('切换当前项目组;后续生成任务会归属到该项目组', {
298
- examples: ['lj-awb project use --project-group-no <no> --dry-run', 'lj-awb project use --project-group-no <no> --yes'],
296
+ examples: ['lj-awb project switch --project-group-no <no> --dry-run', 'lj-awb project switch --project-group-no <no> --yes'],
299
297
  }),
300
298
  args: [
301
299
  PROJECT_GROUP_ARG,
@@ -928,462 +926,6 @@ export function registerAwbCommands(cli) {
928
926
  func: async (_ctx, kwargs) => assetRegister(kwargs),
929
927
  });
930
928
 
931
- const ARTIFACT_ROW_KIND_ARG = { name: 'row-kind', valueName: 'kind', description: 'document/asset/state/speaker/episode/scene/action' };
932
- const ARTIFACT_ENTITY_KEY_ARG = { name: 'entity-key', valueName: 'key', description: '业务唯一键;可包含 / 和 #' };
933
- const ARTIFACT_EPISODE_ARG = { name: 'episode-id', valueName: 'id', description: '集 ID,例如 ep_001' };
934
- const ARTIFACT_SCENE_ARG = { name: 'scene-id', valueName: 'id', description: '场 ID,例如 scn_001' };
935
- const ARTIFACT_CLIP_ARG = { name: 'clip-id', valueName: 'id', description: 'clip ID,例如 clip_001' };
936
- const ARTIFACT_VIDEO_EPISODE_ID_ARG = { name: 'video-episode-id', valueName: 'id', description: '视频集产物的数字主键,由 artifact video upsert-episode / artifact video episode 返回的 id 字段提供(不是 ep_001 这种业务 ID)' };
937
- const ARTIFACT_INCLUDE_STATES_ARG = { name: 'include-states', valueName: 'bool', description: '是否带 states,默认 true' };
938
-
939
- for (const spec of [
940
- {
941
- name: 'artifact script get',
942
- summary: '查询项目完整剧本最终产物',
943
- examples: ['lj-awb artifact script get --project-id <projectId>'],
944
- args: [PROJECT_ID_ARG],
945
- func: artifact.artifactScriptGet,
946
- },
947
- {
948
- name: 'artifact script document',
949
- summary: '查询剧本 document 根记录',
950
- examples: ['lj-awb artifact script document --project-id <projectId>'],
951
- args: [PROJECT_ID_ARG],
952
- func: artifact.artifactScriptDocument,
953
- },
954
- {
955
- name: 'artifact script rows',
956
- summary: '查询剧本最终产物行列表',
957
- examples: [
958
- 'lj-awb artifact script rows --project-id <projectId> --row-kind scene',
959
- 'lj-awb artifact script rows --project-id <projectId> --row-kind action --parent-key scn_001',
960
- ],
961
- args: [
962
- PROJECT_ID_ARG,
963
- ARTIFACT_ROW_KIND_ARG,
964
- { name: 'parent-key', valueName: 'key', description: '按父节点业务键过滤' },
965
- { name: 'revision-after', valueName: 'n', description: '只查 revisionNo 大于该值的行' },
966
- { name: 'include-deleted', valueName: 'bool', description: '是否包含逻辑删除行,默认 false' },
967
- ],
968
- func: artifact.artifactScriptRows,
969
- },
970
- {
971
- name: 'artifact script row',
972
- summary: '查询单条剧本最终产物行',
973
- examples: ['lj-awb artifact script row --project-id <projectId> --row-kind action --entity-key "ep_001/scn_001#0"'],
974
- args: [PROJECT_ID_ARG, ARTIFACT_ROW_KIND_ARG, ARTIFACT_ENTITY_KEY_ARG],
975
- func: artifact.artifactScriptRow,
976
- },
977
- {
978
- name: 'artifact script children',
979
- summary: '按 parentKey 查询剧本子节点',
980
- examples: ['lj-awb artifact script children --project-id <projectId> --parent-key scn_001 --row-kind action'],
981
- args: [
982
- PROJECT_ID_ARG,
983
- { name: 'parent-key', valueName: 'key', description: '父节点业务键' },
984
- ARTIFACT_ROW_KIND_ARG,
985
- ],
986
- func: artifact.artifactScriptChildren,
987
- },
988
- {
989
- name: 'artifact script upsert-row',
990
- summary: '新增或更新单条剧本最终产物行',
991
- examples: ['lj-awb artifact script upsert-row --project-id <projectId> --input-file ./row.json --dry-run', 'lj-awb artifact script upsert-row --project-id <projectId> --input-file ./row.json --yes'],
992
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
993
- func: artifact.artifactScriptUpsertRow,
994
- },
995
- {
996
- name: 'artifact script delete-row',
997
- summary: '逻辑删除单条剧本最终产物行',
998
- examples: ['lj-awb artifact script delete-row --project-id <projectId> --row-kind action --entity-key "ep_001/scn_001#0" --dry-run', 'lj-awb artifact script delete-row --project-id <projectId> --row-kind action --entity-key "ep_001/scn_001#0" --yes'],
999
- args: [PROJECT_ID_ARG, ARTIFACT_ROW_KIND_ARG, ARTIFACT_ENTITY_KEY_ARG, ...ARTIFACT_WRITE_ARGS],
1000
- func: artifact.artifactScriptDeleteRow,
1001
- },
1002
- {
1003
- name: 'artifact script import',
1004
- summary: '从本地 script.json 拆分并批量导入剧本最终产物',
1005
- examples: [
1006
- 'lj-awb artifact script import --project-id <projectId> --input-file 1_script/output/script.json --dry-run',
1007
- 'lj-awb artifact script import --project-id <projectId> --input-file output/script.json --yes',
1008
- ],
1009
- args: [
1010
- PROJECT_ID_ARG,
1011
- { name: 'input-file', valueName: 'path', description: 'script.json 路径,默认 output/script.json' },
1012
- ...ARTIFACT_WRITE_ARGS,
1013
- ],
1014
- func: artifact.artifactScriptImport,
1015
- hint: '不传 --input-file 时默认读取当前目录的 output/script.json。',
1016
- },
1017
- ]) {
1018
- cli({
1019
- name: spec.name,
1020
- description: commandHelp(spec.summary, { examples: spec.examples, hint: spec.hint }),
1021
- args: spec.args,
1022
- func: async (_ctx, kwargs) => spec.func(kwargs),
1023
- });
1024
- }
1025
-
1026
- for (const spec of [
1027
- {
1028
- name: 'artifact asset get',
1029
- summary: '查询项目完整资产最终产物',
1030
- examples: ['lj-awb artifact asset get --project-id <projectId>'],
1031
- args: [PROJECT_ID_ARG],
1032
- func: artifact.artifactAssetGet,
1033
- },
1034
- {
1035
- name: 'artifact asset actors',
1036
- summary: '查询角色最终产物列表',
1037
- examples: ['lj-awb artifact asset actors --project-id <projectId> --include-states true'],
1038
- args: [PROJECT_ID_ARG, ARTIFACT_INCLUDE_STATES_ARG],
1039
- func: artifact.artifactAssetActors,
1040
- },
1041
- {
1042
- name: 'artifact asset actor',
1043
- summary: '查询单个角色最终产物',
1044
- examples: ['lj-awb artifact asset actor --project-id <projectId> --actor-key act_001'],
1045
- args: [PROJECT_ID_ARG, { name: 'actor-key', valueName: 'key', description: '角色业务键' }, ARTIFACT_INCLUDE_STATES_ARG],
1046
- func: artifact.artifactAssetActor,
1047
- },
1048
- {
1049
- name: 'artifact asset props',
1050
- summary: '查询道具最终产物列表',
1051
- examples: ['lj-awb artifact asset props --project-id <projectId>'],
1052
- args: [PROJECT_ID_ARG, ARTIFACT_INCLUDE_STATES_ARG],
1053
- func: artifact.artifactAssetProps,
1054
- },
1055
- {
1056
- name: 'artifact asset prop',
1057
- summary: '查询单个道具最终产物',
1058
- examples: ['lj-awb artifact asset prop --project-id <projectId> --prop-key prp_001'],
1059
- args: [PROJECT_ID_ARG, { name: 'prop-key', valueName: 'key', description: '道具业务键' }, ARTIFACT_INCLUDE_STATES_ARG],
1060
- func: artifact.artifactAssetProp,
1061
- },
1062
- {
1063
- name: 'artifact asset locations',
1064
- summary: '查询场景最终产物列表',
1065
- examples: ['lj-awb artifact asset locations --project-id <projectId>'],
1066
- args: [PROJECT_ID_ARG, ARTIFACT_INCLUDE_STATES_ARG],
1067
- func: artifact.artifactAssetLocations,
1068
- },
1069
- {
1070
- name: 'artifact asset location',
1071
- summary: '查询单个场景最终产物',
1072
- examples: ['lj-awb artifact asset location --project-id <projectId> --location-key loc_001'],
1073
- args: [PROJECT_ID_ARG, { name: 'location-key', valueName: 'key', description: '场景业务键' }, ARTIFACT_INCLUDE_STATES_ARG],
1074
- func: artifact.artifactAssetLocation,
1075
- },
1076
- {
1077
- name: 'artifact asset upsert-actor',
1078
- summary: '新增或更新角色最终产物',
1079
- examples: ['lj-awb artifact asset upsert-actor --project-id <projectId> --input-file ./actor.json --dry-run', 'lj-awb artifact asset upsert-actor --project-id <projectId> --input-file ./actor.json --yes'],
1080
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1081
- func: artifact.artifactAssetUpsertActor,
1082
- },
1083
- {
1084
- name: 'artifact asset upsert-prop',
1085
- summary: '新增或更新道具最终产物',
1086
- examples: ['lj-awb artifact asset upsert-prop --project-id <projectId> --input-file ./prop.json --dry-run', 'lj-awb artifact asset upsert-prop --project-id <projectId> --input-file ./prop.json --yes'],
1087
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1088
- func: artifact.artifactAssetUpsertProp,
1089
- },
1090
- {
1091
- name: 'artifact asset upsert-location',
1092
- summary: '新增或更新场景最终产物',
1093
- examples: ['lj-awb artifact asset upsert-location --project-id <projectId> --input-file ./location.json --dry-run', 'lj-awb artifact asset upsert-location --project-id <projectId> --input-file ./location.json --yes'],
1094
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1095
- func: artifact.artifactAssetUpsertLocation,
1096
- },
1097
- {
1098
- name: 'artifact asset upsert-actor-state',
1099
- summary: '新增或更新角色状态最终产物',
1100
- examples: ['lj-awb artifact asset upsert-actor-state --project-id <projectId> --actor-key act_001 --input-file ./state.json --dry-run', 'lj-awb artifact asset upsert-actor-state --project-id <projectId> --actor-key act_001 --input-file ./state.json --yes'],
1101
- args: [PROJECT_ID_ARG, { name: 'actor-key', valueName: 'key', description: '角色业务键' }, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1102
- func: artifact.artifactAssetUpsertActorState,
1103
- },
1104
- {
1105
- name: 'artifact asset upsert-prop-state',
1106
- summary: '新增或更新道具状态最终产物',
1107
- examples: ['lj-awb artifact asset upsert-prop-state --project-id <projectId> --prop-key prp_001 --input-file ./state.json --dry-run', 'lj-awb artifact asset upsert-prop-state --project-id <projectId> --prop-key prp_001 --input-file ./state.json --yes'],
1108
- args: [PROJECT_ID_ARG, { name: 'prop-key', valueName: 'key', description: '道具业务键' }, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1109
- func: artifact.artifactAssetUpsertPropState,
1110
- },
1111
- {
1112
- name: 'artifact asset upsert-location-state',
1113
- summary: '新增或更新场景状态最终产物',
1114
- examples: ['lj-awb artifact asset upsert-location-state --project-id <projectId> --location-key loc_001 --input-file ./state.json --dry-run', 'lj-awb artifact asset upsert-location-state --project-id <projectId> --location-key loc_001 --input-file ./state.json --yes'],
1115
- args: [PROJECT_ID_ARG, { name: 'location-key', valueName: 'key', description: '场景业务键' }, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1116
- func: artifact.artifactAssetUpsertLocationState,
1117
- },
1118
- {
1119
- name: 'artifact asset delete-actor',
1120
- summary: '逻辑删除角色及其状态最终产物',
1121
- examples: ['lj-awb artifact asset delete-actor --project-id <projectId> --actor-key act_001 --dry-run', 'lj-awb artifact asset delete-actor --project-id <projectId> --actor-key act_001 --yes'],
1122
- args: [PROJECT_ID_ARG, { name: 'actor-key', valueName: 'key', description: '角色业务键' }, ...ARTIFACT_WRITE_ARGS],
1123
- func: artifact.artifactAssetDeleteActor,
1124
- },
1125
- {
1126
- name: 'artifact asset delete-prop',
1127
- summary: '逻辑删除道具及其状态最终产物',
1128
- examples: ['lj-awb artifact asset delete-prop --project-id <projectId> --prop-key prp_001 --dry-run', 'lj-awb artifact asset delete-prop --project-id <projectId> --prop-key prp_001 --yes'],
1129
- args: [PROJECT_ID_ARG, { name: 'prop-key', valueName: 'key', description: '道具业务键' }, ...ARTIFACT_WRITE_ARGS],
1130
- func: artifact.artifactAssetDeleteProp,
1131
- },
1132
- {
1133
- name: 'artifact asset delete-location',
1134
- summary: '逻辑删除场景及其状态最终产物',
1135
- examples: ['lj-awb artifact asset delete-location --project-id <projectId> --location-key loc_001 --dry-run', 'lj-awb artifact asset delete-location --project-id <projectId> --location-key loc_001 --yes'],
1136
- args: [PROJECT_ID_ARG, { name: 'location-key', valueName: 'key', description: '场景业务键' }, ...ARTIFACT_WRITE_ARGS],
1137
- func: artifact.artifactAssetDeleteLocation,
1138
- },
1139
- {
1140
- name: 'artifact asset delete-actor-state',
1141
- summary: '逻辑删除角色状态最终产物',
1142
- examples: ['lj-awb artifact asset delete-actor-state --project-id <projectId> --actor-key act_001 --state-key default --dry-run', 'lj-awb artifact asset delete-actor-state --project-id <projectId> --actor-key act_001 --state-key default --yes'],
1143
- args: [PROJECT_ID_ARG, { name: 'actor-key', valueName: 'key', description: '角色业务键' }, { name: 'state-key', valueName: 'key', description: '状态业务键' }, ...ARTIFACT_WRITE_ARGS],
1144
- func: artifact.artifactAssetDeleteActorState,
1145
- },
1146
- {
1147
- name: 'artifact asset delete-prop-state',
1148
- summary: '逻辑删除道具状态最终产物',
1149
- examples: ['lj-awb artifact asset delete-prop-state --project-id <projectId> --prop-key prp_001 --state-key default --dry-run', 'lj-awb artifact asset delete-prop-state --project-id <projectId> --prop-key prp_001 --state-key default --yes'],
1150
- args: [PROJECT_ID_ARG, { name: 'prop-key', valueName: 'key', description: '道具业务键' }, { name: 'state-key', valueName: 'key', description: '状态业务键' }, ...ARTIFACT_WRITE_ARGS],
1151
- func: artifact.artifactAssetDeletePropState,
1152
- },
1153
- {
1154
- name: 'artifact asset delete-location-state',
1155
- summary: '逻辑删除场景状态最终产物',
1156
- examples: ['lj-awb artifact asset delete-location-state --project-id <projectId> --location-key loc_001 --state-key default --dry-run', 'lj-awb artifact asset delete-location-state --project-id <projectId> --location-key loc_001 --state-key default --yes'],
1157
- args: [PROJECT_ID_ARG, { name: 'location-key', valueName: 'key', description: '场景业务键' }, { name: 'state-key', valueName: 'key', description: '状态业务键' }, ...ARTIFACT_WRITE_ARGS],
1158
- func: artifact.artifactAssetDeleteLocationState,
1159
- },
1160
- {
1161
- name: 'artifact asset import',
1162
- summary: '从本地 actors/props/locations JSON 批量导入资产最终产物',
1163
- examples: [
1164
- 'lj-awb artifact asset import --project-id <projectId> --input-dir 2_asset/output --dry-run',
1165
- 'lj-awb artifact asset import --project-id <projectId> --actors-file output/actors/actors.json --props-file output/props/props.json --locations-file output/locations/locations.json --yes',
1166
- ],
1167
- args: [
1168
- PROJECT_ID_ARG,
1169
- { name: 'input-dir', valueName: 'path', description: '资产 output 目录,默认 output' },
1170
- { name: 'actors-file', valueName: 'path', description: '可选 actors.json 路径' },
1171
- { name: 'props-file', valueName: 'path', description: '可选 props.json 路径' },
1172
- { name: 'locations-file', valueName: 'path', description: '可选 locations.json 路径' },
1173
- ...ARTIFACT_WRITE_ARGS,
1174
- ],
1175
- func: artifact.artifactAssetImport,
1176
- hint: '默认在 --input-dir 下查找 actors/actors.json、props/props.json、locations/locations.json;也兼容 actors.json 等扁平文件名。',
1177
- },
1178
- ]) {
1179
- cli({
1180
- name: spec.name,
1181
- description: commandHelp(spec.summary, { examples: spec.examples, hint: spec.hint }),
1182
- args: spec.args,
1183
- func: async (_ctx, kwargs) => spec.func(kwargs),
1184
- });
1185
- }
1186
-
1187
- for (const spec of [
1188
- {
1189
- name: 'artifact video get',
1190
- summary: '查询项目完整视频最终产物',
1191
- examples: ['lj-awb artifact video get --project-id <projectId>'],
1192
- args: [PROJECT_ID_ARG],
1193
- func: artifact.artifactVideoGet,
1194
- },
1195
- {
1196
- name: 'artifact video episodes',
1197
- summary: '查询视频集列表',
1198
- examples: ['lj-awb artifact video episodes --project-id <projectId>'],
1199
- args: [PROJECT_ID_ARG],
1200
- func: artifact.artifactVideoEpisodes,
1201
- },
1202
- {
1203
- name: 'artifact video episode',
1204
- summary: '查询单集视频最终产物',
1205
- examples: ['lj-awb artifact video episode --project-id <projectId> --episode-id ep_001'],
1206
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG],
1207
- func: artifact.artifactVideoEpisode,
1208
- },
1209
- {
1210
- name: 'artifact video scenes',
1211
- summary: '查询某集下的场列表',
1212
- examples: ['lj-awb artifact video scenes --project-id <projectId> --episode-id ep_001'],
1213
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG],
1214
- func: artifact.artifactVideoScenes,
1215
- },
1216
- {
1217
- name: 'artifact video scene',
1218
- summary: '查询单场视频最终产物',
1219
- examples: ['lj-awb artifact video scene --project-id <projectId> --episode-id ep_001 --scene-id scn_001'],
1220
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG],
1221
- func: artifact.artifactVideoScene,
1222
- },
1223
- {
1224
- name: 'artifact video clips',
1225
- summary: '查询某场下的 clip 列表',
1226
- examples: ['lj-awb artifact video clips --project-id <projectId> --episode-id ep_001 --scene-id scn_001'],
1227
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG],
1228
- func: artifact.artifactVideoClips,
1229
- },
1230
- {
1231
- name: 'artifact video clip',
1232
- summary: '查询单个 clip 视频最终产物',
1233
- examples: ['lj-awb artifact video clip --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001'],
1234
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG, ARTIFACT_CLIP_ARG],
1235
- func: artifact.artifactVideoClip,
1236
- },
1237
- {
1238
- name: 'artifact video upsert-episode',
1239
- summary: '新增或更新视频 episode 最终产物',
1240
- examples: ['lj-awb artifact video upsert-episode --project-id <projectId> --input-file ./episode.json --dry-run', 'lj-awb artifact video upsert-episode --project-id <projectId> --input-file ./episode.json --yes'],
1241
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1242
- func: artifact.artifactVideoUpsertEpisode,
1243
- },
1244
- {
1245
- name: 'artifact video upsert-scene',
1246
- summary: '新增或更新视频 scene 最终产物',
1247
- examples: ['lj-awb artifact video upsert-scene --project-id <projectId> --episode-id ep_001 --input-file ./scene.json --dry-run', 'lj-awb artifact video upsert-scene --project-id <projectId> --episode-id ep_001 --input-file ./scene.json --yes'],
1248
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1249
- func: artifact.artifactVideoUpsertScene,
1250
- },
1251
- {
1252
- name: 'artifact video upsert-clip',
1253
- summary: '新增或更新视频 clip 最终产物',
1254
- examples: ['lj-awb artifact video upsert-clip --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --input-file ./clip.json --dry-run', 'lj-awb artifact video upsert-clip --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --input-file ./clip.json --yes'],
1255
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1256
- func: artifact.artifactVideoUpsertClip,
1257
- },
1258
- {
1259
- name: 'artifact video update-clip-urls',
1260
- summary: '只回写 clip.videoUrls,不覆盖 payload / prompt / duration',
1261
- examples: [
1262
- 'lj-awb artifact video update-clip-urls --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001 --video-urls-json \'["https://example.com/a.mp4"]\' --dry-run',
1263
- 'lj-awb artifact video update-clip-urls --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001 --video-urls-json \'["https://example.com/a.mp4"]\' --yes',
1264
- ],
1265
- args: [
1266
- PROJECT_ID_ARG,
1267
- ARTIFACT_EPISODE_ARG,
1268
- ARTIFACT_SCENE_ARG,
1269
- ARTIFACT_CLIP_ARG,
1270
- { name: 'video-urls-json', valueName: 'json', description: '视频 URL 数组 JSON' },
1271
- ...ARTIFACT_WRITE_ARGS,
1272
- ],
1273
- func: artifact.artifactVideoUpdateClipVideoUrls,
1274
- },
1275
- {
1276
- name: 'artifact video delete-episode',
1277
- summary: '逻辑删除视频 episode,并级联删除该集 scenes/clips',
1278
- examples: ['lj-awb artifact video delete-episode --project-id <projectId> --episode-id ep_001 --dry-run', 'lj-awb artifact video delete-episode --project-id <projectId> --episode-id ep_001 --yes'],
1279
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ...ARTIFACT_WRITE_ARGS],
1280
- func: artifact.artifactVideoDeleteEpisode,
1281
- },
1282
- {
1283
- name: 'artifact video delete-scene',
1284
- summary: '逻辑删除视频 scene,并级联删除该场 clips',
1285
- examples: ['lj-awb artifact video delete-scene --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --dry-run', 'lj-awb artifact video delete-scene --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --yes'],
1286
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG, ...ARTIFACT_WRITE_ARGS],
1287
- func: artifact.artifactVideoDeleteScene,
1288
- },
1289
- {
1290
- name: 'artifact video delete-clip',
1291
- summary: '逻辑删除视频 clip',
1292
- examples: ['lj-awb artifact video delete-clip --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001 --dry-run', 'lj-awb artifact video delete-clip --project-id <projectId> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001 --yes'],
1293
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG, ARTIFACT_SCENE_ARG, ARTIFACT_CLIP_ARG, ...ARTIFACT_WRITE_ARGS],
1294
- func: artifact.artifactVideoDeleteClip,
1295
- },
1296
- {
1297
- name: 'artifact video import-storyboard',
1298
- summary: '从 epXXX_storyboard.json 拆分 episode/scenes/clips 并导入视频最终产物',
1299
- examples: [
1300
- 'lj-awb artifact video import-storyboard --project-id <projectId> --input-file 3_footage/output/ep001/ep001_storyboard.json --dry-run',
1301
- 'lj-awb artifact video import-storyboard --project-id <projectId> --input-file output/ep001/ep001_storyboard.json --yes',
1302
- ],
1303
- args: [PROJECT_ID_ARG, { name: 'input-file', valueName: 'path', description: 'epXXX_storyboard.json 路径' }, ...ARTIFACT_WRITE_ARGS],
1304
- func: artifact.artifactVideoImportStoryboard,
1305
- },
1306
- ]) {
1307
- cli({
1308
- name: spec.name,
1309
- description: commandHelp(spec.summary, { examples: spec.examples }),
1310
- args: spec.args,
1311
- func: async (_ctx, kwargs) => spec.func(kwargs),
1312
- });
1313
- }
1314
-
1315
- for (const spec of [
1316
- {
1317
- name: 'artifact clip get',
1318
- summary: '查询项目完整剪辑最终产物',
1319
- examples: ['lj-awb artifact clip get --project-id <projectId>'],
1320
- args: [PROJECT_ID_ARG],
1321
- func: artifact.artifactClipGet,
1322
- },
1323
- {
1324
- name: 'artifact clip episodes',
1325
- summary: '查询项目剪辑产物列表',
1326
- examples: ['lj-awb artifact clip episodes --project-id <projectId>'],
1327
- args: [PROJECT_ID_ARG],
1328
- func: artifact.artifactClipEpisodes,
1329
- },
1330
- {
1331
- name: 'artifact clip episode',
1332
- summary: '按 videoEpisodeId 查询单集剪辑产物',
1333
- examples: ['lj-awb artifact clip episode --project-id <projectId> --video-episode-id 101'],
1334
- args: [PROJECT_ID_ARG, ARTIFACT_VIDEO_EPISODE_ID_ARG],
1335
- func: artifact.artifactClipEpisode,
1336
- },
1337
- {
1338
- name: 'artifact clip episode-by-id',
1339
- summary: '按业务 episodeId 查询单集剪辑产物',
1340
- examples: ['lj-awb artifact clip episode-by-id --project-id <projectId> --episode-id ep_001'],
1341
- args: [PROJECT_ID_ARG, ARTIFACT_EPISODE_ARG],
1342
- func: artifact.artifactClipEpisodeById,
1343
- },
1344
- {
1345
- name: 'artifact clip upsert-episode',
1346
- summary: '新增或更新单集剪辑最终产物',
1347
- examples: ['lj-awb artifact clip upsert-episode --project-id <projectId> --input-file ./clip-output.json --dry-run', 'lj-awb artifact clip upsert-episode --project-id <projectId> --input-file ./clip-output.json --yes'],
1348
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1349
- func: artifact.artifactClipUpsertEpisode,
1350
- },
1351
- {
1352
- name: 'artifact clip upsert-batch',
1353
- summary: '批量新增或更新剪辑最终产物',
1354
- examples: ['lj-awb artifact clip upsert-batch --project-id <projectId> --input-file ./clip-output-list.json --dry-run', 'lj-awb artifact clip upsert-batch --project-id <projectId> --input-file ./clip-output-list.json --yes'],
1355
- args: [PROJECT_ID_ARG, ...BODY_INPUT_ARGS, ...ARTIFACT_WRITE_ARGS],
1356
- func: artifact.artifactClipUpsertBatch,
1357
- },
1358
- {
1359
- name: 'artifact clip update-status',
1360
- summary: '只更新剪辑产物 status;messages 非空时覆盖',
1361
- examples: ['lj-awb artifact clip update-status --project-id <projectId> --video-episode-id 101 --status music_success --messages-json \'[{"level":"info","step":"music","message":"配乐完成"}]\' --dry-run'],
1362
- args: [
1363
- PROJECT_ID_ARG,
1364
- ARTIFACT_VIDEO_EPISODE_ID_ARG,
1365
- { name: 'status', valueName: 'status', description: '剪辑阶段状态,例如 concat_success / music_success / burn_success' },
1366
- { name: 'messages-json', valueName: 'json', description: '可选 messages 数组 JSON;传入时覆盖原 messages' },
1367
- ...ARTIFACT_WRITE_ARGS,
1368
- ],
1369
- func: artifact.artifactClipUpdateStatus,
1370
- },
1371
- {
1372
- name: 'artifact clip delete-episode',
1373
- summary: '逻辑删除单集剪辑最终产物',
1374
- examples: ['lj-awb artifact clip delete-episode --project-id <projectId> --video-episode-id 101 --dry-run', 'lj-awb artifact clip delete-episode --project-id <projectId> --video-episode-id 101 --yes'],
1375
- args: [PROJECT_ID_ARG, ARTIFACT_VIDEO_EPISODE_ID_ARG, ...ARTIFACT_WRITE_ARGS],
1376
- func: artifact.artifactClipDeleteEpisode,
1377
- },
1378
- ]) {
1379
- cli({
1380
- name: spec.name,
1381
- description: commandHelp(spec.summary, { examples: spec.examples }),
1382
- args: spec.args,
1383
- func: async (_ctx, kwargs) => spec.func(kwargs),
1384
- });
1385
- }
1386
-
1387
929
  cli({
1388
930
  name: 'create subject-list',
1389
931
  description: commandHelp('查询可用于视频主体参考的元素 / 主体', {