dsh-grok-ball 0.0.0-stage → 0.1.0
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 +25 -0
- package/README.md +71 -2
- package/cordis.patch.yml +13 -0
- package/lib/client.js +2370 -0
- package/lib/index.js +18 -0
- package/package.json +57 -3
- package/vendor/LICENSE +21 -0
- package/vendor/grok-ball.js +1980 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 right-leaning (DSH plugin: dsh-grok-ball)
|
|
4
|
+
|
|
5
|
+
The bundled Grok Ball engine (vendor/grok-ball.js) is
|
|
6
|
+
Copyright (c) 2026 tycoding and is used under the MIT License:
|
|
7
|
+
https://github.com/tycoding/grok-ball
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-grok-ball
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSH 界面上的 Grok Ball 表情球挂件:圆球 + 一双会跟着鼠标看的眼睛,按 DSH 的运行状态换表情,可拖动,点一下有反馈。
|
|
4
|
+
|
|
5
|
+
表情引擎来自 [tycoding/grok-ball](https://github.com/tycoding/grok-ball)(MIT,纯 SVG、零运行依赖),本仓库把它接进 DSH 的客户端插件体系。
|
|
6
|
+
|
|
7
|
+
## 它现在会做什么
|
|
8
|
+
|
|
9
|
+
| DSH 状态 | 表情 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| 空闲 / 没有进行中的会话 | `02` 待机放空 |
|
|
12
|
+
| 一轮回复刚开始 | `31` 接收任务(0.65 秒) |
|
|
13
|
+
| 正在跑(`running`) | `30` 思考中 |
|
|
14
|
+
| 需要你回答 / 授权(`pendingInteraction`) | `35` 等待输入 |
|
|
15
|
+
| 一轮刚跑完 | `33` 任务完成 + 撒花(2.6 秒) |
|
|
16
|
+
| 点一下球 | `10` 开心 + 自旋甩彩带 + 弹跳(0.8 秒) |
|
|
17
|
+
|
|
18
|
+
- 眼睛实时跟随鼠标(`setGaze`)。
|
|
19
|
+
- 拖动摆位,位置记在 `localStorage` 的 `dsh-grok-ball:pos`,窗口缩放时自动夹回可视区。
|
|
20
|
+
- 没有面板、不发指令:就是一只会看人、会庆祝的小球。
|
|
21
|
+
- 挂载在 `shell.overlay` 槽位(`order: 950`),只有球本身接收指针事件,不挡聊天。
|
|
22
|
+
|
|
23
|
+
## 安装(本机已装好)
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
dsh plugin --profile desktop add "link:E:\Grok Ball"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
装完需要重启 DSH(插件市场里的「重启」或关掉重开),新插件才会进宿主组合。
|
|
30
|
+
|
|
31
|
+
## 卸载
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
dsh plugin --profile desktop remove dsh-grok-ball
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 结构
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
package.json # dsh.bundle.patch + dsh.client 声明
|
|
41
|
+
cordis.patch.yml # 把插件 insert 进 profile 层栈
|
|
42
|
+
lib/index.js # 宿主半边:空 apply(只为让 bundle 能挂载)
|
|
43
|
+
lib/client.js # 浏览器半边:__ModuleLoader__ 包装 + 内联引擎 + 挂件逻辑(构建产物)
|
|
44
|
+
src/client-src.js # 浏览器半边的可读源文件
|
|
45
|
+
vendor/grok-ball.js # 上游引擎,未修改
|
|
46
|
+
scripts/build.mjs # 把 vendor 引擎塞进 src 里的占位符,产出 lib/client.js
|
|
47
|
+
scripts/smoke-test.mjs # 无浏览器烟测:DOM/React 桩 + 状态映射断言
|
|
48
|
+
preview.html # 纯前端预览页,不依赖 DSH
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 开发
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
$node = "$env:USERPROFILE\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe"
|
|
55
|
+
& $node scripts/build.mjs # 改完 src/client-src.js 或换引擎后重新生成 lib/client.js
|
|
56
|
+
& $node scripts/smoke-test.mjs # 无浏览器烟测
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
改完 `lib/client.js` 后刷新页面即可(client-modules 按 mtime 热读 bundle);新增/移除插件才需要重启宿主。
|
|
60
|
+
|
|
61
|
+
## 状态从哪来
|
|
62
|
+
|
|
63
|
+
浏览器半边通过 `ctx.inject(['slots', 'uiSession'], …)` 拿到 `uiSession`,订阅:
|
|
64
|
+
|
|
65
|
+
- `uiSession.adapter.current`:当前会话绑定(`key` / `props.sessionId`);
|
|
66
|
+
- `uiSession.sessionStatus`:`Map<sessionId, { running, pendingInteraction, completionUnread }>`。
|
|
67
|
+
|
|
68
|
+
「任务完成」由插件自己观察当前会话的 `running: true → false` 得出(主会话的 `completionUnread` 会被宿主清掉,所以不依赖它)。
|
|
69
|
+
|
|
70
|
+
## 许可
|
|
71
|
+
|
|
72
|
+
MIT。引擎版权归 tycoding(见 `vendor/LICENSE` 与根目录 `LICENSE`)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# dsh-grok-ball —— DSH bundle patch
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# 把 Grok Ball 挂件插入 DSH 的插件层栈。安装方式:
|
|
5
|
+
#
|
|
6
|
+
# dsh plugin --profile desktop add link:E:\Grok Ball
|
|
7
|
+
#
|
|
8
|
+
# 依赖装进 profile 的同名目录后,本文件里的 insert 行才会真正挂载插件。
|
|
9
|
+
# ============================================================================
|
|
10
|
+
|
|
11
|
+
- insert:
|
|
12
|
+
- id: dsh-grok-ball
|
|
13
|
+
name: dsh-grok-ball
|