/**
 * Phonecall MCP API credentials.
 *
 * Three tiers, highest priority first:
 *   1. Per-agent bundle — reserved (currently unused; symmetry with the
 *      other credential modules).
 *   2. Shared in-memory heartbeat cache (`sharedKeys.phonecallApiKey`).
 *   3. Local `config.phonecallApiKey` — manual fallback. The heartbeat
 *      shared-keys path seeds this on first delivery but never overwrites
 *      an existing value.
 */
let bundlePhonecallApiKey;
let sharedPhonecallApiKey;
export function setBundlePhonecallApiKey(apiKey) {
    if (bundlePhonecallApiKey === apiKey)
        return false;
    bundlePhonecallApiKey = apiKey;
    return true;
}
export function setSharedPhonecallApiKey(apiKey) {
    if (sharedPhonecallApiKey === apiKey)
        return false;
    sharedPhonecallApiKey = apiKey;
    return true;
}
/**
 * Resolve the Phonecall MCP API key to use.
 *
 * Precedence: per-agent bundle > shared cache > local config (offline cache).
 */
export function resolvePhonecallApiKey(config) {
    return bundlePhonecallApiKey ?? sharedPhonecallApiKey ?? config.phonecallApiKey;
}
//# sourceMappingURL=phonecall-credentials.js.map