dsh-kb-picker 0.2.0 → 0.2.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 +1 -1
- package/README.md +9 -22
- package/lib/client.js +5 -2
- package/package.json +12 -16
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
# dsh-kb-picker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 依赖:`dsh-knowledge`(未安装时按钮会提示,不会显示空列表)。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
DSH 输入框增强插件(本地开发)。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 功能
|
|
8
|
+
- 📚 知识库选择器:读取 dsh-knowledge 的知识库列表,选中后插入 `@知识库:<名称>` 作用域标记,并显示可取消的 chip。
|
|
9
|
+
- 📎 回形针:调用原生附件管线(createDrafts + addAttachments),把文件加入当前草稿附件。
|
|
10
|
+
- 草稿清空时保留已选知识库;手动删掉标记即视为取消。
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Or from GitHub:
|
|
14
|
-
|
|
15
|
-
```powershell
|
|
16
|
-
dsh plugin --profile desktop add file:C:/path/to/dsh-kb-picker
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Files
|
|
20
|
-
|
|
21
|
-
- `lib/index.js` — host side
|
|
22
|
-
- `lib/client.js` — web client side (if present)
|
|
23
|
-
- `cordis.patch.yml` — bundle patch
|
|
24
|
-
|
|
25
|
-
## License
|
|
26
|
-
|
|
27
|
-
MIT © 2026 wang678678
|
|
12
|
+
## 说明
|
|
13
|
+
- 独立插件,不修改市场插件;市场更新不会覆盖。
|
|
14
|
+
- 仅客户端 UI + 一个全局 systemPrompt 段,无外网请求。
|
package/lib/client.js
CHANGED
|
@@ -116,7 +116,7 @@ window.__ModuleLoader__.load({ id: 'dsh-kb-picker', factory: (require) => {
|
|
|
116
116
|
}
|
|
117
117
|
if (!basesRef.current.length) {
|
|
118
118
|
var empty = document.createElement('div');
|
|
119
|
-
empty.textContent = '
|
|
119
|
+
empty.textContent = err ? ('加载失败:' + err) : '未检测到知识库。请先安装 dsh-knowledge 并建库。';
|
|
120
120
|
empty.style.cssText = 'padding:8px;font-size:12px;opacity:.6';
|
|
121
121
|
el.appendChild(empty);
|
|
122
122
|
return;
|
|
@@ -167,7 +167,10 @@ window.__ModuleLoader__.load({ id: 'dsh-kb-picker', factory: (require) => {
|
|
|
167
167
|
|
|
168
168
|
function ensureBases() {
|
|
169
169
|
if (basesRef.current !== null) return;
|
|
170
|
-
fetch('/knowledge/bases').then(function (r) {
|
|
170
|
+
fetch('/knowledge/bases').then(function (r) {
|
|
171
|
+
if (!r.ok) throw new Error(r.status === 404 ? '未检测到 dsh-knowledge(/knowledge/bases 404)' : ('HTTP ' + r.status));
|
|
172
|
+
return r.json();
|
|
173
|
+
}).then(function (j) {
|
|
171
174
|
var list = (j && j.value) || [];
|
|
172
175
|
basesRef.current = list.map(function (b) {
|
|
173
176
|
return { id: b.id, name: b.name, count: (b.documentCount != null ? b.documentCount : b.storedDocCount) || 0 };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-kb-picker",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "DSH 输入框增强:知识库选择器(dsh-knowledge
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "DSH 输入框增强:知识库选择器(dsh-knowledge,选库后插入 @知识库:<名称> 作用域并显示 chip)与回形针(走原生附件管线)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -22,19 +22,18 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"react": "
|
|
25
|
+
"react": "^18.2.0"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"dsh",
|
|
30
|
+
"dsh-plugin",
|
|
31
|
+
"deepseek-harness",
|
|
32
|
+
"knowledge-base",
|
|
33
|
+
"attachment",
|
|
34
|
+
"composer"
|
|
35
|
+
],
|
|
36
|
+
"author": "local",
|
|
38
37
|
"files": [
|
|
39
38
|
"lib",
|
|
40
39
|
"cordis.patch.yml",
|
|
@@ -43,8 +42,5 @@
|
|
|
43
42
|
],
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
46
|
-
},
|
|
47
|
-
"engines": {
|
|
48
|
-
"dsh": ">=0.2.1-rc.1 <0.3.0"
|
|
49
45
|
}
|
|
50
46
|
}
|