@lingjingai/scriptctl 0.61.1 → 0.61.3

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.61.1.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  ## Added
4
4
  - `scriptctl review -p <script.json> [-s <视频目录>]`:派发一个进程内 agent 审完整本剧。
5
- 剧本只解析一次进内存、按集扇出、最后单线程做全剧收敛;每集完成即输出一行 NDJSON,
6
- 调用方可以边跑边落盘,中途挂掉不丢已完成的集。给 `-s` 走原视频拉片核对(切短片段连
7
- 声音一起送模型),不给则纯剧本审核且媒体工具不注册。`--episodes` 续跑指定集,
8
- `--concurrency` 控同时在飞的集数,`--video` 按集顺序显式指定视频,`--check` 只验就绪。
5
+ 剧本只解析一次进内存、按集扇出、最后单线程做全剧收敛;每集完成即输出一行 NDJSON。
6
+ 给 `-s` 走原视频拉片核对(切短片段连声音一起送模型),不给则纯剧本审核且媒体工具
7
+ 不注册。`--episodes` 续跑指定集,`--concurrency` 控同时在飞的集数,`--video` 按集
8
+ 顺序显式指定视频,`--check` 只验就绪。
9
9
 
10
10
  ## Fixed
11
11
  - 发布物装不上:`@lingjingai/screenplay` 是 workspace 包,npm 无法解析 `workspace:*`
@@ -0,0 +1,10 @@
1
+ # 0.61.2
2
+
3
+ ## Fixed
4
+ - `review` 每集**先落盘再输出那一行**。此前它按集报告但只在全部跑完后写一次
5
+ `script.json`,所以中途被杀的 run 会丢掉全部修改,而已经发出的那些集仍在结论里声称
6
+ 已修;调用方据「已报告」跳过它们续跑,修改就永久消失了。现在收到一行即代表那一集的
7
+ 修改已在磁盘上,中途崩溃只丢没报告的集。
8
+ - `commit` 不再把未绑定文档改成已绑定。它以前顺手写 `doc.path`,于是第一次落盘之后
9
+ 每个工具内部的 `save` 都会再写一遍整份文档——1.2MB × 每次工具调用,正好抵消「整本剧
10
+ 只解析一次进内存」的意义。绑定归 `load` / `parse`,`commit` 只负责写。
@@ -0,0 +1,4 @@
1
+ # 0.61.3
2
+
3
+ - Refresh the screenplay document indexes after every mutation, including in-memory review sessions. Repeated moves preserve action identity without duplicating actions or deleting unrelated ones; reads and subsequent edits see the current document.
4
+ - Stage scene and episode writes in a detached copy. Rejected writes leave both the document and its indexes unchanged.
package/dist/bin.js CHANGED
@@ -4207,6 +4207,7 @@ function newId(prefix, taken) {
4207
4207
  return id;
4208
4208
  }
4209
4209
  function save(doc2) {
4210
+ Object.assign(doc2, parse(doc2.raw, doc2.path));
4210
4211
  if (!doc2.path) {
4211
4212
  step("save", "skipped: document is not bound to a file");
4212
4213
  return;
@@ -4219,7 +4220,6 @@ function commit(doc2, path30 = doc2.path) {
4219
4220
  const tmp = `${path30}.tmp-${process.pid}`;
4220
4221
  fs13.writeFileSync(tmp, JSON.stringify(doc2.raw, null, 2) + "\n");
4221
4222
  fs13.renameSync(tmp, path30);
4222
- doc2.path = path30;
4223
4223
  step("commit", `${fs13.statSync(path30).size} bytes -> ${path30} (tmp + atomic rename)`);
4224
4224
  }
4225
4225
 
@@ -4941,6 +4941,13 @@ function preview(raw) {
4941
4941
  return clip(String(raw.content ?? ""), 40);
4942
4942
  }
4943
4943
  function write(doc2, addr, text2, opts = {}) {
4944
+ const draft = parse(structuredClone(doc2.raw));
4945
+ const result = writeDraft(draft, addr, text2, opts);
4946
+ doc2.raw = draft.raw;
4947
+ save(doc2);
4948
+ return result;
4949
+ }
4950
+ function writeDraft(doc2, addr, text2, opts) {
4944
4951
  if (addr === "+" || Number(addr) === doc2.episodes.length + 1) {
4945
4952
  const raw = { scenes: [] };
4946
4953
  if (doc2.version === 4)