(command, state, rl)
| 186 | } |
| 187 | |
| 188 | async function confirmShellCommand(command, state, rl) { |
| 189 | if (state.autoApproveShell) { |
| 190 | return true |
| 191 | } |
| 192 | |
| 193 | if (!rl) { |
| 194 | return false |
| 195 | } |
| 196 | |
| 197 | const answer = await rl.question( |
| 198 | `[shell_command approval]\n${command}\nRun this command? [y/N] `, |
| 199 | ) |
| 200 | return /^y(es)?$/i.test(answer.trim()) |
| 201 | } |
| 202 | |
| 203 | async function persistSession(state) { |
| 204 | if (state.noSave) { |
no outgoing calls
no test coverage detected