import { ClientSharedApprovalDisplayService } from '../../../client-shared/services/approvals/index.js';
/**
 * Owns cli-v2 approval choices, labels, and terminal display formatting.
 */
export class PendingApprovalService {
    static resolveAvailableChoices(approval) {
        return [
            'approve',
            ...(approval.autopilotRootApproval ? ['trust_repo'] : []),
            ...(approval.rememberProjectApproval ? ['allow_project'] : []),
            'deny',
        ];
    }
    static resolveDecision(choice, approval) {
        if (choice === 'deny') {
            return { type: 'deny', reason: 'Denied in cli-v2' };
        }
        if (choice === 'allow_project' && approval.rememberProjectApproval) {
            return {
                type: 'approve_and_remember_project',
                reason: 'Approved and remembered for this project in cli-v2',
            };
        }
        if (choice === 'trust_repo' && approval.autopilotRootApproval) {
            return {
                type: 'approve_and_trust_autopilot_root',
                reason: `Approved and trusted ${approval.autopilotRootApproval.relativeRoot} for Auto in cli-v2`,
            };
        }
        return { type: 'approve', reason: 'Approved in cli-v2' };
    }
    static resolveInputDetail(input) {
        return ClientSharedApprovalDisplayService.resolveInputDetail(input);
    }
    static formatPayload(input, maxChars = 1200) {
        return ClientSharedApprovalDisplayService.formatPayload(input, maxChars);
    }
}
//# sourceMappingURL=pending-approval-service.js.map