π File detail
utils/permissions/PermissionResult.ts
π§© .tsπ 36 linesπΎ 874 bytesπ text
β Back to All Filesπ― Use case
This file lives under βutils/β, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, β¦). On the API surface it exposes getRuleBehaviorDescription β mainly functions, hooks, or classes. It composes internal code from types (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
// Types extracted to src/types/permissions.ts to break import cycles import type { PermissionAllowDecision, PermissionAskDecision, PermissionDecision,
π€ Exports (heuristic)
getRuleBehaviorDescription
π₯οΈ Source preview
// Types extracted to src/types/permissions.ts to break import cycles
import type {
PermissionAllowDecision,
PermissionAskDecision,
PermissionDecision,
PermissionDecisionReason,
PermissionDenyDecision,
PermissionMetadata,
PermissionResult,
} from '../../types/permissions.js'
// Re-export for backwards compatibility
export type {
PermissionAllowDecision,
PermissionAskDecision,
PermissionDecision,
PermissionDecisionReason,
PermissionDenyDecision,
PermissionMetadata,
PermissionResult,
}
// Helper function to get the appropriate prose description for rule behavior
export function getRuleBehaviorDescription(
permissionResult: PermissionResult['behavior'],
): string {
switch (permissionResult) {
case 'allow':
return 'allowed'
case 'deny':
return 'denied'
default:
return 'asked for confirmation for'
}
}