dsh-stickerbook: Add a local sticker library to DeepSeek Harness

Introduction

In the context of developing dialogue products within DSH (DeepSeek Harness), adding stickers is a common requirement. However, existing solutions face a dilemma: either plugins come with built-in libraries but have chaotic structures and unclear licensing, or they have clear structures but require you to build the assets yourself, resulting in solutions that won’t run out of the box. To make matters worse, many solutions rely on Markdown image links, which causes the host’s Markdown renderer to treat relative addresses as workspace files, leading to images displaying as “Unable to preview”. dsh-stickerbook is a local sticker library plugin designed to address these issues: it comes with a built-in library, is ready to use out of the box, and clearly defines the separation of indexing, searching, routing, sending, and asset licensing boundaries.

One-sentence positioning: This is a local sticker plugin running on DeepSeek Harness, featuring a searchable library of 157 Chinese stickers. Both users and assistants can send images, with optional native QQ integration. The plugin is maintained by Asgoresmilelong and is open source on GitHub.

What It Solves

The plugin synthesizes the trade-offs of two similar plugins: it is as ready-to-use as dsh-meme (comes with a library, thumbnails, no build required, and includes testing), while maintaining the clear structure of dsh-nekowhale-stickers (indexed, searchable, layered routing/sending, readable/editable metadata, and clear license boundaries).

It primarily solves three points:

  1. Asset Issues: No need to find images or build them yourself. Once installed, you have 157 “Blue Big Fat Fish” stickers, with explicit sources and licenses.
  2. Sending Issues: Sending images does not rely on Markdown image links. Instead, it uses [sticker: description] plain text tokens, which are rendered into images by the client. This is the only stable path for desktop environments.
  3. Extension Issues: To add your own images, you can simply drop files, let the agent index them, or manually edit them. Adding new images requires no code changes.

Core Capabilities

Search: Find by emotion tag (happy / angry / sad / food etc.) or keywords. Supports Chinese substrings and multi-word AND matching.

User Send Stickers: Click the “🙂 Emoji” button on the left side of the input box to open a searchable sticker panel. Clicking a sticker inserts [sticker: description] into the input box and sends it.

Assistant Send Stickers: Messages only store [sticker: description] plain text tokens; the client renders them into images. The tool returns candidates along with tokens that can be copied directly.

Native QQ / IM Sending: If the host has the companionQq service, action="send" allows for native sending of original images.

Zero-Config Add Stickers: Place images in packs/<pack>/images/. The filename serves as the description initially, which can be supplemented with sticker_learn / sticker_update.

Zero Runtime Dependencies: The host side only uses Node.js built-in modules (node:fs / node:http). No database, no native extensions.

Testing: node --test. Covers search, pack parsing, HTTP fencing, metadata writing, token formatting, and the list API. The repository contains 33 tests in total.

Installation and Usage

Follow the official usage method. The installation command runs directly via CLI. Do not concatenate based on the plugin name; the following three lines are all from the repository documentation:

# Local development (link install, restart to apply changes)
dsh plugin --profile desktop add link:F:\DSH-\oss\dsh-stickerbook

# Or install from npm
dsh plugin --profile desktop add dsh-stickerbook

# Or install from GitHub
dsh plugin --profile desktop add github:<you>/dsh-stickerbook

For the official desktop version, please exit DSH completely before executing the CLI, then restart DSH after installation.

Once installed, the agent will have access to four tools:

Tool Description
send_sticker Find images (tag / query) and return candidates; action=send + path sends images natively via QQ
sticker_list Read-only browsing, with pack/file for easy maintenance
sticker_learn Add an image to the user’s sticker library (default mine)
sticker_update Modify description / emotion / keywords

Typical Usage

Assistant Send Stickers (Web). Three steps: The tool returns candidates, the model writes the selected token verbatim into the reply, and the client replaces the token with an <img> tag for /dsh-stickers/....

  1. send_sticker({ query: "摸鱼" }) → The tool returns candidates, each with a line [sticker: description].
  2. The model writes the token of the selected sticker verbatim into the reply.
  3. The client replaces the token with <img src="/dsh-stickers/...">.

Here, using Markdown images is not recommended: the host’s renderer treats relative addresses as workspace files (/api/file), causing /dsh-stickers/... or HTTP URLs to display “Image cannot be previewed”. The token + DOM decoration approach is the stable solution.

QQ / IM Sessions:

  1. send_sticker({ tag: "happy" }) retrieves candidates (containing absolute paths).
  2. send_sticker({ action: "send", path: "<absolute_path>" }) causes the plugin to call companionQq.sendImage.

