'use server';
import { resolve } from '../../lib/server-container.js';
export async function getAiCycleSummary(cycleId) {
    try {
        const useCase = resolve('GetAiCycleSummaryUseCase');
        const result = await useCase.execute({ cycleId });
        if (!result.ok)
            return { error: result.error };
        return { summary: result.summary };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to get cycle summary';
        return { error: message };
    }
}
export async function getAiProjectHealth(projectId) {
    try {
        const useCase = resolve('GetAiProjectHealthUseCase');
        const result = await useCase.execute({ projectId });
        if (!result.ok)
            return { error: result.error };
        return { health: result.health };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to get project health';
        return { error: message };
    }
}
