dsh-qqbot-plus 0.0.0-stage → 0.1.2

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.
Files changed (301) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/CHANGELOG_EN.md +188 -0
  3. package/LICENSE +21 -0
  4. package/README.md +281 -2
  5. package/README_EN.md +248 -0
  6. package/cordis.patch.yml +163 -0
  7. package/cordis.yml +112 -0
  8. package/install.sh +108 -0
  9. package/lib/alarms.js +371 -0
  10. package/lib/client.js +2411 -0
  11. package/lib/commands/auth.d.ts +18 -0
  12. package/lib/commands/auth.d.ts.map +1 -0
  13. package/lib/commands/auth.js +15 -0
  14. package/lib/commands/auth.js.map +1 -0
  15. package/lib/commands/help.d.ts +10 -0
  16. package/lib/commands/help.d.ts.map +1 -0
  17. package/lib/commands/help.js +39 -0
  18. package/lib/commands/help.js.map +1 -0
  19. package/lib/commands/index.d.ts +15 -0
  20. package/lib/commands/index.d.ts.map +1 -0
  21. package/lib/commands/index.js +30 -0
  22. package/lib/commands/index.js.map +1 -0
  23. package/lib/commands/misc.d.ts +21 -0
  24. package/lib/commands/misc.d.ts.map +1 -0
  25. package/lib/commands/misc.js +93 -0
  26. package/lib/commands/misc.js.map +1 -0
  27. package/lib/commands/model.d.ts +6 -0
  28. package/lib/commands/model.d.ts.map +1 -0
  29. package/lib/commands/model.js +63 -0
  30. package/lib/commands/model.js.map +1 -0
  31. package/lib/commands/new.js +17 -0
  32. package/lib/commands/preset.d.ts +8 -0
  33. package/lib/commands/preset.d.ts.map +1 -0
  34. package/lib/commands/preset.js +56 -0
  35. package/lib/commands/preset.js.map +1 -0
  36. package/lib/commands/session.d.ts +14 -0
  37. package/lib/commands/session.d.ts.map +1 -0
  38. package/lib/commands/session.js +34 -0
  39. package/lib/commands/session.js.map +1 -0
  40. package/lib/commands/status.d.ts +7 -0
  41. package/lib/commands/status.d.ts.map +1 -0
  42. package/lib/commands/status.js +26 -0
  43. package/lib/commands/status.js.map +1 -0
  44. package/lib/commands/types.d.ts +21 -0
  45. package/lib/commands/types.d.ts.map +1 -0
  46. package/lib/commands/types.js +2 -0
  47. package/lib/commands/types.js.map +1 -0
  48. package/lib/config.d.ts +95 -0
  49. package/lib/config.js +88 -0
  50. package/lib/features/answer-parser.d.ts +9 -0
  51. package/lib/features/answer-parser.d.ts.map +1 -0
  52. package/lib/features/answer-parser.js +23 -0
  53. package/lib/features/answer-parser.js.map +1 -0
  54. package/lib/features/approval-channel.d.ts +94 -0
  55. package/lib/features/approval-channel.d.ts.map +1 -0
  56. package/lib/features/approval-channel.js +158 -0
  57. package/lib/features/approval-channel.js.map +1 -0
  58. package/lib/features/approval-renderer.d.ts +18 -0
  59. package/lib/features/approval-renderer.d.ts.map +1 -0
  60. package/lib/features/approval-renderer.js +52 -0
  61. package/lib/features/approval-renderer.js.map +1 -0
  62. package/lib/features/button-utils.d.ts +34 -0
  63. package/lib/features/button-utils.d.ts.map +1 -0
  64. package/lib/features/button-utils.js +27 -0
  65. package/lib/features/button-utils.js.map +1 -0
  66. package/lib/features/history-store.d.ts +8 -0
  67. package/lib/features/history-store.d.ts.map +1 -0
  68. package/lib/features/history-store.js +23 -0
  69. package/lib/features/history-store.js.map +1 -0
  70. package/lib/features/question-channel.d.ts +96 -0
  71. package/lib/features/question-channel.d.ts.map +1 -0
  72. package/lib/features/question-channel.js +234 -0
  73. package/lib/features/question-channel.js.map +1 -0
  74. package/lib/features/question-renderer.d.ts +20 -0
  75. package/lib/features/question-renderer.d.ts.map +1 -0
  76. package/lib/features/question-renderer.js +70 -0
  77. package/lib/features/question-renderer.js.map +1 -0
  78. package/lib/fishcheck/measure.js +230 -0
  79. package/lib/fishcheck/rules.js +99 -0
  80. package/lib/fishmeme/plugin.js +605 -0
  81. package/lib/fishmeme/routes.js +141 -0
  82. package/lib/fishmemory/plugin.js +1052 -0
  83. package/lib/gateway/bootstrap.d.ts +12 -0
  84. package/lib/gateway/bootstrap.d.ts.map +1 -0
  85. package/lib/gateway/bootstrap.js +200 -0
  86. package/lib/gateway/bootstrap.js.map +1 -0
  87. package/lib/gateway/index.d.ts +3 -0
  88. package/lib/gateway/index.d.ts.map +1 -0
  89. package/lib/gateway/index.js +3 -0
  90. package/lib/gateway/index.js.map +1 -0
  91. package/lib/gateway/middleware-setup.d.ts +12 -0
  92. package/lib/gateway/middleware-setup.d.ts.map +1 -0
  93. package/lib/gateway/middleware-setup.js +82 -0
  94. package/lib/gateway/middleware-setup.js.map +1 -0
  95. package/lib/host/adapter.d.ts +48 -0
  96. package/lib/host/adapter.d.ts.map +1 -0
  97. package/lib/host/adapter.js +127 -0
  98. package/lib/host/adapter.js.map +1 -0
  99. package/lib/humanlike/ENV_PROMPT.md +28 -0
  100. package/lib/humanlike/affinity.js +316 -0
  101. package/lib/humanlike/learn.js +343 -0
  102. package/lib/humanlike/life.js +899 -0
  103. package/lib/humanlike/mind.js +323 -0
  104. package/lib/humanlike/plugin.js +587 -0
  105. package/lib/humanlike/reach.js +119 -0
  106. package/lib/humanlike/real.js +276 -0
  107. package/lib/humanlike/rules.js +67 -0
  108. package/lib/humanlike/settings-api.js +159 -0
  109. package/lib/humanlike/settings.js +370 -0
  110. package/lib/humanlike/together.js +251 -0
  111. package/lib/identity/paths.js +27 -0
  112. package/lib/identity/persona.js +75 -0
  113. package/lib/identity/portrait.js +25 -0
  114. package/lib/identity/runtime.js +78 -0
  115. package/lib/index.d.ts +15 -0
  116. package/lib/index.js +117 -0
  117. package/lib/media/draft-tool.js +442 -0
  118. package/lib/media/draft-tool.js.bak-to-182027 +389 -0
  119. package/lib/media/media-cleaner.d.ts +19 -0
  120. package/lib/media/media-cleaner.d.ts.map +1 -0
  121. package/lib/media/media-cleaner.js +81 -0
  122. package/lib/media/media-cleaner.js.map +1 -0
  123. package/lib/media/say-tool.js +72 -0
  124. package/lib/media/send-file-tool.d.ts +12 -0
  125. package/lib/media/send-file-tool.d.ts.map +1 -0
  126. package/lib/media/send-file-tool.js +122 -0
  127. package/lib/media/send-file-tool.js.map +1 -0
  128. package/lib/media/send-media.d.ts +61 -0
  129. package/lib/media/send-media.d.ts.map +1 -0
  130. package/lib/media/send-media.js +104 -0
  131. package/lib/media/send-media.js.map +1 -0
  132. package/lib/media/vision-tool.d.ts +22 -0
  133. package/lib/media/vision-tool.d.ts.map +1 -0
  134. package/lib/media/vision-tool.js +288 -0
  135. package/lib/media/vision-tool.js.map +1 -0
  136. package/lib/middleware/attachment.d.ts +11 -0
  137. package/lib/middleware/attachment.d.ts.map +1 -0
  138. package/lib/middleware/attachment.js +30 -0
  139. package/lib/middleware/attachment.js.map +1 -0
  140. package/lib/middleware/question-answer.d.ts +10 -0
  141. package/lib/middleware/question-answer.d.ts.map +1 -0
  142. package/lib/middleware/question-answer.js +19 -0
  143. package/lib/middleware/question-answer.js.map +1 -0
  144. package/lib/model/index.d.ts +10 -0
  145. package/lib/model/index.d.ts.map +1 -0
  146. package/lib/model/index.js +9 -0
  147. package/lib/model/index.js.map +1 -0
  148. package/lib/model/model-resolver.d.ts +102 -0
  149. package/lib/model/model-resolver.d.ts.map +1 -0
  150. package/lib/model/model-resolver.js +206 -0
  151. package/lib/model/model-resolver.js.map +1 -0
  152. package/lib/model/prefs-store.d.ts +50 -0
  153. package/lib/model/prefs-store.d.ts.map +1 -0
  154. package/lib/model/prefs-store.js +215 -0
  155. package/lib/model/prefs-store.js.map +1 -0
  156. package/lib/model/settings-reader.d.ts +19 -0
  157. package/lib/model/settings-reader.d.ts.map +1 -0
  158. package/lib/model/settings-reader.js +76 -0
  159. package/lib/model/settings-reader.js.map +1 -0
  160. package/lib/model/types.d.ts +15 -0
  161. package/lib/model/types.d.ts.map +1 -0
  162. package/lib/model/types.js +5 -0
  163. package/lib/model/types.js.map +1 -0
  164. package/lib/resume-check.js +122 -0
  165. package/lib/resume-tool.js +29 -0
  166. package/lib/rules.js +57 -0
  167. package/lib/session/idle-evictor.d.ts +18 -0
  168. package/lib/session/idle-evictor.d.ts.map +1 -0
  169. package/lib/session/idle-evictor.js +31 -0
  170. package/lib/session/idle-evictor.js.map +1 -0
  171. package/lib/session/index.d.ts +9 -0
  172. package/lib/session/index.d.ts.map +1 -0
  173. package/lib/session/index.js +8 -0
  174. package/lib/session/index.js.map +1 -0
  175. package/lib/session/pick-agent.js +116 -0
  176. package/lib/session/session-id.d.ts +5 -0
  177. package/lib/session/session-id.d.ts.map +1 -0
  178. package/lib/session/session-id.js +15 -0
  179. package/lib/session/session-id.js.map +1 -0
  180. package/lib/session/session-manager.d.ts +138 -0
  181. package/lib/session/session-manager.d.ts.map +1 -0
  182. package/lib/session/session-manager.js +1157 -0
  183. package/lib/session/session-manager.js.bak-target +1081 -0
  184. package/lib/session/session-manager.js.bak-title-20261118 +1119 -0
  185. package/lib/session/session-manager.js.map +1 -0
  186. package/lib/session/types.d.ts +162 -0
  187. package/lib/session/types.d.ts.map +1 -0
  188. package/lib/session/types.js +2 -0
  189. package/lib/session/types.js.map +1 -0
  190. package/lib/setup/bind-routes.d.ts +78 -0
  191. package/lib/setup/bind-routes.d.ts.map +1 -0
  192. package/lib/setup/bind-routes.js +588 -0
  193. package/lib/setup/bind-routes.js.bak-join-163944 +761 -0
  194. package/lib/setup/bind-routes.js.map +1 -0
  195. package/lib/setup/binding-service.d.ts +86 -0
  196. package/lib/setup/binding-service.d.ts.map +1 -0
  197. package/lib/setup/binding-service.js +175 -0
  198. package/lib/setup/binding-service.js.map +1 -0
  199. package/lib/setup/index.d.ts +50 -0
  200. package/lib/setup/index.d.ts.map +1 -0
  201. package/lib/setup/index.js +163 -0
  202. package/lib/setup/index.js.map +1 -0
  203. package/lib/setup/persist.d.ts +42 -0
  204. package/lib/setup/persist.d.ts.map +1 -0
  205. package/lib/setup/persist.js +344 -0
  206. package/lib/setup/persist.js.map +1 -0
  207. package/lib/setup/presenters.d.ts +40 -0
  208. package/lib/setup/presenters.d.ts.map +1 -0
  209. package/lib/setup/presenters.js +84 -0
  210. package/lib/setup/presenters.js.map +1 -0
  211. package/lib/setup/qr-svg.d.ts +9 -0
  212. package/lib/setup/qr-svg.d.ts.map +1 -0
  213. package/lib/setup/qr-svg.js +33 -0
  214. package/lib/setup/qr-svg.js.map +1 -0
  215. package/lib/shared/bind-protocol.d.ts +42 -0
  216. package/lib/shared/bind-protocol.d.ts.map +1 -0
  217. package/lib/shared/bind-protocol.js +33 -0
  218. package/lib/shared/bind-protocol.js.map +1 -0
  219. package/lib/shared/dirs.d.ts +10 -0
  220. package/lib/shared/dirs.d.ts.map +1 -0
  221. package/lib/shared/dirs.js +20 -0
  222. package/lib/shared/dirs.js.map +1 -0
  223. package/lib/shared/http-body.js +43 -0
  224. package/lib/shared/index.d.ts +8 -0
  225. package/lib/shared/index.d.ts.map +1 -0
  226. package/lib/shared/index.js +8 -0
  227. package/lib/shared/index.js.map +1 -0
  228. package/lib/shared/json-file.js +34 -0
  229. package/lib/shared/orders.js +26 -0
  230. package/lib/shared/scope.d.ts +14 -0
  231. package/lib/shared/scope.d.ts.map +1 -0
  232. package/lib/shared/scope.js +12 -0
  233. package/lib/shared/scope.js.map +1 -0
  234. package/lib/shared/send-helper.d.ts +11 -0
  235. package/lib/shared/send-helper.d.ts.map +1 -0
  236. package/lib/shared/send-helper.js +13 -0
  237. package/lib/shared/send-helper.js.map +1 -0
  238. package/lib/shared/utils.d.ts +31 -0
  239. package/lib/shared/utils.d.ts.map +1 -0
  240. package/lib/shared/utils.js +228 -0
  241. package/lib/shared/utils.js.map +1 -0
  242. package/lib/tool-guard.js +74 -0
  243. package/lib/transport/attachment.d.ts +41 -0
  244. package/lib/transport/attachment.d.ts.map +1 -0
  245. package/lib/transport/attachment.js +191 -0
  246. package/lib/transport/attachment.js.map +1 -0
  247. package/lib/transport/chunker.d.ts +14 -0
  248. package/lib/transport/chunker.d.ts.map +1 -0
  249. package/lib/transport/chunker.js +78 -0
  250. package/lib/transport/chunker.js.map +1 -0
  251. package/lib/transport/deliverables.d.ts +20 -0
  252. package/lib/transport/deliverables.d.ts.map +1 -0
  253. package/lib/transport/deliverables.js +72 -0
  254. package/lib/transport/deliverables.js.map +1 -0
  255. package/lib/transport/events.d.ts +117 -0
  256. package/lib/transport/events.d.ts.map +1 -0
  257. package/lib/transport/events.js +112 -0
  258. package/lib/transport/events.js.map +1 -0
  259. package/lib/transport/inbound.d.ts +11 -0
  260. package/lib/transport/inbound.d.ts.map +1 -0
  261. package/lib/transport/inbound.js +511 -0
  262. package/lib/transport/inbound.js.map +1 -0
  263. package/lib/transport/index.d.ts +10 -0
  264. package/lib/transport/index.d.ts.map +1 -0
  265. package/lib/transport/index.js +10 -0
  266. package/lib/transport/index.js.map +1 -0
  267. package/lib/transport/msgid-cache.d.ts +23 -0
  268. package/lib/transport/msgid-cache.d.ts.map +1 -0
  269. package/lib/transport/msgid-cache.js +57 -0
  270. package/lib/transport/msgid-cache.js.map +1 -0
  271. package/lib/transport/notify.js +147 -0
  272. package/lib/transport/outbound-buffer.d.ts +42 -0
  273. package/lib/transport/outbound-buffer.d.ts.map +1 -0
  274. package/lib/transport/outbound-buffer.js +68 -0
  275. package/lib/transport/outbound-buffer.js.map +1 -0
  276. package/lib/transport/outbound.d.ts +42 -0
  277. package/lib/transport/outbound.d.ts.map +1 -0
  278. package/lib/transport/outbound.js +183 -0
  279. package/lib/transport/outbound.js.map +1 -0
  280. package/lib/transport/reply-limiter.d.ts +31 -0
  281. package/lib/transport/reply-limiter.d.ts.map +1 -0
  282. package/lib/transport/reply-limiter.js +50 -0
  283. package/lib/transport/reply-limiter.js.map +1 -0
  284. package/lib/transport/reply-target.d.ts +32 -0
  285. package/lib/transport/reply-target.d.ts.map +1 -0
  286. package/lib/transport/reply-target.js +64 -0
  287. package/lib/transport/reply-target.js.map +1 -0
  288. package/lib/transport/streaming-writer.d.ts +55 -0
  289. package/lib/transport/streaming-writer.d.ts.map +1 -0
  290. package/lib/transport/streaming-writer.js +122 -0
  291. package/lib/transport/streaming-writer.js.map +1 -0
  292. package/lib/transport/tool-presenter.d.ts +37 -0
  293. package/lib/transport/tool-presenter.d.ts.map +1 -0
  294. package/lib/transport/tool-presenter.js +116 -0
  295. package/lib/transport/tool-presenter.js.map +1 -0
  296. package/lib/turn-check.js +85 -0
  297. package/lib/types.d.ts +39 -0
  298. package/lib/types.js +5 -0
  299. package/locale/en.json +6 -0
  300. package/locale/zh.json +6 -0
  301. package/package.json +127 -4
