"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRuntime = createRuntime;
const LocalRuntime_1 = require("./LocalRuntime");
const SSHRuntime_1 = require("./SSHRuntime");
/**
 * Create a Runtime instance based on the configuration
 */
function createRuntime(config) {
    switch (config.type) {
        case "local":
            return new LocalRuntime_1.LocalRuntime(config.srcBaseDir);
        case "ssh":
            return new SSHRuntime_1.SSHRuntime({
                host: config.host,
                srcBaseDir: config.srcBaseDir,
                identityFile: config.identityFile,
                port: config.port,
            });
        default: {
            const unknownConfig = config;
            throw new Error(`Unknown runtime type: ${unknownConfig.type ?? "undefined"}`);
        }
    }
}
//# sourceMappingURL=runtimeFactory.js.map