@waterwx/dsh-novel-forge 2.0.1-alpha → 2.1.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 (135) hide show
  1. package/README.md +97 -2
  2. package/lib/client.js +3291 -752
  3. package/lib/index.js +3557 -237
  4. package/lib/types/assets.d.ts +16 -3
  5. package/lib/types/assistant.d.ts +4 -0
  6. package/lib/types/client/api.d.ts +89 -0
  7. package/lib/types/client/llmLive.d.ts +33 -0
  8. package/lib/types/client/locales.d.ts +3 -3
  9. package/lib/types/client/panel/AdaptModeView.d.ts +1 -1
  10. package/lib/types/client/panel/AssetsTab.d.ts +1 -1
  11. package/lib/types/client/panel/AssistantTab.d.ts +1 -1
  12. package/lib/types/client/panel/AuthorAssetsView.d.ts +1 -1
  13. package/lib/types/client/panel/AuthorHome.d.ts +4 -2
  14. package/lib/types/client/panel/BookAnalysisView.d.ts +4 -0
  15. package/lib/types/client/panel/BookshelfBar.d.ts +1 -1
  16. package/lib/types/client/panel/CreateBookView.d.ts +6 -2
  17. package/lib/types/client/panel/DirectorView.d.ts +7 -0
  18. package/lib/types/client/panel/FlowGuide.d.ts +1 -1
  19. package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +1 -1
  20. package/lib/types/client/panel/IdeaInspirationView.d.ts +6 -0
  21. package/lib/types/client/panel/ImportModal.d.ts +1 -1
  22. package/lib/types/client/panel/KnowledgeBaseView.d.ts +4 -0
  23. package/lib/types/client/panel/LiveFeedLog.d.ts +5 -0
  24. package/lib/types/client/panel/MangaRoleLibrary.d.ts +1 -1
  25. package/lib/types/client/panel/MangaWorkspace.d.ts +1 -1
  26. package/lib/types/client/panel/MarketRadarView.d.ts +5 -0
  27. package/lib/types/client/panel/NovelPanel.d.ts +2 -2
  28. package/lib/types/client/panel/ProgressConsole.d.ts +1 -1
  29. package/lib/types/client/panel/ProgressHomeView.d.ts +1 -1
  30. package/lib/types/client/panel/PropLibrary.d.ts +1 -1
  31. package/lib/types/client/panel/ReaderView.d.ts +1 -1
  32. package/lib/types/client/panel/RunPanel.d.ts +1 -1
  33. package/lib/types/client/panel/SceneLibrary.d.ts +1 -1
  34. package/lib/types/client/panel/SettingsView.d.ts +1 -1
  35. package/lib/types/client/panel/ShelfView.d.ts +1 -1
  36. package/lib/types/client/panel/StoryboardTab.d.ts +1 -1
  37. package/lib/types/client/panel/StyleCard.d.ts +1 -1
  38. package/lib/types/client/panel/StyleGallery.d.ts +1 -1
  39. package/lib/types/client/panel/WorldTab.d.ts +1 -1
  40. package/lib/types/engine.d.ts +29 -1
  41. package/lib/types/global-assets.d.ts +6 -0
  42. package/lib/types/index.d.ts +6 -0
  43. package/lib/types/llm-live.d.ts +44 -0
  44. package/lib/types/market-radar-scan.d.ts +19 -0
  45. package/lib/types/market-radar-sources.d.ts +31 -0
  46. package/lib/types/prompting.d.ts +35 -0
  47. package/lib/types/protocol.d.ts +364 -8
  48. package/lib/types/run.d.ts +1 -1
  49. package/lib/types/src/ai-scan.d.ts +36 -0
  50. package/lib/types/src/assets.d.ts +37 -0
  51. package/lib/types/src/assistant.d.ts +45 -0
  52. package/lib/types/src/author-assets.d.ts +25 -0
  53. package/lib/types/src/bookshelf.d.ts +42 -0
  54. package/lib/types/src/client/api.d.ts +234 -0
  55. package/lib/types/src/client/docx.d.ts +15 -0
  56. package/lib/types/src/client/index.d.ts +14 -0
  57. package/lib/types/src/client/locales.d.ts +212 -0
  58. package/lib/types/src/client/mount.d.ts +9 -0
  59. package/lib/types/src/client/panel/AdaptModeView.d.ts +5 -0
  60. package/lib/types/src/client/panel/AssetsTab.d.ts +12 -0
  61. package/lib/types/src/client/panel/AssistantTab.d.ts +7 -0
  62. package/lib/types/src/client/panel/AuthorAssetsView.d.ts +4 -0
  63. package/lib/types/src/client/panel/AuthorHome.d.ts +32 -0
  64. package/lib/types/src/client/panel/BookshelfBar.d.ts +11 -0
  65. package/lib/types/src/client/panel/CreateBookView.d.ts +9 -0
  66. package/lib/types/src/client/panel/FlowGuide.d.ts +22 -0
  67. package/lib/types/src/client/panel/GlobalAssetLibraryView.d.ts +4 -0
  68. package/lib/types/src/client/panel/ImportModal.d.ts +7 -0
  69. package/lib/types/src/client/panel/MangaRoleLibrary.d.ts +20 -0
  70. package/lib/types/src/client/panel/MangaWorkspace.d.ts +12 -0
  71. package/lib/types/src/client/panel/ModelManager.d.ts +14 -0
  72. package/lib/types/src/client/panel/NovelPanel.d.ts +13 -0
  73. package/lib/types/src/client/panel/ProgressConsole.d.ts +17 -0
  74. package/lib/types/src/client/panel/ProgressHomeView.d.ts +5 -0
  75. package/lib/types/src/client/panel/PropLibrary.d.ts +8 -0
  76. package/lib/types/src/client/panel/ReaderView.d.ts +8 -0
  77. package/lib/types/src/client/panel/ReasoningSection.d.ts +10 -0
  78. package/lib/types/src/client/panel/RunPanel.d.ts +5 -0
  79. package/lib/types/src/client/panel/SceneLibrary.d.ts +16 -0
  80. package/lib/types/src/client/panel/SettingsView.d.ts +16 -0
  81. package/lib/types/src/client/panel/ShelfView.d.ts +15 -0
  82. package/lib/types/src/client/panel/StoryboardTab.d.ts +19 -0
  83. package/lib/types/src/client/panel/StyleCard.d.ts +8 -0
  84. package/lib/types/src/client/panel/StyleGallery.d.ts +1 -0
  85. package/lib/types/src/client/panel/WorldTab.d.ts +10 -0
  86. package/lib/types/src/client/panel/controller.d.ts +19 -0
  87. package/lib/types/src/client/panel/helpers.d.ts +18 -0
  88. package/lib/types/src/client/panel/views.d.ts +77 -0
  89. package/lib/types/src/client/sidebar-entry.d.ts +13 -0
  90. package/lib/types/src/client/text.d.ts +9 -0
  91. package/lib/types/src/comic-presets.d.ts +12 -0
  92. package/lib/types/src/docx.d.ts +19 -0
  93. package/lib/types/src/engine.d.ts +402 -0
  94. package/lib/types/src/index.d.ts +79 -0
  95. package/lib/types/src/manga-genre-rules.d.ts +22 -0
  96. package/lib/types/src/novel-context.d.ts +80 -0
  97. package/lib/types/src/prompt-utils.d.ts +35 -0
  98. package/lib/types/src/protocol.d.ts +2176 -0
  99. package/lib/types/src/review-policy.d.ts +97 -0
  100. package/lib/types/src/routes.d.ts +29 -0
  101. package/lib/types/src/run.d.ts +32 -0
  102. package/lib/types/src/shot-language.d.ts +46 -0
  103. package/lib/types/src/story-beat-language.d.ts +35 -0
  104. package/lib/types/src/style-library.d.ts +33 -0
  105. package/package.json +1 -1
  106. package/src/assets.ts +1774 -879
  107. package/src/assistant.ts +154 -9
  108. package/src/client/api.ts +105 -6
  109. package/src/client/llmLive.ts +101 -0
  110. package/src/client/locales.ts +4 -4
  111. package/src/client/panel/AdaptModeView.tsx +18 -3
  112. package/src/client/panel/AssistantTab.tsx +41 -3
  113. package/src/client/panel/AuthorHome.tsx +51 -20
  114. package/src/client/panel/BookAnalysisView.tsx +60 -0
  115. package/src/client/panel/CreateBookView.tsx +22 -3
  116. package/src/client/panel/DirectorView.tsx +200 -0
  117. package/src/client/panel/IdeaInspirationView.tsx +71 -0
  118. package/src/client/panel/KnowledgeBaseView.tsx +73 -0
  119. package/src/client/panel/LiveFeedLog.tsx +76 -0
  120. package/src/client/panel/MarketRadarView.tsx +374 -0
  121. package/src/client/panel/NovelPanel.tsx +117 -16
  122. package/src/client/panel/ProgressConsole.tsx +5 -6
  123. package/src/client/panel/SettingsView.tsx +3 -0
  124. package/src/client/panel/panel.module.css +2 -3
  125. package/src/engine.ts +459 -23
  126. package/src/global-assets.ts +59 -0
  127. package/src/index.ts +17 -1
  128. package/src/llm-live.ts +68 -0
  129. package/src/market-radar-scan.ts +41 -0
  130. package/src/market-radar-sources.ts +173 -0
  131. package/src/prompting.ts +159 -0
  132. package/src/protocol.ts +340 -8
  133. package/src/routes.ts +579 -59
  134. package/src/run.ts +15 -8
  135. package/skills/chapter-batch/SKILL.md +0 -81
