Selaa lähdekoodia

fix: reviser loads volume outline, story bible, character matrix, summaries

Reviser previously only had state/ledger/hooks/style_guide — could not
fix outline adherence, OOC, or foreshadowing issues due to missing
context.
Ma 7 kuukautta sitten
vanhempi
commit
44d1de91ca
1 muutettua tiedostoa jossa 18 lisäystä ja 2 poistoa
  1. 18 2
      packages/core/src/agents/reviser.ts

+ 18 - 2
packages/core/src/agents/reviser.ts

@@ -49,11 +49,15 @@ export class ReviserAgent extends BaseAgent {
     mode: ReviseMode = "rewrite",
     mode: ReviseMode = "rewrite",
     genre?: string,
     genre?: string,
   ): Promise<ReviseOutput> {
   ): Promise<ReviseOutput> {
-    const [currentState, ledger, hooks, styleGuideRaw] = await Promise.all([
+    const [currentState, ledger, hooks, styleGuideRaw, volumeOutline, storyBible, characterMatrix, chapterSummaries] = await Promise.all([
       this.readFileSafe(join(bookDir, "story/current_state.md")),
       this.readFileSafe(join(bookDir, "story/current_state.md")),
       this.readFileSafe(join(bookDir, "story/particle_ledger.md")),
       this.readFileSafe(join(bookDir, "story/particle_ledger.md")),
       this.readFileSafe(join(bookDir, "story/pending_hooks.md")),
       this.readFileSafe(join(bookDir, "story/pending_hooks.md")),
       this.readFileSafe(join(bookDir, "story/style_guide.md")),
       this.readFileSafe(join(bookDir, "story/style_guide.md")),
+      this.readFileSafe(join(bookDir, "story/volume_outline.md")),
+      this.readFileSafe(join(bookDir, "story/story_bible.md")),
+      this.readFileSafe(join(bookDir, "story/character_matrix.md")),
+      this.readFileSafe(join(bookDir, "story/chapter_summaries.md")),
     ]);
     ]);
 
 
     // Load genre profile and book rules
     // Load genre profile and book rules
@@ -108,6 +112,18 @@ ${gp.numericalSystem ? "\n=== UPDATED_LEDGER ===\n(更新后的完整资源账
     const ledgerBlock = gp.numericalSystem
     const ledgerBlock = gp.numericalSystem
       ? `\n## 资源账本\n${ledger}`
       ? `\n## 资源账本\n${ledger}`
       : "";
       : "";
+    const outlineBlock = volumeOutline !== "(文件不存在)"
+      ? `\n## 卷纲\n${volumeOutline}\n`
+      : "";
+    const bibleBlock = storyBible !== "(文件不存在)"
+      ? `\n## 世界观设定\n${storyBible}\n`
+      : "";
+    const matrixBlock = characterMatrix !== "(文件不存在)"
+      ? `\n## 角色交互矩阵\n${characterMatrix}\n`
+      : "";
+    const summariesBlock = chapterSummaries !== "(文件不存在)"
+      ? `\n## 章节摘要\n${chapterSummaries}\n`
+      : "";
 
 
     const userPrompt = `请修正第${chapterNumber}章。
     const userPrompt = `请修正第${chapterNumber}章。
 
 
@@ -119,7 +135,7 @@ ${currentState}
 ${ledgerBlock}
 ${ledgerBlock}
 ## 伏笔池
 ## 伏笔池
 ${hooks}
 ${hooks}
-
+${outlineBlock}${bibleBlock}${matrixBlock}${summariesBlock}
 ## 文风指南
 ## 文风指南
 ${styleGuide}
 ${styleGuide}