import type { BotConfig } from "../../config/config.js"; import type { MonitorIMessageOpts, IMessagePayload } from "./types.js"; import { type EnvelopeFormatOptions } from "../../auto-reply/envelope.js"; import { type HistoryEntry } from "../../auto-reply/reply/history.js"; import { finalizeInboundContext } from "../../auto-reply/reply/inbound-context.js"; import { resolveAgentRoute } from "../../routing/resolve-route.js"; type IMessageReplyContext = { id?: string; body: string; sender?: string; }; export type IMessageInboundDispatchDecision = { kind: "dispatch"; isGroup: boolean; chatId?: number; chatGuid?: string; chatIdentifier?: string; groupId?: string; historyKey?: string; sender: string; senderNormalized: string; route: ReturnType; bodyText: string; createdAt?: number; replyContext: IMessageReplyContext | null; effectiveWasMentioned: boolean; commandAuthorized: boolean; effectiveDmAllowFrom: string[]; effectiveGroupAllowFrom: string[]; }; export type IMessageInboundDecision = { kind: "drop"; reason: string; } | { kind: "pairing"; senderId: string; } | IMessageInboundDispatchDecision; export declare function resolveIMessageInboundDecision(params: { cfg: BotConfig; accountId: string; message: IMessagePayload; opts?: Pick; messageText: string; bodyText: string; allowFrom: string[]; groupAllowFrom: string[]; groupPolicy: string; dmPolicy: string; storeAllowFrom: string[]; historyLimit: number; groupHistories: Map; echoCache?: { has: (scope: string, lookup: { text?: string; messageId?: string; }) => boolean; }; logVerbose?: (msg: string) => void; }): IMessageInboundDecision; export declare function buildIMessageInboundContext(params: { cfg: BotConfig; decision: IMessageInboundDispatchDecision; message: IMessagePayload; envelopeOptions?: EnvelopeFormatOptions; previousTimestamp?: number; remoteHost?: string; media?: { path?: string; type?: string; paths?: string[]; types?: Array; }; historyLimit: number; groupHistories: Map; }): { ctxPayload: ReturnType; fromLabel: string; chatTarget?: string; imessageTo: string; inboundHistory?: Array<{ sender: string; body: string; timestamp?: number; }>; }; export declare function buildIMessageEchoScope(params: { accountId: string; isGroup: boolean; chatId?: number; sender: string; }): string; export declare function describeIMessageEchoDropLog(params: { messageText: string; messageId?: string; }): string; export {};