agentdev 0.1.8 → 0.1.9
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/dist/BasicAgent-UWXLSZP2.js +13 -0
- package/dist/ExplorerAgent-LCM3JQS4.js +13 -0
- package/dist/{chunk-LQTEETML.js → chunk-5T4C2XRT.js} +12 -7
- package/dist/chunk-5T4C2XRT.js.map +1 -0
- package/dist/{chunk-OBOU27DM.js → chunk-A354ZCZF.js} +6735 -1822
- package/dist/chunk-A354ZCZF.js.map +1 -0
- package/dist/{chunk-TSASFMRF.js → chunk-BAP2GCYH.js} +1 -1
- package/dist/chunk-BAP2GCYH.js.map +1 -0
- package/dist/{chunk-3BPSNNK3.js → chunk-EECW6PYP.js} +11 -9
- package/dist/chunk-EECW6PYP.js.map +1 -0
- package/dist/chunk-G5ECPY4K.js +551 -0
- package/dist/chunk-G5ECPY4K.js.map +1 -0
- package/dist/{chunk-LLV3W326.js → chunk-NORTAQIL.js} +67 -20
- package/dist/chunk-NORTAQIL.js.map +1 -0
- package/dist/{chunk-F3PR7UTL.js → chunk-QFHPUAUQ.js} +5 -3
- package/dist/{chunk-F3PR7UTL.js.map → chunk-QFHPUAUQ.js.map} +1 -1
- package/dist/cli/server.js +2 -2
- package/dist/cli/viewer.js +2 -2
- package/dist/features/shell/templates/bash.render.d.ts +1 -1
- package/dist/features/websearch/templates/web-fetch.render.d.ts +1 -1
- package/dist/index.d.ts +1733 -500
- package/dist/index.js +30 -8
- package/dist/index.js.map +1 -1
- package/dist/{notification-3VEAP7YF.js → notification-NWVOS2WR.js} +3 -3
- package/dist/tools-LDR3LIJP.js +14 -0
- package/dist/tools-LDR3LIJP.js.map +1 -0
- package/dist/{types-DUKIIntb.d.ts → types-CF5UsxD9.d.ts} +3 -0
- package/node_modules/@sliverp/qqbot/LICENSE +21 -0
- package/node_modules/@sliverp/qqbot/README.md +427 -0
- package/node_modules/@sliverp/qqbot/README.standalone.zh.md +77 -0
- package/node_modules/@sliverp/qqbot/README.zh.md +423 -0
- package/node_modules/@sliverp/qqbot/bin/qqbot-cli.js +227 -0
- package/node_modules/@sliverp/qqbot/clawdbot.plugin.json +16 -0
- package/node_modules/@sliverp/qqbot/dist/index.d.ts +20 -0
- package/node_modules/@sliverp/qqbot/dist/index.js +25 -0
- package/node_modules/@sliverp/qqbot/dist/src/agent.d.ts +76 -0
- package/node_modules/@sliverp/qqbot/dist/src/agent.js +36 -0
- package/node_modules/@sliverp/qqbot/dist/src/api.d.ts +138 -0
- package/node_modules/@sliverp/qqbot/dist/src/api.js +523 -0
- package/node_modules/@sliverp/qqbot/dist/src/channel.d.ts +3 -0
- package/node_modules/@sliverp/qqbot/dist/src/channel.js +349 -0
- package/node_modules/@sliverp/qqbot/dist/src/config.d.ts +25 -0
- package/node_modules/@sliverp/qqbot/dist/src/config.js +156 -0
- package/node_modules/@sliverp/qqbot/dist/src/demo-standalone.d.ts +1 -0
- package/node_modules/@sliverp/qqbot/dist/src/demo-standalone.js +125 -0
- package/node_modules/@sliverp/qqbot/dist/src/gateway.d.ts +20 -0
- package/node_modules/@sliverp/qqbot/dist/src/gateway.js +2156 -0
- package/node_modules/@sliverp/qqbot/dist/src/image-server.d.ts +62 -0
- package/node_modules/@sliverp/qqbot/dist/src/image-server.js +401 -0
- package/node_modules/@sliverp/qqbot/dist/src/known-users.d.ts +100 -0
- package/node_modules/@sliverp/qqbot/dist/src/known-users.js +263 -0
- package/node_modules/@sliverp/qqbot/dist/src/onboarding.d.ts +10 -0
- package/node_modules/@sliverp/qqbot/dist/src/onboarding.js +203 -0
- package/node_modules/@sliverp/qqbot/dist/src/openclaw-agent-adapter.d.ts +2 -0
- package/node_modules/@sliverp/qqbot/dist/src/openclaw-agent-adapter.js +155 -0
- package/node_modules/@sliverp/qqbot/dist/src/outbound.d.ts +150 -0
- package/node_modules/@sliverp/qqbot/dist/src/outbound.js +1175 -0
- package/node_modules/@sliverp/qqbot/dist/src/proactive.d.ts +170 -0
- package/node_modules/@sliverp/qqbot/dist/src/proactive.js +399 -0
- package/node_modules/@sliverp/qqbot/dist/src/runtime.d.ts +5 -0
- package/node_modules/@sliverp/qqbot/dist/src/runtime.js +16 -0
- package/node_modules/@sliverp/qqbot/dist/src/session-store.d.ts +52 -0
- package/node_modules/@sliverp/qqbot/dist/src/session-store.js +254 -0
- package/node_modules/@sliverp/qqbot/dist/src/types.d.ts +145 -0
- package/node_modules/@sliverp/qqbot/dist/src/types.js +1 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/audio-convert.d.ts +73 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/audio-convert.js +645 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/file-utils.d.ts +46 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/file-utils.js +107 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/image-size.d.ts +51 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/image-size.js +234 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/media-tags.d.ts +14 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/media-tags.js +120 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/payload.d.ts +112 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/payload.js +186 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/platform.d.ts +126 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/platform.js +358 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/upload-cache.d.ts +34 -0
- package/node_modules/@sliverp/qqbot/dist/src/utils/upload-cache.js +93 -0
- package/node_modules/@sliverp/qqbot/dist/standalone.d.ts +6 -0
- package/node_modules/@sliverp/qqbot/dist/standalone.js +6 -0
- package/node_modules/@sliverp/qqbot/index.ts +30 -0
- package/node_modules/@sliverp/qqbot/moltbot.plugin.json +16 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/LICENSE +201 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/README.md +134 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/browser.js +17 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/index.d.ts +4 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/node.js +223 -0
- package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/package.json +54 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/index.js +5 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/package.json +36 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
- package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/README.md +265 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/index.js +8 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/package.json +58 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
- package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/types.d.ts +30 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/LICENSE +21 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/README.md +85 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.cjs +16 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.d.ts +70 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.mjs +16 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/silk.wasm +0 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/package.json +39 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/.prettierignore +1 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/LICENSE +7 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/README.md +163 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/dist/esm.js +1 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/dist/index.js +1 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/package.json +50 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/rollup.config.js +27 -0
- package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/src/simple-yenc.js +302 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/LICENSE +20 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/README.md +548 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/browser.js +8 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/index.js +13 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/websocket-server.js +554 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/lib/websocket.js +1393 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/package.json +69 -0
- package/node_modules/@sliverp/qqbot/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/@sliverp/qqbot/openclaw.plugin.json +16 -0
- package/node_modules/@sliverp/qqbot/package.json +81 -0
- package/node_modules/@sliverp/qqbot/skills/qqbot-cron/SKILL.md +513 -0
- package/node_modules/@sliverp/qqbot/skills/qqbot-media/SKILL.md +194 -0
- package/node_modules/@sliverp/qqbot/src/agent.ts +133 -0
- package/node_modules/@sliverp/qqbot/src/api.ts +704 -0
- package/node_modules/@sliverp/qqbot/src/channel.ts +380 -0
- package/node_modules/@sliverp/qqbot/src/config.ts +182 -0
- package/node_modules/@sliverp/qqbot/src/demo-standalone.ts +144 -0
- package/node_modules/@sliverp/qqbot/src/gateway.ts +2285 -0
- package/node_modules/@sliverp/qqbot/src/image-server.ts +474 -0
- package/node_modules/@sliverp/qqbot/src/known-users.ts +353 -0
- package/node_modules/@sliverp/qqbot/src/onboarding.ts +274 -0
- package/node_modules/@sliverp/qqbot/src/openclaw-agent-adapter.ts +168 -0
- package/node_modules/@sliverp/qqbot/src/openclaw-plugin-sdk.d.ts +483 -0
- package/node_modules/@sliverp/qqbot/src/outbound.ts +1301 -0
- package/node_modules/@sliverp/qqbot/src/proactive.ts +530 -0
- package/node_modules/@sliverp/qqbot/src/runtime.ts +22 -0
- package/node_modules/@sliverp/qqbot/src/session-store.ts +303 -0
- package/node_modules/@sliverp/qqbot/src/types.ts +153 -0
- package/node_modules/@sliverp/qqbot/src/utils/audio-convert.ts +738 -0
- package/node_modules/@sliverp/qqbot/src/utils/file-utils.ts +122 -0
- package/node_modules/@sliverp/qqbot/src/utils/image-size.ts +266 -0
- package/node_modules/@sliverp/qqbot/src/utils/media-tags.ts +134 -0
- package/node_modules/@sliverp/qqbot/src/utils/payload.ts +265 -0
- package/node_modules/@sliverp/qqbot/src/utils/platform.ts +404 -0
- package/node_modules/@sliverp/qqbot/src/utils/upload-cache.ts +128 -0
- package/node_modules/@sliverp/qqbot/standalone.ts +6 -0
- package/node_modules/@sliverp/qqbot/tsconfig.json +16 -0
- package/package.json +9 -1
- package/dist/BasicAgent-QWEYCLV5.js +0 -12
- package/dist/ExplorerAgent-4IT22VB7.js +0 -12
- package/dist/chunk-3BPSNNK3.js.map +0 -1
- package/dist/chunk-LLV3W326.js.map +0 -1
- package/dist/chunk-LQTEETML.js.map +0 -1
- package/dist/chunk-OBOU27DM.js.map +0 -1
- package/dist/chunk-TSASFMRF.js.map +0 -1
- /package/dist/{BasicAgent-QWEYCLV5.js.map → BasicAgent-UWXLSZP2.js.map} +0 -0
- /package/dist/{ExplorerAgent-4IT22VB7.js.map → ExplorerAgent-LCM3JQS4.js.map} +0 -0
- /package/dist/{notification-3VEAP7YF.js.map → notification-NWVOS2WR.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BasicAgent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5T4C2XRT.js";
|
|
4
4
|
import {
|
|
5
5
|
ExplorerAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QFHPUAUQ.js";
|
|
7
7
|
import {
|
|
8
8
|
AgentBase,
|
|
9
9
|
AgentPool,
|
|
10
10
|
AnthropicLLM,
|
|
11
|
+
AudioFeedbackFeature,
|
|
12
|
+
AuditFeature,
|
|
11
13
|
CallFinish,
|
|
12
14
|
CallStart,
|
|
13
15
|
Context,
|
|
14
16
|
DataSourceRegistry,
|
|
17
|
+
Decision,
|
|
15
18
|
ExampleFeature,
|
|
16
19
|
FileSessionStore,
|
|
17
20
|
MCPClient,
|
|
@@ -19,19 +22,25 @@ import {
|
|
|
19
22
|
MCPConnectionState,
|
|
20
23
|
MCPFeature,
|
|
21
24
|
MCPToolAdapter,
|
|
25
|
+
MemoryFeature,
|
|
22
26
|
OpenAILLM,
|
|
23
27
|
OpencodeBasicFeature,
|
|
28
|
+
PluginCompatFeature,
|
|
29
|
+
QQBotFeature,
|
|
30
|
+
ShellFeature,
|
|
24
31
|
SkillFeature,
|
|
25
32
|
StepFinish,
|
|
26
33
|
StepStart,
|
|
27
34
|
SubAgentFeature,
|
|
35
|
+
TTSFeature,
|
|
28
36
|
TemplateComposer,
|
|
29
37
|
TemplateLoader,
|
|
30
38
|
TodoFeature,
|
|
31
39
|
ToolFinished,
|
|
32
|
-
ToolRegistry,
|
|
33
40
|
ToolUse,
|
|
34
41
|
UserInputFeature,
|
|
42
|
+
VisualFeature,
|
|
43
|
+
WebSearchFeature,
|
|
35
44
|
assistant,
|
|
36
45
|
compileContextForAnthropic,
|
|
37
46
|
createAnthropicLLM,
|
|
@@ -45,7 +54,6 @@ import {
|
|
|
45
54
|
createManagedMCPToolsFromClient,
|
|
46
55
|
createMessage,
|
|
47
56
|
createOpenAILLM,
|
|
48
|
-
createTool,
|
|
49
57
|
discover,
|
|
50
58
|
discoverMCPTools,
|
|
51
59
|
discoverManagedMCPTools,
|
|
@@ -63,7 +71,7 @@ import {
|
|
|
63
71
|
system,
|
|
64
72
|
toolResult,
|
|
65
73
|
user
|
|
66
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-A354ZCZF.js";
|
|
67
75
|
import {
|
|
68
76
|
PlaceholderResolver
|
|
69
77
|
} from "./chunk-BVF7RUXV.js";
|
|
@@ -72,13 +80,17 @@ import {
|
|
|
72
80
|
getClawRuntimeUrl,
|
|
73
81
|
getDebugCapabilities,
|
|
74
82
|
resolveDebugTransportMode
|
|
75
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-EECW6PYP.js";
|
|
84
|
+
import {
|
|
85
|
+
ToolRegistry,
|
|
86
|
+
createTool
|
|
87
|
+
} from "./chunk-G5ECPY4K.js";
|
|
76
88
|
import {
|
|
77
89
|
ViewerWorker
|
|
78
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-NORTAQIL.js";
|
|
79
91
|
import {
|
|
80
92
|
getDefaultUDSPath
|
|
81
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-BAP2GCYH.js";
|
|
82
94
|
import "./chunk-BDS2QGZ5.js";
|
|
83
95
|
|
|
84
96
|
// src/template/types.ts
|
|
@@ -216,12 +228,15 @@ export {
|
|
|
216
228
|
AgentBase as Agent,
|
|
217
229
|
AgentPool,
|
|
218
230
|
AnthropicLLM,
|
|
231
|
+
AudioFeedbackFeature,
|
|
232
|
+
AuditFeature,
|
|
219
233
|
BasicAgent,
|
|
220
234
|
CallFinish,
|
|
221
235
|
CallStart,
|
|
222
236
|
Context,
|
|
223
237
|
DataSourceRegistry,
|
|
224
238
|
DebugHub,
|
|
239
|
+
Decision,
|
|
225
240
|
ExampleFeature,
|
|
226
241
|
ExplorerAgent,
|
|
227
242
|
FileSessionStore,
|
|
@@ -231,13 +246,18 @@ export {
|
|
|
231
246
|
MCPFeature,
|
|
232
247
|
MCPToolAdapter,
|
|
233
248
|
MCP_RENDER_TEMPLATES,
|
|
249
|
+
MemoryFeature,
|
|
234
250
|
OpenAILLM,
|
|
235
251
|
OpencodeBasicFeature,
|
|
236
252
|
PlaceholderResolver,
|
|
253
|
+
PluginCompatFeature,
|
|
254
|
+
QQBotFeature,
|
|
255
|
+
ShellFeature,
|
|
237
256
|
SkillFeature,
|
|
238
257
|
StepFinish,
|
|
239
258
|
StepStart,
|
|
240
259
|
SubAgentFeature,
|
|
260
|
+
TTSFeature,
|
|
241
261
|
TemplateComposer,
|
|
242
262
|
TemplateError,
|
|
243
263
|
TemplateLoader,
|
|
@@ -247,6 +267,8 @@ export {
|
|
|
247
267
|
ToolUse,
|
|
248
268
|
UserInputFeature,
|
|
249
269
|
ViewerWorker,
|
|
270
|
+
VisualFeature,
|
|
271
|
+
WebSearchFeature,
|
|
250
272
|
assistant,
|
|
251
273
|
compileContextForAnthropic,
|
|
252
274
|
createAnthropicLLM,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/template/types.ts","../src/mcp/render.ts"],"sourcesContent":["/**\n * 提示词模板系统 - 核心类型定义\n */\n\n/**\n * 模板源\n * - string: 硬编码字符串\n * - { file: string }: 文件路径\n * - [dataSourceName: string]: 数据源名称(如 skills, tasks 等)\n * - TemplateComposer: 组合模板\n *\n * @example\n * ```typescript\n * // 静态字符串\n * 'Hello {{name}}'\n *\n * // 文件\n * { file: 'prompts/system.md' }\n *\n * // 数据源(列表渲染)\n * { skills: '- **{{name}}**: {{description}}' }\n * { tasks: '- [{{title}}](#{{id}}) ({{priority}})' }\n *\n * // 条件渲染\n * { conditional: { part: { file: 'advanced.md' }, condition: (ctx) => ctx.advanced } }\n * ```\n */\nexport type TemplateSource =\n | string\n | { file: string }\n | { conditional: ConditionalSource }\n | { [dataSourceName: string]: string } // 数据源 -> 模板\n | import('./composer.js').TemplateComposer;\n\n/**\n * 条件源配置\n */\nexport interface ConditionalSource {\n /** 条件模板源 */\n part: TemplateSource;\n /** 条件函数(true 时渲染) */\n condition: (context: PlaceholderContext) => boolean;\n}\n\n/**\n * 占位符上下文 - 变量替换的键值对\n * 支持原始类型和复杂对象(用于数据源渲染)\n */\nexport type PlaceholderContext = Record<string, string | number | boolean | undefined | object>;\n\n/**\n * 模板渲染结果\n */\nexport interface TemplateResult {\n /** 渲染后的内容 */\n content: string;\n /** 使用的源文件列表(用于调试) */\n sources: string[];\n}\n\n/**\n * 模板加载器配置\n */\nexport interface TemplateLoaderOptions {\n /** 缓存启用状态,默认 true */\n cacheEnabled?: boolean;\n /** 模板搜索目录(相对于项目根目录) */\n searchDirs?: string[];\n /** 项目根目录(自动检测) */\n projectRoot?: string;\n}\n\n/**\n * 缓存统计\n */\nexport interface CacheStats {\n size: number; // 缓存条目数\n hits: number; // 命中次数\n misses: number; // 未命中次数\n hitRate: number; // 命中率\n}\n\n/**\n * 模板相关错误\n */\nexport class TemplateError extends Error {\n constructor(\n message: string,\n public code:\n | 'FILE_NOT_FOUND'\n | 'INVALID_PATH'\n | 'READ_ERROR'\n | 'UNSUPPORTED_FORMAT',\n public path?: string\n ) {\n super(message);\n this.name = 'TemplateError';\n }\n}\n","/**\n * MCP 工具渲染模板\n *\n * 定义 MCP 工具在 DebugHub 中的显示样式\n */\n\n/**\n * 转义 HTML\n */\nfunction escapeHtml(text: any): string {\n const str = String(text);\n const map: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return str.replace(/[&<>\"']/g, m => map[m]);\n}\n\n/**\n * MCP 工具渲染模板\n */\nexport const MCP_RENDER_TEMPLATES = {\n /**\n * MCP 工具调用显示\n */\n 'mcp-tool': {\n call: (args: any) => {\n const server = args._server || 'unknown';\n const name = args._name || 'unknown';\n return `\n <div class=\"bash-command\" style=\"\n border-left: 3px solid #ff6b6b;\n padding-left: 8px;\n margin: 4px 0;\n \">\n <span style=\"\n color: #ff6b6b;\n font-weight: bold;\n font-size: 11px;\n text-transform: uppercase;\n \">MCP</span>\n <span class=\"file-path\" style=\"color: #c068ff;\">${escapeHtml(server)}</span>\n <span style=\"color: #888;\">::</span>\n <span style=\"color: #fff;\">${escapeHtml(name)}</span>\n </div>\n `.trim();\n },\n result: (data: any, success = true) => {\n if (!success || data.error) {\n return `\n <div class=\"bash-output\" style=\"\n border-left: 3px solid #ff4444;\n padding-left: 8px;\n color: #ff6b6b;\n \">\n <div style=\"font-weight: bold; margin-bottom: 4px;\">MCP Error</div>\n <pre style=\"margin: 0; white-space: pre-wrap;\">${escapeHtml(data.error || 'Unknown error')}</pre>\n </div>\n `.trim();\n }\n\n let content = '';\n\n // 文本内容\n if (data.content) {\n content += `<pre class=\"bash-output\" style=\"max-height: 400px; overflow: auto;\">${escapeHtml(data.content)}</pre>`;\n }\n\n // 结构化数据\n if (data.structuredContent) {\n content += `<details style=\"margin-top: 8px;\">\n <summary style=\"cursor: pointer; color: var(--accent-color);\">Structured Data</summary>\n <pre style=\"margin: 4px 0; padding: 8px; background: var(--bg-secondary);\">${escapeHtml(JSON.stringify(data.structuredContent, null, 2))}</pre>\n </details>`;\n }\n\n // 图像\n if (data.images && data.images.length > 0) {\n content += `<div style=\"margin-top: 8px;\">`;\n data.images.forEach((img: any) => {\n content += `<img src=\"data:${img.mimeType};base64,${img.data}\" style=\"max-width: 100%; border-radius: 4px;\" />`;\n });\n content += `</div>`;\n }\n\n // 资源\n if (data.resources && data.resources.length > 0) {\n content += `<div style=\"margin-top: 8px;\">\n <div style=\"font-weight: bold; margin-bottom: 4px;\">Resources:</div>`;\n data.resources.forEach((res: any) => {\n content += `<div style=\"padding: 4px; background: var(--bg-secondary); margin: 4px 0;\">\n <div style=\"font-size: 11px; color: var(--text-secondary);\">${escapeHtml(res.uri)}</div>\n ${res.text ? `<pre style=\"margin: 4px 0 0 0;\">${escapeHtml(res.text)}</pre>` : ''}\n </div>`;\n });\n content += `</div>`;\n }\n\n // 元数据\n const meta = `\n <div style=\"\n font-size: 11px;\n opacity: 0.6;\n margin-top: 8px;\n display: flex;\n gap: 12px;\n \">\n <span>Server: ${escapeHtml(data.server)}</span>\n <span>Duration: ${data.duration}ms</span>\n </div>\n `;\n\n return content + meta;\n },\n },\n\n /**\n * MCP 结果 (简化版)\n */\n 'mcp-result': {\n call: () => '<div class=\"bash-command\">MCP Tool Call</div>',\n result: (data: any, success = true) => {\n return MCP_RENDER_TEMPLATES['mcp-tool'].result(data, success);\n },\n },\n} as const;\n\n/**\n * 获取 MCP 渲染模板\n */\nexport function getMCPRenderTemplate(toolName: string): string {\n return 'mcp-tool';\n}\n\n/**\n * 渲染 MCP 工具调用\n */\nexport function renderMCPToolCall(\n serverName: string,\n toolName: string,\n args: Record<string, any>\n): string {\n const template = MCP_RENDER_TEMPLATES['mcp-tool'].call;\n if (typeof template === 'function') {\n return template({ _server: serverName, _name: toolName, ...args });\n }\n return template;\n}\n\n/**\n * 渲染 MCP 工具结果\n */\nexport function renderMCPToolResult(\n result: any,\n success = true\n): string {\n const template = MCP_RENDER_TEMPLATES['mcp-tool'].result;\n if (typeof template === 'function') {\n return template(result, success);\n }\n return template;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/template/types.ts","../src/mcp/render.ts"],"sourcesContent":["/**\n * 提示词模板系统 - 核心类型定义\n */\n\n/**\n * 模板源\n * - string: 硬编码字符串\n * - { file: string }: 文件路径\n * - [dataSourceName: string]: 数据源名称(如 skills, tasks 等)\n * - TemplateComposer: 组合模板\n *\n * @example\n * ```typescript\n * // 静态字符串\n * 'Hello {{name}}'\n *\n * // 文件\n * { file: 'prompts/system.md' }\n *\n * // 数据源(列表渲染)\n * { skills: '- **{{name}}**: {{description}}' }\n * { tasks: '- [{{title}}](#{{id}}) ({{priority}})' }\n *\n * // 条件渲染\n * { conditional: { part: { file: 'advanced.md' }, condition: (ctx) => ctx.advanced } }\n * ```\n */\nexport type TemplateSource =\n | string\n | { file: string }\n | { conditional: ConditionalSource }\n | { [dataSourceName: string]: string } // 数据源 -> 模板\n | import('./composer.js').TemplateComposer;\n\n/**\n * 条件源配置\n */\nexport interface ConditionalSource {\n /** 条件模板源 */\n part: TemplateSource;\n /** 条件函数(true 时渲染) */\n condition: (context: PlaceholderContext) => boolean;\n}\n\n/**\n * 占位符上下文 - 变量替换的键值对\n * 支持原始类型和复杂对象(用于数据源渲染)\n */\nexport type PlaceholderContext = Record<string, string | number | boolean | undefined | object>;\n\n/**\n * 模板渲染结果\n */\nexport interface TemplateResult {\n /** 渲染后的内容 */\n content: string;\n /** 使用的源文件列表(用于调试) */\n sources: string[];\n}\n\n/**\n * 模板加载器配置\n */\nexport interface TemplateLoaderOptions {\n /** 缓存启用状态,默认 true */\n cacheEnabled?: boolean;\n /** 模板搜索目录(相对于项目根目录) */\n searchDirs?: string[];\n /** 项目根目录(自动检测) */\n projectRoot?: string;\n}\n\n/**\n * 缓存统计\n */\nexport interface CacheStats {\n size: number; // 缓存条目数\n hits: number; // 命中次数\n misses: number; // 未命中次数\n hitRate: number; // 命中率\n}\n\n/**\n * 模板相关错误\n */\nexport class TemplateError extends Error {\n constructor(\n message: string,\n public code:\n | 'FILE_NOT_FOUND'\n | 'INVALID_PATH'\n | 'READ_ERROR'\n | 'UNSUPPORTED_FORMAT',\n public path?: string\n ) {\n super(message);\n this.name = 'TemplateError';\n }\n}\n","/**\n * MCP 工具渲染模板\n *\n * 定义 MCP 工具在 DebugHub 中的显示样式\n */\n\n/**\n * 转义 HTML\n */\nfunction escapeHtml(text: any): string {\n const str = String(text);\n const map: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return str.replace(/[&<>\"']/g, m => map[m]);\n}\n\n/**\n * MCP 工具渲染模板\n */\nexport const MCP_RENDER_TEMPLATES = {\n /**\n * MCP 工具调用显示\n */\n 'mcp-tool': {\n call: (args: any) => {\n const server = args._server || 'unknown';\n const name = args._name || 'unknown';\n return `\n <div class=\"bash-command\" style=\"\n border-left: 3px solid #ff6b6b;\n padding-left: 8px;\n margin: 4px 0;\n \">\n <span style=\"\n color: #ff6b6b;\n font-weight: bold;\n font-size: 11px;\n text-transform: uppercase;\n \">MCP</span>\n <span class=\"file-path\" style=\"color: #c068ff;\">${escapeHtml(server)}</span>\n <span style=\"color: #888;\">::</span>\n <span style=\"color: #fff;\">${escapeHtml(name)}</span>\n </div>\n `.trim();\n },\n result: (data: any, success = true) => {\n if (!success || data.error) {\n return `\n <div class=\"bash-output\" style=\"\n border-left: 3px solid #ff4444;\n padding-left: 8px;\n color: #ff6b6b;\n \">\n <div style=\"font-weight: bold; margin-bottom: 4px;\">MCP Error</div>\n <pre style=\"margin: 0; white-space: pre-wrap;\">${escapeHtml(data.error || 'Unknown error')}</pre>\n </div>\n `.trim();\n }\n\n let content = '';\n\n // 文本内容\n if (data.content) {\n content += `<pre class=\"bash-output\" style=\"max-height: 400px; overflow: auto;\">${escapeHtml(data.content)}</pre>`;\n }\n\n // 结构化数据\n if (data.structuredContent) {\n content += `<details style=\"margin-top: 8px;\">\n <summary style=\"cursor: pointer; color: var(--accent-color);\">Structured Data</summary>\n <pre style=\"margin: 4px 0; padding: 8px; background: var(--bg-secondary);\">${escapeHtml(JSON.stringify(data.structuredContent, null, 2))}</pre>\n </details>`;\n }\n\n // 图像\n if (data.images && data.images.length > 0) {\n content += `<div style=\"margin-top: 8px;\">`;\n data.images.forEach((img: any) => {\n content += `<img src=\"data:${img.mimeType};base64,${img.data}\" style=\"max-width: 100%; border-radius: 4px;\" />`;\n });\n content += `</div>`;\n }\n\n // 资源\n if (data.resources && data.resources.length > 0) {\n content += `<div style=\"margin-top: 8px;\">\n <div style=\"font-weight: bold; margin-bottom: 4px;\">Resources:</div>`;\n data.resources.forEach((res: any) => {\n content += `<div style=\"padding: 4px; background: var(--bg-secondary); margin: 4px 0;\">\n <div style=\"font-size: 11px; color: var(--text-secondary);\">${escapeHtml(res.uri)}</div>\n ${res.text ? `<pre style=\"margin: 4px 0 0 0;\">${escapeHtml(res.text)}</pre>` : ''}\n </div>`;\n });\n content += `</div>`;\n }\n\n // 元数据\n const meta = `\n <div style=\"\n font-size: 11px;\n opacity: 0.6;\n margin-top: 8px;\n display: flex;\n gap: 12px;\n \">\n <span>Server: ${escapeHtml(data.server)}</span>\n <span>Duration: ${data.duration}ms</span>\n </div>\n `;\n\n return content + meta;\n },\n },\n\n /**\n * MCP 结果 (简化版)\n */\n 'mcp-result': {\n call: () => '<div class=\"bash-command\">MCP Tool Call</div>',\n result: (data: any, success = true) => {\n return MCP_RENDER_TEMPLATES['mcp-tool'].result(data, success);\n },\n },\n} as const;\n\n/**\n * 获取 MCP 渲染模板\n */\nexport function getMCPRenderTemplate(toolName: string): string {\n return 'mcp-tool';\n}\n\n/**\n * 渲染 MCP 工具调用\n */\nexport function renderMCPToolCall(\n serverName: string,\n toolName: string,\n args: Record<string, any>\n): string {\n const template = MCP_RENDER_TEMPLATES['mcp-tool'].call;\n if (typeof template === 'function') {\n return template({ _server: serverName, _name: toolName, ...args });\n }\n return template;\n}\n\n/**\n * 渲染 MCP 工具结果\n */\nexport function renderMCPToolResult(\n result: any,\n success = true\n): string {\n const template = MCP_RENDER_TEMPLATES['mcp-tool'].result;\n if (typeof template === 'function') {\n return template(result, success);\n }\n return template;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvC,YACE,SACO,MAKA,MACP;AACA,UAAM,OAAO;AAPN;AAKA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;;;ACzFA,SAAS,WAAW,MAAmB;AACrC,QAAM,MAAM,OAAO,IAAI;AACvB,QAAM,MAA8B;AAAA,IAClC,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EACP;AACA,SAAO,IAAI,QAAQ,YAAY,OAAK,IAAI,CAAC,CAAC;AAC5C;AAKO,IAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAIlC,YAAY;AAAA,IACV,MAAM,CAAC,SAAc;AACnB,YAAM,SAAS,KAAK,WAAW;AAC/B,YAAM,OAAO,KAAK,SAAS;AAC3B,aAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4DAY+C,WAAW,MAAM,CAAC;AAAA;AAAA,uCAEvC,WAAW,IAAI,CAAC;AAAA;AAAA,QAE/C,KAAK;AAAA,IACT;AAAA,IACA,QAAQ,CAAC,MAAW,UAAU,SAAS;AACrC,UAAI,CAAC,WAAW,KAAK,OAAO;AAC1B,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6DAO8C,WAAW,KAAK,SAAS,eAAe,CAAC;AAAA;AAAA,UAE5F,KAAK;AAAA,MACT;AAEA,UAAI,UAAU;AAGd,UAAI,KAAK,SAAS;AAChB,mBAAW,uEAAuE,WAAW,KAAK,OAAO,CAAC;AAAA,MAC5G;AAGA,UAAI,KAAK,mBAAmB;AAC1B,mBAAW;AAAA;AAAA,uFAEoE,WAAW,KAAK,UAAU,KAAK,mBAAmB,MAAM,CAAC,CAAC,CAAC;AAAA;AAAA,MAE5I;AAGA,UAAI,KAAK,UAAU,KAAK,OAAO,SAAS,GAAG;AACzC,mBAAW;AACX,aAAK,OAAO,QAAQ,CAAC,QAAa;AAChC,qBAAW,kBAAkB,IAAI,QAAQ,WAAW,IAAI,IAAI;AAAA,QAC9D,CAAC;AACD,mBAAW;AAAA,MACb;AAGA,UAAI,KAAK,aAAa,KAAK,UAAU,SAAS,GAAG;AAC/C,mBAAW;AAAA;AAEX,aAAK,UAAU,QAAQ,CAAC,QAAa;AACnC,qBAAW;AAAA,0EACqD,WAAW,IAAI,GAAG,CAAC;AAAA,cAC/E,IAAI,OAAO,mCAAmC,WAAW,IAAI,IAAI,CAAC,WAAW,EAAE;AAAA;AAAA,QAErF,CAAC;AACD,mBAAW;AAAA,MACb;AAGA,YAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAQO,WAAW,KAAK,MAAM,CAAC;AAAA,4BACrB,KAAK,QAAQ;AAAA;AAAA;AAInC,aAAO,UAAU;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,cAAc;AAAA,IACZ,MAAM,MAAM;AAAA,IACZ,QAAQ,CAAC,MAAW,UAAU,SAAS;AACrC,aAAO,qBAAqB,UAAU,EAAE,OAAO,MAAM,OAAO;AAAA,IAC9D;AAAA,EACF;AACF;AAKO,SAAS,qBAAqB,UAA0B;AAC7D,SAAO;AACT;AAKO,SAAS,kBACd,YACA,UACA,MACQ;AACR,QAAM,WAAW,qBAAqB,UAAU,EAAE;AAClD,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO,SAAS,EAAE,SAAS,YAAY,OAAO,UAAU,GAAG,KAAK,CAAC;AAAA,EACnE;AACA,SAAO;AACT;AAKO,SAAS,oBACd,QACA,UAAU,MACF;AACR,QAAM,WAAW,qBAAqB,UAAU,EAAE;AAClD,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO,SAAS,QAAQ,OAAO;AAAA,EACjC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DebugHub
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EECW6PYP.js";
|
|
4
|
+
import "./chunk-BAP2GCYH.js";
|
|
5
5
|
import "./chunk-BDS2QGZ5.js";
|
|
6
6
|
|
|
7
7
|
// src/core/notification.ts
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
createToolStart,
|
|
87
87
|
emitNotification
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=notification-
|
|
89
|
+
//# sourceMappingURL=notification-NWVOS2WR.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
captureWindow,
|
|
3
|
+
createCaptureAndUnderstandAdvancedTool,
|
|
4
|
+
createCaptureAndUnderstandTool,
|
|
5
|
+
understandImage
|
|
6
|
+
} from "./chunk-G5ECPY4K.js";
|
|
7
|
+
import "./chunk-BDS2QGZ5.js";
|
|
8
|
+
export {
|
|
9
|
+
captureWindow,
|
|
10
|
+
createCaptureAndUnderstandAdvancedTool,
|
|
11
|
+
createCaptureAndUnderstandTool,
|
|
12
|
+
understandImage
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=tools-LDR3LIJP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -468,6 +468,8 @@ interface AgentConfig {
|
|
|
468
468
|
maxTurns?: number;
|
|
469
469
|
systemMessage?: string | TemplateSource;
|
|
470
470
|
name?: string;
|
|
471
|
+
projectRoot?: string;
|
|
472
|
+
workspaceDir?: string;
|
|
471
473
|
/**
|
|
472
474
|
* Feature 配置
|
|
473
475
|
*
|
|
@@ -488,6 +490,7 @@ interface AgentInfo {
|
|
|
488
490
|
id: string;
|
|
489
491
|
name: string;
|
|
490
492
|
registeredAt: number;
|
|
493
|
+
projectRoot?: string;
|
|
491
494
|
}
|
|
492
495
|
/**
|
|
493
496
|
* 工具元数据(用于前端渲染)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sliverp
|
|
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.
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<img width="120" src="https://img.shields.io/badge/🤖-QQ_Bot-blue?style=for-the-badge" alt="QQ Bot" />
|
|
6
|
+
|
|
7
|
+
# QQ Bot Channel Plugin for OpenClaw
|
|
8
|
+
|
|
9
|
+
**Connect your AI assistant to QQ — private chat, group chat, and rich media, all in one plugin.**
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@sliverp/qqbot)
|
|
12
|
+
[](./LICENSE)
|
|
13
|
+
[](https://bot.q.qq.com/wiki/)
|
|
14
|
+
[](https://github.com/sliverp/openclaw)
|
|
15
|
+
[](https://nodejs.org/)
|
|
16
|
+
[](https://www.typescriptlang.org/)
|
|
17
|
+
|
|
18
|
+
<br/>
|
|
19
|
+
|
|
20
|
+
**[简体中文](README.zh.md) | English**
|
|
21
|
+
|
|
22
|
+
Scan to join the QQ group chat
|
|
23
|
+
|
|
24
|
+
<img width="300" height="540" alt="Clipboard_Screenshot_1773047715" src="https://github.com/user-attachments/assets/4d2d2337-229a-42ad-97ab-8a6d0607f296" />
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## ✨ Features
|
|
32
|
+
|
|
33
|
+
| Feature | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| 🔒 **Multi-Scene** | C2C private chat, group @messages, channel messages, channel DMs |
|
|
36
|
+
| 🖼️ **Rich Media** | Send & receive images, voice, video, and files |
|
|
37
|
+
| 🎙️ **Voice (STT/TTS)** | Speech-to-text transcription & text-to-speech replies |
|
|
38
|
+
| ⏰ **Scheduled Push** | Proactive message delivery via scheduled tasks |
|
|
39
|
+
| 🔗 **URL Support** | Direct URL sending in private chat (no restrictions) |
|
|
40
|
+
| ⌨️ **Typing Indicator** | "Bot is typing..." status shown in real-time |
|
|
41
|
+
| 🔄 **Hot Reload** | Install via npm with seamless hot updates |
|
|
42
|
+
| 📝 **Markdown** | Full Markdown formatting support |
|
|
43
|
+
| 🛠️ **Commands** | Native OpenClaw command integration |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📸 Feature Showcase
|
|
48
|
+
|
|
49
|
+
> **Note:** This plugin serves as a **message channel** only — it relays messages between QQ and OpenClaw. Capabilities like image understanding, voice transcription, drawing, etc. depend on the **AI model** you configure and the **skills** installed in OpenClaw, not on this plugin itself.
|
|
50
|
+
|
|
51
|
+
<details>
|
|
52
|
+
<summary><b>🎙️ Voice Messages (STT)</b> — AI understands voice messages, auto-transcribes speech to text</summary>
|
|
53
|
+
|
|
54
|
+
> **You**: *(send a voice message)* "What's the weather like tomorrow in Shenzhen?"
|
|
55
|
+
>
|
|
56
|
+
> **QQBot**: Tomorrow (March 7, Saturday) Shenzhen weather forecast 🌤️ ...
|
|
57
|
+
|
|
58
|
+
<img width="360" src="docs/images/fc7b2236896cfba3a37c94be5d59ce3e_720.jpg" alt="Voice STT Demo" />
|
|
59
|
+
|
|
60
|
+
</details>
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary><b>📄 File Understanding</b> — Send any file, AI reads and understands it</summary>
|
|
64
|
+
|
|
65
|
+
> **You**: *(send a TXT file of "War and Peace")*
|
|
66
|
+
>
|
|
67
|
+
> **QQBot**: Got it! You uploaded the Chinese version of "War and Peace" by Leo Tolstoy. This appears to be the opening of Chapter 1...
|
|
68
|
+
|
|
69
|
+
<img width="360" src="docs/images/07bff56ab68e03173d2af586eeb3bcee_720.jpg" alt="File Understanding Demo" />
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary><b>🖼️ Image Understanding</b> — Vision-capable models can see and describe images</summary>
|
|
75
|
+
|
|
76
|
+
> **You**: *(send an image)*
|
|
77
|
+
>
|
|
78
|
+
> **QQBot**: Haha, so cute! Is that a QQ penguin in a lobster costume? 🦞🐧 ...
|
|
79
|
+
|
|
80
|
+
<img width="360" src="docs/images/59d421891f813b0d3c0cbe12574b6a72_720.jpg" alt="Image Understanding Demo" />
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
84
|
+
<details>
|
|
85
|
+
<summary><b>🎨 Image Generation</b> — Ask the bot to draw, it sends the result back</summary>
|
|
86
|
+
|
|
87
|
+
> **You**: Draw me a cat
|
|
88
|
+
>
|
|
89
|
+
> **QQBot**: Here you go! 🐱
|
|
90
|
+
|
|
91
|
+
<img width="360" src="docs/images/4645f2b3a20822b7f8d6664a708529eb_720.jpg" alt="Image Generation Demo" />
|
|
92
|
+
|
|
93
|
+
</details>
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary><b>🔊 Voice Reply (TTS)</b> — Bot replies with voice messages</summary>
|
|
97
|
+
|
|
98
|
+
> **You**: Tell me a joke in voice
|
|
99
|
+
>
|
|
100
|
+
> **QQBot**: *(sends a voice message)*
|
|
101
|
+
|
|
102
|
+
<img width="360" src="docs/images/21dce8bfc553ce23d1bd1b270e9c516c.jpg" alt="TTS Voice Demo" />
|
|
103
|
+
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
<details>
|
|
107
|
+
<summary><b>📎 File Sending</b> — Generate and send files of any format (up to 20MB)</summary>
|
|
108
|
+
|
|
109
|
+
> **You**: Extract chapter 1 of War and Peace and send it as a file
|
|
110
|
+
>
|
|
111
|
+
> **QQBot**: *(sends a .txt file)*
|
|
112
|
+
|
|
113
|
+
<img width="360" src="docs/images/17cada70df90185d45a2d6dd36e92f2f_720.jpg" alt="File Sending Demo" />
|
|
114
|
+
|
|
115
|
+
</details>
|
|
116
|
+
|
|
117
|
+
<details>
|
|
118
|
+
<summary><b>🎬 Video Sending</b> — Send videos, large files auto-show upload progress</summary>
|
|
119
|
+
|
|
120
|
+
> **You**: Send me a demo video
|
|
121
|
+
>
|
|
122
|
+
> **QQBot**: *(sends a video)*
|
|
123
|
+
|
|
124
|
+
<img width="360" src="docs/images/85d03b8a216f267ab7b2aee248a18a41_720.jpg" alt="Video Sending Demo" />
|
|
125
|
+
|
|
126
|
+
</details>
|
|
127
|
+
|
|
128
|
+
> For a deep dive into rich media capabilities, see the [Media Guide](docs/qqbot-media-guide.md).
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## ⭐ Star History
|
|
133
|
+
|
|
134
|
+
<div align="center">
|
|
135
|
+
|
|
136
|
+
[](https://www.star-history.com/#sliverp/qqbot&type=date&legend=top-left)
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 🚀 Getting Started
|
|
143
|
+
|
|
144
|
+
### Step 1 — Create a QQ Bot on the QQ Open Platform
|
|
145
|
+
|
|
146
|
+
1. Go to the [QQ Open Platform](https://q.qq.com/) and **scan the QR code with your phone QQ** to register / log in. If you haven't registered before, scanning will automatically complete the registration and bindyour QQ account.
|
|
147
|
+
|
|
148
|
+
<img width="3246" height="1886" alt="Clipboard_Screenshot_1772980354" src="https://github.com/user-attachments/assets/d8491859-57e8-47e4-9d39-b21138be54d0" />
|
|
149
|
+
|
|
150
|
+
2. After scanning, tap **Agree** on your phone — you'll land on the bot configuration page.
|
|
151
|
+
3. Click **Create Bot** to create a new QQ bot.
|
|
152
|
+
|
|
153
|
+
<img width="1982" height="1316" alt="Clipboard_Screenshot_1772980440" src="https://github.com/user-attachments/assets/3ccb494d-6e4d-462c-9218-b4dfd43a254f" />
|
|
154
|
+
|
|
155
|
+
4. Find **AppID** and **AppSecret** on the bot's page, click **Copy** for each, and save them somewhere safe (e.g., a notepad). **AppSecret is not stored in plaintext — if you leave the page without saving it, you'll have to regenerate a new one.**
|
|
156
|
+
|
|
157
|
+
<img width="1670" height="1036" alt="Clipboard_Screenshot_1772980413" src="https://github.com/user-attachments/assets/b898d171-5711-4d42-bc07-2de967b119ec" />
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
> For a step-by-step walkthrough with screenshots, see the [official guide](https://cloud.tencent.com/developer/article/2626045).
|
|
161
|
+
|
|
162
|
+
> ⚠️ The bot will automatically appear in your QQ message list and send a first message. However, it will reply "The bot has gone to Mars" until you complete the configuration steps below.
|
|
163
|
+
|
|
164
|
+
### Step 2 — Install the Plugin
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Via OpenClaw CLI (recommended)
|
|
168
|
+
openclaw plugins install @sliverp/qqbot@latest
|
|
169
|
+
|
|
170
|
+
# Or from source
|
|
171
|
+
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
172
|
+
openclaw plugins install .
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Step 3 — Configure OpenClaw
|
|
176
|
+
|
|
177
|
+
**Option 1: CLI Wizard (Recommended)**
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
openclaw channels add --channel qqbot --token "AppID:AppSecret"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Option 2: Edit Config File**
|
|
184
|
+
|
|
185
|
+
Edit `~/.openclaw/openclaw.json`:
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"channels": {
|
|
190
|
+
"qqbot": {
|
|
191
|
+
"enabled": true,
|
|
192
|
+
"appId": "Your AppID",
|
|
193
|
+
"clientSecret": "Your AppSecret"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Step 4 — Start & Test
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
openclaw gateway
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Open QQ, find your bot, and send a message!
|
|
206
|
+
|
|
207
|
+
<div align="center">
|
|
208
|
+
<img width="500" alt="Chat Demo" src="https://github.com/user-attachments/assets/b2776c8b-de72-4e37-b34d-e8287ce45de1" />
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 🤖 Multi-Account Setup (Multi-Bot)
|
|
214
|
+
|
|
215
|
+
Run multiple QQ bots under a single OpenClaw instance.
|
|
216
|
+
|
|
217
|
+
### Configuration
|
|
218
|
+
|
|
219
|
+
Edit `~/.openclaw/openclaw.json` and add an `accounts` field under `channels.qqbot`:
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"channels": {
|
|
224
|
+
"qqbot": {
|
|
225
|
+
"enabled": true,
|
|
226
|
+
"appId": "111111111",
|
|
227
|
+
"clientSecret": "secret-of-bot-1",
|
|
228
|
+
|
|
229
|
+
"accounts": {
|
|
230
|
+
"bot2": {
|
|
231
|
+
"enabled": true,
|
|
232
|
+
"appId": "222222222",
|
|
233
|
+
"clientSecret": "secret-of-bot-2"
|
|
234
|
+
},
|
|
235
|
+
"bot3": {
|
|
236
|
+
"enabled": true,
|
|
237
|
+
"appId": "333333333",
|
|
238
|
+
"clientSecret": "secret-of-bot-3"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Notes:**
|
|
247
|
+
|
|
248
|
+
- The top-level `appId` / `clientSecret` is the **default account** (accountId = `"default"`)
|
|
249
|
+
- Each key under `accounts` (e.g. `bot2`, `bot3`) is the `accountId` for that bot
|
|
250
|
+
- Each account can independently configure `enabled`, `name`, `allowFrom`, `systemPrompt`, etc.
|
|
251
|
+
- You may also skip the top-level default account and only configure bots inside `accounts`
|
|
252
|
+
|
|
253
|
+
Add a second bot via CLI (if the framework supports the `--account` parameter):
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
openclaw channels add --channel qqbot --account bot2 --token "222222222:secret-of-bot-2"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Sending Messages to a Specific Account's Users
|
|
260
|
+
|
|
261
|
+
When using `openclaw message send`, specify which bot to use with the `--account` parameter:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
# Send with the default bot (no --account = uses "default")
|
|
265
|
+
openclaw message send --channel "qqbot" \
|
|
266
|
+
--target "qqbot:c2c:OPENID" \
|
|
267
|
+
--message "hello from default bot"
|
|
268
|
+
|
|
269
|
+
# Send with bot2
|
|
270
|
+
openclaw message send --channel "qqbot" \
|
|
271
|
+
--account bot2 \
|
|
272
|
+
--target "qqbot:c2c:OPENID" \
|
|
273
|
+
--message "hello from bot2"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Target Formats:**
|
|
277
|
+
|
|
278
|
+
| Format | Description |
|
|
279
|
+
|--------|-------------|
|
|
280
|
+
| `qqbot:c2c:OPENID` | Private chat (C2C) |
|
|
281
|
+
| `qqbot:group:GROUP_OPENID` | Group chat |
|
|
282
|
+
| `qqbot:channel:CHANNEL_ID` | Guild channel |
|
|
283
|
+
|
|
284
|
+
> ⚠️ **Important**: Each bot has its own set of user OpenIDs. An OpenID received by Bot A **cannot** be used to send messages via Bot B — this will result in a 500 error. Always use the matching bot's `accountId` to send messages to its users.
|
|
285
|
+
|
|
286
|
+
### How It Works
|
|
287
|
+
|
|
288
|
+
- When `openclaw gateway` starts, all accounts with `enabled: true` launch their own WebSocket connections
|
|
289
|
+
- Each account maintains an independent Token cache (isolated by `appId`), preventing cross-contamination
|
|
290
|
+
- Incoming message logs are prefixed with `[qqbot:accountId]` for easy debugging
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 🎙️ Voice Configuration (Optional)
|
|
295
|
+
|
|
296
|
+
### STT (Speech-to-Text) — Transcribe Incoming Voice Messages
|
|
297
|
+
|
|
298
|
+
STT supports two-level configuration with priority fallback:
|
|
299
|
+
|
|
300
|
+
| Priority | Config Path | Scope |
|
|
301
|
+
|----------|------------|-------|
|
|
302
|
+
| 1 (highest) | `channels.qqbot.stt` | Plugin-specific |
|
|
303
|
+
| 2 (fallback) | `tools.media.audio.models[0]` | Framework-level |
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"channels": {
|
|
308
|
+
"qqbot": {
|
|
309
|
+
"stt": {
|
|
310
|
+
"provider": "your-provider",
|
|
311
|
+
"model": "your-stt-model"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
- `provider` — references a key in `models.providers` to inherit `baseUrl` and `apiKey`
|
|
319
|
+
- Set `enabled: false` to disable
|
|
320
|
+
- When configured, incoming voice messages are automatically converted (SILK→WAV) and transcribed
|
|
321
|
+
|
|
322
|
+
### TTS (Text-to-Speech) — Send Voice Messages
|
|
323
|
+
|
|
324
|
+
| Priority | Config Path | Scope |
|
|
325
|
+
|----------|------------|-------|
|
|
326
|
+
| 1 (highest) | `channels.qqbot.tts` | Plugin-specific |
|
|
327
|
+
| 2 (fallback) | `messages.tts` | Framework-level |
|
|
328
|
+
|
|
329
|
+
```json
|
|
330
|
+
{
|
|
331
|
+
"channels": {
|
|
332
|
+
"qqbot": {
|
|
333
|
+
"tts": {
|
|
334
|
+
"provider": "your-provider",
|
|
335
|
+
"model": "your-tts-model",
|
|
336
|
+
"voice": "your-voice"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
- `provider` — references a key in `models.providers` to inherit `baseUrl` and `apiKey`
|
|
344
|
+
- `voice` — voice variant
|
|
345
|
+
- Set `enabled: false` to disable (default: `true`)
|
|
346
|
+
- When configured, AI can use `<qqvoice>` tags to generate and send voice messages
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 🔄 Upgrade
|
|
351
|
+
|
|
352
|
+
### Via OpenClaw / npm (Recommended)
|
|
353
|
+
|
|
354
|
+
> For installations via `openclaw plugins install`
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
openclaw plugins upgrade @sliverp/qqbot@latest
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Via npx
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
npx -y @sliverp/qqbot@latest upgrade
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Via upgrade-and-run.sh (One-Click)
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
bash ./upgrade-and-run.sh
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
When no `--appid` / `--secret` is provided, the script reads existing config from `~/.openclaw/openclaw.json` automatically.
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
# First-time or override credentials
|
|
376
|
+
bash ./upgrade-and-run.sh --appid YOUR_APPID --secret YOUR_SECRET
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
<details>
|
|
380
|
+
<summary>Full Options</summary>
|
|
381
|
+
|
|
382
|
+
| Option | Description |
|
|
383
|
+
|--------|-------------|
|
|
384
|
+
| `--appid <id>` | QQ Bot AppID |
|
|
385
|
+
| `--secret <secret>` | QQ Bot AppSecret |
|
|
386
|
+
| `--markdown <yes\|no>` | Enable Markdown format (default: no) |
|
|
387
|
+
| `-h, --help` | Show help |
|
|
388
|
+
|
|
389
|
+
Environment variables `QQBOT_APPID`, `QQBOT_SECRET`, `QQBOT_TOKEN` (AppID:Secret) are also supported.
|
|
390
|
+
|
|
391
|
+
</details>
|
|
392
|
+
|
|
393
|
+
### Via pull-latest.sh (Git Source)
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
bash ./pull-latest.sh
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
<details>
|
|
400
|
+
<summary>Options</summary>
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
bash ./pull-latest.sh --branch main # specify branch (default: main)
|
|
404
|
+
bash ./pull-latest.sh --force # skip prompts, force update
|
|
405
|
+
bash ./pull-latest.sh --repo <git-url> # use a different repo
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
</details>
|
|
409
|
+
|
|
410
|
+
### From Source (Manual)
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
git clone https://github.com/sliverp/qqbot.git && cd qqbot
|
|
414
|
+
bash ./scripts/upgrade.sh
|
|
415
|
+
openclaw plugins install .
|
|
416
|
+
openclaw channels add --channel qqbot --token "AppID:AppSecret"
|
|
417
|
+
openclaw gateway restart
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## 📚 Documentation
|
|
423
|
+
|
|
424
|
+
- [Rich Media Guide](docs/qqbot-media-guide.md) — images, voice, video, files
|
|
425
|
+
- [Command Reference](docs/commands.md) — OpenClaw CLI commands
|
|
426
|
+
- [Changelog](docs/changelog/) — release notes ([latest: 1.5.4](docs/changelog/1.5.4.md))
|
|
427
|
+
|