tuogusa/dsh-word-complete
DSH Web 作曲器的单词自动补全功能:在输入时从当前会话中建议单词,使用方向键选择,按回车确认。
Project Overview项目介绍
A word auto-completion plugin for the DSH Web chat input box, styled after Notepad++. It suggests up to 8 words from the current session and a persistent historical index, matching by prefix and ranked by proximity. Use it to speed up typing long terms or code snippets. Note: English prefixes require at least 2 characters to trigger.
DSH Web 对话输入框的词自动补全插件,采用 Notepad++ 风格。输入时从当前会话及历史索引中提取词,按前缀匹配弹出最多 8 条建议,支持键盘选择与确认。适合频繁输入长词或代码片段时使用。注意:英文前缀需至少 2 个字符才触发。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-word-complete(tuogusa/dsh-word-complete)
仓库:https://github.com/tuogusa/dsh-word-complete
本站详情页:https://www.yhbd.top/plugins/tuogusa-dsh-word-complete/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-08-19 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:tuogusa/dsh-word-complete
把 tuogusa/dsh-word-complete 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-word-complete
DeepSeek Harness Web 对话输入框的词自动补全插件(Notepad++ Word Completion 风格,host + client 一体包):输入时从当前会话出现过的词中弹出补全建议,键盘 ↑/↓ 选择、回车确认。
效果
- 在输入框输入词前缀时(英文 ≥ 2 个字符、中文/日文/韩文 ≥ 1 个字符),光标上方弹出最多 8 条建议词;建议以当前输入内容开头(前缀匹配),并按接近程度升序排列:完全匹配(当前输入词本身)最前,其次附加字符更少(更接近),再词频更高。例如输入
ds会联想dsh、dsh_workspace、dsh-word-complete,而不会出现adds、cards、words这类输入在后面的词; - 建议词来源:当前会话中用户与助手消息里出现过的词(英文/数字/下划线序列、中文、日文、韩文分词,过滤纯数字与超短词);
- 键盘交互:↑/↓ 循环选择、回车确认插入、ESC 关闭;鼠标悬停高亮、点击确认;
- 确认后光标自动移到插入词末尾;回车确认后按 Backspace 会立即重新弹出(编辑刚插入的词);空格键完全放行,不影响正常输入;
- 弹出窗口跟随光标逐字移动,出现在"当前输入的字符上方";上方空间不足时自动翻转到光标下方。
行为细节
| 场景 | 行为 |
|---|---|
词前紧邻 / 或 \ |
不弹出(可能是斜杠命令、文件路径或 URL) |
| 建议相关性 | 只出现以当前输入内容开头的词;adds/cards/words 这类输入在后面的词不显示 |
| 英文前缀不足 2 字符 | 不弹出(避免干扰) |
| 中文 1 字 | 即弹出 |
| 输入法组合(composition)期间 | 不弹出,组合结束恢复 |
| 确认/ESC 后 | 窗口关闭,直到输入新的可打印字符或 Backspace/Delete 才重新激活 |
| 选中词与当前前缀完全相同(已输完整词) | 视为"确认当前词":直接关闭窗口,光标保持在词尾 |
| 词表为空(新会话) | 回退到本地持久化索引(历史会话累计词表),冷启动也有建议 |
架构与技术要点
- host 端(
lib/index.js):监听会话事件增量统计词频(user/message、assistant/message),内存缓存 + 增量持久化到$DSH_HOME/word-complete.json(最近 30 个会话),通过webServer提供GET /api/word-complete/words?sessionId=; - client 端(
lib/client.js,手写 bundle):注册到官方 slotconversation.input.overlay(slash 菜单同款弹层槽位),session scope 注入useInput; - 插入走官方事件:
actx.bail("slash/input-insert-text", { text, span })——带draftRevCAS 校验与撤销支持,不 hack 任何内部状态; - 光标位置测量:用 Range API 在官方 auto-grow 镜像
[data-input-mirror]的文本节点上定位 caret 偏移——镜像与 textarea 共享完全相同的排版规则(font-familyDshChipCell、padding、pre-wrap)并随滚动容器一起移动,测量结果即真实视口坐标,无需复制样式、无需滚动修正; - 窗口定位:
createPortal渲染到document.body+position: fixed,脱离 slot 锚点与 transform 祖先的干扰;随输入/光标/滚动/窗口尺寸实时重测。
安装
dsh plugin --profile web add github:tuogusa/dsh-word-complete
兼容 Profile:web(DSH Web GUI)。安装后重启 DSH 并 Ctrl+Shift+R 强刷浏览器。
更新
# 方式一:CLI 更新(推荐)
dsh plugin --profile web update dsh-word-complete
# 方式二:重新从 GitHub 源安装/更新
dsh plugin --profile web add github:tuogusa/dsh-word-complete
说明:
dsh plugin是 pnpm 的前置转发器,update会按当前依赖声明重新解析该包;通过github:tuogusa/dsh-word-complete安装时,会更新到仓库默认分支的最新提交。
验证
仓库自带离线验证脚本(33 项断言:分词、词频合并、持久化、bundle 形状、插入事件、前缀检测、前缀匹配排序):
node verify.mjs
结构
cordis.patch.yml bundle patch(loader 行)
lib/index.js host 端:词频统计 + 持久化 + REST API
lib/client.js client 端:补全 UI + 键盘交互 + 光标定位
docs/DESIGN.md 设计说明(架构、测量与交互决策依据)
verify.mjs 离线验证脚本
License
MIT
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill