(reason: string)
| 265 | * @param reason - The classifier's reason for denying the action |
| 266 | */ |
| 267 | export function buildYoloRejectionMessage(reason: string): string { |
| 268 | const prefix = AUTO_MODE_REJECTION_PREFIX |
| 269 | |
| 270 | const ruleHint = feature('BASH_CLASSIFIER') |
| 271 | ? `To allow this type of action in the future, the user can add a permission rule like ` + |
| 272 | `Bash(prompt: <description of allowed action>) to their settings. ` + |
| 273 | `At the end of your session, recommend what permission rules to add so you don't get blocked again.` |
| 274 | : `To allow this type of action in the future, the user can add a Bash permission rule to their settings.` |
| 275 | |
| 276 | return ( |
| 277 | `${prefix}${reason}. ` + |
| 278 | `If you have other tasks that don't depend on this action, continue working on those. ` + |
| 279 | `${DENIAL_WORKAROUND_GUIDANCE} ` + |
| 280 | ruleHint |
| 281 | ) |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Build a message for when the auto mode classifier is temporarily unavailable. |
no test coverage detected