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