/**
 * AI Model Registry
 * Manages AI model inventory, versioning, and risk classification
 * Vorion Security Platform
 */
import { EventEmitter } from 'events';
import { AIModelMetadata, RiskLevel, DeploymentStatus, DataClassification, TrainingDataInfo } from './types';
/**
 * Model registration options
 */
export interface ModelRegistrationOptions {
    id: string;
    name: string;
    provider: string;
    version: string;
    capabilities?: string[];
    riskLevel?: RiskLevel;
    dataCategories?: string[];
    description?: string;
    owner?: string;
    team?: string;
    tags?: string[];
    endpoints?: string[];
    maxTokens?: number;
    costPerToken?: number;
    deploymentStatus?: DeploymentStatus;
    complianceFrameworks?: string[];
    dataSensitivity?: DataClassification;
    retentionPolicy?: string;
    modelType?: AIModelMetadata['modelType'];
    trainingDataInfo?: TrainingDataInfo;
}
/**
 * Model search criteria
 */
export interface ModelSearchCriteria {
    provider?: string;
    riskLevel?: RiskLevel | RiskLevel[];
    deploymentStatus?: DeploymentStatus | DeploymentStatus[];
    dataSensitivity?: DataClassification | DataClassification[];
    capabilities?: string[];
    tags?: string[];
    owner?: string;
    team?: string;
    modelType?: AIModelMetadata['modelType'];
}
/**
 * Model version history entry
 */
export interface ModelVersionEntry {
    version: string;
    registeredAt: Date;
    registeredBy: string;
    changes: string[];
    metadata: Partial<AIModelMetadata>;
    deprecated: boolean;
    deprecatedAt?: Date;
    deprecationReason?: string;
}
/**
 * Risk assessment result
 */
export interface RiskAssessmentResult {
    modelId: string;
    assessedAt: Date;
    assessedBy: string;
    riskLevel: RiskLevel;
    riskScore: number;
    factors: RiskFactor[];
    recommendations: string[];
    nextReviewDate: Date;
}
/**
 * Risk factor
 */
export interface RiskFactor {
    category: string;
    factor: string;
    weight: number;
    score: number;
    description: string;
}
/**
 * Storage interface for model registry persistence
 */
export interface ModelRegistryStorage {
    save(model: AIModelMetadata): Promise<void>;
    get(modelId: string): Promise<AIModelMetadata | null>;
    delete(modelId: string): Promise<void>;
    list(): Promise<AIModelMetadata[]>;
    search(criteria: ModelSearchCriteria): Promise<AIModelMetadata[]>;
    saveVersionHistory(modelId: string, versions: ModelVersionEntry[]): Promise<void>;
    getVersionHistory(modelId: string): Promise<ModelVersionEntry[]>;
    saveRiskAssessment(assessment: RiskAssessmentResult): Promise<void>;
    getRiskAssessments(modelId: string): Promise<RiskAssessmentResult[]>;
}
/**
 * In-memory storage implementation
 */
export declare class InMemoryModelRegistryStorage implements ModelRegistryStorage {
    private models;
    private versionHistory;
    private riskAssessments;
    save(model: AIModelMetadata): Promise<void>;
    get(modelId: string): Promise<AIModelMetadata | null>;
    delete(modelId: string): Promise<void>;
    list(): Promise<AIModelMetadata[]>;
    search(criteria: ModelSearchCriteria): Promise<AIModelMetadata[]>;
    saveVersionHistory(modelId: string, versions: ModelVersionEntry[]): Promise<void>;
    getVersionHistory(modelId: string): Promise<ModelVersionEntry[]>;
    saveRiskAssessment(assessment: RiskAssessmentResult): Promise<void>;
    getRiskAssessments(modelId: string): Promise<RiskAssessmentResult[]>;
}
/**
 * AI Model Registry
 * Central repository for AI model inventory and management
 */
export declare class ModelRegistry extends EventEmitter {
    private storage;
    private riskWeights;
    constructor(storage?: ModelRegistryStorage);
    /**
     * Initialize default risk weights for assessment
     */
    private initializeRiskWeights;
    /**
     * Register a new AI model
     */
    registerModel(options: ModelRegistrationOptions, registeredBy: string): Promise<AIModelMetadata>;
    /**
     * Update an existing model
     */
    updateModel(modelId: string, updates: Partial<Omit<AIModelMetadata, 'id' | 'deployedAt'>>, updatedBy: string, changeDescription: string[]): Promise<AIModelMetadata>;
    /**
     * Get a model by ID
     */
    getModel(modelId: string): Promise<AIModelMetadata | null>;
    /**
     * List all models
     */
    listModels(): Promise<AIModelMetadata[]>;
    /**
     * Search models by criteria
     */
    searchModels(criteria: ModelSearchCriteria): Promise<AIModelMetadata[]>;
    /**
     * Get version history for a model
     */
    getVersionHistory(modelId: string): Promise<ModelVersionEntry[]>;
    /**
     * Deprecate a model version
     */
    deprecateVersion(modelId: string, version: string, reason: string, deprecatedBy: string): Promise<void>;
    /**
     * Update deployment status
     */
    updateDeploymentStatus(modelId: string, status: DeploymentStatus, updatedBy: string): Promise<AIModelMetadata>;
    /**
     * Perform risk assessment for a model
     */
    assessRisk(modelId: string, assessedBy: string): Promise<RiskAssessmentResult>;
    /**
     * Get risk assessments for a model
     */
    getRiskAssessments(modelId: string): Promise<RiskAssessmentResult[]>;
    /**
     * Mark model as audited
     */
    markAudited(modelId: string, auditedBy: string): Promise<AIModelMetadata>;
    /**
     * Get models requiring audit
     */
    getModelsRequiringAudit(maxDaysSinceAudit?: number): Promise<AIModelMetadata[]>;
    /**
     * Get high-risk models
     */
    getHighRiskModels(): Promise<AIModelMetadata[]>;
    /**
     * Calculate data sensitivity score (0-1)
     */
    private calculateDataSensitivityScore;
    /**
     * Calculate PII handling score (0-1)
     */
    private calculatePIIScore;
    /**
     * Calculate external access score (0-1)
     */
    private calculateExternalAccessScore;
    /**
     * Calculate complexity score (0-1)
     */
    private calculateComplexityScore;
    /**
     * Calculate audit coverage score (0-1)
     */
    private calculateAuditCoverageScore;
    /**
     * Calculate compliance score (0-1)
     */
    private calculateComplianceScore;
    /**
     * Convert score to risk level
     */
    private scoreToRiskLevel;
    /**
     * Calculate next review date based on risk level
     */
    private calculateNextReviewDate;
    /**
     * Generate risk recommendations
     */
    private generateRiskRecommendations;
    /**
     * Export model inventory for compliance
     */
    exportInventory(): Promise<{
        exportedAt: Date;
        modelCount: number;
        models: AIModelMetadata[];
        summary: {
            byRiskLevel: Record<RiskLevel, number>;
            byStatus: Record<DeploymentStatus, number>;
            byProvider: Record<string, number>;
        };
    }>;
}
export default ModelRegistry;
//# sourceMappingURL=model-registry.d.ts.map