import { buildBackendTargetKey } from '../backendTargets/backendTargetRef.js';
export function isProfileCompatibleWithBackendTarget(profile, target) {
    const targetKey = buildBackendTargetKey(target);
    const explicitByTargetKey = profile.compatibilityByTargetKey?.[targetKey];
    if (typeof explicitByTargetKey === 'boolean')
        return explicitByTargetKey;
    if (target.kind === 'builtInAgent') {
        const explicitLegacy = profile.compatibility?.[target.agentId];
        if (typeof explicitLegacy === 'boolean')
            return explicitLegacy;
    }
    return profile.isBuiltIn ? false : true;
}
export function isProfileCompatibleWithAgent(profile, agentId) {
    return isProfileCompatibleWithBackendTarget(profile, { kind: 'builtInAgent', agentId });
}
//# sourceMappingURL=profileCompatibility.js.map