dsh-quick-phrases 0.3.3 → 0.3.5
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/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/pengtang1024/dsh-quick-phrases/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/pengtang1024/dsh-quick-phrases/releases)
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-quick-phrases)
|
|
5
6
|
[](LICENSE)
|
|
6
7
|
|
|
7
8
|
给 DeepSeek Harness(DSH)的输入框加一排快捷短语按钮:`继续`、`提交`、`推送`、`发版` 这类天天要打的字,点一下就送进输入框或直接发出。按钮上显示的**名称**和真正发出的**内容**分开编辑,所以按钮可以很短,话可以很长。
|
|
@@ -10,6 +11,8 @@
|
|
|
10
11
|
|
|
11
12
|

|
|
12
13
|
|
|
14
|
+
> 文档里的截图都是**界面示意图**:由 `test/preview.mjs` 把真实组件套上宿主主题 token 渲染出来,不是真机截屏。实际观感以运行中的界面为准。
|
|
15
|
+
|
|
13
16
|
## 功能
|
|
14
17
|
|
|
15
18
|
- **一排短语按钮**:显示名称与发送内容分离,默认四条:继续 / 提交 / 推送 / 发版。
|
|
@@ -20,17 +23,31 @@
|
|
|
20
23
|
|
|
21
24
|
## 安装
|
|
22
25
|
|
|
23
|
-
前置:DSH 桌面端或 Web 端(0.2.2
|
|
26
|
+
前置:DSH 桌面端或 Web 端(0.2.2 及以上)。插件没有运行时依赖,也没有构建步骤。
|
|
27
|
+
|
|
28
|
+
**方式 A(npm,推荐)**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
dsh plugin --profile <你的 profile> add dsh-quick-phrases
|
|
32
|
+
```
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
装完重启 DSH(或在会话页按 `Ctrl+R`)。包已发布到 npm:[dsh-quick-phrases](https://www.npmjs.com/package/dsh-quick-phrases),升级时把 `add` 换成 `update dsh-quick-phrases` 即可。
|
|
26
35
|
|
|
27
|
-
**方式 B
|
|
36
|
+
**方式 B(插件市场)**
|
|
37
|
+
|
|
38
|
+
在 DSH 里打开 **Plugins → Discover → Index sources**,添加本仓库的索引地址:
|
|
28
39
|
|
|
29
40
|
```
|
|
30
|
-
|
|
41
|
+
https://cdn.jsdelivr.net/gh/pengtang1024/dsh-quick-phrases@main/index.json
|
|
31
42
|
```
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
之后在 Discover 里搜索「快捷短语」即可看到本插件与版本,点安装走的就是 `plugin_manager`。
|
|
45
|
+
|
|
46
|
+
**方式 C(本地目录)**
|
|
47
|
+
|
|
48
|
+
Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执行 `plugin_manager install_bundle target=/path/to/dsh-quick-phrases`。本地目录安装是 `link:` 方式,改完 `client.js` 只需重载页面、不必重装。
|
|
49
|
+
|
|
50
|
+
> 三种方式装的是同一个 bundle,不要同时装两份:用 npm 或市场装过之后,先把本地 `link:` 那份卸掉再换。
|
|
34
51
|
|
|
35
52
|
## 使用
|
|
36
53
|
|
|
@@ -38,17 +55,17 @@ plugin_manager install_bundle target=/path/to/dsh-quick-phrases
|
|
|
38
55
|
|
|
39
56
|
| 位置 | 插槽 | 说明 |
|
|
40
57
|
| --- | --- | --- |
|
|
41
|
-
| 输入框下方(默认) | `conversation.composer.dock` |
|
|
58
|
+
| 输入框下方(默认) | `conversation.composer.dock` | 常驻在输入卡片下方的一整行,最宽松;同样与卡片内边对齐。 |
|
|
42
59
|
| 输入框上方 | `conversation.input.dock` | 卡片上方一整行;宽度与居中按宿主 dock 几何计算,和卡片文字内边对齐。 |
|
|
43
60
|
| 工具行右侧 | `conversation.input.right` | 挤进输入框底部工具行;空间有限,超出部分横向滚动。 |
|
|
44
61
|
|
|
45
|
-

|
|
46
63
|
|
|
47
64
|
### 管理页
|
|
48
65
|
|
|
49
66
|
设置 → **快捷短语**:上面两个下拉框决定位置与点按行为,下面一条短语一张卡片。
|
|
50
67
|
|
|
51
|
-

|
|
52
69
|
|
|
53
70
|
- 拖动左侧 `⠿` 手柄排序,或用 `↑` / `↓` 一格一格挪;列表顺序就是按钮的从左到右顺序。
|
|
54
71
|
- 卡片顶部那行是**显示名称**,直接点进去改;下面大框是**发送内容**。
|
package/client.js
CHANGED
|
@@ -37,7 +37,7 @@ window.__ModuleLoader__.load({
|
|
|
37
37
|
* row moves between slots without an extra round of registration.
|
|
38
38
|
*/
|
|
39
39
|
var PLACEMENTS = [
|
|
40
|
-
{ slot: 'conversation.composer.dock', value: 'composer-dock', tag: 'dock', order: DOCK_ORDER, compact: false, key: 'manager.placementDock' },
|
|
40
|
+
{ slot: 'conversation.composer.dock', value: 'composer-dock', tag: 'dock', order: DOCK_ORDER, compact: false, inset: true, key: 'manager.placementDock' },
|
|
41
41
|
// `dock` rows live in the composer stack, whose children stretch to the
|
|
42
42
|
// whole column; the card itself is narrower. `inset: true` copies the
|
|
43
43
|
// host's own dock geometry (QueueDock/TodoPanel) so the row lines up with
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -13,8 +13,9 @@ DSH 的插件是「bundle」:一个 npm 包 + 一行 Cordis patch。本仓库
|
|
|
13
13
|
| `client.js` | 客户端插件:`window.__ModuleLoader__.load({ id, factory })` |
|
|
14
14
|
| `locale/{zh,en}.json` | 插件管理器详情页的标题 / 描述 / 详情文档路径 |
|
|
15
15
|
| `icon.svg` | 插件列表图标 |
|
|
16
|
+
| `index.json` | 插件市场索引(format 1),让 Discover 能搜到并安装本插件 |
|
|
16
17
|
|
|
17
|
-
`package.json` 里声明 `dsh.client.platform = "web"`、`immediately: true`、`inject: ["@deepseek-ai/dsh-client-ui-conversation"]`;`dsh.bundle.patch` 指向 patch
|
|
18
|
+
`package.json` 里声明 `dsh.client.platform = "web"`、`immediately: true`、`inject: ["@deepseek-ai/dsh-client-ui-conversation"]`;`dsh.bundle.patch` 指向 patch 文件。`engines.dsh` 声明兼容的 DSH 版本,市场索引与 `plugin_manager` 用它判断可装性。没有构建步骤,改完 `client.js` 让渲染进程重载即可。
|
|
18
19
|
|
|
19
20
|
## 客户端入口
|
|
20
21
|
|
|
@@ -90,7 +91,7 @@ margin: 0 auto;
|
|
|
90
91
|
|
|
91
92
|
`test/smoke.mjs` 把真实的 `client.js` 放进 `vm` 沙箱,用最小假 React(按组件名分配 hook 单元)和假 ModuleLoader 跑起来,直接调组件自己的 `onClick` / `onChange`,断言落在 `localStorage` 和渲染树上的结果。改行为时先改这里——它是唯一能在没有宿主的情况下验证「显示与发送分离」「位置切换」「拖动排序」是否还成立的护栏。
|
|
92
93
|
|
|
93
|
-
`test/preview.mjs` 把组件渲染成静态 HTML,拼上宿主主题 CSS,可用无头 Chromium
|
|
94
|
+
`test/preview.mjs` 把组件渲染成静态 HTML,拼上宿主主题 CSS,可用无头 Chromium 截图,用来肉眼核对深浅两套主题。`docs/images/` 下的图就是它产出的**界面示意图**(图内带「界面示意图」标题),不是真机截屏。
|
|
94
95
|
|
|
95
96
|
## 兼容性注意
|
|
96
97
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/images/row-dark.png
CHANGED
|
Binary file
|