/** 群聊 Bot 互叫:短号转飞书 at、检测其他 Bot at、保险丝剥 at。 */ export declare const BOT_COLLAB_FUSE_LIMIT = 20; export declare const BOT_COLLAB_FUSE_NOTICE = "\u4E92\u53EB\u5DF2\u505C\uFF0C\u9700\u8981\u4EBA\u63A5\u624B\u3002"; export type MentionUser = { id: string; platformId: string; name: string | null; isBot: boolean; }; export type RewriteOutboundMentionsOptions = { selfUserId?: string | null; stripOtherBotAts?: boolean; /** 保险丝:剥掉所有 Bot at(含自己)。 */ stripAllBotAts?: boolean; }; export type SupplementMissingBotMentionOptions = { selfUserId?: string | null; /** 只允许补当前群已知的 Bot,避免把同名的别的群 Bot 叫醒。 */ candidateBotIds?: readonly string[]; }; export type RewriteOutboundMentionsResult = { text: string; /** 转换后、剥 at 前,是否 at 了其他 Bot */ mentionedOtherBot: boolean; /** 转换后是否 at 了自己以外的人(未标 is_bot 的对方 Bot 也算) */ mentionedNonSelf: boolean; stripped: boolean; }; export declare function hasFeishuAtTag(text: string): boolean; /** 去掉开头连续的 @某人,让群聊 `@Bot /help` 仍能识别为内置命令。 */ export declare function stripLeadingAtMentions(text: string): string; /** 群聊认命令:剥开头/结尾的 at,以及 `/status@U3` 这种粘在命令上的 at。 */ export declare function extractBuiltinCommandText(text: string): string; export declare function mapFeishuAtTags(text: string, replace: (platformId: string, inner: string) => string): string; /** 卡片 markdown 用官方 ``;文本消息仍用 ``。 */ export declare function toCardAtTags(text: string): string; /** 只改 at 标签外的文本,避免把已有 `` 再包一层。 */ export declare function mapOutsideAtTags(text: string, rewrite: (chunk: string) => string): string; /** 对唯一、明确的 Bot 交棒意图补真实 at;不确定时保持原文。 */ export declare function supplementMissingBotMention(text: string, users: MentionUser[], options?: SupplementMissingBotMentionOptions): string; export declare function rewriteOutboundMentions(text: string, users: MentionUser[], options?: RewriteOutboundMentionsOptions): RewriteOutboundMentionsResult; export declare function appendFuseNotice(text: string): string; /** 发出去的飞书 at 转回 @U4(Name),供会话历史使用。 */ export declare function invertFeishuAtsToShortLabels(text: string, users: MentionUser[]): string;