@waterwx/dsh-novel-forge 0.1.0 → 1.1.0

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 (37) hide show
  1. package/README.md +67 -25
  2. package/cordis.patch.yml +1 -1
  3. package/lib/client.js +4563 -1093
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +1138 -92
  6. package/lib/index.js.map +1 -1
  7. package/lib/types/assets.d.ts +2 -2
  8. package/lib/types/assistant.d.ts +2 -0
  9. package/lib/types/bookshelf.d.ts +2 -0
  10. package/lib/types/client/api.d.ts +61 -2
  11. package/lib/types/client/locales.d.ts +24 -24
  12. package/lib/types/client/panel/AssetsTab.d.ts +6 -1
  13. package/lib/types/client/panel/CreateBookView.d.ts +9 -0
  14. package/lib/types/client/panel/NovelPanel.d.ts +1 -1
  15. package/lib/types/client/panel/ShelfView.d.ts +11 -0
  16. package/lib/types/client/panel/WorldTab.d.ts +10 -0
  17. package/lib/types/engine.d.ts +67 -6
  18. package/lib/types/index.d.ts +1 -1
  19. package/lib/types/protocol.d.ts +177 -0
  20. package/package.json +1 -13
  21. package/src/assets.ts +9 -7
  22. package/src/assistant.ts +152 -32
  23. package/src/bookshelf.ts +14 -0
  24. package/src/client/api.ts +80 -3
  25. package/src/client/locales.ts +24 -24
  26. package/src/client/panel/AssetsTab.tsx +139 -41
  27. package/src/client/panel/AssistantTab.tsx +136 -23
  28. package/src/client/panel/BookshelfBar.tsx +62 -8
  29. package/src/client/panel/CreateBookView.tsx +189 -0
  30. package/src/client/panel/NovelPanel.tsx +1834 -201
  31. package/src/client/panel/ShelfView.tsx +112 -0
  32. package/src/client/panel/WorldTab.tsx +202 -0
  33. package/src/client/panel/panel.module.css +1210 -59
  34. package/src/engine.ts +618 -29
  35. package/src/index.ts +1 -1
  36. package/src/protocol.ts +189 -1
  37. package/src/routes.ts +511 -14
package/README.md CHANGED
@@ -11,13 +11,23 @@ Your personal AI novel-writing plugin for DSH: turn an outline into a complete n
11
11
 
12
12
  | 中文 | English |
13
13
  |---|---|
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)** |
14
+ | **创作工作流仪表盘**:主行动卡(推荐下一步)+ 创作旅程进度条 + 状态条 + 待办队列 + 资产健康 | **Workflow dashboard**: next-action hero card, journey progress bar, status strip, todo queue, asset health |
15
+ | **书架首页**:书卡网格(封面/简介/进度)+ 开书向导独立页,进入工坊先选书 | **Bookshelf home**: book card grid with covers, blurbs and progress, plus a dedicated book-wizard page |
16
+ | **正文编辑 + AI 审查 + 保存**:章节工作区直接改文,审查草稿不落盘,保存即审稿(沿用报告不重复审) | **Edit AI check save**: edit chapter text, review the draft without persisting, save-with-review reuses the report |
17
+ | **按意见修订**:审稿未通过时一键按意见自动修订(指令自动预填 high 优先问题) | **Revise by review**: one click to revise with the review feedback pre-filled |
18
+ | **国风模块**:总纲 / 道藏 / 大世界 / 人物志 / 暗线 / 编年录 / 文戒 / 笔法帖 / 心法 | **Wuxia-flavored modules**: outline, story bible, world, characters, foreshadows, fact ledger, anti-AI rules, style templates, custom style |
19
+ | **规模化加固**:上下文分片、相关事实注入、质检/影响分析分批、status 瘦身、按卷折叠、token 优化(摘要+事实合并省 25%) | **Scale hardening**: sharded contexts, related-fact injection, batched audit/impact, slim status, volume folding, token optimizations |
20
+ | **开书向导**:书架新建书时直接导入大纲(docx/粘贴),开书即建项目,书名自动识别 | **Book wizard**: create a book with its outline in one step — project is built immediately |
21
+ | **大纲只读化**:开书后大纲页只读展示;「更新大纲」可选仅改文本(保留进度)或重置项目重来 | **Read-only outline**: after opening a book the outline is read-only; update offers keep-progress or full reset |
22
+ | **章节计划结构化**:每章含 本章目标 / 剧情要点 / 爽点·钩子 / 结尾钩子 | **Structured chapter beats**: goal / plot points / payoff-hook / ending hook per chapter |
23
+ | **事实库 / 时间线**:每章自动抽取已确立事实,注入后续生成,保证长期一致 | **Fact ledger**: auto-extracted per-chapter facts injected into later chapters for consistency |
24
+ | **全书一致性质检**:LLM 扫描全本,输出矛盾清单(定位到章),一键去修订 | **Book audit**: LLM scans all chapters for contradictions, locates them, one-click to revise |
25
+ | **角色卡**:出场统计精确计算 + LLM 聚合当前状态,历史章节可回填事实库 | **Character cards**: precise appearance stats + LLM-aggregated status; backfill for old chapters |
26
+ | **润色/修订工作区**:左栏原文(选中即局部修订)+ 右栏指令/预览/应用,草稿制不覆盖原稿,自动备份 .bak | **Revision workspace**: editable original + selection-targeted local edits, draft-apply flow with auto-backup |
27
+ | **AI 助手悬浮窗**:可拖动、可拉大小、位置记忆;「编辑老师」全量知情 + 影响分析 + 步骤卡片 + 思考计时 + 清空聊天 | **Floating AI assistant**: draggable, resizable, position remembered; full-context "editor" persona with impact analysis and live step cards |
28
+ | **分组导航 + 状态角标**:创作/工具/数据库分组,章节待办/伏笔/进度角标 | **Grouped nav + badges**: creation/tools/database groups with live badges |
29
+ | **iOS 风格毛玻璃 UI**(浅色/深色) | **iOS-style frosted glass UI** (light/dark) |
30
+ | **书架 / 伏笔管理 / 写作资产(题材·推进·写法·反AI规则·自定义引擎)/ 全本导出(TXT/MD)/ 卷首语与封面** | **Bookshelf / foreshadowing / writing assets / full-book export (TXT/MD) / blurb & cover** |
21
31
 
