(answer: string)
| 31 | export const APPROVE_OPTIONS = ['accept', 'always yes', 'edit', 'continue', 'reject']; |
| 32 | |
| 33 | export { isAlwaysYesAnswer } from '../../security/permissions.js'; |
| 34 | |
| 35 | export function interpretApprovalAnswer(answer: string): 'accept' | 'edit' | 'revise' | 'reject' { |
| 36 | const a = (answer || '').trim().toLowerCase(); |
| 37 | if (a === 'accept' || a === 'yes' || a === 'y' || isAlwaysYesAnswer(a)) return 'accept'; |
| 38 | if (a === 'edit' || a === 'e') return 'edit'; |
| 39 | if (a === 'continue' || a === 'c' || a === 'revise') return 'revise'; |
| 40 | return 'reject'; // 'no' / 'n' / 'reject' / anything unrecognized → safe default |
| 41 | } |
| 42 |
no outgoing calls
no test coverage detected