Introduction¶
When building agents or local toolchains in DSH, a common requirement is having “an interactive panel,” rather than launching a separate frontend project for every logic change. If you want to perform rule calculations, opponent moves, and optional LLM reviews within the Harness host process, while retaining SGF archives and a standalone page entry, dsh-go-game integrates Go (weiqi) into DSH as a plugin: rules and AI run on the host side, while the browser only submits intents and renders the returned state.
What is this¶
dsh-go-game is maintained by raymondkm2025 and categorized as Model Inference in the SkillHub Directory. Aimed at DeepSeek Harness, it provides a complete Go rules engine, three levels of built-in AI, situational assessment (random playout to estimate dead stones), optional Harness llm reviews, SGF import/export, and optional KataGo GTP bridging. The interface is exposed in two forms: a DSH panel (shell.overlay) and a standalone page at /dsh-go-game/.
The plugin version is 1.0.0 in package.json, licensed under MIT, and requires Node.js >= 20.
Core Features¶
Rules Engine (Host-side Pure JS)¶
Supports 19×19 / 13×13 / 9×9, Chinese scoring (stones plus surrounded territory), configurable Komi and handicap; handles captures, suicide prohibition, simple ko (immediate recapture prohibited), Pass / Double Pass game end, resignation, and unlimited undo; SGF import and export. Dead stones must be handled explicitly at the end: after both sides pass, mark dead stones (manually or via the estimator), then count territory. Rules are not implemented in the browser—both the panel and the standalone page only POST intents, and the host returns the state for redrawing.
Three Built-in AI Levels (Practice Opponent)¶
All three levels run within the host process. The README explicitly states this is a practice partner, not a professional engine: on 19×19, even hard is far below an amateur human; on 9×9, it can play recognizable games.
| Level | Behavior |
|---|---|
easy Beginner |
Random legal moves, avoiding filling own eyes |
medium Intermediate |
Greedy tactics: capturing, saving stones, atari, shape/line preferences |
hard Advanced |
Scores medium candidates using time-limited random playouts |
Situational Assessment and Review¶
Situational Assessment: Performs random playouts from the current position (also avoiding filling eyes), reports stones with low survival probability, and provides per-point ownership for semi-transparent overlay display on the board. This is an estimate, not a verdict; errors can be corrected using Mark Dead Stones. The default budget is approximately 1500 ms and 40 playouts, running on the host to avoid blocking the panel.
Review (Optional): Calls the Harness llm service (no API Key stored within the plugin), returning brief Cantonese commentary and suggested moves, which can be played with one click in the panel. If no model is configured, it degrades to a local scoring summary.
Optional KataGo (GTP)¶
When a stronger opponent is needed, lib/gtp.js drives external KataGo via GTP, standing parallel to the built-in AI: the panel Engine selector chooses one per game; if the engine is missing or errors, it automatically falls back to the built-in opponent, with the reason displayed in the panel.
Directory layout relative to the workspace (one level above the plugin):
katago/engine/katago.exe
katago/engine/default_gtp.cfg # Optional
katago/weights/*.bin.gz
Environment variables (excerpt):
| Variable | Default | Meaning |
|---|---|---|
DSH_GO_GAME_KATAGO_ROOT |
<plugin>/../../katago |
Root directory for engine and weights |
DSH_GO_GAME_KATAGO_THREADS |
4 | Search threads |
DSH_GO_GAME_KATAGO_VISITS |
250 | Max visits per step |
DSH_GO_GAME_KATAGO_TIME |
8 | Seconds per step (limits CPU latency) |
DSH_GO_GAME_KATAGO_TIMEOUT |
90000 | GTP command timeout (ms) |
GET /dsh-go-game/engine reports availability, network list, and status; POST /dsh-go-game/engine { "model": "<file>" } switches the network and restarts the process.
Code Layout and Tests¶
| File | Role |
|---|---|
lib/engine.js |
Rules: board, captures, ko, scoring, SGF; no DOM, no DSH dependencies |
lib/ai.js |
Heuristics, playout opponent, dead stone estimation |
lib/gtp.js |
KataGo GTP bridge |
lib/index.js |
Session and /dsh-go-game/* routes, LLM review, SGF files |
lib/client.js |
React panel registered in shell.overlay |
lib/page.html, lib/page.js |
Standalone page (thin view of the same routes) |
The README lists 98 test cases (engine / AI / host routes / GTP / engine fallback, etc.). Within the repository, you can run each test file directly, for example:
node test/engine.test.mjs
node test/ai.test.mjs
node test/host.test.mjs
node test/gtp.test.mjs
node test/engine-fallback.test.mjs
node test/katago-live.mjs --root=<katago dir>
Note: The documentation states that running node --test locally may fail because the sandbox rejects piped subprocesses, so it is recommended to execute files individually.
Installation and Activation¶
The official README explains: because the agent sandbox cannot write to paths outside the workspace, profile registration must be completed manually in a local normal terminal (three steps). The following commands and paths are from the original README (the example uses Windows and a link: local path; please modify according to your actual plugin directory):
-
In the
package.jsonof the activated profile (%APPDATA%\dsh-desktop\harness\profiles\web): Add"dsh-go-game": "link:C:/AppDev/DSH_WORKSPACE/dsh-go-game"todependencies, and append"dsh-go-game"todsh.profile.bundles. -
Point
node_modulesto the source directory (DSH does not runpnpm installon startup; missing links will fail silently):
mklink /J "%APPDATA%\dsh-desktop\harness\profiles\web\node_modules\dsh-go-game" "C:\AppDev\DSH_WORKSPACE\dsh-go-game"
- Restart DSH.
At any stage, you can use check-plugin.cmd (or check-plugin.ps1) to perform a read-only check of the four links: package → registration → node_modules → live route.
Liveness Verification: Like other local plugins, routes on the loopback interface do not require authentication; a GET /dsh-go-game/status returning JSON is the fastest way to confirm the service is online.
Typical Usage¶
- After enabling the bundle in the DSH Web profile, open the Go panel via shell.overlay, or visit the standalone page
/dsh-go-game/in a browser. - Game sessions reside in host memory (cleaned up after 12 hours of inactivity), distinguished by client IDs generated by the panel/page; restarting DSH will clear sessions. SGFs are persisted in
<workspace>/.dsh-go-game/games/. - For a neural network opponent: Place KataGo according to the layout above, select Engine in the panel, and use
POST /dsh-go-game/engineto switch weight files if necessary. - For text review: Use Review after configuring the
llmservice in Harness; if unconfigured, a local scoring summary will be shown.
Use Cases and Notes¶
Suitable for: Playing practice games in the DSH local environment, testing SGFs, demonstrating host-side game rules and routing; performing lightweight reviews when an LLM is configured; optionally connecting KataGo on CPU for a stronger opponent (requires preparing the engine and weights yourself).
Notes:
- The plugin runs with the current DSH process permissions. Before installation, please read the Source Repository and the MIT license, and verify the behavior of routes and file access in
lib/index.jsetc. - Parts of the README not yet fully verified on the live GUI include: panel rendering within
shell.overlay, pointer events, and the LLM review path connecting to a real provider; engines, AI, and various routes have offline test coverage. - SkillHub is a community plugin directory and has no official affiliation with DeepSeek / High-Flyer; installation follows the manual profile steps in the README, do not assume a unified one-click
dsh plugin addcommand exists.
Conclusion¶
dsh-go-game encapsulates Go rules, practice AI, situational assessment, optional LLM reviews, and SGF handling into a single DSH plugin, with optional KataGo bridging. For a brief introduction and categorization, open the SkillHub Directory Page; for implementation details, environment variables, and test commands, refer to the GitHub Repository README.