Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture. To provide controlled programming capabilities in agent development while avoiding damage to the core environment, specialized tools with boundary constraints are needed. dsh-coding-tools is a DeepSeek Harness host plugin maintained by leonardoxr. It adds a restricted set of coding tools through the plugin mechanism without modifying the DSH core code.
Core Features¶
The plugin provides four core capabilities, all running in a controlled secure sandbox:
- code_read: Provides a UTF-8 code window with precise byte version tokens to ensure atomic reads.
- edit_ranges: Supports atomic edits to observed ranges and allows operators to configure approval workflows.
- ast_grep: Provides AST (abstract syntax tree)-based static analysis tools by running over file snapshots, with pagination and read-only process isolation.
- lsp: Provides persistent read-only language server queries using restricted JSON-RPC protocol communication.
Installation and Enablement¶
Before installation, ensure the environment meets the following requirements:
* Node.js 22.19+ or 24+
* DeepSeek Harness 0.1.1-rc.2 or a compatible public service contract
* The DSH Profile in use (such as the Web Profile) must provide the tools, fs, sandboxPolicy, sandbox, approval, spillStore, subprocess, and settings components
Run the following commands to complete installation and registration:
pnpm install
pnpm check
dsh plugin --profile web add "C:\absolute\path\to\dsh-coding-tools"
After installation, DSH inserts the dsh-coding-tools plugin entry into the configuration via cordis.patch.yml. After installing a host plugin, the Web Profile must be restarted for the changes to take effect. A raw source-code patch alone cannot complete package registration.
Typical Usage¶
Code Reading and Editing¶
This is the core workflow, ensuring that edits are based on an exact version snapshot:
- Call
code_readwith the file path and optional 1-based offset (offset) and limit (limit). - Preserve the returned
version. - Call
edit_ranges, passing the exact same file and version; the operations must be non-overlapping. - In a read-only session, if an edit is rejected, you may retry once by providing a reason in
justificationand settingsandbox_permissions: workspace-write. Sandbox elevation requires separate approval.
Structured Search¶
When calling ast_grep, provide the following parameters:
* pattern: Search pattern
* paths: Must include one regular workspace file
* language: Required language identifier
* strictness: Optional strictness configuration
* pageLimit: Page limit
* cursor: Owner-scoped cursor
Use Cases and Notes¶
- Feature Scope: In the current security-first release,
ast_editand DAP (Debugger Protocol) debugging are intentionally not registered. - Browser Limitation: The browser build is limited to use within the “Coding tools” settings card.
- Windows Compatibility: A native Windows compatibility switch (
allowWindowsPartialReadOnlyProcessConfinement) is provided. Enabling this option lowers the process isolation level (enforced by restricted tokens), but it is not an equivalent implementation of full Linux isolation. In this mode, FAT-like file systems, ACLs writable by everyone, and NTFS hard links may weaken write isolation, and the backend does not isolate reads, network access, or process visibility. Use only in environments where repositories and executables are fully trusted. - Configuration Requirement: Executable paths in the configuration must be absolute paths.
- Profile Dependency: The plugin requires the Profile to provide full toolchain and sandbox policy support.
Short Conclusion¶
dsh-coding-tools provides DeepSeek Harness with a secure, controlled set of coding tools. Through strict version-token management and sandbox constraints, it offers the necessary code manipulation capabilities in agent development while preserving secure environment boundaries. For more details, see the GitHub repository or the community plugin catalog.
- GitHub: https://github.com/leonardoxr/dsh-coding-tools
- Catalog: https://www.skillhub.cn/plugins/leonardoxr/dsh-coding-tools