- Home
- Plugins
- Dev & Plugin Tools
- dsh-service-check
dsh-service-check
cndoin/dsh-service-check
Validates a DSH plugin bundle before install: manifest, patch, locale and icon metadata, and whether the injected Host Services and the methods called on them actually exist.
Install
dsh plugin --profile web add github:cndoin/dsh-service-checkREADME
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.
Zero dependencies. Node 20+. Nothing to build.
The mistake this catches
This is the one that costs an afternoon:
export const inject = ['tools']
export function apply(ctx) {
ctx.tools.registr({ /* ... */ })
// ^^^^^^^ loads fine, throws here, at runtime, in front of a user
}
ctx.tools.registr() is not a method. The plugin installs, the Host starts, the patch applies, and
nothing complains until that line runs. doctor compares every ctx.<service>.<method>() against
a catalog of 109 Host Services captured from a running Harness, so the typo is reported before
you ever install it:
$ dsh-service-check doctor broken-demo
broken-demo
⚠ meta/locale-export no "./locale/*.json" export
Plugin Manager reads meta.title and meta.description from exported locale files.
⚠ service/unknown-method ctx.tools.registr() is not a method the catalog records for "tools"
Recorded methods: register, restrict, get, executable, async resolve, definitions, schemas, setExecutor, …. A typo here fails only when the line runs.
2 warnings
Nothing else does this check. A linter cannot: the method name is a string the Host resolves at runtime.
Why the rest is also worth checking
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 cheap to check and annoying to debug.
Install
Run it without installing anything. npm resolves a git spec directly, so this works from an empty directory:
npx github:cndoin/dsh-service-check doctor ../my-plugin
Verified from nothing but a clean working directory: npx github:cndoin/dsh-service-check new demo --kind tool creates the bundle and ... doctor demo reports
✔ demo: no problems found.
Below, dsh-service-check stands for whichever form you chose — the same
subcommand and flags work in all of them.
As a DSH plugin — from the Plugin Manager, or with any spec pnpm accepts. The installer understands git specs directly, so no npm publication is needed:
github:cndoin/dsh-service-check#v0.28.0
Pin a tag rather than tracking main, so the tool you check with does not change
under you. The tag is bumped with every release; v0.19.3 is the current one.
Verified by installing it that way: the installed tree contains index.js, cordis.patch.yml,
icon.svg and locale/en.json, and import('dsh-service-check') resolves to apply, inject, name.
(Note the bare specifier — the exports map does not expose /index.js as a subpath, so
dsh-service-check/index.js fails with ERR_PACKAGE_PATH_NOT_EXPORTED.)
As a local clone — for reading the source or hacking on the check itself. There is nothing to build:
git clone https://github.com/cndoin/dsh-service-check
cd dsh-service-check
npx . doctor ../my-plugin # or: node bin/dsh-service-check.js doctor ../my-plugin
To get a dsh-service-check command on your PATH, link the clone once:
cd dsh-service-check && npm link # provides the dsh-service-check and dsc commands
One caveat up front: this is not published to npm, so a bare npx dsh-service-check will not
work — the name is free on the registry but unclaimed. The github: form above does, because npm
installs from the repository instead. The reason for the registry gap is in Notes;
none of it affects using the tool.
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.
Add --strict to fail on warnings too. That matters more than it sounds: the typo
this tool exists to catch — ctx.tools.registr() — is a warning, because the plugin
does load and fails only when that line runs. A CI job using plain doctor passes
it. Use --strict when "it loads" is not the bar you want.
$ dsh-service-check doctor .
Bad_Bundle
✖ 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. |
--remote <url> | Check a repository without cloning it first. |
dsh-service-check doctor --remote <url>
Checks a repository you have not cloned. A catalogue lists plugins by URL; this answers "is that entry actually installable?" with one command:
$ dsh-service-check doctor --remote https://github.com/buhuikongpan/dsh-pluginmanager
Checking https://github.com/buhuikongpan/dsh-pluginmanager
dsh-pluginmanager
⚠ service/inject-missing ctx.tools is used but not listed in inject
1 warning, 1 info
A /tree/<ref>/<path> URL checks only that subdirectory, which is what you want for a
monorepo package:
$ dsh-service-check doctor --remote https://github.com/zhiyuanvision-lang/InkMap/tree/main/packages/harness
It shallow-clones into a temporary directory and removes it afterwards, including when the
clone fails. What it will not do: --fix needs to edit files, and edits to a throwaway
clone would be discarded, so the two flags are refused together. The URL is checked before
it reaches git, so a path or an option such as --upload-pack=… is rejected rather than
passed through, and a subpath cannot resolve outside the clone.
Checking a bundle the way the Host does
doctor reads a bundle statically. scripts/host-check.mjs runs it: import the
module, call apply(), capture what ctx.tools.register() receives, and validate
each definition against the Host's own schema validator.
npm run host-check -- ../my-plugin
The difference is not academic. doctor passed a scaffolded bundle whose tool
registered a property map where the request builder needs a schema document — the
manifest, patch and locale were all correct, and the defect was inside the
definition the module builds at runtime. Nothing static can see that.
It needs a profile to borrow @deepseek-ai/dsh-tools from; set
DSH_PROFILE_NODE_MODULES if yours is not in the default place.
A bundle that declares ./client has a second half, which is not an ES module — it
calls window.__ModuleLoader__.load({ id, factory }). That is checked separately:
npm run client-check -- ../my-plugin
It supplies the globals the file expects, runs the factory, and calls apply()
against a recording ctx.slots. It reports the module id it registers under, the
inject list, and the slot names apply() touches. It does not render anything,
so it cannot tell you the decoration looks right — only that the file parses,
registers, and hands back an apply that runs.
Auditing a list of repositories
scripts/audit.mjs runs doctor --remote over a file of URLs and summarises the
result. A catalogue maintainer can answer "which of these entries are actually
installable?" without cloning anything by hand:
npm run audit -- list.txt --json out.json
list.txt is one URL per line, optionally followed by a tab and a label.
Run against a random sample of 100 entries from the public DSH catalogue:
checked 100
no errors 97
with errors 3
crashed 0
clone failed 2
not a bundle 0
error rules:
tool/parameters-shape 3
All three were confirmed by reading the source: each writes parameters as a JSON
Schema document, which the Host rejects at load. Zero false positives and zero
crashes across the sample.
Exit codes follow the same rule as doctor: 0 clean, 1 found problems,
2 could not run, and 3 when this tool itself crashed — a crash is a bug here,
not a finding about the code under test.
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, and --write rewrites the
file in place:
$ dsh-service-check links README.md --write
Updated README.md:
+ PerryLink/dsh-plugin-kit
+ Noob-stupid/example-gone
--write only touches the line that holds the link, so list structure, indentation and
surrounding prose survive. It is idempotent: an entry that already carries the note is left
alone, and an archived note is removed again if that repository comes back. A dead note is
never removed, because a deleted repository does not return. The note goes inside a trailing
sentence period rather than after it, in both English and Chinese.
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.
--baseline <file> changes what a failure means. A curated list rots slowly, so without a
baseline every run reports the same historical dead links and the signal is lost on a pull
request:
$ dsh-service-check links README.md --baseline .dsh-links-baseline.json
Compared with .dsh-links-baseline.json:
1 new, 7 known, 1 fixed
+ someone/newly-deleted-repo
- old/dead-repo resolves again
Only new fails the run, so a list with known rot can still be protected against new rot.
--update-baseline rewrites the file. An archived entry that becomes gone counts as new
because the link now 404s; an entry that resolves again is reported as fixed and dropped, so
the file shrinks instead of accumulating stale entries. A malformed baseline is an error rather
than an empty baseline — treating it as empty would report every known link as newly broken.
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 an absolute path rather than a specifier - a relative row
name(./lib/plugin.js) that resolves to no file in the package - a row that points at this package does not resolve to a module exporting
applyor a default 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
ctx.tools.register()without anoutputdeclaration — the registry throws at loadparameterswritten as a JSON Schema document instead of a property map — also throws
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
Rule names
Every diagnostic carries the rule that produced it, so a CI annotation says what to look at rather than only that something is wrong.
| rule | severity | fires when |
|---|---|---|
manifest/read | error | package.json is absent or is not valid JSON |
manifest/name | error | no name, or not a usable package name |
manifest/version | error | no version |
manifest/type | info | type is not module — a hint, not a requirement: the Cordis loader normalizes ESM/CJS/default export shapes |
bundle/patch | error | dsh.bundle.patch missing or malformed as a declaration |
bundle/patch-missing | error | the declared patch file is not in the package |
bundle/patch-generated | info | the patch lives under a build directory, so it is produced by the build |
bundle/patch-syntax | error | the patch is not parseable YAML |
bundle/patch-shape | error | the patch is not a top-level sequence |
bundle/patch-empty | warning | the patch inserts no rows |
bundle/patch-layers | info | dsh.bundle.patch is a list; says how many layers |
bundle/patch-row | error | a patch entry is not a row or a known operation |
bundle/patch-operation | warning | an operation is none of insert / override / remove |
row/id | error | a row has no id |
row/id-duplicate | error | two rows share one id |
row/name | error | a row has no name |
row/name-shape | error | the name is an absolute path rather than a specifier |
row/name-relative | error | a relative name resolves to no file in the package |
row/name-generated | info | the relative name is build output, absent until the package is built |
row/entry | error | the entry module is missing |
row/entry-built | info | the entry is build output that is not in the checkout |
row/entry-esm | error | the entry exports neither apply nor a default |
client/platform | error | dsh.client.platform is not web |
client/export | error | dsh.client is declared without exports["./client"] |
client/file | error | the client file is missing |
client/file-built | info | the client file is build output absent from a checkout |
client/no-host-row | warning | a client half without a host row |
meta/title | warning | no meta.title |
meta/description | warning | no meta.description |
meta/locale-export | warning | no ./locale/*.json export |
meta/locale-en | warning | no English locale file |
meta/locale-json | error | a locale file is not valid JSON |
meta/icon | warning | no exported icon |
meta/icon-missing | error | exports["./icon"] is declared but the file is absent |
meta/icon-unpublished | warning | the icon exists but files would not publish it |
meta/detail-missing | error | meta.detail points at nothing |
meta/detail-escape | error | meta.detail escapes the package |
meta/detail-size | error | meta.detail exceeds 1 MiB |
service/read | error | the entry module cannot be read |
service/inject-missing | warning | ctx.<service> used but not in export const inject |
service/catalog | warning | an injected name is not a Host Service |
service/inject-unknown | warning | export const inject names something the catalog does not know |
service/catalog-stale | info | the bundled catalog predates the installed Harness |
service/unknown-method | warning | <method> is not recorded for that Service |
tool/output-missing | error | ctx.tools.register() without an output declaration |
tool/parameters-shape | error | parameters is a JSON Schema document, not a property map |
The two built rules are info, not errors. They say a path resolves to build
output that is not in the checkout, which is normal for a package that compiles
before publishing. Reporting them as missing files was a false positive on three
real plugins in this catalogue.
The two tool/ rules are errors because the registry throws on both, so the
plugin never mounts. They were added after this project's own tools hit them.
Service checks
doctor reads the entry module and compares every ctx.<service> and ctx.<service>.<method>()
against a catalog of 109 Host Services captured from a live Harness
(src/catalog/dsh-host-services.json). The example in
The mistake this catches shows the output. This is the check that
catches mistakes which fail only at runtime, after the plugin has installed and the Host has
started.
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/lib'
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.
!!jstags, anchors and aliases are not supported.!!jsis rejected with an error; anchors and aliases are not — they come back as the literal text&n valueand*n, which is worse than a refusal, because a patch that relies on them parses into something plausible and wrong. Multi-document streams are merged rather than rejected. If your patch uses any of the four, rundoctoragainst the generated bundle on a Host rather than trusting the parse here. 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.
Notes
Corrections about this project itself, kept rather than tidied away. None of them changes how the tool behaves, and all of them are here instead of in the first screen above.
The name. This repository was dsh-plugin-kit until a collision was found: that name belongs
to an npm package by another maintainer, and to a GitHub repository that has since moved to
dsh-scaffold. The old URL redirects. See docs/NAME-HISTORY.md and
docs/BLOCKED-npm-name.md.
Not on npm. dsh-service-check is free on the registry but unclaimed — publishing needs an
npm account and token this project does not have. So npx dsh-service-check fails to install
rather than installing something else. An earlier version of this README claimed the opposite,
carrying over a warning that had been true of the previous name; it was wrong for the new one.
What doctor does not prove. It reads structure and metadata against a snapshot; it does not
activate the plugin. A catalog match confirms nothing, and a mismatch may only mean your release is
newer than the snapshot. Run the plugin to know how it behaves.
The ecosystem report. docs/ECOSYSTEM-HEALTH.md surveys 830 linked repositories. Its first version reported a star total that counted the Harness host itself; that figure is corrected in place, with the original left visible next to it.
License
MIT
Related plugins
deepseek-harness
deepseek-ai/deepseek-harness
dsh-market
dsh-market/dsh-market
dsh-web (dsh-plugin-manager)
zhu1090093659/dsh-web
dsh-web
zhu1090093659/dsh-web