package/README.md CHANGED
@@ -7,11 +7,27 @@ Your personal AI novel-writing plugin for DSH: turn an outline into a complete n
7
7
 
8
8
  > **⚠️ 版本状态 / Version status(read this first)**
9
9
  >
10
- > - 本插件当前**唯一发布 / 更新线为 V2.0 ALPHA(`2.0.0-alpha.1`)**,适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 提供的 `cosmokit`,不能在纯 Node 环境单独运行)。
10
+ > - 本插件当前**唯一发布 / 更新线为 V2.0 ALPHA(`2.1.0-alpha`)**,适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 提供的 `cosmokit`,不能在纯 Node 环境单独运行)。
11
11
  > - **V1.0 RC(`1.10.1`)为最终稳定版,已停止更新**;需要稳定版请显式安装 `@waterwx/dsh-novel-forge@1.10.1`。
12
12
  > - **安装前请确认你的 DSH 版本**:在 `0.1.3-alpha.1` 以前的 DSH 上安装 V2.0 ALPHA 会加载失败。
13
13
  > - npm `latest` 现指向 V2.0 ALPHA:`npm i @waterwx/dsh-novel-forge` 会安装预发布版;想要最终稳定 RC 请用 `@1.10.1`。
14
14
 
15
+ <p align="center">
16
+ <img src="https://img.shields.io/badge/DSH-0.1.3--alpha.1%2B-blue" alt="DSH ≥ 0.1.3-alpha.1" />
17
+ <img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License" />
18
+ </p>
19
+
20
+ <p align="center">
21
+ <img 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" alt="创作工作流" />
22
+ <img src="https://img.shields.io/badge/AI%20%E7%BC%96%E8%BE%91%20Agent-%E2%9C%93-blue" alt="AI 编辑 Agent" />
23
+ <img src="https://img.shields.io/badge/%E8%87%AA%E5%8A%A8%E5%AF%BC%E6%BC%94-%E2%9C%93-blue" alt="自动导演" />
24
+ <img src="https://img.shields.io/badge/%E7%9F%A5%E8%AF%86%E5%BA%93%20RAG-%E2%9C%93-blue" alt="知识库 RAG" />
25
+ <img 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" alt="题材雷达→灵感" />
26
+ <img src="https://img.shields.io/badge/%E6%BC%AB%E5%89%A7%E5%B7%A5%E4%BD%9C%E5%8F%B0-%E2%9C%93-blue" alt="漫剧工作台" />
27
+ <img src="https://img.shields.io/badge/%E5%A4%9A%E4%B8%BB%E9%A2%98-%E2%9C%93-blue" alt="多主题" />
28
+ <img src="https://img.shields.io/badge/%E5%85%A8%E6%9C%AC%E5%AF%BC%E5%87%BA-%E2%9C%93-blue" alt="全本导出" />
29
+ </p>
30
+
15
31
  ---