@@ -0,0 +1,163 @@
1
+ # dsh-im-qqbot bundle patch
2
+ #
3
+ # 本包是 @tencent-connect/dsh-qqbot 的 fork(dsh-qqbot-plus),在官方插件基础上
4
+ # 加了记忆 / 人设 / 画像 / 起草—确认回话机制,并继承 dsh-qq 已有的记忆库。
5
+ # 通过 `dsh plugin --profile <name> add dsh-qqbot-plus` 安装后,dsh 启动时自动加载此 patch。
6
+ #
7
+ # 环境变量:
8
+ # QQBOT_APPID - QQ Bot AppID(必填)
9
+ # QQBOT_SECRET - QQ Bot AppSecret(必填)
10
+ #
11
+ # 叠加顺序:dsh-base → 本 bundle patch → profile cordis.patch.yml → --patch
12
+
13
+ # ── 插入 im-qqbot 插件行 + 自己的 agent 预设 ──
14
+ - insert:
15
+ - id: im-qqbot
16
+ name: dsh-qqbot-plus
17
+ config:
18
+ appId: __FROM_ENV__
19
+ appSecret: __FROM_ENV__
20
+ # provider/model 留空:从宿主默认模型路由继承
21
+ # 用户可通过设置面板切换模型;preset 用下面自己注册的 qqbot
22
+ preset: qqbot
23
+ # 关掉流式:起草—确认模式下正文本来就不外发
24
+ streaming: false
25
+ requireMention: true
26
+ textChunkLimit: 4500
27
+ sessionIdleTimeout: 1800000
28
+ maxQueue: 20
29
+ processingTimeoutMs: 1800000
30
+ historyLimit: 10
31
+ debug: false
32
+ # 机器人自己的预设:不再依赖 dsh-qq 注册的 qq 预设,卸载 dsh-qq 也能用。
33
+ - id: preset-qqbot
34
+ name: '@deepseek-ai/dsh-agent-preset'
35
+ config:
36
+ id: qqbot
37
+ name: QQ机器人
38
+ description: 通过 QQ 机器人跟人聊天时的预设:适合即时对话,能查资料、跑命令、写代码,回复保持简短。
39
+ order: 51
40
+ plugins:
41
+ # 人设不放在预设里:QQ 设置(~/.dsh/dsh-qq/persona.md,默认文本见
42
+ # src/persona.js)是唯一来源,由 dsh-qq 在会话作用域注册。
43
+ - id: agent-instructions
44
+ name: '@deepseek-ai/dsh-agent-instructions'
45
+ config:
46
+ maxBytes: 65536
47
+ - id: time-context
48
+ name: '@deepseek-ai/dsh-time-context'
49
+ - id: tool-bash
50
+ name: '@deepseek-ai/dsh-tool-bash'
51
+ disabled: !!js process.platform === 'win32'
52
+ - id: tool-pwsh
53
+ name: '@deepseek-ai/dsh-tool-pwsh'
54
+ disabled: !!js process.platform !== 'win32'
55
+ - id: tool-fs
56
+ name: '@deepseek-ai/dsh-tool-fs'
57
+ config:
58
+ # Set false to drop the apply_patch tool beside edit.
59
+ applyPatch: false
60
+ - id: tool-fs-search
61
+ name: '@deepseek-ai/dsh-tool-fs-search'
62
+ config:
63
+ sampleOverCapGlobResults: false
64
+ - id: tool-jobs
65
+ name: '@deepseek-ai/dsh-tool-jobs'
66
+ - id: tool-schedule
67
+ name: '@deepseek-ai/dsh-tool-schedule'
68
+ - id: skill-filesystem
69
+ name: '@deepseek-ai/dsh-skill-filesystem'
70
+ - id: tool-skill
71
+ name: '@deepseek-ai/dsh-tool-skill'
72
+ - id: command-goal
73
+ name: '@deepseek-ai/dsh-command-goal'
74
+ - id: tool-goal
75
+ name: '@deepseek-ai/dsh-tool-goal'
76
+ - id: planning
77
+ name: cordis:group
78
+ group: true
79
+ isolate:
80
+ planMode: true
81
+ config:
82
+ - id: plan-mode
83
+ name: '@deepseek-ai/dsh-plan-mode'
84
+ config:
85
+ section: |
86
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
87
+
88
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
89
+
90
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
91
+
92
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
93
+
94
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
95
+
96
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
97
+ - id: compaction
98
+ name: cordis:group
99
+ group: true
100
+ isolate:
101
+ compaction: true
102
+ toolResultPruner: true
103
+ config:
104
+ - id: compaction-basic
105
+ name: '@deepseek-ai/dsh-compaction-basic'
106
+ - id: command-compact
107
+ name: '@deepseek-ai/dsh-command-compact'
108
+ - id: tool-result-pruner
109
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
110
+ config:
111
+ thresholdChars: 8192
112
+ headChars: 4096
113
+ tailChars: 1024
114
+ - id: delegation
115
+ name: cordis:group
116
+ group: true
117
+ isolate:
118
+ workflowEngine: true
119
+ config:
120
+ - id: tool-subagent-control
121
+ name: '@deepseek-ai/dsh-tool-subagent-control'
122
+ - id: tool-subagent
123
+ name: '@deepseek-ai/dsh-tool-subagent'
124
+ config:
125
+ provider: spawn
126
+ toolName: subagent
127
+ modelSelection: true
128
+ modelDiscovery: true
129
+ # 子代理用通用预设干活,不背 QQ 聊天那套人设(它没有 qq 工具,
130
+ # 也不该学「回复要短」)。不指定的话会继承 qq 预设。
131
+ agentPreset: standard
132
+ allowedAgentPresets:
133
+ - standard
134
+ - id: tool-subagent-fork
135
+ name: '@deepseek-ai/dsh-tool-subagent'
136
+ config:
137
+ provider: fork
138
+ toolName: subagent_fork
139
+ - id: workflow-ptc
140
+ name: '@deepseek-ai/dsh-workflow-ptc'
141
+ config:
142
+ provider: spawn
143
+ - id: tool-workflow
144
+ name: '@deepseek-ai/dsh-tool-workflow'
145
+ - id: tool-todo
146
+ name: '@deepseek-ai/dsh-tool-todo'
147
+ config:
148
+ allowParallelInProgress: true
149
+ - id: tool-web
150
+ name: '@deepseek-ai/dsh-tool-web'
151
+ config:
152
+ fetch: true
153
+ searchTimeoutMs: 60000
154
+ - id: present
155
+ name: '@deepseek-ai/dsh-tool-present'
156
+ # plugin_manager 留着(能管别的插件);"动自己"由 lib/tool-guard.js 在
157
+ # tools.guard 里拦掉:重载/卸载本插件会把当前 QQ 回合卡死。
158
+ - id: tool-plugin-manager
159
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
160
+ disabled: !!js "!ctx.get('profileContext')"
161
+ - id: tool-plugin-market
162
+ name: '@deepseek-ai/dsh-plugin-market/tools'
163
+ disabled: true
package/cordis.yml ADDED
@@ -0,0 +1,112 @@
1
+ # dsh-im-qqbot 组合配置示例
2
+ #
3
+ # 运行: pnpm dsh --config ./cordis.yml
4
+ #
5
+ # 环境变量:
6
+ # QQBOT_APPID - QQ Bot AppID
7
+ # QQBOT_SECRET - QQ Bot AppSecret
8
+ # DEEPSEEK_API_KEY - DeepSeek API Key
9
+ # DSH_CWD - Agent 工作目录(可选)
10
+ # HUNYUAN_API_KEY - 视觉模型 API Key(qqbot_describe_image 工具,hunyuan-vision)
11
+ # DSH_PRESET_ROOT - 系统预置 preset 目录(可选,默认 ./apps/cli/config/agent-presets)
12
+
13
+ # ── 核心 spine ──
14
+ - id: sessions
15
+ name: '@deepseek-ai/dsh-session'
16
+
17
+ - id: agent
18
+ name: '@deepseek-ai/dsh-agent'
19
+
20
+ - id: agent-loop
21
+ name: '@deepseek-ai/dsh-agent-loop'
22
+
23
+ - id: system-prompt
24
+ name: '@deepseek-ai/dsh-system-prompt'
25
+
26
+ - id: approval
27
+ name: '@deepseek-ai/dsh-user-approval'
28
+ config:
29
+ policy: !!js "process.platform === 'win32' ? 'never' : ((process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask')"
30
+
31
+ - id: tools
32
+ name: '@deepseek-ai/dsh-tools'
33
+
34
+ # ── Agent Preset 服务(/preset 命令切换 preset 依赖) ──
35
+ - id: agent-presets
36
+ name: '@deepseek-ai/dsh-agent-presets'
37
+ config:
38
+ default: standard
39
+ roots:
40
+ # 系统预置 preset 目录(deepseek-harness 的 apps/cli/config/agent-presets,含 standard/code/cordis/minimal)
41
+ - path: ${DSH_PRESET_ROOT:-./apps/cli/config/agent-presets}
42
+ trust: system
43
+ # includeUserRoot 默认 true:额外加载 $DSH_HOME/.agent-presets(用户自定义 preset)
44
+
45
+ # ── 附件存储(describe_image 工具的 attachments.saveImage 依赖) ──
46
+ - id: attachment-local
47
+ name: '@deepseek-ai/dsh-attachment-local'
48
+
49
+ # ── LLM 适配器 ──
50
+ - id: llm-deepseek
51
+ name: '@deepseek-ai/dsh-llm-deepseek'
52
+ config:
53
+ apiKey: ${DEEPSEEK_API_KEY}
54
+
55
+ # 视觉模型适配器(qqbot_describe_image 工具用 llm.stream 调多模态模型)
56
+ - id: llm-pi-ai
57
+ name: '@deepseek-ai/dsh-llm-pi-ai'
58
+ config:
59
+ providers:
60
+ hunyuan:
61
+ displayName: Hunyuan Vision
62
+ apiKeyEnv: HUNYUAN_API_KEY
63
+ api: openai-completions
64
+ baseURL: https://api.hunyuan.cloud.tencent.com/v1
65
+ defaultInput: [text, image]
66
+ models:
67
+ - id: hunyuan-vision
68
+ name: Hunyuan Vision
69
+ contextWindow: 32768
70
+ maxTokens: 4096
71
+
72
+ # ── 执行能力(按需启用) ──
73
+ - id: tool-bash
74
+ name: '@deepseek-ai/dsh-tool-bash'
75
+
76
+ - id: tool-fs
77
+ name: '@deepseek-ai/dsh-tool-fs'
78
+
79
+ - id: tool-web
80
+ name: '@deepseek-ai/dsh-tool-web'
81
+
82
+ # ── 上下文管理 ──
83
+ - id: compaction
84
+ name: '@deepseek-ai/dsh-compaction-basic'
85
+
86
+ - id: token-meter
87
+ name: '@deepseek-ai/dsh-token-meter'
88
+
89
+ # ── 持久化 ──
90
+ - id: session-persistence
91
+ name: '@deepseek-ai/dsh-session-persistence-jsonl'
92
+ config:
93
+ root: ./.dsh-sessions
94
+
95
+ # ── QQ Bot IM 驱动 ──
96
+ - id: im-qqbot
97
+ name: '@tencent-connect/dsh-qqbot'
98
+ config:
99
+ appId: ${QQBOT_APPID}
100
+ appSecret: ${QQBOT_SECRET}
101
+ provider: deepseek
102
+ model: deepseek-chat
103
+ cwd: ${DSH_CWD:-/tmp/dsh-qqbot}
104
+ requireMention: true
105
+ textChunkLimit: 4500
106
+ sessionIdleTimeout: 1800000
107
+ showToolResults: false
108
+ debug: false
109
+ vision:
110
+ enabled: false
111
+ provider: '' # 视觉模型 provider(需与上方 llm-pi-ai 配置的路由一致,如 hunyuan)
112
+ model: '' # 视觉模型 id(如 hunyuan-vision)
package/install.sh ADDED
@@ -0,0 +1,108 @@
1
+ #!/bin/sh
2
+ # @tencent-connect/dsh-qqbot 一键安装
3
+ #
4
+ # 走 dsh CLI 的 profile 插件机制:`add` 自动初始化 profile(首层
5
+ # dsh-base),pnpm 安装后按 dsh.bundle.patch 元数据把本包追加为 bundle 层。
6
+ # 无需 DSH 源码,无需 workspace 链接。
7
+ #
8
+ # 用法:
9
+ # sh install.sh # 安装默认包最新版本
10
+ # sh install.sh --version 0.2.0 # 指定版本
11
+ # sh install.sh --pkg @myorg/my-plugin # 指定包名
12
+ # sh install.sh --pkg @myorg/my-plugin --version 1.0.0 # 指定包名+版本
13
+ # sh install.sh --registry https://registry.npmmirror.com # 指定 npm registry
14
+ set -eu
15
+
16
+ # ── 默认值 ──
17
+ PACKAGE="@tencent-connect/dsh-qqbot"
18
+ VERSION=""
19
+ REGISTRY=""
20
+ PROFILE="qqbot"
21
+
22
+ # ── 参数解析 ──
23
+ while [ $# -gt 0 ]; do
24
+ case "$1" in
25
+ --pkg)
26
+ shift; PACKAGE="$1" ;;
27
+ --pkg=*)
28
+ PACKAGE="${1#--pkg=}" ;;
29
+ --version)
30
+ shift; VERSION="$1" ;;
31
+ --version=*)
32
+ VERSION="${1#--version=}" ;;
33
+ --registry)
34
+ shift; REGISTRY="$1" ;;
35
+ --registry=*)
36
+ REGISTRY="${1#--registry=}" ;;
37
+ --profile)
38
+ shift; PROFILE="$1" ;;
39
+ --profile=*)
40
+ PROFILE="${1#--profile=}" ;;
41
+ -h|--help)
42
+ echo "用法: sh install.sh [选项]"
43
+ echo
44
+ echo "选项:"
45
+ echo " --pkg <name> 指定 npm 包名 (默认: @tencent-connect/dsh-qqbot)"
46
+ echo " --version <ver> 指定包版本 (默认: latest)"
47
+ echo " --registry <url> 指定 npm registry"
48
+ echo " --profile <name> 指定 dsh profile 名 (默认: qqbot)"
49
+ echo " -h, --help 显示帮助"
50
+ exit 0
51
+ ;;
52
+ *)
53
+ echo "未知参数: $1 (使用 --help 查看用法)" >&2
54
+ exit 1
55
+ ;;
56
+ esac
57
+ shift
58
+ done
59
+
60
+ # ── 预检 ──
61
+ if ! command -v dsh >/dev/null 2>&1; then
62
+ echo "未检测到 dsh CLI。先安装:" >&2
63
+ echo " npm install -g @deepseek-ai/dsh" >&2
64
+ exit 1
65
+ fi
66
+
67
+ if ! command -v pnpm >/dev/null 2>&1; then
68
+ echo "未检测到 pnpm。dsh plugin 依赖 pnpm,请先安装:" >&2
69
+ echo " npm install -g pnpm" >&2
70
+ exit 1
71
+ fi
72
+
73
+ # ── 构造安装标识 ──
74
+ INSTALL_SPEC="$PACKAGE"
75
+ if [ -n "$VERSION" ]; then
76
+ INSTALL_SPEC="${PACKAGE}@${VERSION}"
77
+ fi
78
+
79
+ REGISTRY_ARG=""
80
+ if [ -n "$REGISTRY" ]; then
81
+ REGISTRY_ARG="--registry ${REGISTRY}"
82
+ fi
83
+
84
+ # ── 安装 ──
85
+ echo "=================================================="
86
+ echo " 安装 QQ Bot 插件到 dsh"
87
+ echo "=================================================="
88
+ echo
89
+ echo " 包名: ${INSTALL_SPEC}"
90
+ echo " Profile: ${PROFILE}"
91
+ [ -n "$REGISTRY" ] && echo " Registry: ${REGISTRY}"
92
+ echo
93
+
94
+ dsh plugin --profile "$PROFILE" add "$INSTALL_SPEC" $REGISTRY_ARG
95
+
96
+ echo
97
+ echo "=================================================="
98
+ echo " 安装完成"
99
+ echo "=================================================="
100
+ echo
101
+ echo "配置环境变量:"
102
+ echo " export QQBOT_APPID=\"你的AppID\""
103
+ echo " export QQBOT_SECRET=\"你的AppSecret\""
104
+ echo " export DEEPSEEK_API_KEY=\"你的API Key\""
105
+ echo
106
+ echo "启动:"
107
+ echo " dsh --profile ${PROFILE}"
108
+ echo