Introduction¶
Under DSH’s “everything is a plugin” philosophy, plugin development is not just about writing an apply() function. More common issues include: are dependencies correct, can configuration be validated, can registration be revoked, can services be replaced, can model visible content be replayed, and are tests covering the real assembly path?
deepseek-harness-plugin-from-scratch provides an audited, progressive tutorial centered around these issues, along with a TypeScript plugin that can be installed, run, and read step-by-step.
What is this¶
This is an unofficial community tutorial repository maintained by Opr4Mp3r, using the MIT License.
It is aimed at developers who want to understand DSH plugin assembly paths, focusing on the checkpoints required for production-grade plugins: validated configuration, revocable registration, replaceable services, replayable model visible content, and tests covering the real assembly path.
The repository has not yet been published to the npm registry. The Harness is in a pre-release stage; upstream explicitly does not promise compatibility with old formats before the first official tag.
Core Features¶
The following introduces the capabilities provided by the repository:
- A TypeScript plugin that can be installed, run, and read step-by-step.
- Provides the
greet-toolutility and thecordis.patch.ymlcomposition layer. - Provides local verification commands such as
pnpm smoke:source,pnpm smoke:loader, andpnpm check. - Provides a local interactive reader via
pnpm preview. - Covers testing and publishing checks using real assembly paths.
Local Running and Reading¶
The environment requirements are Node.js ^22.19.0 or >=24, and pnpm 11. The audit and local locked environment are Node.js 22.21.1 and pnpm 11.7.0.
First, install dependencies and execute local verification:
pnpm install --frozen-lockfile
pnpm smoke:source
pnpm smoke:loader
pnpm check
pnpm smoke:source and pnpm smoke:loader are used for local verification of source code and loading paths, while pnpm check performs a more comprehensive check.
Start the local reader:
pnpm preview
Open http://127.0.0.1:4175 to read the plugin code by chapter.
Installing into a Harness profile¶
Since the repository is not yet published to the npm registry, you can generate a tarball from the source code and install it to the tutorial profile:
pnpm pack
dsh plugin --profile tutorial add ./deepseek-harness-plugin-from-scratch-0.1.0.tgz
After installation, check the configuration layer:
dsh --profile tutorial --dump-config
This command is used to confirm the configuration layer of the deepseek-harness-plugin-from-scratch plugin within the profile.
Please note that if the cordis.patch.yml pointed to by dsh.bundle.patch is missing, dsh plugin add will only install a normal dependency and will not activate the plugin.
If you want to override plugin configuration in the cordis.patch.yml of that profile, the patch does not perform a deep merge on config, so all relevant fields must be restated when overriding the configuration. The following illustrates this configuration override method:
- id: greet-tool
config:
# 需要重述要覆盖的配置字段
Full Installation Path Check¶
The repository provides a standalone check command to execute the full installation path:
pnpm check:profile
This command will execute packaging, dsh plugin add, configuration layer check, start the profile, and call greet.
GitHub Installation and Build Limitations¶
The repository also provides a method to install from a GitHub commit:
dsh plugin --profile tutorial add 'github:Opr4Mp3r/deepseek-harness-plugin-from-scratch#FULL_COMMIT_SHA'
Here FULL_COMMIT_SHA is a placeholder and needs to be replaced with the specific commit SHA. Since this installation path may trigger a build, and pnpm 10 and above may require adding allowBuilds, if you wish to avoid executing a build during installation, you can use the pre-built tarball installation method mentioned earlier.
Use Cases and Notes¶
Suitable for the following situations:
- Want to understand DSH plugin dependencies, registration, services, and replay paths.
- Want to use a runnable TypeScript plugin to compare against the real assembly path.
- Want to perform
smoke,check, andpreviewlocally first, and then decide whether to install into a profile.
Please note:
- The plugin will run with the permissions of the current DSH process; you should check the source code, dependencies, and license before installation.
- This repository is an unofficial community tutorial under the MIT License.
- Harness is in a pre-release stage; upstream explicitly does not promise compatibility with old formats before the first official tag.
- The current repository has not been published to the npm registry; installation paths are based on the tarball or GitHub commit provided by the repository.
- When installing from a GitHub commit, pay attention to placeholders, commit selection, and pnpm build limitations.
Conclusion¶
The value of this repository lies in advancing DSH plugin development from “how to write a function” to “how a plugin is actually assembled, verified, and replayed”. If you wish to continue viewing the source code, you can start from the GitHub repository.
GitHub Repository:
https://github.com/Opr4Mp3r/deepseek-harness-plugin-from-scratch