16
32
 
17
33
  ## 功能一览 / Features
@@ -59,7 +75,20 @@ Your personal AI novel-writing plugin for DSH: turn an outline into a complete n
59
75
  | **视觉世界观规则(⚠️)**:从道藏提炼生图纠偏规则(如"货架商品=活人,禁止画成常规超市商品"),自动注入所有角色/场景提示词——反常识设定的书不再被生图模型画跑偏 | **Visual world rules**: extraction-time guardrails from the story bible (e.g. "shelf items are living people, no cans/bottles"), auto-injected into every prompt — counter-intuitive settings render correctly |
60
76
  | **漫剧工作台(V2.0 新增)**:创建方案(风格/滤镜/题材)→ 一键生成(拆剧情→分镜→提名角色→视频提示词)→ 分镜工作台(骨架/分镜表/提示词)→ 角色定妆 → 场景底图 → 导出即梦脚本 | **Manga Workbench (V2.0, new)**: create a plan (style/filter/genre) → one-click generate (skeleton→storyboard→role nominations→video prompts) → storyboard studio (skeleton/table/prompts) → character styling → scene base → export Jimeng scripts |
61
77
 
62
- ## 快速开始 / Quick Start
78
+ ## 最近更新 / What's New(本次迭代)
79
+
80
+ 本次迭代把「专业工作流」交给 **AI 编辑 Agent** 代办,并新增一批策划/灵感/编排能力:
81
+
82
+ - 💬 **AI 编辑 Agent**:书内助手改名并升级,一句话即可代办——拆书、自动导演、知识库(增/查/列)、剧情线、导演待办、全书质检、简介、章节生成/审稿/修订、大纲/道藏/暗线/资产、导出;写操作有安全放行 + 收敛规则,不会循环或乱改。
83
+ - 📡 **题材雷达 → 灵感**:扫榜(番茄/起点/晋江)→ 题材信号 / 生产底座 / 开书简报 → 一键「用这些信号生成灵感」,得到贴合市场的多个开书方向。
84
+ - 🎬 **自动导演**:基于本书分卷/剧情线/伏笔/事实,给出下一阶段节点、节奏板、风险与修复;可一键采纳为剧情线或待办。
85
+ - 📚 **知识库 / RAG**:书内自由参考文档,生成时按章节检索注入,提升一致性。
86
+ - 📊 **书分析 / 拆书**:输入任意文本 → 卖点 / 结构 / 可借鉴 / 风险。
87
+ - 💡 **创意灵感**:一句话/题材 → 多个差异化开书灵感,可「以此方向开书」。
88
+ - 🧭 **进阶工具折叠**:默认只露创作流水线 + 核心(助手 / AI 进度)+ 资产,进阶工具收进折叠组;创作页新增「问 AI 编辑 Agent」入口。
89
+ - 🃏 **结构化结果卡片**:拆书 / 导演 / 质检 / 知识库列表等工具结果,在对话里直接渲染成卡片。
90
+
91
+
63
92
 
