@waterwx/dsh-novel-forge 0.1.0 → 1.0.0-alpha

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.
Files changed (180) hide show
  1. package/README.md +162 -111
  2. package/cordis.patch.yml +1 -1
  3. package/lib/client.js +54165 -2666
  4. package/lib/index.js +11895 -2211
  5. package/lib/types/ai-scan.d.ts +36 -0
  6. package/lib/types/assets.d.ts +19 -4
  7. package/lib/types/assistant.d.ts +6 -0
  8. package/lib/types/author-assets.d.ts +25 -0
  9. package/lib/types/bookshelf.d.ts +8 -1
  10. package/lib/types/client/api.d.ts +235 -3
  11. package/lib/types/client/index.d.ts +1 -1
  12. package/lib/types/client/llmLive.d.ts +33 -0
  13. package/lib/types/client/locales.d.ts +101 -28
  14. package/lib/types/client/panel/AdaptModeView.d.ts +5 -0
  15. package/lib/types/client/panel/AssetsTab.d.ts +6 -1
  16. package/lib/types/client/panel/AuthorAssetsView.d.ts +4 -0
  17. package/lib/types/client/panel/AuthorHome.d.ts +34 -0
  18. package/lib/types/client/panel/BookAnalysisView.d.ts +4 -0
  19. package/lib/types/client/panel/CreateBookView.d.ts +13 -0
  20. package/lib/types/client/panel/DirectorView.d.ts +7 -0
  21. package/lib/types/client/panel/FlowGuide.d.ts +22 -0
  22. package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +4 -0
  23. package/lib/types/client/panel/IdeaInspirationView.d.ts +6 -0
  24. package/lib/types/client/panel/ImportModal.d.ts +7 -0
  25. package/lib/types/client/panel/KnowledgeBaseView.d.ts +4 -0
  26. package/lib/types/client/panel/LiveFeedLog.d.ts +5 -0
  27. package/lib/types/client/panel/MangaRoleLibrary.d.ts +20 -0
  28. package/lib/types/client/panel/MangaWorkspace.d.ts +12 -0
  29. package/lib/types/client/panel/MarketRadarView.d.ts +5 -0
  30. package/lib/types/client/panel/ModelManager.d.ts +14 -0
  31. package/lib/types/client/panel/ModelPicker.d.ts +11 -0
  32. package/lib/types/client/panel/NovelPanel.d.ts +1 -1
  33. package/lib/types/client/panel/ProgressConsole.d.ts +17 -0
  34. package/lib/types/client/panel/ProgressHomeView.d.ts +5 -0
  35. package/lib/types/client/panel/PropLibrary.d.ts +8 -0
  36. package/lib/types/client/panel/ReaderView.d.ts +8 -0
  37. package/lib/types/client/panel/ReasoningSection.d.ts +10 -0
  38. package/lib/types/client/panel/RunPanel.d.ts +5 -0
  39. package/lib/types/client/panel/SceneLibrary.d.ts +16 -0
  40. package/lib/types/client/panel/SettingsView.d.ts +16 -0
  41. package/lib/types/client/panel/ShelfView.d.ts +15 -0
  42. package/lib/types/client/panel/StoryboardTab.d.ts +19 -0
  43. package/lib/types/client/panel/StyleCard.d.ts +8 -0
  44. package/lib/types/client/panel/StyleGallery.d.ts +1 -0
  45. package/lib/types/client/panel/WorldTab.d.ts +10 -0
  46. package/lib/types/client/panel/helpers.d.ts +10 -0
  47. package/lib/types/client/panel/views.d.ts +77 -0
  48. package/lib/types/client/run-status.d.ts +19 -0
  49. package/lib/types/client/text.d.ts +9 -0
  50. package/lib/types/comic-presets.d.ts +12 -0
  51. package/lib/types/engine.d.ts +250 -8
  52. package/lib/types/global-assets.d.ts +6 -0
  53. package/lib/types/index.d.ts +24 -2
  54. package/lib/types/llm-live.d.ts +44 -0
  55. package/lib/types/manga-genre-rules.d.ts +22 -0
  56. package/lib/types/market-radar-scan.d.ts +19 -0
  57. package/lib/types/market-radar-sources.d.ts +31 -0
  58. package/lib/types/novel-context.d.ts +80 -0
  59. package/lib/types/prompt-utils.d.ts +35 -0
  60. package/lib/types/prompting.d.ts +35 -0
  61. package/lib/types/protocol.d.ts +1453 -5
  62. package/lib/types/review-policy.d.ts +97 -0
  63. package/lib/types/run.d.ts +32 -0
  64. package/lib/types/shot-language.d.ts +46 -0
  65. package/lib/types/src/ai-scan.d.ts +36 -0
  66. package/lib/types/src/assets.d.ts +37 -0
  67. package/lib/types/src/assistant.d.ts +45 -0
  68. package/lib/types/src/author-assets.d.ts +25 -0
  69. package/lib/types/src/bookshelf.d.ts +42 -0
  70. package/lib/types/src/client/api.d.ts +234 -0
  71. package/lib/types/src/client/docx.d.ts +15 -0
  72. package/lib/types/src/client/index.d.ts +14 -0
  73. package/lib/types/src/client/locales.d.ts +212 -0
  74. package/lib/types/src/client/mount.d.ts +9 -0
  75. package/lib/types/src/client/panel/AdaptModeView.d.ts +5 -0
  76. package/lib/types/src/client/panel/AssetsTab.d.ts +12 -0
  77. package/lib/types/src/client/panel/AssistantTab.d.ts +7 -0
  78. package/lib/types/src/client/panel/AuthorAssetsView.d.ts +4 -0
  79. package/lib/types/src/client/panel/AuthorHome.d.ts +32 -0
  80. package/lib/types/src/client/panel/BookshelfBar.d.ts +11 -0
  81. package/lib/types/src/client/panel/CreateBookView.d.ts +9 -0
  82. package/lib/types/src/client/panel/FlowGuide.d.ts +22 -0
  83. package/lib/types/src/client/panel/GlobalAssetLibraryView.d.ts +4 -0
  84. package/lib/types/src/client/panel/ImportModal.d.ts +7 -0
  85. package/lib/types/src/client/panel/MangaRoleLibrary.d.ts +20 -0
  86. package/lib/types/src/client/panel/MangaWorkspace.d.ts +12 -0
  87. package/lib/types/src/client/panel/ModelManager.d.ts +14 -0
  88. package/lib/types/src/client/panel/NovelPanel.d.ts +13 -0
  89. package/lib/types/src/client/panel/ProgressConsole.d.ts +17 -0
  90. package/lib/types/src/client/panel/ProgressHomeView.d.ts +5 -0
  91. package/lib/types/src/client/panel/PropLibrary.d.ts +8 -0
  92. package/lib/types/src/client/panel/ReaderView.d.ts +8 -0
  93. package/lib/types/src/client/panel/ReasoningSection.d.ts +10 -0
  94. package/lib/types/src/client/panel/RunPanel.d.ts +5 -0
  95. package/lib/types/src/client/panel/SceneLibrary.d.ts +16 -0
  96. package/lib/types/src/client/panel/SettingsView.d.ts +16 -0
  97. package/lib/types/src/client/panel/ShelfView.d.ts +15 -0
  98. package/lib/types/src/client/panel/StoryboardTab.d.ts +19 -0
  99. package/lib/types/src/client/panel/StyleCard.d.ts +8 -0
  100. package/lib/types/src/client/panel/StyleGallery.d.ts +1 -0
  101. package/lib/types/src/client/panel/WorldTab.d.ts +10 -0
  102. package/lib/types/src/client/panel/controller.d.ts +19 -0
  103. package/lib/types/src/client/panel/helpers.d.ts +18 -0
  104. package/lib/types/src/client/panel/views.d.ts +77 -0
  105. package/lib/types/src/client/sidebar-entry.d.ts +13 -0
  106. package/lib/types/src/client/text.d.ts +9 -0
  107. package/lib/types/src/comic-presets.d.ts +12 -0
  108. package/lib/types/src/docx.d.ts +19 -0
  109. package/lib/types/src/engine.d.ts +402 -0
  110. package/lib/types/src/index.d.ts +79 -0
  111. package/lib/types/src/manga-genre-rules.d.ts +22 -0
  112. package/lib/types/src/novel-context.d.ts +80 -0
  113. package/lib/types/src/prompt-utils.d.ts +35 -0
  114. package/lib/types/src/protocol.d.ts +2176 -0
  115. package/lib/types/src/review-policy.d.ts +97 -0
  116. package/lib/types/src/routes.d.ts +29 -0
  117. package/lib/types/src/run.d.ts +32 -0
  118. package/lib/types/src/shot-language.d.ts +46 -0
  119. package/lib/types/src/story-beat-language.d.ts +35 -0
  120. package/lib/types/src/style-library.d.ts +33 -0
  121. package/lib/types/story-beat-language.d.ts +35 -0
  122. package/lib/types/style-library.d.ts +33 -0
  123. package/package.json +57 -42
  124. package/scripts/patch-schemastery.mjs +47 -0
  125. package/src/ai-scan.ts +179 -0
  126. package/src/assets.ts +1774 -518
  127. package/src/assistant.ts +915 -547
  128. package/src/author-assets.ts +147 -0
  129. package/src/bookshelf.ts +32 -2
  130. package/src/client/api.ts +666 -254
  131. package/src/client/index.ts +3 -1
  132. package/src/client/llmLive.ts +101 -0
  133. package/src/client/locales.ts +178 -31
  134. package/src/client/mount.tsx +1 -1
  135. package/src/client/panel/AdaptModeView.tsx +535 -0
  136. package/src/client/panel/AssetsTab.tsx +168 -51
  137. package/src/client/panel/AssistantTab.tsx +339 -188
  138. package/src/client/panel/AuthorAssetsView.tsx +208 -0
  139. package/src/client/panel/AuthorHome.tsx +234 -0
  140. package/src/client/panel/BookAnalysisView.tsx +60 -0
  141. package/src/client/panel/BookshelfBar.tsx +63 -9
  142. package/src/client/panel/CreateBookView.tsx +371 -0
  143. package/src/client/panel/DirectorView.tsx +200 -0
  144. package/src/client/panel/GlobalAssetLibraryView.tsx +172 -0
  145. package/src/client/panel/IdeaInspirationView.tsx +71 -0
  146. package/src/client/panel/ImportModal.tsx +303 -0
  147. package/src/client/panel/KnowledgeBaseView.tsx +73 -0
  148. package/src/client/panel/LiveFeedLog.tsx +67 -0
  149. package/src/client/panel/MarketRadarView.tsx +374 -0
  150. package/src/client/panel/ModelManager.tsx +205 -0
  151. package/src/client/panel/NovelPanel.tsx +4713 -990
  152. package/src/client/panel/ProgressConsole.tsx +63 -0
  153. package/src/client/panel/ProgressHomeView.tsx +87 -0
  154. package/src/client/panel/ReaderView.tsx +306 -0
  155. package/src/client/panel/ReasoningSection.tsx +31 -0
  156. package/src/client/panel/RunPanel.tsx +204 -0
  157. package/src/client/panel/SettingsView.tsx +265 -0
  158. package/src/client/panel/ShelfView.tsx +242 -0
  159. package/src/client/panel/WorldTab.tsx +202 -0
  160. package/src/client/panel/helpers.ts +50 -0
  161. package/src/client/panel/panel.module.css +4325 -526
  162. package/src/client/panel/views.tsx +346 -0
  163. package/src/client/run-status.ts +100 -0
  164. package/src/client/sidebar-entry.ts +1 -1
  165. package/src/client/text.ts +28 -0
  166. package/src/engine.ts +4230 -1019
  167. package/src/global-assets.ts +59 -0
  168. package/src/index.ts +123 -9
  169. package/src/llm-live.ts +68 -0
  170. package/src/market-radar-scan.ts +41 -0
  171. package/src/market-radar-sources.ts +173 -0
  172. package/src/novel-context.ts +287 -0
  173. package/src/prompt-utils.ts +73 -0
  174. package/src/prompting.ts +159 -0
  175. package/src/protocol.ts +1998 -539
  176. package/src/review-policy.ts +161 -0
  177. package/src/routes.ts +3277 -955
  178. package/src/run.ts +338 -0
  179. package/lib/client.js.map +0 -1
  180. package/lib/index.js.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,26 @@
