@waterwx/dsh-novel-forge 2.1.5 → 2.3.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 +13 -9
- package/lib/client.js +3825 -2159
- package/lib/index.js +1935 -1300
- package/lib/types/assistant.d.ts +1 -1
- package/lib/types/client/api.d.ts +3 -1
- package/lib/types/client/llmLive.d.ts +7 -2
- package/lib/types/client/locales.d.ts +1 -0
- package/lib/types/client/panel/AuthorInbox.d.ts +23 -0
- package/lib/types/client/panel/CabinetSnapshot.d.ts +16 -0
- package/lib/types/client/panel/ChapterPlanPanel.d.ts +24 -0
- package/lib/types/client/panel/ConfirmDialog.d.ts +2 -0
- package/lib/types/client/panel/HomeHero.d.ts +60 -0
- package/lib/types/client/panel/ReviewIssueCard.d.ts +24 -0
- package/lib/types/client/panel/RunPanel.d.ts +3 -1
- package/lib/types/client/panel/Skeleton.d.ts +6 -0
- package/lib/types/client/panel/helpers.d.ts +12 -0
- package/lib/types/engine.d.ts +31 -14
- package/lib/types/llm-live.d.ts +2 -2
- package/lib/types/llm-retry.d.ts +11 -0
- package/lib/types/prompt-cache.d.ts +43 -0
- package/lib/types/prompts/adapt.d.ts +21 -0
- package/lib/types/prompts/audit.d.ts +15 -0
- package/lib/types/prompts/bible.d.ts +10 -0
- package/lib/types/prompts/catalog.d.ts +40 -0
- package/lib/types/prompts/characters.d.ts +19 -0
- package/lib/types/prompts/common.d.ts +9 -0
- package/lib/types/prompts/digest.d.ts +27 -0
- package/lib/types/prompts/facts.d.ts +26 -0
- package/lib/types/prompts/foreshadow.d.ts +10 -0
- package/lib/types/prompts/market.d.ts +18 -0
- package/lib/types/prompts/outline.d.ts +25 -0
- package/lib/types/prompts/plan.d.ts +22 -0
- package/lib/types/prompts/plotlines.d.ts +21 -0
- package/lib/types/prompts/polish.d.ts +22 -0
- package/lib/types/prompts/review.d.ts +30 -0
- package/lib/types/prompts/world.d.ts +13 -0
- package/lib/types/prompts/writing.d.ts +29 -0
- package/lib/types/protocol.d.ts +53 -2
- package/lib/types/routes.d.ts +6 -0
- package/lib/types/run-selection.d.ts +5 -2
- package/lib/types/stream-fallback.d.ts +8 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
你的专属 AI 小说写作插件:把一份大纲"编译"成一本完整的小说。
|
|
22
22
|
|
|
23
|
-
**版本:`2.1.
|
|
23
|
+
**版本:`2.1.11`** · 定位:**纯文本小说创作**。所有环节(开书、设定、规划、写作、审校、质检、导出)都在侧边栏「小说工坊」面板内完成;不涉及图片 / 视频 / 分镜生成。
|
|
24
24
|
|
|
25
25
|
> **安装标签**:2.0.0 起本项目已转正式版,`latest` 是默认标签,`npm i @waterwx/dsh-novel-forge` 即可。
|
|
26
26
|
> 只有在测试预发布版本时才需要显式带 `@alpha`。
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|---|---|
|
|
61
61
|
| **自动 AI 审稿**:人设 / 设定 / 红线 / 文笔 / 节奏·爽点 / 逻辑 / 反 AI / 呈现 / 合规 九维打分,输出可勾选问题清单与建议 | **AI review**: 9-dimension scoring with a checkable issue list and suggestions |
|
|
62
62
|
| **修订循环**:审稿未过 → 按意见一键修订 / 选中局部改 / 去 AI 味润色 → 重审;「✔ 直接通过」行使作者终审权 | **Revise loop**: revise by review / targeted edits / de-AI polish → re-review; or approve directly |
|
|
63
|
-
| **审稿问题勾选修复**:每条问题可勾选(high
|
|
63
|
+
| **审稿问题勾选修复**:每条问题可勾选(high 默认选),支持按高优 / 未处理筛选并持久记录作者处理状态,一键按所选问题修订 | **Selective review fixes**: check any issues (high pre-checked), filter high/unhandled findings with persistent author handling state, and fix in one click |
|
|
64
64
|
| **修订仲裁(同一章只改一轮)**:审稿意见 + 时间线矛盾 + 张力偏差合并成**一份**指令;固定优先级 `审稿 high > 时间线 high > 张力 medium > 其它 > 审稿 low`;同源去重(标注「合并同类 N 条」)、单轮最多 8 条(截断显式声明)、每章最多 2 轮后转人工待办 | **Revision arbitration**: review issues + timeline conflicts + tension deviations merged into **ONE** instruction per chapter; fixed priority; same-source dedup; 8-item cap with explicit truncation; 2 rounds max then to manual todos |
|
|
65
65
|
| **张力 / 时间线默认只提示不阻塞**:出章即核对曲线 → 运行日志 + 建议性待办;**不单独触发修订**,只在因审稿 high 修订时搭同一轮车 —— 因此不增加轮次,也不会「改完甲又违反乙」 | **Tension/timeline are advisory-only**: checked on chapter completion → run log + advisory todos; never trigger a revision on their own, only ride along with a review-driven round |
|
|
66
66
|
| **验证基准是多源的**:修订后的复核不再只核对审稿意见,而是核对**本轮实际下发的全部条目**(时间线 / 张力条目带 `[时间线]` / `[张力]` 前缀),杜绝「复核说已解决、时间线说没改」 | **Multi-source verification baseline**: post-revision re-review checks every item actually issued this round (timeline/tension items carry source prefixes) |
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
| **失败分级(fail-stop)**:契约类错误(参数越界、章节不在计划中)**不重试**并记账,网络 / 超时 / 限流类才按次数重试;同一调用同参数已失败过会被直接挡下,避免无效循环 | **Failure classification**: contract errors are not retried and are recorded; only transient errors retry; a repeated identical failed call is blocked |
|
|
98
98
|
| **备用模型与故障恢复**:只对网络 / 超时 / 限流 / 服务端 / 额度类失败切换备用模型;用户取消与参数错误不切换;备用也失败时抛**主模型原始错误**保留第一现场;正文生成 / 修订 / 润色仅在「一个字都没产出」时才换模型,杜绝重复生成 | **Fallback model & recovery**: switches only on transient failures, never on cancellation or bad params; rethrows the primary error; streaming writes only fall back when zero output was produced |
|
|
99
99
|
| **生产单(批量连写)**:区间 / 新增 N 章一键下单,计划补足 + 逐章生成 + 被拒分级处理(无 high 豁免 / 修订 + 验证 / 两轮不过转人工)+ 出章即核对曲线,支持暂停 / 继续 / 停止与断点续跑(`run-state.json`)。**全局单实例、一次一本书、逐章串行**,批次绑定下单时的书目录(换书不打断也不切换);页面内置「运行说明」折叠块讲清并发 / 绑定 / 暂停续跑 / 同章冲突 | **Production run**: line up a range, auto-plan, generate chapter-by-chapter, tiered declined handling, curve check on completion, pause / resume / stop with checkpointing; single global instance, **one book at a time, strictly serial**, batch bound to the book it was started from |
|
|
100
|
-
| **Token / 耗时记账**:实况帧带输入 / 输出 / 思考 / 缓存 token、总耗时、首字耗时;`/status` 返回本次运行(进程内)汇总与按用途分组;面板可查看**每次调用实际发送的 Prompt**(system + user
|
|
100
|
+
| **Token / 耗时记账**:实况帧带输入 / 输出 / 思考 / 缓存 token、总耗时、首字耗时;`/status` 返回本次运行(进程内)汇总与按用途分组;面板可查看**每次调用实际发送的 Prompt**(system + user)。系统提示词按**固定规则 → 本书资料 → 本章动态**三层组装——永不变的排最前、次次都变的垫尾,跨章重复前缀有机会命中厂商输入缓存;汇总行如实展示命中用量与占输入的比例(以上报为准,不承诺比例) | **Token & latency accounting**: live frames carry in/out/reasoning/cached tokens, total and first-token latency; per-run summary grouped by purpose; inspect the actual prompt sent per call. System prompts are assembled in three layers (fixed rules → book material → per-chapter dynamics) so repeated prefixes across chapters have a chance to hit the provider's input cache; the summary row shows cached usage and its share of input as reported, with no promised ratio |
|
|
101
101
|
| **改编模式**:上传全文 → 设定卡片 / 可改范围 → 确认改编维度 → 生成映射表 / 规则 / 影响清单 → 替换 / 重写 → 保存为新书(原书保留) | **Adaptation mode**: upload full text → setting cards / mutability → confirm dimensions → mappings / rules / impacts → replace or rewrite → save as a new book |
|
|
102
102
|
| **知识库 / RAG**:书内自由参考文档,生成时按章节检索注入 | **Knowledge base / RAG**: in-book reference docs, retrieved & injected per chapter |
|
|
103
103
|
|
|
@@ -158,7 +158,7 @@ flowchart TD
|
|
|
158
158
|
⑧ 导出(全本 TXT / MD(含卷首语与封面);分范围导出:设定 / 规划 / 角色 / 质检 / 项目备份 JSON)
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
**辅助旁路(任意阶段可用)**:💬 AI 编辑 Agent(拆书 / 自动编辑 / 知识库 / 质检 / 简介 / 待办)、🧵 剧情线管理、👥 角色库与人物志、⏳ 故事时间线、📈 张力曲线、🎛
|
|
161
|
+
**辅助旁路(任意阶段可用)**:💬 AI 编辑 Agent(拆书 / 自动编辑 / 知识库 / 质检 / 简介 / 待办)、🧵 剧情线管理、👥 角色库与人物志、⏳ 故事时间线、📈 张力曲线、🎛 提示词槽位、🕘 章节历史版本。
|
|
162
162
|
|
|
163
163
|
**推荐节奏**:先让 ②③ 完整落地(设定越全,章节质量越高);④ 建议逐章或小批生成,便于在 ⑤ 及时修正;长篇每写 20-30 章跑一次 ⑦ 全书质检,防止设定漂移。
|
|
164
164
|
|
|
@@ -168,10 +168,12 @@ flowchart TD
|
|
|
168
168
|
|
|
169
169
|
| 位置 | 内容 |
|
|
170
170
|
|---|---|
|
|
171
|
-
|
|
|
171
|
+
| 页头(品牌行) | **小说工坊**(点击返回书架)· 当前书名与进度 · **AI 编辑**、**AI 进度**(两个横切浮窗入口,固定在页头右侧;AI 不作为与写作 / 设定并列的业务分类,而是贯穿所有阶段的能力,因此不进导航分组)· 关闭面板 |
|
|
172
|
+
| 顶栏 · 工作台导航 | **总编台**(全书进度、推荐下一步、四项常驻指标)· **总纲**(大纲 / 卷与章节计划)· **设定**(道藏:角色、世界规则、事实与红线)· **写作**(章节索引 → 章节工作台)· **生产单**(批次生产与流水线,跟着「写作」这条主线走)· **工具 ▾**(见下行)· **写作参数**(本书参数:仅对当前书生效、可一键恢复全局默认;含分范围导出) |
|
|
173
|
+
| 顶栏 · 工具菜单 | 长线管理(剧情线与伏笔)· 知识库 · 拆书分析 · 自动编辑 · 创作资产(题材 / 推进 / 笔法帖 / 文戒 / 心法)——辅助能力全保留,但不与核心创作流程争一级视觉权重;菜单可由点击外部或 Esc 关闭 |
|
|
172
174
|
| 书架页 | **书架**(书卡网格 / 开书向导 / 导入)· **改编** · **资产库 / 全局资产库** · **设置 · 全局**(模型与推理 / 备用模型 / 故事时间线 / 路径与文件 / 外观与主题 / 自定义背景 / 输出目录迁移) |
|
|
173
|
-
| 总编台 · 本书资料 |
|
|
174
|
-
| 总编台 ·
|
|
175
|
+
| 总编台 · 本书资料 | 道藏(设定·角色)· 作者复盘 · 简介·封面 |
|
|
176
|
+
| 总编台 · 资料侧柜 | 与顶部导航共用同一数据源:总纲 / 大纲 · 道藏 · 作者复盘 · 剧情线·伏笔 · 简介·封面 · 生产单 · 张力曲线 · 风格漂移曲线 · 提示词槽位 · 故事时间线 · 知识库 · 拆书分析(条目以 `● 已有数据 / ○ 待补` 显示体检结果) |
|
|
175
177
|
| 全页视图 | 章节工作台(审稿 / 对比·草稿 / 复盘 / 历史版本,内含正文编辑、局部改写与去 AI 味润色)· 小说阅读器 |
|
|
176
178
|
| 悬浮窗(可拖动 / 缩放) | **AI 助手**(AI 编辑 Agent 对话,不占工作台)· **AI 进度**(当前任务进度 + 活动输出,可查看每次调用的 Prompt 与用量) |
|
|
177
179
|
| 右上角状态芯片 | **小说工坊生成状态**:固定在窗口右上角,显示「**《书名》** + 生成中 / 已暂停 / 批完成 / 已停止 / 出错」(含当前章号与失败计数;书名过长省略号截断,全名与批次区间在悬停提示里),点击打开小说工坊面板;可拖拽并记忆位置。显示偏好为三态(总是 / 仅生成中·暂停时 / 关闭),在**书架页 → 设置 · 全局 → 外观与主题**里切换;选「关闭」会同时停掉状态轮询 |
|
|
@@ -273,7 +275,7 @@ node scripts/check-third-party.mjs # 来源卫生:不得出现外部项目
|
|
|
273
275
|
|
|
274
276
|
```
|
|
275
277
|
src/ 插件源码(宿主半)
|
|
276
|
-
engine.ts 写作 / 审稿 / 润色 / 提炼 / 导出等全部 LLM
|
|
278
|
+
engine.ts 写作 / 审稿 / 润色 / 提炼 / 导出等全部 LLM 管线(提示词已迁出,见 prompts/)
|
|
277
279
|
routes.ts Web 路由(/api/dsh-novel-forge/*)
|
|
278
280
|
run.ts 生产单(批量章节生产的标准执行器)
|
|
279
281
|
revision.ts 修订仲裁:三类建议合并成一份指令 + 多源验证基准
|
|
@@ -285,11 +287,13 @@ src/ 插件源码(宿主半)
|
|
|
285
287
|
llm-retry.ts 备用模型与失败恢复
|
|
286
288
|
llm-live.ts 实况帧 + 用量账本 + Prompt 环形留存
|
|
287
289
|
prompt-slots.ts 提示词槽位
|
|
290
|
+
prompt-cache.ts 提示词分层组装(固定/本书/本章三层,服务输入缓存前缀)
|
|
291
|
+
prompts/ 系统提示词按域拆分 + catalog 注册表(改文案去域文件,不在 engine.ts 新起一段)
|
|
288
292
|
assistant.ts AI 编辑 Agent
|
|
289
293
|
assets.ts 内置写作资产(自研表述)
|
|
290
294
|
client/ 浏览器半(React + CSS Modules:面板 / 工作台 / 阅读器)
|
|
291
295
|
lib/ 构建产物(lib/index.js 宿主 / lib/client.js 浏览器)
|
|
292
|
-
tests/
|
|
296
|
+
tests/ 38 个 vitest 测试文件(475 个用例)
|
|
293
297
|
scripts/ 构建与门禁脚本(含 check-third-party.mjs 来源卫生门禁、release.mjs)
|
|
294
298
|
docs/ 设计文档(design-direction.md = 面板样式现行基准)+ archive/ 历史归档
|
|
295
299
|
package.json 包定义(dsh.bundle.patch + dsh.client 声明)
|