"use strict";
// src/orchestrator/rag/EmbeddingRegistry.ts
// v1.13.0 — Embedding provider resolver.
//
// Mirrors src/memory/MemoryProviderRegistry.ts: read
// OPENLIFE_EMBEDDING_PROVIDER (default 'ollama'), construct lazily.
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmbeddingRegistry = void 0;
const VALID = new Set(['ollama', 'openai']);
class EmbeddingRegistry {
    static selectName() {
        const raw = (process.env.OPENLIFE_EMBEDDING_PROVIDER || 'ollama').toLowerCase().trim();
        if (VALID.has(raw))
            return raw;
        if (raw !== 'ollama') {
            console.warn(`[EMBED-REGISTRY] OPENLIFE_EMBEDDING_PROVIDER="${raw}" não reconhecido — caindo pra 'ollama'.`);
        }
        return 'ollama';
    }
    static create(name) {
        const which = name || EmbeddingRegistry.selectName();
        if (which === 'openai') {
            const { OpenAIEmbeddingProvider } = require('./OpenAIEmbeddingProvider');
            return new OpenAIEmbeddingProvider();
        }
        const { OllamaEmbeddingProvider } = require('./OllamaEmbeddingProvider');
        return new OllamaEmbeddingProvider();
    }
}
exports.EmbeddingRegistry = EmbeddingRegistry;
