import type { Context } from 'hono';
import type { GatewayService } from '../service.js';
export interface SSEHandlerConfig {
    service: GatewayService;
    maxSseConnections?: number;
}
/**
 * POST /api/agent — Send a message to the agent, stream response via SSE.
 *
 * Request body: { message, channel?, chatId?, attachments? }
 * Accept: text/event-stream → SSE stream
 * Accept: application/json → wait for full response, return JSON
 *
 * SSE events:
 *   event: status   — { status, runId }
 *   event: user_message — { timestamp, content?, attachments? } (user turn accepted, before agent tokens)
 *   event: user_transcript — { text, attachments? } (voice STT complete, before agent tokens)
 *   event: token    — { content }
 *   event: error    — { content }
 *   event: result   — { ok, payload: { status, summary } }
 */
export declare function createAgentSSEHandler(config: SSEHandlerConfig): (c: Context) => Promise<Response>;
/**
 * POST /api/agent/resume — Re-attach to an in-progress agent run via SSE.
 *
 * Request body: { runId, chatId }
 * The relay replays all buffered events from the beginning and then live-tails
 * until the run completes.
 *
 * SSE events are identical to those from POST /api/agent.
 */
export declare function createAgentResumeHandler(config: SSEHandlerConfig): (c: Context) => Promise<Response>;
/**
 * POST /api/send — Send a message through a channel (non-streaming).
 */
export declare function createSendHandler(config: SSEHandlerConfig): (c: Context) => Promise<(Response & import("hono/dist/types/types.js").TypedResponse<{
    ok: false;
    error: {
        code: string;
        message: string;
    };
}, 400, "json">) | (Response & import("hono/dist/types/types.js").TypedResponse<{
    ok: true;
    payload: {
        sent: boolean;
        messageId?: string;
    };
}, import("hono/dist/types/utils/http-status.js").ContentfulStatusCode, "json">) | (Response & import("hono/dist/types/types.js").TypedResponse<{
    ok: false;
    error: {
        code: string;
        message: string;
    };
}, 500, "json">)>;
/**
 * GET /api/events — Server-pushed event stream (SSE).
 *
 * The client opens this long-lived connection to receive:
 *   - channel status changes
 *   - config reload notifications
 *   - cron execution results
 *   - any other server-initiated events
 *
 * Supports Last-Event-ID for reconnection.
 * Enforces maximum connection limit to prevent DoS.
 */
export declare function createEventsSSEHandler(config: SSEHandlerConfig): (c: Context) => Promise<Response>;
