xling001/dsh-reading-companion ↗★ 0
dsh-reading-companion
DSH 本地阅读 + AI 陪读插件:导入本地 TXT、自动生成目录、按进度滚动阅读,并以「不剧透」的书友口吻陪你聊感想,把「原文摘抄—我的感想—AI 回应」写成结构化 Markdown 笔记。Local-ebook reader with a spoiler-safe AI reading companion for DeepSeek Harness (DSH). 需要安装dsh-better-sidebar,适合在DSH中阅读电子书并记录结构化笔记。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xling001/dsh-reading-companionドキュメント
README 全文を読む ↗配置参考
配置写在 cordis.patch.yml 的那条 insert 里,任何字段都可在 profile 的 cordis.patch.yml 覆盖。
标注「运行时」的项,读者也能在面板里改,且面板优先于配置文件。
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
storageDir | string | '' | 书库与笔记根目录。留空是有意的:默认走宿主的 dshHomePath() 解析成 $DSH_HOME/dsh-reading-companion,这样 profile 迁移时书库跟着走 |
inboxDir | string | 'inbox' | 「扫描导入目录」扫的收件箱,相对 storageDir |
fallbackBlockChars | number | 4000 | TXT 没有可用章节标题、降级为固定块时的块大小(字符) |
importRoots | string[] | [] | POST /library/import 的白名单。空 = 不限制(导入本来就是"从磁盘任意处读书"这个功能本身)。填了就只接受落在这些根目录内的路径,判定走真实路径,用链接绕不过去 |
exportDir | string | '' | 默认导出目录。空 = 落到这本书所绑会话的工作区根;面板里改过一次就写进 settings.json,优先级 settings > 此值 > 工作区根 |
spoilerGate | boolean | true | 路径闸:指向本书原始文本(content.txt / source.txt / chapters.json)的工具调用一律拒绝,与会话归属无关 |
webGate | 'block-all' | 'block-book' | 'off' | 'block-all' | 联网闸强度(运行时可在面板改)。block-book 是启发式:放行联网,但拒绝看起来在问这本书的查询 |
window.currentChapterMode | 'full' | 'read-so-far' | 'full' | 当前章给全文,还是只给到光标处 |
window.headAllowanceChars | number | 1500 | 仅 read-so-far 用:至少给当前章开头这么多字符 |
window.previousChapterMode | 'tail' | 'full' | 'tail' | 上一章给多少:只给结尾(在段落处切)还是整章 |
window.backgroundBudgetChars | number | 9000 | 背景认识那段的上限;超了按优先级裁剪,面板会说明裁掉了什么 |
window.backgroundCoarseDegrade | boolean | true | 降级第二档:主体整体被丢之前,先降成"### 主体 + 最近一条" |
window.compactThreshold | number | 0.85 | 背景超过 backgroundBudgetChars × 此值 时,下一次补齐先压缩(设为 1 = 关闭自动压缩) |
window.discussionLimit | number | 8 | 注入多少条讨论时间线 |
sample.budgetChars | number | 24000 | 一次补齐调用的字符预算——它决定一次能闭合多大的缺口 |
sample.minPerChapter | number | 150 | 默认形态下这是"均分额度的下限",同时决定一批能吞多少章:一批章数 ≈ budgetChars / minPerChapter |
sample.maxPerChapter | number | 600 | 单章上限 |
sample.lengthRatio | number | 0 | 可选形态:0 = 均分(默认);设 0.2 改为"按章节长度比例分配"(代价是短章被切得更狠,见 design-v1 §197) |
sample.foundationChapters | number | 30 | 只对第一次补齐生效的上限:第一次就厚读开头,而不是把预算摊到几百章 |
sample.emphasisChapters | number | 5 | 开头前 N 章(以及每卷的卷首章)按 emphasisFactor 加权 |
sample.emphasisFactor | number | 3 | 加权倍数 |
sample.jumpGateChapters | number | 50 | 跳读闸阈值:一次补齐要闭合的缺口超过它就先问(回 409 与缺口范围,面板给三个选项)。设 0 关闭 |
sample.recentWindowChapters | number | 200 | 选「只记最近这一段」时的窗口大小(调用时可临时改,这是默认值不是上限) |
sample.recentMinPerChapter | number | 300 | 只给 recent 路径用的每章下限(比 minPerChapter 厚:那条路要的是"能聊这一章",不是"不致迷路") |
memoryTimeoutMs | number | 120000 | 一次补齐最多阻塞多久(插件内部另有中止定时器,不会永久挂住) |