'use server';
import { resolve } from '../../lib/server-container.js';
export async function globalSearch(query) {
    if (!query?.trim()) {
        return { results: [] };
    }
    try {
        const useCase = resolve('GlobalSearchUseCase');
        const results = await useCase.execute(query);
        return { results };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Search failed';
        return { error: message };
    }
}
