import { buildMissingDiarizationProviderMessage, resolveDiarizationProviderOrder, } from "../../../transcription/whisper.js";
import { buildMissingTranscriptionProviderNote } from "../../../transcription/whisper/provider-setup.js";
import { resolveTranscriptionAvailability, } from "./transcription-start.js";
export async function resolveTranscriptProviderCapabilities({ transcription, ytDlpPath, diarization = null, }) {
    const availability = await resolveTranscriptionAvailability({ transcription });
    const diarizationProviders = diarization
        ? resolveDiarizationProviderOrder({
            preference: diarization,
            elevenlabsApiKey: transcription.elevenlabsApiKey,
            openaiApiKey: transcription.openaiApiKey,
        })
        : [];
    const canTranscribe = diarization ? diarizationProviders.length > 0 : availability.hasAnyProvider;
    return {
        availability,
        canTranscribe,
        canRunYtDlp: Boolean(ytDlpPath && canTranscribe),
        missingProviderNote: diarization
            ? buildMissingDiarizationProviderMessage(diarization)
            : buildMissingTranscriptionProviderNote(),
    };
}
export function buildMissingTranscriptionProviderResult(args) {
    const notes = args.notes?.filter((note) => note.trim().length > 0) ?? [];
    return {
        text: null,
        source: null,
        attemptedProviders: args.attemptedProviders,
        metadata: args.metadata,
        notes: [buildMissingTranscriptionProviderNote(), ...notes].join("; "),
    };
}
//# sourceMappingURL=transcription-capability.js.map