/**
 * HITL Telegram adapter — inline keyboard approval messages + HMAC-verified callback handler.
 *
 * Plan v6 §1.7: channels are transports; state lives in HITLPort (Postgres).
 * Callback_data uses compact keys (a/v) to stay within Telegram's 64-byte limit.
 *
 * @public
 */
import type { HITLPort, HITLRequest } from "../ports/hitl.js";
/** Telegram channel config. */
export interface TelegramChannelConfig {
    /** Telegram Bot API token. Never hardcoded — pass at runtime. */
    botToken: string;
    /** Target chat ID (string or negative number for groups). */
    chatId: string;
}
export interface SendHITLTelegramOpts {
    channel: TelegramChannelConfig;
    hitlPort: HITLPort;
    request: HITLRequest;
}
export interface TelegramApprovalResult {
    approvalId: string;
    messageId: number;
}
/**
 * Record a new HITL approval request and send an inline-keyboard message via Telegram.
 * Returns the approvalId (=request.id) and the Telegram message_id.
 */
export declare function sendHITLApprovalRequestTelegram(opts: SendHITLTelegramOpts): Promise<TelegramApprovalResult>;
interface TelegramTextOpts {
    agentSource: string;
    question: string;
    approvalId: string;
    payloadSummary: string;
    deadline: string;
}
/**
 * Build the MarkdownV2 message text for a HITL approval request.
 * Exported for snapshot testing.
 */
export declare function buildTelegramText(opts: TelegramTextOpts): string;
export interface TelegramCallbackHandlerOpts {
    hitlPort: HITLPort;
    /** Telegram bot token — used to answer the callback query (removes loading spinner). */
    botToken: string;
    /** Optional HMAC secret for validating x-telegram-hmac-sha256 header. */
    callbackSecret?: string;
}
export interface HandlerResult {
    status: number;
    body: unknown;
}
/**
 * Create a Telegram webhook callback handler.
 *
 * Validates optional HMAC signature, extracts callback_data (compact a/v format),
 * calls hitlPort.resolve(), then answers the Telegram callback query.
 * Idempotent: duplicate callbacks for an already-resolved request are silently ignored.
 */
export declare function createTelegramCallbackHandler(opts: TelegramCallbackHandlerOpts): (rawBody: string, headers: Record<string, string>) => Promise<HandlerResult>;
/**
 * Verify the x-telegram-hmac-sha256 header using HMAC-SHA256 of the raw body.
 *
 * @public — exported for unit tests
 */
export declare function verifyTelegramSignature(rawBody: string, signature: string, secret: string): boolean;
/**
 * Send a plain informational message to a Telegram chat (no buttons).
 * Used for daily briefs and non-interactive notifications.
 */
export declare function sendTelegramMessage(text: string, channel: TelegramChannelConfig): Promise<void>;
export {};
//# sourceMappingURL=telegram.d.ts.map