'use server';
import { resolve } from '../../lib/server-container.js';
export async function adoptBranch(input) {
    const { branchName, repositoryPath } = input;
    if (!branchName?.trim()) {
        return { error: 'Branch name is required' };
    }
    if (!repositoryPath?.trim()) {
        return { error: 'Repository path is required' };
    }
    try {
        const useCase = resolve('AdoptBranchUseCase');
        const result = await useCase.execute({ branchName, repositoryPath });
        return { feature: result.feature };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to adopt branch';
        return { error: message };
    }
}
