/**
 * LocalTransport — In-process SQLite transport for fully offline agent messaging.
 *
 * Reads and writes messages directly to conduit.db via node:sqlite.
 * No network calls. Works fully offline. Messages are stored in the
 * project-local conduit.db (ADR-037), keeping agent messaging isolated
 * from the global-identity signaldock.db.
 *
 * Priority: LocalTransport is preferred over HttpTransport when
 * conduit.db is available (see factory.ts).
 *
 * @see docs/specs/SIGNALDOCK-UNIFIED-AGENT-REGISTRY.md Section 4.4
 * @task T213
 * @task T356
 * @epic T310
 */
import type { ConduitMessage, Transport, TransportConnectConfig } from '@cleocode/contracts';
/** In-process SQLite transport for fully offline agent messaging. */
export declare class LocalTransport implements Transport {
    readonly name = "local";
    private state;
    /**
     * Connect to conduit.db for in-process messaging.
     *
     * Opens the database, sets WAL mode pragmas, and verifies
     * the messages table exists. Throws if conduit.db is missing
     * or uninitialized (run `cleo init` first).
     *
     * @task T356
     * @epic T310
     */
    connect(config: TransportConnectConfig): Promise<void>;
    /** Close the database connection and stop any subscriber polling. */
    disconnect(): Promise<void>;
    /**
     * Store a message in conduit.db.
     *
     * Inserts into the messages table with status 'pending'.
     * For conversation messages, also links via conversation_participants
     * if not already present.
     */
    push(to: string, content: string, options?: {
        conversationId?: string;
        replyTo?: string;
    }): Promise<{
        messageId: string;
    }>;
    /**
     * Poll for messages addressed to this agent.
     *
     * Returns messages with status 'pending' where to_agent_id matches
     * the connected agent. Messages are returned oldest-first.
     */
    poll(options?: {
        limit?: number;
        since?: string;
    }): Promise<ConduitMessage[]>;
    /**
     * Acknowledge messages by marking them as 'delivered'.
     *
     * Updates the status and delivered_at timestamp for each message ID.
     */
    ack(messageIds: string[]): Promise<void>;
    /**
     * Subscribe to real-time local messages.
     *
     * Since this is in-process, subscribers are notified synchronously
     * when push() is called. Additionally, a polling interval checks
     * for messages inserted by other processes (e.g., Rust CLI).
     *
     * @returns Unsubscribe function.
     */
    subscribe(handler: (message: ConduitMessage) => void): () => void;
    /**
     * Check whether conduit.db is available for local transport.
     *
     * Used by factory.ts to decide whether to use LocalTransport.
     *
     * @task T356
     * @epic T310
     * @param cwd - Optional working directory override (defaults to process.cwd()).
     * @returns `true` if conduit.db exists at the expected path.
     */
    static isAvailable(cwd?: string): boolean;
    /** Poll for new messages and notify subscribers (cross-process sync). */
    private pollAndNotify;
    /** Notify all active subscribers of a new message. */
    private notifySubscribers;
    /**
     * Ensure a DM conversation exists between two agents.
     *
     * Conversations store participants as a comma-separated TEXT field.
     * We search for existing private conversations containing both agents.
     *
     * @returns The conversation ID.
     */
    private ensureDmConversation;
    /** Throw if not connected. */
    private ensureConnected;
}
//# sourceMappingURL=local-transport.d.ts.map