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