"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmbeddingsService = void 0;
class EmbeddingsService {
    resolvers = new Map();
    registerResolver(remoteType, resolver) {
        this.resolvers.set(remoteType, resolver);
    }
    hasResolver(remoteType) {
        return this.resolvers.has(remoteType);
    }
    async download(remoteType, remote, filePath, destinationPath) {
        const resolver = this.resolvers.get(remoteType);
        if (!resolver) {
            throw new Error(`No resolver registered for remoteType: "${remoteType}". ` +
                `Install and configure the appropriate knowhow module (e.g. @tyvm/knowhow-module-github).`);
        }
        await resolver.download(remote, filePath, destinationPath);
    }
    async upload(remoteType, localPath, remote, remoteKey) {
        const resolver = this.resolvers.get(remoteType);
        if (!resolver) {
            throw new Error(`No resolver registered for remoteType: "${remoteType}". ` +
                `Install and configure the appropriate knowhow module (e.g. @tyvm/knowhow-module-s3).`);
        }
        if (!resolver.upload) {
            throw new Error(`Resolver for remoteType: "${remoteType}" does not support uploads.`);
        }
        await resolver.upload(localPath, remote, remoteKey);
    }
}
exports.EmbeddingsService = EmbeddingsService;
//# sourceMappingURL=EmbeddingsService.js.map