DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
D

@goodandready/dsh-dsml-artifact-guard

Dsml Artifact Guard

Sanitizes leaked DeepSeek DSML closing tags from model text streams

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:GooDAnDReaDY/dsh-dsml-artifact-guard#110e7202636e0845a54e119f6e12333ba0303975
READMECompatibilityVersions

Compatibility and provenance

Dsml Artifact Guard is published as @goodandready/dsh-dsml-artifact-guard and currently resolves to version 0.2.13. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
10/20/2026

Versions

0.2.13stable
10/20/2026
0.2.12stable
10/15/2026
0.2.11stable
10/15/2026
Show 12 more versionsCollapse versions
0.2.10stable
10/7/2026
0.2.8stable
9/26/2026
0.2.7stable
9/25/2026
0.2.5stable
9/24/2026
0.2.4stable
9/22/2026
0.2.3stable
9/19/2026
0.2.2stable
9/19/2026
0.2.1stable
9/17/2026
0.2.0stable
9/17/2026
0.1.5stable
9/12/2026
0.1.2stable
9/4/2026
0.1.1stable
9/4/2026

Related plugins

Loading related plugins…

Latest
0.2.13
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 4
Weekly downloads
0
Last push
10/20/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in models-usage.

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundleExperimental machine translation of expanded reasoningWhale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinOur Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — Install this plugin in dsh to use cutting-edge models including DeepSeek V4.1 Flash and Kimi K3, with no login, registration, or API Key required. The desktop version also offers an EAC co-payment channel; starting with 2.0, it supports ten account channels: LobsterAI, Qoder, TRAE, Usage@linxin666/dsh-usageUsage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with a compact price glance card above the sidebar's Settings row

README

📦 @goodandready/dsh-dsml-artifact-guard

Fail-Open Stream Sanitizer for Leaked Protocol DSML Closing Tags in DeepSeek Harness

🇬🇧 English • 🇷🇺 Русский • 🇨🇳 中文说明

⭐ If you like this plugin, please star it on GitHub — it shows me that the plugin is useful to you and motivates me to keep developing it.

🐛 If you find a bug or would like to request a feature, open a GitHub issue in any language — I will review your proposal and implement useful suggestions in a future plugin version.

⚡ Overview & The Problem

When interacting with certain upstream model providers or API gateways, raw DSML (DeepSeek Markup Language) tool-invocation protocol tags can leak into the assistant's visible text stream. Users frequently see trailing protocol clutter like:

Done. All tests have passed.
</|DSML|parameter> </|DSML|invoke> </|DSML|tool_calls>

These leaked closing tags visually pollute the chat bubble, cause Markdown rendering glitches, and can confuse downstream agents or clipboard exports.

@goodandready/dsh-dsml-artifact-guard is a lightweight, host-only runtime stream interceptor for DeepSeek Harness that cleans up these terminal artifacts in real time before they reach the user interface:

  1. Synchronous Stream Contract Preservation: Cordis requires stream interceptors to return an AsyncIterable synchronously. Making interceptors async returns a Promise that crashes the harness turn with stream is not async iterable. This guard adheres strictly to the synchronous hook contract.
  2. Split Chunk Buffer Pipeline: Protocol tags often arrive split across multiple TCP or WebSocket text deltas. The guard maintains a small sliding buffer (KEEP = 96 bytes) to reliably match and strip multi-chunk tails.
  3. 100% Fail-Open Safety: Never drops legitimate user or assistant text. Legitimate discussions about DSML syntax or internal tool calls are preserved intact.
  4. Targeted Provider & Model Scoping: Restricts processing specifically to the provider and model configurations that exhibit tag leakage, passing other model traffic through with zero overhead.

💡 Why Not in DSH Core?

As of DeepSeek Harness 0.1.7-rc.2, the core upstream stream pipeline (dsh-llm-pi-ai, dsh-llm-deepseek*, etc.) does not perform terminal DSML protocol cleanup — there is zero mention or handling of |DSML| anywhere in the core engine. When upstream gateways (e.g. commandcode, deepseek-official, or custom proxies) leak protocol closing tags at the conclusion of an assistant turn, DSH forwards them directly to the frontend.

dsh-dsml-artifact-guard serves as the universal runtime guard across all DeepSeek models regardless of provider gateway or routing configuration.


🏗️ Architecture

graph TD
    subgraph DSH ["DeepSeek Harness Runtime"]
        Turn["Agent Turn Execution<br/>(LLM Stream Request)"]
        ChatUI["Chat UI Stream Consumer<br/>(Renders clean markdown text)"]
    end

    subgraph Guard ["@goodandready/dsh-dsml-artifact-guard"]
        Hook["Synchronous llm/stream Hook<br/>(Returns AsyncIterable synchronously)"]
        ScopeCheck{"Scope Match?<br/>(providerId & modelId)"}
        PassThrough["Raw Stream Pass-Through<br/>(Zero overhead for other models)"]
        Buffer["Sliding Tail Buffer<br/>(Preserves trailing 96 bytes across deltas)"]
        Detector{"Terminal Artifact?<br/>(Matches leaked DSML tail at finish)"}
        Sanitize["Sanitize Mode<br/>(Strips leaked closing tags)"]
        Audit["Audit Mode<br/>(Emits ctx.logger warning only)"]
    end

    Turn -->|llm/stream hook| Hook
    Hook --> ScopeCheck
    ScopeCheck -->|No| PassThrough
    ScopeCheck -->|Yes| Buffer
    PassThrough --> ChatUI
    Buffer --> Detector
    Detector -->|No Artifact| ChatUI
    Detector -->|Artifact detected: sanitize| Sanitize --> ChatUI
    Detector -->|Artifact detected: audit| Audit --> ChatUI

