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.
Files changed (186) hide show
  1. package/dist/BasicAgent-UWXLSZP2.js +13 -0
  2. package/dist/ExplorerAgent-LCM3JQS4.js +13 -0
  3. package/dist/{chunk-LQTEETML.js → chunk-5T4C2XRT.js} +12 -7
  4. package/dist/chunk-5T4C2XRT.js.map +1 -0
  5. package/dist/{chunk-OBOU27DM.js → chunk-A354ZCZF.js} +6735 -1822
  6. package/dist/chunk-A354ZCZF.js.map +1 -0
  7. package/dist/{chunk-TSASFMRF.js → chunk-BAP2GCYH.js} +1 -1
  8. package/dist/chunk-BAP2GCYH.js.map +1 -0
  9. package/dist/{chunk-3BPSNNK3.js → chunk-EECW6PYP.js} +11 -9
  10. package/dist/chunk-EECW6PYP.js.map +1 -0
  11. package/dist/chunk-G5ECPY4K.js +551 -0
  12. package/dist/chunk-G5ECPY4K.js.map +1 -0
  13. package/dist/{chunk-LLV3W326.js → chunk-NORTAQIL.js} +67 -20
  14. package/dist/chunk-NORTAQIL.js.map +1 -0
  15. package/dist/{chunk-F3PR7UTL.js → chunk-QFHPUAUQ.js} +5 -3
  16. package/dist/{chunk-F3PR7UTL.js.map → chunk-QFHPUAUQ.js.map} +1 -1
  17. package/dist/cli/server.js +2 -2
  18. package/dist/cli/viewer.js +2 -2
  19. package/dist/features/shell/templates/bash.render.d.ts +1 -1
  20. package/dist/features/websearch/templates/web-fetch.render.d.ts +1 -1
  21. package/dist/index.d.ts +1733 -500
  22. package/dist/index.js +30 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/{notification-3VEAP7YF.js → notification-NWVOS2WR.js} +3 -3
  25. package/dist/tools-LDR3LIJP.js +14 -0
  26. package/dist/tools-LDR3LIJP.js.map +1 -0
  27. package/dist/{types-DUKIIntb.d.ts → types-CF5UsxD9.d.ts} +3 -0
  28. package/node_modules/@sliverp/qqbot/LICENSE +21 -0
  29. package/node_modules/@sliverp/qqbot/README.md +427 -0
  30. package/node_modules/@sliverp/qqbot/README.standalone.zh.md +77 -0
  31. package/node_modules/@sliverp/qqbot/README.zh.md +423 -0
  32. package/node_modules/@sliverp/qqbot/bin/qqbot-cli.js +227 -0
  33. package/node_modules/@sliverp/qqbot/clawdbot.plugin.json +16 -0
  34. package/node_modules/@sliverp/qqbot/dist/index.d.ts +20 -0
  35. package/node_modules/@sliverp/qqbot/dist/index.js +25 -0
  36. package/node_modules/@sliverp/qqbot/dist/src/agent.d.ts +76 -0
  37. package/node_modules/@sliverp/qqbot/dist/src/agent.js +36 -0
  38. package/node_modules/@sliverp/qqbot/dist/src/api.d.ts +138 -0
  39. package/node_modules/@sliverp/qqbot/dist/src/api.js +523 -0
  40. package/node_modules/@sliverp/qqbot/dist/src/channel.d.ts +3 -0
  41. package/node_modules/@sliverp/qqbot/dist/src/channel.js +349 -0
  42. package/node_modules/@sliverp/qqbot/dist/src/config.d.ts +25 -0
  43. package/node_modules/@sliverp/qqbot/dist/src/config.js +156 -0
  44. package/node_modules/@sliverp/qqbot/dist/src/demo-standalone.d.ts +1 -0
  45. package/node_modules/@sliverp/qqbot/dist/src/demo-standalone.js +125 -0
  46. package/node_modules/@sliverp/qqbot/dist/src/gateway.d.ts +20 -0
  47. package/node_modules/@sliverp/qqbot/dist/src/gateway.js +2156 -0
  48. package/node_modules/@sliverp/qqbot/dist/src/image-server.d.ts +62 -0
  49. package/node_modules/@sliverp/qqbot/dist/src/image-server.js +401 -0
  50. package/node_modules/@sliverp/qqbot/dist/src/known-users.d.ts +100 -0
  51. package/node_modules/@sliverp/qqbot/dist/src/known-users.js +263 -0
  52. package/node_modules/@sliverp/qqbot/dist/src/onboarding.d.ts +10 -0
  53. package/node_modules/@sliverp/qqbot/dist/src/onboarding.js +203 -0
  54. package/node_modules/@sliverp/qqbot/dist/src/openclaw-agent-adapter.d.ts +2 -0
  55. package/node_modules/@sliverp/qqbot/dist/src/openclaw-agent-adapter.js +155 -0
  56. package/node_modules/@sliverp/qqbot/dist/src/outbound.d.ts +150 -0
  57. package/node_modules/@sliverp/qqbot/dist/src/outbound.js +1175 -0
  58. package/node_modules/@sliverp/qqbot/dist/src/proactive.d.ts +170 -0
  59. package/node_modules/@sliverp/qqbot/dist/src/proactive.js +399 -0
  60. package/node_modules/@sliverp/qqbot/dist/src/runtime.d.ts +5 -0
  61. package/node_modules/@sliverp/qqbot/dist/src/runtime.js +16 -0
  62. package/node_modules/@sliverp/qqbot/dist/src/session-store.d.ts +52 -0
  63. package/node_modules/@sliverp/qqbot/dist/src/session-store.js +254 -0
  64. package/node_modules/@sliverp/qqbot/dist/src/types.d.ts +145 -0
  65. package/node_modules/@sliverp/qqbot/dist/src/types.js +1 -0
  66. package/node_modules/@sliverp/qqbot/dist/src/utils/audio-convert.d.ts +73 -0
  67. package/node_modules/@sliverp/qqbot/dist/src/utils/audio-convert.js +645 -0
  68. package/node_modules/@sliverp/qqbot/dist/src/utils/file-utils.d.ts +46 -0
  69. package/node_modules/@sliverp/qqbot/dist/src/utils/file-utils.js +107 -0
  70. package/node_modules/@sliverp/qqbot/dist/src/utils/image-size.d.ts +51 -0
  71. package/node_modules/@sliverp/qqbot/dist/src/utils/image-size.js +234 -0
  72. package/node_modules/@sliverp/qqbot/dist/src/utils/media-tags.d.ts +14 -0
  73. package/node_modules/@sliverp/qqbot/dist/src/utils/media-tags.js +120 -0
  74. package/node_modules/@sliverp/qqbot/dist/src/utils/payload.d.ts +112 -0
  75. package/node_modules/@sliverp/qqbot/dist/src/utils/payload.js +186 -0
  76. package/node_modules/@sliverp/qqbot/dist/src/utils/platform.d.ts +126 -0
  77. package/node_modules/@sliverp/qqbot/dist/src/utils/platform.js +358 -0
  78. package/node_modules/@sliverp/qqbot/dist/src/utils/upload-cache.d.ts +34 -0
  79. package/node_modules/@sliverp/qqbot/dist/src/utils/upload-cache.js +93 -0
  80. package/node_modules/@sliverp/qqbot/dist/standalone.d.ts +6 -0
  81. package/node_modules/@sliverp/qqbot/dist/standalone.js +6 -0
  82. package/node_modules/@sliverp/qqbot/index.ts +30 -0
  83. package/node_modules/@sliverp/qqbot/moltbot.plugin.json +16 -0
  84. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/LICENSE +201 -0
  85. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/README.md +134 -0
  86. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/browser.js +17 -0
  87. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
  88. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
  89. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/index.d.ts +4 -0
  90. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/node.js +223 -0
  91. package/node_modules/@sliverp/qqbot/node_modules/@eshaz/web-worker/package.json +54 -0
  92. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/index.js +5 -0
  93. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/package.json +36 -0
  94. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
  95. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
  96. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
  97. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
  98. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
  99. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
  100. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
  101. package/node_modules/@sliverp/qqbot/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
  102. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/README.md +265 -0
  103. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
  104. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
  105. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/index.js +8 -0
  106. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/package.json +58 -0
  107. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
  108. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
  109. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
  110. package/node_modules/@sliverp/qqbot/node_modules/mpg123-decoder/types.d.ts +30 -0
  111. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/LICENSE +21 -0
  112. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/README.md +85 -0
  113. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.cjs +16 -0
  114. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.d.ts +70 -0
  115. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/index.mjs +16 -0
  116. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/silk.wasm +0 -0
  117. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/lib/utils.d.ts +4 -0
  118. package/node_modules/@sliverp/qqbot/node_modules/silk-wasm/package.json +39 -0
  119. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
  120. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/.prettierignore +1 -0
  121. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/LICENSE +7 -0
  122. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/README.md +163 -0
  123. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/dist/esm.js +1 -0
  124. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/dist/index.js +1 -0
  125. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/package.json +50 -0
  126. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/rollup.config.js +27 -0
  127. package/node_modules/@sliverp/qqbot/node_modules/simple-yenc/src/simple-yenc.js +302 -0
  128. package/node_modules/@sliverp/qqbot/node_modules/ws/LICENSE +20 -0
  129. package/node_modules/@sliverp/qqbot/node_modules/ws/README.md +548 -0
  130. package/node_modules/@sliverp/qqbot/node_modules/ws/browser.js +8 -0
  131. package/node_modules/@sliverp/qqbot/node_modules/ws/index.js +13 -0
  132. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/buffer-util.js +131 -0
  133. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/constants.js +19 -0
  134. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/event-target.js +292 -0
  135. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/extension.js +203 -0
  136. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/limiter.js +55 -0
  137. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/permessage-deflate.js +528 -0
  138. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/receiver.js +706 -0
  139. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/sender.js +602 -0
  140. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/stream.js +161 -0
  141. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/subprotocol.js +62 -0
  142. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/validation.js +152 -0
  143. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/websocket-server.js +554 -0
  144. package/node_modules/@sliverp/qqbot/node_modules/ws/lib/websocket.js +1393 -0
  145. package/node_modules/@sliverp/qqbot/node_modules/ws/package.json +69 -0
  146. package/node_modules/@sliverp/qqbot/node_modules/ws/wrapper.mjs +8 -0
  147. package/node_modules/@sliverp/qqbot/openclaw.plugin.json +16 -0
  148. package/node_modules/@sliverp/qqbot/package.json +81 -0
  149. package/node_modules/@sliverp/qqbot/skills/qqbot-cron/SKILL.md +513 -0
  150. package/node_modules/@sliverp/qqbot/skills/qqbot-media/SKILL.md +194 -0
  151. package/node_modules/@sliverp/qqbot/src/agent.ts +133 -0
  152. package/node_modules/@sliverp/qqbot/src/api.ts +704 -0
  153. package/node_modules/@sliverp/qqbot/src/channel.ts +380 -0
  154. package/node_modules/@sliverp/qqbot/src/config.ts +182 -0
  155. package/node_modules/@sliverp/qqbot/src/demo-standalone.ts +144 -0
  156. package/node_modules/@sliverp/qqbot/src/gateway.ts +2285 -0
  157. package/node_modules/@sliverp/qqbot/src/image-server.ts +474 -0
  158. package/node_modules/@sliverp/qqbot/src/known-users.ts +353 -0
  159. package/node_modules/@sliverp/qqbot/src/onboarding.ts +274 -0
  160. package/node_modules/@sliverp/qqbot/src/openclaw-agent-adapter.ts +168 -0
  161. package/node_modules/@sliverp/qqbot/src/openclaw-plugin-sdk.d.ts +483 -0
  162. package/node_modules/@sliverp/qqbot/src/outbound.ts +1301 -0
  163. package/node_modules/@sliverp/qqbot/src/proactive.ts +530 -0
  164. package/node_modules/@sliverp/qqbot/src/runtime.ts +22 -0
  165. package/node_modules/@sliverp/qqbot/src/session-store.ts +303 -0
  166. package/node_modules/@sliverp/qqbot/src/types.ts +153 -0
  167. package/node_modules/@sliverp/qqbot/src/utils/audio-convert.ts +738 -0
  168. package/node_modules/@sliverp/qqbot/src/utils/file-utils.ts +122 -0
  169. package/node_modules/@sliverp/qqbot/src/utils/image-size.ts +266 -0
  170. package/node_modules/@sliverp/qqbot/src/utils/media-tags.ts +134 -0
  171. package/node_modules/@sliverp/qqbot/src/utils/payload.ts +265 -0
  172. package/node_modules/@sliverp/qqbot/src/utils/platform.ts +404 -0
  173. package/node_modules/@sliverp/qqbot/src/utils/upload-cache.ts +128 -0
  174. package/node_modules/@sliverp/qqbot/standalone.ts +6 -0
  175. package/node_modules/@sliverp/qqbot/tsconfig.json +16 -0
  176. package/package.json +9 -1
  177. package/dist/BasicAgent-QWEYCLV5.js +0 -12
  178. package/dist/ExplorerAgent-4IT22VB7.js +0 -12
  179. package/dist/chunk-3BPSNNK3.js.map +0 -1
  180. package/dist/chunk-LLV3W326.js.map +0 -1
  181. package/dist/chunk-LQTEETML.js.map +0 -1
  182. package/dist/chunk-OBOU27DM.js.map +0 -1
  183. package/dist/chunk-TSASFMRF.js.map +0 -1
  184. /package/dist/{BasicAgent-QWEYCLV5.js.map → BasicAgent-UWXLSZP2.js.map} +0 -0
  185. /package/dist/{ExplorerAgent-4IT22VB7.js.map → ExplorerAgent-LCM3JQS4.js.map} +0 -0
  186. /package/dist/{notification-3VEAP7YF.js.map → notification-NWVOS2WR.js.map} +0 -0