1
1
  # dsh-novel-forge — AI 编译小说工作台 / AI Novel Writing Workbench
2
2
 
3
- **中文** | [English](#english)
3
+ <p align="center">
4
+ <img alt="version" src="https://img.shields.io/badge/version-1.0.0--alpha-blue" />
5
+ <img alt="DSH" src="https://img.shields.io/badge/DSH-%E2%89%A50.1.3--alpha.1-blue" />
6
+ <img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue" />
7
+ <a href="https://github.com/watersxya/dsh-novel-forge/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/watersxya/dsh-novel-forge/actions/workflows/ci.yml/badge.svg?branch=main" /></a>
8
+ </p>
9
+
10
+ <p align="center">
11
+ <img alt="纯文本小说" src="https://img.shields.io/badge/%E5%88%9B%E4%BD%9C%E5%B7%A5%E4%BD%9C%E6%B5%81-%E2%9C%93-blue" />
12
+ <img alt="AI 编辑 Agent" src="https://img.shields.io/badge/AI%20%E7%BC%96%E8%BE%91%20Agent-%E2%9C%93-blue" />
13
+ <img alt="自动编辑" src="https://img.shields.io/badge/%E8%87%AA%E5%8A%A8%E7%BC%96%E8%BE%91-%E2%9C%93-blue" />
14
+ <img alt="知识库 RAG" src="https://img.shields.io/badge/%E7%9F%A5%E8%AF%86%E5%BA%93%20RAG-%E2%9C%93-blue" />
15
+ <img alt="题材雷达→灵感" src="https://img.shields.io/badge/%E9%A2%98%E6%9D%90%E9%9B%B7%E8%BE%BE%E2%86%92%E7%81%B5%E6%84%9F-%E2%9C%93-blue" />
16
+ <img alt="生产单" src="https://img.shields.io/badge/%E7%94%9F%E4%BA%A7%E5%8D%95-%E2%9C%93-blue" />
17
+ <img alt="三套主题" src="https://img.shields.io/badge/%E4%B8%89%E5%A5%97%E4%B8%BB%E9%A2%98-%E2%9C%93-blue" />
18
+ <img alt="全本导出" src="https://img.shields.io/badge/%E5%85%A8%E6%9C%AC%E5%AF%BC%E5%87%BA-%E2%9C%93-blue" />
19
+ </p>
4
20
 
5
21
  你的专属 AI 小说写作插件:把一份大纲"编译"成一本完整的小说。
6
- Your personal AI novel-writing plugin for DSH: turn an outline into a complete novel.
22
+
23
+ **版本:`1.0.0-alpha`** · 定位:**纯文本小说创作**。所有环节(写作、设定、规划、审校、质检、导出)均在侧边栏「小说工坊」面板内完成。
7
24
 
8
25
  ---
9
26
 
@@ -11,15 +28,88 @@ Your personal AI novel-writing plugin for DSH: turn an outline into a complete n
11
28
 
12
29
  | 中文 | English |
13
30
  |---|---|
14
- | **创作工作流**:大纲 设定圣经 卷计划 章节计划 → 逐章生成 + AI 审稿 → 润色/导出 | **Workflow**: outline story bible volumes chapter plan chapter-by-chapter writing with AI review → polish/export |
15
- | **书架**:同时管理多本书,点击切换进度继续编译,可新建书 | **Bookshelf**: manage multiple books at once click to switch and keep writing, or start a new one |
16
- | **写作资产**:题材基底库 / 推进模式库 / 8 套预置写法模板 / 12 条反 AI 规则 / 自定义写法引擎 | **Writing assets**: genre library / progression modes / 8 preset style templates / 12 anti-AI rules / custom style engine |
17
- | **AI 助手**:对话讨论剧情,助手可直接修改大纲、设定、章节(工具调用实时可见) | **AI assistant**: chat about the plot; the assistant edits outline, settings, and chapters live |
18
- | **docx 导入**:点击选择或拖拽本机大纲文件,浏览器本地解析 | **docx import**: pick or drag a local outline file parsed in the browser |
19
- | **逐章生成**:3000–4000 字/章,自动摘要(叙事记忆)+ AI 审稿 + 按意见修订 + AI | **Chapter generation**: 3000–4000 chars per chapter with summaries, AI review, revise-by-feedback, de-AI polish |
20
- | **伏笔管理 / 全本导出(TXT/MD)** | **Foreshadowing / full-book export (TXT/MD)** |
31
+ | **创作工作流仪表盘**:主行动卡(推荐下一步)+ 创作旅程进度条 + 状态条 + 待办队列 + 资产健康 | **Workflow dashboard**: next-action hero card, journey progress bar, status strip, todo queue, asset health |
32
+ | **书架首页 + 开书向导**:书卡网格(封面/简介/进度),新建书一步导入大纲(docx / 粘贴),书名自动识别;另支持「想法 → AI 大纲」多方案 | **Bookshelf home + book wizard**: book card grid, one-step outline import, auto book-name; idea AI outline suggestions |
33
+ | **开书即立项**:导入大纲自动建项目,书名以大纲首行为准;纳入书架并激活 | **Open-to-project**: outline import builds the project, registers on the shelf and activates it |
34
+ | **国风模块**:总纲 / 道藏 / 大世界 / 人物志 / 暗线 / 编年录 / 文戒 / 笔法帖 / 心法 | **Wuxia-flavored modules**: outline, story bible, world, characters, foreshadows, fact ledger, anti-AI rules, style templates, custom style |
35
+ | **道藏提炼**:从大纲与已写章节提炼人设 / 世界观 / 金手指规则 / 写作红线,注入生成与审稿 | **Story bible**: extract personas / world rules / golden-finger rules / red lines from the outline & chapters |
36
+ | **大世界**:境界体系 / 区域 / 势力结构化编辑 + AI 提炼,注入每章生成与审稿 | **World**: realms / regions / factions structured editing + AI extraction, injected per chapter |
37
+ | **卷计划 / 章节计划(结构化)**:每章含 本章目标 / 剧情要点 / 爽点·钩子 / 结尾钩子;**续写模式**自动读上一章结尾 + 编年录锚点 + 已发生情节禁令,不重头生成,重复标题自动去重 | **Volume / chapter planning (structured)**: goal / plot points / payoff-hook / ending hook per chapter; continuation mode reads the previous ending + fact anchors + banned-repeat list, never restarts |
38
+ | **逐章编译**:调用 LLM 生成 3000–4000 字正文并保存为 Markdown,流式输出实时进度 | **Chapter-by-chapter compile**: LLM writes 3000–4000-char bodies to Markdown with live stream |
39
+ | **摘要 + 编年录事实库**:每章自动抽取剧情摘要与已确立事实(人物状态/资源/关系/线索落地),注入后续章节,保证长期一致 | **Summary + fact ledger**: per-chapter auto-summary & extracted facts injected into later chapters for consistency |
40
+ | **相关事实全量检索**:生成时按本章剧情要点对全量编年录检索(角色名加权 + 近因加权 + 去重),旧设定不因窗口滑出而丢失 | **Full-ledger fact retrieval**: chapter-plot-based retrieval across the whole chronicle (character + recency weighting, dedup) |
41
+ | **自动 AI 审稿**:人设 / 设定 / 红线 / 文笔 / 节奏·爽点 / 逻辑 / 反 AI / 呈现 / 合规 九维打分,输出可勾选问题清单与建议 | **AI review**: 9-dimension scoring with a checkable issue list and suggestions |
42
+ | **修订循环**:审稿未过 → 按意见一键修订 / 选中局部改 / 去 AI 味润色 → 重审;「✔ 直接通过」行使作者终审权;未过章节自动按意见修订 + 验证模式 | **Revise loop**: revise by review / targeted local edits / de-AI polish → re-review; or approve directly |
43
+ | **审稿问题勾选修复**:每条问题可勾选(high 默认选),一键按所选问题修订 | **Selective review fixes**: check any issues (high pre-checked) and fix in one click |
44
+ | **作者复盘**:每章结构复盘(钩子兑现 / 结尾钩子 / 剧情线推进 / 连续性 / 节奏趋势),按卷分组,自动关联推进的剧情线 | **Author review**: per-chapter structural review (hook payoff / ending hook / arc progress / continuity / pacing), grouped by volume |
45
+ | **剧情线与神秘线管理**:主线 / 支线 / 人物线 / 悬念线,目标与进度追踪、章节关联;生成强制至少推进一条活跃线;健康检查 + AI 剧情方案 | **Plotlines**: main / branch / character / mystery arcs with goals, progress & linked chapters; generation must advance a line; health check + AI plan |
46
+ | **角色库(纯文本)**:AI 从全书提炼角色并自动分级(主角/女主/女配/配角/反派/路人),候选逐条采纳;定位 / 关系网 / 成长线 / 知情度编辑;**角色知情度**严格维护信息差 | **Role library (text)**: AI extraction with auto-tiering, adopt per candidate; edit identity / relations / arc / knowledge; strict information asymmetry |
47
+ | **人物志持久化**:角色当前状态(编年录聚合结果)落盘,打开即显示,可一键回填历史章节 | **Persistent character status**: aggregated status saved to disk, shown on open, backfill old chapters |
48
+ | **全书一致性质检**:LLM 扫描全本输出矛盾清单(定位到章),一键去修订 | **Book audit**: LLM scans all chapters for contradictions, locates them, one-click to revise |
49
+ | **敏感词检查**:内置违禁词库(政治/擦边/暴力/辱骂/广告/其他)全书一键扫描,命中定位到章并一键去修订 | **Sensitive-word check**: built-in banned-word library, scanned across the book, located per chapter with one-click fix |
50
+ | **知识库 / RAG**:书内自由参考文档,生成时按章节检索注入 | **Knowledge base / RAG**: in-book reference docs, retrieved & injected per chapter |
51
+ | **AI 编辑 Agent**:一句话代办——拆书、自动编辑、知识库(增/查/列)、剧情线、编辑待办、全书质检、简介、章节生成/审稿/修订、大纲/道藏/暗线/资产、导出;写操作有守卫 + 收敛规则 | **AI Editor Agent**: one line to delegate teardown / director / KB / plotlines / todos / audit / blurb / chapter ops / outline / bible / foreshadow / assets / export; write-guard + convergence |
52
+ | **题材雷达 → 灵感**:扫榜(番茄/起点/晋江)→ 题材信号 / 生产底座 / 开书简报 → 一键生成贴合市场的开书灵感 | **Market radar → inspiration**: scan public leaderboards → signals / production foundation / creative brief → generate market-fit book ideas |
53
+ | **自动编辑**:基于本书分卷/剧情线/伏笔/事实给出下一阶段节点、节奏板、风险与修复,可一键采纳为剧情线或待办 | **Auto-director**: next-arc nodes, pacing board, risks & fixes, adoptable into plotlines or todos |
54
+ | **书分析 / 拆书**:输入任意文本 → 卖点 / 结构 / 可借鉴 / 风险 | **Book analysis / teardown**: paste text → selling points / structure / lessons / risks |
55
+ | **创意灵感**:一句话/题材 → 多个差异化开书灵感,可「以此方向开书」 | **Creative inspiration**: one idea/genre → several differentiated book ideas, "start a book this way" |
56
+ | **生产单(批量连写)**:区间/新增 N 章一键下单,计划补足 + 逐章生成 + 被拒分级处理(豁免/修订+验证/待人工),支持暂停/继续/停止与断点续跑 | **Production run (batch)**: line up a range, auto-plan, generate chapter-by-chapter, tiered declined handling, pause/resume/stop & resume |
57
+ | **改编模式**:上传全文 → 设定卡片/可改范围 → 确认改编维度 → 生成映射表/规则/影响清单 → 替换/重写 → 保存为新书(原书保留) | **Adaptation mode**: upload full text → setting cards / mutability → confirm dimensions → mappings / rules / impacts → replace or rewrite → save as a new book |
58
+ | **全本导出**:TXT / MD(含卷首语与封面) | **Full-book export**: TXT / MD (with blurb & cover) |
59
+ | **并发安全保存**:计划/生成/审稿落盘前自动合并磁盘最新设定(道藏/角色库/剧情线/知情度) | **Concurrency-safe saves**: merge latest on-disk settings before save |
60
+ | **三套主题 + 玻璃 UI**:iOS 液态玻璃(绿)/ 经典毛玻璃(蓝)/ 新拟物双阴影,即时切换;分组导航 + 实时状态角标 | **Themes + frosted UI**: iOS liquid glass / classic frosted / neumorphism, grouped nav with live badges |
61
+ | **活动输出控制台**:实时记录生成/审稿/润色/质检等全部活动,自动滚动 + 一键清空 | **Activity console**: records every action, auto-scrolls, one-click clear |
62
+
63
+ ---
21
64
 
22
- ## 快速开始 / Quick Start
65
+ ## 工作流程 / Workflow
66
+
67
+ 一条主线:**开书 → 立设定 → 排章节 → 逐章编译 → 质检定稿 → 导出**。所有步骤都在侧边栏「小说工坊」面板内完成。
68
+
69
+ ```mermaid
70
+ flowchart TD
71
+ A[① 开书<br/>粘贴大纲 / 导入 docx] --> B[② 立设定<br/>道藏 · 大世界 · 写作资产]
72
+ B --> C[③ 排章节<br/>卷计划 · 章节计划 / 续写模式]
73
+ C --> D[④ 逐章编译<br/>生成正文 → 摘要·事实 → 审稿]
74
+ D --> E{审稿通过?}
75
+ E -->|否| F[⑤ 修订循环<br/>按意见修订 / 局部改 / 润色]
76
+ F --> D
77
+ E -->|是| G[⑥ 全书定稿<br/>全书质检 · 敏感词 · 维护]
78
+ G --> H[⑦ 导出<br/>全本 TXT / MD]
79
+
80
+ R1[💬 AI 编辑 Agent<br/>拆书 / 自动编辑 / 知识库 / 质检 / 简介 / 待办] -.-> B
81
+ R1 -.-> C
82
+ R1 -.-> D
83
+ R1 -.-> G
84
+ R2[🧵 剧情线 · 👥 角色库 · 📊 进度] -.-> D
85
+ R2 -.-> G
86
+ ```
87
+
88
+ ```
89
+ ① 开书(书架 → 开书向导:粘贴大纲文本 / 导入 docx,书名自动识别)
90
+
91
+ ② 立设定(总纲只读 → ✨ 提炼道藏【人设/世界观/金手指规则/写作红线】→ 大世界【境界/区域/势力】→ 写作资产【题材/推进/笔法帖/文戒/心法】)
92
+
93
+ ③ 排章节(卷计划 → 章节计划:AI 按大纲生成每章 目标/剧情要点/爽点钩子/结尾钩子;
94
+ 已有章节时自动进入「续写模式」——读取上一章结尾原文 + 编年录锚点,不会重头生成)
95
+
96
+ ④ 逐章编译(生成正文 3000-4000 字 → 自动抽取摘要 + 编年录事实 → 自动 AI 审稿打分 → 作者复盘)
97
+
98
+ ⑤ 修订循环(审稿未过 → 按意见一键修订 / 工作区选中局部修改 / 润色去 AI 味 → 重审;
99
+ 不满意可「✔ 直接通过」行使作者终审权)
100
+
101
+ ⑥ 全书定稿(全书质检【矛盾清单】→ 敏感词扫描 → 编年录/剧情线/角色库/复盘定期维护)
102
+
103
+ ⑦ 导出(全本 TXT / MD,含卷首语与封面)
104
+ ```
105
+
106
+ **辅助旁路(任意阶段可用)**:💬 AI 编辑 Agent(拆书/自动编辑/知识库/质检/简介/待办)、🧵 剧情线管理(健康检查/设计剧情方案)、👥 角色库(AI 提炼/知情度维护)、📊 工作进度悬浮窗(任务实时进度与活动记录)、书架多书切换。
107
+
108
+ **推荐节奏**:先让 ②③ 完整落地(设定越全,章节质量越高);④ 建议逐章或小批生成,便于在 ⑤ 及时修正;长篇小说每写 20-30 章跑一次 ⑥ 全书质检,防止设定漂移。
109
+
110
+ ---
111
+
112
+ ## 安装 / Installation
23
113
 
24
114
  ```sh
25
115
  pnpm install # 安装依赖 / install dependencies
@@ -41,140 +131,101 @@ dsh plugin --profile web add link:"<此目录绝对路径>"
41
131
  ```
42
132
 
43
133
  重启 dsh web 后,侧边栏出现「小说工坊」。
44
- Restart dsh web and the "Novel Forge" entry appears in the sidebar.
45
-
46
- ## 安装方式 / Installation
47
134
 
48
- ### 从 GitHub 安装 / Install from GitHub
49
-
50
- ```sh
51
- dsh plugin --profile web add github:watersxya/dsh-novel-forge
52
- ```
53
-
54
- > 注意:pnpm ≥10 默认拒绝运行 git 依赖的 `prepare` 构建脚本。首次安装失败时,把 pnpm 提示的包键加入该 profile 的 `pnpm-workspace.yaml`:
55
- > Note: pnpm ≥10 refuses to run `prepare` build scripts of git dependencies by default. On first failure, add the package key pnpm prints to the profile's `pnpm-workspace.yaml`:
56
- >
57
- > ```yaml
58
- > allowBuilds:
59
- > '@waterwx/dsh-novel-forge': true
60
- > ```
61
- >
62
- > 然后重新执行 `add`。只对源码可信的包授权。
63
- > Then re-run `add`. Only allow packages whose source you trust.
64
-
65
- ### 从 npm 安装 / Install from npm(推荐 / recommended)
135
+ ### 从 npm 安装(推荐)
66
136
 
67
137
  ```sh
68
138
  dsh plugin --profile web add @waterwx/dsh-novel-forge
69
139
  ```
70
140
 
71
141
  npm 分发的是预构建产物,无需任何构建授权。
72
- npm distribution ships prebuilt artifacts no build authorization needed.
73
-
74
- ### 本地开发 / Local development
142
+ GitHub 安装需为 git 依赖的 `prepare` 构建授权(`pnpm-workspace.yaml` `allowBuilds`)。
75
143
 
76
- ```sh
77
- pnpm install && pnpm build
78
- dsh plugin --profile web add link:"<本目录绝对路径>"
79
- ```
80
-
81
- ## 目录结构 / Directory Layout
82
-
83
- ```
84
- src/ 插件源码(宿主半 + 浏览器半)/ plugin source (host + browser)
85
- lib/ 构建产物(lib/index.js 宿主 / lib/client.js 浏览器)/ build output
86
- scripts/ 工具脚本 / utility scripts
87
- package.json 包定义(dsh.bundle.patch + dsh.client 声明)/ package definition
88
- cordis.patch.yml profile 挂载补丁 / profile mount patch
89
- tsdown.config.ts 双面打包配置 / dual-face bundling config
90
- ```
144
+ ---
91
145
 
92
146
  ## 数据位置 / Data Locations
93
147
 
94
148
  - 书架 / Bookshelf:`~/.dsh/dsh-novel-forge-bookshelf.json`
95
- - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown)/ each book owns an output directory
96
- - AI 助手对话记录 / assistant log:`<输出目录>/novel-assistant.jsonl`
97
-
98
- ## 限制 / Limitations
99
-
100
- - 生成消耗 LLM API 额度(默认 deepseek-official / deepseek-v4-flash)/ generation consumes LLM API quota
101
- - 章节质量取决于大纲完整度 / chapter quality depends on outline completeness
102
- - 设置写入 `~/.dsh/settings.yaml` 的 `dsh-novel-forge` 段 / settings persist in `~/.dsh/settings.yaml`
149
+ - 作者资产库 / Author assets:`~/.dsh/dsh-novel-forge-author-assets.json`
150
+ - 全局写作资产 / Global assets:`~/.dsh/novel-forge-global-assets.json`
151
+ - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown + 润色备份 `.bak.md`)
152
+ - AI 编辑 Agent 对话记录:`<输出目录>/novel-assistant.jsonl`
153
+ - 生产单状态:`<输出目录>/run-state.json`
154
+ - 设置:`~/.dsh/settings.yaml` `dsh-novel-forge` 段;界面偏好(主题/字号/面板宽度)在浏览器 localStorage
103
155
 
