Whale Lady's Chess: DSH Chess Plugin

Introduction

The plugin ecosystem of DeepSeek Harness (DSH) follows the philosophy of “everything is a plugin,” allowing developers to quickly integrate features into the chat interface. However, when building conversational scenarios with game elements, common challenges include: implementing the board UI, piece dragging, move validation, and game replay on your own, while also handling the interaction between game state and conversational memory. These details can distract from the core business logic.

The “Whale-chan Chess” plugin introduced below is a DSH Web plugin that lets you play a game of chess against Whale-chan within the DSH Web interface. It comes with a built-in board window, drag-and-drop interaction, random first-move assignment, game replay, and a dark theme. It also introduces personality-driven move selection, an ELO slider, a mercy mechanism, and memory functionality, tying the game and conversation together more tightly.

Core Features

Window & Interaction

The window uses a left-right split layout: the board on the left, and a fixed Whale-chan panel on the right. The overall aesthetic employs a soft, low-saturation ocean-blue water theme, complemented by bubbles and dynamic SVG expressions.

Supported interaction modes include click-to-select and drag-and-drop:
- Click a piece, then click the target square; or directly drag the piece to the target square (works with both mouse and touch).
- Pressing a piece highlights its legal destinations. Dragging produces a semi-transparent ghost piece that follows your cursor. On release, the piece glides to the landing spot before settling.

Random First Move & Replay

At the start of each game, it is randomly decided whether the player plays White or Black (Whale-chan takes the other side), and the board flips automatically. If Whale-chan is White, she makes the first move on her own.

After each game ends, the move list is automatically saved. The “Replay” button in the title bar lets you step through the most recent game move by move, with support for forward/backward navigation, jumping to a specific move number, and move highlighting.

Dark Theme

The plugin follows DSH’s theme service colorScheme, including custom dark themes. The window, panel, bubbles, memory book, replay card, and promotion dialog all switch to a deep-sea night palette, while the board retains a lighter playing surface to ensure contrast between pieces and background.

Personality-Driven Moves & Memory

Personality Factors

The plugin reads the native persona text (NATIVE_PERSONA in src/brain.js) and extracts four factors: baseMercy / baseJealousTrigger / basePride / baseAggression. These factors are layered onto the move-selection weights without resetting or overriding the original persona settings.

Move Selection Strategy

A built-in static evaluation and shallow search produce objective candidates, but the best move is not selected directly. Final weight = evaluation base + persona weight + real-time emotion + game memory, followed by softmax sampling.

When mercy is high, the temperature increases, the candidate pool widens, and she deliberately plays softer moves when ahead. When jealousy / sulking / tsundere flags are triggered, mercy drops to zero and she switches to targeted aggression.

Memory & Adaptation

localStorage records opening preferences, frequently used pieces, common blunder patterns, and counts of takebacks / draw offers / chat messages. At the start of the next game, these records are used to adjust her defensive responses and jealousy threshold.

Each move’s output contract includes san (Standard Algebraic Notation), speech (line), animationKey (action), newWhaleState (Whale-chan state), and evalSummary (evaluation summary). The evalSummary field appears only in internal console logs and is never written into chat bubbles.

Engine: Local / LLM

The “Engine” row on the panel allows switching between two modes:

  • Local (default): Fully offline, pure JS engine, with search depth and candidate pool controlled by ELO.
  • LLM: Before making a move, the position and candidates are sent to the Host’s /dsh-whale-chess/move endpoint. The current default model selects a move from the candidates and generates a line / action. The client then validates the move against local rules one final time.

Candidates are narrowed by ELO: high rating gets only the top 3, mid rating gets the top 6, and low rating intentionally includes mid-to-lower tier moves. If the model times out (12–15 seconds), returns an illegal move, or the service is unavailable, the system automatically falls back to the local engine without interrupting the game. Each LLM move incurs one model call (approximately 2–8 seconds, consuming tokens).

Skill Slider (ELO 100–1700)

Below the panel is a 100–1700 slider in increments of 50, which maps in real time to search depth, temperature, mercy multiplier, human-like blunder rate, and evaluation/style weights. The slider is merely a “ceiling”: the persona’s mercy still applies on top of it (a high-rated player still holds back when feeling merciful), and when jealousy / sulking kicks in, mercy is zeroed out regardless of ELO, converting to targeted aggression.

Parameters for different ELO tiers:

Dimension Low (100–500) Mid (900–1200) High (1500–1700)
Search depth depth 1 · 8 candidates depth 2 · 10–11 candidates depth 3 · 12 candidates
Temperature ~2.1 (very casual) ~0.8 ~0.25 (near optimal)
Mercy multiplier ×1.9–2.0 ×1.0 ×0.1–0.2
Human-like blunders up to 12% / move none none
Eval/style weight 0.8 / 1.35 1.45 / 0.9 1.75 / 0.4

Settings are persisted to localStorage.

Installation & Activation

From npm (after publishing)

dsh plugin --profile web add dsh-whale-chess

From a local directory / tarball / zip

# Directory
dsh plugin --profile web add <absolute path to this directory>
# Or an npm package
dsh plugin --profile web add ./dist/dsh-whale-chess-0.2.0.tgz
# Or a GitHub Release zip (extracts to dsh-whale-chess-0.2.0/)
dsh plugin --profile web add ./dsh-whale-chess-0.2.0

After installation, click “Play Chess with Whale-chan” in the DSH Web bottom status bar to open the window (it opens automatically on first install).

Use Cases & Notes

Ideal for developers who want to add a chess game to their conversational scenario and need a stable board UI and rule implementation. The plugin runs with the permissions of the current dsh process. Review the source code and license before installing.

Conclusion

“Whale-chan Chess” provides a complete chess experience within the DSH Web interface: from the window and interaction design, to personality-driven move selection, the ELO slider, the mercy mechanism, and memory, through to both local and LLM engine modes. If you need to integrate a board game into your chat interface, you can reference its implementation approach or use the plugin directly as a starting point.

  • Plugin directory: https://www.skillhub.cn/plugins/ChubbyFishy-qwq/dsh-whale-chess
  • GitHub: https://github.com/ChubbyFishy-qwq/dsh-whale-chess
羽毛球分组比赛记分
小程序二维码

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

Xiaoye