Two games inside DeepSeek Harness where the model supplies intent and a local engine owns the rules: a twin-brain snake that periodically draws a strategy card, and Chinese chess where the model only comments on a move picked from locally generated legal candidates. Both keep running when the model is slow, offline or out of quota.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-ai-arcade
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:439436269-ctrl/dsh-ai-arcade
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
AI 街机厅 —— 在 DeepSeek Harness 里玩游戏,对手是有脑子的:模型负责「想」,本地引擎负责「动」。
点左下角的 🎮 打开面板,里面是一个完整的街机厅。
| 游戏 | 模型做什么 | 本地做什么 |
|---|---|---|
| 🐍 双脑贪吃蛇 | 每 1.7 秒出一张策略卡(目标 / 激进程度 / 风险偏好)+ 一句挑衅 | 按 60fps 跑规则、按策略卡决定每一步、模型慢或挂了自动兜底 |
| ♟ 中国象棋 | 只解说(从引擎给的候选里挑一个 + 说一句心理活动) | 走法生成、合法性校验、alpha-beta 搜索 —— 全部棋力 |
为什么模型不直接下棋 / 不直接控制蛇
因为它做不到,而且实测数据很清楚:
- 象棋:马腿、象眼、炮架、将帅照面这些规则一旦交给模型,非法棋是常态;就算合法,几百行的搜索也轻松赢它。所以模型只被允许从本地给出的合法候选里挑一个——非法棋因此不可能出现。
- 贪吃蛇:单次模型往返 0.8–2 秒,而游戏一步只要 140 毫秒。所以模型只出意图,具体走法由本地引擎算。
- 还有一个坑:宿主默认的
reasoningEffort是high,实测一次游戏规模的提问会烧掉 2048 个输出 token 全在思考块里、耗时 17 秒、正文为空。这个插件显式要off,同样的提问变成 0.78 秒、37 个 token、回答完整。
断网、模型超时、额度用尽 —— 两个游戏都照常运行,只是少了那张嘴。
安装
dsh plugin --profile <你的 profile> add dsh-ai-arcade
装好后点界面左下角的 🎮。
配置
写在 profile 补丁层,或直接在设置页改:
- insert:
- id: dsh-ai-arcade
name: dsh-ai-arcade
config:
enabled: true
provider: deepseek-account # 留空则自动挑第一个可用 provider
model: deepseek-flash
reasoningEffort: "off" # 游戏要快;深度复盘时可以单独覆盖
maxTokens: 2048
timeoutMs: 45000
架构
🎮 按钮(插件客户端 bundle:一枚按钮 + 一个 iframe)
└─ <iframe src="/api/dsh-ai-arcade/play">
└─ 游戏页面(宿主路由,每次现读磁盘,no-store)
└─ fetch /api/dsh-ai-arcade/brain
└─ ctx.llm.stream() ← 凭证留在主进程
游戏本体为什么不在插件的客户端 bundle 里:DSH 把所有插件的浏览器半边聚合成一个响应,带一年 immutable 强缓存,服务端也缓存这份聚合;改客户端代码必须重启 DSH。把游戏放到宿主路由提供的页面上(no-store)之后,改玩法只要刷新页面 —— 这个插件在加入象棋、暂停功能的整个过程中没有重启过。
反过来,插件那一半只当"壳",几乎不需要改。
操作模式
- 双脑贪吃蛇:单步(点一次走一格、听 AI 的理由)/实时对战(两条蛇自己打)/我来玩(方向键操控蓝蛇)
- 中国象棋:人机对弈(你执红)/AI 对弈(看它自己下);难度滑杆 1–10,同时调搜索深度与"失误率"
- 两个游戏都有 ⏸ 暂停(快捷键
P)
开发
npm run build # esbuild 打包客户端壳与游戏页面(需 Node 22+)
npm test # 38 项打包自检 + 14 项象棋引擎测试
改游戏只需重新构建页面并覆盖 lib/play.html,然后刷新浏览器;改服务端或壳需要重启 DSH。
测试覆盖
node --test test/xiangqi.test.mjs —— 14 项,包括:
- 开局着法数 44(中国象棋标准值),逐子分解断言(车 4 + 马 4 + 相 4 + 仕 2 + 帅 1 + 兵 5 + 炮 24)
- 马腿、象眼、象不过河、炮必须有炮架才能吃、兵过河才能横走
- 将帅照面视为将军、被将军时只能走应将着法、make/undo 往返一致
- 识别双车错将死、搜索能白吃车、能认出一手绝杀
- 难度滑杆:10 级 20/20 选最优,1 级会失手
License
MIT
Links
More in this category
PC2005-cloud/dsh-pet#dsh-pet★ 6896
Desktop pet for the DSH Web UI on Windows, macOS and Linux: 106 transparent animations in the browser overlay or a transparent always-on-top desktop window, throw-and-bounce drag physics with squash and particle scoring, a work-status bubble driven by live session events, self-talk and chat with persistent memory, balance display, meme-image bubbles, multiple pets on screen, and drop-in custom animations and pet packs.
flizzywine/dsh-tavern#dsh-tavern★ 1827
An agent-powered tavern for DeepSeek Harness with SillyTavern compatibility, character card imports, support for multiple models, and mobile play. Install the tavern from Settings → Tavern Launcher on desktop. A launcher derived from 2NF/dsh-profile-bridge (MIT): it downloads the tavern into a separate DSH profile and switches profiles on restart. Install this launcher or the upstream plugin, not both — they claim the same /profile-bridge channel.
Alterssss/dsh-bili-whale★ 1157
A Bilibili companion that keeps its own schedule. A 60-second tick in the plugin host wakes a dedicated agent session at a random moment inside the configured time windows (opting out of a day is a configurable chance), then hands it a bundled CLI of 38 subcommands — feed, subtitles, danmaku, comments, ffmpeg frame grabs, and two diaries. Shares at most N items a day by commenting on them and @-mentioning the owner (default 3, enforced from a written quota log, and it stops on rate-limit or captcha signals). Also polls comment replies, direct messages and live-room danmaku; replies to anyone but the owner are queued for approval in Settings. Settings → 养鱼 writes ~/.dsh/bili-whale.config.json; cookies live separately in ~/.bili-ai/credentials.json and are never echoed back. The HTTP routes are loopback-only behind DSH's trust fence. Needs Node 18+ and ffmpeg on PATH for frame extraction.
Nagi-ovo/dsh-ads★ 738
Parody ads in 2005-Chinese-web style: sidebar banners, in-chat feeds, corner popups, and a close button whose hit area is smaller than it looks. All fictional.
yyh-001/dsh-meme★ 613
Chat meme stickers: text-only send, mood auto-send, QQ/WeChat-style picker, auto-learn, custom packs.
vlln/whale-girl★ 419
Desktop pet (QQ-pet style): floats in the corner, draggable, feedable, playable.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.