dsh-plugin-templateDeepSeek Harness plugin

Template for deepseek-harness plugin development.

Stars
101
Forks
1
License
MIT
Last commit
Aug 27, 2026

Overview

Template for deepseek-harness plugin development.

Original README

Cached from the project repository on Sep 3, 2026. This is source content, separate from the Agents.md review above.

View source

dsh-plugin-template

English | 中文

dsh.so security dsh.so install

A complete dual-side DeepSeek Harness plugin template. It demonstrates the full plugin surface — a host plugin exposing a Typert Remote, and a client plugin mounting that Remote into a React view — with type-checking, linting, unit tests, CI, and publishing metadata wired up.

Out of the box it registers a greet Remote: the host composes "Hello, <name>" from a configurable prefix, and the client renders the result in a new "Greet" tab.

Structure

1package.json           # dsh.bundle + dsh.client manifests, scripts, peer deps
2cordis.patch.yml       # mounts the host plugin row into a profile
3dsh.plugin.json        # dsh.so registry manifest
4src/index.ts           # host entry: Config schema + Typert manifest registration
5src/runtime.ts         # host Remote service (TypertRemoteService)
6src/typert.ts          # Typert model manifest
7src/contract.ts        # strict wire contract shared by host and client
8src/types.ts           # shared host/client types
9src/client/index.tsx   # client entry: mounts Remote + registers the view slot
10src/client/remote.ts   # client Remote contribution + typed namespace
11src/client/locales.ts  # zh / en dictionaries
12src/client/view.tsx    # minimal React view
13src/client/styles.ts   # theme-token stylesheet
14tests/                 # vitest unit tests (contract + runtime)
15build.mjs              # esbuild dual build (host ESM + client CJS)
16.github/workflows/ci.yml

package.json is the only manifest Harness needs. dsh.bundle.patch makes the package an installable profile bundle; dsh.client declares the Web client bundle and the client packages it injects. The host entry is the ordinary Cordis name/apply export; the client entry is bundled to lib/client.js and loaded by the Web harness module loader.

Requirements

  • Node.js >= 22.19 (or >= 24)
  • pnpm >= 9
  • DeepSeek Harness >=0.1.0-rc.6

Install from a local checkout

sh
pnpm install
pnpm run build
dsh plugin --profile web add .

Restart the Web Harness after rebuilding the plugin. A "Greet" tab appears in the session view ring showing Hello, DSH.

Remove it with:

sh
dsh plugin --profile web remove dsh-plugin-template

Install from Git

sh
dsh plugin --profile web add github:you/dsh-plugin-template

A Git install fetches sources, not built artifacts, so pnpm runs the prepare script to build lib/. pnpm ≥10 blocks that build until you allow it; on the first failed add, dsh prints the fix — copy the package key it shows into the profile's pnpm-workspace.yaml:

yaml
allowBuilds:
  dsh-plugin-template: true

then re-run the add. That allowance lets the package run code at install time, so only allow packages you trust (and pin a commit).

Development

sh
pnpm run check

check runs typecheck, lint, test, and build. CI runs the same command after pnpm install --frozen-lockfile.

Individual scripts:

sh
pnpm run build      # esbuild dual bundle + declaration emit
pnpm run typecheck  # tsc over src and tests
pnpm run lint       # eslint
pnpm run test       # vitest

Renaming the package

Keep these values in sync when you rename:

  • package.jsonname, exports, files
  • build.mjs → the __ModuleLoader__.load id
  • src/index.tsname
  • src/client/remote.ts → package id and the TypertRemoteNamespace$… hex of the service key
  • src/client/locales.ts → locale namespace key
  • src/client/index.tsx → slot id
  • src/typert.tspackage
  • src/contract.ts → invocation ids
  • cordis.patch.ymlid and name
  • dsh.plugin.jsonid

Discoverability

Add the GitHub topic dsh-plugin to your fork:

sh
gh api --method PUT repos/YOUR-USER/dsh-plugin-template/topics \
  -H 'Accept: application/vnd.github+json' \
  -f 'names[]=dsh-plugin'

License

MIT