@waterwx/dsh-novel-forge 2.1.0-alpha → 2.1.2-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.
package/README.md CHANGED
@@ -1,457 +1,458 @@
1
- # dsh-novel-forge — AI 编译小说工作台 / AI Novel Writing Workbench
2
-
3
- **中文** | [English](#english)
4
-
5
- 你的专属 AI 小说写作插件:把一份大纲"编译"成一本完整的小说。
6
- Your personal AI novel-writing plugin for DSH: turn an outline into a complete novel.
7
-
8
- > **⚠️ 版本状态 / Version status(read this first)**
9
- >
10
- > - 本插件当前**唯一发布 / 更新线为 V2.0 ALPHA(`2.1.0-alpha`)**,适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 提供的 `cosmokit`,不能在纯 Node 环境单独运行)。
11
- > - **V1.0 RC(`1.10.1`)为最终稳定版,已停止更新**;需要稳定版请显式安装 `@waterwx/dsh-novel-forge@1.10.1`。
12
- > - **安装前请确认你的 DSH 版本**:在 `0.1.3-alpha.1` 以前的 DSH 上安装 V2.0 ALPHA 会加载失败。
13
- > - npm `latest` 现指向 V2.0 ALPHA:`npm i @waterwx/dsh-novel-forge` 会安装预发布版;想要最终稳定 RC 请用 `@1.10.1`。
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
-
31
- ---
32
-
33
- ## 功能一览 / Features
34
-
35
- | 中文 | English |
36
- |---|---|
37
- | **创作工作流仪表盘**:主行动卡(推荐下一步)+ 创作旅程进度条 + 状态条 + 待办队列 + 资产健康 | **Workflow dashboard**: next-action hero card, journey progress bar, status strip, todo queue, asset health |
38
- | **书架首页**:书卡网格(封面/简介/进度)+ 开书向导独立页,进入工坊先选书 | **Bookshelf home**: book card grid with covers, blurbs and progress, plus a dedicated book-wizard page |
39
- | **正文编辑 + AI 审查 + 保存**:章节工作区直接改文,审查草稿不落盘,保存即审稿(沿用报告不重复审) | **Edit AI check save**: edit chapter text, review the draft without persisting, save-with-review reuses the report |
40
- | **按意见修订**:审稿未通过时一键按意见自动修订(指令自动预填 high 优先问题) | **Revise by review**: one click to revise with the review feedback pre-filled |
41
- | **国风模块**:总纲 / 道藏 / 大世界 / 人物志 / 暗线 / 编年录 / 文戒 / 笔法帖 / 心法 | **Wuxia-flavored modules**: outline, story bible, world, characters, foreshadows, fact ledger, anti-AI rules, style templates, custom style |
42
- | **规模化加固**:上下文分片、相关事实注入、质检/影响分析分批、status 瘦身、按卷折叠、token 优化(摘要+事实合并省 25%) | **Scale hardening**: sharded contexts, related-fact injection, batched audit/impact, slim status, volume folding, token optimizations |
43
- | **开书向导**:书架新建书时直接导入大纲(docx/粘贴),开书即建项目,书名自动识别 | **Book wizard**: create a book with its outline in one step project is built immediately |
44
- | **大纲只读化**:开书后大纲页只读展示;「更新大纲」可选仅改文本(保留进度)或重置项目重来 | **Read-only outline**: after opening a book the outline is read-only; update offers keep-progress or full reset |
45
- | **章节计划结构化**:每章含 本章目标 / 剧情要点 / 爽点·钩子 / 结尾钩子 | **Structured chapter beats**: goal / plot points / payoff-hook / ending hook per chapter |
46
- | **章节计划续写模式**:已有章节时自动续写规划(上一章结尾原文 + 编年录锚点 + 已发生情节禁令),不再重头生成;追加自动去重 | **Continuation planning**: with existing chapters the planner continues from the last chapter's ending (tail text + fact anchors + banned-repeat list), never restarts; duplicate titles are dropped on append |
47
- | **事实库 / 时间线**:每章自动抽取已确立事实,注入后续生成,保证长期一致 | **Fact ledger**: auto-extracted per-chapter facts injected into later chapters for consistency |
48
- | **全书一致性质检**:LLM 扫描全本,输出矛盾清单(定位到章),一键去修订 | **Book audit**: LLM scans all chapters for contradictions, locates them, one-click to revise |
49
- | **角色卡**:出场统计精确计算 + LLM 聚合当前状态,历史章节可回填事实库 | **Character cards**: precise appearance stats + LLM-aggregated status; backfill for old chapters |
50
- | **润色/修订工作区**:左栏原文(选中即局部修订)+ 右栏指令/预览/应用,草稿制不覆盖原稿,自动备份 .bak | **Revision workspace**: editable original + selection-targeted local edits, draft-apply flow with auto-backup |
51
- | **章节编辑独立页**:点「编辑」进入独占整页(左导航保留),原文|对比左右各半、原稿新稿并排高亮,默认即对比模式 | **Full-page chapter editor**: opening a chapter takes over the content pane; original vs draft side by side with highlighted changes, diff view by default |
52
- | **审稿问题勾选修复**:审查报告每条问题可勾选,一键按所选问题修订(默认勾 high) | **Selective review fixes**: check any review issues (high pre-checked) and fix them in one click |
53
- | **编辑器字号可调**:设置页 12-24px + 编辑页 A−/A+ 快捷调整(localStorage 记忆) | **Adjustable editor font size**: 12-24px in settings plus A−/A+ in the editor toolbar (localStorage) |
54
- | **AI 助手悬浮窗**:可拖动、可拉大小、位置记忆;「编辑老师」全量知情 + 影响分析 + 步骤卡片 + 思考计时 + 清空聊天 | **Floating AI assistant**: draggable, resizable, position remembered; full-context "editor" persona with impact analysis and live step cards |
55
- | **剧情线管理**:主线/支线/人物线/悬念线,目标与进度追踪、章节关联;生成时强制每章推进至少一条活跃线,工作台实时进度 | **Plotline management**: main/branch/character/mystery arcs with goals, progress and linked chapters; generation must advance an active arc, live progress on the workbench |
56
- | **AI 剧情规划**:健康检查(是否需要新线/多少章后加/各线健康度)+ 一键设计剧情方案(下一阶段方向 + 建议新线可采纳)+ 单线 AI 刷新进度 | **AI plotline planning**: health check (need new arcs? when?) + one-click design plan (next-stage direction + adoptable arcs) + per-arc progress refresh |
57
- | **角色库**:独立页签——AI 从全书提炼角色(自动分级主角/女主/女配/配角/反派/路人)、候选逐条采纳、定位/关系网/成长线/知情度编辑;生成时按定位规格刻画互动 | **Role library**: dedicated tab AI extracts all characters with auto-tiering (protagonist/female lead/female support/support/antagonist/extra), adopt per candidate, edit identity/relations/arc/knowledge; generation follows the role tier |
58
- | **人物志持久化**:角色当前状态(编年录聚合)落盘存档,打开即显示;状态卡带「查看档案」跳转角色库 | **Persistent character status**: aggregated status from the chronicle is saved to disk and shown on open; each card links to the role library |
59
- | **作者复盘**:每章自动复盘(钩子兑现/结尾钩子强度/剧情线推进/连续性/节奏趋势),按卷分组的复盘记录页,复盘自动关联推进的剧情线 | **Author review**: per-chapter structural review (hook payoff / ending hook / arc progress / continuity / pacing), volume-grouped records page, auto-links advanced arcs |
60
- | **工作进度悬浮窗**:工具组入口,可拖拽/缩放/位置记忆;当前任务大进度条 + 全量活动记录,任务开始自动弹出 | **Floating progress console**: draggable/resizable window from the tools nav with live task progress bar + full activity log, auto-opens on task start |
61
- | **角色知情度**:每个角色"已知信息"清单,生成与审稿严格维护信息差(未列出的信息角色一律不知道) | **Character knowledge**: per-character known-info lists; writing & review enforce information asymmetry strictly |
62
- | **助手写操作守卫**:AI 助手只在作者明确指令下执行写操作(生成/修订/删除),随口提问不会误触发生成章节 | **Assistant write guard**: the AI assistant only performs write actions (generate/revise/delete) on explicit author instruction — casual questions can never trigger chapter generation |
63
- | **相关事实全量检索**:生成时按本章剧情要点对全量编年录检索(角色名加权 + 近因加权 + 去重),长篇连载旧设定不因窗口滑出而丢失 | **Full-ledger fact retrieval**: chapter generation retrieves relevant facts across the entire chronicle (character-name + recency weighting, dedup)old settings survive in long serials |
64
- | **并发安全保存**:计划/生成/审稿落盘前自动合并磁盘最新设定(道藏/角色库/剧情线/知情度),多窗口操作互不覆盖 | **Concurrency-safe saves**: plan/generate/review merge the latest on-disk settings (bible/roles/plotlines/knowledge) before savingparallel windows never clobber each other |
65
- | **敏感词检查**:内置违禁词库(政治/擦边/暴力/辱骂/广告)全书一键扫描,命中定位到章并一键去修订 | **Sensitive-word check**: built-in banned-word library scans all chapters, hits located per chapter with one-click fix |
66
- | **编年录独立页**:事实库从设置页移入数据库导航,支持一键回填历史章节 | **Chronicle tab**: the fact ledger moved into the database nav with one-click backfill |
67
- | **三套主题**:iOS 液态玻璃(绿)/ 经典毛玻璃(蓝)/ 新拟物双阴影,设置页即时切换(localStorage) | **Three themes**: iOS Liquid Glass (green) / classic frosted (blue) / neumorphism, instant switching in settings |
68
- | **活动输出控制台**:工作流页实时记录生成/审稿/润色/质检等全部活动,自动滚动 + 一键清空 | **Activity console**: dashboard records every action (writing/review/polish/audit), auto-scrolls, one-click clear |
69
- | **iOS 字体统一**:SF Pro + 苹方/冬青黑体/微软雅黑全站统一,编辑区不再等宽 | **iOS font stack**: SF Pro + PingFang/Hiragino/YaHei unified across the panel; editor no longer monospace |
70
- | **分组导航 + 状态角标**:创作/工具/数据库分组,章节待办/伏笔/进度角标 | **Grouped nav + badges**: creation/tools/database groups with live badges |
71
- | **iOS 风格毛玻璃 UI**(浅色/深色) | **iOS-style frosted glass UI** (light/dark) |
72
- | **书架 / 伏笔管理 / 写作资产(题材·推进·写法·反AI规则·自定义引擎)/ 全本导出(TXT/MD)/ 卷首语与封面** | **Bookshelf / foreshadowing / writing assets / full-book export (TXT/MD) / blurb & cover** |
73
- | **角色形象(🖼️)**:角色详情悬浮页=提示词分发中心——立绘/四视图/表情×N/细节 四类生图提示词(中文默认+英文标签折叠),一次提炼直接产出锚点+表情清单+精修提示词包,图集(立绘/四视图/表情/场景/细节)分类上传 | **Character visuals**: role detail modal as prompt hub — portrait / 4-view / expressions / details prompt kits (CN default + EN tags folded), one-shot extraction yields anchor + expression list + refined kits, gallery uploads by category |
74
- | **场景库(🏞️)**:从全书提炼「镜头场景」级视觉锚点(五幕结构/时间光态/关键镜头/人物状态),中英文生图提示词 + 场景图集,候选逐条采纳 | **Scene library**: shot-level visual anchors extracted from the book (act structure / time-of-day / key beats / character state), CN+EN prompts, adoptable candidates |
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 |
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 |
77
-
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
-
92
-
93
- ```sh
94
- pnpm install # 安装依赖 / install dependencies
95
- pnpm build # 重新构建 lib/ / rebuild lib/
96
- ```
97
-
98
- 挂载到 dsh web profile / Mount into the dsh web profile:
99
-
100
- ```sh
101
- dsh plugin --profile web add link:"<此目录绝对路径>"
102
- ```
103
-
104
- 或 / or in `~/.dsh/profiles/web/cordis.patch.yml`:
105
-
106
- ```yaml
107
- - insert:
108
- - id: novel-forge
109
- name: '@waterwx/dsh-novel-forge'
110
- ```
111
-
112
- 重启 dsh web 后,侧边栏出现「小说工坊」。
113
- Restart dsh web and the "Novel Forge" entry appears in the sidebar.
114
-
115
- ## 安装方式 / Installation
116
-
117
- ### 从 GitHub 安装 / Install from GitHub
118
-
119
- ```sh
120
- dsh plugin --profile web add github:watersxya/dsh-novel-forge
121
- ```
122
-
123
- > 注意:pnpm ≥10 默认拒绝运行 git 依赖的 `prepare` 构建脚本。首次安装失败时,把 pnpm 提示的包键加入该 profile 的 `pnpm-workspace.yaml`:
124
- > 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`:
125
- >
126
- > ```yaml
127
- > allowBuilds:
128
- > '@waterwx/dsh-novel-forge': true
129
- > ```
130
- >
131
- > 然后重新执行 `add`。只对源码可信的包授权。
132
- > Then re-run `add`. Only allow packages whose source you trust.
133
-
134
- ### 从 npm 安装 / Install from npm(推荐 / recommended)
135
-
136
- ```sh
137
- dsh plugin --profile web add @waterwx/dsh-novel-forge
138
- ```
139
-
140
- npm 分发的是预构建产物,无需任何构建授权。
141
- npm distribution ships prebuilt artifacts — no build authorization needed.
142
-
143
- ### 本地开发 / Local development
144
-
145
- ```sh
146
- pnpm install && pnpm build
147
- dsh plugin --profile web add link:"<本目录绝对路径>"
148
- ```
149
-
150
- ## 工作流程 / Workflow
151
-
152
- 一条主线:**开书 → 立设定 → 排章节 → 逐章编译 → 质检定稿 → 导出**。所有步骤都在侧边栏「小说工坊」面板内完成。
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
-
173
- ```
174
- ① 开书(书架 → 开书向导:粘贴大纲文本 / 导入 docx,书名自动识别)
175
-
176
- ② 立设定(总纲只读 → ✨ 提炼道藏【人设/世界观/金手指规则/写作红线】→ 大世界【境界/区域/势力】→ 写作资产【题材/推进/笔法帖/文戒/心法】)
177
-
178
- ③ 排章节(卷计划 → 章节计划:AI 按大纲生成每章 目标/剧情要点/爽点钩子/结尾钩子;
179
- 已有章节时自动进入「续写模式」——读取上一章结尾原文 + 编年录锚点,不会重头生成)
180
-
181
- ④ 逐章编译(生成正文 3000-4000 字 → 自动抽取摘要 + 编年录事实 → 自动 AI 审稿打分)
182
-
183
- ⑤ 修订循环(审稿未过 → 按意见一键修订 / 工作区选中局部修改 / 润色去 AI 味 → 重审;
184
- 不满意可「✔ 直接通过」行使作者终审权)
185
-
186
- ⑥ 全书定稿(全书质检【矛盾清单】→ 敏感词扫描 → 编年录/剧情线/角色库/复盘定期维护)
187
-
188
- ⑦ 导出(全本 TXT / MD,含卷首语与封面)
189
- ```
190
-
191
- **辅助旁路(任意阶段可用)**:💬 AI 助手悬浮窗(问设定/改文/影响分析)、🧵 剧情线管理(健康检查/设计剧情方案)、👥 角色库(AI 提炼/知情度维护)、📊 工作进度悬浮窗(任务实时进度与活动记录)、书架多书切换。
192
-
193
- **推荐节奏**:先让 ②③ 完整落地(设定越全,章节质量越高);④ 建议逐章或小批生成,便于在 ⑤ 及时修正;长篇小说每写 20-30 章跑一次 ⑥ 全书质检,防止设定漂移。
194
-
195
- ## 目录结构 / Directory Layout
196
-
197
- ```
198
- src/ 插件源码(宿主半 + 浏览器半)/ plugin source (host + browser)
199
- lib/ 构建产物(lib/index.js 宿主 / lib/client.js 浏览器)/ build output
200
- scripts/ 工具脚本 / utility scripts
201
- package.json 包定义(dsh.bundle.patch + dsh.client 声明)/ package definition
202
- cordis.patch.yml profile 挂载补丁 / profile mount patch
203
- tsdown.config.ts 双面打包配置 / dual-face bundling config
204
- ```
205
-
206
- ## 数据位置 / Data Locations
207
-
208
- - 书架 / Bookshelf:`~/.dsh/dsh-novel-forge-bookshelf.json`
209
- - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown + 润色备份 `.bak.md`)/ each book owns an output directory
210
- - AI 助手对话记录 / assistant log:`<输出目录>/novel-assistant.jsonl`
211
-
212
- ## 相关影响 / Impact & Notes
213
-
214
- 使用本插件会对你的账号、磁盘与 LLM 额度产生以下影响,请知悉:
215
-
216
- - **LLM 额度消耗**:生成/审稿/润色/质检/提炼/复盘等所有 AI 操作都调用 LLM(默认 `deepseek-official / deepseek-v4-flash`)。量级参考:一章 3000-4000 字正文 ≈ 1-2 万 token(含推理);审稿约 2000-3000 token;全书质检与角色提炼更贵(数万 token)。批量操作(如一次生成多章、全书质检、复盘补齐)会连续消耗额度,建议分小批执行。
217
- - **写操作守卫**:AI 助手只在作者**明确要求**时执行写操作(生成/修订/删除章节、改设定等)。你只是提问、查信息时,助手只会回答、不会擅自改文——防止"随口一问"误触发生成。
218
- - **并发安全**:计划/生成/审稿落盘前会自动合并磁盘上的最新设定(道藏/角色库/剧情线/知情度),多窗口同时操作不会互相覆盖。
219
- - **数据落盘**:每本书一个输出目录(默认 `~/.dsh/novels/<书名>`,可在设置页修改),正文为 Markdown 文件、项目状态为 `novel-project.json`、助手对话为 `novel-assistant.jsonl`;润色/重写应用草稿前自动生成 `.bak.md` 备份原稿。
220
- - **设置持久化**:面板「设置」页的修改(输出目录/模型/审稿阈值等)写入 `~/.dsh/settings.yaml` `dsh-novel-forge` 段;界面偏好(主题/字号/面板宽度)存在浏览器 localStorage。
221
- - **token 优化**:生成与审稿已做上下文分片、相关事实注入与摘要合并,长篇连载下批量成本约省 25%,但单章仍受模型上下文窗口限制(超长设定会按需检索注入,而非全量塞入)。
222
-
223
- ## 限制 / Limitations
224
-
225
- - 生成消耗 LLM API 额度(默认 deepseek-official / deepseek-v4-flash)/ generation consumes LLM API quota
226
- - 章节质量取决于大纲完整度 / chapter quality depends on outline completeness
227
- - 设置写入 `~/.dsh/settings.yaml` `dsh-novel-forge` / settings persist in `~/.dsh/settings.yaml`
228
- - 角色/场景视觉资产为「提示词 + 图集」形态,并可在设置页配置内置生图模型(imageModels/imageApiKey,支持多模型库与连通性测试);出图既可走内置生成,也可用外部工具(即梦/豆包/Krea 等),提示词可直接复制 / visual assets are prompt+image anchors, with optional built-in image-model configuration (imageModels/imageApiKey, multi-model library + endpoint test); images may be generated in-app or via external tools (Jimeng/Doubao/Krea) with copy-ready prompts
229
- - **V2.0 ALPHA** 新增并重做「漫剧工作台」:创建方案 一键生成 分镜工作台(骨架/分镜表/视频提示词)→ 角色定妆 场景底图 导出即梦脚本;仅适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 的 `cosmokit`)。V1.0 RC(`1.10.1`)不含此功能且已停止更新 / **V2.0 ALPHA** adds the reworked Manga Workbench (create plan → one-click generate storyboard studio → character styling → scene base → export Jimeng scripts); requires **DSH 0.1.3-alpha.1** (relies on DSH's `cosmokit`). V1.0 RC (1.10.1) lacks it and is no longer updated.
230
-
231
- ---
232
-
233
- <a id="english"></a>
234
-
235
- ## English
236
-
237
- # My Personal AI Novel Forge
238
-
239
- This is the working copy of the `dsh-novel-forge` plugin. All
240
- source code, build artifacts, and configuration are included install, build,
241
- and mount it any time.
242
-
243
- ## Feature Overview
244
-
245
- - **Workflow dashboard**: next-action hero card with a reason, a 6-stage journey
246
- progress bar, a status strip, a todo queue, and asset health
247
- - **Bookshelf home**: book card grid with covers, blurbs and progress; a
248
- dedicated book-wizard page opens a new book with its outline in one step
249
- - **Edit AI check save**: edit chapter text in the workspace, review the
250
- draft without persisting, and save-with-review reuses the report (never
251
- double-review); one-click "revise by review" pre-fills the feedback
252
- - **Wuxia-flavored modules**: 总纲 (outline), 道藏 (story bible), 大世界 (world),
253
- 人物志 (characters), 暗线 (foreshadows), 编年录 (fact ledger), 文戒 (anti-AI
254
- rules), 笔法帖 (style templates), 心法 (custom style)
255
- - **Read-only outline**: after opening a book the outline page is read-only;
256
- "Update outline" offers either keep-progress text update or full project reset
257
- - **Structured chapter beats**: every planned chapter carries goal / plot points /
258
- payoff-hook / ending hook sections
259
- - **Continuation planning**: with existing chapters the planner continues from the
260
- last chapter's ending it injects the previous chapter's tail text, fact-ledger
261
- anchors and a banned-repeat list (e.g. no re-entering the xu-jing), and trims the
262
- outline to settings-only, so regenerating a plan never restarts the story;
263
- duplicate titles are dropped on append
264
- - **Fact ledger**: each chapter auto-extracts established facts (character state,
265
- resources, relations, foreshadow landings); the latest 20 are injected into
266
- later chapters to keep the long story consistent
267
- - **Book audit**: one click scans all written chapters against the bible, fact
268
- ledger and red lines, reporting located contradictions with one-click revision
269
- - **Character cards**: appearance statistics are computed precisely from the
270
- chapter bodies, status is LLM-aggregated; historical chapters can be backfilled
271
- - **Revision workspace**: editable original on the left (select text for
272
- targeted local edits), instruction + preview + apply/cancel on the right;
273
- drafts never overwrite until applied, and applying auto-backs-up the original
274
- - **Full-page chapter editor**: clicking "Edit" takes over the content pane
275
- (left nav stays); original vs draft side by side 1:1 with highlighted
276
- changes, diff view on by default
277
- - **Selective review fixes**: every review issue gets a checkbox (high issues
278
- pre-checked) and one click fixes exactly the checked ones
279
- - **Adjustable editor font size**: 12-24px in settings plus A−/A+ shortcuts in
280
- the editor toolbar, remembered in localStorage
281
- - **Floating AI assistant**: draggable, resizable, position-remembered dialog
282
- with a full-context "editor" persona, impact analysis, live step cards and
283
- conversation clearing
284
- - **Grouped navigation with live badges**: creation / tools / database groups,
285
- badges for chapter todos, foreshadows and journey progress
286
- - **Scale hardening**: sharded book contexts, related-fact injection, batched
287
- audit/impact analysis, slim status payload, volume folding and token
288
- optimizations (summary+facts merged into one call, ~25% cheaper batches)
289
- - **iOS-style frosted glass UI** with light & dark palettes
290
- - Bookshelf, foreshadowing management, writing assets (genre / progression /
291
- style templates / anti-AI rules / custom style engine), full-book export,
292
- blurb & cover
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
-
322
- ## Getting Started
323
-
324
- ```sh
325
- pnpm install # install dependencies
326
- pnpm build # rebuild lib/
327
- ```
328
-
329
- Mount into the dsh web profile:
330
-
331
- ```sh
332
- dsh plugin --profile web add link:"<absolute path to this directory>"
333
- ```
334
-
335
- Or insert into `~/.dsh/profiles/web/cordis.patch.yml`:
336
-
337
- ```yaml
338
- - insert:
339
- - id: novel-forge
340
- name: '@waterwx/dsh-novel-forge'
341
- ```
342
-
343
- Restart dsh web, and the "Novel Forge" entry appears in the sidebar.
344
-
345
- ## Workflow
346
-
347
- One main pipeline — **open a book → build the setting → plan chapters →
348
- compile chapter by chapteraudit & finalizeexport**. Everything happens
349
- inside the "Novel Forge" panel in the sidebar.
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
-
370
- ```
371
- ① Open a book (bookshelf → book wizard: paste outline text / import docx; book name auto-detected)
372
-
373
- ② Build the setting (read-only outline → ✨ extract story bible [characters/world/golden-finger rules/
374
- red lines] world [realms/regions/factions]writing assets [genre/progression/templates/rules/style])
375
-
376
- ③ Plan chapters (volume plan → chapter plan: AI generates goal / plot points / payoff hook / ending
377
- hook per chapter; with existing chapters it auto-enters "continuation mode" reads the previous
378
- chapter's ending + fact anchors, never restarts from scratch)
379
-
380
- ④ Compile chapter by chapter (generate 3000-4000 chars → auto extract summary + fact ledger → auto AI review)
381
-
382
- ⑤ Revision loop (review failed → one-click revise per feedback / select-targeted local edits / polish
383
- to remove AI flavorre-review; or use "✔ approve directly" as the author's final say)
384
-
385
- ⑥ Book-wide finalization (book audit [contradiction list] → sensitive-word scan → periodic maintenance
386
- of chronicle/plotlines/role library/reviews)
387
-
388
- ⑦ Export (full book as TXT / MD, with blurb & cover)
389
- ```
390
-
391
- **Side paths (usable at any stage)**: 💬 floating AI assistant (ask about the
392
- setting / revise text / impact analysis), 🧵 plotline management (health check /
393
- design plans), 👥 role library (AI extraction / knowledge tracking), 📊 floating
394
- progress console (live task progress & activity log), multi-book bookshelf.
395
-
396
- **Suggested cadence**: fully land steps ②③ first (the richer the setting, the
397
- better the chapters); generate step one chapter or small batches at a time so
398
- step can correct early; run the step book audit every 20-30 chapters on long
399
- serials to prevent setting drift.
400
-
401
- ## Impact & Notes
402
-
403
- Using this plugin has the following effects on your account, disk and LLM quota:
404
-
405
- - **LLM quota consumption**: all AI operations (generate/review/polish/audit/
406
- extract/review-backfill) call the LLM (default `deepseek-official` /
407
- `deepseek-v4-flash`). Rough scale: one 3000-4000 char chapter ≈ 10-20k tokens
408
- including reasoning; a review ≈ 2-3k tokens; book-wide audit and role
409
- extraction are more expensive (tens of thousands of tokens). Batch operations
410
- (multi-chapter generation, book audit, review backfill) consume quota
411
- continuously prefer small batches.
412
- - **Write guard**: the AI assistant only performs write actions (generate/revise/
413
- delete chapters, change settings) when the author explicitly asks. If you are
414
- just asking questions, it answers in prose and never modifies anything casual
415
- questions can never trigger chapter generation.
416
- - **Concurrency safety**: plan/generate/review merge the latest on-disk settings
417
- (bible/roles/plotlines/knowledge) before saving, so parallel windows never
418
- clobber each other.
419
- - **Data on disk**: each book owns an output directory (default `~/.dsh/novels/<book name>`, configurable in settings)
420
- with per-chapter Markdown, `novel-project.json` project state, and
421
- `novel-assistant.jsonl` assistant log; applying polish/rewrite drafts auto-backs-up
422
- the original as `.bak.md`.
423
- - **Settings persistence**: panel "Settings" changes (output dir/model/review
424
- threshold etc.) are written to the `dsh-novel-forge` section of
425
- `~/.dsh/settings.yaml`; UI preferences (theme/font size/panel width) live in
426
- browser localStorage.
427
- - **Token optimization**: generation and review use sharded contexts, related-fact
428
- injection and merged summaries (~25% cheaper batches on long serials), but each
429
- chapter is still bounded by the model context window long settings are
430
- retrieved on demand rather than injected in full.
431
-
432
- ## Directory Layout
433
-
434
- ```
435
- src/ Plugin source (host half + browser half)
436
- lib/ Build output (lib/index.js host / lib/client.js browser)
437
- scripts/ Utility scripts
438
- package.json Package definition (dsh.bundle.patch + dsh.client declaration)
439
- cordis.patch.yml Profile mount patch
440
- tsdown.config.ts Dual-face bundling config
441
- ```
442
-
443
- ## Data Locations
444
-
445
- - Bookshelf: `~/.dsh/dsh-novel-forge-bookshelf.json`
446
- - Each book owns an output directory (containing `novel-project.json` project state,
447
- per-chapter Markdown, and polish backups `.bak.md`)
448
- - AI assistant conversation log: `<output-dir>/novel-assistant.jsonl`
449
-
450
- ## Limitations
451
-
452
- - Generation consumes LLM API quota (provider/model default: `deepseek-official` /
453
- `deepseek-v4-flash`)
454
- - Chapter quality depends on outline completeness; batch generation is serial
455
- - Settings (output directory, model, review threshold, etc.) are edited in the
456
- panel's "Settings" tab and written to the `dsh-novel-forge` section of
457
- `~/.dsh/settings.yaml`
1
+ # dsh-novel-forge — AI 编译小说工作台 / AI Novel Writing Workbench
2
+
3
+ **中文** | [English](#english)
4
+
5
+ 你的专属 AI 小说写作插件:把一份大纲"编译"成一本完整的小说。
6
+ Your personal AI novel-writing plugin for DSH: turn an outline into a complete novel.
7
+
8
+ > **⚠️ 版本状态 / Version status(read this first)**
9
+ >
10
+ > - 本插件当前**唯一发布 / 更新线为 V2.0 ALPHA(`2.1.2-alpha`)**,适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 提供的 `cosmokit`,不能在纯 Node 环境单独运行)。
11
+ > - **V1.0 RC(`1.10.1`)为最终稳定版,已停止更新**;需要稳定版请显式安装 `@waterwx/dsh-novel-forge@1.10.1`。
12
+ > - **安装前请确认你的 DSH 版本**:在 `0.1.3-alpha.1` 以前的 DSH 上安装 V2.0 ALPHA 会加载失败。
13
+ > - npm `latest` 现指向 V2.0 ALPHA:`npm i @waterwx/dsh-novel-forge` 会安装预发布版;想要最终稳定 RC 请用 `@1.10.1`。
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
+ <a href="https://github.com/watersxya/dsh-novel-forge/actions"><img src="https://img.shields.io/github/actions/workflow/status/watersxya/dsh-novel-forge/ci.yml" alt="CI" /></a>
19
+ </p>
20
+
21
+ <p align="center">
22
+ <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="创作工作流" />
23
+ <img src="https://img.shields.io/badge/AI%20%E7%BC%96%E8%BE%91%20Agent-%E2%9C%93-blue" alt="AI 编辑 Agent" />
24
+ <img src="https://img.shields.io/badge/%E8%87%AA%E5%8A%A8%E7%BC%96%E8%BE%91-%E2%9C%93-blue" alt="自动编辑" />
25
+ <img src="https://img.shields.io/badge/%E7%9F%A5%E8%AF%86%E5%BA%93%20RAG-%E2%9C%93-blue" alt="知识库 RAG" />
26
+ <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="题材雷达→灵感" />
27
+ <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="漫剧工作台" />
28
+ <img src="https://img.shields.io/badge/%E5%A4%9A%E4%B8%BB%E9%A2%98-%E2%9C%93-blue" alt="多主题" />
29
+ <img src="https://img.shields.io/badge/%E5%85%A8%E6%9C%AC%E5%AF%BC%E5%87%BA-%E2%9C%93-blue" alt="全本导出" />
30
+ </p>
31
+
32
+ ---
33
+
34
+ ## 功能一览 / Features
35
+
36
+ | 中文 | English |
37
+ |---|---|
38
+ | **创作工作流仪表盘**:主行动卡(推荐下一步)+ 创作旅程进度条 + 状态条 + 待办队列 + 资产健康 | **Workflow dashboard**: next-action hero card, journey progress bar, status strip, todo queue, asset health |
39
+ | **书架首页**:书卡网格(封面/简介/进度)+ 开书向导独立页,进入工坊先选书 | **Bookshelf home**: book card grid with covers, blurbs and progress, plus a dedicated book-wizard page |
40
+ | **正文编辑 + AI 审查 + 保存**:章节工作区直接改文,审查草稿不落盘,保存即审稿(沿用报告不重复审) | **Edit AI check save**: edit chapter text, review the draft without persisting, save-with-review reuses the report |
41
+ | **按意见修订**:审稿未通过时一键按意见自动修订(指令自动预填 high 优先问题) | **Revise by review**: one click to revise with the review feedback pre-filled |
42
+ | **国风模块**:总纲 / 道藏 / 大世界 / 人物志 / 暗线 / 编年录 / 文戒 / 笔法帖 / 心法 | **Wuxia-flavored modules**: outline, story bible, world, characters, foreshadows, fact ledger, anti-AI rules, style templates, custom style |
43
+ | **规模化加固**:上下文分片、相关事实注入、质检/影响分析分批、status 瘦身、按卷折叠、token 优化(摘要+事实合并省 25%) | **Scale hardening**: sharded contexts, related-fact injection, batched audit/impact, slim status, volume folding, token optimizations |
44
+ | **开书向导**:书架新建书时直接导入大纲(docx/粘贴),开书即建项目,书名自动识别 | **Book wizard**: create a book with its outline in one step project is built immediately |
45
+ | **大纲只读化**:开书后大纲页只读展示;「更新大纲」可选仅改文本(保留进度)或重置项目重来 | **Read-only outline**: after opening a book the outline is read-only; update offers keep-progress or full reset |
46
+ | **章节计划结构化**:每章含 本章目标 / 剧情要点 / 爽点·钩子 / 结尾钩子 | **Structured chapter beats**: goal / plot points / payoff-hook / ending hook per chapter |
47
+ | **章节计划续写模式**:已有章节时自动续写规划(上一章结尾原文 + 编年录锚点 + 已发生情节禁令),不再重头生成;追加自动去重 | **Continuation planning**: with existing chapters the planner continues from the last chapter's ending (tail text + fact anchors + banned-repeat list), never restarts; duplicate titles are dropped on append |
48
+ | **事实库 / 时间线**:每章自动抽取已确立事实,注入后续生成,保证长期一致 | **Fact ledger**: auto-extracted per-chapter facts injected into later chapters for consistency |
49
+ | **全书一致性质检**:LLM 扫描全本,输出矛盾清单(定位到章),一键去修订 | **Book audit**: LLM scans all chapters for contradictions, locates them, one-click to revise |
50
+ | **角色卡**:出场统计精确计算 + LLM 聚合当前状态,历史章节可回填事实库 | **Character cards**: precise appearance stats + LLM-aggregated status; backfill for old chapters |
51
+ | **润色/修订工作区**:左栏原文(选中即局部修订)+ 右栏指令/预览/应用,草稿制不覆盖原稿,自动备份 .bak | **Revision workspace**: editable original + selection-targeted local edits, draft-apply flow with auto-backup |
52
+ | **章节编辑独立页**:点「编辑」进入独占整页(左导航保留),原文|对比左右各半、原稿新稿并排高亮,默认即对比模式 | **Full-page chapter editor**: opening a chapter takes over the content pane; original vs draft side by side with highlighted changes, diff view by default |
53
+ | **审稿问题勾选修复**:审查报告每条问题可勾选,一键按所选问题修订(默认勾 high) | **Selective review fixes**: check any review issues (high pre-checked) and fix them in one click |
54
+ | **编辑器字号可调**:设置页 12-24px + 编辑页 A−/A+ 快捷调整(localStorage 记忆) | **Adjustable editor font size**: 12-24px in settings plus A−/A+ in the editor toolbar (localStorage) |
55
+ | **AI 助手悬浮窗**:可拖动、可拉大小、位置记忆;「编辑老师」全量知情 + 影响分析 + 步骤卡片 + 思考计时 + 清空聊天 | **Floating AI assistant**: draggable, resizable, position remembered; full-context "editor" persona with impact analysis and live step cards |
56
+ | **剧情线管理**:主线/支线/人物线/悬念线,目标与进度追踪、章节关联;生成时强制每章推进至少一条活跃线,工作台实时进度 | **Plotline management**: main/branch/character/mystery arcs with goals, progress and linked chapters; generation must advance an active arc, live progress on the workbench |
57
+ | **AI 剧情规划**:健康检查(是否需要新线/多少章后加/各线健康度)+ 一键设计剧情方案(下一阶段方向 + 建议新线可采纳)+ 单线 AI 刷新进度 | **AI plotline planning**: health check (need new arcs? when?) + one-click design plan (next-stage direction + adoptable arcs) + per-arc progress refresh |
58
+ | **角色库**:独立页签——AI 从全书提炼角色(自动分级主角/女主/女配/配角/反派/路人)、候选逐条采纳、定位/关系网/成长线/知情度编辑;生成时按定位规格刻画互动 | **Role library**: dedicated tab AI extracts all characters with auto-tiering (protagonist/female lead/female support/support/antagonist/extra), adopt per candidate, edit identity/relations/arc/knowledge; generation follows the role tier |
59
+ | **人物志持久化**:角色当前状态(编年录聚合)落盘存档,打开即显示;状态卡带「查看档案」跳转角色库 | **Persistent character status**: aggregated status from the chronicle is saved to disk and shown on open; each card links to the role library |
60
+ | **作者复盘**:每章自动复盘(钩子兑现/结尾钩子强度/剧情线推进/连续性/节奏趋势),按卷分组的复盘记录页,复盘自动关联推进的剧情线 | **Author review**: per-chapter structural review (hook payoff / ending hook / arc progress / continuity / pacing), volume-grouped records page, auto-links advanced arcs |
61
+ | **工作进度悬浮窗**:工具组入口,可拖拽/缩放/位置记忆;当前任务大进度条 + 全量活动记录,任务开始自动弹出 | **Floating progress console**: draggable/resizable window from the tools nav with live task progress bar + full activity log, auto-opens on task start |
62
+ | **角色知情度**:每个角色"已知信息"清单,生成与审稿严格维护信息差(未列出的信息角色一律不知道) | **Character knowledge**: per-character known-info lists; writing & review enforce information asymmetry strictly |
63
+ | **助手写操作守卫**:AI 助手只在作者明确指令下执行写操作(生成/修订/删除),随口提问不会误触发生成章节 | **Assistant write guard**: the AI assistant only performs write actions (generate/revise/delete) on explicit author instructioncasual questions can never trigger chapter generation |
64
+ | **相关事实全量检索**:生成时按本章剧情要点对全量编年录检索(角色名加权 + 近因加权 + 去重),长篇连载旧设定不因窗口滑出而丢失 | **Full-ledger fact retrieval**: chapter generation retrieves relevant facts across the entire chronicle (character-name + recency weighting, dedup)old settings survive in long serials |
65
+ | **并发安全保存**:计划/生成/审稿落盘前自动合并磁盘最新设定(道藏/角色库/剧情线/知情度),多窗口操作互不覆盖 | **Concurrency-safe saves**: plan/generate/review merge the latest on-disk settings (bible/roles/plotlines/knowledge) before saving parallel windows never clobber each other |
66
+ | **敏感词检查**:内置违禁词库(政治/擦边/暴力/辱骂/广告)全书一键扫描,命中定位到章并一键去修订 | **Sensitive-word check**: built-in banned-word library scans all chapters, hits located per chapter with one-click fix |
67
+ | **编年录独立页**:事实库从设置页移入数据库导航,支持一键回填历史章节 | **Chronicle tab**: the fact ledger moved into the database nav with one-click backfill |
68
+ | **三套主题**:iOS 液态玻璃(绿)/ 经典毛玻璃(蓝)/ 新拟物双阴影,设置页即时切换(localStorage) | **Three themes**: iOS Liquid Glass (green) / classic frosted (blue) / neumorphism, instant switching in settings |
69
+ | **活动输出控制台**:工作流页实时记录生成/审稿/润色/质检等全部活动,自动滚动 + 一键清空 | **Activity console**: dashboard records every action (writing/review/polish/audit), auto-scrolls, one-click clear |
70
+ | **iOS 字体统一**:SF Pro + 苹方/冬青黑体/微软雅黑全站统一,编辑区不再等宽 | **iOS font stack**: SF Pro + PingFang/Hiragino/YaHei unified across the panel; editor no longer monospace |
71
+ | **分组导航 + 状态角标**:创作/工具/数据库分组,章节待办/伏笔/进度角标 | **Grouped nav + badges**: creation/tools/database groups with live badges |
72
+ | **iOS 风格毛玻璃 UI**(浅色/深色) | **iOS-style frosted glass UI** (light/dark) |
73
+ | **书架 / 伏笔管理 / 写作资产(题材·推进·写法·反AI规则·自定义引擎)/ 全本导出(TXT/MD)/ 卷首语与封面** | **Bookshelf / foreshadowing / writing assets / full-book export (TXT/MD) / blurb & cover** |
74
+ | **角色形象(🖼️)**:角色详情悬浮页=提示词分发中心——立绘/四视图/表情×N/细节 四类生图提示词(中文默认+英文标签折叠),一次提炼直接产出锚点+表情清单+精修提示词包,图集(立绘/四视图/表情/场景/细节)分类上传 | **Character visuals**: role detail modal as prompt hub portrait / 4-view / expressions / details prompt kits (CN default + EN tags folded), one-shot extraction yields anchor + expression list + refined kits, gallery uploads by category |
75
+ | **场景库(🏞️)**:从全书提炼「镜头场景」级视觉锚点(五幕结构/时间光态/关键镜头/人物状态),中英文生图提示词 + 场景图集,候选逐条采纳 | **Scene library**: shot-level visual anchors extracted from the book (act structure / time-of-day / key beats / character state), CN+EN prompts, adoptable candidates |
76
+ | **视觉世界观规则(⚠️)**:从道藏提炼生图纠偏规则(如"货架商品=活人,禁止画成常规超市商品"),自动注入所有角色/场景提示词——反常识设定的书不再被生图模型画跑偏 | **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 |
77
+ | **漫剧工作台(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 |
78
+
79
+ ## 最近更新 / What's New(本次迭代)
80
+
81
+ 本次迭代把「专业工作流」交给 **AI 编辑 Agent** 代办,并新增一批策划/灵感/编排能力:
82
+
83
+ - 💬 **AI 编辑 Agent**:书内助手改名并升级,一句话即可代办——拆书、自动编辑、知识库(增/查/列)、剧情线、编辑待办、全书质检、简介、章节生成/审稿/修订、大纲/道藏/暗线/资产、导出;写操作有安全放行 + 收敛规则,不会循环或乱改。
84
+ - 📡 **题材雷达 → 灵感**:扫榜(番茄/起点/晋江)→ 题材信号 / 生产底座 / 开书简报 → 一键「用这些信号生成灵感」,得到贴合市场的多个开书方向。
85
+ - 🎬 **自动编辑**:基于本书分卷/剧情线/伏笔/事实,给出下一阶段节点、节奏板、风险与修复;可一键采纳为剧情线或待办。
86
+ - 📚 **知识库 / RAG**:书内自由参考文档,生成时按章节检索注入,提升一致性。
87
+ - 📊 **书分析 / 拆书**:输入任意文本 卖点 / 结构 / 可借鉴 / 风险。
88
+ - 💡 **创意灵感**:一句话/题材 多个差异化开书灵感,可「以此方向开书」。
89
+ - 🧭 **进阶工具折叠**:默认只露创作流水线 + 核心(助手 / AI 进度)+ 资产,进阶工具收进折叠组;创作页新增「问 AI 编辑 Agent」入口。
90
+ - 🃏 **结构化结果卡片**:拆书 / 自动编辑 / 质检 / 知识库列表等工具结果,在对话里直接渲染成卡片。
91
+
92
+
93
+
94
+ ```sh
95
+ pnpm install # 安装依赖 / install dependencies
96
+ pnpm build # 重新构建 lib/ / rebuild lib/
97
+ ```
98
+
99
+ 挂载到 dsh web profile / Mount into the dsh web profile:
100
+
101
+ ```sh
102
+ dsh plugin --profile web add link:"<此目录绝对路径>"
103
+ ```
104
+
105
+ 或 / or in `~/.dsh/profiles/web/cordis.patch.yml`:
106
+
107
+ ```yaml
108
+ - insert:
109
+ - id: novel-forge
110
+ name: '@waterwx/dsh-novel-forge'
111
+ ```
112
+
113
+ 重启 dsh web 后,侧边栏出现「小说工坊」。
114
+ Restart dsh web and the "Novel Forge" entry appears in the sidebar.
115
+
116
+ ## 安装方式 / Installation
117
+
118
+ ### 从 GitHub 安装 / Install from GitHub
119
+
120
+ ```sh
121
+ dsh plugin --profile web add github:watersxya/dsh-novel-forge
122
+ ```
123
+
124
+ > 注意:pnpm ≥10 默认拒绝运行 git 依赖的 `prepare` 构建脚本。首次安装失败时,把 pnpm 提示的包键加入该 profile `pnpm-workspace.yaml`:
125
+ > 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`:
126
+ >
127
+ > ```yaml
128
+ > allowBuilds:
129
+ > '@waterwx/dsh-novel-forge': true
130
+ > ```
131
+ >
132
+ > 然后重新执行 `add`。只对源码可信的包授权。
133
+ > Then re-run `add`. Only allow packages whose source you trust.
134
+
135
+ ### 从 npm 安装 / Install from npm(推荐 / recommended)
136
+
137
+ ```sh
138
+ dsh plugin --profile web add @waterwx/dsh-novel-forge
139
+ ```
140
+
141
+ npm 分发的是预构建产物,无需任何构建授权。
142
+ npm distribution ships prebuilt artifacts — no build authorization needed.
143
+
144
+ ### 本地开发 / Local development
145
+
146
+ ```sh
147
+ pnpm install && pnpm build
148
+ dsh plugin --profile web add link:"<本目录绝对路径>"
149
+ ```
150
+
151
+ ## 工作流程 / Workflow
152
+
153
+ 一条主线:**开书 → 立设定 → 排章节 → 逐章编译 → 质检定稿 → 导出**。所有步骤都在侧边栏「小说工坊」面板内完成。
154
+
155
+ ```mermaid
156
+ flowchart TD
157
+ A[① 开书<br/>粘贴大纲 / 导入 docx] --> B[ 立设定<br/>道藏 · 大世界 · 写作资产]
158
+ B --> C[ 排章节<br/>卷计划 · 章节计划 / 续写模式]
159
+ C --> D[④ 逐章编译<br/>生成正文 → 摘要·事实 → 审稿]
160
+ D --> E{审稿通过?}
161
+ E -->|否| F[⑤ 修订循环<br/>按意见修订 / 局部改 / 润色]
162
+ F --> D
163
+ E -->|是| G[ 全书定稿<br/>全书质检 · 敏感词 · 维护]
164
+ G --> H[⑦ 导出<br/>全本 TXT / MD]
165
+
166
+ R1[💬 AI 编辑 Agent<br/>拆书 / 自动编辑 / 知识库 / 质检 / 简介 / 待办] -.-> B
167
+ R1 -.-> C
168
+ R1 -.-> D
169
+ R1 -.-> G
170
+ R2[🧵 剧情线 · 👥 角色库 · 📊 进度] -.-> D
171
+ R2 -.-> G
172
+ ```
173
+
174
+ ```
175
+ ① 开书(书架 → 开书向导:粘贴大纲文本 / 导入 docx,书名自动识别)
176
+
177
+ ② 立设定(总纲只读 → ✨ 提炼道藏【人设/世界观/金手指规则/写作红线】→ 大世界【境界/区域/势力】→ 写作资产【题材/推进/笔法帖/文戒/心法】)
178
+
179
+ 排章节(卷计划 → 章节计划:AI 按大纲生成每章 目标/剧情要点/爽点钩子/结尾钩子;
180
+ 已有章节时自动进入「续写模式」——读取上一章结尾原文 + 编年录锚点,不会重头生成)
181
+
182
+ ④ 逐章编译(生成正文 3000-4000 字 → 自动抽取摘要 + 编年录事实 → 自动 AI 审稿打分)
183
+
184
+ 修订循环(审稿未过 → 按意见一键修订 / 工作区选中局部修改 / 润色去 AI 味 → 重审;
185
+ 不满意可「✔ 直接通过」行使作者终审权)
186
+
187
+ ⑥ 全书定稿(全书质检【矛盾清单】→ 敏感词扫描 → 编年录/剧情线/角色库/复盘定期维护)
188
+
189
+ ⑦ 导出(全本 TXT / MD,含卷首语与封面)
190
+ ```
191
+
192
+ **辅助旁路(任意阶段可用)**:💬 AI 助手悬浮窗(问设定/改文/影响分析)、🧵 剧情线管理(健康检查/设计剧情方案)、👥 角色库(AI 提炼/知情度维护)、📊 工作进度悬浮窗(任务实时进度与活动记录)、书架多书切换。
193
+
194
+ **推荐节奏**:先让 ②③ 完整落地(设定越全,章节质量越高);④ 建议逐章或小批生成,便于在 ⑤ 及时修正;长篇小说每写 20-30 章跑一次 ⑥ 全书质检,防止设定漂移。
195
+
196
+ ## 目录结构 / Directory Layout
197
+
198
+ ```
199
+ src/ 插件源码(宿主半 + 浏览器半)/ plugin source (host + browser)
200
+ lib/ 构建产物(lib/index.js 宿主 / lib/client.js 浏览器)/ build output
201
+ scripts/ 工具脚本 / utility scripts
202
+ package.json 包定义(dsh.bundle.patch + dsh.client 声明)/ package definition
203
+ cordis.patch.yml profile 挂载补丁 / profile mount patch
204
+ tsdown.config.ts 双面打包配置 / dual-face bundling config
205
+ ```
206
+
207
+ ## 数据位置 / Data Locations
208
+
209
+ - 书架 / Bookshelf:`~/.dsh/dsh-novel-forge-bookshelf.json`
210
+ - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown + 润色备份 `.bak.md`)/ each book owns an output directory
211
+ - AI 助手对话记录 / assistant log:`<输出目录>/novel-assistant.jsonl`
212
+
213
+ ## 相关影响 / Impact & Notes
214
+
215
+ 使用本插件会对你的账号、磁盘与 LLM 额度产生以下影响,请知悉:
216
+
217
+ - **LLM 额度消耗**:生成/审稿/润色/质检/提炼/复盘等所有 AI 操作都调用 LLM(默认 `deepseek-official / deepseek-v4-flash`)。量级参考:一章 3000-4000 字正文 ≈ 1-2 万 token(含推理);审稿约 2000-3000 token;全书质检与角色提炼更贵(数万 token)。批量操作(如一次生成多章、全书质检、复盘补齐)会连续消耗额度,建议分小批执行。
218
+ - **写操作守卫**:AI 助手只在作者**明确要求**时执行写操作(生成/修订/删除章节、改设定等)。你只是提问、查信息时,助手只会回答、不会擅自改文——防止"随口一问"误触发生成。
219
+ - **并发安全**:计划/生成/审稿落盘前会自动合并磁盘上的最新设定(道藏/角色库/剧情线/知情度),多窗口同时操作不会互相覆盖。
220
+ - **数据落盘**:每本书一个输出目录(默认 `~/.dsh/novels/<书名>`,可在设置页修改),正文为 Markdown 文件、项目状态为 `novel-project.json`、助手对话为 `novel-assistant.jsonl`;润色/重写应用草稿前自动生成 `.bak.md` 备份原稿。
221
+ - **设置持久化**:面板「设置」页的修改(输出目录/模型/审稿阈值等)写入 `~/.dsh/settings.yaml` 的 `dsh-novel-forge` 段;界面偏好(主题/字号/面板宽度)存在浏览器 localStorage。
222
+ - **token 优化**:生成与审稿已做上下文分片、相关事实注入与摘要合并,长篇连载下批量成本约省 25%,但单章仍受模型上下文窗口限制(超长设定会按需检索注入,而非全量塞入)。
223
+
224
+ ## 限制 / Limitations
225
+
226
+ - 生成消耗 LLM API 额度(默认 deepseek-official / deepseek-v4-flash)/ generation consumes LLM API quota
227
+ - 章节质量取决于大纲完整度 / chapter quality depends on outline completeness
228
+ - 设置写入 `~/.dsh/settings.yaml` `dsh-novel-forge` / settings persist in `~/.dsh/settings.yaml`
229
+ - 角色/场景视觉资产为「提示词 + 图集」形态,并可在设置页配置内置生图模型(imageModels/imageApiKey,支持多模型库与连通性测试);出图既可走内置生成,也可用外部工具(即梦/豆包/Krea 等),提示词可直接复制 / visual assets are prompt+image anchors, with optional built-in image-model configuration (imageModels/imageApiKey, multi-model library + endpoint test); images may be generated in-app or via external tools (Jimeng/Doubao/Krea) with copy-ready prompts
230
+ - **V2.0 ALPHA** 新增并重做「漫剧工作台」:创建方案 → 一键生成 → 分镜工作台(骨架/分镜表/视频提示词)→ 角色定妆 → 场景底图 → 导出即梦脚本;仅适用于 **DSH ≥ 0.1.3-alpha.1**(依赖 DSH 的 `cosmokit`)。V1.0 RC(`1.10.1`)不含此功能且已停止更新 / **V2.0 ALPHA** adds the reworked Manga Workbench (create plan → one-click generate → storyboard studio → character styling → scene base → export Jimeng scripts); requires **DSH ≥ 0.1.3-alpha.1** (relies on DSH's `cosmokit`). V1.0 RC (1.10.1) lacks it and is no longer updated.
231
+
232
+ ---
233
+
234
+ <a id="english"></a>
235
+
236
+ ## English
237
+
238
+ # My Personal AI Novel Forge
239
+
240
+ This is the working copy of the `dsh-novel-forge` plugin. All
241
+ source code, build artifacts, and configuration are included — install, build,
242
+ and mount it any time.
243
+
244
+ ## Feature Overview
245
+
246
+ - **Workflow dashboard**: next-action hero card with a reason, a 6-stage journey
247
+ progress bar, a status strip, a todo queue, and asset health
248
+ - **Bookshelf home**: book card grid with covers, blurbs and progress; a
249
+ dedicated book-wizard page opens a new book with its outline in one step
250
+ - **Edit AI check → save**: edit chapter text in the workspace, review the
251
+ draft without persisting, and save-with-review reuses the report (never
252
+ double-review); one-click "revise by review" pre-fills the feedback
253
+ - **Wuxia-flavored modules**: 总纲 (outline), 道藏 (story bible), 大世界 (world),
254
+ 人物志 (characters), 暗线 (foreshadows), 编年录 (fact ledger), 文戒 (anti-AI
255
+ rules), 笔法帖 (style templates), 心法 (custom style)
256
+ - **Read-only outline**: after opening a book the outline page is read-only;
257
+ "Update outline" offers either keep-progress text update or full project reset
258
+ - **Structured chapter beats**: every planned chapter carries goal / plot points /
259
+ payoff-hook / ending hook sections
260
+ - **Continuation planning**: with existing chapters the planner continues from the
261
+ last chapter's ending it injects the previous chapter's tail text, fact-ledger
262
+ anchors and a banned-repeat list (e.g. no re-entering the xu-jing), and trims the
263
+ outline to settings-only, so regenerating a plan never restarts the story;
264
+ duplicate titles are dropped on append
265
+ - **Fact ledger**: each chapter auto-extracts established facts (character state,
266
+ resources, relations, foreshadow landings); the latest 20 are injected into
267
+ later chapters to keep the long story consistent
268
+ - **Book audit**: one click scans all written chapters against the bible, fact
269
+ ledger and red lines, reporting located contradictions with one-click revision
270
+ - **Character cards**: appearance statistics are computed precisely from the
271
+ chapter bodies, status is LLM-aggregated; historical chapters can be backfilled
272
+ - **Revision workspace**: editable original on the left (select text for
273
+ targeted local edits), instruction + preview + apply/cancel on the right;
274
+ drafts never overwrite until applied, and applying auto-backs-up the original
275
+ - **Full-page chapter editor**: clicking "Edit" takes over the content pane
276
+ (left nav stays); original vs draft side by side 1:1 with highlighted
277
+ changes, diff view on by default
278
+ - **Selective review fixes**: every review issue gets a checkbox (high issues
279
+ pre-checked) and one click fixes exactly the checked ones
280
+ - **Adjustable editor font size**: 12-24px in settings plus A−/A+ shortcuts in
281
+ the editor toolbar, remembered in localStorage
282
+ - **Floating AI assistant**: draggable, resizable, position-remembered dialog
283
+ with a full-context "editor" persona, impact analysis, live step cards and
284
+ conversation clearing
285
+ - **Grouped navigation with live badges**: creation / tools / database groups,
286
+ badges for chapter todos, foreshadows and journey progress
287
+ - **Scale hardening**: sharded book contexts, related-fact injection, batched
288
+ audit/impact analysis, slim status payload, volume folding and token
289
+ optimizations (summary+facts merged into one call, ~25% cheaper batches)
290
+ - **iOS-style frosted glass UI** with light & dark palettes
291
+ - Bookshelf, foreshadowing management, writing assets (genre / progression /
292
+ style templates / anti-AI rules / custom style engine), full-book export,
293
+ blurb & cover
294
+
295
+ ## What's New
296
+
297
+ This iteration hands the professional workflows over to the **AI Editor Agent**
298
+ and adds a batch of planning / inspiration / orchestration capabilities:
299
+
300
+ - 💬 **AI Editor Agent**: the in-book assistant renamed & upgraded — say one line
301
+ and it handles 拆书 (book teardown), 自动编辑 (auto-director), knowledge base
302
+ (add/search/list), plotlines, director todos, book audit, blurb, chapter
303
+ generate/review/revise, outline/bible/foreshadow/assets, export; write actions
304
+ are gated and convergence-guarded so it never loops or edits on its own.
305
+ - 📡 **Market radar inspiration**: scan public leaderboards (Fanqie / Qidian /
306
+ Jinjiang) signals / production foundation / creative brief → one-click
307
+ "generate inspiration from these signals" for market-fit book ideas.
308
+ - 🎬 **Auto-director**: from this book's volumes / plotlines / foreshadows / facts,
309
+ outputs next-arc nodes, pacing board, risks and fixes; adoptable into plotlines
310
+ or todos in one click.
311
+ - 📚 **Knowledge base / RAG**: free-form reference docs per book, retrieved and
312
+ injected per chapter at generation time for consistency.
313
+ - 📊 **Book analysis / teardown**: paste any text → selling points / structure /
314
+ lessons / risks.
315
+ - 💡 **Creative inspiration**: one idea/genre → several differentiated book ideas,
316
+ with "start a book this way".
317
+ - 🧭 **Advanced tools folded**: by default only the pipeline + core (assistant /
318
+ AI progress) + assets are shown; advanced tools collapse into a group, and the
319
+ dashboard gains a "Ask the AI Editor Agent" entry.
320
+ - 🃏 **Structured result cards**: tool results (teardown / director / audit /
321
+ knowledge list) render as cards right in the conversation.
322
+
323
+ ## Getting Started
324
+
325
+ ```sh
326
+ pnpm install # install dependencies
327
+ pnpm build # rebuild lib/
328
+ ```
329
+
330
+ Mount into the dsh web profile:
331
+
332
+ ```sh
333
+ dsh plugin --profile web add link:"<absolute path to this directory>"
334
+ ```
335
+
336
+ Or insert into `~/.dsh/profiles/web/cordis.patch.yml`:
337
+
338
+ ```yaml
339
+ - insert:
340
+ - id: novel-forge
341
+ name: '@waterwx/dsh-novel-forge'
342
+ ```
343
+
344
+ Restart dsh web, and the "Novel Forge" entry appears in the sidebar.
345
+
346
+ ## Workflow
347
+
348
+ One main pipeline **open a book build the settingplan chapters
349
+ compile chapter by chapter audit & finalize → export**. Everything happens
350
+ inside the "Novel Forge" panel in the sidebar.
351
+
352
+ ```mermaid
353
+ flowchart TD
354
+ A[1. Open a book<br/>paste outline / import docx] --> B[2. Build the setting<br/>story bible · world · assets]
355
+ B --> C[3. Plan chapters<br/>volume plan · chapter plan / continuation]
356
+ C --> D[4. Compile each chapter<br/>generate → summary·facts → review]
357
+ D --> E{Review passed?}
358
+ E -->|No| F[5. Revise loop<br/>revise per feedback / local edit / polish]
359
+ F --> D
360
+ E -->|Yes| G[6. Finalize book<br/>audit · sensitive scan · maintain]
361
+ G --> H[7. Export<br/>full book TXT / MD]
362
+
363
+ R1[AI Editor Agent<br/>teardown / director / KB / audit / blurb / todos] -.-> B
364
+ R1 -.-> C
365
+ R1 -.-> D
366
+ R1 -.-> G
367
+ R2[Plotlines · Roles · Progress] -.-> D
368
+ R2 -.-> G
369
+ ```
370
+
371
+ ```
372
+ ① Open a book (bookshelf → book wizard: paste outline text / import docx; book name auto-detected)
373
+
374
+ Build the setting (read-only outline extract story bible [characters/world/golden-finger rules/
375
+ red lines] → world [realms/regions/factions] → writing assets [genre/progression/templates/rules/style])
376
+
377
+ Plan chapters (volume plan → chapter plan: AI generates goal / plot points / payoff hook / ending
378
+ hook per chapter; with existing chapters it auto-enters "continuation mode" — reads the previous
379
+ chapter's ending + fact anchors, never restarts from scratch)
380
+
381
+ ④ Compile chapter by chapter (generate 3000-4000 chars → auto extract summary + fact ledger → auto AI review)
382
+
383
+ Revision loop (review failed one-click revise per feedback / select-targeted local edits / polish
384
+ to remove AI flavor → re-review; or use "✔ approve directly" as the author's final say)
385
+
386
+ Book-wide finalization (book audit [contradiction list] → sensitive-word scan → periodic maintenance
387
+ of chronicle/plotlines/role library/reviews)
388
+
389
+ ⑦ Export (full book as TXT / MD, with blurb & cover)
390
+ ```
391
+
392
+ **Side paths (usable at any stage)**: 💬 floating AI assistant (ask about the
393
+ setting / revise text / impact analysis), 🧵 plotline management (health check /
394
+ design plans), 👥 role library (AI extraction / knowledge tracking), 📊 floating
395
+ progress console (live task progress & activity log), multi-book bookshelf.
396
+
397
+ **Suggested cadence**: fully land steps ②③ first (the richer the setting, the
398
+ better the chapters); generate step one chapter or small batches at a time so
399
+ step can correct early; run the step ⑥ book audit every 20-30 chapters on long
400
+ serials to prevent setting drift.
401
+
402
+ ## Impact & Notes
403
+
404
+ Using this plugin has the following effects on your account, disk and LLM quota:
405
+
406
+ - **LLM quota consumption**: all AI operations (generate/review/polish/audit/
407
+ extract/review-backfill) call the LLM (default `deepseek-official` /
408
+ `deepseek-v4-flash`). Rough scale: one 3000-4000 char chapter 10-20k tokens
409
+ including reasoning; a review 2-3k tokens; book-wide audit and role
410
+ extraction are more expensive (tens of thousands of tokens). Batch operations
411
+ (multi-chapter generation, book audit, review backfill) consume quota
412
+ continuously prefer small batches.
413
+ - **Write guard**: the AI assistant only performs write actions (generate/revise/
414
+ delete chapters, change settings) when the author explicitly asks. If you are
415
+ just asking questions, it answers in prose and never modifies anything — casual
416
+ questions can never trigger chapter generation.
417
+ - **Concurrency safety**: plan/generate/review merge the latest on-disk settings
418
+ (bible/roles/plotlines/knowledge) before saving, so parallel windows never
419
+ clobber each other.
420
+ - **Data on disk**: each book owns an output directory (default `~/.dsh/novels/<book name>`, configurable in settings)
421
+ with per-chapter Markdown, `novel-project.json` project state, and
422
+ `novel-assistant.jsonl` assistant log; applying polish/rewrite drafts auto-backs-up
423
+ the original as `.bak.md`.
424
+ - **Settings persistence**: panel "Settings" changes (output dir/model/review
425
+ threshold etc.) are written to the `dsh-novel-forge` section of
426
+ `~/.dsh/settings.yaml`; UI preferences (theme/font size/panel width) live in
427
+ browser localStorage.
428
+ - **Token optimization**: generation and review use sharded contexts, related-fact
429
+ injection and merged summaries (~25% cheaper batches on long serials), but each
430
+ chapter is still bounded by the model context window — long settings are
431
+ retrieved on demand rather than injected in full.
432
+
433
+ ## Directory Layout
434
+
435
+ ```
436
+ src/ Plugin source (host half + browser half)
437
+ lib/ Build output (lib/index.js host / lib/client.js browser)
438
+ scripts/ Utility scripts
439
+ package.json Package definition (dsh.bundle.patch + dsh.client declaration)
440
+ cordis.patch.yml Profile mount patch
441
+ tsdown.config.ts Dual-face bundling config
442
+ ```
443
+
444
+ ## Data Locations
445
+
446
+ - Bookshelf: `~/.dsh/dsh-novel-forge-bookshelf.json`
447
+ - Each book owns an output directory (containing `novel-project.json` project state,
448
+ per-chapter Markdown, and polish backups `.bak.md`)
449
+ - AI assistant conversation log: `<output-dir>/novel-assistant.jsonl`
450
+
451
+ ## Limitations
452
+
453
+ - Generation consumes LLM API quota (provider/model default: `deepseek-official` /
454
+ `deepseek-v4-flash`)
455
+ - Chapter quality depends on outline completeness; batch generation is serial
456
+ - Settings (output directory, model, review threshold, etc.) are edited in the
457
+ panel's "Settings" tab and written to the `dsh-novel-forge` section of
458
+ `~/.dsh/settings.yaml`