diff --git a/extensions/qqbot/src/engine/api/messages.ts b/extensions/qqbot/src/engine/api/messages.ts index 9e98342516f..36a5cee9e3e 100644 --- a/extensions/qqbot/src/engine/api/messages.ts +++ b/extensions/qqbot/src/engine/api/messages.ts @@ -291,6 +291,3 @@ export interface Credentials { appId: string; clientSecret: string; } - -// Re-export getNextMsgSeq for consumers that import from messages.ts. -export { getNextMsgSeq } from "./routes.js"; diff --git a/extensions/qqbot/src/engine/api/retry.ts b/extensions/qqbot/src/engine/api/retry.ts index c7fdbf6f07b..623ac3d2327 100644 --- a/extensions/qqbot/src/engine/api/retry.ts +++ b/extensions/qqbot/src/engine/api/retry.ts @@ -211,7 +211,7 @@ export function buildPartFinishPersistentPolicy( } /** Business error codes that trigger persistent part-finish retry. */ -export const PART_FINISH_RETRYABLE_CODES: Set = new Set([40093001]); +const PART_FINISH_RETRYABLE_CODES: Set = new Set([40093001]); /** upload_prepare error code indicating daily limit exceeded. */ export const UPLOAD_PREPARE_FALLBACK_CODE = 40093002; diff --git a/extensions/qqbot/src/engine/messaging/outbound-deliver.ts b/extensions/qqbot/src/engine/messaging/outbound-deliver.ts index 3ab34ab8c24..87fc033210d 100644 --- a/extensions/qqbot/src/engine/messaging/outbound-deliver.ts +++ b/extensions/qqbot/src/engine/messaging/outbound-deliver.ts @@ -73,7 +73,7 @@ export interface DeliverDeps { // ---- Exported types ---- /** Maximum text length for a single QQ Bot message. */ -export const TEXT_CHUNK_LIMIT = 5000; +const TEXT_CHUNK_LIMIT = 5000; export interface DeliverEventContext { type: "c2c" | "guild" | "dm" | "group"; diff --git a/extensions/qqbot/src/engine/messaging/sender.ts b/extensions/qqbot/src/engine/messaging/sender.ts index 02c5d58eb53..82b5fbecebc 100644 --- a/extensions/qqbot/src/engine/messaging/sender.ts +++ b/extensions/qqbot/src/engine/messaging/sender.ts @@ -803,6 +803,6 @@ export function accountToCreds(account: { appId: string; clientSecret: string }) } /** Check whether a target type supports rich media (C2C and Group only). */ -export function supportsRichMedia(targetType: string): boolean { +function supportsRichMedia(targetType: string): boolean { return targetType === "c2c" || targetType === "group"; } diff --git a/extensions/qqbot/src/engine/messaging/streaming-media-send.ts b/extensions/qqbot/src/engine/messaging/streaming-media-send.ts index 77dc854545d..45f81e059e8 100644 --- a/extensions/qqbot/src/engine/messaging/streaming-media-send.ts +++ b/extensions/qqbot/src/engine/messaging/streaming-media-send.ts @@ -31,11 +31,11 @@ export interface SendQueueItem { } /** 统一的媒体标签正则 — 匹配标准化后的 6 种标签 */ -export const MEDIA_TAG_REGEX = +const MEDIA_TAG_REGEX = /<(qqimg|qqvoice|qqvideo|qqfile|qqmedia|img)>([^<>]+)<\/(?:qqimg|qqvoice|qqvideo|qqfile|qqmedia|img)>/gi; /** 创建一个新的全局标签正则实例(每次调用 reset lastIndex) */ -export function createMediaTagRegex(): RegExp { +function createMediaTagRegex(): RegExp { return new RegExp(MEDIA_TAG_REGEX.source, MEDIA_TAG_REGEX.flags); } @@ -70,7 +70,7 @@ export interface MediaSendContext { * 此方法在 gateway.ts deliver 回调、outbound.ts sendText、 * streaming.ts sendMediaQueue 中共用。 */ -export function fixPathEncoding( +function fixPathEncoding( mediaPath: string, log?: { debug?: (msg: string) => void; error?: (msg: string) => void }, ): string { @@ -133,7 +133,7 @@ export function fixPathEncoding( * @param position 要检测的位置(字符索引) * @returns 如果 position 在围栏代码块内返回 true */ -export function isInsideCodeBlock(text: string, position: number): boolean { +function isInsideCodeBlock(text: string, position: number): boolean { const fenceRegex = /^(`{3,})[^\n]*$/gm; let fenceMatch: RegExpExecArray | null; let openFence: { pos: number; ticks: number } | null = null; diff --git a/extensions/qqbot/src/engine/tools/channel-api.ts b/extensions/qqbot/src/engine/tools/channel-api.ts index d5f2f600b65..3e7c6cad0a7 100644 --- a/extensions/qqbot/src/engine/tools/channel-api.ts +++ b/extensions/qqbot/src/engine/tools/channel-api.ts @@ -63,7 +63,7 @@ export const ChannelApiSchema = { * Build the full API URL from base + path + query params. * 拼接 API 基地址 + 路径 + 查询参数。 */ -export function buildUrl(path: string, query?: Record): string { +function buildUrl(path: string, query?: Record): string { let url = `${API_BASE}${path}`; if (query && Object.keys(query).length > 0) { const params = new URLSearchParams(); @@ -84,7 +84,7 @@ export function buildUrl(path: string, query?: Record): string { * Validate API path format; returns an error string or null if valid. * 校验 API 路径格式,返回错误描述或 null(合法)。 */ -export function validatePath(path: string): string | null { +function validatePath(path: string): string | null { if (!path.startsWith("/")) { return "path must start with /"; }