import { type MediaKind } from 'openclaw/plugin-sdk/media-runtime'; import type { Dispatcher } from 'undici'; import type { Logger, TrueConfChannelConfig, TrueConfResponse } from './types'; import { type FileUploadLimits } from './limits'; import type { PerChatSendQueue } from './send-queue'; import type { OutboundQueue } from './outbound-queue'; export interface DirectChatStore { directChatsByStableUserId: Map; } export declare function isReconnectableSendError(err: unknown): boolean; export declare function responseErrorCode(response: TrueConfResponse): number | undefined; export declare function sanitizeMarkdown(text: string): string; export declare function sanitizeMarkdownPreservingParagraphs(text: string): string; declare function sendMessageRequest(outboundQueue: OutboundQueue, chatId: string, text: string, sendQueue: PerChatSendQueue): Promise; export declare const __test__sendMessageRequest: typeof sendMessageRequest; type SendTextOptions = { fallbackUserId: string; directChatStore: DirectChatStore; accountId?: string; sendQueue: PerChatSendQueue; outboundQueue: OutboundQueue; }; export type SendTextResult = { ok: false; } | { ok: true; messageId?: string; chatId: string; }; export declare function sendTextToChat(outboundQueue: OutboundQueue, chatId: string, text: string, logger: Logger, sendQueue: PerChatSendQueue): Promise; export declare function sendText(userId: string, text: string, logger: Logger, options: SendTextOptions): Promise; export type OutboundAttachmentReason = 'fileNotFound' | 'tooLarge' | 'uploadFailed' | 'sendFailed' | 'genericError'; export interface OutboundAttachmentCtx { to: string; text: string; mediaUrl?: string; mediaLocalRoots?: readonly string[]; accountId?: string | null; } export interface OutboundAttachmentDeps { outboundQueue: OutboundQueue; resolved: { serverUrl: string; useTls: boolean; port?: number; }; store: DirectChatStore; channelConfig: TrueConfChannelConfig; logger: Logger; dispatcher?: Dispatcher; limits: FileUploadLimits; sendQueue: PerChatSendQueue; } interface PreparedUpload { temporalFileId: string; inlineCaption: string | null; kind: MediaKind; bytes: number; replyMessageId?: string | null; } declare function buildSendFilePayload(chatId: string, upload: PreparedUpload): Record; export declare const __test__buildSendFilePayload: typeof buildSendFilePayload; export declare function handleOutboundAttachment(ctx: OutboundAttachmentCtx, deps: OutboundAttachmentDeps): Promise<{ ok: true; messageId: string; chatId: string; } | { ok: false; reason: OutboundAttachmentReason; }>; export interface OutboundAttachmentToChatCtx { chatId: string; text: string; mediaUrl?: string; mediaLocalRoots?: readonly string[]; } export type OutboundAttachmentToChatDeps = Pick; export declare function handleOutboundAttachmentToChat(ctx: OutboundAttachmentToChatCtx, deps: OutboundAttachmentToChatDeps): Promise<{ ok: true; messageId: string; chatId: string; } | { ok: false; reason: OutboundAttachmentReason; }>; export {}; //# sourceMappingURL=outbound.d.ts.map