dsh-novel-writer 4.3.1 → 5.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.
package/README.en.md CHANGED
@@ -1,6 +1,4 @@
1
- # 📚 dsh-novel-writer — on-device style checkup for novel writers
2
-
3
- > 🌐 **[Project site](https://siweina.github.io/dsh-novel-writer/)** · [Technical docs — implementation details, formulas and limits for all 16 tools](https://siweina.github.io/dsh-novel-writer/tools/)
1
+ # 📚 dsh-novel-writer — an on-device writing workstation for novel writers
4
2
 
5
3
  English | [中文](./README.md)
6
4
 
@@ -12,21 +10,41 @@ English | [中文](./README.md)
12
10
  [![GitHub stars](https://img.shields.io/github/stars/siweina/dsh-novel-writer.svg?style=flat-square&color=orange)](https://github.com/siweina/dsh-novel-writer/stargazers)
13
11
  [![siweina/dsh-novel-writer MCP server](https://glama.ai/mcp/servers/siweina/dsh-novel-writer/badges/score.svg)](https://glama.ai/mcp/servers/siweina/dsh-novel-writer)
14
12
 
15
- **16 tools that turn "my writing drifted" into numbers you can act on.**
16
- Sentence, emotion and style-baseline analysis all run **on your machine**: a 24MB Chinese model ships with the package,
13
+ **18 tools covering the whole loop: gather inputs before you write → quantify & self-check → work a prioritised fix list → audit the cross-chapter structure.**
14
+ One call before writing gathers **16 inputs** (missing one is how style drift starts); after you write, you don't just get numbers — you get a **priority-ordered to-do list** (line-anchored original text, current vs. target values, reference passages, **direction only, never ghost-written prose**); across chapters you can finally see "the thread snapped, a character vanished, a hook was forgotten".
15
+ Sentence, emotion and semantic analysis all run **on your machine**: a 24MB Chinese model ships with the package,
17
16
  **zero API cost, your manuscript never leaves the device**. Built for DeepSeek Harness (DSH); the same engine is also
18
17
  exposed as a **stdio MCP server** for Claude Desktop / Cursor.
19
18
 
20
- [Install](#install) · [60-second start](#60-second-start) · [See the output](#see-the-output) · [The 16 tools](#provided-tools-16) · [MCP server](#mcp-server-usable-outside-dsh)
19
+ [Install](#install) · [The writing loop](#the-writing-loop-end-to-end) · [60-second start](#60-second-start) · [See the output](#see-the-output) · [The 18 tools](#provided-tools-18) · [MCP server](#mcp-server-usable-outside-dsh)
21
20
 
22
21
  ---
23
22
 
23
+ ## The writing loop (end to end)
24
+
25
+ | Step | What you say | Tool | What you get |
26
+ |---|---|---|---|
27
+ | ① **Gather** | "gather material for the next chapter" | `novel_chapter_brief` | **One call, 16 inputs**: previous chapter's closing text (hand-off) / its hook / this chapter's outline direction / relevant character cards / open plot threads with **how long they've been open** / worldview wording rules + banned words / six-metric baseline / reference passages & sentence skeletons / previous chapter's self-check / avoid-list / writing checklist — anything missing is reported in `degraded` with the reason and the fix |
28
+ | ② **Write** | "write chapter N" | `novel_new_chapter` · `write` | The new chapter file (with the baseline μ attached and the reference pack); the anchors are for **calibrating feel only** (never copy the skeletons), the numbers are for verifying afterwards |
29
+ | ③ **Self-check** | "check chapter N" | `novel_style_check` · `novel_sentence_analysis` | Similarity + deviation list + six-metric comparison (in band ✓ / out of band ⚠). **Only fix when the deviation is obvious (≥2× tolerance) or the passage genuinely reads wrong** — a single dimension drifting slightly is normal variance, don't rewrite to please the numbers |
30
+ | ④ **Revise** | "turn chapter N into a fix list" | `novel_fix_plan` | A to-do list sorted by severity → effort → line (capped at **12 items** by default): line-anchored text, current/target values, anchors, rewrite direction; **work it in batches** (merge same-paragraph items) and run `verify` at most once |
31
+ | ⑤ **Audit** | "show me the book's structure" | `novel_plot { action: "graph" }` | Plot-thread spans / consecutive character absences / largest thread gap / timeline order / outline-vs-body drift |
32
+
33
+ > **Everything local, read-only by default**: the brief and the structure view **write no files at all**; the fix desk writes only its own list file, **never touches your prose and never writes prose for you**; semantic search and emotion analysis cost zero tokens.
34
+
35
+ > **Token-saving mode (new in v5.1.0)**: the sidebar's **Lean workflow** switch (or `novel_sentence_config` with `leanWorkflow=true`) keeps exactly one rule — **call tools on demand**: no automatic self-checks, no re-checking fix lists, no registry updates; report tools return the brief form unless you explicitly pass `brief` (style report: 181 chars vs 1725 for the full one).
36
+ >
37
+ > **v5.1.0 cost & feel fixes**: v5.0.0 had turned "always run a self-check after writing + the closing trio" and "mark every item + verify repeatedly" into mandatory checklists — one chapter went from 3 tool calls to 6, and revising took 30+. Together with "build sentences to the skeletons" and "fix any out-of-band dimension", that made prose stiff. This release makes all of it **on demand**: a chapter now takes **2 calls and up**, the fix-list cap dropped **40 → 12** with only the worst paragraph per dimension, and it now says plainly that **out-of-band ≠ defect** (keep lyrical / psychological / elliptical passages when they read fine — `mark` them `skip`).
38
+
24
39
  ## What problem does it solve
25
40
 
26
41
  | Your pain | What you get here |
27
42
  |---|---|
28
43
  | "This passage I just wrote doesn't sound like me" | **Six-metric style baseline**: μ±σ of the original measured per chapter across syntactic complexity / modifier density / abstraction / action density / hedging / gap index; a new chapter is compared dimension by dimension and flagged ⚠ when out of band |
29
44
  | "The AI says my style changed but can't say where" | **Style check**: similarity score + a deviation list (which sentence types increased, how far sentence length drifted, whether the dominant emotion changed) |
45
+ | "I have to poke six or seven tools before writing, and I still miss one" | **Chapter brief**: 16 inputs in one call; whatever can't be found is explained in `degraded` — **missing an input is the number one source of style drift and setting contradictions** |
46
+ | "I can see the chapter has problems but not which one to fix first" | **Fix plan**: to-dos sorted by severity → effort → line, each with line-anchored text, current vs. target values, a reference passage and a rewrite direction; re-checkable in three states after editing |
47
+ | "A thread snapped, a character vanished, a hook was forgotten — and it only shows up 50 chapters later" | **Structure view**: cross-chapter plot-thread spans, consecutive character-absence intervals, largest thread gap, timeline order, and outline-vs-body overlap |
30
48
  | "Analysing a novel means paying for API calls" | Semantic search and emotion analysis run **fully local** — zero token cost |
31
49
  | "I planted a plot thread and forgot to pay it off" | **Plot registry**: add / list / scan / done, automatically recording which chapters mention each thread |
32
50
  | "Character settings contradict each other" | **Five settings tables + continuity audit** (bridge / OOC / outline drift) |
@@ -57,7 +75,14 @@ appears in the sidebar.
57
75
  mkdir -p novels/my-novel # put chapter files inside (第01章.md, 第02章.md, …)
58
76
  ```
59
77
 
60
- Then just ask in chat: **"run novel_style_report on my novel"** and you get:
78
+ Then ask, in order (this is one complete chapter):
79
+
80
+ 1. **"gather material for the next chapter"** → `novel_chapter_brief` returns all 16 inputs in one call (it does the work of 6–8 tools, and **cannot miss one**)
81
+ 2. **"write chapter 7"** → write by the returned anchors and skeletons; `novel_new_chapter` attaches the baseline μ
82
+ 3. **"check chapter 7"** → `novel_style_check` returns similarity, a deviation list and the six-metric comparison
83
+ 4. **"turn chapter 7 into a fix list"** → `novel_fix_plan` returns the prioritised to-dos; run `verify` afterwards to re-check the three states
84
+
85
+ To just look at the baseline first, ask **"run novel_style_report on my novel"** and you get:
61
86
 
62
87
  ```text
63
88
  全书 1329 字:六维基线 μ=句法复杂度:2.3 修饰密度:35.6 抽象度:0.5 动作密度:101.7 不确定性:2.1 留白指数:7.0
@@ -68,6 +93,38 @@ Then just ask in chat: **"run novel_style_report on my novel"** and you get:
68
93
 
69
94
  ## See the output
70
95
 
96
+ **Chapter brief** (`novel_chapter_brief`, one call before writing):
97
+
98
+ ```text
99
+ 目标:第 8 章《(无标题)》(尚未创建,文件名推导为 第08章.md)
100
+
101
+ 【上一章结尾原文·承接口】…(previous chapter's last 300 / 600 chars, per budget)
102
+ 【待回收伏笔】
103
+ - [mu5kjla…] 琥珀色齿轮怀表的来历与停摆的指针(high|第 1 章埋下,已过 6 章)
104
+ 【相关人物】- 林昭:守码头的女人,父亲失踪后回到旧宅
105
+ 【世界观用语】欧式中世纪沿海城邦;点烛不烧香|禁用:上香、烧香、时辰、老夫
106
+ 【风格基线】complexity μ=2.42 modifierDensity μ=22.2 abstractDensity μ=10.06 …
107
+ 【原著锚段·照这个味道写】[对话] … [心理] …
108
+ 【上一章自检】第 7 章六维对照:全部维度在容差带内 ✓
109
+ 【本章禁用清单】- 禁词:上香(建议改用:点烛)
110
+ 【开写清单】□ 先读锚段再动笔 □ 承接上一章结尾 □ …(共 8 步)
111
+ 【降级/提示】- 钩子记录里没有第 7 章的钩子(上一章钩子未回填)
112
+ ```
113
+
114
+ **Fix plan** (`novel_fix_plan`, diagnostics turned into an ordered to-do list):
115
+
116
+ ```text
117
+ 改稿台:共 13 项待办(严重度降序 → 难度升序)。抽象度过高 ×3、衔接缺失 ×1、禁用词 ×3、语用不符 ×5、句式偏离 ×1。
118
+ 备注:留白指数 虽出带但差值 8.36 < 门槛 12,已按「无量级差异」忽略 ← the absolute-magnitude gate: no false positives
119
+
120
+ - [抽象度过高] 严重度 5 / 难度 2(第 5 行)
121
+ id:fix-abstract-5-c2c156d4
122
+ 现状:abstractDensity 47.9 目标:0.55~6.95
123
+ 原句:林昭大概说不清那种感觉。她隐隐觉得…
124
+ 方向:抽象度偏离:全章 47.9(基线 3.75,偏差 +1177.3%),本段 74.38。这句抽象词过密,改成具体动作或物件。
125
+ 锚段:林昭把它捏在掌心,翻过来看背面。背面刻着一行小字,被磨得只剩半边。她认出了父亲的名字。
126
+ ```
127
+
71
128
  **Style check** (new chapter vs. book baseline):
72
129
 
73
130
  ```text
@@ -94,7 +151,7 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
94
151
  | Cost | **0 (local inference)** | Billed per token | Self-hosted |
95
152
  | Purpose-built for Chinese fiction | **Yes** | Generic | No |
96
153
  | Style baseline (μ±σ) | **Yes** | Rare | No |
97
- | DSH integration | **16 tools + sidebar toggles** | None | None |
154
+ | DSH integration | **18 tools + sidebar toggles** | None | None |
98
155
  | Usable without DSH | **Yes (MCP)** | Yes | You wrap it yourself |
99
156
 
100
157
  > **A note for non-Chinese users**: this plugin is designed for analysing and writing Chinese fiction — the sentence-pattern,
@@ -106,22 +163,23 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
106
163
 
107
164
  ## Features
108
165
 
109
- 1. **Style portrait report** (`novel_style_report`): 6-dimension measurement — style fingerprint / high-frequency lexicon / genre-theme / emotion quantification / 12-axis vibe spectrum / semantic style distance. **Measurement-judgment separation**: the plugin only reports numbers, never labels; AI judgment can be saved back to `.novel-writer/style-reports/` for consistent continuation writing.
110
- 2. **12-axis vibe spectrum**: nightmare / angst / heartwarming / fluff / tearjerker / dark / mystery / blaze / absurd / lonesome / aesthetic / sensual — with traceable evidence, 0 token.
111
- 3. **Local semantic engine**: bge-small-zh Chinese model (24MB, shipped with the plugin) local CPU inference — `novel_semantic_search` finds semantically related passages with natural language (with chapter location), semantic style comparison, semantic implicit emotion; lazy loading + graceful fallback.
112
- 4. **Sentence-pattern analysis**: 9 categories, arrangement patterns, rhythm, emotion curve, style fingerprint + guidance, with cache & report export.
113
- 5. **Emotion purification & quantification**: strong/weak emotion-word grading, pollution detection, caveat warning + AI re-verification; Valence sliding window → variance V / delta Δ / conflict index C + implicit imagery carriers.
114
- 6. **Worldview & pragmatics detection**: auto cultural-baseline detection with confidence; speechStyle title/honorifics/rituals/tone norms; genre & theme + webnovel signals.
115
- 7. **Writing toolkit**: plot tracking / five settings tables (characters·locations·items·timeline·worldview) / chapter summaries / continuity audit / batch import / style check / continuation writing.
116
- 8. **Per-tool UI toggles**: 「写作助手功能」 ("Writing Assistant") sidebar panel (master + grouped tool toggles + feature toggles), plain-language labels, data-dir usage & semantic-engine status display.
117
- 9. **Style Baseline**: Six writing metrics (syntactic complexity / modifier density / abstraction / action density / hedging / gap index) + per-chapter μ±σ baseline band; `novel_style_report` outputs the band, `novel_style_check` compares new chapters (in-band ✓ / out-of-band ⚠); per-metric ±% tolerance configurable in the sidebar (**recommended = 1.5× σ of the book's chapter variance**, rounded, clamped to ±10%~100%; leave blank to use recommended) — free theme, writing style kept inside the band.
118
- 10. **Writing sentinels**: `novel_continuity_check` extended — ①**bridge check** (`chapter`: time jumps / semantic distance / character continuity / hook handoff, with quoted evidence) ②**OOC check** (`ooc`: per-character emotion baseline deviation) ③**outline drift** (`outline`: direction vs body keyword overlap); **brief mode** for report tools.
119
- 11. **Original mode & creation files**: fill in creation settings in the sidebar (worldview/characters/forbidden/main conflict/genre/extras, blank = model decides, per-book profile library); novel_outline maintains creation files (bible/characters/outline/hooks/status), enforcing the bible → outline → hook chain with dynamic batches (10→20→30 chapters) to prevent plot jumps and OOC.
120
- 12. **Experience & stats**: main panel **library stats** (per-book chapters/total chars/7-day active chars, 🔥 green), **🎬 demo** (built-in sample, no files, runs the 6-dim baseline), **📊 report history** (analysis/style-reports browsing); actionable error hints; slimmer tool descriptions.
166
+ 1. **The writing-desk trio**: `novel_chapter_brief` (**chapter brief**) — **one call** before you start writing gathers every input (previous-chapter hand-off / chapter direction / relevant characters / open plot threads / wording rules / style baseline / anchors & skeletons / avoid-list / checklist; two `budget` modes: compact / full); anything unavailable lands in `degraded` with the reason; read-only, writes nothing. `novel_fix_plan` (**fix plan**) — turns style diagnostics into a priority-ordered to-do list (line-anchored original text + current vs. target values + reference passages + rewrite direction) with `plan` / `verify` / `mark` and a three-state re-check, **direction only, never generates prose**. `novel_plot { action: "graph" }` (**structure view**) — plot-thread spans / consecutive character absences / thread gaps / timeline order / outline-vs-body overlap. Plus **scene-scoped prompts** (general / writing / revising / auditing / setup; `general` is the old behaviour).
167
+ 2. **Style portrait report** (`novel_style_report`): 6-dimension measurement — style fingerprint / high-frequency lexicon / genre-theme / emotion quantification / 12-axis vibe spectrum / semantic style distance. **Measurement-judgment separation**: the plugin only reports numbers, never labels; AI judgment can be saved back to `.novel-writer/style-reports/` for consistent continuation writing.
168
+ 3. **12-axis vibe spectrum**: nightmare / angst / heartwarming / fluff / tearjerker / dark / mystery / blaze / absurd / lonesome / aesthetic / sensual — with traceable evidence, 0 token.
169
+ 4. **Local semantic engine**: bge-small-zh Chinese model (24MB, shipped with the plugin) local CPU inference — `novel_semantic_search` finds semantically related passages with natural language (with chapter location), semantic style comparison, semantic implicit emotion; lazy loading + graceful fallback.
170
+ 5. **Sentence-pattern analysis**: 9 categories, arrangement patterns, rhythm, emotion curve, style fingerprint + guidance, with cache & report export.
171
+ 6. **Emotion purification & quantification**: strong/weak emotion-word grading, pollution detection, caveat warning + AI re-verification; Valence sliding window → variance V / delta Δ / conflict index C + implicit imagery carriers.
172
+ 7. **Worldview & pragmatics detection**: auto cultural-baseline detection with confidence; speechStyle title/honorifics/rituals/tone norms; genre & theme + webnovel signals.
173
+ 8. **Writing toolkit**: plot tracking / five settings tables (characters·locations·items·timeline·worldview) / chapter summaries / continuity audit / batch import / style check / continuation writing.
174
+ 9. **Per-tool UI toggles**: 「写作助手功能」 ("Writing Assistant") sidebar panel (master + grouped tool toggles + feature toggles + prompt mode/scene/**lean workflow**), plain-language labels, data-dir usage & semantic-engine status display.
175
+ 10. **Style Baseline**: Six writing metrics (syntactic complexity / modifier density / abstraction / action density / hedging / gap index) + per-chapter μ±σ baseline band; `novel_style_report` outputs the band, `novel_style_check` compares new chapters (in-band ✓ / out-of-band ⚠); per-metric ±% tolerance configurable in the sidebar (**recommended = 1.5× σ of the book's chapter variance**, rounded, clamped to ±10%~100%; leave blank to use recommended) — free theme, writing style kept inside the band.
176
+ 11. **Writing sentinels**: `novel_continuity_check` extended — ①**bridge check** (`chapter`: time jumps / semantic distance / character continuity / hook handoff, with quoted evidence) ②**OOC check** (`ooc`: per-character emotion baseline deviation) ③**outline drift** (`outline`: direction vs body keyword overlap); **brief mode** for report tools.
177
+ 12. **Original mode & creation files**: fill in creation settings in the sidebar (worldview/characters/forbidden/main conflict/genre/extras, blank = model decides, per-book profile library); novel_outline maintains creation files (bible/characters/outline/hooks/status), enforcing the bible → outline → hook chain with dynamic batches (10→20→30 chapters) to prevent plot jumps and OOC.
178
+ 13. **Experience & stats**: main panel **library stats** (per-book chapters/total chars/7-day active chars, 🔥 green), **🎬 demo** (built-in sample, no files, runs the 6-dim baseline), **📊 report history** (analysis/style-reports browsing); actionable error hints; slimmer tool descriptions.
121
179
 
122
180
  ---
123
181
 
124
- ## Provided Tools (16)
182
+ ## Provided Tools (18)
125
183
 
126
184
  | Tool | Description |
127
185
  |------|-------------|
@@ -132,21 +190,23 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
132
190
  | `novel_new_chapter` | Create new chapter file |
133
191
  | `novel_import` | Batch import manuscripts |
134
192
  | `novel_sentence_analysis` | Sentence-pattern analysis |
135
- | `novel_sentence_config` | View/set tool & feature toggles |
193
+ | `novel_sentence_config` | View/set tool & feature toggles (incl. prompt scene) |
136
194
  | `novel_style_check` | Style check (rule + semantic) |
137
195
  | `novel_style_report` | **Style portrait report** (6-dim measurement) |
138
- | `novel_plot` | Plot/foreshadowing tracker |
196
+ | `novel_plot` | Plot/foreshadowing tracker; `action: "graph"` structure view (plot-thread spans / consecutive character absences / thread gaps / timeline order / outline-vs-body overlap) |
139
197
  | `novel_settings` | Settings management (+worldview) |
140
198
  | `novel_summary` | Chapter summaries |
141
199
  | `novel_continuity_check` | Continuity audit + **bridge/OOC/outline sentinels** |
142
200
  | `novel_semantic_search` | Semantic search (local embedding, 0 token) |
143
201
  | `novel_outline` | **Creation-file management** (bible/characters/outline/hooks/status) |
202
+ | `novel_chapter_brief` | **Chapter brief** — one call before writing gathers everything (previous-chapter hand-off / chapter direction / characters / open threads / wording rules / style baseline / anchors & skeletons / avoid-list / checklist) |
203
+ | `novel_fix_plan` | **Fix plan** — turns style diagnostics into a priority-ordered to-do list (line anchors + reference passages), re-checkable after edits; **direction only, never generates prose** |
144
204
 
145
205
  ---
146
206
 
147
207
  ## MCP server (usable outside DSH)
148
208
 
149
- The package ships a **stdio MCP server** (`mcp/server.mjs`) that exposes all 16 tools to any MCP client,
209
+ The package ships a **stdio MCP server** (`mcp/server.mjs`) that exposes all 18 tools to any MCP client,
150
210
  e.g. Claude Desktop or Cursor. **It runs as a local process on your own machine — no server, no network, no daemon.**
151
211
 
152
212
  ```bash
@@ -188,7 +248,7 @@ start the server with `--allow-external-src`. Details: [mcp/README.md](./mcp/REA
188
248
 
189
249
  ## Data Directory
190
250
 
191
- Under `<library-root>/.novel-writer/`: `plots` / `settings` / `summaries` / `analysis` / `audits` / `embedding` / `style-reports`.
251
+ Under `<library-root>/.novel-writer/`: `plots` / `settings` / `summaries` / `analysis` / `audits` (continuity audits + fix-plan lists) / `embedding` / `style-reports`.
192
252
 
193
253
  ---
194
254
 
package/README.md CHANGED
@@ -1,6 +1,4 @@
1
- # 📚 dsh-novel-writer — 给网文作者的本地章节体检
2
-
3
- > 🌐 **[在线主页](https://siweina.github.io/dsh-novel-writer/)** · [完整技术文档(16 个工具的实现细节、公式与约束)](https://siweina.github.io/dsh-novel-writer/tools/)
1
+ # 📚 dsh-novel-writer — 给网文作者的本地写作工作台
4
2
 
5
3
  [English](./README.en.md) | 中文
6
4
 
@@ -12,20 +10,40 @@
12
10
  [![GitHub stars](https://img.shields.io/github/stars/siweina/dsh-novel-writer.svg?style=flat-square&color=orange)](https://github.com/siweina/dsh-novel-writer/stargazers)
13
11
  [![siweina/dsh-novel-writer MCP server](https://glama.ai/mcp/servers/siweina/dsh-novel-writer/badges/score.svg)](https://glama.ai/mcp/servers/siweina/dsh-novel-writer)
14
12
 
15
- **16 个工具,把"文风跑偏"变成可量化的数字。**
16
- 句式 / 情感 / 风格基线全部**在本地算**:24MB 中文模型随包分发,**零 API 花费、正文不出本机**。
13
+ **18 个工具,覆盖「动笔前取材料 → 写完量化自检 → 改稿按优先级复测 → 跨章结构体检」整条流程。**
14
+ 动笔前**一次调用取齐 16 项材料**(漏读一样就漂移);改稿不再只丢给你一堆数字,而是**按严重度排好的待办**(带原句行号、当前值与目标值、原著锚段,**只给方向不代写**);跨章层面能查「线断了、人丢了、伏笔忘了」。
15
+ 句式 / 情感 / 语义全部**在本地算**:24MB 中文模型随包分发,**零 API 花费、正文不出本机**。
17
16
  为 DeepSeek Harness(DSH)打造;同一套能力也可作为 **MCP 服务器**给 Claude Desktop / Cursor 使用。
18
17
 
19
- [安装](#安装) · [60 秒上手](#60-秒上手) · [看看输出](#看看输出长什么样) · [16 个工具](#提供的工具16-个) · [MCP 服务器](#mcp-服务器非-dsh-用户也能用)
18
+ [安装](#安装) · [写作流程](#写作流程一条能走完的闭环) · [60 秒上手](#60-秒上手) · [看看输出](#看看输出长什么样) · [18 个工具](#提供的工具18-个) · [MCP 服务器](#mcp-服务器非-dsh-用户也能用)
20
19
 
21
20
  ---
22
21
 
22
+ ## 写作流程(一条能走完的闭环)
23
+
24
+ | 步骤 | 你说什么 | 用哪个工具 | 拿到什么 |
25
+ |---|---|---|---|
26
+ | ① **取材料** | 「给下一章取材料」 | `novel_chapter_brief` | **一次调用**取齐 16 项输入:上一章结尾原文(承接口)/ 上一章钩子 / 本章大纲方向 / 相关人物卡 / 待回收伏笔(含**埋了多久**)/ 世界观用语规范与禁词 / 六维基线 / 原著锚段与句式骨架 / 上一章自检结论 / 禁用清单 / 开写清单——缺哪项、为什么、怎么补写在 `degraded` 里 |
27
+ | ② **动笔** | 「写第 N 章」 | `novel_new_chapter` · `write` | 新章文件(自动附基线 μ 摘要与原著锚包);锚段只用来**校准语感**(不照骨架造句),数字只做事后校验 |
28
+ | ③ **自检** | 「自检这一章」 | `novel_style_check` · `novel_sentence_analysis` | 相似度 + 偏差清单 + 六维对照(带内 ✓ / 出带 ⚠)。**只有偏离明显(≥2 倍容差)或读起来确实别扭时才改**——单一维度轻微出带属正常波动,不要为对齐数字改文 |
29
+ | ④ **改稿** | 「把这章排成改稿清单」 | `novel_fix_plan` | 按「严重度 → 难度 → 行号」排序的待办(默认上限 **12 条**),每条带原句行号、当前值/目标值、锚段与改写方向;**分批改**(同段同类合并),改完最多 `verify` 一次 |
30
+ | ⑤ **跨章体检** | 「看看全书结构」 | `novel_plot { action: "graph" }` | 伏笔埋设跨度 / 人物连续缺席区间 / 剧情线最大空档 / 时间线顺序 / 大纲方向与正文的偏离 |
31
+
32
+ > **全程本地、只读优先**:开写包与结构视图**不写任何文件**;改稿台只写自己的清单文件、**从不改正文,也不代写正文**;语义检索与情感分析零 token。
33
+
34
+ > **省 token 模式(v5.1.0 新增)**:侧边栏「精简工作流」开关(或 `novel_sentence_config` 传 `leanWorkflow=true`)打开后只保留一条原则——**工具按需调用**:不主动跑自检、不复测清单、不登记伏笔/钩子/摘要;报告类工具未显式传 `brief` 时默认走精简输出(风格画像实测 181 字符 vs 完整 1725 字符)。
35
+ >
36
+ > **v5.1.0 成本与手感修复**:v5.0.0 曾把「写完必须自检 + 收尾三件」「改稿逐条 mark + 反复 verify」写成必做清单,一章从 3 次调用涨到 6 次、改稿要 30+ 次;同时"照骨架造句"与"任一维度出带必改"会让文章越改越僵。本版全部改回**按需**:写一章 **2 次调用起**,改稿清单上限 **40 → 12 条**、同一维度只报最严重的 1 段,并明确了**出带不等于缺陷**(抒情/心理/留白段读起来不别扭就保留,可用 `mark` 标 `skip`)。
37
+
23
38
  ## 它解决什么问题
24
39
 
25
40
  | 你的困扰 | 这里给的答案 |
26
41
  |---|---|
27
42
  | "我续写的这段,读起来不像我自己写的" | **文笔六维基线**:从句法复杂度 / 修饰密度 / 抽象度 / 动作密度 / 不确定性 / 留白指数六个维度算出原著的 μ±σ,新章逐维对照,出带标 ⚠ |
28
43
  | "AI 说文风变了,但说不清哪儿变了" | **风格自检**:相似度 + 偏差清单(哪类句式多了、句长偏了多少、主导情绪有没有换) |
44
+ | "动笔前要翻六七个工具,还老漏读一样" | **开写包**:一次调用取齐 16 项材料;取不到的在 `degraded` 里说明缺什么、怎么补——**漏读正是文风漂移与设定矛盾的头号来源** |
45
+ | "知道这章有问题,但不知道先改哪句" | **改稿台**:按「严重度 → 难度 → 行号」排好待办,每条给原句行号 / 当前值与目标值 / 原著锚段 / 改写方向;改完可三态复测 |
46
+ | "线断了、人丢了、伏笔忘了——写到后面才崩" | **结构视图**:跨章算出伏笔埋设跨度、人物连续缺席区间、剧情线最大空档、时间线顺序、大纲与正文的偏离 |
29
47
  | "分析小说要花钱调 API" | 语义检索与情感分析**全本地推理**,零 token 花费 |
30
48
  | "伏笔埋了忘了收" | **伏笔登记表**:add / list / scan / done,自动记录每条伏笔在哪些章被提到 |
31
49
  | "人物设定前后打架" | **设定五张表 + 连贯性审计**(衔接 / OOC / 大纲走偏三件套) |
@@ -55,7 +73,14 @@ dsh plugin --profile web add github:siweina/dsh-novel-writer#main
55
73
  mkdir -p novels/我的小说 # 把章节文件放进去(第01章.md、第02章.md …)
56
74
  ```
57
75
 
58
- 然后在对话里说:**"用 novel_style_report 给我的小说做一次风格画像"**,你会拿到:
76
+ 然后在对话里依次说(这就是完整的一章):
77
+
78
+ 1. **「给下一章取材料」** → `novel_chapter_brief` 一次给齐 16 项输入(等于替你跑了 6~8 个工具,且**不会漏读**)
79
+ 2. **「写第 7 章」** → 照返回的锚段与骨架写;`novel_new_chapter` 建文件时还会附上基线 μ
80
+ 3. **「自检第 7 章」** → `novel_style_check` 给出相似度、偏差清单与六维对照
81
+ 4. **「把第 7 章排成改稿清单」** → `novel_fix_plan` 给出按优先级排好的待办;改完再 `verify` 复测三态
82
+
83
+ 只想先看看家底,就说 **「用 novel_style_report 给我的小说做一次风格画像」**:
59
84
 
60
85
  ```text
61
86
  全书 1329 字:六维基线 μ=句法复杂度:2.3 修饰密度:35.6 抽象度:0.5 动作密度:101.7 不确定性:2.1 留白指数:7.0
@@ -64,6 +89,42 @@ mkdir -p novels/我的小说 # 把章节文件放进去(第01章.md、第0
64
89
 
65
90
  ## 看看输出长什么样
66
91
 
92
+ **开写包**(`novel_chapter_brief`,动笔前一次调用):
93
+
94
+ ```text
95
+ 目标:第 8 章《(无标题)》(尚未创建,文件名推导为 第08章.md)
96
+
97
+ 【上一章结尾原文·承接口】…(上一章末尾 300 / 600 字,按 budget 档位)
98
+ 【待回收伏笔】
99
+ - [mu5kjla…] 琥珀色齿轮怀表的来历与停摆的指针(high|第 1 章埋下,已过 6 章)
100
+ - [mu5kjlb…] 海图上红铅笔圈的礁区坐标(high|第 3 章埋下,已过 4 章)
101
+ 【相关人物】- 林昭:守码头的女人,父亲失踪后回到旧宅 - 沈砚:随船出海的人
102
+ 【世界观用语】欧式中世纪沿海城邦;点烛不烧香|禁用:上香、烧香、时辰、老夫
103
+ 【风格基线】complexity μ=2.42 modifierDensity μ=22.2 abstractDensity μ=10.06 actionDensity μ=122.45 …
104
+ 【原著锚段·照这个味道写】[对话] … [心理] …
105
+ 【上一章自检】第 7 章六维对照:全部维度在容差带内 ✓
106
+ 【本章禁用清单】- 禁词:上香(建议改用:点烛) - 禁词:时辰(建议改用:钟点)
107
+ 【开写清单】□ 先读锚段再动笔 □ 承接上一章结尾 □ …(共 8 步)
108
+ 【降级/提示】- 钩子记录里没有第 7 章的钩子(上一章钩子未回填)
109
+ ```
110
+
111
+ **改稿台**(`novel_fix_plan`,把诊断变成排好序的待办):
112
+
113
+ ```text
114
+ 改稿台:共 13 项待办(严重度降序 → 难度升序)。抽象度过高 ×3、衔接缺失 ×1、禁用词 ×3、语用不符 ×5、句式偏离 ×1。
115
+ 备注:留白指数 虽出带但差值 8.36 < 门槛 12,已按「无量级差异」忽略 ← 不误报的绝对量级闸
116
+
117
+ - [抽象度过高] 严重度 5 / 难度 2(第 5 行)
118
+ id:fix-abstract-5-c2c156d4
119
+ 现状:abstractDensity 47.9 目标:0.55~6.95
120
+ 原句:林昭大概说不清那种感觉。她隐隐觉得…
121
+ 方向:抽象度偏离:全章 47.9(基线 3.75,偏差 +1177.3%),本段 74.38。这句抽象词过密,改成具体动作或物件。
122
+ 锚段:林昭把它捏在掌心,翻过来看背面。背面刻着一行小字,被磨得只剩半边。她认出了父亲的名字。
123
+ - [语用不符] 严重度 4 / 难度 2(第 15 行)
124
+ 现状:客套禁词「承蒙」(第 15 行) 目标:避免该类客套表达
125
+ 方向:「承蒙」属世界观说话方式规范里明确不用的客套表达(honorBad)。这是说法层面的替换,不要顺手改剧情。
126
+ ```
127
+
67
128
  **风格自检**(新章 vs 全书基线):
68
129
 
69
130
  ```text
@@ -90,7 +151,7 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
90
151
  | 花费 | **0(本地推理)** | 按 token 计费 | 自建 |
91
152
  | 中文小说专用 | **是** | 通用 | 否 |
92
153
  | 风格基线(μ±σ) | **有** | 少见 | 无 |
93
- | 与 DSH 集成 | **16 工具 + 侧边栏开关** | 无 | 无 |
154
+ | 与 DSH 集成 | **18 工具 + 侧边栏开关** | 无 | 无 |
94
155
  | 非 DSH 用户可用 | **可以(MCP)** | 可以 | 需自己封装 |
95
156
 
96
157
  > **致非中文用户**:本插件为中文小说分析写作而设计——句式、情感、意象等核心能力以及内置的语义模型,全部针对中文语料构建与调优。在深耕中文的同时兼顾英文等其他语言,确实超出了我目前的能力范围。若因此给您带来不便,我深感抱歉,恳请谅解。
@@ -99,22 +160,23 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
99
160
 
100
161
  ## 功能
101
162
 
102
- 1. **风格画像报告**(novel_style_report):6 维测量报告——文风指纹 / 高频词汇 / 题材流派 / 情感量化 / 氛围光谱 12 轴 / 语义风格距离。**测量与判断分离**:插件只报数不贴标签,AI 判断可回传存盘(`.novel-writer/style-reports/`),续写保持风格一致。
103
- 2. **氛围光谱 12 轴**:噩梦感 / 焦虑压抑 / 温馨治愈 / 甜宠日常 / 催泪虐心 / 黑暗残酷 / 悬疑神秘 / 热血激昂 / 荒诞无厘头 / 孤独疏离 / 文艺唯美 / 情欲暧昧——证据链可追溯,0 token。
104
- 3. **本地语义引擎**:bge-small-zh 中文模型(24MB 随插件分发)本地 CPU 推理——`novel_semantic_search` 自然语言搜全书语义相关段落(带章节定位),语义级风格对比、语义隐性情感,懒加载 + 自动回退。
105
- 4. **句式模式分析**:九类句式分布、排列规律、句长节奏、情感曲线、风格指纹与节奏建议,带缓存与报告导出。
106
- 5. **情感净化 + 量化**:强/弱情绪词分级、污染源检测、caveat 预警 + AI 复核;Valence 滑动窗口 → 方差 V / 斜率 Δ / 矛盾指数 C + 隐性意象载体。
107
- 6. **世界观与语用检测**:文化基准自动判断(西/东/混合)+ 置信度;speechStyle 称谓/客套/仪式/语气规范;题材流派 + 网文信号。
108
- 7. **写作辅助全家桶**:伏笔登记表 / 设定五张表(人物·地点·道具·时间线·世界观)/ 章节摘要 / 连贯性审计 / 批量导入 / 风格自检 / 续写辅助。
109
- 8. **全工具 UI 开关**:侧边栏「写作助手功能」面板(总开关 + 工具开关分组 + 功能开关),大白话文案,显示数据目录占用与语义引擎状态。
110
- 9. **风格基线**:文笔六维测量(句法复杂度/修饰密度/抽象度/动作密度/不确定性/留白指数)+ 按章节 μ±σ 基线带;`novel_style_report` 输出基线带,`novel_style_check` 对照新章偏差(带内 ✓ / 出带 ⚠);侧边栏可自定义每维 ±% 容差(**推荐值 = 原著章节波动的 1.5 倍 σ**,自动取整、限 ±10%~100%;输入框留空即用推荐)——原创/续写时主题自由、写法保持在基线带内。
111
- 10. **写作哨兵三件套**:`novel_continuity_check` 扩展——①**衔接检查**(chapter 参数:时间硬跳/语义距离/人物延续/钩子承接四路检测,带原文引用)②**OOC 检测**(ooc 参数:角色情绪基线偏离)③**大纲走偏**(outline 参数:方向行 vs 正文关键词重合);报告工具支持 **brief 精简模式**。
112
- 11. **原创模式与创作资料**:侧边栏填写创作设定(世界观/角色/禁忌/主线/题材/额外要求,留空=模型自定,多书独立设定库);novel_outline 维护创作资料(创作设定/人物/剧情大纲/钩子记录/创作状态卡),原创强制「设定书→大纲→钩子」链,动态批次(10→20→30 章)防剧情跳跃与角色 OOC。
113
- 12. **体验与统计**:主面板**书库统计卡**(每本章数/总字数/近 7 天活跃字数,活跃🔥标绿)、**🎬 体验演示**(内置示例不落盘跑六维基线)、**📊 报告历史**(analysis/style-reports 列表浏览);错误提示带解决步骤;工具说明压缩省 token。
163
+ 1. **写作台三件套**:`novel_chapter_brief` **开写包**——动笔前**一次调用**取齐材料(上一章承接口 / 本章方向 / 相关人物 / 待回收伏笔 / 用语规范 / 风格基线 / 锚段与骨架 / 禁用清单 / 开写清单,两档 `budget`:compact / full),取不到的材料进 `degraded` 并说明原因,只读不写盘;`novel_fix_plan` **改稿台**——把风格诊断变成按优先级排好的待办(原句行号定位 + 当前值与目标值 + 原著锚段 + 改写方向),`plan` / `verify` / `mark` 三态复测,**只给方向、不生成正文**;`novel_plot { action: "graph" }` **结构视图**——伏笔埋设跨度 / 人物连续缺席 / 剧情线空档 / 时间线顺序 / 大纲对照。另有**场景化提示词**(general / writing / revising / auditing / setup,`general` 即旧行为)。
164
+ 2. **风格画像报告**(novel_style_report):6 维测量报告——文风指纹 / 高频词汇 / 题材流派 / 情感量化 / 氛围光谱 12 轴 / 语义风格距离。**测量与判断分离**:插件只报数不贴标签,AI 判断可回传存盘(`.novel-writer/style-reports/`),续写保持风格一致。
165
+ 3. **氛围光谱 12 轴**:噩梦感 / 焦虑压抑 / 温馨治愈 / 甜宠日常 / 催泪虐心 / 黑暗残酷 / 悬疑神秘 / 热血激昂 / 荒诞无厘头 / 孤独疏离 / 文艺唯美 / 情欲暧昧——证据链可追溯,0 token。
166
+ 4. **本地语义引擎**:bge-small-zh 中文模型(24MB 随插件分发)本地 CPU 推理——`novel_semantic_search` 自然语言搜全书语义相关段落(带章节定位),语义级风格对比、语义隐性情感,懒加载 + 自动回退。
167
+ 5. **句式模式分析**:九类句式分布、排列规律、句长节奏、情感曲线、风格指纹与节奏建议,带缓存与报告导出。
168
+ 6. **情感净化 + 量化**:强/弱情绪词分级、污染源检测、caveat 预警 + AI 复核;Valence 滑动窗口 → 方差 V / 斜率 Δ / 矛盾指数 C + 隐性意象载体。
169
+ 7. **世界观与语用检测**:文化基准自动判断(西/东/混合)+ 置信度;speechStyle 称谓/客套/仪式/语气规范;题材流派 + 网文信号。
170
+ 8. **写作辅助全家桶**:伏笔登记表 / 设定五张表(人物·地点·道具·时间线·世界观)/ 章节摘要 / 连贯性审计 / 批量导入 / 风格自检 / 续写辅助。
171
+ 9. **全工具 UI 开关**:侧边栏「写作助手功能」面板(总开关 + 工具开关分组 + 功能开关 + 提示词档位/场景/**精简工作流**),大白话文案,显示数据目录占用与语义引擎状态。
172
+ 10. **风格基线**:文笔六维测量(句法复杂度/修饰密度/抽象度/动作密度/不确定性/留白指数)+ 按章节 μ±σ 基线带;`novel_style_report` 输出基线带,`novel_style_check` 对照新章偏差(带内 ✓ / 出带 ⚠);侧边栏可自定义每维 ±% 容差(**推荐值 = 原著章节波动的 1.5 倍 σ**,自动取整、限 ±10%~100%;输入框留空即用推荐)——原创/续写时主题自由、写法保持在基线带内。
173
+ 11. **写作哨兵三件套**:`novel_continuity_check` 扩展——①**衔接检查**(chapter 参数:时间硬跳/语义距离/人物延续/钩子承接四路检测,带原文引用)②**OOC 检测**(ooc 参数:角色情绪基线偏离)③**大纲走偏**(outline 参数:方向行 vs 正文关键词重合);报告工具支持 **brief 精简模式**。
174
+ 12. **原创模式与创作资料**:侧边栏填写创作设定(世界观/角色/禁忌/主线/题材/额外要求,留空=模型自定,多书独立设定库);novel_outline 维护创作资料(创作设定/人物/剧情大纲/钩子记录/创作状态卡),原创强制「设定书→大纲→钩子」链,动态批次(10→20→30 章)防剧情跳跃与角色 OOC。
175
+ 13. **体验与统计**:主面板**书库统计卡**(每本章数/总字数/近 7 天活跃字数,活跃🔥标绿)、**🎬 体验演示**(内置示例不落盘跑六维基线)、**📊 报告历史**(analysis/style-reports 列表浏览);错误提示带解决步骤;工具说明压缩省 token。
114
176
 
115
177
  ---
116
178
 
117
- ## 提供的工具(16 个)
179
+ ## 提供的工具(18 个)
118
180
 
119
181
  | 工具 | 说明 |
120
182
  |------|------|
@@ -125,21 +187,23 @@ fixAnchors:3 条原著锚段(对话 / 心理 / 描写各一条,供逐句
125
187
  | `novel_new_chapter` | 创建新章节文件 |
126
188
  | `novel_import` | 原稿件批量导入/分类 |
127
189
  | `novel_sentence_analysis` | 句式模式分析(九类/情感净化/量化/曲线/指纹) |
128
- | `novel_sentence_config` | 查看/修改工具与功能开关 |
190
+ | `novel_sentence_config` | 查看/修改工具与功能开关(含提示词场景) |
129
191
  | `novel_style_check` | 风格自检(规则+语义双维度) |
130
192
  | `novel_style_report` | **风格画像报告**(6 维测量 + AI 判断分离) |
131
- | `novel_plot` | 伏笔/剧情线登记表 |
193
+ | `novel_plot` | 伏笔/剧情线登记表;`action: "graph"` 结构视图(伏笔埋设跨度 / 人物连续缺席 / 剧情线空档 / 时间线顺序 / 大纲对照) |
132
194
  | `novel_settings` | 设定管理(人物/地点/道具/时间线/世界观) |
133
195
  | `novel_summary` | 章节摘要(长书续写辅助) |
134
196
  | `novel_continuity_check` | 连贯性审计 + **衔接/OOC/大纲走偏哨兵** |
135
197
  | `novel_semantic_search` | 语义检索(本地 embedding,0 token) |
136
198
  | `novel_outline` | **创作资料管理**(创作设定/人物/大纲/钩子/状态卡) |
199
+ | `novel_chapter_brief` | **开写包**——动笔前一次调用取齐材料(上一章承接口/本章方向/相关人物/待回收伏笔/用语规范/风格基线/锚段与骨架/禁用清单/开写清单) |
200
+ | `novel_fix_plan` | **改稿台**——把风格诊断变成按优先级排好的待办(带行号定位与锚段),改完可复测;**只给方向不生成正文** |
137
201
 
138
202
  ---
139
203
 
140
204
  ## MCP 服务器(非 DSH 用户也能用)
141
205
 
142
- 包里自带一个 **stdio MCP 服务器**(`mcp/server.mjs`),把 16 个工具原样暴露给任何 MCP 客户端,
206
+ 包里自带一个 **stdio MCP 服务器**(`mcp/server.mjs`),把 18 个工具原样暴露给任何 MCP 客户端,
143
207
  例如 Claude Desktop、Cursor。**它是跑在你自己电脑上的本地进程,不需要服务器、不需要联网、不需要常驻。**
144
208
 
145
209
  ```bash
@@ -177,7 +241,7 @@ npx -y -p dsh-novel-writer dsh-novel-writer-mcp --root /你的小说库路径
177
241
 
178
242
  ## 数据目录
179
243
 
180
- `<书库根>/.novel-writer/`:`plots`(伏笔)/ `settings`(设定)/ `summaries`(摘要)/ `analysis`(分析报告)/ `audits`(审计)/ `embedding`(语义索引)/ `style-reports`(风格画像)。
244
+ `<书库根>/.novel-writer/`:`plots`(伏笔)/ `settings`(设定)/ `summaries`(摘要)/ `analysis`(分析报告)/ `audits`(连贯性审计 + 改稿清单 `fix-plan-*.json`)/ `embedding`(语义索引)/ `style-reports`(风格画像)。
181
245
 
182
246
  ---
183
247
 
package/cordis.patch.yml CHANGED
@@ -1,4 +1,4 @@
1
- # dsh-novel-writer v4.3.1 bundle patch: 16 tools (incl. novel_semantic_search) + local embedding engine.
1
+ # dsh-novel-writer v5.0.0 bundle patch: 18 tools (incl. novel_semantic_search) + local embedding engine.
2
2
  # dsh-novel-writer bundle patch: mounts the novel-writing assistant plugin
3
3
  # into the profile's loader tree. The entry's name is the plugin package
4
4
  # itself, resolved from the profile's node_modules.