104
156
  ---
105
157
 
106
- <a id="english"></a>
158
+ ## 影响与限制 / Impact & Limitations
107
159
 
108
- ## English
160
+ - **LLM 额度消耗**:生成/审稿/润色/质检/提炼/复盘等所有 AI 操作都调用 LLM(默认 `deepseek-official / deepseek-v4-flash`)。参考:一章 3000-4000 字正文 ≈ 1-2 万 token(含推理);审稿约 2000-3000 token;全书质检与角色提炼更贵(数万 token)。建议分小批执行。
161
+ - **写操作守卫**:AI 编辑 Agent 只在作者**明确要求**时执行写操作(生成/修订/删除章节、改设定等);只提问不会误触发。
162
+ - **并发安全**:计划/生成/审稿落盘前会自动合并磁盘上的最新设定(道藏/角色库/剧情线/知情度),多窗口同时操作互不覆盖。
163
+ - **纯文本定位**:本插件不负责图片/视频生成;设定均为文字数据(角色卡仅含定位/性格/目标/关系/成长线/知情度等字段)。
164
+ - **章节质量**取决于大纲完整度;批量生成串行执行。
165
+ - **数据落盘**:每本书一个输出目录(默认 `~/.dsh/novels/<书名>`,可在设置页修改);正文为 Markdown、项目状态为 `novel-project.json`。
109
166
 
