DSH plugin extension points: DeepSeek Harness core and seams
A DSH plugin capability is not attached at random: the official docs split packages with a service declaration into core spine services (core), swappable capability seams (seam), and bundle/composition points (bundle), each with its own extension point and constraints (source). This article covers those three boundaries, what the single-implementation constraint really means, and where to attach a new capability; the three roles (Definition / Provider / Consumer) are already covered in the site's DSH plugin guide, so this article does not repeat them.
Core services, seams, and bundles in a DSH plugin: three kinds of extension points
The official docs group packages by service declaration into three kinds, where core is the pipeline spine, seam is a swappable capability, and bundle is the composition layer of a product form (source). The comparison:
| Type | Role | Description | Example |
|---|---|---|---|
| Core spine service | core | Carries the agent loop pipeline itself, with no known alternative implementation in the table | ctx.tools, ctx.sessions, ctx.systemPrompt, ctx.agents |
| Swappable capability seam | seam | A capability boundary with several providers to swap | ctx.fs, ctx.shell, ctx.llm, ctx.workflowEngine, ctx.sessionPersistence |
| Bundle / composition point | bundle | Assembles several capabilities into one product form and picks the provider at the composition layer | ctx.agentLoop (the one concrete bundle-level loop driver) |
- The spine is the agent loop itself — the official docs mark
agent-loopas "the one concrete loop plugin" and state that extension packages should depend ondsh-agentevents and services rather than on this package. Expect: change the flow through events, not by editing the spine implementation. - A seam is a capability boundary — filesystem, shell, LLM, and the workflow engine are all exposed as seams with swappable providers. Expect: swapping an implementation leaves the consumer untouched.
- The composition layer picks the provider — profiles and bundles decide which provider is loaded at assembly time. Expect: product differences live in the composition, not in scattered code branches.
The test is "what are you replacing": to replace the implementation of a capability, plug into the matching seam; to extend a pipeline stage, go through events instead of replacing a spine service — see DSH plugin events.
The single-implementation constraint in a DSH plugin: one active implementation per ctx key
The single-implementation constraint is Cordis service-registration semantics: inside one context, one ctx.<key> maps to a single active service instance (source). A Service subclass registers with super(ctx, name) on construction, the registration takes effect immediately, and it is removed automatically with its owning fiber. Three direct consequences:
- A seam being swappable means replacing, not coexisting — only the provider currently loaded is in place, and swapping an implementation changes "who is loaded." Expect: never mount two providers on the same key.
- A core service has no parallel implementation — the Implementations column is empty for
corerows in the official table; they are single-owner. Expect: to extend a spine capability, add events or a new service, not a second implementation under the same name. - Incompatible Host and Client declarations must not reuse the same
Contextkey — even when the two use independent runtime contexts, TypeScript declaration merging still sees both types. Expect: naming conflicts are avoided at the type level.
This yields two rules for plugin authors: keep every subscription and registration inside apply so it rolls back with the fiber, and when you need alternative behavior, swap the provider through the composition layer instead of mounting a second implementation in parallel.
Choosing a DSH plugin extension point: which seam to attach to
When adding a capability, choose the extension point by "what are you replacing" and plug into an existing seam rather than building a parallel system. The decision steps:
- Replace the implementation of a capability — plug into an existing seam, such as
ctx.llm(model capability, see LLM adapter),ctx.fsandctx.shell(files and commands),ctx.workflowEngine(workflow script engine),ctx.codeRuntime(code execution), orctx.sessionPersistence(session persistence). Expect: zero changes to upper tools. - Extend a pipeline stage — go through events without replacing a spine service. Expect: the extension point is reversible and unloadable.
- Assemble a product form — use composition packages and bundle points to pick a provider in configuration. Expect: swapping an implementation only touches the composition.
- None of the above — implement it as a cohesive standalone domain service, for example a domain-scoped registry. Expect: no confusion with the spine or a seam.
After choosing the extension point, keep the naming and packaging conventions: interface packages use the capability name, implementation packages add a mechanism / protocol / environment / vendor qualifier; singular ctx keys for single services like engine, runtime, and policy, and plural keys for registry and multi-member services. Run three self-checks after writing: is the capability correctly classified as core, seam, or composition; are two implementations fighting over the same key; did you plug into an existing seam instead of building a parallel system. To revisit the underlying framework, read the Cordis primer; to compare community DeepSeek Harness plugin implementations on the same seam, search the DSH Plugin Hub; for package structure, see adding a workspace package.
FAQ
A core service carries the agent loop pipeline itself and has no known alternative implementation in the official table, such as ctx.tools, ctx.sessions, and ctx.systemPrompt; a swappable capability seam is a capability boundary with several providers to swap, such as ctx.fs, ctx.shell, and ctx.llm. The test is what you are replacing: replacing an implementation is a seam, while extending a pipeline stage should go through events.
The agent loop spine can be replaced: the official docs mark agent-loop as the one concrete bundle-level loop driver, and other extension packages should depend on dsh-agent events and services rather than on this package. That means changing the flow goes through events or the composition layer, not through editing the spine service.
The single-implementation constraint means one ctx.<key> corresponds to a single active service instance inside one context, and a Service subclass registers on construction and is removed automatically with its owning fiber. So a seam being swappable means swapping the one provider currently loaded, not running several implementations at once.
A DSH plugin should decide by what it is replacing: to replace an implementation, plug into an existing seam such as ctx.llm, ctx.fs, ctx.shell, ctx.workflowEngine, ctx.codeRuntime, or ctx.sessionPersistence; to extend a pipeline stage, go through events; to assemble a product form, go through composition packages and bundle points.
After choosing a DSH plugin extension point, search DSH Plugin Hub for community plugins built on the same seam and compare their provider and consumer code. For package layout, package.json invariants, and root config registration, follow the file-by-file checklist for adding a workspace package.
Related Terms
- capability seam
- A capability seam is a replaceable capability boundary in DeepSeek Harness, jointly defined by a Service Definition that declares the interface, a Service Provider that implements it, and a Consumer that uses it. It is why swapping one implementation can change the behavior of the whole product.— https://deepseek-harness.github.io/deepseek-harness/en/reference/capability-seams
- core spine service
- A core spine service is a stable service that carries the agent loop pipeline itself and has no known alternative implementation in the official table, such as ctx.tools, ctx.sessions, and ctx.systemPrompt.— https://deepseek-harness.github.io/deepseek-harness/en/reference/capability-seams
- bundle / composition point
- A bundle or composition point is a package that assembles several capabilities into one product form; it picks which provider to load at the composition layer, so swapping an implementation changes the composition, not the consumer.— https://deepseek-harness.github.io/deepseek-harness/en/reference/capability-seams
- single implementation constraint
- The single implementation constraint is Cordis service-registration semantics: inside one context, one ctx.<key> maps to a single active service instance, and a Service subclass occupies the key on registration and is removed automatically with its owning fiber.— https://deepseek-harness.github.io/deepseek-harness/en/reference/cordis-api/service