DSH (DeepSeek Harness) is a plugin-based ecosystem, and developers often need to handle data transformation in agent development. When JSON data needs to be converted into Rust structs, the dsh--to-rust plugin provides a convenient solution.

Plugin Introduction

This is a plugin implemented purely in Node, providing the json_to_rust tool for converting JSON data into Rust structs that support serde.

Installation and Enablement

Use the official installation command:

dsh plugin add dsh--to-rust

After installation, you need to add "dsh-json-to-rust" to dsh.profile.bundles in the profile’s package.json to enable the plugin.

Core Features

  1. json_to_rust: The core conversion tool responsible for converting JSON data into Rust struct code.
  2. Pure Node implementation: The plugin runs on Node.js.
  3. serde support: The generated Rust code is compatible with the serde library.

Typical Usage

Invoke the tool registered by the plugin in a session. For example:

把这个 JSON 转成 Rust 结构体
→ 调用 json_to_rust(data={id:1,name:"test"})

Dependencies and Notes

The plugin requires the following packages at runtime:
* @deepseek-ai/cordis
* @deepseek-ai/dsh-tools

Note: Installing it runs third-party code on your local machine. Please review the source code and license yourself.