dsh-plugin-greeting-bubble 0.0.0-stage → 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 腾盛
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.md CHANGED
@@ -1,3 +1,256 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-greeting-bubble · 你好,腾盛
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
+ 一个用于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)Web 界面的小型 UI 插件:页面加载后,在**窗口右下角**弹出「你好,腾盛」问候气泡,点 × 即可关闭。
4
+
5
+ - 不联网、不收集任何数据、不读写会话内容;
6
+ - 不修改 DSH 自带界面,只是往整帧浮层 `shell.overlay` 里加一个自己的气泡;
7
+ - 跟随亮色 / 暗色主题,支持键盘操作与 `prefers-reduced-motion`;
8
+ - Host 端不执行任何逻辑(`apply()` 为空),只负责让浏览器半加载。
9
+
10
+ > 适配版本:DeepSeek Harness **0.2.2-rc.5**(Desktop 与浏览器 Web GUI)。
11
+
12
+ ---
13
+
14
+ ## 目录
15
+
16
+ - [效果](#效果)
17
+ - [安装](#安装)
18
+ - [使用](#使用)
19
+ - [自定义](#自定义)
20
+ - [工作原理(完整流程)](#工作原理完整流程)
21
+ - [文件结构](#文件结构)
22
+ - [本地开发与测试](#本地开发与测试)
23
+ - [兼容性与限制](#兼容性与限制)
24
+ - [English](#english)
25
+ - [License](#license)
26
+
27
+ ---
28
+
29
+ ## 效果
30
+
31
+ - 页面加载约 0.35 秒后,右下角(距右 20px、距底 84px,即输入框发送按钮上方)淡入气泡:👋 你好,腾盛 ×
32
+ - 点气泡右侧的 **×** 关闭;关闭只对当前页面生效,**刷新页面后会再次出现**。
33
+ - 位置刻意抬高到输入框上方:不会盖住发送按钮;气泡本体点击穿透,只有 × 可点,因此也不会拦住下面的输入框或右侧按钮。
34
+ - 在「插件」「设置」等页面同样显示(浮层属于整个应用框架),但**不会拦截点击**:整颗气泡只有 × 接收点击,其余区域点击照常落到下面的界面。
35
+ - 进入动画在系统开启“减少动态效果”时自动关闭;窄窗口下气泡最大宽度自动收缩,不会顶出屏幕。
36
+
37
+ ## 安装
38
+
39
+ 四种方式任选其一。都需要本机可用的 `pnpm`(DSH 插件安装自带);GitHub 安装还需要能访问 `github.com` 的 `git`。
40
+
41
+ ### 方式一:从 npm 安装(最稳,推荐)
42
+
43
+ 插件发布到 npm 后,在 **插件 → 添加插件** 中直接填包名:
44
+
45
+ ```
46
+ dsh-plugin-greeting-bubble
47
+ ```
48
+
49
+ 安装走 npm 源(国内可用镜像兜底),不经过 GitHub 的网络检查;发布新版本后还能在插件页直接“更新”。
50
+
51
+ ### 方式二:从 GitHub 直接安装
52
+
53
+ 1. 打开 DSH Web 界面,左侧边栏进入 **插件**。
54
+ 2. 点右上角 **添加插件**。
55
+ 3. 在「包名或地址」中填入仓库地址(把用户名换成实际的):
56
+
57
+ ```
58
+ https://github.com/liwei169/dsh-plugin-greeting-bubble
59
+ ```
60
+
61
+ 也支持 pnpm 的简写:`github:liwei169/dsh-plugin-greeting-bubble`。
62
+ 4. 点 **安装**,等待下载完成。安装成功后会自动启用,气泡随即出现(页面已打开时通常无需刷新;若没出现,刷新一次)。
63
+
64
+ ### 方式三:本地目录安装
65
+
66
+ ```powershell
67
+ git clone https://github.com/liwei169/dsh-plugin-greeting-bubble.git
68
+ ```
69
+
70
+ 然后在 **插件 → 添加插件** 中填入克隆下来的本地目录路径(例如 `D:\dsh-plugin-greeting-bubble`)并安装。
71
+
72
+ > 本地目录安装是软链接(`link:`):移动或删除该目录,插件会失效。长期使用建议用方式一或方式二。
73
+
74
+ ### 方式四:让 agent 安装
75
+
76
+ 在 DSH 对话里说“安装 D:\dsh-plugin-greeting-bubble 这个插件”,agent 会调用 `plugin_manager` 的 `install_bundle` 完成同样的步骤。
77
+
78
+ ### 验证安装
79
+
80
+ - **插件** 页的「已安装插件」列表里出现 **Greeting bubble / 右下角问候气泡**,状态为运行中;
81
+ - 右下角出现气泡。
82
+
83
+ ## 使用
84
+
85
+ | 操作 | 结果 |
86
+ | --- | --- |
87
+ | 页面加载 | 气泡出现(每个页面视图一次) |
88
+ | 点 ×(或聚焦后按 Enter / Space) | 本次页面隐藏气泡 |
89
+ | 刷新页面 | 气泡再次出现 |
90
+ | 插件页关闭该包的开关 | 气泡立即消失(HMR 生效时无需刷新) |
91
+ | 插件页卸载该包 | 彻底移除,不再出现 |
92
+
93
+ ## 自定义
94
+
95
+ 所有可改的东西都在两三个文件里,改完保存即可(开发模式自动热重载;正式安装需要重装或重启 DSH 后生效)。
96
+
97
+ ### 1. 改问候语
98
+
99
+ 编辑 `client.js` 中 `apply()` 里的字典(`zh` / `en` 两处):
100
+
101
+ ```js
102
+ zh: { greeting: '你好,腾盛', dismiss: '关闭问候气泡' },
103
+ en: { greeting: '你好,腾盛', dismiss: 'Dismiss greeting' },
104
+ ```
105
+
106
+ 问候语刻意在两种语言下保持一致(它是这个插件固定的“签名语”),只有关闭按钮的提示文字跟随界面语言。想让英文界面显示英文问候,把 `en.greeting` 改成 `Hello, Tengsheng` 即可。
107
+
108
+ ### 2. 改位置 / 间距
109
+
110
+ `client.js` 中的 `.dsh-greeting-bubble`:
111
+
112
+ ```css
113
+ right: calc(20px + env(safe-area-inset-right, 0px));
114
+ bottom: calc(84px + env(safe-area-inset-bottom, 0px)); /* 输入框发送按钮上方 */
115
+ ```
116
+
117
+ 改成 `left` / `top` 就能换角;把 `20px` 调大即离边更远。`bottom` 不要低于 `84px`:DSH 的发送按钮在输入卡右下角,贴近底边会在窄窗口下盖住它。
118
+
119
+ ### 3. 改视觉
120
+
121
+ - 圆角、描边、阴影:`--dsw-radius-lg`、`--dsw-elevation-stroke-color`、`--dsw-elevation-prominent`,与 DSH 原生浮层一致;
122
+ - 底/字色:`--dsw-alias-bg-layer-3`、`--dsw-alias-label-primary`,自动跟随亮/暗主题;
123
+ - 尺寸与字号:`.dsh-greeting-bubble` 的 `font-size`、`gap`、`padding`。
124
+
125
+ ### 4. 改成“只问候一次”(可选)
126
+
127
+ 默认每次页面加载都会出现。如果希望用户关闭后永久不再出现,在组件里加一个 `localStorage` 开关,例如:
128
+
129
+ ```js
130
+ function GreetingBubble({ t }) {
131
+ const KEY = 'dsh-greeting-bubble:dismissed';
132
+ const [dismissed, setDismissed] = React.useState(() => {
133
+ try { return window.localStorage.getItem(KEY) === '1'; } catch { return false; }
134
+ });
135
+ if (dismissed) return null;
136
+ const close = () => {
137
+ try { window.localStorage.setItem(KEY, '1'); } catch {}
138
+ setDismissed(true);
139
+ };
140
+ // …把 onClick: () => setDismissed(true) 换成 onClick: close
141
+ }
142
+ ```
143
+
144
+ 清除 `localStorage` 里这个键即可让问候重新出现。
145
+
146
+ ### 5. 改图标、名称、描述
147
+
148
+ - 图标:`icon.svg`(36×36,纯几何、无文字);
149
+ - 插件页显示的名称与说明:`locale/zh.json`、`locale/en.json` 的 `meta.title` / `meta.description`;
150
+ - 详情页大图:`docs/preview.svg`(由 `docs/DETAIL.md` 引用)。
151
+
152
+ ## 工作原理(完整流程)
153
+
154
+ 插件是一个 **DSH bundle(组合包)**,由一个 Host 插件行 + 一个浏览器端模块组成。整条链路如下:
155
+
156
+ ```text
157
+ package.json
158
+ ├─ dsh.bundle.patch → cordis.patch.yml 往 profile 的 Loader 插入一行插件
159
+ └─ dsh.client → ./client.js 声明浏览器半(platform: web)
160
+
161
+ 安装(插件页 / plugin_manager)
162
+ → pnpm 把包装进 profile,并在 dsh.profile.bundles 里选中该 bundle
163
+ → Loader 挂载插件行:index.js 的 apply()(空实现,Host 端零开销)
164
+ → Host 的 client-modules 扫描已启用条目,把 ./client 变成 /plugins 下的浏览器模块
165
+ → 浏览器模块表执行 window.__ModuleLoader__.load({ id, factory })
166
+ → factory(require) 取出 react,返回 Cordis 插件 { inject, apply }
167
+ → apply():
168
+ ctx.effect(() => ctx.locale.register(NS, { zh, en })) // 注册文案
169
+ ctx.slots.inject('shell.overlay', () => // 等浮层槽出现
170
+ ctx.slots.register({ name: 'shell.overlay', id, order, locale }, GreetingBubble))
171
+ → 浮层渲染气泡;点 × → 组件内 useState → 返回 null
172
+ → 停用/卸载 → Loader 行移除 → slots 注册被 dispose → 气泡消失
173
+ ```
174
+
175
+ 几个关键设计点:
176
+
177
+ 1. **渲染位置选 `shell.overlay`**:这是 `@deepseek-ai/dsh-client-ui-layout` 声明的整帧浮层(`position: absolute; inset: 0; z-index: 20; pointer-events: none`),位于所有列之上、列滚动容器之外,适合徽标、Toast、状态胶囊这类覆盖层。注册时用一个新 `id`(`greeting-bubble`)就是**追加**一条,不会替换自带的条目。
178
+ 2. **两层点击穿透**:浮层本身 `pointer-events: none`,但它的每个直接子元素默认 `pointer-events: auto`。插件根节点显式设为 `none`;气泡卡片同样设为 `none`,只把 × 按钮设回 `auto`。这样即使气泡在窄窗口下与输入框有少量几何重叠,点击也会落到下面的真实控件上,不会“抢”发送或输入。
179
+ 3. **高度避让**:气泡距底 `84px`,位于输入卡发送按钮(34px 圆钮)之上;发送按钮始终露出来,不被问候语遮挡。
180
+ 4. **生命周期归 Cordis 管**:所有注册都放在 `ctx.effect` / `ctx.slots.inject` 里。`slots.inject` 会在槽声明存在时注册、声明消失时注销;插件停用或卸载时整个 fiber 被销毁,气泡和字典一起被清理,不需要手写 DOM 清理。
181
+ 5. **工厂无副作用**:`client.js` 顶层只调用 `__ModuleLoader__.load`,真正的注册发生在 `apply()`;模块体不碰 DOM、不开定时器。
182
+ 6. **样式走主题变量**:气泡用 `--dsw-alias-bg-layer-3`、`--dsw-alias-border-l3`、`--dsw-alias-label-primary`、`--dsw-alias-interactive-bg-hover` 等 token,亮/暗主题自动切换;组件内的 `<style>` 随组件卸载一起移除。
183
+ 7. **文案走 locale**:`locale: NS` 让框架把 `t` 注入组件,切换界面语言时文案实时更新,无需重载。
184
+ 8. **Host 端为空**:`index.js` 只导出 `export function apply() {}`。插件不注册工具、不发请求、不写会话日志,因此对模型和会话完全透明。
185
+
186
+ ## 文件结构
187
+
188
+ ```text
189
+ dsh-plugin-greeting-bubble/
190
+ ├─ package.json # 包清单:bundle patch + dsh.client + 导出/打包清单
191
+ ├─ index.js # Host 半:空 apply()
192
+ ├─ client.js # 浏览器半:React 气泡 + slot 注册 + 文案
193
+ ├─ cordis.patch.yml # 往 Loader 插入 id 为 greeting-bubble 的插件行
194
+ ├─ icon.svg # 插件图标(36×36,原创几何图形)
195
+ ├─ locale/
196
+ │ ├─ zh.json # 插件页中文标题/描述/详情文档路径
197
+ │ └─ en.json # 英文标题/描述/详情文档路径
198
+ ├─ docs/
199
+ │ ├─ DETAIL.md # 英文详情页文档(只含一张特性图)
200
+ │ ├─ DETAIL.zh.md # 中文详情页文档(同一张图,中文替代文本)
201
+ │ └─ preview.svg # 特性图(640×300,无文字)
202
+ ├─ test/
203
+ │ └─ smoke.mjs # 离线冒烟测试(不随包发布)
204
+ ├─ UPLOAD.md # 上传到 GitHub 的逐步说明(维护者用)
205
+ ├─ README.md
206
+ ├─ LICENSE
207
+ └─ .gitignore
208
+ ```
209
+
210
+ ## 本地开发与测试
211
+
212
+ ```powershell
213
+ # 1. 语法检查(需要 Node.js 18+)
214
+ node --check index.js
215
+ node --check client.js
216
+
217
+ # 2. 离线冒烟测试:用假的 window/React/Cordis 上下文执行 client.js,
218
+ # 校验模块 id、注册参数、字典内容,并渲染一次组件
219
+ node test/smoke.mjs
220
+ ```
221
+
222
+ 开发循环:
223
+
224
+ 1. 修改 `client.js` 等文件;
225
+ 2. 让 DSH 重新加载该插件(插件页关闭再打开开关,或重启 DSH);
226
+ 3. 刷新页面查看效果。安装后的包被替换时,DSH 需要重启才能加载新的 JavaScript 模块代。
227
+
228
+ 排查“气泡没出现”:
229
+
230
+ - 插件页确认 bundle 已安装且开关为开;
231
+ - 打开浏览器开发者工具控制台,搜索 `slot entry crashed`(如果组件抛错,会记录在这里);
232
+ - 确认 DSH 版本包含 `shell.overlay` 槽(0.2.x 起);
233
+ - 确认界面语言/主题没有影响(气泡应始终显示,直到点 ×)。
234
+
235
+ ## 兼容性与限制
236
+
237
+ - 面向 **DSH Web 客户端**(`dsh.client.platform: web`):桌面版窗口和浏览器版都适用;CLI / headless 模式没有界面,插件不产生任何效果。
238
+ - 依赖 `shell.overlay` 槽;更老的 DSH 版本没有该槽时,插件会安静地不显示,不会报错。
239
+ - 每次页面加载都会出现一次,不记忆关闭状态(如需记忆见[自定义](#自定义))。
240
+ - 浮层位于整帧之上:气泡距右下角 20px、位于输入框上方(84px),窄窗口下可能与输入卡右上区域有少量视觉重叠,但气泡本身点击穿透,不会挡住输入、发送或页面按钮;点 × 即可关闭。
241
+ - 问候语固定为中文,在任何界面语言下都不翻译;只有关闭按钮的提示文字跟随语言。
242
+ - 插件只在本地运行,不访问网络。
243
+
244
+ ## English
245
+
246
+ A tiny DeepSeek Harness Web UI plugin that shows a “你好,腾盛” speech bubble in the bottom-right corner after the page loads. Click × to dismiss it; it returns on the next page load.
247
+
248
+ - Install: **Plugins → Add plugin** → `https://github.com/liwei169/dsh-plugin-greeting-bubble` (or `github:liwei169/dsh-plugin-greeting-bubble`).
249
+ - It registers one entry into the frame-wide `shell.overlay` slot, uses `--dsw-alias-*` theme tokens, localizes its close label, and keeps every registration inside `ctx.effect` / `ctx.slots.inject` so disabling the bundle removes the bubble again.
250
+ - No network access, no data collection, no model-facing behavior.
251
+
252
+ Tested with DeepSeek Harness 0.2.2-rc.5.
253
+
254
+ ## License
255
+
256
+ [MIT](LICENSE) © 2026 腾盛
package/client.js ADDED
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Browser half of dsh-plugin-greeting-bubble.
3
+ *
4
+ * Loaded lazily by the DSH client module table: this file only registers a
5
+ * factory. The factory returns a Cordis plugin whose `apply` owns every live
6
+ * resource through `ctx.effect` / `ctx.slots.inject`, so disabling or removing
7
+ * the bundle removes the bubble again without a reload.
8
+ *
9
+ * Rendering surface: the `shell.overlay` list slot declared by
10
+ * `@deepseek-ai/dsh-client-ui-layout`. It is a frame-wide, click-through layer
11
+ * above every column, so the bubble floats over the whole app without moving
12
+ * any host control. Registering a fresh `id` adds an entry beside the shipped
13
+ * ones instead of replacing them.
14
+ */
15
+ window.__ModuleLoader__.load({
16
+ id: 'dsh-plugin-greeting-bubble',
17
+ factory(require) {
18
+ const React = require('react');
19
+ const h = React.createElement;
20
+
21
+ /** Locale namespace owned by this plugin (registered in `apply`). */
22
+ const NS = 'greetingBubble';
23
+
24
+ /**
25
+ * Component-local stylesheet; unmounting the entry removes it with the
26
+ * node.
27
+ *
28
+ * Placement notes:
29
+ * - 84px above the bottom edge clears the composer's 34px send button and
30
+ * its card padding, so the greeting never covers the primary control.
31
+ * - The card itself is click-through (`pointer-events: none`); only the
32
+ * dismiss button opts back in, so a residual overlap can never swallow a
33
+ * click meant for the app underneath.
34
+ * - Radii and elevation reuse the host tokens, so the bubble reads as one
35
+ * of the app's own floating surfaces in both themes.
36
+ */
37
+ const STYLES = `
38
+ .dsh-greeting-layer {
39
+ position: absolute;
40
+ inset: 0;
41
+ pointer-events: none;
42
+ }
43
+ .dsh-greeting-bubble {
44
+ position: absolute;
45
+ right: calc(20px + env(safe-area-inset-right, 0px));
46
+ bottom: calc(84px + env(safe-area-inset-bottom, 0px));
47
+ z-index: 1;
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 8px;
51
+ box-sizing: border-box;
52
+ max-width: min(320px, calc(100vw - 40px));
53
+ padding: 8px 6px 8px 12px;
54
+ border: 0;
55
+ --dsw-elevation-stroke-color: var(--dsw-alias-border-l3);
56
+ border-radius: var(--dsw-radius-lg, 16px);
57
+ background: var(--dsw-alias-bg-layer-3);
58
+ color: var(--dsw-alias-label-primary);
59
+ box-shadow: var(--dsw-elevation-prominent, 0 4px 16px rgba(0, 0, 0, 0.12));
60
+ font-size: 13px;
61
+ line-height: 20px;
62
+ pointer-events: none;
63
+ animation: dsh-greeting-in 320ms cubic-bezier(0.22, 0.8, 0.24, 1) 350ms both;
64
+ }
65
+ .dsh-greeting-wave {
66
+ flex: none;
67
+ font-size: 16px;
68
+ line-height: 1;
69
+ }
70
+ .dsh-greeting-text {
71
+ min-width: 0;
72
+ overflow-wrap: anywhere;
73
+ }
74
+ .dsh-greeting-close {
75
+ flex: none;
76
+ display: inline-flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ width: 26px;
80
+ height: 26px;
81
+ padding: 0;
82
+ border: 0;
83
+ border-radius: var(--dsw-radius-sm, 8px);
84
+ background: transparent;
85
+ color: var(--dsw-alias-label-tertiary);
86
+ cursor: pointer;
87
+ pointer-events: auto;
88
+ }
89
+ .dsh-greeting-close:hover {
90
+ background: var(--dsw-alias-interactive-bg-hover);
91
+ color: var(--dsw-alias-label-secondary);
92
+ }
93
+ .dsh-greeting-close:focus-visible {
94
+ outline: var(--dsw-focus-ring-width, 2px) solid
95
+ var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
96
+ outline-offset: 1px;
97
+ }
98
+ @keyframes dsh-greeting-in {
99
+ from {
100
+ opacity: 0;
101
+ transform: translateY(10px) scale(0.96);
102
+ }
103
+ to {
104
+ opacity: 1;
105
+ transform: translateY(0) scale(1);
106
+ }
107
+ }
108
+ @media (prefers-reduced-motion: reduce) {
109
+ .dsh-greeting-bubble {
110
+ animation: none;
111
+ }
112
+ }
113
+ `;
114
+
115
+ /**
116
+ * The greeting bubble itself.
117
+ *
118
+ * @param props - the framework `t` seat bound to {@link NS}.
119
+ * @returns the bubble, or null once the reader dismissed it.
120
+ */
121
+ function GreetingBubble({ t }) {
122
+ const [dismissed, setDismissed] = React.useState(false);
123
+ if (dismissed) return null;
124
+ const text = typeof t === 'function' ? t('greeting') : '你好,腾盛';
125
+ const dismissLabel = typeof t === 'function' ? t('dismiss') : '关闭问候气泡';
126
+ return h(
127
+ 'div',
128
+ { className: 'dsh-greeting-layer', style: { position: 'absolute', inset: 0, pointerEvents: 'none' } },
129
+ h('style', { key: 'styles' }, STYLES),
130
+ h(
131
+ 'div',
132
+ { className: 'dsh-greeting-bubble', key: 'bubble' },
133
+ h('span', { className: 'dsh-greeting-wave', 'aria-hidden': 'true' }, '👋'),
134
+ // `lang` pins the reading voice for this fixed Chinese phrase; the
135
+ // status role lives on the text so the dismiss button stays outside
136
+ // the live region.
137
+ h('span', { className: 'dsh-greeting-text', role: 'status', lang: 'zh-CN' }, text),
138
+ h(
139
+ 'button',
140
+ {
141
+ className: 'dsh-greeting-close',
142
+ type: 'button',
143
+ title: dismissLabel,
144
+ 'aria-label': dismissLabel,
145
+ onClick: () => { setDismissed(true); },
146
+ },
147
+ h(
148
+ 'svg',
149
+ { width: 13, height: 13, viewBox: '0 0 12 12', 'aria-hidden': 'true' },
150
+ h('path', {
151
+ d: 'M2.5 2.5l7 7M9.5 2.5l-7 7',
152
+ fill: 'none',
153
+ stroke: 'currentColor',
154
+ strokeWidth: 1.4,
155
+ strokeLinecap: 'round',
156
+ }),
157
+ ),
158
+ ),
159
+ ),
160
+ );
161
+ }
162
+
163
+ return {
164
+ inject: ['slots', 'locale'],
165
+ /**
166
+ * Register the plugin's dictionary and its single overlay entry.
167
+ * @param ctx - client plugin context.
168
+ */
169
+ apply(ctx) {
170
+ ctx.effect(
171
+ () => ctx.locale.register(NS, {
172
+ // The greeting is the plugin's fixed signature phrase, so it stays
173
+ // identical in every locale; only the control labels are localized.
174
+ zh: { greeting: '你好,腾盛', dismiss: '关闭问候气泡' },
175
+ en: { greeting: '你好,腾盛', dismiss: 'Dismiss greeting' },
176
+ }),
177
+ 'greeting-bubble: dictionaries',
178
+ );
179
+ ctx.slots.inject('shell.overlay', () => ctx.slots.register({
180
+ name: 'shell.overlay',
181
+ id: 'greeting-bubble',
182
+ order: 50,
183
+ locale: NS,
184
+ }, GreetingBubble));
185
+ },
186
+ };
187
+ },
188
+ });
@@ -0,0 +1,8 @@
1
+ # Registers the browser-only greeting-bubble plugin row.
2
+ #
3
+ # `name` is this package's own name (it resolves from the profile that installs
4
+ # the bundle). `id` is the unique Loader entry id shown in the plugin inventory
5
+ # and used by profile patches to enable or disable the row.
6
+ - insert:
7
+ - id: greeting-bubble
8
+ name: dsh-plugin-greeting-bubble
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![A greeting bubble in the bottom-right corner of the window](preview.svg)
@@ -0,0 +1 @@
1
+ ![窗口右下角、输入框上方的问候气泡](preview.svg)
@@ -0,0 +1,27 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <rect x="40" y="24" width="560" height="252" rx="16" fill="none" stroke="#c3cdda" stroke-width="2"/>
3
+ <path d="M40 58h560" stroke="#d7dee8" stroke-width="2"/>
4
+ <circle cx="62" cy="41" r="4" fill="#cfd8e3"/>
5
+ <circle cx="80" cy="41" r="4" fill="#cfd8e3"/>
6
+ <circle cx="98" cy="41" r="4" fill="#cfd8e3"/>
7
+ <path d="M176 58v218" stroke="#d7dee8" stroke-width="2"/>
8
+ <rect x="56" y="80" width="96" height="8" rx="4" fill="#dfe6ef"/>
9
+ <rect x="56" y="102" width="96" height="8" rx="4" fill="#dfe6ef"/>
10
+ <rect x="56" y="124" width="96" height="8" rx="4" fill="#dfe6ef"/>
11
+ <rect x="204" y="84" width="220" height="54" rx="12" fill="#f2f5f9"/>
12
+ <rect x="220" y="98" width="140" height="8" rx="4" fill="#dbe3ee"/>
13
+ <rect x="220" y="114" width="96" height="7" rx="3.5" fill="#e6ebf3"/>
14
+ <rect x="204" y="212" width="332" height="44" rx="14" fill="#f5f7fa" stroke="#dbe3ec" stroke-width="2"/>
15
+ <rect x="220" y="228" width="120" height="8" rx="4" fill="#dbe3ee"/>
16
+ <circle cx="512" cy="234" r="13" fill="#b9cbe4"/>
17
+ <path d="M512 240v-11m-5 5 5-5 5 5" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <rect x="388" y="148" width="196" height="58" rx="16" fill="#eef4fc" stroke="#b7c9de" stroke-width="2"/>
19
+ <rect x="404.5" y="164" width="3.5" height="12" rx="1.75" fill="#F2994A"/>
20
+ <rect x="409" y="162" width="3.5" height="14" rx="1.75" fill="#F2994A"/>
21
+ <rect x="413.5" y="165" width="3.5" height="11" rx="1.75" fill="#F2994A"/>
22
+ <path d="M404 174h13v7a4 4 0 0 1-4 4h-5a4 4 0 0 1-4-4z" fill="#F2994A"/>
23
+ <rect x="400" y="175" width="5" height="4.5" rx="2" fill="#F2994A"/>
24
+ <rect x="428" y="170" width="100" height="8" rx="4" fill="#93a9c0"/>
25
+ <rect x="428" y="184" width="62" height="6" rx="3" fill="#c3d1e0"/>
26
+ <path d="M552 162l7 7M559 162l-7 7" fill="none" stroke="#8fa3ba" stroke-width="2" stroke-linecap="round"/>
27
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36">
2
+ <path d="M11 23.5v8l8.5-8z" fill="#F2994A"/>
3
+ <rect x="3.5" y="3.5" width="29" height="21.5" rx="7.5" fill="#F2994A"/>
4
+ <circle cx="13.8" cy="11.5" r="1.9" fill="#FFFFFF"/>
5
+ <circle cx="22.2" cy="11.5" r="1.9" fill="#FFFFFF"/>
6
+ <path d="M12.5 15.6c0 3.2 11 3.2 11 0" fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"/>
7
+ </svg>
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Host half of the greeting-bubble bundle.
3
+ *
4
+ * The whole feature lives in the browser half (`client.js`): the Host row only
5
+ * keeps the Loader entry alive so the client module system serves the bundle
6
+ * and the browser mounts it into `shell.overlay`. Nothing runs on the Host, so
7
+ * the plugin adds no model-facing tools, no requests, and no session state.
8
+ */
9
+ export function apply() {}
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Greeting bubble",
4
+ "description": "Shows a “你好,腾盛” speech bubble near the bottom-right corner of the window, just above the message composer, after the page loads. Click × to dismiss it; it appears again on the next page load. The greeting stays Chinese in every interface language; only the close-button label is localized. The bubble is click-through except for the close button, makes no network requests, collects no data, and changes nothing else in the app. Disable or remove the bundle under Plugins to remove it.",
5
+ "detail": "docs/DETAIL.md"
6
+ }
7
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "右下角问候气泡",
4
+ "description": "页面加载后,在窗口右下角、输入框上方弹出「你好,腾盛」问候气泡。点气泡上的 × 即可关闭,下次页面加载时会再次出现。问候语在任何界面语言下都保持中文,只有关闭按钮的提示文字跟随界面语言。气泡本体点击穿透,只有 × 可点;插件不联网、不收集数据,除气泡外不改变任何界面。在「插件」页停用或移除本插件即可彻底去掉。",
5
+ "detail": "docs/DETAIL.zh.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "dsh-plugin-greeting-bubble",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Shows a “你好,腾盛” speech bubble in the bottom-right corner of the DeepSeek Harness Web GUI.",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "keywords": [
11
+ "dsh",
12
+ "dsh-plugin",
13
+ "deepseek-harness",
14
+ "web-ui",
15
+ "greeting"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/liwei169/dsh-plugin-greeting-bubble.git"
20
+ },
21
+ "homepage": "https://github.com/liwei169/dsh-plugin-greeting-bubble#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/liwei169/dsh-plugin-greeting-bubble/issues"
24
+ },
25
+ "exports": {
26
+ ".": "./index.js",
27
+ "./client": "./client.js",
28
+ "./locale/*.json": "./locale/*.json",
29
+ "./icon": "./icon.svg",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "index.js",
34
+ "client.js",
35
+ "cordis.patch.yml",
36
+ "locale/*.json",
37
+ "docs",
38
+ "icon.svg"
39
+ ],
40
+ "dsh": {
41
+ "bundle": {
42
+ "patch": "./cordis.patch.yml"
43
+ },
44
+ "client": {
45
+ "platform": "web",
46
+ "immediately": true,
47
+ "inject": [
48
+ "@deepseek-ai/dsh-client-ui-layout"
49
+ ]
50
+ }
51
+ }
6
52
  }