dsh-novel-writer 3.9.5 → 4.0.1
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 +27 -0
- package/README.md +32 -0
- package/cordis.patch.yml +1 -1
- package/lib/analysis.js +405 -212
- package/lib/client.js +232 -105
- package/lib/core.js +2175 -0
- package/lib/embedding.js +155 -64
- package/lib/index.js +276 -2395
- package/lib/lexicons/dutir_seven.json.gz +0 -0
- package/lib/models/tokenizer.json.gz +0 -0
- package/lib/prompts.js +9 -2
- package/lib/style-metrics.js +14 -4
- package/lib/update-check.js +62 -20
- package/lib/vibe.js +68 -17
- package/package.json +76 -65
- package/skills/novel-writing/SKILL.md +5 -0
- package/lib/lexicons/dutir_seven.json +0 -1
- package/lib/models/tokenizer.json +0 -21278
package/README.en.md
CHANGED
|
@@ -92,6 +92,33 @@ Under `<library-root>/.novel-writer/`: `plots` / `settings` / `summaries` / `ana
|
|
|
92
92
|
|
|
93
93
|
---
|
|
94
94
|
|
|
95
|
+
## Dependencies, permissions and failure bounds
|
|
96
|
+
|
|
97
|
+
**Runtime dependencies** (installed by `npm install`; all public packages):
|
|
98
|
+
|
|
99
|
+
- `onnxruntime-web` ^1.24.3 — local ONNX inference (WASM backend) for semantic search and style distance;
|
|
100
|
+
- `@huggingface/tokenizers` ^0.1.0 — tokenization (WASM);
|
|
101
|
+
- peerDependency `react` ^18.2.0 — the browser half reuses the React shipped with the DSH Web GUI.
|
|
102
|
+
|
|
103
|
+
**Local model**: `lib/models/` ships the quantized bge-small-zh-v1.5 model (~24MB ONNX) and its tokenizer
|
|
104
|
+
(`tokenizer.json.gz`, decompressed on load). All inference runs on the local CPU; no text is uploaded.
|
|
105
|
+
|
|
106
|
+
**Permissions and external services**:
|
|
107
|
+
|
|
108
|
+
- Filesystem: only the user-chosen library root (`novels/`), its data directory (`<root>/.novel-writer/`)
|
|
109
|
+
and the plugin state file (`~/.dsh/dsh-novel-writer/state.json`).
|
|
110
|
+
- Local HTTP: five routes registered inside the DSH Web GUI, loopback-only by default.
|
|
111
|
+
- Network: the only outbound call is the GitHub Releases API (`api.github.com`) for update checks —
|
|
112
|
+
3s timeout, 24h cache, silent fallback; no manuscript content is sent.
|
|
113
|
+
- Subprocesses: none, except opening the OS file manager with an argv array.
|
|
114
|
+
- Lifecycle scripts: none.
|
|
115
|
+
|
|
116
|
+
**Failure bounds**: semantic engine failure falls back to pure rule mode; cache/disk failures never block
|
|
117
|
+
tool results; a plugin load failure cannot affect the DSH host process.
|
|
118
|
+
|
|
119
|
+
**Compatibility**: Node.js >= 22.3 (`engines.node`); DSH >= 0.1.1-rc.2 (`dsh.engines.dsh`).
|
|
120
|
+
|
|
121
|
+
---
|
|
95
122
|
## License
|
|
96
123
|
|
|
97
124
|
[MIT](./LICENSE)
|
package/README.md
CHANGED
|
@@ -92,6 +92,38 @@ dsh plugin --profile web add github:siweina/dsh-novel-writer#main
|
|
|
92
92
|
|
|
93
93
|
---
|
|
94
94
|
|
|
95
|
+
## 依赖、权限与失败边界
|
|
96
|
+
|
|
97
|
+
**运行时依赖**(`npm install` 自动安装,均为公开包):
|
|
98
|
+
|
|
99
|
+
- `onnxruntime-web` ^1.24.3 —— 本地 ONNX 推理(WASM 后端),用于语义检索与语义风格距离;
|
|
100
|
+
- `@huggingface/tokenizers` ^0.1.0 —— 中文分词(WASM);
|
|
101
|
+
- peerDependency:`react` ^18.2.0(浏览器端复用 DSH Web GUI 自带的 React,不额外打包)。
|
|
102
|
+
|
|
103
|
+
**本地模型**:`lib/models/` 随包分发 bge-small-zh-v1.5 量化模型(约 24MB,ONNX)与分词器
|
|
104
|
+
(`tokenizer.json.gz`,加载时解压)。全部推理在本机 CPU 完成,**不上传任何文本**。
|
|
105
|
+
|
|
106
|
+
**权限与外部服务**:
|
|
107
|
+
|
|
108
|
+
- 文件系统:只读写用户指定的书库根目录 `novels/` 与其数据目录 `<root>/.novel-writer/`,
|
|
109
|
+
以及插件自身的开关文件 `~/.dsh/dsh-novel-writer/state.json`;不访问其他路径。
|
|
110
|
+
- 本地 HTTP:在 DSH Web GUI 内注册 5 条路由(state / reveal / reports / demo / update-check),
|
|
111
|
+
仅回环地址可访问;`allowLanState` 默认关闭,局域网访问默认拒绝。
|
|
112
|
+
- 外部网络:唯一外呼是 GitHub Releases API(`api.github.com`)检查新版本——3 秒超时、24 小时缓存、
|
|
113
|
+
失败静默降级;请求不含任何书籍内容。
|
|
114
|
+
- 子进程:无。唯一例外是打开系统文件管理器(Windows `explorer` / macOS `open` / Linux `xdg-open`),
|
|
115
|
+
以数组参数直调、不经 shell。
|
|
116
|
+
- 生命周期脚本:无(无 preinstall / postinstall / prepare)。
|
|
117
|
+
|
|
118
|
+
**失败边界**:
|
|
119
|
+
|
|
120
|
+
- 语义引擎不可用(模型缺失或 WASM 初始化失败)时自动回退纯规则模式,其余功能不受影响;
|
|
121
|
+
- 分析结果落盘失败不阻塞工具返回;缓存损坏按"无缓存"处理并重建;
|
|
122
|
+
- 插件加载失败不影响 DSH 主进程:工具注册与提示词注入相互独立。
|
|
123
|
+
|
|
124
|
+
**兼容范围**:Node.js >= 22.3(`engines.node`);DSH >= 0.1.1-rc.2(`dsh.engines.dsh`)。
|
|
125
|
+
|
|
126
|
+
---
|
|
95
127
|
## 许可证
|
|
96
128
|
|
|
97
129
|
[MIT](./LICENSE)
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# dsh-novel-writer
|
|
1
|
+
# dsh-novel-writer v4.0.0 bundle patch: 16 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.
|