'use server';
import { resolve } from '../../lib/server-container.js';
export async function connectGithubAction(token) {
    try {
        const useCase = resolve('ConnectGithubUseCase');
        const { login } = await useCase.execute({ token });
        return { success: true, login };
    }
    catch (error) {
        return { success: false, error: error instanceof Error ? error.message : String(error) };
    }
}
export async function disconnectGithubAction() {
    try {
        const useCase = resolve('DisconnectGithubUseCase');
        await useCase.execute();
        return { success: true };
    }
    catch (error) {
        return { success: false, error: error instanceof Error ? error.message : String(error) };
    }
}
export async function getGithubStatusAction() {
    const useCase = resolve('GetGithubIntegrationStatusUseCase');
    return useCase.execute();
}
