@lingjingai/lj-awb-cli 0.4.5 → 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.
@@ -13,7 +13,6 @@
13
13
  - [分镜流水线(分镜图 → 视频)](#分镜流水线分镜图--视频) — GPT Image 2 分镜 → 视频生成
14
14
  - [预上传后批量复用](#预上传后批量复用) — `upload files` 一次,多任务复用 `backendPath`
15
15
  - [素材库加白后生视频](#素材库加白后生视频) — `model asset-review-models` → `create asset` → 视频
16
- - [Artifact 流水线错误恢复](#artifact-流水线错误恢复) — `import-storyboard` / 批量写入失败的局部重试
17
16
 
18
17
  ## 通用启动流程
19
18
 
@@ -290,77 +289,3 @@ lj-awb create video \
290
289
  - 同一角色后续视频任务复用同一 `assetId` / `assetPath`,不要每次重新 register。
291
290
  - asset 系列只服务于素材加白;**不要**把素材 `assetId` / `assetPath` 当成可灵的 `subject:reference` 用,反之亦然。
292
291
  - 不要调用隐式 submissions 自动补组;素材组查重、创建、素材注册都用显式 CLI 步骤。
293
-
294
- ## Artifact 流水线错误恢复
295
-
296
- 适用:把沙箱 / 本地流水线产出回写 AWB 时,`script import` / `asset import` / `video import-storyboard` / `clip upsert-batch` 部分失败的恢复路径。
297
-
298
- #### 全量预览,确认无误后再写
299
-
300
- 整条流水线统一先 `--dry-run`,让用户在一次确认里看完所有变更面(script / asset / video / clip 各跑一遍预览,再统一 `--yes`),避免提交一半发现规模不对。
301
-
302
- ```bash
303
- lj-awb artifact script import --project-id "$PROJECT_ID" --input-file 1_script/output/script.json --dry-run
304
- lj-awb artifact asset import --project-id "$PROJECT_ID" --input-dir 2_asset/output --dry-run
305
- lj-awb artifact video import-storyboard --project-id "$PROJECT_ID" --input-file 3_footage/output/ep001/ep001_storyboard.json --dry-run
306
- lj-awb artifact clip upsert-batch --project-id "$PROJECT_ID" --input-file 4_clip/output/ep001_clip_batch.json --dry-run
307
- ```
308
-
309
- #### 单文件 import 失败(argument_error / 业务字段错)
310
-
311
- `exit=20 error.type=argument_error`:CLI 已经拒绝写入,整条 batch 不会被部分提交。修 JSON 后重跑同一条命令。**不要**手工跑 `delete-*` 回滚,因为云端根本没写入。
312
-
313
- #### 单条 upsert 失败(某 scene/clip 字段不合法)
314
-
315
- 如果是 `upsert-batch` 已经 `--yes` 提交了一部分后某条失败:
316
-
317
- 1. 读响应 `data.results[]`,区分 `succeeded` 和 `failed`;失败项的 `body` 里有具体字段错。
318
- 2. 修这些失败行,单独跑 `upsert-clip` / `upsert-scene` / `upsert-episode` 补写,**不要**重跑整个 batch 文件(会把已成功的 episode/scene 再 upsert 一遍,浪费写入也容易盖掉已经手工修过的字段)。
319
-
320
- #### 整集需要回滚重导
321
-
322
- 确认要整集重来(例如 episodeId 拼错、storyboard 结构整体不对):
323
-
324
- ```bash
325
- lj-awb artifact video delete-episode \
326
- --project-id "$PROJECT_ID" \
327
- --episode-id ep_001 \
328
- --dry-run
329
-
330
- lj-awb artifact video delete-episode \
331
- --project-id "$PROJECT_ID" \
332
- --episode-id ep_001 \
333
- --yes
334
-
335
- lj-awb artifact video import-storyboard \
336
- --project-id "$PROJECT_ID" \
337
- --input-file 3_footage/output/ep001/ep001_storyboard.json \
338
- --yes
339
- ```
340
-
341
- `delete-episode` 会级联删除该集下所有 scene / clip(详见 [`artifact/video.md`](artifact/video.md))。
342
-
343
- #### clip 子域写入找不到 videoEpisodeId
344
-
345
- clip 子域用的是数字主键 `videoEpisodeId`,不是业务键 `ep_001`。先用 video 子域查到数字 id 再喂给 clip:
346
-
347
- ```bash
348
- lj-awb artifact video episode \
349
- --project-id "$PROJECT_ID" \
350
- --episode-id ep_001 \
351
- -f json
352
- # 取 .data.id
353
-
354
- lj-awb artifact clip update-status \
355
- --project-id "$PROJECT_ID" \
356
- --video-episode-id <上一步拿到的数字 id> \
357
- --status music_success \
358
- --messages-json '[{"level":"info","step":"music","message":"配乐完成"}]' \
359
- --yes
360
- ```
361
-
362
- 规则:
363
-
364
- - 不要在 import 失败后默认建议"全删重来";先看错误类型 — argument_error 直接修文件重跑;部分 upsert 失败用单条补写。
365
- - 删除是云端写入(虽然是逻辑删除),必须 `--dry-run` + `--yes` 两步走,不要看到 batch 报错就静默跑 delete。
366
- - artifact 系列写入失败不会扣积分;只有创作类(image/video/create asset/create subject)才有费用,恢复时不需要重新跑 `credits balance`。
@@ -16,6 +16,7 @@ CLI 失败时 envelope 形如:
16
16
  | `1` | `runtime_error` / `api_error` | 平台业务失败或一般运行异常 | 看 `message` / `details`;不要自动重试相同请求 |
17
17
  | `1` | `subject_failed` | 主体创建任务已失败 | 看 `details.errorMessage`,调整参考资源 / 模型后重新创建 |
18
18
  | `1` | `subject_voice_failed` | 主体音色创建任务已失败 | 看 `details.errorMessage`,调整音频 / 视频来源后重新创建 |
19
+ | `1` | `redeem_failed` | 兑换码兑换失败(平台 `code != 200`) | 看 `message`(平台原始提示),确认兑换码是否正确 / 已被使用;持续失败联系平台处理 |
19
20
  | `2` | `argument_error` | 必填参数缺失、参数格式 / 枚举不合法 | 按 `hint` 补参数;用 `lj-awb schema --command <name> -f json` 查 `requiredOptions / requiredAnyOptions` |
20
21
  | `2` | `unknown_command` / `unknown_option` | 命令名 / 参数名打错 | 跑 `lj-awb -h` 或对应子域 `lj-awb <domain> -h` 重查命令 |
21
22
  | `3` | `auth_required` | 缺少 access key | 提示用户 `lj-awb auth login --access-key <key>` 或设置 `LINGJING_AWB_ACCESS_KEY` |
@@ -28,6 +29,7 @@ CLI 失败时 envelope 形如:
28
29
  | `20` | `subject_still_pending` | 主体 externalId 尚未回填 | 续跑 `create subject-wait --element-id ... --wait-seconds <n>` |
29
30
  | `20` | `subject_voice_still_pending` | 主体音色 externalId 尚未回填 | 续跑 `create subject-voice-wait --voice-record-id ... --wait-seconds <n>` |
30
31
  | `20` | `auth_flow_pending` | 浏览器授权等待窗口结束但用户尚未授权 | 用 `details.flowId` 续跑 `auth login --flow-id <flowId>`,**不要重发新 login**,**不代表失败** |
32
+ | `20` | `redeem_timeout` | 交互式等待输入兑换码超时(默认约 10 分钟) | 重新跑 `credits redeem` 并及时输入,或直接 `credits redeem --code <code>` 传入 |
31
33
  | `30` | `network_error` | TLS / DNS / 连接失败 / 平台 5xx | 检查网络;macOS 证书问题用 `lj-awb`(shell wrapper)而不是直接 `node bin/lj-awb.js` |
32
34
  | `30` | `http_error` | 非 401 的 HTTP 错误(4xx / 5xx) | 看 `message`;429 等限流时退避重试 |
33
35
  | `30` | `upload_failed` | COS 上传失败 | 重试一次;持续失败检查文件大小 / mimeType / 网络 |
@@ -97,7 +99,7 @@ lj-awb auth verify # 实际打一次平台 API
97
99
 
98
100
  - 积分不足:跑 `credits balance` 给用户看余额,建议充值或换模型。
99
101
  - 模型不可用:跑 `model image-models` / `video-models` 看 `taskQueueNum` 和上下架状态。
100
- - 项目组无权限:跑 `project list` 看用户在哪个项目组,必要时 `project use --project-group-no <no> --yes`。
102
+ - 项目组无权限:跑 `project list` 看用户在哪个项目组,必要时 `project switch --project-group-no <no> --yes`。
101
103
 
102
104
  ### 场景 8:api_error code=1007(视频素材模式混用)
103
105
 
@@ -131,3 +133,18 @@ AI agent / 无法实时看输出时的标准流程:
131
133
  lj-awb auth login --no-wait --json # 拿 flowId + verifyUrl,发给用户去浏览器授权
132
134
  lj-awb auth login --flow-id <flowId> # 用户授权后续轮询,拿到并保存 accessKey
133
135
  ```
136
+
137
+ ### 场景 10:兑换码兑换(redeem_*)
138
+
139
+ `credits redeem` 的几种结果:
140
+
141
+ - `redeem_failed`(exit 1):平台返回 `code != 200`,兑换没成功。`message` 是平台原始提示,如实复述给用户,让其确认兑换码是否正确 / 已被使用;持续失败建议联系平台处理。**不要自动重试相同兑换码**。
142
+ - `redeem_timeout`(exit 20):交互式等待输入超时(默认约 10 分钟)。重新发起并提醒用户及时输入。
143
+
144
+ AI agent / 非交互终端**不要裸跑 `credits redeem`**(会因为无法读取输入直接报 `argument_error`),应让用户提供兑换码后用 `--code` 传入:
145
+
146
+ ```bash
147
+ lj-awb credits redeem --code <code> # 兑换成功后会顺带展示最新积分余额
148
+ ```
149
+
150
+ 兑换是会改账户积分的写操作,执行前先与用户确认;可先 `--dry-run` 预览将要提交的兑换码。
@@ -22,7 +22,7 @@
22
22
  | `account_summary` | `account info` | `userName`、`groupName`、`currentProjectGroupName`、`billingPointBalance` | `userId`、`groupId` | — |
23
23
  | `team_list` | `account teams` | `count` + 团队名 | `groupId` 用于 `account switch-team` | — |
24
24
  | `project_list` | `project list` | `projectGroupName`、`isSelected` | `projectGroupNo`(下游引用) | budget 详情 |
25
- | `project_summary` | `project use / create / update / current` | `projectGroupName`、`selected/created/updated`、`projectBudgetBalance` | `projectGroupNo` | `memberCount` |
25
+ | `project_summary` | `project switch / create / update / current` | `projectGroupName`、`selected/created/updated`、`projectBudgetBalance` | `projectGroupNo` | `memberCount` |
26
26
  | `project_user_list` | `project users` | `count` | `userId` | — |
27
27
 
28
28
  ## 积分
@@ -31,6 +31,8 @@
31
31
  |------------|------|-----------|--------------|--------|
32
32
  | `credits_balance` | `credits balance` | `billingPointBalance`、`projectBudgetBalance`、`projectBudgetMax` | — | `currentProjectGroupNo` |
33
33
  | `credits_usage` | `credits usage` | `pointTotal`、`scannedTaskCount`、`buckets[]` 汇总 | `tasks[]`(若 `--include-tasks`) | sinceMs/untilMs 原值 |
34
+ | `purchase_guide` | `credits buy` | `purchaseUrl` | — | — |
35
+ | `redeem_result` | `credits redeem` | `redeemed`、`billingPointBalance` | `redemptionCode` | `currentProjectGroupNo` |
34
36
 
35
37
  > 永远优先看 `billingPointBalance`(可扣积分);`projectBudgetBalance` 是项目预算 / ROI 约束,不要混为一谈。
36
38
 
@@ -98,17 +100,10 @@
98
100
  | `asset_group_write_result` | `create asset-group / group-update` | `created/updated`、`groupId`、`platform` | — | — |
99
101
  | `asset_register_result` | `create asset` | `registered`、`assetId`、`assetPath`、`platform`、`assetType` | `assetId`(下游引用) | upload 嵌套 |
100
102
 
101
- ## Artifact(产物 CRUD)
103
+ ## 更新
102
104
 
103
105
  | outputKind | 命令 | 必报给用户 | agent 内部用 | 可丢弃 |
104
106
  |------------|------|-----------|--------------|--------|
105
- | `artifact_list` | `* rows` / `* episodes` / `* scenes` / `* clips` / `* actors` / ... | `count` + 关键字段摘要 | `id / entityKey / episodeId / sceneId / clipId` | 全 row 嵌套 |
106
- | `artifact_record` | `* row` / `* episode` / `* scene` / `* clip` / `* actor` / ... | 关键标识 + 状态 | `id`(下游 update / delete 用) | 大段 description / payload |
107
- | `artifact_full` | `script get` / `asset get` / `video get` / `clip get` | 顶层 `id`、各子集合 `*.Count` | — | 整棵嵌套 |
108
- | `artifact_write_result` | `upsert-*` / `update-clip-urls` | 写入字段 + `id` | `id`(下游) | — |
109
- | `artifact_delete_result` | `delete-*` | `deleted`、`key`、级联 | — | — |
110
- | `artifact_import_result` | `* import` / `import-storyboard` / `upsert-batch` | `imported`、`rowCount/actorCount/...`、文件计数 | `rowsByKind`(用于断言) | `batch` 数组 |
111
- | `artifact_status_update` | `artifact clip update-status` | `updated`、`status` | — | messageCount |
112
107
  | `update_result` | `update` / `update --check` | `updateAvailable`、`currentVersion`、`latestVersion`、`command` | `skillUpdated`、`restartRecommended` | 安装日志 |
113
108
 
114
109
  ## Dry-run
@@ -118,4 +113,4 @@
118
113
  - agent 内部用:`results[]`(批量 dry-run 每条)
119
114
  - 可丢弃:完整 `request` 嵌套(已经在 compact summary 里)
120
115
 
121
- `--yes` 后再跑会换成对应的写入 outputKind(如 `task_submission` / `artifact_write_result`),字段语义见上表。
116
+ `--yes` 后再跑会换成对应的写入 outputKind(如 `task_submission`),字段语义见上表。