- Home
- Plugins
- UI Enhancements
- dsh-word-lens
dsh-word-lens
lzj8888866/dsh-word-lens
A conversation word lens for DSH: select any word in an AI answer to open an explanation panel, keep each word saved locally, and collapse or reopen it without scrolling back. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
dsh plugin --profile web add github:lzj8888866/dsh-word-lensREADME
dsh-word-lens
A floating word explainer for DeepSeek Harness. While reading an AI answer, select a word you do not understand — a small 解释 bubble appears — and the explanation is opened in a side panel that can be shown or hidden at any time. The answer is saved per word on disk, so it survives topic changes, new sessions, page refreshes and app restarts.
- Works in the DSH web UI (DSH Desktop and
dsh web). - No build step and no runtime dependencies; it only uses the host's
llmandwebServerservices. - The panel is a fixed overlay: it never reflows the conversation, moves your scroll position or steals input focus.
Features
- Right-edge pill with a live entry count; click to open or collapse the panel, or press Alt+W. Esc closes the panel.
- Select-to-explain: select 1–60 characters in an AI answer, then click the 解释 bubble next to the selection.
- Panel: search/filter saved words locally, press Enter to explain a typed word, open an entry's detail page (explanation, context, copy, re-explain, two-step delete).
- Persistence per word: entries are written by the host half to
~/.dsh/dsh-word-lens/store.jsonwith atomic writes, a corrupted-file backup and a 2,000-entry cap. The data is independent of any conversation. - Lightweight model use: explanations are generated with reasoning disabled on DeepSeek models, at low temperature, with a short timeout.
Install
From the DSH plugin market (recommended)
Open Settings → Plugins → Discover, search for dsh-word-lens (or 词语解释) and install it. After the catalog lists this plugin.
With the DSH CLI
dsh plugin --profile desktop add dsh-word-lens
# for a plain web profile:
dsh plugin --profile web add dsh-word-lens
Then reload/restart the profile if your host does not hot-apply plugins, and refresh the page once.
Manual install
- Copy this folder into
%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-word-lens(or the matching profile). - Add the bundle patch row to the profile's
cordis.patch.yml(or let the profile loader applycordis.patch.ymlfrom the package). - Restart the app or trigger a profile patch reload, then refresh the page.
Usage
- Select a word in an AI answer; click the 解释 bubble.
- The panel opens with a Chinese explanation and the entry is saved.
- Collapse with the panel button or Esc; reopen with Alt+W or the right-edge pill.
- Use the search box to filter saved words; press Enter to explain the typed word.
- In the detail page you can copy the explanation, re-explain (overwrites), or delete in two steps.
Configuration
The plugin row id is word-lens. Override it in your profile's cordis.patch.yml:
- id: word-lens
name: 'dsh-word-lens'
config:
provider: deepseek-official # optional; auto-detected when omitted
model: deepseek-flash # optional; auto-detected when omitted
maxTokens: 600
timeoutMs: 45000
# dataDir: 'D:/my-data/word-lens' # defaults to ~/.dsh/dsh-word-lens
# debug: false
# selftest: false # skip the one-time startup self-test (one short model call)
Without provider/model, the host prefers deepseek-official, then the first available provider, and prefers the models deepseek-v4-flash / deepseek-flash / deepseek-chat. Set them explicitly if your DSH profile only has other providers.
Data & privacy
- Saved words and explanations live in
~/.dsh/dsh-word-lens/(or$DSH_HOME/dsh-word-lens):store.json, plus diagnosticdebug.json/client-ready.json. - The selected word and up to 600 characters of surrounding context are sent to the model provider configured in your DSH profile. Nothing is sent anywhere else; there is no telemetry.
- Entries are shared only through your own disk backup — they are not tied to a conversation or an account.
Compatibility
- Tested with DSH 0.2.2-rc.1 on Windows, Node.js 22.13+.
- Requires the host services
llmandwebServer, available in DSH Desktop anddsh web. - The UI text is Chinese in this release; the explanation language follows the built-in prompt (Simplified Chinese).
Troubleshooting
- No pill on the right edge: refresh the page once (Ctrl+R); the client half mounts on page load.
- "解释" fails: open
~/.dsh/dsh-word-lens/debug.jsonand checkroute.provider/route.modelandlastError. A 503 usually means no model provider is configured — setprovider/modelin the config above. - Timeout: raise
timeoutMsor choose a faster model. - Explain from a new session: entries are global to this machine and profile, not to the conversation.
Security
This is a DSH plugin with a host half that runs inside the DSH main process. It only registers /_dsh/word-lens/* routes, reads/writes its own data directory and calls the host llm service. Read lib/index.js before installing third-party plugins in general.
Development
lib/index.js— host half, plain ESM, Node built-ins only.lib/client.js— prebuilt client bundle, consumed by the DSH client loader through the./clientexport. It is plain JavaScript (no React dependency).- No build step is required. When bumping the version, update
package.json,PACKAGE_VERSIONinlib/index.jsandVERSIONinlib/client.js.
License
MIT
中文说明
dsh-word-lens 是挂在 DeepSeek Harness 对话界面上的常驻词语解释窗口:读 AI 回答时遇到不懂的词,选中即可解释;窗口可随时展开/收起,不改变对话布局,也不打断当前输入。解释按词语保存在本机,换话题、开新会话、刷新页面、重启应用都不会丢。
功能
- 右边缘竖排贴片(带词条计数):点开/收起面板;Alt+W 切换,Esc 关闭。
- 在 AI 回答中选中 1–60 个字符,点击浮出的「解释」气泡生成中文释义。
- 面板支持本地搜索、回车解释新词、详情页(复制 / 重新解释 / 两步删除)。
- 词条持久化在
~/.dsh/dsh-word-lens/store.json(原子写、损坏备份、上限 2000 条),与当前对话无关。 - 只为轻量任务调用模型:DeepSeek 模型关闭思维链、低温度、短超时。
安装
- 插件市场(推荐):设置 → 插件 → 发现,搜索
dsh-word-lens(或「词语解释」)安装。 - 命令行:
dsh plugin --profile desktop add dsh-word-lens(dsh web用--profile web),随后刷新页面。 - 手动:把本目录复制到
%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-word-lens,按需在 profile 的cordis.patch.yml中加入本包的 bundle 行,重启/热重载后刷新页面。
配置
在 profile 的 cordis.patch.yml 中以 id: word-lens 覆盖配置:provider、model、maxTokens、timeoutMs、dataDir、debug。不填 provider/model 时自动选择:优先 deepseek-official,其次第一个可用提供方;模型优先 deepseek-v4-flash / deepseek-flash / deepseek-chat。
数据与隐私
词条与诊断信息只存放在 ~/.dsh/dsh-word-lens/;生成解释时,所选词语与最多 600 字上下文会发送给当前 DSH 配置的模型提供方,除此之外不发送任何数据,无遥测。
兼容与排错
- 在 DSH 0.2.2-rc.1 + Windows + Node 22.13 验证;需要宿主的
llm与webServer服务。 - 页面右侧没有贴片:刷新一次页面(Ctrl+R)。
- 解释失败:查看
~/.dsh/dsh-word-lens/debug.json中的route与lastError;503 通常是未配置模型提供方,按上面的配置指定provider/model。 - 超时:调大
timeoutMs或换更快模型。
安全
宿主半身运行在 DSH 主进程内,仅注册 /_dsh/word-lens/* 路由、读写自己的数据目录并调用宿主 llm 服务。安装第三方插件前建议先阅读 lib/index.js。
许可证
MIT
Related plugins
dsh-web (dsh-task-board)
zhu1090093659/dsh-web
dsh-web (dsh-web-all)
zhu1090093659/dsh-web
dsh-TUI
ccch1mneyyy/dsh-tui
dsh-web-ui (dsh-task-board)
zhu1090093659/dsh-web-ui