110
- # My Personal AI Novel Forge (Standalone Copy)
167
+ ---
111
168
 
112
- This is a **complete, standalone copy** of the `dsh-novel-forge` plugin. All
113
- source code, build artifacts, and configuration are included — install, build,
114
- and mount it any time.
169
+ ## 目录结构 / Directory Layout
115
170
 
116
- ## Feature Overview
171
+ ```
172
+ src/ 插件源码(宿主半 + 浏览器半)
173
+ lib/ 构建产物(lib/index.js 宿主 / lib/client.js 浏览器)
174
+ scripts/ 工具脚本
175
+ package.json 包定义(dsh.bundle.patch + dsh.client 声明)
176
+ cordis.patch.yml profile 挂载补丁
177
+ tsdown.config.ts 双面打包配置
178
+ ```
117
179
 
118
- - **Workflow**: Outline → Story Bible → Volume Plan → Chapter Plan → chapter-by-chapter
119
- writing with AI review → polish / export
120
- - **Bookshelf**: manage multiple books at once — click to switch progress and keep
121
- writing, or start a new book
122
- - **Writing assets**: genre base library / progression mode library / 8 preset style
123
- templates / 12 anti-AI rules / custom style engine
124
- - **AI Assistant**: discuss plot in chat; the assistant can directly edit the outline,
125
- settings, and chapters (tool calls are visible live)
126
- - **docx import**: pick a local outline file or drag & drop it — parsed in the browser,
127
- no server upload
128
- - **Chapter generation**: 3000–4000 characters per chapter, with automatic summary
129
- (narrative memory), AI review, revise-by-feedback, and de-AI polish
130
- - **Foreshadowing management / full-book export (TXT/MD)**
180
+ ---
131
181
 
