@waterwx/dsh-novel-forge 0.1.0 → 1.0.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.
- package/README.md +51 -25
- package/cordis.patch.yml +1 -1
- package/lib/client.js +3456 -1316
- package/lib/client.js.map +1 -1
- package/lib/index.js +436 -37
- package/lib/index.js.map +1 -1
- package/lib/types/bookshelf.d.ts +2 -0
- package/lib/types/client/api.d.ts +32 -2
- package/lib/types/client/panel/AssetsTab.d.ts +6 -1
- package/lib/types/client/panel/NovelPanel.d.ts +1 -1
- package/lib/types/engine.d.ts +25 -6
- package/lib/types/protocol.d.ts +82 -0
- package/package.json +1 -13
- package/src/assistant.ts +24 -3
- package/src/bookshelf.ts +11 -0
- package/src/client/api.ts +38 -3
- package/src/client/panel/AssetsTab.tsx +132 -17
- package/src/client/panel/BookshelfBar.tsx +62 -8
- package/src/client/panel/NovelPanel.tsx +1341 -172
- package/src/client/panel/panel.module.css +863 -59
- package/src/engine.ts +235 -21
- package/src/protocol.ts +84 -0
- package/src/routes.ts +225 -8
package/README.md
CHANGED
|
@@ -11,13 +11,18 @@ Your personal AI novel-writing plugin for DSH: turn an outline into a complete n
|
|
|
11
11
|
|
|
12
12
|
| 中文 | English |
|
|
13
13
|
|---|---|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
14
|
+
| **创作工作流仪表盘**:主行动卡(推荐下一步)+ 创作旅程进度条 + 状态条 + 待办队列 + 资产健康 | **Workflow dashboard**: next-action hero card, journey progress bar, status strip, todo queue, asset health |
|
|
15
|
+
| **开书向导**:书架新建书时直接导入大纲(docx/粘贴),开书即建项目,书名自动识别 | **Book wizard**: create a book with its outline in one step — project is built immediately |
|
|
16
|
+
| **大纲只读化**:开书后大纲页只读展示;「更新大纲」可选仅改文本(保留进度)或重置项目重来 | **Read-only outline**: after opening a book the outline is read-only; update offers keep-progress or full reset |
|
|
17
|
+
| **章节计划结构化**:每章含 本章目标 / 剧情要点 / 爽点·钩子 / 结尾钩子 | **Structured chapter beats**: goal / plot points / payoff-hook / ending hook per chapter |
|
|
18
|
+
| **事实库 / 时间线**:每章自动抽取已确立事实,注入后续生成,保证长期一致 | **Fact ledger**: auto-extracted per-chapter facts injected into later chapters for consistency |
|
|
19
|
+
| **全书一致性质检**:LLM 扫描全本,输出矛盾清单(定位到章),一键去修订 | **Book audit**: LLM scans all chapters for contradictions, locates them, one-click to revise |
|
|
20
|
+
| **角色卡**:出场统计精确计算 + LLM 聚合当前状态,历史章节可回填事实库 | **Character cards**: precise appearance stats + LLM-aggregated status; backfill for old chapters |
|
|
21
|
+
| **润色/修订工作区**:左栏原文(选中即局部修订)+ 右栏指令/预览/应用,草稿制不覆盖原稿,自动备份 .bak | **Revision workspace**: editable original + selection-targeted local edits, draft-apply flow with auto-backup |
|
|
22
|
+
| **AI 助手悬浮窗**:可拖动、可拉大小、位置记忆,不占用工作台 | **Floating AI assistant**: draggable, resizable, position remembered |
|
|
23
|
+
| **分组导航 + 状态角标**:创作/工具/数据库分组,章节待办/伏笔/进度角标 | **Grouped nav + badges**: creation/tools/database groups with live badges |
|
|
24
|
+
| **iOS 风格毛玻璃 UI**(浅色/深色) | **iOS-style frosted glass UI** (light/dark) |
|
|
25
|
+
| **书架 / 伏笔管理 / 写作资产(题材·推进·写法·反AI规则·自定义引擎)/ 全本导出(TXT/MD)** | **Bookshelf / foreshadowing / writing assets / full-book export (TXT/MD)** |
|
|
21
26
|
|
|
22
27
|
## 快速开始 / Quick Start
|
|
23
28
|
|
|
@@ -78,6 +83,15 @@ pnpm install && pnpm build
|
|
|
78
83
|
dsh plugin --profile web add link:"<本目录绝对路径>"
|
|
79
84
|
```
|
|
80
85
|
|
|
86
|
+
## 写作流程 / Writing Pipeline
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
开书(导入大纲) → 设定圣经 → 卷计划 → 章节计划(结构化 beats)
|
|
90
|
+
→ 逐章生成(自动摘要 + 事实抽取 + AI 审稿)
|
|
91
|
+
→ 修订/润色(工作区对比 → 应用草稿)→ 全书质检 → 角色卡 → 导出
|
|
92
|
+
(旁路:伏笔管理 / 写作资产 / AI 助手悬浮窗 / 书架多书)
|
|
93
|
+
```
|
|
94
|
+
|
|
81
95
|
## 目录结构 / Directory Layout
|
|
82
96
|
|
|
83
97
|
```
|
|
@@ -92,7 +106,7 @@ tsdown.config.ts 双面打包配置 / dual-face bundling config
|
|
|
92
106
|
## 数据位置 / Data Locations
|
|
93
107
|
|
|
94
108
|
- 书架 / Bookshelf:`~/.dsh/dsh-novel-forge-bookshelf.json`
|
|
95
|
-
- 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown
|
|
109
|
+
- 每本书一个输出目录(含 `novel-project.json` + 各章 Markdown + 润色备份 `.bak.md`)/ each book owns an output directory
|
|
96
110
|
- AI 助手对话记录 / assistant log:`<输出目录>/novel-assistant.jsonl`
|
|
97
111
|
|
|
98
112
|
## 限制 / Limitations
|
|
@@ -107,27 +121,39 @@ tsdown.config.ts 双面打包配置 / dual-face bundling config
|
|
|
107
121
|
|
|
108
122
|
## English
|
|
109
123
|
|
|
110
|
-
# My Personal AI Novel Forge
|
|
124
|
+
# My Personal AI Novel Forge
|
|
111
125
|
|
|
112
|
-
This is
|
|
126
|
+
This is the working copy of the `dsh-novel-forge` plugin. All
|
|
113
127
|
source code, build artifacts, and configuration are included — install, build,
|
|
114
128
|
and mount it any time.
|
|
115
129
|
|
|
116
130
|
## Feature Overview
|
|
117
131
|
|
|
118
|
-
- **Workflow**:
|
|
119
|
-
|
|
120
|
-
- **
|
|
121
|
-
|
|
122
|
-
- **
|
|
123
|
-
|
|
124
|
-
- **
|
|
125
|
-
|
|
126
|
-
- **
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
- **Workflow dashboard**: next-action hero card with a reason, a 6-stage journey
|
|
133
|
+
progress bar, a status strip, a todo queue, and asset health
|
|
134
|
+
- **Book wizard**: create a book with its outline in one step — project is built
|
|
135
|
+
immediately and the title is inferred from the outline
|
|
136
|
+
- **Read-only outline**: after opening a book the outline page is read-only;
|
|
137
|
+
"Update outline" offers either keep-progress text update or full project reset
|
|
138
|
+
- **Structured chapter beats**: every planned chapter carries goal / plot points /
|
|
139
|
+
payoff-hook / ending hook sections
|
|
140
|
+
- **Fact ledger**: each chapter auto-extracts established facts (character state,
|
|
141
|
+
resources, relations, foreshadow landings); the latest 20 are injected into
|
|
142
|
+
later chapters to keep the long story consistent
|
|
143
|
+
- **Book audit**: one click scans all written chapters against the bible, fact
|
|
144
|
+
ledger and red lines, reporting located contradictions with one-click revision
|
|
145
|
+
- **Character cards**: appearance statistics are computed precisely from the
|
|
146
|
+
chapter bodies, status is LLM-aggregated; historical chapters can be backfilled
|
|
147
|
+
- **Revision workspace**: editable original on the left (select text for
|
|
148
|
+
targeted local edits), instruction + preview + apply/cancel on the right;
|
|
149
|
+
drafts never overwrite until applied, and applying auto-backs-up the original
|
|
150
|
+
- **Floating AI assistant**: draggable, resizable, position-remembered dialog —
|
|
151
|
+
chat while working in other tabs
|
|
152
|
+
- **Grouped navigation with live badges**: creation / tools / database groups,
|
|
153
|
+
badges for chapter todos, foreshadows and journey progress
|
|
154
|
+
- **iOS-style frosted glass UI** with light & dark palettes
|
|
155
|
+
- Bookshelf, foreshadowing management, writing assets (genre / progression /
|
|
156
|
+
style templates / anti-AI rules / custom style engine), full-book export
|
|
131
157
|
|
|
132
158
|
## Getting Started
|
|
133
159
|
|
|
@@ -166,8 +192,8 @@ tsdown.config.ts Dual-face bundling config
|
|
|
166
192
|
## Data Locations
|
|
167
193
|
|
|
168
194
|
- Bookshelf: `~/.dsh/dsh-novel-forge-bookshelf.json`
|
|
169
|
-
- Each book owns an output directory (containing `novel-project.json` project state
|
|
170
|
-
|
|
195
|
+
- Each book owns an output directory (containing `novel-project.json` project state,
|
|
196
|
+
per-chapter Markdown, and polish backups `.bak.md`)
|
|
171
197
|
- AI assistant conversation log: `<output-dir>/novel-assistant.jsonl`
|
|
172
198
|
|
|
173
199
|
## Limitations
|
package/cordis.patch.yml
CHANGED