64
93
  ```sh
65
94
  pnpm install # 安装依赖 / install dependencies
@@ -122,6 +151,25 @@ dsh plugin --profile web add link:"<本目录绝对路径>"
122
151
 
123
152
  一条主线:**开书 → 立设定 → 排章节 → 逐章编译 → 质检定稿 → 导出**。所有步骤都在侧边栏「小说工坊」面板内完成。
124
153
 
154
+ ```mermaid
155
+ flowchart TD
156
+ A[① 开书<br/>粘贴大纲 / 导入 docx] --> B[② 立设定<br/>道藏 · 大世界 · 写作资产]
157
+ B --> C[③ 排章节<br/>卷计划 · 章节计划 / 续写模式]
158
+ C --> D[④ 逐章编译<br/>生成正文 → 摘要·事实 → 审稿]
159
+ D --> E{审稿通过?}
160
+ E -->|否| F[⑤ 修订循环<br/>按意见修订 / 局部改 / 润色]
161
+ F --> D
162
+ E -->|是| G[⑥ 全书定稿<br/>全书质检 · 敏感词 · 维护]
163
+ G --> H[⑦ 导出<br/>全本 TXT / MD]
164
+
165
+ R1[💬 AI 编辑 Agent<br/>拆书 / 导演 / 知识库 / 质检 / 简介 / 待办] -.-> B
166
+ R1 -.-> C
167
+ R1 -.-> D
168
+ R1 -.-> G
169
+ R2[🧵 剧情线 · 👥 角色库 · 📊 进度] -.-> D
170
+ R2 -.-> G
171
+ ```
172
+
125
173
  ```
