"use strict";
/**
 * Agent shim registry: lineage → shim implementation.
 * Each CLI lineage (anthropic, openai, google, xai) has a corresponding shim
 * that handles launch commands, prompt formatting, and cost estimation.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.localShim = exports.openrouterShim = exports.kimiShim = exports.opencodeShim = exports.grokShim = exports.geminiShim = exports.codexShim = exports.claudeShim = exports.antigravityShim = void 0;
exports.pickShimForVoice = pickShimForVoice;
exports.isHttpDispatchedShim = isHttpDispatchedShim;
const antigravity_js_1 = require("./antigravity.js");
Object.defineProperty(exports, "antigravityShim", { enumerable: true, get: function () { return antigravity_js_1.antigravityShim; } });
const claude_js_1 = require("./claude.js");
Object.defineProperty(exports, "claudeShim", { enumerable: true, get: function () { return claude_js_1.claudeShim; } });
const codex_js_1 = require("./codex.js");
Object.defineProperty(exports, "codexShim", { enumerable: true, get: function () { return codex_js_1.codexShim; } });
const gemini_js_1 = require("./gemini.js");
Object.defineProperty(exports, "geminiShim", { enumerable: true, get: function () { return gemini_js_1.geminiShim; } });
const grok_js_1 = require("./grok.js");
Object.defineProperty(exports, "grokShim", { enumerable: true, get: function () { return grok_js_1.grokShim; } });
const opencode_js_1 = require("./opencode.js");
Object.defineProperty(exports, "opencodeShim", { enumerable: true, get: function () { return opencode_js_1.opencodeShim; } });
const kimi_js_1 = require("./kimi.js");
Object.defineProperty(exports, "kimiShim", { enumerable: true, get: function () { return kimi_js_1.kimiShim; } });
const openrouter_js_1 = require("./openrouter.js");
Object.defineProperty(exports, "openrouterShim", { enumerable: true, get: function () { return openrouter_js_1.openrouterShim; } });
const local_js_1 = require("./local.js");
Object.defineProperty(exports, "localShim", { enumerable: true, get: function () { return local_js_1.localShim; } });
const SHIMS = {
    anthropic: claude_js_1.claudeShim,
    openai: codex_js_1.codexShim,
    google: gemini_js_1.geminiShim,
    opencode: opencode_js_1.opencodeShim,
    moonshot: kimi_js_1.kimiShim,
    openrouter: openrouter_js_1.openrouterShim,
    local: local_js_1.localShim,
    grok: grok_js_1.grokShim,
    antigravity: antigravity_js_1.antigravityShim,
    any: claude_js_1.claudeShim, // Fallback to Claude
};
const registry = {
    pickShim(lineage) {
        return SHIMS[lineage] ?? SHIMS.any;
    },
    listAvailable() {
        return Object.values(SHIMS);
    },
};
/**
 * Pick a shim taking the model id into account.
 *
 * - `openrouter:*` model ids → openrouterShim (HTTP, regardless of lineage)
 * - `local:*` model ids → localShim (HTTP, regardless of lineage)
 * - everything else → registry lookup by lineage
 *
 * Callers that have a model hint (runner doer + reviewer dispatch) should
 * use this; callers that don't (legacy paths) can keep using registry.pickShim.
 */
function pickShimForVoice(lineage, model) {
    if (model && model.startsWith('openrouter:'))
        return openrouter_js_1.openrouterShim;
    if (model && model.startsWith('local:'))
        return local_js_1.localShim;
    return registry.pickShim(lineage);
}
/** True when this voice should bypass CLI-credential precheck (HTTP-auth instead). */
function isHttpDispatchedShim(shim) {
    return shim === openrouter_js_1.openrouterShim || shim === local_js_1.localShim;
}
//# sourceMappingURL=index.js.map