'use server';
import { resolve } from '../../lib/server-container.js';
export async function listCycles(projectId) {
    if (!projectId?.trim()) {
        return { error: 'Project ID is required' };
    }
    try {
        const useCase = resolve('ListCyclesUseCase');
        const cycles = await useCase.execute(projectId);
        return { cycles };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to list cycles';
        return { error: message };
    }
}
