圍棋插件:完整規則引擎、三檔內建 AI、死子估算、可選 LLM 覆盤、SGF 匯入匯出,以及可選的 KataGo GTP 引擎橋接。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:raymondkm2025/dsh-go-game
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
圍棋 for the DeepSeek Harness. A full rules engine, a three-level AI partner,
a playout dead-stone estimator, optional LLM review, SGF save/load — surfaced
both as a DSH panel (shell.overlay) and as a standalone page at
/dsh-go-game/.
What it does
Rules (host half, pure JS). 19×19 / 13×13 / 9×9, Chinese area scoring (stones + surrounded empty points), configurable komi and handicap, capture by liberty exhaustion, no suicide, simple ko (immediate recapture forbidden), pass / two-pass end, resignation, unlimited undo, SGF import and export. Dead-stone adjudication is explicit: both sides pass, dead stones are marked (manually or by the estimator), then the area is counted.
The AI. Three levels, all run in the host process:
| level | how it plays |
|---|---|
easy 入門 |
random legal moves that avoid filling its own eyes |
medium 中級 |
greedy tactics: capture, rescue from atari, atari the opponent, shape/line preference |
hard 進階 |
the medium candidate list, each scored by light random playouts inside a wall-clock budget |
Honest limit: this is a practice partner, not an engine. On 19×19 even
hard is far below a human amateur; on 9×9 it plays a recognisable game.
Dead-stone estimator. 形勢判斷 runs random playouts (avoiding own-eye
fills) from the current position and reports which stones rarely survive, plus a
per-point ownership map the board renders as a translucent overlay. It is an
estimate, not an adjudication — correct anything it gets wrong with 標記死子.
LLM review (optional). 覆盤 asks the harness llm service (no API keys in
this plugin) for a short Cantonese commentary plus a suggested move, which the
panel offers as a one-click play. Without a configured model it degrades to the
local scoring summary.
Layout
| file | face | role |
|---|---|---|
lib/engine.js |
shared | rules: board, capture, ko, score, SGF — no DOM, no DSH imports |
lib/ai.js |
host | heuristics, playout opponent, dead-stone estimator |
lib/gtp.js |
host | GTP bridge to an external neural-network engine (KataGo) |
lib/index.js |
host | sessions + every /dsh-go-game/* route, LLM review, SGF files |
lib/client.js |
web | the React panel registered in shell.overlay |
lib/page.html, lib/page.js |
web | the standalone page (a thin view over the same routes) |
cordis.patch.yml |
— | inserts the plugin row into the web profile roster |
test/*.test.mjs |
— | 98 cases: 26 engine, 11 AI, 22 host routes, 26 GTP, 13 engine fallback |
check-plugin.ps1 / .cmd |
— | read-only install check |
No rules live in the browser: both views post intent and re-render the state the host returns.
Tests
node test/engine.test.mjs
node test/ai.test.mjs
node test/host.test.mjs
node test/gtp.test.mjs # GTP bridge, driven by an injected fake engine
node test/engine-fallback.test.mjs # engine selected but absent -> built-in AI
node test/katago-live.mjs --root=<katago dir> # real engine, skipped without --root
Run each file directly; node --test fails on this machine (the runner spawns a
piped child process and the sandbox rejects it). The host suite drives the real
routes through a mock webserver, mock req/res and a mock llm, so the whole
non-UI chain is covered offline.
KataGo (optional neural-network opponent)
lib/ai.js is a heuristic/playout practice partner. For real strength,
lib/gtp.js drives an external KataGo process over GTP, side by side with the
built-in AI: the panel's 引擎 selector picks one per game, and a missing or
broken engine falls back to the built-in opponent automatically (the reason is
shown in the panel, not swallowed).
Layout it looks for (relative to the workspace, i.e. one level above the plugin):
katago/engine/katago.exe Eigen (CPU) build, or any other backend
katago/engine/default_gtp.cfg optional, ships with the release
katago/weights/*.bin.gz one or more networks
Environment overrides:
| variable | default | meaning |
|---|---|---|
DSH_GO_GAME_KATAGO_ROOT |
<plugin>/../../katago |
engine + weights root |
DSH_GO_GAME_KATAGO_THREADS |
4 | search threads (stay below the core count) |
DSH_GO_GAME_KATAGO_VISITS |
250 | hard visit ceiling per move |
DSH_GO_GAME_KATAGO_TIME |
8 | seconds per move — bounds CPU latency |
DSH_GO_GAME_KATAGO_TIMEOUT |
90000 | GTP command timeout (ms) |
GET /dsh-go-game/engine reports availability, the network list and live status;
POST /dsh-go-game/engine {model:"<file>"} switches network, restarting the
process (KataGo loads exactly one network at startup).
Measured on this machine — i5-8250U, 4 threads, no GPU, b18c384 on the AVX2 Eigen
build: first move ≈ 11 s (it loads the 93 MB network), later moves ≈ 8 s with
maxTime=8. Because the search is time-bounded, slower hardware loses strength
rather than latency. Every query replays the game onto a clean engine board after
an explicit clear_board: KataGo does not wipe the stones on a same-size
boardsize, which otherwise surfaces as a spurious "illegal move".
Install (three steps, outside DSH)
The agent sandbox cannot write outside the workspace, so profile registration is a manual step — run these in a normal terminal:
In the active profile
package.json(%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_modules at the source directory (DSH does not run
pnpm installon boot, and a missing link fails silently):mklink /J "%APPDATA%\dsh-desktop\harness\profiles\web\node_modules\dsh-go-game" "C:\AppDev\DSH_WORKSPACE\dsh-go-game"Restart DSH.
check-plugin.cmd verifies all four links of the chain (package → registration →
node_modules → live route) at any point.
Routes are unauthenticated on loopback, matching the other local plugins:
GET /dsh-go-game/status answering JSON is the fastest proof of life.
Notes and unverified parts
- Sessions live in host memory (12-hour idle sweep) and are keyed by a client id
the panel/page generates; restarting DSH clears them. SGF files persist under
<workspace>/.dsh-go-game/games/. - The playout estimator is CPU-bound by design and budget-limited (default 1500 ms, 40 playouts). It runs on the host so the panel never blocks.
- Not yet verified on a live GUI: the panel's rendering inside
shell.overlay, its pointer-event behaviour, and the LLM review path against a real provider. The engine, AI and every route are covered by the offline suites.
链接
同类插件
PC2005-cloud/dsh-pet#dsh-pet★ 6896
DSH Web UI 桌面宠物,Windows / macOS / Linux 三端可用:浏览器浮层或透明置顶桌面窗口,106 个透明动画、带挤压与粒子的甩抛反弹物理、随会话事件实时联动的工作状态气泡、碎碎念与带持久记忆的对话、余额展示、表情包配图、多开同屏,并支持直接放入的自定义动画与宠物种类(pet pack)。
flizzywine/dsh-tavern#dsh-tavern★ 1827
基于 DeepSeek Harness 的 Agent 酒馆,兼容 SillyTavern 生态,人物卡导入即玩,支持多种模型和手机游玩。桌面端从「设置 → 酒馆启动器」安装酒馆。 基于 2NF/dsh-profile-bridge(MIT)改造的启动器:把酒馆下载到独立 DSH 配置并在重启时切换。与上游插件不能同装——两者都占用 /profile-bridge 通道。
Alterssss/dsh-bili-whale★ 1157
一条按自己作息过日子的 B 站插件:宿主里每 60 秒一次心跳,在设定的作息窗口里随机挑一个时刻叫醒专用会话(今天不想看是按概率跳过),再交给自带的 38 个子命令——信息流、字幕、弹幕、评论、ffmpeg 抽帧、两本日记。每天最多发 N 条评论/动态并 @ 主人(默认 3,按配额账本计数,撞到限流或验证码就停手)。同时轮询评论回复、私信和直播间弹幕;除主人以外的回复先入队,等主人在设置页批准。设置 → 养鱼 写 ~/.dsh/bili-whale.config.json;cookie 单独在 ~/.bili-ai/credentials.json,只写不回显。HTTP 路由只认回环地址并过 DSH 信任栅栏。抽帧需要 Node 18+ 与 ffmpeg。
Nagi-ovo/dsh-ads★ 738
2005 年中文站点风格的整活广告插件:侧栏广告/信息流/角落弹窗 + 假关闭叉,素材全虚构。
yyh-001/dsh-meme★ 613
聊天表情包:纯文本斗图、情绪主动发图、像 QQ/微信 一样发图、AI 自动学图、自定义表情包。
vlln/whale-girl★ 419
桌面宠物(QQ 宠物形态):右下角悬浮、可拖拽/投喂/玩耍。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。