'use server';
import { resolve } from '../../lib/server-container.js';
export async function addRepository(input) {
    const { path, name } = input;
    if (!path?.trim()) {
        return { error: 'path is required' };
    }
    try {
        const addRepoUseCase = resolve('AddRepositoryUseCase');
        const repository = await addRepoUseCase.execute({ path, name });
        return { repository };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to add repository';
        return { error: message };
    }
}
