@lingjingai/scriptctl 0.49.7 → 0.49.9
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/changes/0.49.9.md +13 -0
- package/dist/cli.js +37 -28
- package/dist/cli.js.map +1 -1
- package/dist/common.js +2 -4
- package/dist/common.js.map +1 -1
- package/dist/help-text.js +51 -28
- package/dist/help-text.js.map +1 -1
- package/dist/infra/script-output-api.d.ts +10 -6
- package/dist/infra/script-output-api.js +27 -4
- package/dist/infra/script-output-api.js.map +1 -1
- package/dist/infra/script-output-store.d.ts +22 -0
- package/dist/infra/script-output-store.js.map +1 -1
- package/dist/infra/script-working-copy.d.ts +22 -0
- package/dist/infra/script-working-copy.js +155 -0
- package/dist/infra/script-working-copy.js.map +1 -0
- package/dist/usecases/ingest/publish-command.d.ts +1 -4
- package/dist/usecases/ingest/publish-command.js +3 -76
- package/dist/usecases/ingest/publish-command.js.map +1 -1
- package/dist/usecases/script/create.js +12 -48
- package/dist/usecases/script/create.js.map +1 -1
- package/dist/usecases/script/session.d.ts +2 -1
- package/dist/usecases/script/session.js +18 -49
- package/dist/usecases/script/session.js.map +1 -1
- package/dist/usecases/script/working-copy.d.ts +5 -0
- package/dist/usecases/script/working-copy.js +367 -0
- package/dist/usecases/script/working-copy.js.map +1 -0
- package/package.json +3 -1
- package/skills/scriptctl/SKILL.md +15 -22
- package/skills/scriptctl/references/atomic-write-workflow.md +10 -8
- package/skills/scriptctl/references/ingest-workflow.md +8 -9
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scriptctl
|
|
3
|
-
description: "剧本 script.json
|
|
3
|
+
description: "剧本 script.json 的本地读写 + 入库 CLI。远端剧本先 checkout 成工作副本,所有原子读写只改本地 script.json,完成后 publish 严格按 revision 入库;新增 op 无需新增业务 API。转剧本:ingest(txt/md/docx 或视频,产出 workspace/script.json)→ 标准化复核 → view 自查 → publish。覆盖集/场/action/资产/state/scene-ref/结构调整/批量 do/patch/校验。剧本阶段做任何剧本相关读写、以及操作两个 script.json 之前都应加载。"
|
|
4
4
|
metadata:
|
|
5
5
|
version: "0.24.0"
|
|
6
|
-
scriptctl_version: "0.49.
|
|
6
|
+
scriptctl_version: "0.49.8"
|
|
7
7
|
author: "official"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# scriptctl
|
|
11
11
|
|
|
12
|
-
`scriptctl` 读写结构化剧本 `script.json
|
|
12
|
+
`scriptctl` 读写结构化剧本 `script.json`,并把外部素材转成剧本、入库。查询和原子编辑始终作用于本地文件;远端只在 `checkout` / `publish` 边界访问。
|
|
13
13
|
|
|
14
14
|
两条主线:
|
|
15
15
|
- **转剧本入库**:`ingest`(抽取,产出 `workspace/script.json`)→ 标准化复核 → `view`(自查)→ `publish`(入库)。见 [references/ingest-workflow.md](references/ingest-workflow.md)。
|
|
@@ -45,21 +45,15 @@ location 表示可独立布置、可独立生成参考图、可重复引用的
|
|
|
45
45
|
|
|
46
46
|
人物在同一连续场内需要多份视觉参考时,先绑定第一份引用,再用 `scene-ref ... actor:<id> --state <state_id> --append` 追加其余引用;用 `--occurrence <n>` 精确修改或删除第 n 份同人物引用。地点切换、跳时或叙事线切换仍建立新 scene。收尾时用 `scenes --in <ep>` 复核相邻场界。完整命令顺序见 [references/atomic-write-workflow.md](references/atomic-write-workflow.md)。
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## 先定本地文件
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- ☁️ **沙箱里**:后端注入 `SANDBOX_PROJECT_GROUP_NO`,**裸命令自动指向该项目 DB**(自动 remote),无需任何 flag。
|
|
59
|
-
- 🖥️ **本地电脑上**:几乎每条命令都带 `--script-path <file>`。下文示例为简洁常省略它,实际本地使用请补上。
|
|
60
|
-
- **不给任何目标、又不在沙箱**:CLI 拒绝猜测并报 `SCRIPT_NO_TARGET`。选一个目标。
|
|
61
|
-
- `--script-path`(本地文件)与 `--remote`/`--local`/`--project-group-no`(store)**互斥**,混用报 `TARGET_FLAG_CONFLICT`。
|
|
62
|
-
- `--workspace-path <dir>` 只给 `ingest`/`view`/`publish`/`ingest status` 用,指 ingest 工作区,不是剧本目标。**不传就是 `<cwd>/workspace`**(默认值 `workspace` 相对当前目录解析);要放别处就显式传 `--workspace-path <dir>`,`ingest` 会在结果里回显解析后的绝对路径。`view`/`publish`/`ingest status` 要传**同一个** workspace 路径。
|
|
50
|
+
- 查询、`create`、全部原子编辑、`do`、`patch` 只接受 `--script-path <file>`;省略时统一使用 `<cwd>/workspace/script.json`。
|
|
51
|
+
- 编辑远端已有剧本:先 `scriptctl checkout [--script-path FILE]`,再对该文件运行任意原子命令,最后 `scriptctl publish [--script-path FILE]`。
|
|
52
|
+
- `checkout` 会建立 `.scriptctl/<filename>.working-copy.json`,记录远端项目、API 地址、base revision 和语义内容 hash。已有未管理文件或有本地修改时拒绝覆盖;只有明确 `--discard-local` 才丢弃。
|
|
53
|
+
- `status` 完全本地判断 managed / clean / dirty,不访问网络。
|
|
54
|
+
- `publish` 对已管理文件拉取最新 snapshot,以本地稿为准计算 diff 后严格 CAS PATCH;CAS 或网络失败会重拉、重算、重试。干净工作副本不访问网络。无 metadata 的文件只允许以 base revision 0 首次发布。
|
|
55
|
+
- 所有写命令按文件加锁;外部编辑器在命令期间改文件也会在落盘前被检测并拒绝覆盖。
|
|
56
|
+
- `--workspace-path` 仍只属于 `ingest` / `view` / `ingest status`;普通读写和 publish 用 `--script-path`。
|
|
63
57
|
|
|
64
58
|
### 两个 script.json:洗稿 / 对标 / 转绘
|
|
65
59
|
|
|
@@ -277,14 +271,13 @@ scriptctl view # 生成 review.html
|
|
|
277
271
|
scriptctl summary --script-path workspace/script.json # 抽完后当普通剧本读/改(注意目标是本地文件)
|
|
278
272
|
|
|
279
273
|
# 3) 入库:校验 v3 通过后写进目标 store
|
|
280
|
-
scriptctl publish
|
|
281
|
-
scriptctl publish --local # 本地:写 SCRIPTCTL_OUTPUT_DIR
|
|
274
|
+
scriptctl publish --script-path workspace/script.json # 首次发布或更新受管工作副本
|
|
282
275
|
```
|
|
283
276
|
|
|
284
277
|
- 🔴 **ingest 不入库**——它只产出 `<workspace>/script.json`。**入库是 `publish` 这独立一步**(沙箱里转完必须 publish,否则后端/前端看不到剧本)。
|
|
285
|
-
- 🔴 **workspace 路径**:不传 `--workspace-path` 默认 `<cwd>/workspace`;`ingest`
|
|
286
|
-
-
|
|
287
|
-
- publish
|
|
278
|
+
- 🔴 **workspace 路径**:不传 `--workspace-path` 默认 `<cwd>/workspace`;`ingest` 结果回显绝对路径。后续读写/publish 指向该目录下的 `script.json`。
|
|
279
|
+
- 抽取后用所有本地动词精修,再 publish。若后续继续编辑远端版本,checkout 到本地再改,不直接对 DB 跑原子 op。
|
|
280
|
+
- publish 使用 local-wins:远端 revision 变化时自动以最新 snapshot 为 base 重算 diff,最终远端内容与本地稿一致;不会做三方合并。
|
|
288
281
|
|
|
289
282
|
### `ingest status`:进度按真实文件判定
|
|
290
283
|
|
|
@@ -133,16 +133,18 @@ insert ep_001/scn_001 --type dialogue --content "欢迎光临。" --actor act_00
|
|
|
133
133
|
|
|
134
134
|
## 写到哪里去(落库)
|
|
135
135
|
|
|
136
|
-
`create` 和所有编辑 verb
|
|
136
|
+
`create` 和所有编辑 verb 只写本地 `--script-path <file>`;省略时是
|
|
137
|
+
`<cwd>/workspace/script.json`。远端剧本必须遵循:
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
| **DB(项目组)** | `--remote`(沙箱裸命令自动 remote),或 `--project-group-no <no>` | ☁️ **沙箱首选**。每个编辑 op 直接写进 DB 的新 revision,边写边入库 |
|
|
142
|
-
| **本地约定 store** | `--local` | 写 `SCRIPTCTL_OUTPUT_DIR` 下的约定 store |
|
|
139
|
+
```text
|
|
140
|
+
checkout → 本地查询/原子编辑/do/patch → validate → publish
|
|
141
|
+
```
|
|
143
142
|
|
|
144
|
-
-
|
|
145
|
-
-
|
|
143
|
+
- 已有远端剧本先 `scriptctl checkout --script-path draft.json`。
|
|
144
|
+
- 全程对同一个 `draft.json` 编辑。新增原子能力只需实现本地操作,不增加远端业务 API。
|
|
145
|
+
- `scriptctl status --script-path draft.json` 查看是否 dirty。
|
|
146
|
+
- `scriptctl publish --script-path draft.json` 拉最新 snapshot 后以本地稿为准生成 patch;CAS/网络失败会重拉重试,最终远端内容与本地稿一致。
|
|
147
|
+
- 本地新剧可直接 create/ingest 后首次 publish;没有 working-copy metadata 时只尝试从 revision 0 创建。
|
|
146
148
|
|
|
147
149
|
### 两份 script.json(洗稿 / 对标 / 转绘)
|
|
148
150
|
|
|
@@ -21,7 +21,7 @@ scriptctl ingest --source-path uploads/正片/
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
常用 flag:
|
|
24
|
-
- `--workspace-path <dir>`:工作区根(manifest + 各 pass 目录 + 产物)。**不传默认 `<cwd>/workspace
|
|
24
|
+
- `--workspace-path <dir>`:工作区根(manifest + 各 pass 目录 + 产物)。**不传默认 `<cwd>/workspace`**;显式传可放别处。`view` / `ingest status` 使用同一 workspace;publish 用 `--script-path <workspace>/script.json`。
|
|
25
25
|
- `--concurrency <n>`:文本/归并 fanout 并发(文本默认 80,视频默认 30)。
|
|
26
26
|
- `--video-concurrency <n>`:视频上传+转录并发。默认 10。
|
|
27
27
|
- `--fps <n>`:视频采样帧率(>1 解锁亚秒级时间码)。默认 3。
|
|
@@ -79,27 +79,26 @@ scriptctl summary --script-path workspace/script.json # 抽完当普通剧本
|
|
|
79
79
|
## 五、入库 `publish`
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
scriptctl publish
|
|
83
|
-
scriptctl publish --
|
|
84
|
-
scriptctl publish --remote --project-group-no 123 # 显式指定项目组
|
|
82
|
+
scriptctl publish --script-path workspace/script.json
|
|
83
|
+
scriptctl publish --script-path workspace/script.json --project-group-no 123
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
- `publish`
|
|
86
|
+
- `publish` 读本地 `--script-path`(默认 `workspace/script.json`),**再跑一遍 v3 校验**,通过才发布。
|
|
88
87
|
- 沙箱里转完**必须 publish**,否则后端/前端看不到剧本。
|
|
89
|
-
-
|
|
90
|
-
- publish
|
|
88
|
+
- 已管理工作副本 publish 采用 local-wins:CAS/网络失败后重拉 snapshot、重算 diff 并重试,最终远端内容以本地稿为准。
|
|
89
|
+
- 已管理且内容未变时 publish 本地直接 no-op,不发网络请求。服务端不保存 requestId,也不提供 publish 幂等重试。
|
|
91
90
|
|
|
92
91
|
## 六、复杂场景怎么接
|
|
93
92
|
|
|
94
93
|
- **转完先精修再入库**:`ingest` → 用 `--script-path workspace/script.json` 跑读写动词修(改归属、并角色、标龙套、补造型……)→ `publish`。
|
|
95
|
-
-
|
|
94
|
+
- **入库后再改**:继续编辑同一个受管本地文件再 publish;若工作副本不在,先 checkout,不能直接对 DB 跑原子命令。
|
|
96
95
|
- **视频复核**:`view` 出的 `review.html` 视频版支持点击台词跳到对应画面时间码,逐场核对发声源/造型。
|
|
97
96
|
- **超大剧集(几十集)**:并发默认已调好;失败就重跑到 `ingest status` 显示 `ready`。花名册归并只跑一次并复用,重跑很快。
|
|
98
97
|
- **归并质量**:跨集角色归并靠文字锚点,相似角色可能误合/合过头。用 `roster.review.md`(视频)核对归并决策;发现误合,入库后用 `merge` 拆分/改名修正。
|
|
99
98
|
|
|
100
99
|
## 七、抽完后的读写
|
|
101
100
|
|
|
102
|
-
抽取产物就是标准 v3 剧本,用 SKILL.md
|
|
101
|
+
抽取产物就是标准 v3 剧本,用 SKILL.md 里所有读写能力精修(目标指 `--script-path workspace/script.json`;远端稿先 checkout):
|
|
103
102
|
- `summary` / `episodes` 看整本 + 分集梗概;`actions --in <ep>` 带 timestamp 看节奏。
|
|
104
103
|
- `states <actor>` 看造型弧线;`actors --counts` 看出场频次决定 `importance`。
|
|
105
104
|
- 归属/造型修正:`dialogue <at> --actor/--kind`、`scene-ref <ep/scn> <kind:id> --state`。
|