/**
 * installAgentMessageHook — production binding for the agent-to-agent Telegram comms
 * receiver (spec MENTOR-LIVE-READINESS §Fix 2b, PR 3b). Composes the PR-1 routing logic
 * (AgentTelegramComms.decideRoute) + the PR-3a storage primitives (AgentTelegramLedger,
 * ProcessedIdStore) into the AgentMessageHook that TelegramAdapter calls before normal
 * dispatch.
 *
 * The role-handler map is **per-recipient** (Echo registers `mentor-reply`; Codey
 * registers `mentor`). Routed messages dispatch via the map; drops are audited; non-a2a
 * messages fall through (`{handled:false}`).
 */
import { type RecipientConfig, type A2aMessage } from './AgentTelegramComms.js';
import type { AgentTelegramLedger } from './AgentTelegramLedger.js';
import type { ProcessedIdStore } from './ProcessedIdStore.js';
import type { AgentMessageHook } from './TelegramAdapter.js';
/** A role-handler is called when decideRoute returns 'route' for that role. The handler
 *  consumes the message body (post-marker-strip) and any audit context it wants. */
export type RoleHandler = (msg: A2aMessage, ctx: {
    topicId: number;
    senderBotId?: string;
}) => Promise<void>;
export interface InstallAgentMessageHookDeps {
    config: RecipientConfig;
    ledger: AgentTelegramLedger;
    processedIds: ProcessedIdStore;
    /** Map of role → handler. A role-handler is called only when decideRoute returns
     *  `route` AND the role is in `config.acceptRoles[from]` — the per-source admission
     *  matrix gates ahead of the role-handler map. */
    roleHandlers: Map<string, RoleHandler>;
}
/**
 * Build the AgentMessageHook closure. Never throws — any internal error is captured
 * + audited as a 'dropped' row with reason 'agent-marker-malformed' (the closest existing
 * code), and the hook returns `{handled:true}` so a broken handler can't double-process
 * via the user-flow fallback.
 */
export declare function buildAgentMessageHook(deps: InstallAgentMessageHookDeps): AgentMessageHook;
//# sourceMappingURL=installAgentMessageHook.d.ts.map