Introduction¶
When building agents with DeepSeek Harness, enabling the model to accurately understand code structure—especially TypeScript/JavaScript type systems—often requires the agent to actively invoke LSP tools. The DSH TypeLens plugin solves this problem. It performs local analysis and automatically supplements type declarations and diagnostic information after file reads and edits, allowing agents to obtain context without manual intervention.
What is This¶
DSH TypeLens is an automated plugin for bounded type context and edit diagnostics. It is maintained by fantasyce and is designed to provide local-first type support for DeepSeek Harness. By appending type declarations and diagnostic results to DSH request flows, it removes the need for agents to remember to invoke LSP tools.
Core Features¶
DSH TypeLens provides the following core capabilities:
- Automatic type context and diagnostics: After a file read, it appends only the complete type declarations needed to understand the visible code. After a file edit, it appends bounded TypeScript diagnostics and displays new errors with priority.
- Local analysis and privacy: Analysis runs entirely locally, with no outbound requests. Analysis state and counters reside only in memory and do not persist source-code analysis state.
- Native DSH integration: It provides explicit tool interfaces and offers health checks, automatic behavior tuning, limit settings, and reset functionality for in-memory cache and counters in DSH Web under Settings → TypeLens.
- Bounded and fail-open: It enforces limits on workspaces, file size, timeouts, depth, results, cache, and tokens. Even if analysis fails, it remains in fail-open mode and does not turn successful file operations into failures.
- Multilingual support: It supports TypeScript, TSX, JavaScript, JSX, Vue, and Svelte.
Installation and Activation¶
Before installing, make sure dsh and pnpm are installed on the system.
dsh --version
pnpm --version
Install it using the official plugin management commands:
dsh plugin --profile web add dsh-typelens
dsh plugin --profile headless add dsh-typelens
After installation, restart the affected DSH Profile, then use the following command to verify that the configuration takes effect:
dsh --profile web --dump-config
In DSH Web, go to Settings → TypeLens to view health status, adjust automatic behavior and limit parameters, or reset the in-memory cache and counters.
Typical Usage¶
DSH TypeLens provides four native tools for agents to invoke:
typelens_lookup_type: Finds named declarations related to a file.typelens_list_types: Lists bounded declarations related to a file.typelens_check: Runs bounded file and project diagnostics.typelens_explain: Inspects effective configuration, health status, circuit breaker state, and source-independent counters.
All paths returned by these tools are workspace-relative paths.
Use Cases and Notes¶
DSH TypeLens is suitable for developers who need to work with TypeScript, JavaScript, Vue, or Svelte projects in DeepSeek Harness. The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.
The plugin only persists validated settings, located at $DSH_HOME/typelens/settings, with owner-only permissions. Analysis context and diagnostic information are appended to agent steps and become part of the next DSH model request, so model-provider privacy policies apply.
Conclusion¶
DSH TypeLens provides standardized type context and diagnostic capabilities for DeepSeek Harness. Through a localized, bounded analysis strategy, it improves the accuracy and reliability of agents in code-editing tasks.