'use server';
import { resolve } from '../../lib/server-container.js';
export async function syncRepository(repositoryId) {
    if (!repositoryId?.trim()) {
        return { success: false, error: 'Repository id is required' };
    }
    try {
        const useCase = resolve('SyncRepositoryMainUseCase');
        await useCase.execute(repositoryId);
        return { success: true };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to sync repository';
        return { success: false, error: message };
    }
}
