( command: string, config: Config, )
| 446 | * @returns An object with 'allowed' boolean and optional 'reason' string if not allowed. |
| 447 | */ |
| 448 | export function isCommandAllowed( |
| 449 | command: string, |
| 450 | config: Config, |
| 451 | ): { allowed: boolean; reason?: string } { |
| 452 | // By not providing a sessionAllowlist, we invoke "default allow" behavior. |
| 453 | const { allAllowed, blockReason } = checkCommandPermissions(command, config); |
| 454 | if (allAllowed) { |
| 455 | return { allowed: true }; |
| 456 | } |
| 457 | return { allowed: false, reason: blockReason }; |
| 458 | } |
no test coverage detected