ohoyour/dsh-file-mention--packages-client ↗★ 0
@ohoyo/dsh-client-ui-file-mention
DeepSeek Harness web client plugin: the '@' input-trigger source for @file/@directory mentions.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗@ohoyo/dsh-client-ui-file-mention
DeepSeek Harness web client half of the file/directory mention plugin: the @
input-trigger source (trigger: '@', name: 'file', order: -1).
How it works
- The plugin's async
applyfirst mounts a hand-written Typert contribution (ctx.remote.$mount(TYPERT_REMOTE), namespacefileIndex— the third-party equivalent of what@deepseek-ai/dsh-api-remotesdoes for built-in namespaces), then registers the source. - A complete snapshot uses a sessionId-level cache (host-configured TTL +
single-flight) and
candidates()filters/ranks locally with the same rules as the Host — the flicker-free fast path. When the Host marks the snapshotcomplete: falsebecause the workspace exceeds the index cap, each distinct non-empty query is resolved remotely and retained in a bounded per-session TTL cache. The Host shares one bounded metadata catalog across those queries, avoiding repeated workspace walks while typing. Incomplete-mode queries use a 50 ms abort-aware debounce, so superseded keystrokes do not start an RPC. Each response also carries a Host mutationrevision; if a query observes a newer revision than the base snapshot, the client returns that query result but discards its session cache so the next request refetches the base index. - Candidates: files
📄name+ parent-dir description; directories📁name/; clashing basenames becomedir/名字(directories keep/) so menu React keys stay unique. onPickinserts a native-highlighted unique@tokenwhen the complete index can prove it resolves to one path. Capped indexes and names that cannot use the legacy token grammar fall back to exact@{path}text, preserving spaces, punctuation, and duplicate basenames without the fixed-width chip.warm()prewarms the session cache; every remote failure returns[]and logs.
Build artifacts
lib/index.js— empty node half so the composition row mounts on the Host.lib/client.js— the browser bundle: a CJS factory-form artifact that registers throughwindow.__ModuleLoader__.load({ id, factory })(the harnessclientBundlepreset recipe), withzodinlined (the contribution codecs) and no@deepseek-ai/*value imports (bundle purity).
The dsh.client package.json metadata (inject + platform: "web") is what the
modules node half scans into window.__DSH_BOOT__ and serves as
/plugins//client.js.
Development
pnpm build && pnpm test
Tests (vitest) cover contribution mounting, single-flight caching, local filtering, basename disambiguation, highlighted and exact plain-text picks, codec serialization, failure containment, aborted keystrokes, TTL expiry, style cleanup, and the warm hook.
License
MIT