Preface¶
The Web GUI of DSH itself only provides sessions and a “Plugin” panel. It is hard to take a break and play a game without a convenient entry; making a game an overlay covering the entire client would affect viewing logs and running commands. The dsh-1024-game introduced below takes the panel route: the entry is placed in the left sidebar, side-by-side with “Plugins”. Clicking it opens a standalone main panel page where the board, score, and key instructions are all on the same page.
This plugin is maintained by akiwu and is a pure frontend client plugin. It requires no internet connection and does not participate in the agent’s conversation or billing. The goal is to allow playing 1024 inside DSH just like on a webpage: arrow keys, WASD, and touch swipes are all supported. The high score and saved states are stored locally, and switching panels or refreshing the page won’t lose your progress.
What is this¶
One-sentence positioning: A client plugin to play 1024 directly in the DeepSeek Harness Web GUI (a 4×4 variant of 2048, reaching 1024 by merging counts as success).
The plugin consists of two halves:
- Host bundle
lib/index.js. Theapplyfunction is empty, serving only to let the browser bundle be discovered by client-modules. - Browser bundle
lib/client.js. Contains the__ModuleLoader__factory-style bundle, game logic, and two mount slots.
It can be installed without publishing to npm: DSH’s plugin manager installs directly from GitHub, and the Release page includes a pre-packaged tarball. The lib/ directory contains pre-built artifacts committed to the repository, so installing from git requires no build steps.
Core Features¶
Game Rules:
- Two blocks of the same value collide and merge into their sum, and the player gains points; each block only merges once per move.
- Every step randomly spawns a 2 or a 4; the game ends when the board is full and no adjacent blocks can be merged.
- Reaching 1024 is the goal, but you can continue to challenge yourself.
Controls:
| Key | Action |
|---|---|
← ↑ → ↓、W A S D |
Slide all blocks to the bottom in that direction |
R |
Restart game |
⌘ / Ctrl + Z |
Undo one move, up to 32 steps back |
| Drag on the board (touchpad/mouse) | Swipe move |
Persistence: The high score and saved state are written to localStorage, with keys named dsh-1024-game/best and dsh-1024-game/state. Switching to another panel and coming back, or refreshing the page, won’t lose the game.
Keyboard Listeners: These only exist when the panel is mounted. A note here: the “Back to Session” button on the game panel calls ctx.layout.selectPanel(null). After returning to the session, it will not steal the focus from the input box.
Installation & Activation¶
First, confirm the prerequisites: DSH 0.2.x (desktop version or dsh web), and you need to restart DSH once after installation—the host loader’s package resolution is finalized at startup.
There are three ways to install, ordered by convenience.
Method 1: Spec line. Paste into the DSH plugin page install entry, /dsh plugin add, or the agent’s plugin_manager.install_bundle:
github:akiwu/dsh-1024-game
The equivalent long-form URL can also be used; adding #v0.1.2 or similar ref to the end locks the version:
git+https://github.com/akiwu/dsh-1024-game.git
Method 2: Pre-packaged tarball. No need to clone the repo or authorize builds, suitable for unstable network connections:
https://github.com/akiwu/dsh-1024-game/releases/latest/download/dsh-1024-game.tgz
Paste this URL into the install entry, or paste the absolute path of the downloaded file.
Method 3: One-click install from the market (after being listed): Search for “1024” in dsh-market or DSH’s Discover and click install. DSH does not have a built-in official marketplace; the Discover page reads the index URL you add yourself.
Equivalent CLI operations:
dsh plugin add "github:akiwu/dsh-1024-game"
If installing for a specific profile:
dsh plugin --profile web add "github:akiwu/dsh-1024-game"
Note that the desktop profile is managed by the App itself; do not install for the web profile in the terminal, or you won’t see it in the desktop version.
For local development, install using a local path. DSH will link: to the project directory, and changes take effect after reloading the code:
plugin_manager install_bundle { target: "/path/to/DeepSeek1024" }
After installation, restart DSH, and “1024 Game” will appear under “Plugins” in the left sidebar. To uninstall, disable and remove dsh-1024-game in the plugin page, or delete the dependency and the entry in dsh.profile.bundles from the profile’s package.json.
If you don’t see an entry after installation, the common reason is that you haven’t restarted, or dsh-1024-game is not enabled in the plugin page. If you are on the old interface, refresh the page once.
Typical Usage¶
You can play locally without installing DSH first to confirm the game’s behavior:
npm test # 22 test cases: merge rules, 4 directions, win/loss, undo, persistence, package contract
node preview/build.mjs # Generates preview/bundle.js (borrowing esbuild + react from the sibling project)
open preview/index.html # Local preview stub, runs the real bundle directly
The preview/ and scripts/ directories only serve local development and are not published. The plugin itself has zero runtime dependencies, only require("react"), and react comes from the DSH platform base module table.
If you want to modify behavior, the game logic is all in pure functions: slideLine / moveBoard / spawnTile / canPlay / applyMove / undoMove. All have unit tests. Components are only responsible for rendering and events. Run npm test after changes to verify.
Implementation Highlights¶
There are two mount points that are key to understanding this plugin:
main(keyed,key = "1024-game") — The main panel itself. It only mounts when selected. Keyboard and touch listeners live or die with mounting.sidebar.panellist(list,id = "1024-game") — The icon entry in the left sidebar panel list, parallel to “Plugins”. Clicking it callsctx.layout.selectPanel(id)from the sidebar.
Styles are injected via ctx.effect into <style> and removed on unmount. Color schemes read --dsw-alias-* theme variables and follow both light and dark themes. State uses a module singleton store combined with useSyncExternalStore. Components are compatible with React 18/19, using only createElement and hooks available since 18.
Applicable Scenarios & Notes¶
Suitable for users who want to use DSH as a single entry point to occasionally play a game, especially those already using the desktop Web GUI. It is also suitable for developers who want to see how to split the host bundle and browser bundle for a client plugin—the directory structure is simple, and the mounting method of the two slots has reference value.
Limitations to be aware of:
- It is only for the Web platform (the Desktop built-in is also the Web GUI); the terminal TUI is not displayed.
- No internet connection, no host tools, pure frontend game; does not participate in agent conversation or billing.
- Opening the game panel replaces the session view in the middle column (just like the “Plugins” page), but the session itself is unaffected.
Security Considerations:
First, the plugin has the permissions of the current DSH process while running, so you should check the source code and license before installing. This plugin is under the MIT license, and the source code is readable directly on GitHub.
Second, the DSH community directory is an independent site with no official affiliation with DeepSeek or Hexagon. It is not an official app store; it is recommended to confirm the source before installing from a third-party index.
Conclusion¶
The value of this plugin lies in putting the game into the panel system rather than an overlay: the entry is parallel to “Plugins”, keyboard listeners exist only when mounted, and they won’t interfere with session input; high scores and saved states are saved locally, with zero runtime dependencies and no build required. If you want to use it directly, just paste github:akiwu/dsh-1024-game into the plugin page’s install entry and restart DSH to find it in the sidebar.
Directory page: https://www.skillhub.cn/plugins/akiwu/dsh-1024-game
GitHub: https://github.com/akiwu/dsh-1024-game