The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When developing agents or workflows, if a model requires specific tool capabilities, developers need to write plugins themselves. The dsh-greet-plugin is a minimal example plugin that registers a greet tool with the Harness, demonstrating how to write a pure JavaScript plugin.
Plugin Overview¶
This is a plugin maintained by imiss1314520 and licensed under MIT. It is implemented in pure JavaScript without relying on build steps, making it suitable as a starting point for developing custom tools.
Core Features¶
- Registers a
greettool - Pure JavaScript, no build steps required
- Configuration layer declared via
package.json - Inserts the plugin into the composition via
cordis.patch.yml
Installation and Activation¶
Install from GitHub using the official command:
dsh plugin --profile myprofile add github:<username>/<repo-name>
After installation, first verify that the configuration layer is active before starting the Harness:
dsh --profile myprofile --dump-config # The output should contain the "# == dsh-greet-plugin" layer
dsh --profile myprofile
Typical Usage¶
Enter the following in the session:
Use the greet tool to greet Ada.
The model will call the greet tool and receive the tool result Hello, Ada!.
Composition and Implementation¶
The plugin consists of three core files:
package.json: Declaresdsh.bundle.patchand runtime dependencies.cordis.patch.yml: Contributes a configuration layer, inserting a plugin line into the composition, referencing this package by its package name.index.js: The plugin entry point, exportingname,inject, andapply. It registers the tool viadefineToolwithinapply.
inject = ['tools'] ensures that apply is called only after the tool registry is ready. defineTool validates arguments based on parameters, execute returns canonical values declared by output.schema, and output.render then transforms them into model-facing content.
How to Modify¶
To transform this into your own plugin:
- Change the
nameinpackage.json, for example todsh-my-plugin. This package name is what others will use to install and reference it; it is independent of the repository name. - Change the
nameof the plugin line incordis.patch.yml; it must exactly match the package name above. - Change the
nameexport, tool name, parameters, and return values inindex.js. - If user-configurable options are needed, export a Schemastery schema as
Configand write the default values within the schema.
Notes¶
- Do not introduce build steps.
dsh plugin add github:...pulls source code, not build artifacts: if a package requires abuild, user installation will fail, and they would need to authorize it viaallowBuildsin the profile’spnpm-workspace.yaml. Keeping it pure JavaScript avoids this issue. - Write runtime dependencies into
dependencies; when others install via git or npm, pnpm will automatically install them. - The plugin runs with the permissions of the current dsh process. Check the source code and license before installation.
Publishing and Discovery¶
- Publish to npm:
pnpm publish. - To help others find this plugin: add the
dsh-plugintopic to the GitHub repository.
Related Links¶
- Plugin Directory: https://www.skillhub.cn/plugins/imiss1314520/dsh-greet-plugin
- GitHub Repository: https://github.com/imiss1314520/dsh-greet-plugin