22
32
  ## 快速开始 / Quick Start
23
33
 
@@ -78,6 +88,15 @@ pnpm install && pnpm build
78
88
  dsh plugin --profile web add link:"<本目录绝对路径>"
79
89
  ```
80
90
 
91
+ ## 写作流程 / Writing Pipeline
92
+
93
+ ```
94
+ 开书(导入大纲) → 设定圣经 → 卷计划 → 章节计划(结构化 beats)
95
+ → 逐章生成(自动摘要 + 事实抽取 + AI 审稿)
96
+ → 修订/润色(工作区对比 → 应用草稿)→ 全书质检 → 角色卡 → 导出
97
+ (旁路:伏笔管理 / 写作资产 / AI 助手悬浮窗 / 书架多书)
98
+ ```
99
+
81
100
  ## 目录结构 / Directory Layout
82
101
 
83
102
  ```
@@ -92,7 +111,7 @@ tsdown.config.ts 双面打包配置 / dual-face bundling config
92
111
  ## 数据位置 / Data Locations
93
112
 
94
113
  - 书架 / Bookshelf:`~/.dsh/dsh-novel-forge-bookshelf.json`
95
- - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown)/ each book owns an output directory
114
+ - 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown + 润色备份 `.bak.md`)/ each book owns an output directory
96
115
  - AI 助手对话记录 / assistant log:`<输出目录>/novel-assistant.jsonl`
97
116
 
98
117
  ## 限制 / Limitations
@@ -107,27 +126,50 @@ tsdown.config.ts 双面打包配置 / dual-face bundling config
107
126
 
108
127
  ## English
109
128
 
110
- # My Personal AI Novel Forge (Standalone Copy)
129
+ # My Personal AI Novel Forge
111
130
 
112
- This is a **complete, standalone copy** of the `dsh-novel-forge` plugin. All
131
+ This is the working copy of the `dsh-novel-forge` plugin. All
113
132
  source code, build artifacts, and configuration are included — install, build,
114
133
  and mount it any time.
115
134
 
116
135
  ## Feature Overview
117
136
 
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)**
137
+ - **Workflow dashboard**: next-action hero card with a reason, a 6-stage journey
138
+ progress bar, a status strip, a todo queue, and asset health
139
+ - **Bookshelf home**: book card grid with covers, blurbs and progress; a
140
+ dedicated book-wizard page opens a new book with its outline in one step
141
+ - **Edit AI check save**: edit chapter text in the workspace, review the
142
+ draft without persisting, and save-with-review reuses the report (never
143
+ double-review); one-click "revise by review" pre-fills the feedback
144
+ - **Wuxia-flavored modules**: 总纲 (outline), 道藏 (story bible), 大世界 (world),
145
+ 人物志 (characters), 暗线 (foreshadows), 编年录 (fact ledger), 文戒 (anti-AI
146
+ rules), 笔法帖 (style templates), 心法 (custom style)
147
+ - **Read-only outline**: after opening a book the outline page is read-only;
148
+ "Update outline" offers either keep-progress text update or full project reset
149
+ - **Structured chapter beats**: every planned chapter carries goal / plot points /
150
+ payoff-hook / ending hook sections
151
+ - **Fact ledger**: each chapter auto-extracts established facts (character state,
152
+ resources, relations, foreshadow landings); the latest 20 are injected into
153
+ later chapters to keep the long story consistent
154
+ - **Book audit**: one click scans all written chapters against the bible, fact
155
+ ledger and red lines, reporting located contradictions with one-click revision
156
+ - **Character cards**: appearance statistics are computed precisely from the
157
+ chapter bodies, status is LLM-aggregated; historical chapters can be backfilled
158
+ - **Revision workspace**: editable original on the left (select text for
159
+ targeted local edits), instruction + preview + apply/cancel on the right;
160
+ drafts never overwrite until applied, and applying auto-backs-up the original
161
+ - **Floating AI assistant**: draggable, resizable, position-remembered dialog
162
+ with a full-context "editor" persona, impact analysis, live step cards and
163
+ conversation clearing
164
+ - **Grouped navigation with live badges**: creation / tools / database groups,
165
+ badges for chapter todos, foreshadows and journey progress
166
+ - **Scale hardening**: sharded book contexts, related-fact injection, batched
167
+ audit/impact analysis, slim status payload, volume folding and token
168
+ optimizations (summary+facts merged into one call, ~25% cheaper batches)
169
+ - **iOS-style frosted glass UI** with light & dark palettes
170
+ - Bookshelf, foreshadowing management, writing assets (genre / progression /
171
+ style templates / anti-AI rules / custom style engine), full-book export,
172
+ blurb & cover
131
173
 
132
174
  ## Getting Started
133
175
 
@@ -166,8 +208,8 @@ tsdown.config.ts Dual-face bundling config
166
208
  ## Data Locations
167
209
 
168
210
  - 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)
211
+ - Each book owns an output directory (containing `novel-project.json` project state,
212
+ per-chapter Markdown, and polish backups `.bak.md`)
171
213
  - AI assistant conversation log: `<output-dir>/novel-assistant.jsonl`
172
214
 
173
215
  ## Limitations
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'