@@ -0,0 +1,150 @@
1
+ /**
2
+ * QQ Bot 消息发送模块
3
+ */
4
+ import type { ResolvedQQBotAccount } from "./types.js";
5
+ /** 限流检查结果 */
6
+ export interface ReplyLimitResult {
7
+ /** 是否允许被动回复 */
8
+ allowed: boolean;
9
+ /** 剩余被动回复次数 */
10
+ remaining: number;
11
+ /** 是否需要降级为主动消息(超期或超过次数) */
12
+ shouldFallbackToProactive: boolean;
13
+ /** 降级原因 */
14
+ fallbackReason?: "expired" | "limit_exceeded";
15
+ /** 提示消息 */
16
+ message?: string;
17
+ }
18
+ /**
19
+ * 检查是否可以回复该消息(限流检查)
20
+ * @param messageId 消息ID
21
+ * @returns ReplyLimitResult 限流检查结果
22
+ */
23
+ export declare function checkMessageReplyLimit(messageId: string): ReplyLimitResult;
24
+ /**
25
+ * 记录一次消息回复
26
+ * @param messageId 消息ID
27
+ */
28
+ export declare function recordMessageReply(messageId: string): void;
29
+ /**
30
+ * 获取消息回复统计信息
31
+ */
32
+ export declare function getMessageReplyStats(): {
33
+ trackedMessages: number;
34
+ totalReplies: number;
35
+ };
36
+ /**
37
+ * 获取消息回复限制配置(供外部查询)
38
+ */
39
+ export declare function getMessageReplyConfig(): {
40
+ limit: number;
41
+ ttlMs: number;
42
+ ttlHours: number;
43
+ };
44
+ export interface OutboundContext {
45
+ to: string;
46
+ text: string;
47
+ accountId?: string | null;
48
+ replyToId?: string | null;
49
+ account: ResolvedQQBotAccount;
50
+ }
51
+ export interface MediaOutboundContext extends OutboundContext {
52
+ mediaUrl: string;
53
+ }
54
+ export interface OutboundResult {
55
+ channel: string;
56
+ messageId?: string;
57
+ timestamp?: string | number;
58
+ error?: string;
59
+ }
60
+ /**
61
+ * 发送文本消息
62
+ * - 有 replyToId: 被动回复,1小时内最多回复4次
63
+ * - 无 replyToId: 主动发送,有配额限制(每月4条/用户/群)
64
+ *
65
+ * 注意:
66
+ * 1. 主动消息(无 replyToId)必须有消息内容,不支持流式发送
67
+ * 2. 当被动回复不可用(超期或超过次数)时,自动降级为主动消息
68
+ * 3. 支持 <qqimg>路径</qqimg> 或 <qqimg>路径</img> 格式发送图片
69
+ */
70
+ export declare function sendText(ctx: OutboundContext): Promise<OutboundResult>;
71
+ /**
72
+ * 主动发送消息(不需要 replyToId,有配额限制:每月 4 条/用户/群)
73
+ *
74
+ * @param account - 账户配置
75
+ * @param to - 目标地址,格式:openid(单聊)或 group:xxx(群聊)
76
+ * @param text - 消息内容
77
+ */
78
+ export declare function sendProactiveMessage(account: ResolvedQQBotAccount, to: string, text: string): Promise<OutboundResult>;
79
+ /**
80
+ * 发送富媒体消息(图片)
81
+ *
82
+ * 支持以下 mediaUrl 格式:
83
+ * - 公网 URL: https://example.com/image.png
84
+ * - Base64 Data URL: data:image/png;base64,xxxxx
85
+ * - 本地文件路径: /path/to/image.png(自动读取并转换为 Base64)
86
+ *
87
+ * @param ctx - 发送上下文,包含 mediaUrl
88
+ * @returns 发送结果
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * // 发送网络图片
93
+ * const result = await sendMedia({
94
+ * to: "group:xxx",
95
+ * text: "这是图片说明",
96
+ * mediaUrl: "https://example.com/image.png",
97
+ * account,
98
+ * replyToId: msgId,
99
+ * });
100
+ *
101
+ * // 发送 Base64 图片
102
+ * const result = await sendMedia({
103
+ * to: "group:xxx",
104
+ * text: "这是图片说明",
105
+ * mediaUrl: "data:image/png;base64,iVBORw0KGgo...",
106
+ * account,
107
+ * replyToId: msgId,
108
+ * });
109
+ *
110
+ * // 发送本地文件(自动读取并转换为 Base64)
111
+ * const result = await sendMedia({
112
+ * to: "group:xxx",
113
+ * text: "这是图片说明",
114
+ * mediaUrl: "/tmp/generated-chart.png",
115
+ * account,
116
+ * replyToId: msgId,
117
+ * });
118
+ * ```
119
+ */
120
+ export declare function sendMedia(ctx: MediaOutboundContext): Promise<OutboundResult>;
121
+ /**
122
+ * 发送 Cron 触发的消息
123
+ *
124
+ * 当 OpenClaw cron 任务触发时,消息内容可能是:
125
+ * 1. QQBOT_CRON:{base64} 格式的结构化载荷 - 解码后根据 targetType 和 targetAddress 发送
126
+ * 2. 普通文本 - 直接发送到指定目标
127
+ *
128
+ * @param account - 账户配置
129
+ * @param to - 目标地址(作为后备,如果载荷中没有指定)
130
+ * @param message - 消息内容(可能是 QQBOT_CRON: 格式或普通文本)
131
+ * @returns 发送结果
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * // 处理结构化载荷
136
+ * const result = await sendCronMessage(
137
+ * account,
138
+ * "user_openid", // 后备地址
139
+ * "QQBOT_CRON:eyJ0eXBlIjoiY3Jvbl9yZW1pbmRlciIs..." // Base64 编码的载荷
140
+ * );
141
+ *
142
+ * // 处理普通文本
143
+ * const result = await sendCronMessage(
144
+ * account,
145
+ * "user_openid",
146
+ * "这是一条普通的提醒消息"
147
+ * );
148
+ * ```
149
+ */
150
+ export declare function sendCronMessage(account: ResolvedQQBotAccount, to: string, message: string): Promise<OutboundResult>;