/**
 * buildDetectStatusFromAcp
 *
 * Turns a declarative `acp/session-protocol@1` block into a runtime
 * `(input: AcpStatusInput) => 'idle' | 'generating' | 'waiting_approval' | null`
 * function.
 *
 * Dispatch order:
 *   1. Not connected → null (no information available).
 *   2. Error patterns — checked first; first match returns the declared verdict.
 *   3. Generating pattern — `generating`.
 *   4. Idle pattern — `idle`.
 *   5. Default: `null` (no change — caller preserves last known status).
 *
 * All regex patterns are compiled once at builder time so the returned
 * detector function is allocation-free on the hot path.
 */
interface AcpRegexPatternSpec {
    regex: string;
    flags?: string;
    description?: string;
}
interface AcpErrorPatternSpec extends AcpRegexPatternSpec {
    verdict: 'idle' | 'generating' | 'waiting_approval';
}
export interface AcpSessionSpec {
    $schema?: 'adhdev:acp/session-protocol@1';
    /** Pattern that matches a line emitted when the agent is idle/ready. */
    idlePattern?: AcpRegexPatternSpec;
    /** Pattern that matches a line emitted while the agent is actively working. */
    generatingPattern?: AcpRegexPatternSpec;
    /**
     * Error/edge-case patterns. Checked in order; first match returns the
     * declared verdict. Useful for approval prompts, fatal errors, etc.
     */
    errorPatterns?: AcpErrorPatternSpec[];
    /** Wire format; informational only at the builder level — regex matching
     *  is identical regardless of promptStyle. */
    promptStyle?: 'json-rpc' | 'plain-text' | 'mcp';
    /** Message delimiter used to split incoming bytes (default: newline). */
    messageDelimiter?: string;
}
export interface AcpStatusInput {
    /** The most recently received line from the stdio stream. */
    lastLine: string;
    /**
     * A sliding window of recent output lines (newest last).
     * Builders may check these when a single line is not enough for context.
     */
    recentLines: string[];
    /** Whether the ACP process is currently connected and running. */
    isConnected: boolean;
}
export type AcpDetectedStatus = 'idle' | 'generating' | 'waiting_approval' | null;
interface CompiledAcpSpec {
    idle: RegExp | null;
    generating: RegExp | null;
    errors: Array<{
        re: RegExp;
        verdict: AcpDetectedStatus;
    }>;
}
declare function compileSpec(spec: AcpSessionSpec): CompiledAcpSpec;
export declare function buildDetectStatusFromAcp(spec: AcpSessionSpec): (input: AcpStatusInput) => AcpDetectedStatus;
export declare const __internal: {
    compileSpec: typeof compileSpec;
};
export {};
