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