'use server';
import { resolve } from '../../lib/server-container.js';
/** Permissions that grant direct push access to a repository. */
const PUSH_PERMISSIONS = new Set(['ADMIN', 'MAINTAIN', 'WRITE']);
export async function getViewerPermission(repoPath) {
    try {
        const service = resolve('IGitHubRepositoryService');
        const permission = await service.getViewerPermission(repoPath);
        return { canPushDirectly: PUSH_PERMISSIONS.has(permission) };
    }
    catch {
        return { canPushDirectly: false };
    }
}