User Send Stickers: Click the “🙂 Emoji” button on the left of the input box, search or select directly, and the plugin will insert [sticker: description] into the input box and send it.

Adding Stickers

Three methods, arranged by convenience.

Method 1: Drop files directly. Fastest:

packs/blue-whale/images/new.gif

Restart DSH or wait for the next tool call to rescan to find it. The description is initially the filename, which can be changed later with sticker_update.

Method 2: Let the agent index it:

sticker_learn({ path: "D:\\pics\\angry_cat.gif", caption: "Angry Cat: Bite if asked again", emotion: "angry", tags: "cat angry bite" })

The file will be copied to ~/.dsh/sticker-packs/mine/images/, while the original remains in place.

Method 3: Manual edit of stickers.json:

{
  "version": 1,
  "items": [
    {
      "file": "images/angry_cat.gif",
      "caption": "Angry Cat: Bite if asked again",
      "emotion": "angry",
      "tags": ["cat", "angry", "bite"],
      "use": "When annoyed by questions"
    }
  ]
}

stickers.json is an optional file; it works without it, and the filename serves as the description. The library format is as follows:

packs/
  blue-whale/
    pack.json        # { id, name, description, author, source, license, version }
    stickers.json    # { version: 1, items: [{ file, caption, emotion, tags, use }] }
    images/          # Images (gif/png/jpg/webp), subdirectories allowed

User libraries are located at ~/.dsh/sticker-packs/<pack>/, separated from the plugin package, so upgrading the plugin won’t lose them.

Configuration

Add config: to the line in the profile’s cordis.patch.yml:

- id: stickerbook
  name: dsh-stickerbook
  config:
    route: /dsh-stickers      # Image route prefix
    packs:                    # Override default scan root (relative to package dir or absolute path)
      - packs
      - D:\my-stickers
    allowLan: false           # Default only allows loopback address for fetching images
    allowedHosts: []          # Reverse proxy domain whitelist
    maxBytes: 20971520        # Single image limit 20MB

The environment variable DSH_STICKERBOOK_ALLOW_LAN=1 is equivalent to allowLan: true.

HTTP fencing only recognizes the Host header (not Origin), and defaults to loopback addresses only; reverse proxies or LANs must explicitly allow it.

Design Trade-offs

Metadata on Disk: packs/** is the single source of truth; the in-memory index is derived. Changing a description does not require migration or database rebuilding.

Sending via Token + Client Decoration: Messages only store [sticker: description] plain text, which the client replaces with <img>; the host’s Markdown renderer does not recognize local or HTTP image addresses, which is the only stable path for desktop environments.

Few and Clear Tools: Sending, browsing, adding, and editing are four distinct tasks, avoiding a giant settings panel.

Use Cases and Notes

Suitable for developers who want to add stickers to DSH conversations but don’t want to build assets themselves: those who need a locally searchable library, user-selectable image sending, and optional native QQ sending can use this as a starting point; those looking to maintain a large library of their own images long-term can also draw inspiration from its layered structure and license separation.

There are a few points to be aware of in advance:

  1. The plugin runs with the permissions of the current DSH process. You should check the source code and license before installing; do not install simply because a directory site lists it.
  2. The code is MIT licensed by the author, Asgoresmilelong; however, the 157 stickers in packs/blue-whale/images/ are not original creations of the plugin author and all come from Bilibili @赤风RED. The asset license is CC BY-NC 4.0 (Attribution + Non-Commercial Use). Reproduction or distribution must retain the attribution “赤风RED” and source link; commercial use requires separate permission from 赤风RED. MIT only covers the code, not this batch of assets.
  3. The 157 “Blue Big Fat Fish” stickers included in the repository are a version compressed from 460MB original GIFs to 45MB (240px, 12fps, 128 colors). The compression script is at tools/prepare-pack.mjs and can be reused when repacking.

Conclusion

The value of dsh-stickerbook lies in doing the three things—“built-in library + stable sending + clear license”—right the first time: ready to use out of the box, token rendering bypasses Markdown image limitations, and the source and commercial boundaries of assets are clearly stated. If you want to implement similar functionality, its four-tool division, the convention of disk-as-metadata, and license separation are worth referencing.

  • Directory Page: https://www.skillhub.cn/plugins/Asgoresmilelong/dsh-stickerbook
  • GitHub: https://github.com/Asgoresmilelong/dsh-stickerbook
羽毛球分组比赛记分
小程序二维码

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

Xiaoye