'use server';
import { resolve } from '../../lib/server-container.js';
export async function createWorkItem(input) {
    try {
        const useCase = resolve('CreateWorkItemUseCase');
        const result = await useCase.execute(input);
        if (!result.ok)
            return { error: result.error };
        return { workItem: result.workItem };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to create work item';
        return { error: message };
    }
}