132
- ## Getting Started
182
+ ## English
133
183
 
134
- ```sh
135
- pnpm install # install dependencies
136
- pnpm build # rebuild lib/
137
- ```
184
+ # AI Novel Forge
138
185
 
139
- Mount into the dsh web profile:
186
+ An AI novel-writing plugin for DeepSeek Harness (DSH). Feed it an outline (docx or pasted text) and it compiles it into a complete novel: open a book → build the setting plan chapters → compile chapter by chapter → audit & finalize → export.
140
187
 
141
- ```sh
142
- dsh plugin --profile web add link:"<absolute path to this directory>"
143
- ```
188
+ **Version `1.0.0-alpha` · Scope: pure-text novel writing.** Everything (writing, setting, planning, review, audit, export) happens inside the "Novel Forge" sidebar panel; no comic/storyboard/video or image generation.
144
189
 
145
- Or insert into `~/.dsh/profiles/web/cordis.patch.yml`:
190
+ ## Main pipeline
146
191
 
147
- ```yaml
148
- - insert:
149
- - id: novel-forge
150
- name: '@waterwx/dsh-novel-forge'
151
- ```
192
+ 1. **Open a book** (bookshelf → wizard): paste an outline or import docx; book name auto-detected; idea → AI outline supported.
193
+ 2. **Build the setting** (read-only outline → extract story bible [personas / world rules / golden-finger rules / red lines] → world [realms / regions / factions] → writing assets [genre / progression / style templates / anti-AI rules / custom style]).
194
+ 3. **Plan chapters** (volume plan → structured chapter plan with goal / plot points / payoff-hook / ending hook; continuation mode with existing chapters never restarts).
195
+ 4. **Compile chapter by chapter** (generate 3000–4000 chars → auto summary + fact ledger → AI review → author review).
196
+ 5. **Revise loop** (revise by review / targeted edits / de-AI polish → re-review; or approve directly).
197
+ 6. **Finalize** (book audit for contradictions → sensitive-word scan → maintain chronicle / plotlines / roles / reviews).
198
+ 7. **Export** (full book TXT / MD, with blurb & cover).
152
199
 
