yfwu2020/dsh-selection-explain ↗★ 0
@yfwu2020/dsh-selection-explain
选中文字浮出按钮并流式显示翻译与详解 适合在阅读或对话中需要快速翻译和专业词汇释义的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yfwu2020/dsh-selection-explain说明文档
阅读完整 README ↗配置
配置写在 profile 的 cordis.patch.yml 里同 id 的行上(dsh plugin add 装好后,包自带的 cordis.patch.yml 里已有可改的样板):
- insert:
- id: selection-explain
name: '@yfwu2020/dsh-selection-explain'
config:
reasoningEffort: high
sessionContextMaxMessages: 24
下表默认值取自 src/index.ts 的 Config schema,也就是推荐值。 不填即用默认。
模型与推理
| 字段 | 默认 | 说明 |
|---|---|---|
provider | '' | 固定 provider 路由;留空 = 跟随「设置 → 默认模型」 |
model | '' | 固定 model id;留空 = 跟随默认模型 |
reasoningEffort | high | 详解阶段推理档位(off / low / high / max) |
translationReasoningEffort | low | 首轮翻译单独一档。这一轮只需挑英文片段,压低换首字速度 |
chatReasoningEffort | high | 追问档位(追问要准不要快;想更快可调 low) |
temperature | -1 | 采样温度。-1 = 不传,交给供应商默认(与主会话一致);0~2 之间才真的传 |
maxTokens | 0 | 单次输出上限(tokens)。0 = 不限制。填正数可控成本 / 控时延 |
timeoutMs | 300000 | 单次调用超时(含工具轮;客户端断开即中止上游) |
推理档位三档分开是有原因的:翻译不需要深度推理,详解需要。默认
translationReasoningEffort: low让首字快、reasoningEffort: high让详解细。
上下文与缓存
| 字段 | 默认 | 说明 |
|---|---|---|
maxSelectionChars | 4000 | 选中文字长度上限(超了不出现按钮,host 侧也会拦截并给出明确报错) |
maxContextChars | 12000 | 局部上下文上限(选区前后各取一段窗口) |
sessionContext | true | 是否注入当前会话的对话背景(判断指代与前提的关键) |
sessionContextFastMessages | 8 | 首轮翻译用的背景条数;越小首字越快 |
sessionContextMaxMessages | 24 | 详解 / 追问用的背景条数(自选中文字所在消息向上取) |
sessionContextMaxChars | 0 | 会话背景字符上限;0 = 不限(只按条数取窗口) |
resultCacheTtlMs | 600000 | 共享结果缓存 TTL(毫秒);0 = 关闭 |
historyMaxEntries | 20 | 小窗对话历史保留多少个划词条目;0 = 关闭历史 |
maxRequestsPerMinute | 40 | 本地限流,防误触发刷爆额度 |
工具(联网 / 文件)
| 字段 | 默认 | 说明 |
|---|---|---|
tools | true | 是否允许解读过程调用工具 |
toolNames | advanced_search,platform_search,read,grep,glob | 工具白名单(逗号分隔)。默认用 free-search 插件的搜索工具,支持多引擎、时间过滤、平台搜索 |
fallbackToolNames | web_search | 备用清单:只在首选里的联网工具一个都不在时才补进来(没装 free-search 时兜底) |
maxToolRounds | 2 | 最多几轮工具调用(用完会补一轮不带工具的收尾,避免"转半天没回答") |
toolResultMaxChars | 3000 | 单个工具结果注入模型前的字符上限 |
toolReadRoot | '' | 文件类工具(read/grep/glob)的读取边界:'' = 会话工作目录,'*' = 不限制,其他 = 指定目录。越界在执行前被拒 |