dsh-plugin-at-mention
August 14, 2026 · View on GitHub
Codex-style @ file mentions for the DeepSeek Harness web GUI: type @ in the composer, search the workspace files (and directories) as you type, and pick one — the literal @path text lands in the draft and ships to the model, which resolves the mention with its own read tools.
Developed against the DeepSeek Harness web client (task01) and reviewed/hardened in task02 (typecheck fixes, export-barrel completion, and a breadth-first walk fix). The code is published here as the plugin's source; it is designed to be mounted inside a deepseek-harness checkout.
How it works
composer "@" → input-trigger pipeline → ui-file-mention source
→ workspace.search RPC (sessionId + query)
→ host resolves session cwd from the session header
→ bounded breadth-first tree walk (this repo: host/)
→ ranked candidates (basename-prefix > basename-substring > path-substring)
→ pick inserts "@path " literal (plain-text reference)
- No context injection: mentions are plain text; the model reads the file itself with its own tools (the harness's plain-text-reference decision).
- No chip decoration: workspace trees are unbounded and change under the session, so the source implements no lexicon roll.
- Bounded per keystroke: one RPC per keystroke; each host walk is capped (50 results, 4000 visited nodes, 16 levels,
.git/node_modulesskipped) and abortable via the carrierAbortSignal.
Layout
| Path | Contents |
|---|---|
client/ | The browser plugin @deepseek-ai/dsh-client-ui-file-mention: the @ source registration, locale dictionaries, node half, invariant companion, tests, package metadata. |
host/ | Self-contained extraction of the workspace.search walk core (mentionSearch + ranking + bounds), plus the RPC handler as wired in the harness. |
e2e/ | Browser end-to-end scenario (file-mentions.e2e.ts) and its golden aria snapshot. |
docs/ | The feature Agent Note (EN + ZH). |
Mounting inside deepseek-harness
The plugin ships as a client package plus a host RPC. To integrate it into a deepseek-harness checkout:
- Package — place
client/atpackages/client/ui-file-mention/(it is a standard dsh client plugin package:dsh.clientmanifest,tsdownclient bundle, invariant companion). - Registration (three surfaces, all required) — add the package to
tsconfig.client.jsonreferences, add adsh.clientrow topackages/bundle/web-app/cordis.patch.yml, and declare the dependency inpackages/bundle/web-app/package.json. - Host RPC — implement
workspace.searchincreateApiProxy(packages/host/apiproxy/src/api-proxy.ts) usingmentionSearchfromhost/workspace-search.ts; register the method inapi/rpc-map.ts, the request/value schemas inapi/workspace.schema.ts, and the carrier routes infetch/client.ts+fetch/handler.ts. Theworkspacedomain types (WorkspaceSearchEntry/WorkspaceSearchResult) must be re-exported through the connection and api-remotes client barrels. - Rebuild — rebuild the client bundle (
pnpm --filter @deepseek-ai/dsh-client-ui-file-mention bundle) and the web frontend before probing a livedsh webserver (the registry serveslib/client.js, not sources).
Development notes
- Breadth-first walk — the visited-node cap spreads across the tree so an alphabetically-last subtree cannot starve matches in early directories (
.agents,apps) on large trees. This was a bug found in review (the original depth-first LIFO walk returned zero results for@skillson the deepseek-harness repo itself); seedocs/2026-08-14-file-mentions-web-composer.md. - Tests —
client/tests/browser-plugin.client.spec.tscovers source registration, locale dictionaries, HMR-safety disposal, candidate mapping, and pick outcomes. The harness-side host spec (api-proxy-workspace-search.spec.ts) exercises the walk against a real temp tree, including the visited-cap regression test. - Known limitations — plain-text mentions (no context injection), no chip decoration, one bounded walk per keystroke (a per-session cached index is deferred work).
License
MIT — see LICENSE. Copyright (c) 2026 Jack-c101. The plugin was developed for and derived from DeepSeek Harness (Copyright (c) 2026 DeepSeek, MIT), whose license is reproduced in full alongside.