'use server';
import { resolve } from '../../lib/server-container.js';
export async function getWorkItem(identifier) {
    if (!identifier?.trim()) {
        return { error: 'Work item identifier is required' };
    }
    try {
        const useCase = resolve('GetWorkItemUseCase');
        const result = await useCase.execute(identifier);
        if (!result.ok)
            return { error: result.error };
        return { workItem: result.workItem };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to get work item';
        return { error: message };
    }
}
