// ===== Registry Implementation Helpers =====
/**
 * Base class for adapter factories (optional helper)
 */
export class BaseAdapterFactory {
    metadata;
    constructor(metadata) {
        this.metadata = metadata;
    }
    getMetadata() {
        return this.metadata;
    }
    async validate() {
        // Default validation - can be overridden
        return {
            valid: true,
            errors: [],
            warnings: []
        };
    }
}
// ===== Error Types =====
/**
 * Error thrown when requested adapter is not found
 */
export class AdapterNotFoundError extends Error {
    language;
    availableLanguages;
    constructor(language, availableLanguages) {
        super(`No debug adapter registered for language: ${language}. Available: ${availableLanguages.join(', ')}`);
        this.language = language;
        this.availableLanguages = availableLanguages;
        this.name = 'AdapterNotFoundError';
    }
}
/**
 * Error thrown when factory validation fails
 */
export class FactoryValidationError extends Error {
    language;
    validationResult;
    constructor(language, validationResult) {
        super(`Adapter factory validation failed for ${language}: ${validationResult.errors.join(', ')}`);
        this.language = language;
        this.validationResult = validationResult;
        this.name = 'FactoryValidationError';
    }
}
/**
 * Error thrown when trying to register duplicate language
 */
export class DuplicateRegistrationError extends Error {
    language;
    constructor(language) {
        super(`Adapter already registered for language: ${language}`);
        this.language = language;
        this.name = 'DuplicateRegistrationError';
    }
}
// ===== Type Guards =====
/**
 * Check if an object implements IAdapterFactory
 */
export function isAdapterFactory(obj) {
    return (typeof obj === 'object' &&
        obj !== null &&
        'createAdapter' in obj &&
        'getMetadata' in obj &&
        'validate' in obj);
}
/**
 * Check if an object implements IAdapterRegistry
 */
export function isAdapterRegistry(obj) {
    return (typeof obj === 'object' &&
        obj !== null &&
        'register' in obj &&
        'create' in obj &&
        'getSupportedLanguages' in obj);
}
//# sourceMappingURL=adapter-registry-interface.js.map