@yangda611/dsh-scriptor 8.4.7 → 8.4.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/README.md CHANGED
@@ -1,23 +1,23 @@
1
1
  # Webnovel Writer · 网文写作工作台
2
2
 
3
- Scriptor 8.4.7 适配 DSH 0.2.2-rc.1。安装范围为 `>=0.2.2-rc.1 <0.3.0-0`,Node最低24.9;实际验证按具体版本记录。
3
+ Scriptor 8.4.9 适配 DSH 0.2.2-rc.1。安装范围为 `>=0.2.2-rc.1 <0.3.0-0`,Node最低24.9;实际验证按具体版本记录。
4
4
 
5
5
  [产品主页](https://yangda611.github.io/dsh-scriptor-full/) · [新手教程](https://yangda611.github.io/dsh-scriptor-full/docs/beginner.html)
6
6
 
7
- > Scriptor 8.4.7 配套 **DSH 0.2.2-rc.1**。旧格式先备份并使用书仓维护预览,按明确批准执行升级。
7
+ > Scriptor 8.4.9 配套 **DSH 0.2.2-rc.1**。旧格式先备份并使用书仓维护预览,按明确批准执行升级。
8
8
 
9
- DSH 插件 `@yangda611/dsh-scriptor` 提供写作工作台。8.4.7包含14个写作与维护技能和八个脚本入口。
9
+ DSH 插件 `@yangda611/dsh-scriptor` 提供写作工作台。8.4.9包含14个写作与维护技能和八个脚本入口。
10
10
  要求 Node.js至少24.9,DSH 0.2.2-rc.1。许可证 GPL-3.0-only。
11
11
 
12
12
  ## 安装
13
13
 
14
- 在 DSH 0.2.2-rc.1 桌面端侧栏打开“插件 → 添加插件”,输入 `@yangda611/dsh-scriptor@8.4.7`,核对后安装并应用变更。桌面端自带运行时,不需要另外安装 Node/pnpm。
14
+ 在 DSH 0.2.2-rc.1 桌面端侧栏打开“插件 → 添加插件”,输入 `@yangda611/dsh-scriptor@8.4.9`,核对后安装并应用变更。桌面端自带运行时,不需要另外安装 Node/pnpm。
15
15
 
16
16
  以下是进阶用户创建独立 Web profile 的方式,不用于桌面端保留的 `desktop` profile:
17
17
 
18
18
  ```powershell
19
19
  dsh --profile webnovel --from-default-profile web --dump-config
20
- dsh plugin --profile webnovel add C:/scriptor-dist/yangda611-dsh-scriptor-8.4.7.tgz
20
+ dsh plugin --profile webnovel add C:/scriptor-dist/yangda611-dsh-scriptor-8.4.9.tgz
21
21
  dsh --profile webnovel --host 127.0.0.1 --port 6104 --no-open
22
22
  ```
23
23
 
@@ -27,7 +27,7 @@ dsh --profile webnovel --host 127.0.0.1 --port 6104 --no-open
27
27
 
28
28
  ## 更新与卸载
29
29
 
30
- 先停止指定 profile 的运行实例,再安装目标精确版本并重启(本版为 `C:/scriptor-dist/yangda611-dsh-scriptor-8.4.7.tgz`)。
30
+ 先停止指定 profile 的运行实例,再安装目标精确版本并重启(本版为 `C:/scriptor-dist/yangda611-dsh-scriptor-8.4.9.tgz`)。
31
31
  卸载后可执行上面的安装命令重装:
32
32
 
33
33
  ```powershell
@@ -37,7 +37,9 @@ dsh --profile webnovel --dump-config
37
37
 
38
38
  卸载插件不会删除作品书仓。安装不需要源码、安装时构建或 npm 账号。tarball 放在无空格目录,并核对对应 Release 提供的 SHA256。首次下载宿主依赖仍可能需要网络。
39
39
 
40
- ## 8.4.7 更新与旧项目升级
40
+ ## 8.4.9 更新与旧项目升级
41
+
42
+ 短剧单集渲染现在会核对作品契约并保存到 `草稿区/剧本/短剧/集NNN.md`,读回内容一致后才报告保存成功。结果中的 `path` 是实际草稿路径,`finalPath` 是未来定稿路径;草稿仍须节拍检查、审读和作者确认。缺失或类型错误的嵌套字段会得到具体诊断。完整变更见仓库 CHANGELOG。
41
43
 
42
44
  本二开版保持原有的千章关系星团、证据轨迹、原生设置与书仓维护能力。先升级到 DSH 0.2.2-rc.1,再更新已用插件。旧格式须先备份,检查并预览整仓升级;正常读取不再转换旧字段。升级后新建写作模式对话,打开原工作区继续;旧对话不会自动迁移。
43
45
 
@@ -45,11 +47,11 @@ dsh --profile webnovel --dump-config
45
47
 
46
48
  **旧项目升级后请补充并确认作品契约的章节篇幅**:保留“阅读体验与情绪承诺”原内容,追加目标汉字数与宽松上下限,经原契约工具保存确认。未配置仍可使用,但不启用范围核对。脚本按实际正文汉字数检查,越界沿原文本规范发现项处置,不增加审批步骤。见 [升级与备份](https://github.com/yangda611/dsh-scriptor-full/blob/main/docs/user/upgrade-backup.md)。
47
49
 
48
- 本次检索增加独立图谱模型,已包含在主包内;桌宠同步兼容版本,安装仍可选;full 与主包相同,不包含桌宠,不与主包入口重复安装。
50
+ 本次检索与桌宠为兼容发行,无新增功能。检索已包含在主包内;桌宠独立可选;full 与主包相同,不包含桌宠,不与主包入口重复安装。
49
51
 
50
52
  ## 公开文档
51
53
 
52
- 当前主包 8.4.7。完整的安装、配置、首章和备份教程见 [公开使用文档](https://github.com/yangda611/dsh-scriptor-full/tree/main/docs/user)。
54
+ 当前主包 8.4.9。完整的安装、配置、首章和备份教程见 [公开使用文档](https://github.com/yangda611/dsh-scriptor-full/tree/main/docs/user)。
53
55
 
54
56
  第三方组件的原始声明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md),许可证文本随包放在 licenses/。源码及校验和由对应的 GitHub Release 提供。
55
57
 
package/lib/cli.js CHANGED
@@ -11334,6 +11334,11 @@ function inside(root, rel) {
11334
11334
  if (!isInsideCanonicalRoot(root, abs)) throw new Error(`\u4E8B\u52A1\u8DEF\u5F84\u9003\u9038\u4E66\u4ED3\uFF1A${rel}`);
11335
11335
  return abs;
11336
11336
  }
11337
+ function hasReservedTopLevel(relPath) {
11338
+ let first = relPath.split("/")[0]?.toLowerCase() ?? "";
11339
+ if (process.platform === "win32") first = first.replace(/[. ]+$/, "");
11340
+ return first === RUNTIME_DIR || first === ".git";
11341
+ }
11337
11342
  function writeDurable(file, content, flag = "wx") {
11338
11343
  const fd = fs6.openSync(file, flag, 438);
11339
11344
  try {
@@ -11668,11 +11673,16 @@ function runLocked(root, ops, options2) {
11668
11673
  const id = `${Date.now().toString(36)}-${process.pid}-${randomBytes(5).toString("hex")}`;
11669
11674
  const normalized = ops.map((op) => ({ relPath: safeRel(op.relPath), content: op.content }));
11670
11675
  for (const op of normalized) {
11671
- const first = op.relPath.split("/")[0]?.toLowerCase();
11672
- if (first === RUNTIME_DIR || first === ".git") throw new Error(`\u4E8B\u52A1\u76EE\u6807\u4E3A\u4FDD\u7559\u8DEF\u5F84\uFF1A${op.relPath}`);
11676
+ if (hasReservedTopLevel(op.relPath)) throw new Error(`\u4E8B\u52A1\u76EE\u6807\u4E3A\u4FDD\u7559\u8DEF\u5F84\uFF1A${op.relPath}`);
11673
11677
  inside(root, op.relPath);
11674
11678
  }
11675
- if (new Set(normalized.map((op) => op.relPath)).size !== normalized.length) {
11679
+ const targets = normalized.map((op) => {
11680
+ const target = canonicalizePath(inside(root, op.relPath));
11681
+ const relative10 = path6.relative(root, target).split(path6.sep).map((part) => process.platform === "win32" ? part.replace(/[. ]+$/, "").toLowerCase() : part).join("/");
11682
+ if (hasReservedTopLevel(relative10)) throw new Error(`\u4E8B\u52A1\u76EE\u6807\u4E3A\u4FDD\u7559\u8DEF\u5F84\uFF1A${op.relPath}`);
11683
+ return relative10;
11684
+ });
11685
+ if (new Set(targets).size !== normalized.length) {
11676
11686
  throw new Error("\u4E8B\u52A1\u76EE\u6807\u8DEF\u5F84\u91CD\u590D");
11677
11687
  }
11678
11688
  const txRoot = path6.join(root, TRANSACTION_DIR, id);
@@ -15962,11 +15972,19 @@ function runScreenplayReview(input) {
15962
15972
  }
15963
15973
 
15964
15974
  // ../core/src/shortdrama/types.ts
15975
+ var SHORTDRAMA_ORIENTATIONS = ["\u7AD6\u5C4F", "\u6A2A\u5C4F"];
15976
+ var HOOK_TYPES = ["\u8EAB\u4EFD", "\u60C5\u611F", "\u987F\u609F"];
15965
15977
  var HOOK_ROTATION = ["\u8EAB\u4EFD", "\u60C5\u611F", "\u987F\u609F"];
15966
15978
  function hookTypeForEpisode(\u96C6) {
15967
15979
  if (!Number.isSafeInteger(\u96C6) || \u96C6 < 1) throw new Error(`\u96C6\u53F7\u5FC5\u987B\u662F\u6B63\u6574\u6570\uFF08\u6536\u5230\uFF1A${String(\u96C6)}\uFF09`);
15968
15980
  return HOOK_ROTATION[(\u96C6 - 1) % HOOK_ROTATION.length];
15969
15981
  }
15982
+ function isHookType(value) {
15983
+ return typeof value === "string" && HOOK_TYPES.includes(value);
15984
+ }
15985
+ function isShortDramaOrientation(value) {
15986
+ return typeof value === "string" && SHORTDRAMA_ORIENTATIONS.includes(value);
15987
+ }
15970
15988
 
15971
15989
  // ../core/src/shortdrama/templates.ts
15972
15990
  var SHORTDRAMA_SOURCES = {
@@ -16232,7 +16250,74 @@ function isBeatMark(mark) {
16232
16250
  function fail2(message) {
16233
16251
  throw new Error(`\u5355\u96C6\u5267\u672C\u6E32\u67D3\u5931\u8D25\uFF1A${message}`);
16234
16252
  }
16253
+ function requireRecord(value, field) {
16254
+ if (value === null || typeof value !== "object" || Array.isArray(value)) fail2(`${field}\u5FC5\u987B\u662F\u4E00\u4E2A\u5BF9\u8C61`);
16255
+ return value;
16256
+ }
16257
+ function requireArray(value, field) {
16258
+ if (!Array.isArray(value)) fail2(`${field}\u5FC5\u987B\u662F\u4E00\u4E2A\u6570\u7EC4`);
16259
+ return value;
16260
+ }
16261
+ function requireString(value, field) {
16262
+ if (typeof value !== "string") fail2(`${field}\u5FC5\u987B\u662F\u5B57\u7B26\u4E32`);
16263
+ }
16264
+ function requireNumber(value, field) {
16265
+ if (typeof value !== "number") fail2(`${field}\u5FC5\u987B\u662F\u6570\u5B57`);
16266
+ }
16267
+ function requireStringArray(value, field) {
16268
+ for (const [index, item] of requireArray(value, field).entries()) requireString(item, `${field}[${index}]`);
16269
+ }
16270
+ function validateLines(value, field) {
16271
+ for (const [index, item] of requireArray(value, field).entries()) {
16272
+ const where = `${field}[${index}]`;
16273
+ const line = requireRecord(item, where);
16274
+ requireString(line["\u89D2\u8272"], `${where}.\u89D2\u8272`);
16275
+ requireString(line["\u53F0\u8BCD"], `${where}.\u53F0\u8BCD`);
16276
+ if (line["\u62EC\u53F7\u63D0\u793A"] !== void 0) requireString(line["\u62EC\u53F7\u63D0\u793A"], `${where}.\u62EC\u53F7\u63D0\u793A`);
16277
+ }
16278
+ }
16279
+ function validateStructure(input) {
16280
+ const value = requireRecord(input, "\u53C2\u6570");
16281
+ for (const field of ["\u6807\u9898", "\u6838\u5FC3\u60F3\u6CD5", "\u723D\u70B9", "\u7ED3\u5C3E\u60AC\u5FF5"]) requireString(value[field], field);
16282
+ if (!isShortDramaOrientation(value["\u753B\u5E45"])) fail2("\u753B\u5E45\u5FC5\u987B\u662F\u7AD6\u5C4F\u6216\u6A2A\u5C4F");
16283
+ if (!isHookType(value["\u94A9\u5B50\u7C7B\u578B"])) fail2("\u94A9\u5B50\u7C7B\u578B\u5FC5\u987B\u662F\u8EAB\u4EFD\u3001\u60C5\u611F\u6216\u987F\u609F");
16284
+ for (const field of ["\u5F00\u573A\u51B2\u7A81\u79D2", "\u7ED3\u5C3E\u94A9\u5B50\u79D2"]) requireNumber(value[field], field);
16285
+ for (const [index, second] of requireArray(value["\u53CD\u8F6C\u79D2"], "\u53CD\u8F6C\u79D2").entries()) requireNumber(second, `\u53CD\u8F6C\u79D2[${index}]`);
16286
+ for (const [index, item] of requireArray(value["\u573A\u666F"], "\u573A\u666F").entries()) {
16287
+ const where = `\u573A\u666F[${index}]`;
16288
+ const scene = requireRecord(item, where);
16289
+ for (const field of ["\u5730\u70B9", "\u65F6\u95F4", "\u52A8\u4F5C"]) requireString(scene[field], `${where}.${field}`);
16290
+ if (scene["\u5185\u5916"] !== "\u5185" && scene["\u5185\u5916"] !== "\u5916") fail2(`${where}.\u5185\u5916\u5FC5\u987B\u662F\u5185\u6216\u5916`);
16291
+ validateLines(scene["\u53F0\u8BCD"], `${where}.\u53F0\u8BCD`);
16292
+ if (scene["\u573A\u666F\u73AF\u5883"] !== void 0) requireString(scene["\u573A\u666F\u73AF\u5883"], `${where}.\u573A\u666F\u73AF\u5883`);
16293
+ if (scene["\u4EBA\u7269"] !== void 0) {
16294
+ for (const [personIndex, personItem] of requireArray(scene["\u4EBA\u7269"], `${where}.\u4EBA\u7269`).entries()) {
16295
+ const personWhere = `${where}.\u4EBA\u7269[${personIndex}]`;
16296
+ const person = requireRecord(personItem, personWhere);
16297
+ requireString(person["\u89D2\u8272"], `${personWhere}.\u89D2\u8272`);
16298
+ if (person["\u5F62\u8C61\u6807\u8BC6"] !== void 0) requireString(person["\u5F62\u8C61\u6807\u8BC6"], `${personWhere}.\u5F62\u8C61\u6807\u8BC6`);
16299
+ }
16300
+ }
16301
+ if (scene["\u955C\u5934"] !== void 0) {
16302
+ for (const [shotIndex, shotItem] of requireArray(scene["\u955C\u5934"], `${where}.\u955C\u5934`).entries()) {
16303
+ const shotWhere = `${where}.\u955C\u5934[${shotIndex}]`;
16304
+ const shot = requireRecord(shotItem, shotWhere);
16305
+ requireNumber(shot["\u955C\u5934\u53F7"], `${shotWhere}.\u955C\u5934\u53F7`);
16306
+ for (const field of ["\u5F00\u59CB\u79D2", "\u7ED3\u675F\u79D2"]) {
16307
+ if (shot[field] !== null) requireNumber(shot[field], `${shotWhere}.${field}\uFF08\u672A\u77E5\u65F6\u586B null\uFF09`);
16308
+ }
16309
+ for (const field of ["\u666F\u522B", "\u89D2\u5EA6", "\u8FD0\u955C"]) requireString(shot[field], `${shotWhere}.${field}`);
16310
+ requireStringArray(shot["\u63CF\u5199"], `${shotWhere}.\u63CF\u5199`);
16311
+ validateLines(shot["\u53F0\u8BCD"], `${shotWhere}.\u53F0\u8BCD`);
16312
+ for (const field of ["\u73AF\u5883\u58F0", "\u5B57\u5E55"]) {
16313
+ if (shot[field] !== void 0) requireStringArray(shot[field], `${shotWhere}.${field}`);
16314
+ }
16315
+ }
16316
+ }
16317
+ }
16318
+ }
16235
16319
  function validate(input) {
16320
+ validateStructure(input);
16236
16321
  const warnings = [];
16237
16322
  const template = RHYTHM_TEMPLATES[input.\u753B\u5E45];
16238
16323
  if (!Number.isSafeInteger(input.\u96C6) || input.\u96C6 < 1 || input.\u96C6 > 100) {
@@ -18851,10 +18936,10 @@ function computeScreenplayExport(bookRoot, options2) {
18851
18936
  if (options2.\u5F62\u6001 !== "\u7535\u5F71\u5267\u672C" && options2.\u5F62\u6001 !== "\u77ED\u5267") return fail3(["\u5BFC\u51FA\u5F62\u6001\u5FC5\u987B\u662F \u7535\u5F71\u5267\u672C \u6216 \u77ED\u5267"]);
18852
18937
  const \u683C\u5F0F = options2.\u683C\u5F0F ?? "storyboard";
18853
18938
  if (\u683C\u5F0F !== "storyboard" && \u683C\u5F0F !== "master-scene" && \u683C\u5F0F !== "fountain" && \u683C\u5F0F !== "both") {
18854
- return fail3(["\u5BFC\u51FA\u683C\u5F0F\u5FC5\u987B\u662F storyboard\u3001master-scene\u3001fountain \u6216 both\uFF08\u65E7\u503C markdown \u5DF2\u5E9F\u5F03\uFF1A\u7535\u5F71\u9ED8\u8BA4 storyboard\uFF0C\u6B21\u8981\u5BFC\u51FA\u7528 master-scene\uFF09"]);
18939
+ return fail3(["\u5BFC\u51FA\u683C\u5F0F\u5FC5\u987B\u662F storyboard\u3001master-scene\u3001fountain \u6216 both\u3002\u65E7\u503C markdown \u5DF2\u5E9F\u5F03\u3002\u7535\u5F71\u9ED8\u8BA4 storyboard\uFF0C\u6B21\u8981\u5BFC\u51FA\u7528 master-scene\u3002"]);
18855
18940
  }
18856
18941
  if (options2.\u5F62\u6001 === "\u77ED\u5267" && \u683C\u5F0F === "master-scene") {
18857
- return fail3(["\u77ED\u5267\u6CA1\u6709 master-scene \u5F62\u6001\uFF08\u77ED\u5267\u5267\u672C\u672C\u8EAB\u5C31\u662F\u5206\u955C\u5267\u672C\uFF09\uFF1A\u7528 storyboard\uFF08\u9ED8\u8BA4\uFF09\u3001fountain \u6216 both"]);
18942
+ return fail3(["\u77ED\u5267\u6CA1\u6709 master-scene \u5F62\u6001\uFF0C\u77ED\u5267\u5267\u672C\u672C\u8EAB\u5C31\u662F\u5206\u955C\u5267\u672C\u3002\u8BF7\u7528 storyboard\uFF08\u9ED8\u8BA4\uFF09\u3001fountain \u6216 both\u3002"]);
18858
18943
  }
18859
18944
  if (options2.\u5F62\u6001 === "\u77ED\u5267" && (options2.\u96C6 === void 0 || !Number.isSafeInteger(options2.\u96C6) || options2.\u96C6 < 1 || options2.\u96C6 > 100)) {
18860
18945
  return fail3(["\u77ED\u5267\u5BFC\u51FA\u5FC5\u987B\u4F20 --\u96C6 1\u2013100 \u7684\u96C6\u53F7"]);
@@ -18877,9 +18962,9 @@ function computeScreenplayExport(bookRoot, options2) {
18877
18962
  const \u5B9A\u7A3F\u76F8\u5BF9\u8DEF\u5F84 = options2.\u5F62\u6001 === "\u7535\u5F71\u5267\u672C" ? paths.\u7535\u5F71\u5267\u672C() : paths.\u77ED\u5267\u96C6(options2.\u96C6);
18878
18963
  let source;
18879
18964
  try {
18880
- source = fs39.readFileSync(path44.join(root, \u5B9A\u7A3F\u76F8\u5BF9\u8DEF\u5F84), "utf-8");
18881
- } catch {
18882
- return fail3([`\u5267\u672C\u5B9A\u7A3F\u4E0D\u5B58\u5728\uFF1A${\u5B9A\u7A3F\u76F8\u5BF9\u8DEF\u5F84}\uFF08\u5148\u628A\u5267\u672C\u5B9A\u7A3F\u5230 \u5267\u672C/ \u76EE\u5F55\uFF0C\u89C1 docs/book-format.md\u300C\u5267\u672C\u5B9A\u7A3F\u76EE\u5F55\u300D\uFF09`]);
18965
+ source = readMaterialFile(root, \u5B9A\u7A3F\u76F8\u5BF9\u8DEF\u5F84).text;
18966
+ } catch (error) {
18967
+ return fail3([`\u5267\u672C\u5B9A\u7A3F\u8BFB\u53D6\u5931\u8D25\uFF1A${\u5B9A\u7A3F\u76F8\u5BF9\u8DEF\u5F84}\uFF08${error instanceof Error ? error.message : String(error)}\uFF09\u3002\u8BF7\u5148\u628A\u5267\u672C\u5B9A\u7A3F\u5230 \u5267\u672C/ \u76EE\u5F55\u3002\u76EE\u5F55\u7EA6\u5B9A\u89C1 docs/book-format.md\u300C\u5267\u672C\u5B9A\u7A3F\u76EE\u5F55\u300D\u3002`]);
18883
18968
  }
18884
18969
  const stem = safeFileStem(\u4E66\u540D);
18885
18970
  if (options2.\u603B\u7EB2 !== void 0) \u603B\u7EB2\u6587\u4EF6 = `${stem}-\u603B\u7EB2.md`;
@@ -18945,6 +19030,7 @@ function computeScreenplayExport(bookRoot, options2) {
18945
19030
  const parsed = parseEpisodeScript(source);
18946
19031
  if (!parsed.ok || parsed.episode === void 0) return fail3(parsed.problems);
18947
19032
  const episode = parsed.episode;
19033
+ if (episode.\u96C6 !== options2.\u96C6) return fail3(["\u96C6\u53F7\u4E0D\u4E00\u81F4\uFF1A\u5B9A\u7A3F\u6587\u4EF6\u540D\u548C\u5267\u672C\u6B63\u6587\u5FC5\u987B\u5C5E\u4E8E\u540C\u4E00\u96C6"]);
18948
19034
  let rendered;
18949
19035
  try {
18950
19036
  rendered = renderEpisodeScript(episode);
@@ -19419,12 +19505,14 @@ function ingestAuthorRevisionLocked(bookRoot, key, body) {
19419
19505
  const baseVer = parent === null ? initialVersion("\u4F5C\u8005\u624B\u6539") : bumpVersion(parent, "\u4F5C\u8005\u624B\u6539");
19420
19506
  const ver = { ...baseVer, \u751F\u6210\u6A21\u5757: "\u4F5C\u8005\u624B\u6539" };
19421
19507
  const relPath = path46.posix.join(paths.\u8349\u7A3F\u76EE\u5F55(key.\u5377, key.\u7AE0\u540D), nextDraftFileName(bookRoot, key));
19422
- demoteOtherPendingDrafts(bookRoot, key, relPath);
19423
19508
  const fields = applyVersionFields(
19424
19509
  { ...doc.data.fields, \u89D2\u8272: "\u5F85\u5BA1\u7A3F", \u9009\u5B9A: true },
19425
19510
  ver
19426
19511
  );
19427
- writeFileAtomic(bookRoot, relPath, serializeDocument(fields, body, \u8349\u7A3F\u5B57\u6BB5\u5E8F));
19512
+ writeBatchAtomic(bookRoot, [
19513
+ ...prepareDraftDemotions(bookRoot, key, relPath),
19514
+ { relPath, content: serializeDocument(fields, body, \u8349\u7A3F\u5B57\u6BB5\u5E8F) }
19515
+ ]);
19428
19516
  const record = loadReviewRecord(bookRoot, key);
19429
19517
  const followup = followupReport(bookRoot, key, body, record);
19430
19518
  const diff = lineDiff(parentBody, body);
@@ -19628,12 +19716,8 @@ function readText8(root, rel) {
19628
19716
  return null;
19629
19717
  }
19630
19718
  }
19631
- function bodyOnly2(text) {
19632
- const r2 = parseDocument(text);
19633
- return (r2.ok ? r2.data.body : text).trim();
19634
- }
19635
19719
  function stripSummaryHeading2(text) {
19636
- return bodyOnly2(text).replace(/^#\s*章摘要\s*\n+/, "").trim();
19720
+ return text.trim().replace(/^#\s*章摘要\s*\n+/, "").trim();
19637
19721
  }
19638
19722
  function extractSection2(body, title) {
19639
19723
  const lines = body.replace(/\r\n/g, "\n").split("\n");
@@ -19673,7 +19757,9 @@ function computeVolumeSummaryCandidate(bookRoot, \u5377) {
19673
19757
  \u7F3A\u7AE0\u6458\u8981.push(c.\u7AE0);
19674
19758
  continue;
19675
19759
  }
19676
- const content = stripSummaryHeading2(text);
19760
+ const parsed = parseDocument(text);
19761
+ if (!parsed.ok) return { ok: false, reason: `\u7AE0\u6458\u8981\u89E3\u6790\u5931\u8D25\uFF1A${rel}\uFF1B${parsed.detail}\uFF0C\u4E0D\u4EA7\u5019\u9009\u4E0D\u843D\u76D8`, \u7F3A\u7AE0\u6458\u8981: [] };
19762
+ const content = stripSummaryHeading2(parsed.data.body);
19677
19763
  if (content === "" || content === "\uFF08\u65E0\u6458\u8981\u6C89\u6DC0\uFF09") {
19678
19764
  \u7F3A\u7AE0\u6458\u8981.push(c.\u7AE0);
19679
19765
  continue;
@@ -19708,7 +19794,9 @@ ${content}`);
19708
19794
  }
