Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
"title": "Add To Context",
"category": "Roo Code"
},
{
"command": "roo-cline.newTask",
"title": "New Task",
"category": "Roo Code"
},
{
"command": "roo-cline.terminalAddToContext",
"title": "Add Terminal Content to Context",
Expand Down
22 changes: 22 additions & 0 deletions src/activate/handleTask.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as vscode from "vscode"
import { COMMAND_IDS } from "../core/CodeActionProvider"
import { ClineProvider } from "../core/webview/ClineProvider"
import { t } from "../i18n"

export const handleNewTask = async (params: { prompt?: string } | null | undefined) => {
let prompt = params?.prompt
if (!prompt) {
prompt = await vscode.window.showInputBox({
prompt: t("common:input.task_prompt"),
placeHolder: t("common:input.task_placeholder"),
})
}
if (!prompt) {
await vscode.commands.executeCommand("roo-cline.SidebarProvider.focus")
return
}

await ClineProvider.handleCodeAction(COMMAND_IDS.NEW_TASK, "NEW_TASK", {
userInput: prompt,
})
}
2 changes: 2 additions & 0 deletions src/activate/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import delay from "delay"
import { ClineProvider } from "../core/webview/ClineProvider"

import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRelayResponse } from "./humanRelay"
import { handleNewTask } from "./handleTask"

// Store panel references in both modes
let sidebarPanel: vscode.WebviewView | undefined = undefined
Expand Down Expand Up @@ -85,6 +86,7 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
"roo-cline.registerHumanRelayCallback": registerHumanRelayCallback,
"roo-cline.unregisterHumanRelayCallback": unregisterHumanRelayCallback,
"roo-cline.handleHumanRelayResponse": handleHumanRelayResponse,
"roo-cline.newTask": handleNewTask,
"roo-cline.setCustomStoragePath": async () => {
const { promptForCustomStoragePath } = await import("../shared/storagePathManager")
await promptForCustomStoragePath()
Expand Down
2 changes: 1 addition & 1 deletion src/core/Cline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2893,7 +2893,7 @@ export class Cline extends EventEmitter<ClineEvents> {
if (item.mimeType?.startsWith("image") && item.blob) {
images.push(item.blob)
}
});
})
await this.say("mcp_server_response", resourceResultPretty, images)
pushToolResult(formatResponse.toolResult(resourceResultPretty, images))
break
Expand Down
2 changes: 2 additions & 0 deletions src/core/CodeActionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ export const ACTION_NAMES = {
FIX_LOGIC: "Roo Code: Fix Logic",
IMPROVE: "Roo Code: Improve Code",
ADD_TO_CONTEXT: "Roo Code: Add to Context",
NEW_TASK: "Roo Code: New Task",
} as const

export const COMMAND_IDS = {
EXPLAIN: "roo-cline.explainCode",
FIX: "roo-cline.fixCode",
IMPROVE: "roo-cline.improveCode",
ADD_TO_CONTEXT: "roo-cline.addToContext",
NEW_TASK: "roo-cline.newTask",
} as const

