import { ANTHROPIC_ALLOWED_FIELDS, ANTHROPIC_PARAMETERS_WRAPPER_ALLOW_KEYS, GEMINI_ALLOWED_FIELDS, OPENAI_CHAT_ALLOWED_FIELDS, OPENAI_CHAT_PARAMETERS_WRAPPER_ALLOW_KEYS, OPENAI_RESPONSES_ALLOWED_FIELDS, OPENAI_RESPONSES_PARAMETERS_WRAPPER_ALLOW_KEYS } from '../../protocol-field-allowlists.js';
import { resolveHubProtocolSpecWithNative } from '../../../router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js';
const ALLOWLISTS = {
    openaiChatAllowedFields: OPENAI_CHAT_ALLOWED_FIELDS,
    openaiChatParametersWrapperAllowKeys: OPENAI_CHAT_PARAMETERS_WRAPPER_ALLOW_KEYS,
    openaiResponsesAllowedFields: OPENAI_RESPONSES_ALLOWED_FIELDS,
    openaiResponsesParametersWrapperAllowKeys: OPENAI_RESPONSES_PARAMETERS_WRAPPER_ALLOW_KEYS,
    anthropicAllowedFields: ANTHROPIC_ALLOWED_FIELDS,
    anthropicParametersWrapperAllowKeys: ANTHROPIC_PARAMETERS_WRAPPER_ALLOW_KEYS,
    geminiAllowedFields: GEMINI_ALLOWED_FIELDS
};
function buildSpec(protocol) {
    return resolveHubProtocolSpecWithNative({
        protocol,
        allowlists: ALLOWLISTS
    });
}
export const HUB_PROTOCOL_SPECS = {
    'openai-chat': buildSpec('openai-chat'),
    'openai-responses': buildSpec('openai-responses'),
    'anthropic-messages': buildSpec('anthropic-messages'),
    'gemini-chat': buildSpec('gemini-chat')
};
export function resolveHubProtocolSpec(protocol) {
    const normalized = (protocol || '').trim().toLowerCase();
    return HUB_PROTOCOL_SPECS[normalized] ?? HUB_PROTOCOL_SPECS['openai-chat'];
}
