@wlv-zedd/dsh-btw-plugin 1.0.5 → 1.0.6
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 +4 -2
- package/README.zh-CN.md +110 -0
- package/lib/client.js +43 -25
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-btw-plugin
|
|
2
2
|
|
|
3
|
-
[English](https://github.com/WLV-ZEDD/dsh-btw#readme) | [中文](
|
|
3
|
+
[English](https://github.com/WLV-ZEDD/dsh-btw#readme) | [中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@wlv-zedd/dsh-btw-plugin)
|
|
6
6
|
[](https://dshmarket.com/p/WLV-ZEDD/dsh-btw/)
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
<img src="https://raw.githubusercontent.com/WLV-ZEDD/dsh-btw/main/assets/promo-dshmarket-official.png?v=1.0.3" alt="dsh-btw on DSH Market" width="100%">
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/WLV-ZEDD/dsh-btw/main/assets/demo.gif?v=1.0.3" alt="dsh-btw Interactive Demo" width="100%">
|
|
18
|
+
</p>
|
|
17
19
|
|
|
18
20
|
---
|
|
19
21
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# dsh-btw-plugin
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | [中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@wlv-zedd/dsh-btw-plugin)
|
|
6
|
+
[](https://dshmarket.com/p/WLV-ZEDD/dsh-btw/)
|
|
7
|
+
[](https://github.com/WLV-ZEDD/dsh-btw/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
> **DeepSeek Harness 侧边助手面板**
|
|
10
|
+
> 随时提问,不打断也不污染当前主 Agent 运行。
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://raw.githubusercontent.com/WLV-ZEDD/dsh-btw/main/assets/promo-dshmarket-official.png?v=1.0.3" alt="dsh-btw on DSH Market" width="100%">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/WLV-ZEDD/dsh-btw/main/assets/demo.gif?v=1.0.3" alt="dsh-btw 交互演示" width="100%">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 功能特性
|
|
23
|
+
|
|
24
|
+
- **即时非阻塞 /btw 命令:**
|
|
25
|
+
在对话框中输入 `/btw <问题>`,输入框立即清空(0ms),并在后台执行,不影响主 Agent 的运行。
|
|
26
|
+
|
|
27
|
+
- **悬浮于输入框上方的浮动面板:**
|
|
28
|
+
紧贴消息输入框上方显示,带有实时量子均衡器动画、Markdown 渲染、分页(`< 1/5 >`)以及展开/折叠切换。
|
|
29
|
+
|
|
30
|
+
- **量子均衡器可视化:**
|
|
31
|
+
五根动态药丸条在生成回答时以主题蓝色脉冲。自动重试期间,所有条形和状态徽章切换为琥珀色,让你随时掌握当前状态。
|
|
32
|
+
|
|
33
|
+
- **智能自动重试(5 步):**
|
|
34
|
+
遇到瞬态模型错误时,插件以快速连发方式最多重试 5 次(1 秒 → 1.5 秒 → 2 秒 → 2.5 秒 → 3 秒,约 10 秒总计)。状态徽章以琥珀色显示 `Retrying (X/5)...`,让你一目了然。
|
|
35
|
+
|
|
36
|
+
- **当前会话与循环上下文感知:**
|
|
37
|
+
动态继承当前会话的模型,并提取最近轮次历史(`session.deriveMessages()`、当前工作区),让 `/btw` 清楚了解你与主 Agent 正在进行的工作,无需中断当前执行。
|
|
38
|
+
|
|
39
|
+
- **精准优先系统提示词:**
|
|
40
|
+
6 条明确的积极指示,指导模型忠实保留专有名词与会话历史,直接作答,避免因过度防御性限制导致幻觉。
|
|
41
|
+
|
|
42
|
+
- **丰富的 Markdown 渲染:**
|
|
43
|
+
支持粗体、斜体、行内代码、有序列表(在 UI 中呈现为主题蓝色的真实数字序号 `1.` `2.`)与无序列表,无需用表格占用紧凑空间。
|
|
44
|
+
|
|
45
|
+
- **隔离的 JSON 持久化:**
|
|
46
|
+
在 `~/.dsh/storages/btw-history.json` 中独立保存会话问答历史,不污染也不修改其他插件的数据。
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 安装方法
|
|
51
|
+
|
|
52
|
+
### 方式 1:通过 DSH 插件市场安装(推荐)
|
|
53
|
+
在 DSH Web UI 中点击 **Settings → Plugin Market**,搜索 `dsh-btw` 并安装,或者运行:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm dsh plugin add @wlv-zedd/dsh-btw-plugin
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 方式 2:通过 npm 手动安装并配置 Cordis
|
|
60
|
+
将插件安装到你的 DeepSeek Harness 环境中:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm add @wlv-zedd/dsh-btw-plugin
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
在 `cordis.yml`(或 `cordis.patch.yml`)中启用插件:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
# cordis.yml
|
|
70
|
+
plugins:
|
|
71
|
+
@wlv-zedd/dsh-btw-plugin:
|
|
72
|
+
# 可选:指定独立模型;留空则自动继承当前会话模型
|
|
73
|
+
# model: deepseek:deepseek-chat
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 使用指南
|
|
79
|
+
|
|
80
|
+
### 在 Web 聊天界面中
|
|
81
|
+
在输入框输入 `/btw` 紧跟你的问题:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
/btw PostgreSQL 的默认端口是多少?
|
|
85
|
+
/btw 简要解释 TCP 和 UDP 的区别
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- **浮动面板:** 输入框上方立即出现问题卡片,伴随量子均衡器脉冲。生成完毕后展示富文本 Markdown 回答。
|
|
89
|
+
- **分页导航(`< 1/5 >`):** 点击 `<` 与 `>` 翻阅当前会话历史中的侧边问答。
|
|
90
|
+
- **操作按钮:**
|
|
91
|
+
- **复制:** 一键将回答复制到剪贴板。
|
|
92
|
+
- **删除:** 从会话历史中移除该条记录。
|
|
93
|
+
- **折叠 / 展开:** 收起回答内容,保持工作区清爽。
|
|
94
|
+
- **关闭 [X]:** 关闭浮动卡片面板。
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 支持与社区福利
|
|
99
|
+
|
|
100
|
+
[](https://paypal.me/wlvzedd) 如果你觉得本插件对你有帮助,欢迎赞助支持。
|
|
101
|
+
|
|
102
|
+
[](https://agentrouter.org/register?aff=bIJf) 使用 GitHub 注册 AgentRouter 即可领取最高 **$200 免费额度**,用于 LLM 工作流。
|
|
103
|
+
|
|
104
|
+
[](https://vyceai.com/signup?ref=VYCE_BL6YAG) 注册 Vyce AI 即可领取 **$50 免费额度**,用于高速 LLM 工作流。
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 开源协议
|
|
109
|
+
|
|
110
|
+
MIT © [WLV-ZEDD](https://github.com/WLV-ZEDD)
|
package/lib/client.js
CHANGED
|
@@ -19,9 +19,9 @@ window.__ModuleLoader__.load({
|
|
|
19
19
|
|
|
20
20
|
const IconChevronLeft = () => (
|
|
21
21
|
React.createElement("svg", { width: 14, height: 14, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" },
|
|
22
|
-
React.createElement("path", { d: "M10 12L6 8L10 4" }
|
|
22
|
+
React.createElement("path", { d: "M10 12L6 8L10 4" }
|
|
23
23
|
)
|
|
24
|
-
);
|
|
24
|
+
));
|
|
25
25
|
|
|
26
26
|
const IconChevronRight = () => (
|
|
27
27
|
React.createElement("svg", { width: 14, height: 14, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" },
|
|
@@ -386,6 +386,10 @@ window.__ModuleLoader__.load({
|
|
|
386
386
|
const [models, setModels] = useState([{ id: "auto", name: "Inherit Session Model" }]);
|
|
387
387
|
const [selectedModel, setSelectedModel] = useState("auto");
|
|
388
388
|
const prevCountRef = useRef(0);
|
|
389
|
+
const itemsRef = useRef(items);
|
|
390
|
+
useEffect(() => {
|
|
391
|
+
itemsRef.current = items;
|
|
392
|
+
}, [items]);
|
|
389
393
|
|
|
390
394
|
useEffect(() => {
|
|
391
395
|
fetch('/api/dsh-btw/models')
|
|
@@ -410,30 +414,41 @@ window.__ModuleLoader__.load({
|
|
|
410
414
|
}).catch(() => {});
|
|
411
415
|
};
|
|
412
416
|
|
|
413
|
-
|
|
417
|
+
useEffect(() => {
|
|
414
418
|
if (!sessionId) return;
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
419
|
+
let timer = null;
|
|
420
|
+
let active = true;
|
|
421
|
+
|
|
422
|
+
const poll = () => {
|
|
423
|
+
if (!active) return;
|
|
424
|
+
fetch(`/api/dsh-btw/feed?sessionId=${encodeURIComponent(sessionId)}`)
|
|
425
|
+
.then(res => res.json())
|
|
426
|
+
.then(data => {
|
|
427
|
+
if (!active) return;
|
|
428
|
+
if (data.ok && Array.isArray(data.items)) {
|
|
429
|
+
setItems(data.items);
|
|
430
|
+
if (data.items.length > prevCountRef.current) {
|
|
431
|
+
setDismissedId(null);
|
|
432
|
+
setCurrentIndex(0);
|
|
433
|
+
setCollapsed(false);
|
|
434
|
+
}
|
|
435
|
+
prevCountRef.current = data.items.length;
|
|
424
436
|
}
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return () =>
|
|
436
|
-
|
|
437
|
+
})
|
|
438
|
+
.catch(() => {})
|
|
439
|
+
.finally(() => {
|
|
440
|
+
if (!active) return;
|
|
441
|
+
const hasLoading = itemsRef.current.some(i => i.loading) ? 500 : 2500;
|
|
442
|
+
timer = setTimeout(poll, hasLoading);
|
|
443
|
+
});
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
poll();
|
|
447
|
+
return () => {
|
|
448
|
+
active = false;
|
|
449
|
+
if (timer) clearTimeout(timer);
|
|
450
|
+
};
|
|
451
|
+
}, [sessionId]);
|
|
437
452
|
|
|
438
453
|
if (!sessionId || items.length === 0) return null;
|
|
439
454
|
const currentItem = items[currentIndex];
|
|
@@ -593,7 +608,10 @@ window.__ModuleLoader__.load({
|
|
|
593
608
|
paddingTop: 8,
|
|
594
609
|
paddingBottom: 4,
|
|
595
610
|
borderTop: "0.5px solid rgba(255, 255, 255, 0.08)",
|
|
596
|
-
|
|
611
|
+
maxHeight: "min(380px, 45vh)",
|
|
612
|
+
overflowY: "auto",
|
|
613
|
+
overflowX: "hidden",
|
|
614
|
+
overscrollBehavior: "contain"
|
|
597
615
|
}
|
|
598
616
|
}, currentItem.loading
|
|
599
617
|
? React.createElement(QuantumEqualizer, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wlv-zedd/dsh-btw-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "DeepSeek Harness Side-Assistant Dock (/btw command)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"check": "node --check lib/index.js && node --check lib/client.js"
|
|
36
|
+
"check": "node --check lib/index.js && node --check lib/client.js",
|
|
37
|
+
"test": "node --test tests/*.test.mjs"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"@deepseek-ai/cordis": "*",
|
|
@@ -62,4 +63,4 @@
|
|
|
62
63
|
"bugs": {
|
|
63
64
|
"url": "https://github.com/WLV-ZEDD/dsh-btw/issues"
|
|
64
65
|
}
|
|
65
|
-
}
|
|
66
|
+
}
|