153
- Restart dsh web, and the "Novel Forge" entry appears in the sidebar.
200
+ ## Highlights
154
201
 
155
- ## Directory Layout
202
+ - **Story bible & world**: personas / world rules / golden-finger rules / red lines; realms / regions / factions.
203
+ - **Fact ledger (chronicle)**: per-chapter extracted facts injected into later chapters; full-ledger retrieval relevance for long serials.
204
+ - **Structured chapter plans + continuation planning**.
205
+ - **AI review** (9 dimensions) + one-click revise / local edits / de-AI polish; selective issue fixes.
206
+ - **Plotlines** (main / branch / character / mystery) with health check & AI plan; **role library** (text) with knowledge asymmetry; **persistent character status**.
207
+ - **Book audit** (contradiction list), **sensitive-word check**, **knowledge base / RAG**.
208
+ - **AI Editor Agent** with write-guard + convergence.
209
+ - **Market radar → inspiration**, **auto-director**, **book analysis / teardown**, **creative inspiration**.
210
+ - **Production run** (batch, resume).
211
+ - **Adaptation mode** (upload a full text, remap/rewrite, save as a new book).
212
+ - **Full-book export** TXT / MD.
156
213
 
214
+ ## Install
215
+
216
+ ```sh
217
+ dsh plugin --profile web add @waterwx/dsh-novel-forge
157
218
  ```
