export interface GuardrailRule {
    name: string;
    description?: string;
    check: (context: GuardrailContext) => GuardrailViolation[];
    streaming?: boolean;
    severity?: "warning" | "error" | "fatal";
    recoverable?: boolean;
}
export interface GuardrailContext {
    content: string;
    checkpoint?: string;
    delta?: string;
    tokenCount: number;
    completed: boolean;
    metadata?: Record<string, any>;
    previousViolations?: GuardrailViolation[];
}
export interface GuardrailViolation {
    rule: string;
    message: string;
    severity: "warning" | "error" | "fatal";
    position?: number;
    recoverable: boolean;
    timestamp?: number;
    context?: Record<string, any>;
    suggestion?: string;
}
export interface GuardrailState {
    violations: GuardrailViolation[];
    violationsByRule: Map<string, GuardrailViolation[]>;
    hasFatalViolations: boolean;
    hasErrorViolations: boolean;
    violationCount: number;
    lastCheckTime?: number;
}
export interface GuardrailConfig {
    rules: GuardrailRule[];
    stopOnFatal?: boolean;
    enableStreaming?: boolean;
    checkInterval?: number;
    onViolation?: (violation: GuardrailViolation) => void;
    onPhaseStart?: (phase: "pre" | "post", ruleCount: number, tokenCount: number) => void;
    onPhaseEnd?: (phase: "pre" | "post", passed: boolean, violations: GuardrailViolation[], durationMs: number) => void;
    onRuleStart?: (index: number, ruleId: string, callbackId: string) => void;
    onRuleEnd?: (index: number, ruleId: string, passed: boolean, callbackId: string, durationMs: number) => void;
}
export interface GuardrailResult {
    passed: boolean;
    violations: GuardrailViolation[];
    shouldRetry: boolean;
    shouldHalt: boolean;
    summary: {
        total: number;
        fatal: number;
        errors: number;
        warnings: number;
    };
}
export interface JsonStructure {
    openBraces: number;
    closeBraces: number;
    openBrackets: number;
    closeBrackets: number;
    inString: boolean;
    isBalanced: boolean;
    issues: string[];
}
export interface MarkdownStructure {
    openFences: number;
    fenceLanguages: string[];
    inFence: boolean;
    headers: number[];
    listDepth: number;
    issues: string[];
}
export interface LatexStructure {
    openEnvironments: string[];
    isBalanced: boolean;
    issues: string[];
}
export interface PatternConfig {
    patterns: Array<string | RegExp>;
    isBadPattern: boolean;
    message?: string;
    fatal?: boolean;
}
export interface DriftConfig {
    detectToneShift?: boolean;
    detectMetaCommentary?: boolean;
    detectRepetition?: boolean;
    detectEntropySpike?: boolean;
    entropyThreshold?: number;
    repetitionThreshold?: number;
}
export interface FunctionCallStructure {
    name?: string;
    arguments?: string;
    parsedArguments?: Record<string, any>;
    isValid: boolean;
    errors: string[];
}
export interface SchemaValidation {
    valid: boolean;
    errors: string[];
    parsed?: any;
}
//# sourceMappingURL=guardrails.d.ts.map