← Back to home@chenhz01

dsh-sample-plugin

Verified sample plugins for DeepSeek Harness: hash_sum tool + tools/result hook (8/8 checks)

Stars
0
Language
TypeScript
Created
Sep 23, 2026
Updated
Sep 23, 2026

Introduction

dsh-sample-plugin

A minimal, verified sample of writing plugins for DeepSeek Harness ("everything is a plugin"). Not official — just a community example that runs.

Two plugins, one composition:

  • src/tool-hash-sum.ts — a model-callable hash_sum tool (sha256/sha1/md5 over text or file). Follows the defineTool contract from the official docs: typed parameters, canonical JSON output, model-facing render, exec.signal cancellation.
  • src/result-logger.ts — a hook plugin observing the documented tools/result extension point, counting every final outcome without touching dispatch.

Verified, not "should work"

End-to-end run against the real service stack (Timer + SystemPrompt + ToolRegistry, same as the harness's own test helpers), 8/8 checks pass:

#CheckResult
1schemas() model-facing projectionpass
2canonical JSON value + render outputpass
3known-answer check: sha256("abc") = ba7816bf…15adpass
4file hashing via exec.signal-aware I/Opass
5cross-field validation (exactly one of text/path) contained as isErrorpass
6unsupported algorithm contained, no crashpass
7tools/result hook observed 5/5 outcomespass
8effect-based unregistration (dispose removes tool)pass

Run it

npm install
node --import tsx verify.ts

Node 22+. Dependencies resolve from npm: @deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-system-prompt, @deepseek-ai/cordis-plugin-timer. No API key needed — the sample runs keylessly, same as the official Cordis tutorial.

Three gotchas worth knowing (learned the hard way)

  1. output.schema is a DSL, not raw JSON Schema (ValueSchemaSpec): object nodes must declare additionalProperties, required is only supported on parameter properties, and type: 'json' exists only in the DSL.
  2. Raw registry.register() validates against plain JSON Schema instead — where type: 'json' is not a thing.
  3. registry.execute() requires a caller signal — the registry reads callerSignal unconditionally.

License

MIT. Third-party packages used under MIT / BSD-3-Clause — see THIRD_PARTY_NOTICES.md.


Built as a first-contribution probe for the dsh plugin ecosystem. Feedback welcome: hcac4735@agent.qq.com · GitHub @chenhz01

Collaboration

Everything in this repo is free to use — no locked layers, no upsell.

  • Free: this sample, its verification script, and the three gotchas above. Copy them.
  • Custom plugin development: I take paid engagements building production dsh plugins (tools, hooks, protocol bridges). Two things to include in an email: what your harness deployment needs, and your timeline.
  • Not offered: opinions on DeepSeek's roadmap — that's their court, not mine.

If you're deciding whether to email: the verification table above is the quality bar. If it looks like your bar, we'll probably get along.