19709
19795
  const \u7EBF\u7D22\u6BB5 = \u7EBF\u7D22\u6BB5Parts.join("\n");
19710
19796
  const \u5377\u7EB2\u6587 = readText8(bookRoot, paths.\u5377\u7EB2(\u5377));
19711
- const \u5377\u672B\u5151\u73B0 = \u5377\u7EB2\u6587 === null ? null : extractSection2(bodyOnly2(\u5377\u7EB2\u6587), "\u5377\u672B\u5151\u73B0");
19797
+ const \u5377\u7EB2 = \u5377\u7EB2\u6587 === null ? null : parseDocument(\u5377\u7EB2\u6587);
19798
+ if (\u5377\u7EB2 !== null && !\u5377\u7EB2.ok) return { ok: false, reason: `\u5377\u7EB2\u89E3\u6790\u5931\u8D25\uFF1A${paths.\u5377\u7EB2(\u5377)}\uFF1B${\u5377\u7EB2.detail}\uFF0C\u4E0D\u4EA7\u5019\u9009\u4E0D\u843D\u76D8`, \u7F3A\u7AE0\u6458\u8981: [] };
19799
+ const \u5377\u672B\u5151\u73B0 = \u5377\u7EB2 === null ? null : extractSection2(\u5377\u7EB2.data.body, "\u5377\u672B\u5151\u73B0");
19712
19800
  const \u5019\u9009 = [
19713
19801
  "# \u5377\u6458\u8981",
19714
19802
  "",
@@ -20424,6 +20512,9 @@ function ingestFindingsLocked(bookRoot, key, \u6A21\u5757\u540D, rawFindings, ex
20424
20512
  if (check === void 0) {
20425
20513
  return { ok: false, reason: `\u672A\u6CE8\u518C\u7684\u5BA1\u8BFB\u6A21\u5757:${\u6A21\u5757\u540D}`, record: null };
20426
20514
  }
20515
+ if (check.\u9002\u7528\u8303\u56F4 !== "\u7AE0") {
20516
+ return { ok: false, reason: `\u5BA1\u8BFB\u6A21\u5757 ${\u6A21\u5757\u540D} \u9002\u7528\u8303\u56F4\u662F ${check.\u9002\u7528\u8303\u56F4}\uFF0C\u4E0D\u80FD\u56DE\u5199\u8FDB\u7AE0\u7684\u5BA1\u6838\u8BB0\u5F55`, record: null };
20517
+ }
20427
20518
  const authorOpinion = check.\u6267\u884C\u5F62\u6001 === "\u4F5C\u8005";
20428
20519
  if (!authorOpinion && (typeof expectedFingerprint !== "string" || expectedFingerprint.trim() === "")) {
20429
20520
  return { ok: false, reason: "\u81EA\u52A8\u5BA1\u8BFB\u7ED3\u679C\u5FC5\u987B\u643A\u5E26\u5BA1\u8BFB\u6307\u7EB9\uFF1A\u6BCF\u4E2A\u6A21\u5757\u56DE\u5199\u5747\u9700\u63D0\u4F9B\u5B9E\u9645\u5BA1\u8BFB\u8F93\u5165\u7684\u6307\u7EB9\uFF0C\u8BF7\u91CD\u65B0\u8FD0\u884C\u5BA1\u6838", record: null };
@@ -20554,6 +20645,9 @@ function computeScreenplayReview(bookRoot, input) {
20554
20645
  }
20555
20646
  function computeEpisodeReview(bookRoot, key, input) {
20556
20647
  registerFilmDramaChecks();
20648
+ if (key.\u96C6 !== input.\u5267\u672C.\u96C6 || key.\u96C6 !== input.\u5927\u7EB2.\u96C6) {
20649
+ return { ok: false, reason: "\u96C6\u53F7\u4E0D\u4E00\u81F4\uFF1A\u5BA1\u6838\u8BB0\u5F55\u3001\u5355\u96C6\u5267\u672C\u548C\u5206\u96C6\u5927\u7EB2\u5FC5\u987B\u5C5E\u4E8E\u540C\u4E00\u96C6", record: null };
20650
+ }
20557
20651
  const \u5267\u672C\u6587\u672C = renderEpisodeScript(input.\u5267\u672C).\u5185\u5BB9;
20558
20652
  const computed = computeEpisodeFindings({ \u96C6: key.\u96C6, \u5267\u672C: input.\u5267\u672C, \u5267\u672C\u6587\u672C, \u5927\u7EB2: input.\u5927\u7EB2, \u6750\u6599\u7248\u672C: input.\u6750\u6599\u7248\u672C });
20559
20653
  const existing = loadEpisodeReviewRecord(bookRoot, key.\u96C6) ?? emptyReviewRecord();
package/lib/graph.js CHANGED
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url)
4
4
  // ../embedding-provider/src/auxiliary.ts
5
5
  import { Service as Service2 } from "@deepseek-ai/cordis";
6
6
 
7
- // ../../node_modules/.pnpm/@deepseek-ai+dsh-credentials@0.2.2-rc.1_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-credentials/lib/index.js
7
+ // ../../node_modules/.pnpm/@deepseek-ai+dsh-credential_cb4904d5f5ea0e5c919a0b498b20243c/node_modules/@deepseek-ai/dsh-credentials/lib/index.js
8
8
  import { Service } from "@deepseek-ai/cordis";
9
9
 
10
10
  // ../embedding-provider/src/live-settings.ts