dsh-service-check
Scaffold and validate DeepSeek Harness (DSH) plugins, and check that the Services a plugin injects actually exist.
DSH has no official plugin marketplace, and community plugin sources disagree on metadata. That
makes the boring parts expensive: what exactly goes in package.json, which Loader operations a
patch may contain, what makes Plugin Manager show a title instead of a package name. dsh-service-check
generates a bundle that already satisfies those rules, then checks the result before you install it.
The part nothing else does: a plugin that declares export const inject = ['tools'] and then calls
ctx.tools.registr() loads cleanly and fails at the call site. This tool checks both the injected
name and the method against a catalog captured from a running Harness, so the typo surfaces here
instead of in production.
Renamed from
dsh-plugin-kit. That name is already used by two unrelated projects — an npm package by another maintainer, and a GitHub repository that has since moved todsh-scaffold. The old URL redirects. See docs/NAME-HISTORY.md.
Zero dependencies. Node 20+. Nothing to build.
Why
A DSH bundle is a package whose package.json declares dsh.bundle.patch, plus a Cordis YAML patch
that inserts plugin rows. A misplaced key fails silently at install time, and metadata mistakes
surface as a package name where a title belongs. Both are cheap to check and annoying to debug.
Install
Not on npm.
npx dsh-service-checkinstalls a different package that happens to share this name — see docs/BLOCKED-npm-name.md. Clone and run it directly until that is resolved.
git clone https://github.com/cndoin/dsh-service-check
cd dsh-service-check
node bin/dsh-service-check.js doctor ../my-plugin
To call it as dsh-service-check anywhere, link it once:
cd dsh-service-check && npm link # provides the dsh-service-check and dsc commands
Zero dependencies, so npm install is a no-op; there is nothing to build.
Commands
dsh-service-check new <dir>
Generates a bundle whose patch, manifest, locale file and icon already match what DSH reads.
| Flag | Meaning |
|---|---|
--kind host |
Host plugin. Registers Services or Event listeners. No browser half. |
--kind tool |
Adds one callable agent tool, with a Config schema. |
--kind ui |
Adds a client half that registers into the conversation.composer.dock Slot. |
--template <name> |
Start from a ready-made bundle instead of the bare skeleton. |
--name <pkg> |
Package name. Defaults to the directory name. |
--description <text> |
Written to the manifest and to meta.description. |
--force |
Write into a directory that already exists. |
Templates
--template picks a starting point. Each one is a real, installable bundle, not a stub.
| Template | Kind | What you get |
|---|---|---|
theme |
host | Registers CSS custom properties (--dsh-accent, --dsh-radius) with a Config schema, and removes them on unload. |
mcp |
host | Wraps an MCP server behind a Config schema (command, args, transport, url). Inert until configured. |
tool |
tool | One callable agent tool with a validated parameter schema. |
decoration |
ui | A small element rendered into the composer dock. |
dsh-service-check new my-theme --template theme --name my-theme
dsh-service-check doctor my-theme
The generated tree:
my-plugin/
├── package.json dsh.bundle.patch + dsh.client (ui only)
├── cordis.patch.yml - insert: [{ id, name }]
├── index.js export function apply(ctx, config)
├── client.js ui only: window.__ModuleLoader__.load(...)
├── locale/en.json meta.title / meta.description
├── icon.svg
├── README.md
└── LICENSE
dsh-service-check doctor [dir]
Walks dir (default .), finds every package that declares dsh.bundle, and reports problems.
Exits non-zero when any bundle has an error, so it works as a CI gate.
$ dsh-service-check doctor .
Bad_Bundle
✖ manifest/type package.json must declare "type": "module"
DSH loads plugins as ES modules; CommonJS is not supported.
✖ row/name-shape row name "./local-path", not a package specifier
✖ row/id-duplicate row id "bad-row" appears more than once
⚠ manifest/name name "Bad_Bundle" is not a conventional package name
⚠ meta/locale-export no "./locale/*.json" export
3 errors, 2 warnings
| Flag | Meaning |
|---|---|
--json |
Machine-readable report, for CI and editors. |
--quiet |
Print nothing; rely on the exit code. |
dsh-service-check templates
Lists the available templates with the kind each one produces.
dsh-service-check doctor [dir] --fix
Repairs the mechanical problems, then re-reports. The rule it follows: touch declarations,
never logic. A fix may add a missing manifest field, fill in display metadata, or drop a
meta.detail that points nowhere. It will not edit a plugin entry module or a patch, because both
change what actually loads — those come back as manual with the reason.
$ dsh-service-check doctor ./my-plugin --fix
my-plugin
fixed package.json: set "type": "module"
fixed package.json: added exports["./locale/*.json"]
fixed icon.svg: wrote a placeholder icon
fixed locale/en.json: set meta.title to "My plugin"
manual index.js: Service usage needs a source edit, so it is left to the author
✔ my-plugin: no problems found
It iterates, because repairing one problem can expose the next: adding the locale export is what
makes a broken meta.detail reachable. It stops after five passes.
| Fixable rule | What the fix does |
|---|---|
manifest/type |
adds "type": "module" |
meta/locale-export |
exports ./locale/*.json |
meta/locale-en |
creates locale/en.json |
meta/title |
fills meta.title from the package name |
meta/description |
fills meta.description from the package description |
meta/icon |
exports ./icon and writes a placeholder icon |
meta/detail-missing |
removes a meta.detail that points at a missing file |
meta/detail-escape |
removes a meta.detail that points outside the package |
dsh-service-check init [dir]
Answers "which Services does this package need?" from the catalog, before you write a line of
apply. It reads the package name and description, matches them against the 109 Host Services,
and prints the inject line plus a sketch of the first recorded method for each match.
$ dsh-service-check init .
dsh-service-check in /repo/dsh-service-check
catalog: 109 Host Services captured from DSH 0.2.1-rc.5 on 2026-12-01
installed: 0.2.1-rc.5 (from ~/.dsh/profiles/desktop/node_modules/@deepseek-ai/dsh-brand)
This package may need:
pluginManager Manage profile files and apply their declared reload lifecycle.
matched because "plugin" appears in the name or description
Declare them:
export const inject = ['pluginManager']
Sketch for apply:
ctx.pluginManager.readBundleDetail(/* … */) // Manage profile files, …
It is a hint generator, not an oracle. Every suggestion states why it matched, and the sketches use method names recorded in the catalog rather than invented ones. When nothing matches it says so instead of padding the list.
dsh-service-check services [query]
Browses the catalog. No argument lists all 109 with their descriptions and method names; a positional argument filters by Service name or description.
dsh-service-check services # everything
dsh-service-check services tool # 6 matches
dsh-service-check services --json # machine readable
Use it in CI
The repository also ships a GitHub Action, so a plugin repository can refuse a broken bundle
before anyone installs it. Because this project is not on npm, check the action out first and point
uses: at that checkout:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: cndoin/dsh-service-check
path: .dsh-service-check
- uses: ./.dsh-service-check/action
with:
path: .
It writes a job summary table, annotates every diagnostic inline on the diff, and exposes errors
and warnings as outputs:
| Input | Default | Meaning |
|---|---|---|
path |
. |
Directory to scan |
fail-on-warning |
false |
Treat warnings as failures too |
json |
false |
Also print the machine-readable report |
dsh-service-check links <file.md>
Checks the github.com/owner/repo links in a curated list and reports which ones no
longer work. Written after finding 24 dead entries across five DSH awesome-lists, none
of which re-check the entries already in them.
$ dsh-service-check links README.md
README.md
354 repository link(s), 354 checked in 41.2s
Dead (8):
✖ Degurechaff57/dsh-openapi HTTP 404
✖ JasonJin2006/dsh-sound-effects-plugin HTTP 404
...
Archived (10):
! Qintsg/dsh-safe-delete
...
Suggested annotations:
Degurechaff57/dsh-openapi (仓库已删除,链接失效)
Qintsg/dsh-safe-delete (已归档)
The classification is the HTTP status, not a guess:
| Status | Reported as |
|---|---|
| 200, not archived | ok |
200, archived: true |
archived |
| 404 / 451 | dead — fails the run |
| 403 / 429, or a transport error | unknown — never counted as broken |
That last row matters: a rate-limited check must not tell a maintainer their list is broken. A repository that redirects to a different slug is reported as moved, but is still ok.
--limit N bounds the work, --json prints the full result set.
There is also action-link/, which runs the link check on a schedule. It is a separate action
because the two have different failure semantics: a bundle that fails validation is the author's
bug, while a dead link in a curated list is rot the maintainer did not cause. Sharing one action
would force one exit-code policy on both.
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: cndoin/dsh-service-check
path: .dsh-service-check
- uses: ./.dsh-service-check/action-link
with:
path: README.md
fail-on-dead: 'true'
It writes a per-file summary table, annotates each dead or archived link on the diff, and exposes
dead, archived and unknown as outputs. unknown covers rate limits and transport failures
and never fails the job — a throttled run must not be reported as a broken list.
What it checks
Errors — DSH cannot load the bundle as written.
package.jsonis missing or is not valid JSON- no
name, noversion, ortypeother thanmodule dsh.bundle.patchis absent, or names a file that does not exist- the patch is not valid YAML, is not a sequence, or is malformed enough to abort composition
- a row has no
id, or two rows share one - a row has no
name, or itsnameis a path rather than a package specifier - a row that points at this package does not resolve to a module exporting
applyor a default class dsh.clientis declared withoutexports["./client"], or that file is missingmeta.detailescapes the package, is missing, or exceeds 1 MiB- a locale file is not valid JSON
Warnings — it loads, but not the way you expect.
- unconventional package name
- a patch that inserts no rows
- no
./locale/*.jsonexport, or nometa.title/meta.description - no exported icon (Plugin Manager falls back to generic artwork)
- a client half with no host row
- a
ctx.<service>used but missing fromexport const inject - an injected name that is not a Host Service in the bundled catalog
ctx.<service>.<method>()where the catalog does not record that method
Service checks
doctor reads the entry module and compares it against a catalog of 109 Host Services captured
from a live Harness (src/catalog/dsh-host-services.json). That catches the mistakes that fail
only at runtime:
broken-demo
⚠ service/inject-missing ctx.tools is used but not listed in inject
Add export const inject = ['tools'] so Cordis resolves the dependency before apply runs.
⚠ service/unknown-method ctx.tools.registr() is not a method the catalog records for "tools"
Recorded methods: register, restrict, get, executable, async resolve, …
The catalog is a snapshot, so an injected name that is absent is a warning, not an error: the user may be running a DSH release newer than the snapshot.
doctor also reports when the snapshot no longer matches the release you are running:
theme-minimal
ℹ service/catalog-stale DSH 0.3.0 is newer than the catalog (captured from 0.2.1-rc.5);
a Service reported as unknown may exist in your release
Regenerate the catalog with cordis_inspect_query host/Service.listService.
The installed version is read from $DSH_INSTALL_DIR, falling back to a sibling
@deepseek-ai package under $DSH_PROFILE_DIR/node_modules. When neither is available the check
says it could not determine a version rather than assuming the catalog is right.
Using it as a library
import { checkBundle, findBundles, parseYaml, scaffold } from 'dsh-service-check'
for (const { dir } of await findBundles('.')) {
const result = await checkBundle(dir, { parseYaml })
console.log(result.name, result.ok)
}
parseYaml understands the subset a bundle patch can contain, plus flow collections, block
scalars and comments. Unsupported constructs raise YamlError with a line number instead of
producing a half-parsed patch.
Limits
- The YAML parser is a deliberate subset. Anchors, aliases, multi-document streams and
!!jstags are rejected with an explicit error rather than guessed at. doctorchecks structure and metadata. It does not activate the plugin. Its Service and method checks run against a captured catalog rather than your installed Harness, so a match confirms nothing and a mismatch may only mean your release is newer. Confirm real behavior by running the plugin.- Slot ids other than
conversation.composer.dockare not validated against a live page.
See docs/BLOCKERS.md for what this project has deliberately not solved yet and the reason for each. Ready-to-post copy for V2EX, r/DeepSeekHarness and Show HN lives in docs/PROMOTION.md.
License
MIT
No comments yet. Be the first to write one.