@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.
@@ -1,64 +0,0 @@
1
- # Artifact · Asset 子域
2
-
3
- 资产分三类:角色 (`actor`) / 道具 (`prop`) / 场景 (`location`),每类都有"主体"和"状态"两级——主体描述资产本身,状态描述某个时刻的造型 / 状态 / 镜头。
4
-
5
- 所有命令都要求 `--project-id <projectId>`(项目 ID,不是项目组编号)。回到 [`../artifact.md`](../artifact.md) 看完整域概览和导入工作流。
6
-
7
- ## 查询
8
-
9
- | 命令 | 用途 |
10
- |------|------|
11
- | `lj-awb artifact asset get --project-id <id>` | 查询完整资产产物(含三类全部) |
12
- | `lj-awb artifact asset actors --project-id <id> --include-states true` | 查询角色列表 |
13
- | `lj-awb artifact asset actor --project-id <id> --actor-key act_001` | 查询单个角色 |
14
- | `lj-awb artifact asset props --project-id <id>` | 查询道具列表 |
15
- | `lj-awb artifact asset prop --project-id <id> --prop-key prop_001` | 查询单个道具 |
16
- | `lj-awb artifact asset locations --project-id <id>` | 查询场景列表 |
17
- | `lj-awb artifact asset location --project-id <id> --location-key loc_001` | 查询单个场景 |
18
-
19
- ## 主体写入 / 删除
20
-
21
- ```bash
22
- lj-awb artifact asset upsert-actor --project-id <id> --input-file actor.json --dry-run
23
- lj-awb artifact asset upsert-prop --project-id <id> --input-file prop.json --dry-run
24
- lj-awb artifact asset upsert-location --project-id <id> --input-file location.json --dry-run
25
-
26
- lj-awb artifact asset delete-actor --project-id <id> --actor-key act_001 --dry-run
27
- lj-awb artifact asset delete-prop --project-id <id> --prop-key prop_001 --dry-run
28
- lj-awb artifact asset delete-location --project-id <id> --location-key loc_001 --dry-run
29
- ```
30
-
31
- 删除主体会级联删除该主体下的所有状态。**删主体和删状态是两个不同操作,用户说"撤回 / 删掉"时先确认是哪一种。**
32
-
33
- ## 状态写入 / 删除
34
-
35
- ```bash
36
- lj-awb artifact asset upsert-actor-state --project-id <id> --actor-key act_001 --input-file state.json --dry-run
37
- lj-awb artifact asset upsert-prop-state --project-id <id> --prop-key prop_001 --input-file state.json --dry-run
38
- lj-awb artifact asset upsert-location-state --project-id <id> --location-key loc_001 --input-file state.json --dry-run
39
-
40
- lj-awb artifact asset delete-actor-state --project-id <id> --actor-key act_001 --state-key state_001 --dry-run
41
- lj-awb artifact asset delete-prop-state --project-id <id> --prop-key prop_001 --state-key state_001 --dry-run
42
- lj-awb artifact asset delete-location-state --project-id <id> --location-key loc_001 --state-key state_001 --dry-run
43
- ```
44
-
45
- ## 批量导入
46
-
47
- ```bash
48
- lj-awb artifact asset import --project-id <id> --input-dir 2_asset/output --dry-run
49
- ```
50
-
51
- `asset import` 在 `--input-dir` 下查找 `actors/actors.json`、`props/props.json`、`locations/locations.json`,也兼容扁平的 `actors.json` / `props.json` / `locations.json`;缺哪类资产就跳过哪类,不会报错。
52
-
53
- ## 规则
54
-
55
- - 单条 body 使用 AWB 接口的 camelCase 字段;不要在 body 里传 `id`、`projectId`、`createdAt`、`updatedAt`、`isDeleted` 等审计字段。
56
- - 写入 / 删除都是逻辑写入,但仍需 `--dry-run` 预览 + `--yes` 确认两步走。
57
- - 不确定参数时先读精确 schema,例如 `lj-awb schema --domain artifact --command "asset upsert-actor" -f json`。
58
- - 输出字段速查见 [`../../references/output-fields.md`](../../references/output-fields.md) 的"Artifact"小节。
59
-
60
- ## 下一步
61
-
62
- - `asset import` 完成 → 接 [`video.md`](video.md) 导入视频集 / 场 / clip。
63
- - 想给角色加一种新造型 → 用 `upsert-actor-state` 而不是 `upsert-actor`(避免覆盖主体描述)。
64
- - 不要把这里的 `actor` / `prop` / `location` 和 [`../asset.md`](../asset.md) 的素材库("加白"用)混为一谈:这里是剧本结构里的资产,那里是平台素材库。
@@ -1,65 +0,0 @@
1
- # Artifact · Clip 子域
2
-
3
- 剪辑阶段把一个视频集打包成一行宽表产物。和 [`video 子域`](video.md) 不同的是,clip 域里每行只对应一集(不是一个镜头)。
4
-
5
- 所有命令都要求 `--project-id <projectId>`(项目 ID,不是项目组编号)。回到 [`../artifact.md`](../artifact.md) 看完整域概览和导入工作流。
6
-
7
- ## ID 矩阵(重要)
8
-
9
- clip 子域同时存在两种 ID,搞错会导致命令报参数错或读到错数据:
10
-
11
- | 命令 | 用哪个 ID 定位 | 说明 |
12
- |------|----------------|------|
13
- | `clip get` | 不需要定位 ID | 返回项目下所有剪辑产物 |
14
- | `clip episodes` | 不需要定位 ID | 列出项目所有剪辑产物 |
15
- | `clip episode` | `--video-episode-id <数字>` | 数字主键,由 `upsert-episode` 或 `artifact video episode` 返回的 `id` 字段提供 |
16
- | `clip episode-by-id` | `--episode-id ep_001` | 业务键(ep_001 等) |
17
- | `clip upsert-episode` | 不需要定位 ID | body 内含 `videoEpisodeId`,作为本次写入的目标 |
18
- | `clip upsert-batch` | 不需要定位 ID | body 是数组,每项含 `videoEpisodeId` |
19
- | `clip update-status` | `--video-episode-id <数字>` | 必须先查到主键 |
20
- | `clip delete-episode` | `--video-episode-id <数字>` | 必须先查到主键 |
21
-
22
- 要从业务键拿到数字主键,最常见的链路是:
23
-
24
- ```bash
25
- lj-awb artifact video episode --project-id <id> --episode-id ep_001 -f json
26
- # 取响应 .data.id 作为 video-episode-id
27
- ```
28
-
29
- ## 查询
30
-
31
- | 命令 | 用途 |
32
- |------|------|
33
- | `lj-awb artifact clip get --project-id <id>` | 查询项目完整剪辑产物 |
34
- | `lj-awb artifact clip episodes --project-id <id>` | 查询剪辑产物列表 |
35
- | `lj-awb artifact clip episode --project-id <id> --video-episode-id 101` | 按主键查询单集 |
36
- | `lj-awb artifact clip episode-by-id --project-id <id> --episode-id ep_001` | 按业务键查询单集 |
37
-
38
- ## 写入 / 状态 / 删除
39
-
40
- ```bash
41
- lj-awb artifact clip upsert-episode --project-id <id> --input-file clip-output.json --dry-run
42
- lj-awb artifact clip upsert-batch --project-id <id> --input-file clip-batch.json --dry-run
43
-
44
- lj-awb artifact clip update-status \
45
- --project-id <id> \
46
- --video-episode-id 101 \
47
- --status music_success \
48
- --messages-json '[{"level":"info","step":"music","message":"配乐完成"}]' \
49
- --dry-run
50
-
51
- lj-awb artifact clip delete-episode --project-id <id> --video-episode-id 101 --dry-run
52
- ```
53
-
54
- ## 规则
55
-
56
- - 单条 body 使用 AWB 接口的 camelCase 字段;不要在 body 里传 `id`、`projectId`、`createdAt`、`updatedAt`、`isDeleted` 等审计字段。
57
- - 写入 / 删除都是逻辑写入,但仍需 `--dry-run` 预览 + `--yes` 确认两步走。
58
- - 不确定参数时先读精确 schema,例如 `lj-awb schema --domain artifact --command "clip upsert-episode" -f json`。
59
- - 输出字段速查见 [`../../references/output-fields.md`](../../references/output-fields.md) 的"Artifact"小节。
60
-
61
- ## 下一步
62
-
63
- - 想拿到数字主键 `videoEpisodeId` → 先跑 `artifact video episode --project-id <id> --episode-id ep_001 -f json`,取 `.data.id`。
64
- - 配乐 / 字幕烧录等阶段汇报 → `update-status --video-episode-id <id> --status <state> --messages-json '[...]'`,不要 upsert 整行。
65
- - 整集失败要回滚 → `delete-episode --video-episode-id <id> --yes`,然后重新 `upsert-episode`。
@@ -1,37 +0,0 @@
1
- # Artifact · Script 子域
2
-
3
- 剧本最终产物按 `rowKind` 分行存储:`document / asset / state / speaker / episode / scene / action`。`document` 是根记录,其余行通过 `entityKey` 和 `parentKey` 串联。
4
-
5
- 所有命令都要求 `--project-id <projectId>`(项目 ID,不是项目组编号)。回到 [`../artifact.md`](../artifact.md) 看完整域概览和导入工作流。
6
-
7
- ## 查询
8
-
9
- | 命令 | 用途 |
10
- |------|------|
11
- | `lj-awb artifact script get --project-id <id>` | 查询完整剧本产物(含所有行) |
12
- | `lj-awb artifact script document --project-id <id>` | 仅查询 document 根记录 |
13
- | `lj-awb artifact script rows --project-id <id> --row-kind scene` | 查询某种 rowKind 的所有行 |
14
- | `lj-awb artifact script row --project-id <id> --row-kind action --entity-key "ep_001/scn_001#0"` | 查询单行 |
15
- | `lj-awb artifact script children --project-id <id> --parent-key scn_001 --row-kind action` | 按 parentKey 查询子节点 |
16
-
17
- ## 写入 / 删除
18
-
19
- ```bash
20
- lj-awb artifact script upsert-row --project-id <id> --input-file row.json --dry-run
21
- lj-awb artifact script delete-row --project-id <id> --row-kind action --entity-key "ep_001/scn_001#0" --dry-run
22
- lj-awb artifact script import --project-id <id> --input-file script.json --dry-run
23
- ```
24
-
25
- `script import` 会把 `script.json` 拆成 document / asset / state / speaker / episode / scene / action 行批量导入。
26
-
27
- ## 规则
28
-
29
- - 单条 body 使用 AWB 接口的 camelCase 字段;不要在 body 里传内部审计字段(`id`、`projectId`、`createdAt`、`updatedAt`、`isDeleted`),CLI 会自动注入或忽略。
30
- - 写入 / 删除都是逻辑写入(不真删数据),但仍需 `--dry-run` 预览 + `--yes` 确认两步走。
31
- - 不确定参数时先读精确 schema,例如 `lj-awb schema --domain artifact --command "script import" -f json`。
32
- - 输出字段速查见 [`../../references/output-fields.md`](../../references/output-fields.md) 的"Artifact"小节。
33
-
34
- ## 下一步
35
-
36
- - `script import` 完成 → 接 [`asset.md`](asset.md) 导入角色 / 道具 / 场景。
37
- - 查到某行需要修改 → 用 `upsert-row --input-file <一条 row.json>` 单条更新,不必重新跑 `import`。
@@ -1,65 +0,0 @@
1
- # Artifact · Video 子域
2
-
3
- 视频最终产物三级结构:集 (`episode`) → 场 (`scene`) → 镜头 (`clip`)。`import-storyboard` 把 `epXXX_storyboard.json` 拆成 episode + scenes + clips 一次导入;`episodeId` 优先取 JSON 字段,否则从 `ep001_storyboard.json` 文件名推断。
4
-
5
- 所有命令都要求 `--project-id <projectId>`(项目 ID,不是项目组编号)。回到 [`../artifact.md`](../artifact.md) 看完整域概览和导入工作流。
6
-
7
- ## 查询
8
-
9
- | 命令 | 用途 |
10
- |------|------|
11
- | `lj-awb artifact video get --project-id <id>` | 查询完整视频产物(含全部 episodes/scenes/clips) |
12
- | `lj-awb artifact video episodes --project-id <id>` | 查询视频集列表 |
13
- | `lj-awb artifact video episode --project-id <id> --episode-id ep_001` | 查询单集 |
14
- | `lj-awb artifact video scenes --project-id <id> --episode-id ep_001` | 查询某集下的场列表 |
15
- | `lj-awb artifact video scene --project-id <id> --episode-id ep_001 --scene-id scn_001` | 查询单场 |
16
- | `lj-awb artifact video clips --project-id <id> --episode-id ep_001 --scene-id scn_001` | 查询某场下的 clip 列表 |
17
- | `lj-awb artifact video clip --project-id <id> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001` | 查询单个 clip |
18
-
19
- ## 写入 / 回写 / 删除
20
-
21
- ```bash
22
- lj-awb artifact video upsert-episode --project-id <id> --input-file episode.json --dry-run
23
- lj-awb artifact video upsert-scene --project-id <id> --episode-id ep_001 --input-file scene.json --dry-run
24
- lj-awb artifact video upsert-clip --project-id <id> --episode-id ep_001 --scene-id scn_001 --input-file clip.json --dry-run
25
-
26
- lj-awb artifact video delete-episode --project-id <id> --episode-id ep_001 --dry-run
27
- lj-awb artifact video delete-scene --project-id <id> --episode-id ep_001 --scene-id scn_001 --dry-run
28
- lj-awb artifact video delete-clip --project-id <id> --episode-id ep_001 --scene-id scn_001 --clip-id clip_001 --dry-run
29
- ```
30
-
31
- 删除 episode 会级联 scenes/clips;删除 scene 会级联 clips。
32
-
33
- 视频生成完成后只回写 clip 链接(不覆盖 prompt / duration / payload):
34
-
35
- ```bash
36
- lj-awb artifact video update-clip-urls \
37
- --project-id <id> \
38
- --episode-id ep_001 \
39
- --scene-id scn_001 \
40
- --clip-id clip_001 \
41
- --video-urls-json '["https://example.com/a.mp4"]' \
42
- --dry-run
43
- ```
44
-
45
- ## 批量导入
46
-
47
- ```bash
48
- lj-awb artifact video import-storyboard --project-id <id> --input-file ep001_storyboard.json --dry-run
49
- ```
50
-
51
- 批量 storyboard 需要逐个 episode 文件执行 `import-storyboard`。
52
-
53
- ## 规则
54
-
55
- - 单条 body 使用 AWB 接口的 camelCase 字段;不要在 body 里传 `id`、`projectId`、`createdAt`、`updatedAt`、`isDeleted` 等审计字段。
56
- - `upsert-episode` 返回的 `id` 是数字主键,下游 [`clip 子域`](clip.md) 的 `--video-episode-id` 必须用这个值,不是 `ep_001` 业务键。
57
- - 写入 / 删除都是逻辑写入,但仍需 `--dry-run` 预览 + `--yes` 确认两步走。
58
- - 不确定参数时先读精确 schema,例如 `lj-awb schema --domain artifact --command "video upsert-episode" -f json`。
59
- - 输出字段速查见 [`../../references/output-fields.md`](../../references/output-fields.md) 的"Artifact"小节。
60
-
61
- ## 下一步
62
-
63
- - `import-storyboard` 完成 → 进 [`clip.md`](clip.md) 处理剪辑阶段(clip 子域用的 `videoEpisodeId` 就是这里 `upsert-episode` 返回的 `id` 数字主键)。
64
- - 视频任务终态拿到 `resultUrls` → `update-clip-urls --project-id ... --episode-id ... --scene-id ... --clip-id ... --video-urls-json '[...]'`,只回写链接,不动 prompt / duration。
65
- - 想看完整三级结构 → `artifact video get --project-id <id>`;只看某集 → `episode` / `scenes` / `clips`。
@@ -1,65 +0,0 @@
1
- # Artifact Module
2
-
3
- artifact 模块用于把沙箱 / 本地流水线产出的最终 JSON 写入 AWB 数据库化产物,也可直接查询或单条 CRUD。写入都是云端动作,必须先 dry-run,再经用户确认后追加 `--yes`。
4
-
5
- artifact 下有四个子域,结构和 `lj-awb artifact -h` 一致。按用户意图选子域,不要把所有命令塞进一个流程:
6
-
7
- | 子域 | 处理的内容 | 入口 |
8
- |------|------------|------|
9
- | `artifact script` | 剧本 document / asset / state / speaker / episode / scene / action 行 | [`artifact/script.md`](artifact/script.md) |
10
- | `artifact asset` | 角色 / 道具 / 场景 及各自状态 | [`artifact/asset.md`](artifact/asset.md) |
11
- | `artifact video` | 视频集 / 场 / clip 三级最终产物 | [`artifact/video.md`](artifact/video.md) |
12
- | `artifact clip` | 剪辑宽表(按集组织) | [`artifact/clip.md`](artifact/clip.md) |
13
-
14
- ## 项目 ID
15
-
16
- 所有 artifact 命令都需要 `--project-id <projectId>`。沙箱环境通常从环境变量读取:
17
-
18
- ```bash
19
- PROJECT_ID="${SANDBOX_PROJECT_ID:?missing SANDBOX_PROJECT_ID}"
20
- ```
21
-
22
- `--project-id` 是项目本身的标识,和 `--project-group-no`(项目组编号,用于积分 / 创作类命令)不是同一个概念,不要混用。
23
-
24
- ## 标准导入工作流
25
-
26
- 完整流水线推荐顺序:script → asset → video → clip。每步独立,前一步不强依赖后一步,但 clip 的 `videoEpisodeId` 来自 video 阶段返回的主键。
27
-
28
- ```bash
29
- lj-awb artifact script import \
30
- --project-id "$PROJECT_ID" \
31
- --input-file 1_script/output/script.json \
32
- --dry-run
33
-
34
- lj-awb artifact asset import \
35
- --project-id "$PROJECT_ID" \
36
- --input-dir 2_asset/output \
37
- --dry-run
38
-
39
- lj-awb artifact video import-storyboard \
40
- --project-id "$PROJECT_ID" \
41
- --input-file 3_footage/output/ep001/ep001_storyboard.json \
42
- --dry-run
43
-
44
- lj-awb artifact clip upsert-episode \
45
- --project-id "$PROJECT_ID" \
46
- --input-file 4_clip/output/ep001_clip_output.json \
47
- --dry-run
48
- ```
49
-
50
- 用户确认后,把对应命令的 `--dry-run` 替换为 `--yes`。批量 storyboard 逐 episode 调用;批量 clip 用 `artifact clip upsert-batch`。
51
-
52
- ## 通用规则
53
-
54
- - 不确定命令参数时先读 `lj-awb schema --domain artifact -f json`,再回到对应子域文件。
55
- - 写入 / 删除全部是逻辑写入(不真删数据),但仍需 `--dry-run` 预览 + `--yes` 确认两步走。
56
- - 单条 body 使用 AWB 接口的 camelCase 字段;不要在 body 里传内部审计字段(`id`、`projectId`、`createdAt`、`updatedAt`、`isDeleted`),CLI 会自动注入或忽略。
57
- - 用户说"存一下 / 写到 AWB / 同步上去"但没指明哪类产物时,先确认是 script / asset / video / clip 哪个子域,再走对应子域文件,不要默认选一个开干。
58
- - 用户说"删掉某条 / 撤回"涉及 asset 子域时,先确认是删主体还是删状态(删主体会级联删状态)。
59
- - 输出字段速查见 [`../references/output-fields.md`](../references/output-fields.md) 的"Artifact"小节;写入失败 / argument_error 见 [`../references/error-codes.md`](../references/error-codes.md)。
60
-
61
- ## 下一步
62
-
63
- - 整条流水线:[script.md](artifact/script.md) → [asset.md](artifact/asset.md) → [video.md](artifact/video.md) → [clip.md](artifact/clip.md),按顺序导入。
64
- - 视频任务结果回写产物:拿到 `task wait` 的 `resultUrls` → `artifact video update-clip-urls --project-id <id> --episode-id <ep> --scene-id <scn> --clip-id <clip> --video-urls-json '[...]'`。
65
- - 剪辑阶段状态汇报:`artifact clip update-status --video-episode-id <数字主键> --status <state> --messages-json '[...]'`。