export class CodeActionProvider implements vscode.CodeActionProvider {
Expand Down
4 changes: 4 additions & 0 deletions src/core/__tests__/Cline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ jest.mock("vscode", () => {
}

return {
CodeActionKind: {
QuickFix: { value: "quickfix" },
RefactorRewrite: { value: "refactor.rewrite" },
},
window: {
createTextEditorDecorationType: jest.fn().mockReturnValue({
dispose: jest.fn(),
Expand Down
4 changes: 4 additions & 0 deletions src/core/webview/__tests__/ClineProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ jest.mock("vscode", () => ({
joinPath: jest.fn(),
file: jest.fn(),
},
CodeActionKind: {
QuickFix: { value: "quickfix" },
RefactorRewrite: { value: "refactor.rewrite" },
},
window: {
showInformationMessage: jest.fn(),
showErrorMessage: jest.fn(),
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/ca/common.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"input": {
"task_prompt": "Què vols que faci Roo?",
"task_placeholder": "Escriu la teva tasca aquí"
},
"extension": {
"name": "Roo Code",
"description": "Tot un equip de desenvolupadors d'IA al teu editor."
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Bitte gib einen absoluten Pfad ein (z.B. D:\\RooCodeStorage oder /home/user/storage)",
"enter_valid_path": "Bitte gib einen gültigen Pfad ein"
},
"input": {
"task_prompt": "Was soll Roo tun?",
"task_placeholder": "Gib deine Aufgabe hier ein"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Please enter an absolute path (e.g. D:\\RooCodeStorage or /home/user/storage)",
"enter_valid_path": "Please enter a valid path"
},
"input": {
"task_prompt": "What should Roo do?",
"task_placeholder": "Type your task here"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Por favor, ingresa una ruta absoluta (por ejemplo, D:\\RooCodeStorage o /home/user/storage)",
"enter_valid_path": "Por favor, ingresa una ruta válida"
},
"input": {
"task_prompt": "¿Qué debe hacer Roo?",
"task_placeholder": "Escribe tu tarea aquí"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Veuillez entrer un chemin absolu (ex. D:\\RooCodeStorage ou /home/user/storage)",
"enter_valid_path": "Veuillez entrer un chemin valide"
},
"input": {
"task_prompt": "Que doit faire Roo ?",
"task_placeholder": "Écris ta tâche ici"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "कृपया एक पूर्ण पाथ दर्ज करें (उदाहरण: D:\\RooCodeStorage या /home/user/storage)",
"enter_valid_path": "कृपया एक वैध पाथ दर्ज करें"
},
"input": {
"task_prompt": "Roo को क्या करना है?",
"task_placeholder": "अपना कार्य यहाँ लिखें"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Inserisci un percorso assoluto (ad esempio D:\\RooCodeStorage o /home/user/storage)",
"enter_valid_path": "Inserisci un percorso valido"
},
"input": {
"task_prompt": "Cosa deve fare Roo?",
"task_placeholder": "Scrivi il tuo compito qui"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "絶対パスを入力してください(例:D:\\RooCodeStorage または /home/user/storage)",
"enter_valid_path": "有効なパスを入力してください"
},
"input": {
"task_prompt": "Rooにどんなことをさせますか?",
"task_placeholder": "タスクをここに入力してください"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/ko/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "절대 경로를 입력하세요 (예: D:\\RooCodeStorage 또는 /home/user/storage)",
"enter_valid_path": "유효한 경로를 입력하세요"
},
"input": {
"task_prompt": "Roo에게 무엇을 시킬까요?",
"task_placeholder": "여기에 작업을 입력하세요"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/pl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Wprowadź pełną ścieżkę (np. D:\\RooCodeStorage lub /home/user/storage)",
"enter_valid_path": "Wprowadź prawidłową ścieżkę"
},
"input": {
"task_prompt": "Co ma zrobić Roo?",
"task_placeholder": "Wpisz swoje zadanie tutaj"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/pt-BR/common.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"input": {
"task_prompt": "O que você quer que o Roo faça?",
"task_placeholder": "Digite sua tarefa aqui"
},
"extension": {
"name": "Roo Code",
"description": "Uma equipe completa de desenvolvedores com IA em seu editor."
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/tr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Lütfen mutlak bir yol girin (örn. D:\\RooCodeStorage veya /home/user/storage)",
"enter_valid_path": "Lütfen geçerli bir yol girin"
},
"input": {
"task_prompt": "Roo ne yapsın?",
"task_placeholder": "Görevini buraya yaz"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/vi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "Vui lòng nhập đường dẫn tuyệt đối (ví dụ: D:\\RooCodeStorage hoặc /home/user/storage)",
"enter_valid_path": "Vui lòng nhập đường dẫn hợp lệ"
},
"input": {
"task_prompt": "Bạn muốn Roo làm gì?",
"task_placeholder": "Nhập nhiệm vụ của bạn ở đây"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "请输入绝对路径(例如 D:\\RooCodeStorage 或 /home/user/storage)",
"enter_valid_path": "请输入有效的路径"
},
"input": {
"task_prompt": "让Roo做什么?",
"task_placeholder": "在这里输入任务"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/zh-TW/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,9 @@
"path_placeholder": "D:\\RooCodeStorage",
"enter_absolute_path": "請輸入絕對路徑(例如 D:\\RooCodeStorage 或 /home/user/storage)",
"enter_valid_path": "請輸入有效的路徑"
},
"input": {
"task_prompt": "讓Roo做什麼?",
"task_placeholder": "在這裡輸入任務"
}
}
38 changes: 3 additions & 35 deletions src/shared/support-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ export const createPrompt = (template: string, params: PromptParams): string =>
}

interface SupportPromptConfig {
label: string
description: string
template: string
}

const supportPromptConfigs: Record<string, SupportPromptConfig> = {
ENHANCE: {
label: "Enhance Prompt",
description:
"Use prompt enhancement to get tailored suggestions or improvements for your inputs. This ensures Roo understands your intent and provides the best possible responses. Available via the ✨ icon in chat.",
template: `Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):

\${userInput}`,
},
EXPLAIN: {
label: "Explain Code",
description:
"Get detailed explanations of code snippets, functions, or entire files. Useful for understanding complex code or learning new patterns. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
template: `Explain the following code from file path @/\${filePath}:
\${userInput}

Expand All @@ -56,9 +48,6 @@ Please provide a clear and concise explanation of what this code does, including
3. Important patterns or techniques used`,
},
FIX: {
label: "Fix Issues",
description:
"Get help identifying and resolving bugs, errors, or code quality issues. Provides step-by-step guidance for fixing problems. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
template: `Fix any issues in the following code from file path @/\${filePath}
\${diagnosticText}
\${userInput}
Expand All @@ -74,9 +63,6 @@ Please:
4. Explain what was fixed and why`,
},
IMPROVE: {
label: "Improve Code",
description:
"Receive suggestions for code optimization, better practices, and architectural improvements while maintaining functionality. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
template: `Improve the following code from file path @/\${filePath}:
\${userInput}

Expand All @@ -93,28 +79,19 @@ Please suggest improvements for:
Provide the improved code along with explanations for each enhancement.`,
},
ADD_TO_CONTEXT: {
label: "Add to Context",
description:
"Add context to your current task or conversation. Useful for providing additional information or clarifications. Available in code actions (lightbulb icon in the editor). and the editor context menu (right-click on selected code).",
template: `\${filePath}:
\`\`\`
\${selectedText}
\`\`\``,
},
TERMINAL_ADD_TO_CONTEXT: {
label: "Add Terminal Content to Context",
description:
"Add terminal output to your current task or conversation. Useful for providing command outputs or logs. Available in the terminal context menu (right-click on selected terminal content).",
template: `\${userInput}
Terminal output:
\`\`\`
\${terminalContent}
\`\`\``,
},
TERMINAL_FIX: {
label: "Fix Terminal Command",
description:
"Get help fixing terminal commands that failed or need improvement. Available in the terminal context menu (right-click on selected terminal content).",
template: `\${userInput}
Fix this terminal command:
\`\`\`
Expand All @@ -127,9 +104,6 @@ Please:
3. Explain what was fixed and why`,
},
TERMINAL_EXPLAIN: {
label: "Explain Terminal Command",
description:
"Get detailed explanations of terminal commands and their outputs. Available in the terminal context menu (right-click on selected terminal content).",
template: `\${userInput}
Explain this terminal command:
\`\`\`
Expand All @@ -141,6 +115,9 @@ Please provide:
2. Explanation of each part/flag
3. Expected output and behavior`,
},
NEW_TASK: {
template: `\${userInput}`,
},
} as const

type SupportPromptType = keyof typeof supportPromptConfigs
Expand All @@ -158,15 +135,6 @@ export const supportPrompt = {

export type { SupportPromptType }

// Expose labels and descriptions for UI
export const supportPromptLabels = Object.fromEntries(
Object.entries(supportPromptConfigs).map(([key, config]) => [key, config.label]),
) as Record<SupportPromptType, string>

export const supportPromptDescriptions = Object.fromEntries(
Object.entries(supportPromptConfigs).map(([key, config]) => [key, config.description]),
) as Record<SupportPromptType, string>

export type CustomSupportPrompts = {
[key: string]: string | undefined
}
4 changes: 4 additions & 0 deletions webview-ui/src/i18n/locales/ca/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"TERMINAL_EXPLAIN": {
"label": "Explicar comanda del terminal",
"description": "Obtingueu explicacions detallades de les comandes del terminal i les seves sortides. Disponible al menú contextual del terminal (clic dret al contingut seleccionat del terminal)."
},
"NEW_TASK": {
"label": "Iniciar nova tasca",
"description": "Inicieu una nova tasca amb l'entrada proporcionada. Disponible a la paleta de comandes."
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions webview-ui/src/i18n/locales/de/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"TERMINAL_EXPLAIN": {
"label": "Terminal-Befehl erklären",
"description": "Erhalten Sie detaillierte Erklärungen zu Terminal-Befehlen und deren Ausgaben. Verfügbar im Kontextmenü des Terminals (Rechtsklick auf ausgewählten Terminal-Inhalt)."
},
"NEW_TASK": {
"label": "Neue Aufgabe starten",
"description": "Starte eine neue Aufgabe mit deiner Eingabe. Verfügbar in der Befehlspalette."
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions webview-ui/src/i18n/locales/en/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"TERMINAL_EXPLAIN": {
"label": "Explain Terminal Command",
"description": "Get detailed explanations of terminal commands and their outputs. Available in the terminal context menu (right-click on selected terminal content)."
},
"NEW_TASK": {
"label": "Start New Task",
"description": "Start a new task with user input. Available in the Command Palette."
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions webview-ui/src/i18n/locales/es/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"TERMINAL_EXPLAIN": {
"label": "Explicar comando de terminal",
"description": "Obtén explicaciones detalladas de comandos de terminal y sus salidas. Disponible en el menú contextual de la terminal (clic derecho en el contenido seleccionado de la terminal)."
},
"NEW_TASK": {
"label": "Iniciar nueva tarea",
"description": "Inicia una nueva tarea con entrada del usuario. Disponible en la Paleta de comandos."
}
}
},
Expand Down
Loading
Loading