Preface¶
When running DeepSeek Harness (DSH) on Windows, models and agents often rely on ad-hoc PowerShell scripts or regex to handle local issues: guessing the encoding of a byte stream, determining why path creation failed, extracting ports from netstat output, calculating directory usage, or finding duplicate files. Such scripts often guess incorrectly without acknowledging uncertainty, produce truncated output that looks complete, or silently drop characters during encoding conversion. The DSH community has packaged these capabilities into installable plugins; dsh-win-native, released by maintainer ax2 and categorized as “Model Inference” on SkillHub, essentially turns the aforementioned judgments into six tools with receipts, boundaries, and a read-only-first approach for agents within the harness to call.
What is this¶
dsh-win-native is a DSH plugin for Windows (npm package name dsh-win-native, current version 0.1.5, MIT license). The README positions it as a Windows Correctness Layer—turning the judgments agents usually hack together with PowerShell text parsing into tools that have receipts, boundaries, and tell the truth. The plugin contains 6 tools, has no installation-time scripts, and has no network dependency at runtime (README marks network: none). Each tool adheres to the DSH plugin contract: returns { result, meta }; rejects rather than truncates when structured input exceeds the budget; returns domain failures as successful results (e.g., a non-existent path is data, not a crash).
Compared to “letting the model write pwsh itself,” the README emphasizes that this logic is handled by a fixed implementation covered by 57 tests, avoiding issues where a single line of script might miss reserved device names, encoding ambiguity, or junction following problems.
Core Functions: Six Tools¶
Encoding: encoding_detect and encoding_convert¶
encoding_detect only analyzes base64 bytes provided by the caller; it does not read the disk. The flow is BOM → Strict UTF-8 → Scored Candidates; it supports scoring for scenarios like GBK, GB18030, Big5, and Shift_JIS, providing high / medium / low confidence and a list of close-scoring alternatives. Short samples may be indistinguishable in information theory (e.g., GB18030 and Big5 have overlaps in valid double-byte pairs); the tool will report low and explain in meta.notes rather than pretending to be certain.
encoding_convert also only processes base64 bytes. Target encodings include utf-8, utf-16le, utf-16be, gbk, gb18030, big5, shift_jis, latin1, ascii; when from: "auto", it detects first. Lossy conversions will list lossy_characters, lossy_list, and clearly mark them in meta.notes, without silently turning characters into ?.
Path: path_inspect¶
Pure string analysis, does not access the file system, so it can check paths even if they don’t exist. Coverage includes absolute/relative, \\?\ extended prefixes, UNC and drive letter forms, reserved DOS device names (including CON.txt with extensions), illegal and control characters, trailing spaces or dots, 8.3 safety, segment length, and MAX_PATH (260), etc.; each issue comes with a code, severity, and position. README example: the path C:\temp\CON.txt will return reserved_name and safe_for_max_path: false.
Network: netstat_parse¶
Only parses netstat text pasted by the caller; does not touch the file system or write to disk. Used to turn port occupation output from “regex hacks” into structured parsing (specific fields depend on the plugin implementation and tests).
Read-only Disk: dir_usage and file_duplicates¶
These two tools will read the file system, but the plugin promises to never delete, move, rename, or write to any file.
| Tool | Disk Read | Disk Write |
|---|---|---|
dir_usage |
lstat + opendir traversal of specified absolute path |
No |
file_duplicates |
Streaming SHA-256 content reading | No |
Both reject relative paths (meaning depends on the host process working directory; the plugin chooses to reject rather than guess). Traversal uses lstat; symbolic links, junctions, and other reparse points are skipped and reported (skipped_links), not followed. Input has a budget; requests exceeding the budget are rejected. file_duplicates only reports duplicate groups and reclaimable bytes; reclamation is performed by humans or upper-layer policies.
The other four tools (two encoding, path, netstat) do not touch the file system.
Installation and Activation¶
In the DSH environment, the installation method given in the README is:
dsh plugin --profile web add dsh-win-native
After installation, you need to restart the application (the bundle list is read at startup). If you wish to install four related plugins from ax2 in one go (including dsh-deterministic-tools, dsh-jvm-doctor, dsh-py-doctor), you can use the bundle package dsh-toolbox-bundle; the README explicitly states: do not mix with standalone installations. For a family overview, see zicode.com/software.
Runtime requirements (from package.json): Node.js >=20.10; peer dependencies @deepseek-ai/cordis >=4.0.0, @deepseek-ai/dsh-tools >=0.2.0-rc.1.
Typical Usage¶
1. Check if a path is valid¶
Ask the agent something like “Is the path C:\temp\CON.txt usable?”, and the model can call path_inspect. The README’s actual output snippet is as follows:
{
"issues": [
{
"code": "reserved_name",
"severity": "error",
"position": 8,
"detail": "segment \"CON.txt\" is a reserved DOS device name, even with an extension or a path prefix"
}
],
"safe_for_max_path": false,
"canonical_length": 15
}
2. Detect GBK-like byte stream encoding¶
The input is base64-encoded bytes (e.g., GBK text containing “Config file path: C:\Users\ax2, service not started.”), call encoding_detect:
{ "base64": "..." }
Returns the best candidate (e.g., gb18030), confidence, BOM info, and the score, sample, round_trip, etc. for each encoding in alternatives, facilitating manual or upper-layer policy decisions in cases of ambiguity.
3. Lossy conversion must be visible¶
When converting UTF-8 “Chinese test” to latin1, call encoding_convert:
{
"base64": "5Lit5paH5rWL6K+V",
"from": "utf-8",
"to": "latin1",
"bom": "strip"
}
The result will include lossy_characters: 4, lossy_list listing unrepresentable code points character by character, and a LOSSY explanation in meta.notes.
Use Cases and Notes¶
Who it is for: Developers doing operations, troubleshooting, and code repository analysis via DSH on Windows; scenarios requiring stable handling of multi-byte encodings (Chinese/Traditional Japanese, etc.), Windows path rules, netstat output, or directory usage and duplicate file analysis with defined boundaries.
Ecosystem Note: DSH adopts an “everything is a plugin” extension approach; SkillHub (Plugin Directory Page) is a community directory site, with no official affiliation to DeepSeek / High-Flyer, and should not be understood as an official app store.
Security and Permissions: The plugin runs with the permissions of the current DSH process user; dir_usage and file_duplicates will read content under the absolute paths you specify. Before installation, you should review the GitHub Repository source code and MIT license to ensure compliance with your environment policies. The plugin is designed to be offline, local-first, and network-free, but the scope of disk reading still depends on the path parameters passed by the agent.
Adjacent Plugins: The same maintainer also provides dsh-deterministic-tools, dsh-jvm-doctor, dsh-py-doctor, and the bundle dsh-toolbox-bundle. These can be combined as needed, but do not mix installs with the bundle.
Conclusion¶
dsh-win-native consolidates high-frequency, error-prone local judgments on Windows into six structured tools: encoding detection and auditable conversion, path validity, netstat parsing, and budgeted read-only disk statistics and duplicate file reporting. If you are tired of “looks like GBK” and “path error, try changing slashes” in your harness, you can learn about the intro and classification from the directory page, install it according to the README, and let the agent call these tools after restarting DSH.
- Directory Page: https://www.skillhub.cn/plugins/ax2/dsh-win-native
- GitHub: https://github.com/ax2/dsh-win-native