@zaofan/dsh-qqbot 1.10.48 → 1.11.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/README.md +40 -3
- package/client/qqbot-settings.js +487 -30
- package/dist/features/ext-capabilities.d.ts +2 -0
- package/dist/features/ext-capabilities.d.ts.map +1 -1
- package/dist/features/ext-capabilities.js +38 -0
- package/dist/features/ext-capabilities.js.map +1 -1
- package/dist/features/ext-reload.d.ts +2 -2
- package/dist/features/ext-reload.d.ts.map +1 -1
- package/dist/features/ext-reload.js +30 -8
- package/dist/features/ext-reload.js.map +1 -1
- package/dist/features/ext-ui-seed.d.ts +25 -0
- package/dist/features/ext-ui-seed.d.ts.map +1 -0
- package/dist/features/ext-ui-seed.js +187 -0
- package/dist/features/ext-ui-seed.js.map +1 -0
- package/dist/features/ext-ui.d.ts +3 -5
- package/dist/features/ext-ui.d.ts.map +1 -1
- package/dist/features/ext-ui.js +34 -12
- package/dist/features/ext-ui.js.map +1 -1
- package/dist/features/extension-store.d.ts.map +1 -1
- package/dist/features/extension-store.js +3 -0
- package/dist/features/extension-store.js.map +1 -1
- package/dist/gateway/bootstrap.d.ts.map +1 -1
- package/dist/gateway/bootstrap.js +18 -1
- package/dist/gateway/bootstrap.js.map +1 -1
- package/dist/gateway/middleware-setup.d.ts.map +1 -1
- package/dist/gateway/middleware-setup.js +11 -1
- package/dist/gateway/middleware-setup.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +131 -1
- package/dist/index.js.map +1 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +2 -1
- package/dist/session/session-manager.js.map +1 -1
- package/docs/extension-contract.md +400 -255
- package/examples/ext-commands//346/211/251/345/261/225/347/244/272/344/276/213.mjs +84 -0
- package/examples/ext-hooks/demo-store.mjs +75 -0
- package/examples/ext-ui/demo/dock/card.css +55 -0
- package/examples/ext-ui/demo/dock/card.html +95 -0
- package/examples/ext-ui/demo/dock/card.js +261 -0
- package/examples/ext-ui/demo/settings/card.css +61 -0
- package/examples/ext-ui/demo/settings/card.html +38 -0
- package/examples/ext-ui/demo/settings/card.js +87 -0
- package/package.json +145 -144
- package/settings-host.js +6680 -6244
- package/examples/ext-ui/local-llm/card.css +0 -66
- package/examples/ext-ui/local-llm/card.html +0 -38
- package/examples/ext-ui/local-llm/card.js +0 -59
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- qqbot-ui: { "id": "demo", "slot": "settings", "title": "扩展示例 · 全局", "order": 5 } -->
|
|
2
|
+
<!--
|
|
3
|
+
扩展示例 · 设置页卡片(slot=settings → 放 profile 级目录)
|
|
4
|
+
{PROFILE_ROOT}/.qqbot-extensions/ui/demo-settings/card.html
|
|
5
|
+
|
|
6
|
+
★ 2026-10-27:虽然是「全局 UI」,但能操作**当前选中账号**那份数据 ——
|
|
7
|
+
上面账号下拉框切到谁,getConfig('data') 就是谁。
|
|
8
|
+
这是主人明确要的能力:一个界面里既能改全局,又能改单实例。
|
|
9
|
+
-->
|
|
10
|
+
<div class="card">
|
|
11
|
+
<div class="hd"><span class="dot" id="dot"></span><span>⚙ 扩展示例</span></div>
|
|
12
|
+
|
|
13
|
+
<div class="tip">
|
|
14
|
+
这里填的文字会出现在 <b>/扩展示例</b> 的输出里 —— 去群里敲一下就能看到:
|
|
15
|
+
<div class="code">/扩展示例 → (文本1)(文本2)</div>
|
|
16
|
+
<b>文本2</b> 在悬浮球的「🔌 扩展示例」里改(每个机器人各一份)。
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="row seg">
|
|
20
|
+
<label><input type="radio" name="dscope" value="profile" checked /> 改全局(所有机器人共用)</label>
|
|
21
|
+
<label><input type="radio" name="dscope" value="data" /> 改当前账号:<b id="acctName">—</b></label>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="row">
|
|
25
|
+
<span class="lbl" id="fieldLbl">文本1(全局)</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="row">
|
|
28
|
+
<input class="txt" id="t1" placeholder="填一段文字,例如 我是全局文本" />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="row">
|
|
31
|
+
<span class="hint" id="scopeHint">改动影响所有机器人;改完去群里敲 /扩展示例 看效果。</span>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="acts">
|
|
34
|
+
<button class="btn" id="save">保存</button>
|
|
35
|
+
<button class="btn ghost" id="load">重新读取</button>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="row"><span class="val" id="st"></span></div>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* 扩展示例 · 设置页卡片逻辑
|
|
2
|
+
*
|
|
3
|
+
* ★ 核心演示(2026-10-27 主人要求):**一张全局 UI,两种作用域**
|
|
4
|
+
* · profile 级 → 所有机器人共用(getConfig() / setConfig(p))
|
|
5
|
+
* · data 级 → 只改上面账号下拉框选中的那个(getConfig('data') / setConfig(p,'data'))
|
|
6
|
+
* 卡片自己不用知道路径,qqbotExt.acct 里就有当前选中的账号。
|
|
7
|
+
*/
|
|
8
|
+
(function () {
|
|
9
|
+
var $ = function (id) { return shadowRoot.getElementById(id) };
|
|
10
|
+
var t1 = $('t1');
|
|
11
|
+
var st = $('st');
|
|
12
|
+
var dot = $('dot');
|
|
13
|
+
var acctName = $('acctName');
|
|
14
|
+
var fieldLbl = $('fieldLbl');
|
|
15
|
+
var scopeHint = $('scopeHint');
|
|
16
|
+
|
|
17
|
+
var acct = qqbotExt.acct || null;
|
|
18
|
+
var scope = 'profile'; // profile | data
|
|
19
|
+
|
|
20
|
+
function show(ok, msg) {
|
|
21
|
+
if (st) { st.textContent = msg; st.style.color = ok ? '#2f9e44' : '#c33' }
|
|
22
|
+
if (dot) dot.className = 'dot ' + (ok ? 'on' : 'err')
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 显示当前选中的账号名(没账号时提示去「账号与预设」加)
|
|
26
|
+
if (acctName) acctName.textContent = acct && acct.ns ? acct.ns : '(还没选账号)'
|
|
27
|
+
var hasAcct = !!(acct && acct.ns)
|
|
28
|
+
|
|
29
|
+
function syncLabels() {
|
|
30
|
+
var isData = scope === 'data'
|
|
31
|
+
if (fieldLbl) fieldLbl.textContent = isData ? ('文本1(账号:' + (acct.ns || '?') + ')') : '文本1(全局)'
|
|
32
|
+
if (scopeHint) {
|
|
33
|
+
scopeHint.textContent = isData
|
|
34
|
+
? '只影响「' + (acct.ns || '?') + '」这个机器人;改完去群里敲 /扩展示例 看效果。'
|
|
35
|
+
: '改动影响所有机器人;改完去群里敲 /扩展示例 看效果。'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function load() {
|
|
40
|
+
show(true, '读取中…')
|
|
41
|
+
// 第二参数不传 = 用卡片上下文里的当前账号
|
|
42
|
+
qqbotExt.getConfig(scope).then(function (c) {
|
|
43
|
+
if (t1) t1.value = c.text1 || ''
|
|
44
|
+
var where = scope === 'data' ? ('账号 ' + (acct.ns || '?')) : '全局'
|
|
45
|
+
show(true, (c.text1 ? ('当前(' + where + '):' + c.text1) : ('当前(' + where + '):还没设置')))
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ── 作用域切换 ──────────────────────────────────────────
|
|
50
|
+
shadowRoot.querySelectorAll('input[name="dscope"]').forEach(function (r) {
|
|
51
|
+
r.addEventListener('change', function () {
|
|
52
|
+
if (!r.checked) return
|
|
53
|
+
if (r.value === 'data' && !hasAcct) {
|
|
54
|
+
show(false, '上面还没选账号 —— 先去「账号与预设」加一个')
|
|
55
|
+
var p = shadowRoot.querySelector('input[name="dscope"][value="profile"]')
|
|
56
|
+
if (p) p.checked = true
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
scope = r.value
|
|
60
|
+
syncLabels()
|
|
61
|
+
load()
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// ── 保存 / 重读 ─────────────────────────────────────────
|
|
66
|
+
var save = $('save');
|
|
67
|
+
if (save) {
|
|
68
|
+
save.addEventListener('click', function () {
|
|
69
|
+
if (scope === 'data' && !hasAcct) return show(false, '没有可写的账号')
|
|
70
|
+
save.disabled = true
|
|
71
|
+
qqbotExt.setConfig({ text1: t1 ? t1.value : '' }, scope).then(function (r) {
|
|
72
|
+
save.disabled = false
|
|
73
|
+
if (r && r.ok) {
|
|
74
|
+
var where = scope === 'data' ? ('账号 ' + (acct.ns || '?')) : '全局'
|
|
75
|
+
show(true, '已保存到' + where + ':' + ((r.config && r.config.text1) || ''))
|
|
76
|
+
} else {
|
|
77
|
+
show(false, '保存失败:' + ((r && r.reason) || '未知'))
|
|
78
|
+
}
|
|
79
|
+
}).catch(function () { save.disabled = false; show(false, '保存异常') })
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
var re = $('load');
|
|
83
|
+
if (re) re.addEventListener('click', load)
|
|
84
|
+
|
|
85
|
+
syncLabels()
|
|
86
|
+
load()
|
|
87
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,144 +1,145 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zaofan/dsh-qqbot",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "QQ Bot IM channel plugin for deepseek-harness (dsh)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./entry.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./entry.js"
|
|
12
|
-
},
|
|
13
|
-
"./channel-tools": {
|
|
14
|
-
"types": "./dist/channel-tools.d.ts",
|
|
15
|
-
"import": "./dist/channel-tools.js"
|
|
16
|
-
},
|
|
17
|
-
"./sticker-store": {
|
|
18
|
-
"types": "./dist/features/sticker-store.d.ts",
|
|
19
|
-
"import": "./dist/features/sticker-store.js"
|
|
20
|
-
},
|
|
21
|
-
"./schedule-store": {
|
|
22
|
-
"types": "./dist/features/schedule-store.d.ts",
|
|
23
|
-
"import": "./dist/features/schedule-store.js"
|
|
24
|
-
},
|
|
25
|
-
"./client": "./client/qqbot-settings.js"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"dsh
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"docs/
|
|
62
|
-
"docs/
|
|
63
|
-
"docs/
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"scripts/
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
"@deepseek-ai/dsh-client-ui-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"@deepseek-ai/dsh-client-ui-
|
|
96
|
-
"@deepseek-ai/
|
|
97
|
-
"@
|
|
98
|
-
"@tencent-connect/qqbot-
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"@deepseek-ai/
|
|
109
|
-
"@deepseek-ai/dsh-
|
|
110
|
-
"@deepseek-ai/dsh-
|
|
111
|
-
"@deepseek-ai/dsh-
|
|
112
|
-
"@deepseek-ai/dsh-
|
|
113
|
-
"@
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"@deepseek-ai/
|
|
135
|
-
"@deepseek-ai/dsh-
|
|
136
|
-
"@deepseek-ai/dsh-
|
|
137
|
-
"@deepseek-ai/dsh-
|
|
138
|
-
"@deepseek-ai/
|
|
139
|
-
"@
|
|
140
|
-
"@types/
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zaofan/dsh-qqbot",
|
|
3
|
+
"version": "1.11.0",
|
|
4
|
+
"description": "QQ Bot IM channel plugin for deepseek-harness (dsh)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./entry.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./entry.js"
|
|
12
|
+
},
|
|
13
|
+
"./channel-tools": {
|
|
14
|
+
"types": "./dist/channel-tools.d.ts",
|
|
15
|
+
"import": "./dist/channel-tools.js"
|
|
16
|
+
},
|
|
17
|
+
"./sticker-store": {
|
|
18
|
+
"types": "./dist/features/sticker-store.d.ts",
|
|
19
|
+
"import": "./dist/features/sticker-store.js"
|
|
20
|
+
},
|
|
21
|
+
"./schedule-store": {
|
|
22
|
+
"types": "./dist/features/schedule-store.d.ts",
|
|
23
|
+
"import": "./dist/features/schedule-store.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": "./client/qqbot-settings.js",
|
|
26
|
+
"./session-registry": "./dist/features/session-registry.js"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"dev": "tsc --watch",
|
|
31
|
+
"prepublishOnly": "npm run build && node scripts/check-package.mjs",
|
|
32
|
+
"check:package": "node scripts/check-package.mjs",
|
|
33
|
+
"lint": "eslint src/",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"ci:prepare-test-pkg": "node scripts/prepare-test-pkg.js"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/zaofan-make/dsh-qqbot.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/zaofan-make/dsh-qqbot#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/zaofan-make/dsh-qqbot/issues"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"deepseek-harness",
|
|
48
|
+
"dsh",
|
|
49
|
+
"dsh-plugin",
|
|
50
|
+
"qqbot",
|
|
51
|
+
"qq-bot",
|
|
52
|
+
"chatbot",
|
|
53
|
+
"ai-agent",
|
|
54
|
+
"cordis",
|
|
55
|
+
"plugin",
|
|
56
|
+
"llm"
|
|
57
|
+
],
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"docs/extension-contract.md",
|
|
62
|
+
"docs/USER-GUIDE.md",
|
|
63
|
+
"docs/botplay-contract.md",
|
|
64
|
+
"docs/host-services.md",
|
|
65
|
+
"examples",
|
|
66
|
+
"client",
|
|
67
|
+
"cordis.patch.yml",
|
|
68
|
+
"settings-host.js",
|
|
69
|
+
"README.md",
|
|
70
|
+
"README_EN.md",
|
|
71
|
+
"LICENSE",
|
|
72
|
+
"voice-convert.mjs",
|
|
73
|
+
"scripts/download-model.mjs",
|
|
74
|
+
"scripts/fix-dsh-016-presets.ps1",
|
|
75
|
+
"entry.js"
|
|
76
|
+
],
|
|
77
|
+
"dsh": {
|
|
78
|
+
"bundle": {
|
|
79
|
+
"patch": "./cordis.patch.yml"
|
|
80
|
+
},
|
|
81
|
+
"client": {
|
|
82
|
+
"platform": "web",
|
|
83
|
+
"inject": [
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-slots"
|
|
86
|
+
],
|
|
87
|
+
"immediately": true
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"dsh": ">=0.1.5-rc.2"
|
|
91
|
+
},
|
|
92
|
+
"manifestVersion": 1
|
|
93
|
+
},
|
|
94
|
+
"dependencies": {
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.1",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.1",
|
|
97
|
+
"@deepseek-ai/schemastery": "3.18.4",
|
|
98
|
+
"@tencent-connect/qqbot-connector": "1.2.0",
|
|
99
|
+
"@tencent-connect/qqbot-nodejs": "^1.0.4",
|
|
100
|
+
"js-yaml": "^4.1.0",
|
|
101
|
+
"lamejs-fixed": "^1.2.2",
|
|
102
|
+
"silk-wasm": "^3.7.1"
|
|
103
|
+
},
|
|
104
|
+
"optionalDependencies": {
|
|
105
|
+
"@huggingface/transformers": "^4.3.0"
|
|
106
|
+
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"@deepseek-ai/cordis": ">=4.0.1",
|
|
109
|
+
"@deepseek-ai/dsh-agent": ">=0.1.0-rc.6",
|
|
110
|
+
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.6",
|
|
111
|
+
"@deepseek-ai/dsh-session": ">=0.1.0-rc.6",
|
|
112
|
+
"@deepseek-ai/dsh-settings": "*",
|
|
113
|
+
"@deepseek-ai/dsh-tools": ">=0.1.1-rc.2",
|
|
114
|
+
"@tencent-connect/qqbot-connector": "1.2.0"
|
|
115
|
+
},
|
|
116
|
+
"peerDependenciesMeta": {
|
|
117
|
+
"@deepseek-ai/cordis": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@deepseek-ai/schemastery": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"@deepseek-ai/dsh-agent": {
|
|
124
|
+
"optional": true
|
|
125
|
+
},
|
|
126
|
+
"@deepseek-ai/dsh-session": {
|
|
127
|
+
"optional": true
|
|
128
|
+
},
|
|
129
|
+
"@deepseek-ai/dsh-llm": {
|
|
130
|
+
"optional": true
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"devDependencies": {
|
|
134
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
135
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.6",
|
|
136
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.6",
|
|
137
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.6",
|
|
138
|
+
"@deepseek-ai/dsh-tools": ">=0.1.1-rc.2",
|
|
139
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
140
|
+
"@types/js-yaml": "^4.0.9",
|
|
141
|
+
"@types/node": "^26.2.0",
|
|
142
|
+
"typescript": "^5.5.0",
|
|
143
|
+
"vitest": "^4.1.8"
|
|
144
|
+
}
|
|
145
|
+
}
|