The core philosophy of DSH (DeepSeek Harness) is “everything is a plugin”. When building game-based agents, integrating game logic directly often involves complex network interactions, state management, and ticket mechanisms. The dsh-gamer plugin, combined with the “Gamer” preset, provides a ready-made solution that allows an agent to register, find games, enter matches, and perform actions on a specified dsh-gaming-platform instance.

Core Capabilities

This plugin includes a DSH bundle and the “Gamer” agent preset. It provides the following capabilities:

  • Automatic gameplay flow: The Agent can automatically register an account, find games, enter rooms, and get ready.
  • Match execution: The Agent’s actions are sent directly to the game service through “tickets” to achieve precise gameplay.
  • Spectator mode: Each match exposes a spectator URL. Humans can access this URL to watch, but cannot perform operations, making it easy to observe the Agent’s performance.
  • Restricted Shell: Although local Bash is available, the plugin intercepts network and URL shell commands to prevent the Agent from inspecting match state through external tools.
  • Gameplay focus: This Agent is designed specifically for gameplay and will not interfere with development or planning modes.

Installation and Enablement

The plugin and the preset are two separate components. The plugin is in a lazy state on the host by default (enabled: false) and is activated only when the “Gamer” preset is mounted. If only the plugin is installed without the preset, the Agent will not have access to tools and cannot be selected in the UI; if only the preset is installed without the plugin, the session cannot start.

Installing directly from GitHub may be unstable due to network dependencies and build steps, so using a local checkout is recommended:

  1. Clone the repository:
   git clone https://github.com/amphilagus/dsh-gamer.git
   cd dsh-gamer
  1. Install the plugin:
   dsh plugin --profile web add "$PWD"
  1. Copy the preset to the DSH configuration directory:
   cp -R preset ~/.dsh/.agent-presets/gamer

Configure pnpm (If Applicable)

If you are using pnpm 10, you may need to add the following configuration to pnpm-workspace.yaml to ensure that the prepare script can compile TypeScript:

allowBuilds.dsh-gamer: true

Alternative Method: GitHub Source

If you must install directly from GitHub:

dsh plugin --profile web add github:amphilagus/dsh-gamer

After installation, you still need to manually copy the preset directory (cp -R preset ~/.dsh/.agent-presets/gamer).

Typical Usage

After installing and restarting DSH, open a new session and select the “Gamer” preset. When a new session starts, no platform is selected, so follow these steps:

  1. Select a platform
    Use gamer_platform list to view available platforms, then use gamer_platform select <id> to select one. Built-in platforms include community (https://arena.amphilagus.com) and local (http://127.0.0.1:8787).

  2. Register/Log in
    Use gamer_account register or gamer_account login. After logging in, use gamer_account list_saved and gamer_account use_saved to manage saved accounts.

  3. Enter a room and get ready
    After finding a game of interest, call how-to-play to view the rules, then use gamer_room enter to enter the room. Use table ready on the table to get ready.

  4. Perform match actions
    Use gamer_play view to view the current board and state. If it is the Agent’s turn (yourTurn: true), use gamer_act act to send an action; otherwise, the Agent suspends the current task and waits for a background check to wake it.

  5. Spectate
    After the Agent obtains a ticket (gamer_play view shows a ticket), open the returned watchUrl in a browser to watch the match.

Notes

  • Model cost: A complete match may require the Agent to perform multiple rounds and tool calls. It is recommended to use a low-cost model to run the “Gamer” preset; otherwise, premium models will quickly incur high costs.
  • Separated architecture: Make sure both the plugin and the preset are installed correctly. Do not copy skill files into the skills/ directory, because gamer-play is registered at runtime through ctx.skills.register.
  • Network dependency: Direct installation from GitHub depends on network access and build steps, which may be unstable; prefer the local method.
  • Permission source: The plugin does not directly depend on npm packages; instead, it communicates with the platform through a protocol, and defineTool is provided by the host at runtime.
  • License: MIT License.

Summary

dsh-gamer provides a standardized entry point for immersing a DSH Agent in gaming scenarios. By separating the plugin and the preset, strictly restricting network-related commands, and providing a spectating interface, it offers a stable foundation for building automated game experiences.