158
- src/ Plugin source (host half + browser half)
159
- lib/ Build output (lib/index.js host / lib/client.js browser)
160
- scripts/ Utility scripts
161
- package.json Package definition (dsh.bundle.patch + dsh.client declaration)
162
- cordis.patch.yml Profile mount patch
163
- tsdown.config.ts Dual-face bundling config
164
- ```
219
+ or link a local checkout and restart dsh web; the "Novel Forge" entry appears in the sidebar.
165
220
 
166
- ## Data Locations
221
+ ## Data
167
222
 
168
223
  - Bookshelf: `~/.dsh/dsh-novel-forge-bookshelf.json`
169
- - Each book owns an output directory (containing `novel-project.json` project state
170
- plus per-chapter Markdown files)
171
- - AI assistant conversation log: `<output-dir>/novel-assistant.jsonl`
224
+ - Per book: an output directory with `novel-project.json`, chapter Markdown, `.bak.md` backups, `novel-assistant.jsonl`
225
+ - Settings: `dsh-novel-forge` section of `~/.dsh/settings.yaml`
172
226
 
173
227
  ## Limitations
174
228
 
175
- - Generation consumes LLM API quota (provider/model default: `deepseek-official` /
176
- `deepseek-v4-flash`)
177
- - Chapter quality depends on outline completeness; batch generation is serial
178
- - Settings (output directory, model, review threshold, etc.) are edited in the
179
- panel's "Settings" tab and written to the `dsh-novel-forge` section of
180
- `~/.dsh/settings.yaml`
229
+ - All AI operations consume LLM quota (default `deepseek-official / deepseek-v4-flash`).
230
+ - Chapter quality depends on outline completeness; batch generation is serial.
231
+ - The plugin writes text only no image/video generation.
package/cordis.patch.yml CHANGED
@@ -10,4 +10,4 @@
10
10
  # served at /plugins/<id>/client.js) load in the web GUI.
11
11
  - insert:
12
12
  - id: novel-forge
13
- name: '@ryan/dsh-novel-forge'
13
+ name: '@waterwx/dsh-novel-forge'