feat(qqbot): 流式消息输出与架构重构

**流式消息**
- 新增 StreamSender 类,支持流式消息分片发送
- 实现消息队列异步处理,防止阻塞心跳
- 支持 C2C/Group 流式消息

**架构重构**
- 移除 clawdbot/moltbot 旧配置,统一为 qqbot
- 新增 upgrade-and-run.sh 一键升级脚本
- 重构 api/channel/gateway/outbound 模块
- 新增富媒体消息发送接口
This commit is contained in:
rianli
2026-01-31 19:49:27 +08:00
parent 35cb5ec1d6
commit 50422aac14
16 changed files with 2933 additions and 1501 deletions

View File

@@ -21,6 +21,8 @@ export interface ResolvedQQBotAccount {
systemPrompt?: string;
/** 图床服务器公网地址 */
imageServerBaseUrl?: string;
/** 是否支持 markdown 消息 */
markdownSupport?: boolean;
config: QQBotAccountConfig;
}
@@ -39,6 +41,8 @@ export interface QQBotAccountConfig {
systemPrompt?: string;
/** 图床服务器公网地址,用于发送图片,例如 http://your-ip:18765 */
imageServerBaseUrl?: string;
/** 是否支持 markdown 消息,默认 true */
markdownSupport?: boolean;
}
/**
@@ -117,3 +121,37 @@ export interface WSPayload {
s?: number;
t?: string;
}
/**
* 流式消息状态
*/
export enum StreamState {
/** 流式消息开始/进行中 */
STREAMING = 1,
/** 流式消息结束 */
END = 10,
}
/**
* 流式消息配置
*/
export interface StreamConfig {
/** 流式状态: 1=开始/进行中, 10=结束 */
state: StreamState;
/** 分片索引从0开始 */
index: number;
/** 流式消息ID第一次发送为空后续需要带上服务端返回的ID */
id: string;
}
/**
* 流式消息发送上下文
*/
export interface StreamContext {
/** 当前分片索引 */
index: number;
/** 流式消息ID首次发送后由服务端返回 */
streamId: string;
/** 是否已结束 */
ended: boolean;
}