import type { HistoryMediaEntry } from "openclaw/plugin-sdk/reply-history"; import type { MsgContent, SessionInfo, SessionType, MeetBot } from "@meet-im/meet-bot-jssdk"; import type { MeetMessageContext, MeetReplyContext, MeetMediaAttachment } from "./types.js"; export type QuoteMsgMap = Record; export declare function mapSessionType(sessionType: SessionType): "direct" | "channel"; /** * 构建引用消息查找 Key * key = convID:quoteSeqID,convID 规则与服务端 xim.GetConvID 一致: * - 群聊会话 (sessionType=3): firstID+secondID[+companyID]:quoteSeqID * - 私聊会话 (sessionType=1): min:max[:companyID]:quoteSeqID */ export declare function buildQuoteMsgKey(sessionInfo: SessionInfo, quoteSeqID: number): string; /** * 解析引用消息 */ export declare function resolveQuoteMessage(msg: MsgContent, quoteMsgMap: QuoteMsgMap): MeetReplyContext | undefined; /** * 从引用消息中提取媒体附件信息(用于下载) */ export declare function extractQuoteMessageMedia(msg: MsgContent, quoteMsgMap: QuoteMsgMap): MeetMediaAttachment[] | undefined; export declare function msgContentToContext(msg: MsgContent, botUserId: string, quoteMsgMap?: QuoteMsgMap): MeetMessageContext; /** * 从缓存中填充 senderName 和 atIds 对应的用户名 * 同时将用户名注册到目录缓存,用于出站 @提及 转换 */ export declare function enrichContextWithUserNames(ctx: MeetMessageContext, bot: MeetBot, accountId?: string): Promise; export declare function parseTargetToSessionInfo(target: string, botUserId: number): SessionInfo; export declare function buildMeetTarget(sessionInfo: SessionInfo, botUserId: number): string; export interface MergedForwardEntry { sender: string; body: string; timestamp?: number; messageId: string; media?: HistoryMediaEntry[]; } /** * 解析合并转发消息的 content,展开为多条可读记录 */ export declare function parseMergedForwardContent(content: string): MergedForwardEntry[];