✨ Features & Capabilities

1. Synchronous Hook Guarantee

Under Cordis and DSH service lifecycles, event listeners on llm/stream must return the transformed stream synchronously. An asynchronous hook wrapper will return a Promise<AsyncIterable>, causing the runtime dispatcher to immediately throw TypeError: stream is not async iterable. dsh-dsml-artifact-guard wraps the stream generator in a pure synchronous registration.

2. Multi-Chunk Tail Buffering

In real-world streaming, the artifact </|DSML|parameter> </|DSML|invoke> </|DSML|tool_calls> is frequently fractured into fragments:

  • Chunk 1: All tasks complete. </|DSML|pa
  • Chunk 2: rameter> </|DSML|invoke>
  • Chunk 3: </|DSML|tool_calls>

The guard retains a minimal 96-byte window until the next chunk or finish event arrives, ensuring fractured tags are seamlessly detected and sanitized as a single terminal artifact.

3. Fail-Open Architecture

  • If the text contains genuine prose about DSML (e.g. <|DSML|tool_calls>example</|DSML|tool_calls>), it is never removed.
  • Non-text chunks (tool-call-delta, usage, finish) are forwarded immediately without delay.
  • Any malformed chunk structure passes through transparently to preserve session stability.

4. Flexible Operating Modes

  • sanitize (default): Strips terminal DSML closing tags and logs a warning with the count of removed artifacts.
  • audit: Emits diagnostic logs with ctx.logger.info(...) without modifying the user-visible stream.
  • disabled: Bypasses processing entirely.

5. Native Web UI Settings Card

Registered directly in DeepSeek Harness plugins.row.config and plugins.item slots (lib/client.js):

  • Reactive Configuration: Adjust mode, providers, and modelPattern on the fly without restarting the harness.
  • Snapshot State Awareness: Gracefully handles snapshot loading, ready, and unavailable states.
  • Protection Bypass Warning: Displays a prominent OFF badge and warning banner when the guard is set to disabled.

6. One-Click In-Place Auto-Updater

A canonical HTTP management route (/api/dsh-dsml-artifact-guard/update) mounted via lib/updater.js:

  • SemVer Inspection: Queries the registry and compares versions with full pre-release support.
  • Loopback & Same-Origin Protection: Write mutations (POST) are strictly restricted to local loopback connections with valid origin headers.
  • Clean Invocation: Executes package updates safely without risky CLI bypass flags.

7. Full Dark & Light Theme Compliance

All client UI styles are strictly tokenized via DeepSeek Harness --dsw-alias-... CSS custom properties and color-mix() functions with zero hardcoded hex or rgba color literals. High contrast and accessibility are guaranteed in both Dark and Light themes, guarded by automated regression tests (test/theme.test.js).


📦 Installation

Install into your DeepSeek Harness web profile:

dsh plugin --profile web add @goodandready/dsh-dsml-artifact-guard

Restart your DeepSeek Harness instance.


⚙️ Configuration (settings.yaml)

Configure model matching and provider targets in settings.yaml or through the Web UI:

# settings.yaml
dsh-dsml-artifact-guard:
  mode: sanitize
  modelPattern: "deepseek"   # Case-insensitive RegExp matching all DeepSeek models
  providers: []             # Empty = guard all providers; or e.g. ["commandcode", "deepseek-official"]

Configuration Parameters

ParameterTypeDefaultDescription
modestring"sanitize"Operation mode: "sanitize" (strip tags), "audit" (log only), or "disabled"
modelPatternstring"deepseek"Case-insensitive RegExp matched against model IDs (e.g. deepseek, deepseek-v4.*, deepseek/.*)
providersstring[][]Optional list of provider IDs. When empty, guards all providers
providerIdstringundefined(Deprecated) Legacy exact provider identifier; maintained for backward compatibility
modelIdstringundefined(Deprecated) Legacy exact model identifier; maintained for backward compatibility

HTTP Management Endpoints

MethodEndpointAccessDescription
GET/api/dsh-dsml-artifact-guard/updateWeb UI / LocalhostRetrieves current version, latest registry version, and update status
POST/api/dsh-dsml-artifact-guard/updateLoopback & Same-OriginTriggers in-place package update via DSH CLI

🧪 Testing

Run the automated test suite covering split chunks, audit vs sanitize modes, scope matching, and synchronous hook contracts:

npm test
npm run check

📄 License

MIT © GooDAnDReaDY


For a complete release history and version migration notes, see CHANGELOG.md.