DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Dsml Artifact Guard — DeepSeek Harness 插件(DSH Plugin)
← Plugins
D

@goodandready/dsh-dsml-artifact-guard

Dsml Artifact Guard

清理模型文本流中泄漏的 DeepSeek DSML 结束标签

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:GooDAnDReaDY/dsh-dsml-artifact-guard#ca35b0c7c0b0397e34c6d469e2ae9b5ea2e5671a
README兼容性版本

兼容性与来源证明

Dsml Artifact Guard 以 @goodandready/dsh-dsml-artifact-guard 发布,当前版本为 0.2.3。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/19

版本

0.2.3stable
2026/9/19
0.2.2stable
2026/9/19
0.2.1stable
2026/9/17
查看其余 4 个版本收起版本
0.2.0stable
2026/9/17
0.1.5stable
2026/9/12
0.1.2stable
2026/9/4
0.1.1stable
2026/9/4

相关插件

正在加载相关插件…

最新版
0.2.3
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/9/19
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

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.

🏗️ 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 the DeepSeek Harness settings.plugin.item slot (lib/client.js):

  • Reactive Configuration: Adjust mode, providerId, and modelId on the fly without restarting the harness, powered by reactive scope.watch.
  • 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 provider and model targets in settings.yaml or through the Web UI:

# settings.yaml
dsh-dsml-artifact-guard:
  mode: sanitize
  providerId: "your-provider-id"
  modelId: "your-model-id"

Configuration Parameters

ParameterTypeDefaultDescription
modestring"sanitize"Operation mode: "sanitize" (strip tags), "audit" (log only), or "disabled"
providerIdstring"opencode-go"Target provider identifier exhibiting leaked tags
modelIdstring"deepseek-v4-flash"Target model identifier exhibiting leaked tags

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.

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编码计划配额,并提供实时令牌使用记录,同时在侧边栏条目中显示当前会话提供商今日的使用量Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Usage Stats@ychris12138/dsh-usage-statsdsh Web GUI 的令牌使用热力图、提供商余额和订阅配额Codex Connectdsh-codex-connect用于 DeepSeek Harness 的 ChatGPT OAuth 和 Codex 模型。