source dump of claude code
at main 35 lines 874 B view raw
1// Types extracted to src/types/permissions.ts to break import cycles 2import type { 3 PermissionAllowDecision, 4 PermissionAskDecision, 5 PermissionDecision, 6 PermissionDecisionReason, 7 PermissionDenyDecision, 8 PermissionMetadata, 9 PermissionResult, 10} from '../../types/permissions.js' 11 12// Re-export for backwards compatibility 13export type { 14 PermissionAllowDecision, 15 PermissionAskDecision, 16 PermissionDecision, 17 PermissionDecisionReason, 18 PermissionDenyDecision, 19 PermissionMetadata, 20 PermissionResult, 21} 22 23// Helper function to get the appropriate prose description for rule behavior 24export function getRuleBehaviorDescription( 25 permissionResult: PermissionResult['behavior'], 26): string { 27 switch (permissionResult) { 28 case 'allow': 29 return 'allowed' 30 case 'deny': 31 return 'denied' 32 default: 33 return 'asked for confirmation for' 34 } 35}