dsh-deterministic-tools: A Deterministic, Offline, and Bounded Local Toolbox

Introduction

In the DeepSeek Harness (DSH) ecosystem, agents often need to handle tasks such as format validation, text statistics, and encoding conversion. Currently, the common practice is to let the model invoke the shell (e.g., PowerShell or Bash) to execute pwsh or jq. However, this is prone to issues with encoding, quoting, and version differences in Windows environments, and it is often non-reproducible.

Below is an introduction to dsh-deterministic-tools. This is a local toolbox plugin that registers 29 reproducible formatting and data processing tools for the model. It does not rely on the network, does not consume credentials, and returns structured receipts for every invocation, addressing the uncertainty and boundary issues agents face when processing structured data.

Installation and Activation

To install the plugin, use the official CLI command. Please ensure the DeepSeek Harness process is installed and configured with the web profile.

dsh plugin --profile web add dsh-deterministic-tools

After installation, you must restart the application because the plugin list is loaded at startup.

Note: Do not mix this plugin with separately installed components, otherwise tools with the same name will be registered redundantly.

Core Features

The plugin provides the following categories of tools, all prefixed with _ for easy identification:

  • Formatting & Validation: _format, _minify, _validate, _query, _diff.
  • Text Processing: text_stats, lines_process, case_convert, text_diff, regex_find, regex_replace.
  • Data Transformation: yaml_to_, _to_yaml, csv_to_, _to_csv.
  • Encoding & Inspection: base64_encode, base64_decode, hex_encode, hex_decode, url_encode, url_decode, url_inspect, hash_text, unicode_inspect, number_base, color_convert, cidr_inspect, jwt_inspect, timestamp_convert.

Usage Examples

The model can utilize these functions during conversations via natural language or tool invocation commands.

Validate JSON Syntax
When instructed to validate JSON with line and column precision, the model will invoke _validate. For example, given the input {"a":1,}, the tool returns the validation result and the exact error location:

{
  "valid": false,
  "error": {
    "message": "expected a double-quoted property name but found '}'",
    "line": 1,
    "column": 9,
    "position": 8
  },
  "top_level_type": "unknown"
}

Format Output
When using _format, indentation and sorting methods can be specified. For instance, by setting indent: 2 and sort_keys: true, the model can obtain the formatted JSON.

Unified Receipt Format
The return value of every tool follows a unified standard, containing a payload and metadata:

{
  "result": "...",
  "meta": {
    "bytesIn": 15,
    "bytesOut": 45,
    "truncated": false,
    "notes": []
  }
}

Design and Constraints

  • Pure Local Execution: The plugin executes locally with zero network requests and zero credential consumption.
  • Boundedness: Structured inputs have a hard limit and are rejected directly if exceeded (not truncated); text outputs have a soft limit, and truncation is marked if exceeded.
  • Determinism: Does not rely on random numbers or the system clock. It explicitly declares no signature verification.
  • Verification Status: Passes tsc --noEmit checks with no type errors; includes 35 test cases.

Summary

dsh-deterministic-tools lowers the barrier for agents handling structured data by transforming common formatting, encoding, and inspection operations into deterministic tools. It is suitable for scenarios requiring secure, fast local data processing with high demands on result reproducibility.

For more details and source code, please refer to: GitHub

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye