DeepSeek Harness Roleplay Backend Plugin

Introduction

DeepSeek Harness (DSH) only provides basic features such as conversation, trajectory, and context management by default. Developers must write their own system prompts for each agent to inject a persona. If the persona requires long-term maintenance, multi-role switching, or fine-grained context control, manual upkeep becomes cumbersome.

dsh-rp-studio adds a “Character Studio” tab to the DSH conversation tab bar, consolidating character cards, world books, galleries, user info, and permission settings into a single interface. It does not alter DSH’s underlying logic; it simply injects the currently bound character card into all sessions via the deployment-layer prompt segment rp-studio:persona, so that presets and sessions automatically carry the persona.

Plugin Overview

  • Name: dsh-rp-studio
  • Maintainer: gaozhenkun92-eng
  • GitHub: https://github.com/gaozhenkun92-eng/dsh-rp-studio
  • Category: Fun Roleplay
  • Core Value: Centrally manage character cards, world books, galleries, and permissions within DSH, and automatically inject the persona into all sessions via the rp-studio:persona prompt segment.

Core Features

Character Cards

In the right panel of the “Character Studio” tab, click “Switch Character” to create or import a character card. Supported formats include:

  • PNG (with tEXt field chara / ccv3)
  • JSON (V2 / V3)
  • Plain text

If a character card embeds a character_book, its world book entries will be imported as that card’s “card-local” world book, with automatic deduplication.

The character card editor has four fixed fields:

  • Persona
  • Background Story
  • Speaking Style
  • Special Content

After typing in each field, the content auto-saves after a 400ms debounce—no need to manually click a save button. A ⤢ button on the right side of each field, when clicked, expands that field to fill the central area; click again to restore.

At the bottom there is a “Custom” button that lets you add an unlimited number of custom fields. Custom field content is written into the system prompt in the form ## <field name>. The height of each column and the currently active page are remembered.

Character cards support export as PNG / JSON / TXT. Once a character card is selected, it is bound to the current session; the binding state is stored in $DSH_HOME/rp-studio/active.json. To unbind, click “Unbind” in the “Switch Character” panel.

World Books

World books have two scopes:

  • Card-local: applies only to that specific character card
  • Global: shared across all character cards

World books support a “Collection” (categorization) feature:

  • Create an empty collection; it persists even if left empty
  • Click “+ Entry” at the collection header to create an entry directly within that collection
  • The toggle at the collection header flips the enabled state of all entries in that collection at once
  • Collections can be renamed; entries migrate along with the rename
  • Collections can be deleted (with a second confirmation); entries are deleted together (or can be moved back to “Uncategorized”)
  • Each entry has an independent enable/disable toggle
  • Entries can be edited in place, including changing their assigned collection

Disabled entries are excluded from the prompt: both matchWorldbook() in lib/prompt.js and readWorldbook() in lib/agent.js skip entries with enabled: false.

Import / export supports three formats:

  • Workshop format: preserves collections and toggle states
  • SillyTavern format: comment is written as “Collection / Name”; disable: true means turned off
  • Plain text: each line in the format “keyword | content”, suitable for temporary settings

During import, deduplication is performed using the fingerprint name\u0000keyword\u0000body; duplicates are counted in skipped.

The gallery supports three sources:

Source Directory Permissions
studio $DSH_HOME/rp-studio/images Upload, rename, set avatar, delete
roleplay0 $DSH_HOME/roleplay/images Read-only; can rename display name, can “Save to Gallery”
roleplayN <workspace>/.dsh-roleplay/images in each workspace Same as above
  • Renaming only changes the display name; display names are stored in $DSH_HOME/rp-studio/images/index.json; the on-disk filename remains unchanged
  • Setting an avatar only accepts PNG files; it writes avatarPath and back-fills the card
  • The character itself can use the rp_gallery tool to view gallery names (controlled by the gallery permission toggle)

Permission Settings

The master permission toggle is in the top-right corner of the “Character Studio” tab, off by default. Before turning it on, a one-time disclaimer confirmation dialog appears with two independent checkboxes:

  • “I have read and agree to the above terms”: confirmation for this session
  • “Don’t show this reminder again”: long-term preference

Once “Don’t show again” is checked, the dialog will not appear the next time the master toggle is turned on. To see the dialog again, click “Replay Enable Reminder” at the bottom of the permission settings panel.

When the master permission toggle is turned on, sessions gain six groups of tool permissions:

  • File I/O: read write edit read_image glob grep
  • Command line: pwsh bash job_output job_kill job_list
  • Network: web_search web_fetch
  • Sub-agents: subagent subagent_fork send_message list_agents
  • Skills & Delivery: skill delivery
  • Gallery: rp_gallery

The mechanism behind the toggle is agent.ctx.tools.restrict({ allow } / { deny }) per session. Toggling reapplies the filter, so it takes effect immediately on running sessions.

User Info

“Your Name” determines that the tab title displays as “’s Companion” and also serves as the {{user}} placeholder in the system prompt.

“Your Persona” and “Writing Style Rules” are written into the system prompt.

Installation & Activation

Install from GitHub (desktop profile):

dsh plugin --profile desktop add github:gaozhenkun92-eng/dsh-rp-studio

After installation, you need to restart the desktop app (system tray → Quit → Relaunch), because cordis.patch.yml is only read once at startup.

Typical Usage

  1. After installing the plugin, you’ll see the new “Character Studio” tab in the DSH conversation tab bar, titled “’s Companion”.
  2. Enter “Character Studio”, click “Switch Character” → “+ Create Character” in the right panel, and fill in the name, persona, background story, speaking style, and special content.
  3. Alternatively, click “Import Character Card” to import an existing character card from PNG, JSON, or plain text.
  4. Once a character card is selected, it is bound to the current session, and all sessions will automatically carry that character’s persona.
  5. In “World Book”, create collections for card-local or global scope, add entries, set enabled states, and export or import in SillyTavern format.
  6. In “Gallery”, upload images, set avatars for character cards, or save read-only images from other workspaces.
  7. In “Permission Settings”, turn on the master toggle and enable file I/O, command line, network, and other tool permissions as needed.

Use Cases & Cautions

This plugin is ideal for DSH users who need long-term maintenance of multi-role personas, fine-grained control over context structure, and simultaneous management of multiple world books.

Permission settings involve file I/O, command line, network, and other capabilities. Once enabled, the character will have tool permissions at the same level as a DSH session. Therefore, please toggle carefully according to your character’s setting and security requirements, and read DISCLAMER.md (linked in the plugin README) before use.

The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT © Miaocui.Jiao) before installing.

Conclusion

dsh-rp-studio consolidates card management, world books, galleries, and permission control for roleplay scenarios into a single interface, achieving automatic persona injection via the rp-studio:persona prompt segment. It does not modify DSH’s core logic but provides a reusable, maintainable configuration approach, well-suited for developers who frequently switch roles or manage complex personas.

  • Plugin directory page: https://www.skillhub.cn/plugins/gaozhenkun92-eng/dsh-rp-studio
  • GitHub: https://github.com/gaozhenkun92-eng/dsh-rp-studio
羽毛球分组比赛记分
小程序二维码

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

Xiaoye