import type { MastraMessageV2 } from '../../agent/message-list/index.js';
import type { MastraLanguageModel } from '../../llm/model/shared.types.js';
import type { ChunkType } from '../../stream/index.js';
import type { Processor } from '../index.js';
/**
 * Confidence scores for each moderation category (0-1)
 */
export interface ModerationCategoryScores {
    hate?: number;
    'hate/threatening'?: number;
    harassment?: number;
    'harassment/threatening'?: number;
    'self-harm'?: number;
    'self-harm/intent'?: number;
    'self-harm/instructions'?: number;
    sexual?: number;
    'sexual/minors'?: number;
    violence?: number;
    'violence/graphic'?: number;
    [customCategory: string]: number | undefined;
}
/**
 * Result structure for moderation
 */
export interface ModerationResult {
    category_scores?: ModerationCategoryScores;
    reason?: string;
}
/**
 * Configuration options for ModerationInputProcessor
 */
export interface ModerationOptions {
    /** Model configuration for the moderation agent */
    model: MastraLanguageModel;
    /**
     * Categories to check for moderation.
     * If not specified, uses default OpenAI categories.
     */
    categories?: string[];
    /**
     * Confidence threshold for flagging (0-1, default: 0.5)
     * Content is flagged if any category score exceeds this threshold
     */
    threshold?: number;
    /**
     * Strategy when content is flagged:
     * - 'block': Reject the entire input with an error (default)
     * - 'warn': Log warning but allow content through
     * - 'filter': Remove flagged messages but continue with remaining
     */
    strategy?: 'block' | 'warn' | 'filter';
    /**
     * Custom moderation instructions for the agent
     * If not provided, uses default instructions based on categories
     */
    instructions?: string;
    /**
     * Whether to include confidence scores in logs (default: false)
     * Useful for tuning thresholds and debugging
     */
    includeScores?: boolean;
    /**
     * Number of previous chunks to include for context when moderating stream chunks.
     * If set to 1, includes the previous part. If set to 2, includes the two previous chunks, etc.
     * Default: 0 (no context window)
     */
    chunkWindow?: number;
}
/**
 * ModerationInputProcessor uses an internal Mastra agent to evaluate content
 * against configurable moderation categories for content safety.
 *
 * Provides flexible moderation with custom categories, thresholds, and strategies
 * while maintaining compatibility with OpenAI's moderation API structure.
 */
export declare class ModerationProcessor implements Processor {
    readonly name = "moderation";
    private moderationAgent;
    private categories;
    private threshold;
    private strategy;
    private includeScores;
    private chunkWindow;
    private static readonly DEFAULT_CATEGORIES;
    constructor(options: ModerationOptions);
    processInput(args: {
        messages: MastraMessageV2[];
        abort: (reason?: string) => never;
    }): Promise<MastraMessageV2[]>;
    processOutputResult(args: {
        messages: MastraMessageV2[];
        abort: (reason?: string) => never;
    }): Promise<MastraMessageV2[]>;
    processOutputStream(args: {
        part: ChunkType;
        streamParts: ChunkType[];
        state: Record<string, any>;
        abort: (reason?: string) => never;
    }): Promise<ChunkType | null | undefined>;
    /**
     * Moderate content using the internal agent
     */
    private moderateContent;
    /**
     * Determine if content is flagged based on category scores above threshold
     */
    private isModerationFlagged;
    /**
     * Handle flagged content based on strategy
     */
    private handleFlaggedContent;
    /**
     * Extract text content from message for moderation
     */
    private extractTextContent;
    /**
     * Create default moderation instructions
     */
    private createDefaultInstructions;
    /**
     * Create moderation prompt for the agent
     */
    private createModerationPrompt;
    /**
     * Build context string from chunks based on chunkWindow
     * streamParts includes the current part
     */
    private buildContextFromChunks;
}
//# sourceMappingURL=moderation.d.ts.map