dsh-bard: A Bard Role-Playing Plugin for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) relies on modular design. Developers sometimes need to integrate SillyTavern roleplay assets (JSON/PNG cards) into the DSH agent ecosystem. The dsh-bard plugin implements this: it reads SillyTavern character cards and worldbooks, combines them with Harness skills, and saves them as native agent presets. It does not create an independent conversation loop; it translates the content into Harness’s internal formats (agent presets, system prompt context, skill lists), so history, tools, permissions, and context compression all follow Harness’s existing behavior.

Core Features

Character card import
Supports SillyTavern V1/V2/V3 formats. It can read JSON files, or read tEXt blocks inside PNG cards (with ccv3 taking priority over chara). After import, you can preview the portrait, intro, and opening line.

Worldbook import
Supports importing standalone JSON worldbooks, or extracting an embedded character_book from a character card.

Content selection and budget trimming
Worldbook entries are matched by keywords (resident/secondary gating); disabled entries are automatically skipped. The system trims entries using both item-count and character-count budgets, and the highest-ranked entry is forcibly injected even if it exceeds the budget.

Skill and tool binding
A preset can bind multiple Harness skills. When creating or editing a preset, tool calls can be disabled (suitable for text-only models), or a tool whitelist can be used to limit which tools are allowed into requests. A Section whitelist can select specific sections from the full system prompt (mutually exclusive with complete: true).

User and gender
Each preset can specify a replacement value for {{user}}; SillyTavern macros inside the character card are automatically replaced during rendering. The player’s gender can be specified (unspecified/male/female/custom text), preventing the model from guessing pronouns incorrectly based on a neutral name.

Data persistence and portraits
Saved presets have the bard- prefix and appear in Harness’s preset selector. When importing a PNG card, the original portrait image is retained.

Data storage
All data is stored under $DSH_HOME/bard/ (default ~/.dsh/bard/), as plain files that are readable and manually editable. Writes use atomic operations (temporary file + rename), so crashes do not leave partial records.

Installation and Activation

The plugin directory must be resolvable as a bundle. It is recommended to configure it in the profile’s package.json:

{
  "dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-bard"] } }
}

The package itself declares dsh.bundle.patch: ./cordis.patch.yml, and this patch inserts one line: { id: bard, name: dsh-bard }. The resolution order is “installation anchor first, then profile directory,” so dsh-bard will be found as long as it appears under the profile’s node_modules.

After activation, the plugin creates four directories under $DSH_HOME/bard/: cards / worldbooks / portraits / presets, and provides four tabs under “Settings -> Bard”.

Usage

Interface Operations

  1. Settings -> Bard: divided into four tabs: Character Cards, Worldbooks, Skills, and Presets.
  2. Import: import assets in the Character Cards or Worldbooks tab.
  3. Bind: select Harness skills in the Skills tab.
  4. Save: combine the assets above in the Presets tab, name it, and save.

Commands

/bard                    列出所有吟游预设
/bard card               查看当前会话正在使用的角色
/bard greet [序号]       输出开场白(第 n 条备选,缺省用当前会话的角色)

Opening Flow

  1. In Settings -> Bard, complete asset import, skill binding, and save the preset.
  2. In the session’s preset selector, choose “Bard · “.
  3. The character card persona, matched worldbook entries, and bound skills automatically enter that session’s system prompt.

Technical Details

Scope Limitation
All host-side services must be obtained from agent.ctx, not from the plugin’s global ctx. This is because DSH services are layered by scope; the plugin ctx has no scope tag, and writing to it will fall into the global layer, causing silent failure.

Tool Injection
The tool list is injected into the persona prefix via a variable, rather than as a separate section. This ensures the list appears below the persona and is immune to trimming by complete: true (this flag drops all sections except persona).

Whitelist Implementation
The tool whitelist filters only inherited tools (global layer and ancestor layer), not tools registered by the child agent itself (such as Agent Teams tools). The Section whitelist is implemented through a waterfall in system-prompt/assemble; the listener modifies assembly.sections in place.

Data Source
Worldbook injection text is taken from the most recent 24 messages in that session, truncated to the latest 8000 characters. HTTP endpoints only allow loopback host plus same-origin access.

Summary

dsh-bard is a tool that converts SillyTavern roleplay assets into native DeepSeek Harness capabilities. It does not build an independent conversation loop; instead, it implements roleplay functionality by translating assets and leveraging Harness’s native mechanisms.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye