dsh-fetch-models-search
Manifest validDSH plugin: adds search filtering to the "Fetch available models" candidate dialog.
dsh-fetch-models-search
Add a search box to the Fetch available models dialog in DSH settings → Models — filter the candidate model list as you type.
A pure browser-side DSH plugin. It injects a search input above the candidate list opened by Fetch available models and filters rows in real time (case-insensitive substring match on the model id). It does not modify or patch any component code — it is a self-contained DOM enhancement that degrades to a no-op when the dialog is not present.
Features
- 🔍 Search box injected at the top of the candidate model picker; type to filter instantly.
- 🧱 No component modifications — built entirely on stable DOM structure, no CSS-hash class selectors.
- ♻️ Survives React re-renders: a
MutationObserver(frame-coalesced viarequestAnimationFrame) re-applies the current filter whenever the candidate list is rebuilt. - ✓ Filtering never touches checkbox selection or the Select all / Deselect all semantics.
- 🧹 Fully reversible: only
displaytoggles and one injected style element; uninstall restores the page exactly. - 🌐 Localized: search placeholder and "no matches" hint follow the page language (
zh⇒ Chinese). - 🪶 Zero runtime dependencies: the bundle does not
importany@deepseek-aimodule at runtime and ships its complete__ModuleLoader__.loadclosure factory wrapper.
Installation
Install from GitHub into the web profile:
dsh plugin --profile web add github:masknull/dsh-fetch-models-search
Or, from a local checkout:
dsh plugin --profile web add link:D:\.dsh\plugins\dsh-fetch-models-search
# or from the package directory itself:
dsh plugin --profile web add .
Restart DSH Desktop / the dsh service after installing. The client-module graph (
window.__DSH_BOOT__) is composed at startup; a page refresh alone will not pick up a newly added plugin bundle.
Usage
- Open Settings → Models.
- Expand a pi-ai provider card and click Fetch available models.
- The picker opens with a search box above the candidate list. Type part of a model id to narrow the list; clear it to show all candidates again.
- Selection behaviour (checkboxes, Select all / Deselect all, Add selected) is unchanged.
How it works
- Targeting: the picker is a
ui-primitivesModalrendered viacreatePortalintodocument.body—role="dialog"+aria-modal="true". Its unique structural fingerprint is a<ul>whose<li>children containinput[type=checkbox](other dialogs, e.g. the delete-confirmation dialog, have no such list). No CSS-module hash class names are used, so the anchor is immune to theme/language changes. - Injection: a search
<input type="search">is inserted immediately before the candidate<ul>; a<style>element with--dsw-alias-*-token styling is injected once into<head>. - Filtering: rows keep their DOM nodes; non-matching ones get
display: none. A "no matching models" hint appears when the query yields nothing and disappears when cleared. - Lifecycle:
apply(ctx)registers the observer and hands a cleanup back throughctx.effect; the plugin unload restores everything (observer disconnected, style removed).
Uninstall
dsh plugin --profile web remove dsh-fetch-models-search
Package layout
| Path | Purpose |
|---|---|
cordis.patch.yml | bundle patch — inserts the fetch-models-search loader row |
lib/index.js | host half — empty apply (the row must exist host-side; the browser half is discovered via the dsh.client declaration) |
lib/client.js | browser half — search-box injection + filtering |
scripts/verify.mjs | jsdom end-to-end verification (18 assertions) |
Development & verification
node scripts/verify.mjs
The script loads lib/client.js through a simulated window.__ModuleLoader__, builds a dialog DOM isomorphic to the real picker, and asserts: correct dialog targeting (no false positives on other dialogs), injection, filtering, checkbox isolation, filter persistence across re-renders, no-match hint, re-open re-injection, and lifecycle cleanup.
Limitations
- Applies only to the Fetch available models picker; manually edited model rows are not involved.
- Matching is a case-insensitive substring match on the candidate id text only (no fuzzy / regex).
- Select all / Deselect all still targets all candidates (original behaviour unchanged by the current filter).
License
Comments
Loading…
Similar plugins
by chancoki
为 DeepSeek Harness (DSH) Web GUI 提供模型搜索功能的插件——在模型选择弹窗中添加关键字搜索框,快速筛选模型。
★ 0
JavaScript
Sep 7, 2026
dsh plugin --profile web add dsh-model-search-pluginby Nannannan233
改进了模型选择框,添加了搜索 + 按提供商分组 + 最近使用功能
★ 0
MIT
JavaScript
Aug 18, 2026
dsh plugin --profile web add dsh-better-model-pickerby HeathHe
Adds a search box to the DeepSeek Harness Web GUI model switcher — filter by model name, ID, or provider instantly while preserving every official interaction.
★ 0
MIT
JavaScript
Aug 20, 2026
dsh plugin --profile web add dsh-model-searchby Townrain
Deselect-all button for the DSH Settings > Models 'fetch available models' dialog (client-only plugin)
★ 0
MIT
JavaScript
Aug 17, 2026
dsh plugin --profile web add dsh-fetch-models-unselect-allby swyc520
DeepSeek Harness (dsh) 插件:在「设置 → 模型」里逐个勾选要显示的模型,未勾选的从模型选择器菜单中隐藏。
★ 1
MIT
JavaScript
Oct 23, 2026
dsh plugin --profile web add @swyc520/dsh-plugin-model-whitelistby qgx1992
DSH web 插件:把输入框模型选择控件替换为两个独立按钮(供应商 + 模型两级联动,支持推理等级调节)
★ 0
JavaScript
Aug 27, 2026
dsh plugin --profile web add dsh-model-select-style