dsh-plugin-poker: Texas Hold'em Poker Plugin for DeepSeek Harness

Introduction

The core of DeepSeek Harness (DSH) is building agents. When an agent needs to handle environments containing complex state machines or requiring deterministic logic (such as a Texas Hold’em poker game), directly relying on large model outputs is often unstable. dsh-plugin-poker provides a complete Texas Hold’em environment for DSH: it serves as both a toolset callable by the model and a visual browser interface.

This plugin addresses the pain point of the model “wanting to play poker but lacking the rules.” It encapsulates complex poker rules, opponent logic, and game calculations into standard DSH tools, enabling the model to participate in real poker games via natural language or function calls.

Core Features

The plugin provides two sets of implementations: a “host half” and a “browser half.”

Complete Rule Implementation

The engine implements the complete rules of No-Limit Hold’em (NLH). This includes minimum raises, handling short stacks/all-ins, side pot layering and merging, returning uncalled bets, and automatic deal settlement when all players are all-in. Hand evaluation uses the best-of-7 algorithm (selecting 5 cards), and the state of the entire game can be reproduced via logs.

Six Personality Bots & AI Opponents

The system includes six built-in opponents based on heuristic strategies (e.g., Rock, Tight-Aggressive, Loose-Aggressive, Calling Station, Maniac, Seasoned). They dynamically adjust their playstyle based on position, pot odds, and actual table tendencies.
It also supports connecting any OpenAI-compatible interface (such as /v1/chat/completions) as an AI opponent. API keys are stored only on the host side; the page does not receive the secret key when fetching settings, and there is a timeout fallback mechanism.

Coach Mode

Provides an independent, draggable coach window that calculates situation analysis in real-time. This includes hand evaluation, pot odds, MDF, SPR, range width reading, and win rate estimation. The coach is available in two styles: “Concise” and “GTO,” which can be switched instantly to help the model or user understand the current decision logic.

Browser Table & Interaction

Provides a realistic felt table interface. A key feature is: all action buttons connect directly to the host route and never send messages to the conversation stream. This avoids redundant information in the chat history caused by tool calls and manual clicks. The interface supports 2-9 player tables, displays amounts in BB (Big Blinds), and features a bet sizing assistant.

Zero Dependencies & Hot Reload

The plugin relies on no runtime libraries and is ready to use upon installation. Code modifications support hot reloading; after editing files like impl.js, there is no need to restart the host, and the game state is not lost.

Installation & Activation

Install the plugin via the command line:

dsh plugin --profile web add dsh-plugin-poker

After installation, you must restart the dsh web process and refresh the page once in your browser. This is because the client’s boot image is burned into the HTML, and a restart is required to load the plugin correctly.

For local development or testing without restarts, you can also manually edit the cordis.patch.yml file:

- insert:
    - id: poker
      name: 'dsh-plugin-poker'

Typical Usage

Starting a Game

Call the poker_new_table tool in the conversation. For example, to start a table with 3 bots, starting chips of 5000, and blinds of 25/50:

{
  "tools": ["poker_new_table"],
  "arguments": {
    "bot_count": 3,
    "starting_chips": 5000,
    "small_blind": 25,
    "big_blind": 50
  }
}

Model Interaction & Decision Making

The model can call tools to advance the game or click buttons directly on the sidebar panel. Common commands include:
* “Call”
* “Raise to 600”
* “What is my current equity?” (calls poker_equity)
* “Make the bot think harder before playing” (switch opponent mode)

Viewing Status

The model or user can call the poker_table tool to read the current table status and recent records.

Architecture Description

The plugin adopts the design principle of “Engine as the Single Source of Truth.”
* State Isolation: Table state is isolated by session via WeakMap.
* Rendering Layer: The tool layer is only responsible for logic translation; specific table cards and sidebar panels are rendered by the browser side.
* Security: API keys on the settings page are stored only in the host configuration. The frontend page obtains only the existence of the key via GET /poker/settings and does not return the specific content.

Notes

  • Permission Check: Please check the source code and license (MIT) before installation.
  • Runtime Environment: The plugin runs within the permission scope of the current DSH process.
  • Version Consistency: According to available data, the plugin is shown as 0.2.0 in the README but 0.1.0 in some clues; local package.json should be taken as the standard during installation.

Summary

dsh-plugin-poker provides a complete, deployable Texas Hold’em simulation environment for DSH. Through the combination of model-callable tools and browser visualization, it enables agents to handle complex game logic while maintaining a development experience with zero dependencies and hot reloading.

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

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

Xiaoye