diff --git a/packages/types/src/vscode.ts b/packages/types/src/vscode.ts index 2838514690..d22ebdab22 100644 --- a/packages/types/src/vscode.ts +++ b/packages/types/src/vscode.ts @@ -53,6 +53,7 @@ export const commandIds = [ "focusInput", "acceptInput", "focusPanel", + "toggleAutoApprove", ] as const export type CommandId = (typeof commandIds)[number] diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts index fac615edf1..4fbb8a5b59 100644 --- a/src/activate/registerCommands.ts +++ b/src/activate/registerCommands.ts @@ -221,6 +221,29 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt visibleProvider.postMessageToWebview({ type: "acceptInput" }) }, + toggleAutoApprove: async () => { + const visibleProvider = getVisibleProviderOrLog(outputChannel) + + if (!visibleProvider) { + return + } + + // Get current state using context proxy + const currentState = visibleProvider.contextProxy.getValue("autoApprovalEnabled") ?? false + + // Toggle the state + const newState = !currentState + await visibleProvider.contextProxy.setValue("autoApprovalEnabled", newState) + + // Update the webview + await visibleProvider.postStateToWebview() + + // Show notification to user + const statusText = newState ? t("common:status.enabled") : t("common:status.disabled") + vscode.window.showInformationMessage( + t("common:commands.toggleAutoApprove.notification", { status: statusText }), + ) + }, }) export const openClineInNewTab = async ({ context, outputChannel }: Omit) => { diff --git a/src/i18n/locales/ca/common.json b/src/i18n/locales/ca/common.json index b71b7eb913..405b5130fb 100644 --- a/src/i18n/locales/ca/common.json +++ b/src/i18n/locales/ca/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Evitar la finalització de tasques quan hi ha todos incomplets a la llista de todos" + }, + "toggleAutoApprove": { + "notification": "Auto-Aprovació {{status}}" } }, + "status": { + "enabled": "activada", + "disabled": "desactivada" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index 6577d460d1..24574ace05 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -225,8 +225,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Aufgabenabschluss verhindern, wenn unvollständige Todos in der Todo-Liste vorhanden sind" + }, + "toggleAutoApprove": { + "notification": "Auto-Genehmigung {{status}}" } }, + "status": { + "enabled": "aktiviert", + "disabled": "deaktiviert" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index e8c264ba68..4c3a4e7f2e 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -214,8 +214,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Prevent task completion when there are incomplete todos in the todo list" + }, + "toggleAutoApprove": { + "notification": "Auto-Approve {{status}}" } }, + "status": { + "enabled": "enabled", + "disabled": "disabled" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index 5cfa3c5749..49712af5c5 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -225,8 +225,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Prevenir la finalización de tareas cuando hay todos incompletos en la lista de todos" + }, + "toggleAutoApprove": { + "notification": "Auto-Aprobación {{status}}" } }, + "status": { + "enabled": "habilitada", + "disabled": "deshabilitada" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index 5a11c874a7..426a76d80d 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Empêcher la finalisation des tâches lorsqu'il y a des todos incomplets dans la liste de todos" + }, + "toggleAutoApprove": { + "notification": "Auto-Approbation {{status}}" } }, + "status": { + "enabled": "activée", + "disabled": "désactivée" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/hi/common.json b/src/i18n/locales/hi/common.json index e89c16cbd0..90d2ada929 100644 --- a/src/i18n/locales/hi/common.json +++ b/src/i18n/locales/hi/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "जब टूडू सूची में अधूरे टूडू हों तो कार्य पूर्ण होने से रोकें" + }, + "toggleAutoApprove": { + "notification": "स्वचालित अनुमोदन {{status}}" } }, + "status": { + "enabled": "सक्षम", + "disabled": "अक्षम" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/id/common.json b/src/i18n/locales/id/common.json index ae1662eb37..7aa40b5edc 100644 --- a/src/i18n/locales/id/common.json +++ b/src/i18n/locales/id/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Mencegah penyelesaian tugas ketika ada todo yang belum selesai dalam daftar todo" + }, + "toggleAutoApprove": { + "notification": "Persetujuan Otomatis {{status}}" } }, + "status": { + "enabled": "diaktifkan", + "disabled": "dinonaktifkan" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index aeaec11d0d..7d0c4ec4bb 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Impedire il completamento delle attività quando ci sono todo incompleti nella lista dei todo" + }, + "toggleAutoApprove": { + "notification": "Auto-Approvazione {{status}}" } }, + "status": { + "enabled": "abilitata", + "disabled": "disabilitata" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index a607dbffd5..180f01f7e1 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Todoリストに未完了のTodoがある場合、タスクの完了を防ぐ" + }, + "toggleAutoApprove": { + "notification": "自動承認{{status}}" } }, + "status": { + "enabled": "有効", + "disabled": "無効" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index e48b84fe20..1cb4e10655 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "할 일 목록에 미완료된 할 일이 있을 때 작업 완료를 방지" + }, + "toggleAutoApprove": { + "notification": "자동 승인 {{status}}" } }, + "status": { + "enabled": "활성화됨", + "disabled": "비활성화됨" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/nl/common.json b/src/i18n/locales/nl/common.json index 0e3e2459a0..8412cbc180 100644 --- a/src/i18n/locales/nl/common.json +++ b/src/i18n/locales/nl/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Voorkom taakafronding wanneer er onvolledige todos in de todolijst staan" + }, + "toggleAutoApprove": { + "notification": "Auto-Goedkeuring {{status}}" } }, + "status": { + "enabled": "ingeschakeld", + "disabled": "uitgeschakeld" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/pl/common.json b/src/i18n/locales/pl/common.json index 1d48b0f9cc..14b909251b 100644 --- a/src/i18n/locales/pl/common.json +++ b/src/i18n/locales/pl/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Zapobiegaj ukończeniu zadania gdy na liście zadań są nieukończone zadania" + }, + "toggleAutoApprove": { + "notification": "Auto-Zatwierdzanie {{status}}" } }, + "status": { + "enabled": "włączone", + "disabled": "wyłączone" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json index 093ef7b0bf..c966168030 100644 --- a/src/i18n/locales/pt-BR/common.json +++ b/src/i18n/locales/pt-BR/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Impedir a conclusão de tarefas quando há todos incompletos na lista de todos" + }, + "toggleAutoApprove": { + "notification": "Auto-Aprovação {{status}}" } }, + "status": { + "enabled": "habilitada", + "disabled": "desabilitada" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index 7edd656d8c..6a3153cb62 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Предотвратить завершение задач при наличии незавершенных дел в списке дел" + }, + "toggleAutoApprove": { + "notification": "Авто-Одобрение {{status}}" } }, + "status": { + "enabled": "включено", + "disabled": "отключено" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/tr/common.json b/src/i18n/locales/tr/common.json index 20b2824b98..d37b0b83c6 100644 --- a/src/i18n/locales/tr/common.json +++ b/src/i18n/locales/tr/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Todo listesinde tamamlanmamış todolar olduğunda görev tamamlanmasını engelle" + }, + "toggleAutoApprove": { + "notification": "Otomatik Onay {{status}}" } }, + "status": { + "enabled": "etkin", + "disabled": "devre dışı" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/vi/common.json b/src/i18n/locales/vi/common.json index f4755162fe..73ddf408f3 100644 --- a/src/i18n/locales/vi/common.json +++ b/src/i18n/locales/vi/common.json @@ -237,8 +237,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "Ngăn chặn hoàn thành nhiệm vụ khi có các todo chưa hoàn thành trong danh sách todo" + }, + "toggleAutoApprove": { + "notification": "Tự động phê duyệt {{status}}" } }, + "status": { + "enabled": "đã bật", + "disabled": "đã tắt" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/zh-CN/common.json b/src/i18n/locales/zh-CN/common.json index 787c5c8ae9..2551df044b 100644 --- a/src/i18n/locales/zh-CN/common.json +++ b/src/i18n/locales/zh-CN/common.json @@ -235,8 +235,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "当待办事项列表中有未完成的待办事项时阻止任务完成" + }, + "toggleAutoApprove": { + "notification": "自动批准已{{status}}" } }, + "status": { + "enabled": "启用", + "disabled": "禁用" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/i18n/locales/zh-TW/common.json b/src/i18n/locales/zh-TW/common.json index 0ae3549d3e..2f4080f88c 100644 --- a/src/i18n/locales/zh-TW/common.json +++ b/src/i18n/locales/zh-TW/common.json @@ -230,8 +230,15 @@ "commands": { "preventCompletionWithOpenTodos": { "description": "當待辦事項清單中有未完成的待辦事項時阻止工作完成" + }, + "toggleAutoApprove": { + "notification": "自動核准已{{status}}" } }, + "status": { + "enabled": "啟用", + "disabled": "停用" + }, "docsLink": { "label": "Docs", "url": "https://docs.roocode.com" diff --git a/src/package.json b/src/package.json index 4016b06f22..c534ed9448 100644 --- a/src/package.json +++ b/src/package.json @@ -174,6 +174,11 @@ "command": "roo-cline.acceptInput", "title": "%command.acceptInput.title%", "category": "%configuration.title%" + }, + { + "command": "roo-cline.toggleAutoApprove", + "title": "%command.toggleAutoApprove.title%", + "category": "%configuration.title%" } ], "menus": { @@ -310,6 +315,13 @@ "win": "ctrl+y", "linux": "ctrl+y", "when": "editorTextFocus && editorHasSelection" + }, + { + "command": "roo-cline.toggleAutoApprove", + "key": "ctrl+shift+a", + "mac": "cmd+shift+a", + "win": "ctrl+shift+a", + "linux": "ctrl+shift+a" } ], "submenus": [ diff --git a/src/package.nls.json b/src/package.nls.json index b0b7f401f8..1db69777ac 100644 --- a/src/package.nls.json +++ b/src/package.nls.json @@ -26,6 +26,7 @@ "command.terminal.fixCommand.title": "Fix This Command", "command.terminal.explainCommand.title": "Explain This Command", "command.acceptInput.title": "Accept Input/Suggestion", + "command.toggleAutoApprove.title": "Toggle Auto-Approve", "configuration.title": "Roo Code", "commands.allowedCommands.description": "Commands that can be auto-executed when 'Always approve execute operations' is enabled", "commands.deniedCommands.description": "Command prefixes that will be automatically denied without asking for approval. In case of conflicts with allowed commands, the longest prefix match takes precedence. Add * to deny all commands.",