dsh-plugin-tetris 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jayzhu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,68 @@
1
+ <div align="center">
2
+
3
+ # dsh-plugin-tetris
4
+
5
+ **Play a round of Tetris in the DSH Web GUI while the agent is working.**
6
+
7
+ [中文](README.md) | [English](README.en.md)
8
+
9
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-tetris.svg)](https://www.npmjs.com/package/dsh-plugin-tetris) [![dsh-plugin topic](https://img.shields.io/badge/topic-dsh--plugin-3b82f6)](https://github.com/topics/dsh-plugin)
10
+
11
+ | Mode menu | Playing |
12
+ |:---:|:---:|
13
+ | ![Mode menu](docs/menu.png) | ![Playing](docs/game.png) |
14
+
15
+ </div>
16
+
17
+ ## Background
18
+
19
+ While coding with DSH, waiting for the agent to finish leaves you with a few dozen idle
20
+ seconds — so this became a plugin. The game panel lives in DSH's frame-level overlay and
21
+ appears on its own when the agent starts working. A circular T-tetrimino icon stays in the
22
+ bottom-right corner, and the panel opens right where that icon sits.
23
+
24
+ The engine is not a throwaway: it is a line-by-line TypeScript port of my other project
25
+ [**tetris-terminal**](https://github.com/zlh124/tetris-terminal) (a Python terminal Tetris).
26
+ 7-bag, SRS wall kicks, Hold, Ghost, T-Spin, Back-to-Back and the line-clear animation all
27
+ match the terminal version, quirks included. The rules and feel came from there first.
28
+
29
+ > If you enjoy this, go give [**tetris-terminal**](https://github.com/zlh124/tetris-terminal) a ⭐.
30
+
31
+ ## Controls
32
+
33
+ | Key | Action |
34
+ |---|---|
35
+ | `←` `→` / `A` `D` | Move left / right |
36
+ | `↑` / `W` / `X` | Rotate clockwise |
37
+ | `Z` | Rotate counter-clockwise |
38
+ | `↓` / `S` | Soft drop |
39
+ | `Space` | Hard drop |
40
+ | `C` | Hold |
41
+ | `P` | Pause / resume |
42
+
43
+ Click the board once before using the keyboard; a green ring shows it has focus. The
44
+ "焦点联动" slider in the title bar toggles *pause on blur* and *focus returns when the
45
+ conversation ends*.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ dsh plugin --profile web add dsh-plugin-tetris
51
+ ```
52
+
53
+ No page refresh needed. Uninstall:
54
+
55
+ ```bash
56
+ dsh plugin --profile web remove dsh-plugin-tetris
57
+ ```
58
+
59
+ Working from source: `npm install && npm run build`, then
60
+ `dsh plugin --profile web add link:"$PWD"`.
61
+
62
+ > The built `lib/` is committed, so a git install works too:
63
+ > `dsh plugin --profile web add git+https://github.com/<you>/dsh-plugin-tetris.git`.
64
+
65
+ ## License
66
+
67
+ MIT. The engine logic comes from [tetris-terminal](https://github.com/zlh124/tetris-terminal)
68
+ (MIT, jayzhu).
package/README.md CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # dsh-plugin-tetris
4
+
5
+ **趁 agent 干活的时候,在 DSH Web GUI 里来一局俄罗斯方块。**
6
+
7
+ [中文](README.md) | [English](README.en.md)
8
+
9
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-tetris.svg)](https://www.npmjs.com/package/dsh-plugin-tetris) [![dsh-plugin topic](https://img.shields.io/badge/topic-dsh--plugin-3b82f6)](https://github.com/topics/dsh-plugin)
10
+
11
+ | 模式菜单 | 对局 |
12
+ |:---:|:---:|
13
+ | ![模式菜单](docs/menu.png) | ![对局](docs/game.png) |
14
+
15
+ </div>
16
+
17
+ ## 背景
18
+
19
+ 用 DSH 写代码的时候,等 agent 跑任务总有几十秒空档,于是把它做成了一个插件:
20
+ 游戏面板挂在 DSH 的框架级浮动层上,agent 开始工作时自动出现;右下角常驻一个圆形
21
+ T 形方块图标,随时点开就能玩,面板会从图标的位置弹出。
22
+
23
+ 引擎不是随手写的——它是我另一个项目
24
+ [**tetris-terminal**](https://github.com/zlh124/tetris-terminal)(Python 终端版俄罗斯方块)
25
+ 的逐行 TypeScript 移植:7-bag、SRS 墙踢、Hold、Ghost、T-Spin、B2B、消行动画都和终端版一致,
26
+ 连终端版的一些怪癖也一并保留了。规则和手感是它先做出来的。
27
+
28
+ > 觉得好玩的话,去给 [**tetris-terminal**](https://github.com/zlh124/tetris-terminal) 点个 ⭐ 吧。
29
+
30
+ ## 操作
31
+
32
+ | 键 | 动作 |
33
+ |---|---|
34
+ | `←` `→` / `A` `D` | 左右移动 |
35
+ | `↑` / `W` / `X` | 顺时针旋转 |
36
+ | `Z` | 逆时针旋转 |
37
+ | `↓` / `S` | 软降 |
38
+ | `空格` | 硬降 |
39
+ | `C` | Hold |
40
+ | `P` | 暂停 / 继续 |
41
+
42
+ 先点一下棋盘再用键盘;聚焦后棋盘会有一圈绿色描边。标题栏的「焦点联动」滑块控制
43
+ "失焦自动暂停 + 对话结束把焦点交还游戏"。
44
+
45
+ ## 安装
46
+
47
+ ```bash
48
+ dsh plugin --profile web add dsh-plugin-tetris
49
+ ```
50
+
51
+ 装完不需要刷新页面。卸载:
52
+
53
+ ```bash
54
+ dsh plugin --profile web remove dsh-plugin-tetris
55
+ ```
56
+
57
+ 从源码开发:`npm install && npm run build`,然后
58
+ `dsh plugin --profile web add link:"$PWD"`。
59
+
60
+ > 仓库里提交了构建产物 `lib/`,所以也可以直接从 git 装:
61
+ > `dsh plugin --profile web add git+https://github.com/<you>/dsh-plugin-tetris.git`。
62
+
63
+ ## License
64
+
65
+ MIT。引擎逻辑来自 [tetris-terminal](https://github.com/zlh124/tetris-terminal)(MIT, jayzhu)。
@@ -0,0 +1,12 @@
1
+ # Bundle patch layer for dsh-plugin-tetris.
2
+ #
3
+ # Applied when this package is listed in the profile's `dsh.profile.bundles`
4
+ # (`dsh plugin --profile web add link:<path>` appends it automatically), or when
5
+ # the same `insert` row is added to the profile's own cordis.patch.yml.
6
+ #
7
+ # A `dsh.client` row is what the client-modules node half scans into the
8
+ # browser roster, so this single row is all it takes to get the plugin into
9
+ # window.__DSH_BOOT__ and served from /plugins/dsh-plugin-tetris/client.js.
10
+ - insert:
11
+ - id: tetris
12
+ name: 'dsh-plugin-tetris'
package/docs/game.png ADDED
Binary file
package/docs/menu.png ADDED
Binary file