126
174
  ① 开书(书架 → 开书向导:粘贴大纲文本 / 导入 docx,书名自动识别)
127
175
 
@@ -243,6 +291,34 @@ and mount it any time.
243
291
  style templates / anti-AI rules / custom style engine), full-book export,
244
292
  blurb & cover
245
293
 
294
+ ## What's New
295
+
296
+ This iteration hands the professional workflows over to the **AI Editor Agent**
297
+ and adds a batch of planning / inspiration / orchestration capabilities:
298
+
299
+ - 💬 **AI Editor Agent**: the in-book assistant renamed & upgraded — say one line
300
+ and it handles 拆书 (book teardown), 自动导演 (auto-director), knowledge base
301
+ (add/search/list), plotlines, director todos, book audit, blurb, chapter
302
+ generate/review/revise, outline/bible/foreshadow/assets, export; write actions
303
+ are gated and convergence-guarded so it never loops or edits on its own.
304
+ - 📡 **Market radar → inspiration**: scan public leaderboards (Fanqie / Qidian /
305
+ Jinjiang) → signals / production foundation / creative brief → one-click
306
+ "generate inspiration from these signals" for market-fit book ideas.
307
+ - 🎬 **Auto-director**: from this book's volumes / plotlines / foreshadows / facts,
308
+ outputs next-arc nodes, pacing board, risks and fixes; adoptable into plotlines
309
+ or todos in one click.
310
+ - 📚 **Knowledge base / RAG**: free-form reference docs per book, retrieved and
311
+ injected per chapter at generation time for consistency.
312
+ - 📊 **Book analysis / teardown**: paste any text → selling points / structure /
313
+ lessons / risks.
314
+ - 💡 **Creative inspiration**: one idea/genre → several differentiated book ideas,
315
+ with "start a book this way".
316
+ - 🧭 **Advanced tools folded**: by default only the pipeline + core (assistant /
317
+ AI progress) + assets are shown; advanced tools collapse into a group, and the
318
+ dashboard gains a "Ask the AI Editor Agent" entry.
319
+ - 🃏 **Structured result cards**: tool results (teardown / director / audit /
320
+ knowledge list) render as cards right in the conversation.
321
+
246
322
  ## Getting Started
247
323
 
248
324
  ```sh
@@ -272,6 +348,25 @@ One main pipeline — **open a book → build the setting → plan chapters →
272
348
  compile chapter by chapter → audit & finalize → export**. Everything happens
273
349
  inside the "Novel Forge" panel in the sidebar.
274
350
 
351
+ ```mermaid
352
+ flowchart TD
353
+ A[1. Open a book<br/>paste outline / import docx] --> B[2. Build the setting<br/>story bible · world · assets]
354
+ B --> C[3. Plan chapters<br/>volume plan · chapter plan / continuation]
355
+ C --> D[4. Compile each chapter<br/>generate → summary·facts → review]
356
+ D --> E{Review passed?}
357
+ E -->|No| F[5. Revise loop<br/>revise per feedback / local edit / polish]
358
+ F --> D
359
+ E -->|Yes| G[6. Finalize book<br/>audit · sensitive scan · maintain]
360
+ G --> H[7. Export<br/>full book TXT / MD]
361
+
362
+ R1[AI Editor Agent<br/>teardown / director / KB / audit / blurb / todos] -.-> B
363
+ R1 -.-> C
364
+ R1 -.-> D
365
+ R1 -.-> G
366
+ R2[Plotlines · Roles · Progress] -.-> D
367
+ R2 -.-> G
368
+ ```
369
+
275
370
  ```
276
371
  ① Open a book (bookshelf → book wizard: paste outline text / import docx; book name auto-detected)
277
372