In the DSH plugin ecosystem, agents often need to process JSON data. When encountering formatting issues such as syntax errors, trailing commas, single quotes, or comments, manually locating error positions or fixing them item by item is time-consuming and error-prone. The dsh--validate plugin solves this pain point through automation, providing an end-to-end capability from validation to repair.
Core Features¶
Implemented in pure Node.js, the plugin provides the following capabilities:
- Validation and Location: Validates JSON syntax and directly identifies the line and column where the error occurs.
- Automatic Repair: Automatically fixes common JSON formatting errors, including but not limited to comments, trailing commas, and single quotes.
Installation and Enabling¶
Add the plugin using the official installation command:
dsh plugin add github:uckkk/dsh--validate
After installation, the plugin is automatically added to the profile’s package.json configuration. The tools registered by the plugin can then be invoked directly during a session.
Typical Usage¶
The plugin provides two core tool functions:
- Validate:
validate_json(text="...") - Fix:
fix_json
Use Cases and Caveats¶
This plugin is suitable for scenarios where you need to quickly process JSON text, normalize formatting, or troubleshoot syntax errors in the DSH environment.
Important Note: Installing the plugin means running third-party code on your local machine. Please review the source code before installation to ensure its behavior meets your security and compliance requirements.
Ecosystem Links¶
- GitHub: https://github.com/uckkk/dsh–validate
- Plugin Directory: https://www.skillhub.cn/plugins/uckkk/dsh–validate