"use strict";
// =============================================================================
// Pure Agent - Transport Registry
// Ported from Hermes agent/transports/__init__.py
// =============================================================================
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerTransport = registerTransport;
exports.getTransport = getTransport;
exports.hasTransport = hasTransport;
const logger_1 = require("../logger");
const _registry = new Map();
let _discovered = false;
function registerTransport(apiMode, factory) {
    _registry.set(apiMode, factory);
    (0, logger_1.getLogger)().debug(`Registered transport: ${apiMode}`);
}
function getTransport(apiMode) {
    if (!_discovered) {
        discoverTransports();
    }
    const factory = _registry.get(apiMode);
    if (!factory)
        return null;
    return factory();
}
function hasTransport(apiMode) {
    if (!_discovered)
        discoverTransports();
    return _registry.has(apiMode);
}
function discoverTransports() {
    _discovered = true;
    // Import transport modules - each calls registerTransport at module level
    require('./chat-completions');
    require('./anthropic');
    (0, logger_1.getLogger)().info(`Discovered ${_registry.size} transports`);
}
//# sourceMappingURL=registry.js.map