export function isContextualSummarizerEnabled() {
    return process.env.TUBEROSA_CONTEXTUAL_PREFIX_LLM === 'true';
}
export async function summarizeAtomContext(provider, atom, sourceUri) {
    if (!isContextualSummarizerEnabled()) {
        return undefined;
    }
    if (typeof provider.summarizeSection !== 'function') {
        return undefined;
    }
    const text = await provider.summarizeSection({
        sectionPath: atom.sectionPath,
        content: atom.content,
        sourceUri,
    });
    if (!text || text.trim().length === 0) {
        return undefined;
    }
    return { text: text.trim(), source: 'provider' };
}
