import type { TeamProtocolMessage } from '@levelcode/common/types/team-protocol';
import type { Logger } from '@levelcode/common/types/contracts/logger';
export interface InboxPollerConfig {
    teamName: string;
    agentName: string;
    pollIntervalMs?: number;
    logger: Logger;
}
export interface InboxPollResult {
    messages: TeamProtocolMessage[];
    formattedContent: string | null;
}
/**
 * InboxPoller continuously polls an agent's inbox file for new messages
 * and provides them in a format suitable for injection into the agent's
 * next prompt turn.
 *
 * Usage:
 *   const poller = new InboxPoller({ teamName, agentName, logger })
 *   poller.start()
 *   // Between agent turns:
 *   const result = poller.drain()
 *   if (result.formattedContent) {
 *     // inject into message history
 *   }
 *   // When agent shuts down:
 *   poller.stop()
 */
export declare class InboxPoller {
    private teamName;
    private agentName;
    private pollIntervalMs;
    private logger;
    private timer;
    private pendingMessages;
    private running;
    constructor(config: InboxPollerConfig);
    /**
     * Start polling the inbox file at the configured interval.
     */
    start(): void;
    /**
     * Stop polling.
     */
    stop(): void;
    /**
     * Poll the inbox once and accumulate any new messages.
     * Messages are read from the filesystem and the inbox is cleared
     * after reading to prevent duplicate delivery.
     */
    private poll;
    /**
     * Drain all accumulated pending messages and return them.
     * After calling drain(), the internal buffer is cleared.
     * Returns both the raw messages and a formatted string suitable
     * for injection into the agent's message history.
     */
    drain(): InboxPollResult;
    /**
     * Check if there are any pending messages without draining them.
     */
    hasPendingMessages(): boolean;
    /**
     * Force an immediate poll (useful before draining between turns).
     */
    pollNow(): void;
    /**
     * Returns whether the poller is currently running.
     */
    isRunning(): boolean;
}
/**
 * One-shot convenience function: reads the inbox, formats messages,
 * clears the inbox, and returns the result. Useful when you don't need
 * continuous background polling and just want to check between turns.
 */
export declare function drainInbox(params: {
    teamName: string;
    agentName: string;
    logger: Logger;
}): InboxPollResult;
