dsh-casual-games
windrover/dsh-casual-games
在 DeepSeek Harness 左侧栏底部常驻八款小游戏:2048、Tetris、五子棋、华容道、贪吃蛇、舒尔特方格、打砖块与推箱子。它的 HTTP 路由没有 DSH 的访问检查,浏览器里打开的网页可以调用它们。
安装
dsh plugin --profile web add github:windrover/dsh-casual-gamesREADME
dsh-casual-games
Eight tiny games docked at the bottom-left of the DeepSeek Harness sidebar. One compact card, one dropdown, no window juggling.
Games
| Game | Controls |
|---|---|
| 2048 | Arrow keys. Score / best are always visible; slide, merge and spawn are animated. |
| Tetris | Click the board to start. ← → move, ↑ / X rotate, ↓ soft drop, Space hard drop, P pause. Leaving the tab pauses the run. |
| Gomoku | Go-style 15×15 intersection board. You play black against the computer; difficulty Simple / Normal / Hard (simple is a pure beginner: random empty cell, deliberately away from your stones, never blocks or takes a win on purpose). |
| Klotski | Select a block, then click a target cell or use arrow keys. Put Cao Cao on the bottom-centre exit to win. |
| Snake | Arrow keys / WASD, P pause, Space restart. |
| Schulte table | Tap 1→25 in order. Progress / time / best are shown; the remaining numbers reshuffle every 4 s. The board can be a square grid or a rotating circle (numbers stay upright). |
| Sokoban | Classic 100-level Sokoban pack (16×16 XSB-style maps). Arrow keys / WASD walk and push, R resets the level; press Enter after clearing a level to advance (the overlay button still works). |
| Breakout | Drag the paddle with the mouse/touch (pointer capture keeps it following outside the field), or hold ← → / A D. Space serves, P pauses. Six staggered rows of bricks. |
Install
Inside a DSH profile directory:
cd ~/.dsh/profiles/<your-profile>
pnpm add github:windrover/dsh-casual-games
Then add dsh-casual-games to dsh.profile.bundles in that profile's package.json (or install it through DSH's plugin manager), and fully restart DSH — the desktop client caches plugin client modules.
Automatic pop-up during long agent runs
The card (and its collapsed pill) is hidden via CSS while the shell marks the sidebar collapsed ([data-sidebar-collapsed]).
The Host half listens to agent/status and serves GET /api/dsh-casual-games/status with { running, longestMs, longRunning }. When any agent has been running for more than 3.5 s, the client expands the card once; it resets after the run finishes, and a manual minimize is respected.
Architecture
- Single client module (
client.js) registered intoshell.overlay; the card is fixed atleft: 12px; bottom: 72px, width 240 px, border-only, no scrollbars. - All games stay mounted in one CSS grid cell, so the card height never jumps between games.
- State lives in
GameShelland is persisted tolocalStorage['dsh.games.v2']; each game sanitizes its saved state on mount. - Shared host state is served by the tiny
index.jsroute above.
Development
npm test
# or individually
node scripts/verify-games-logic.mjs # 119 pure-logic assertions across all games (incl. Sokoban pack validation + one BFS solve)
node scripts/smoke-render.mjs # renders components with a minimal hook runtime
node scripts/verify-host-status.mjs # host route: running / longRunning / idle / 405
License
MIT © 2026 windrover