diff --git a/package-lock.json b/package-lock.json index 0e3e29d44e..b888400875 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "diff": "^5.2.0", "diff-match-patch": "^1.0.5", "fast-deep-equal": "^3.1.3", + "fast-xml-parser": "^4.5.1", "fastest-levenshtein": "^1.0.16", "get-folder-size": "^5.0.0", "globby": "^14.0.2", @@ -1450,6 +1451,28 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/core/node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -8618,9 +8641,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", "funding": [ { "type": "github", @@ -8631,6 +8654,7 @@ "url": "https://paypal.me/naturalintelligence" } ], + "license": "MIT", "dependencies": { "strnum": "^1.0.5" }, diff --git a/package.json b/package.json index 5e75c57ad4..64e17efb37 100644 --- a/package.json +++ b/package.json @@ -331,6 +331,7 @@ "diff": "^5.2.0", "diff-match-patch": "^1.0.5", "fast-deep-equal": "^3.1.3", + "fast-xml-parser": "^4.5.1", "fastest-levenshtein": "^1.0.16", "get-folder-size": "^5.0.0", "globby": "^14.0.2", diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 2b98f387b8..034329edc3 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -64,6 +64,7 @@ import { McpHub } from "../services/mcp/McpHub" import crypto from "crypto" import { insertGroups } from "./diff/insert-groups" import { EXPERIMENT_IDS, experiments as Experiments, ExperimentId } from "../shared/experiments" +import { parseXml } from "../utils/xml" const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution @@ -2659,6 +2660,7 @@ export class Cline { */ const result: string | undefined = block.params.result const command: string | undefined = block.params.command + const next_step: string | undefined = block.params.next_step try { const lastMessage = this.clineMessages.at(-1) if (block.partial) { @@ -2707,8 +2709,44 @@ export class Cline { ) break } + + if (!next_step) { + this.consecutiveMistakeCount++ + pushToolResult( + await this.sayAndCreateMissingParamError("attempt_completion", "next_step"), + ) + break + } + + let normalizedSuggest = null + + type Suggest = { + task: string + mode: string + } + + let parsedSuggest: { + suggest: Suggest[] | Suggest + } + + try { + parsedSuggest = parseXml(next_step, ["suggest.task", "suggest.mode"]) as { + suggest: Suggest[] | Suggest + } + console.log("next_step", next_step) + } catch (error) { + this.consecutiveMistakeCount++ + await this.say("error", `Failed to parse operations: ${error.message}`) + pushToolResult(formatResponse.toolError("Invalid operations xml format")) + break + } + this.consecutiveMistakeCount = 0 + normalizedSuggest = Array.isArray(parsedSuggest?.suggest) + ? parsedSuggest.suggest + : [parsedSuggest?.suggest].filter((sug): sug is Suggest => sug !== undefined) + let commandResult: ToolResponse | undefined if (command) { if (lastMessage && lastMessage.ask !== "command") { @@ -2733,6 +2771,10 @@ export class Cline { await this.say("completion_result", result, undefined, false) } + const toolResults: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[] = [] + + await this.say("next_step_suggest", JSON.stringify(normalizedSuggest)) + // we already sent completion_result says, an empty string asks relinquishes control over button and field const { response, text, images } = await this.ask("completion_result", "", false) if (response === "yesButtonClicked") { @@ -2741,7 +2783,6 @@ export class Cline { } await this.say("user_feedback", text ?? "", images) - const toolResults: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[] = [] if (commandResult) { if (typeof commandResult === "string") { toolResults.push({ type: "text", text: commandResult }) diff --git a/src/core/assistant-message/index.ts b/src/core/assistant-message/index.ts index f1c49f85ab..6c3532025b 100644 --- a/src/core/assistant-message/index.ts +++ b/src/core/assistant-message/index.ts @@ -56,6 +56,7 @@ export const toolParamNames = [ "operations", "mode", "message", + "next_step", ] as const export type ToolParamName = (typeof toolParamNames)[number] @@ -126,7 +127,7 @@ export interface AskFollowupQuestionToolUse extends ToolUse { export interface AttemptCompletionToolUse extends ToolUse { name: "attempt_completion" - params: Partial, "result" | "command">> + params: Partial, "result" | "command" | "next_step">> } export interface SwitchModeToolUse extends ToolUse { diff --git a/src/core/prompts/__tests__/__snapshots__/system.test.ts.snap b/src/core/prompts/__tests__/__snapshots__/system.test.ts.snap index 291745fcd1..ab4446167c 100644 --- a/src/core/prompts/__tests__/__snapshots__/system.test.ts.snap +++ b/src/core/prompts/__tests__/__snapshots__/system.test.ts.snap @@ -165,22 +165,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -273,7 +338,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -306,7 +371,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -488,22 +553,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -596,7 +726,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -629,7 +759,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -811,22 +941,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -919,7 +1114,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -952,7 +1147,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -1180,22 +1375,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -1290,7 +1550,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -1324,7 +1584,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -1555,22 +1815,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -2027,7 +2352,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -2060,7 +2385,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -2288,22 +2613,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -2398,7 +2788,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -2432,7 +2822,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -2674,22 +3064,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -2784,7 +3239,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -2817,7 +3272,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -2999,22 +3454,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -3107,7 +3627,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -3140,7 +3660,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -3413,22 +3933,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -3531,7 +4116,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -3564,7 +4149,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -3747,22 +4332,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -3855,7 +4505,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -3888,7 +4538,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -4032,22 +4682,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -4140,7 +4855,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -4173,7 +4888,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. @@ -4437,22 +5152,87 @@ IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user th Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type + ## switch_mode Description: Request to switch to a different mode. This tool allows modes to request switching to another mode when needed, such as switching to Code mode to make code changes. The user must approve the mode switch. Parameters: @@ -4909,7 +5689,7 @@ RULES - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. @@ -4942,7 +5722,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance. diff --git a/src/core/prompts/responses.ts b/src/core/prompts/responses.ts index f06dff3d88..26a71f62e3 100644 --- a/src/core/prompts/responses.ts +++ b/src/core/prompts/responses.ts @@ -127,10 +127,9 @@ Tool uses are formatted using XML-style tags. The tool name is enclosed in openi For example: - - -I have completed the task... - - +Example: Requesting to read frontend-config.json + +frontend-config.json + Always adhere to this format for all tool uses to ensure proper parsing and execution.` diff --git a/src/core/prompts/sections/objective.ts b/src/core/prompts/sections/objective.ts index 66cefce885..1d9222f360 100644 --- a/src/core/prompts/sections/objective.ts +++ b/src/core/prompts/sections/objective.ts @@ -1,4 +1,4 @@ -export function getObjectiveSection(): string { +export function getObjectiveSection(_?: Record): string { return `==== OBJECTIVE @@ -8,6 +8,6 @@ You accomplish a given task iteratively, breaking it down into clear steps and w 1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order. 2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go. 3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided. -4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. +4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built. You must provide next step for user via attempt_completion tool by suggest next step. 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.` } diff --git a/src/core/prompts/sections/rules.ts b/src/core/prompts/sections/rules.ts index 86e554a157..12b98e7403 100644 --- a/src/core/prompts/sections/rules.ts +++ b/src/core/prompts/sections/rules.ts @@ -75,7 +75,7 @@ ${getEditingInstructions(diffStrategy, experiments)} - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write. * For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$" - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices. -- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again. +- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attempt_completion tool to present the result to the user. You must provide for user next step with attempt_completion tool. The user may provide feedback, which you can use to make improvements and try again. - You are only allowed to ask the user questions using the ask_followup_question tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the list_files tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves. - When executing commands, if you don't see the expected output, assume the terminal executed the command successfully and proceed with the task. The user's terminal may be unable to stream the output back properly. If you absolutely need to see the actual terminal output, use the ask_followup_question tool to request the user to copy and paste it back to you. - The user may provide a file's contents directly in their message, in which case you shouldn't use the read_file tool to get the file contents again since you already have it. diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index 90791f6358..101fc50f12 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -86,7 +86,7 @@ ${getRulesSection(cwd, supportsComputerUse, effectiveDiffStrategy, experiments)} ${getSystemInfoSection(cwd, mode, customModeConfigs)} -${getObjectiveSection()} +${getObjectiveSection(experiments)} ${await addCustomInstructions(promptComponent?.customInstructions || modeConfig.customInstructions || "", globalCustomInstructions || "", cwd, mode, { preferredLanguage })}` diff --git a/src/core/prompts/tools/attempt-completion.ts b/src/core/prompts/tools/attempt-completion.ts index 4418c8dc71..046aa1e01d 100644 --- a/src/core/prompts/tools/attempt-completion.ts +++ b/src/core/prompts/tools/attempt-completion.ts @@ -1,23 +1,90 @@ -export function getAttemptCompletionDescription(): string { +import { ToolArgs } from "./types" + +export function getAttemptCompletionDescription(_: ToolArgs): string { return `## attempt_completion Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. Optionally you may provide a CLI command to showcase the result of your work. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again. IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool. Parameters: - result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance. - command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use \`open index.html\` to display a created html website, or \`open localhost:3000\` to display a locally running development server. But DO NOT use commands like \`echo\` or \`cat\` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions. +- next_step: (required) A list of suggested next tasks that logically follow from the completed work. Each suggestion must: + 1. Be provided in its own tag with two fields: + - task: The description of the suggested task + - mode: The available mode slug to execute the task in (e.g., "code", "architect", "ask") + 2. Be specific, actionable, and directly related to the completed task + 3. Be ordered by priority or logical sequence + 4. Provide minimum 2-4 suggestions and maximum 12 suggestions + Usage: Your final result description here + + +Implement authentication service tests +code + + Command to demonstrate result (optional) -Example: Requesting to attempt completion with a result and command +Example: Basic completion with result and command -I've updated the CSS +I've updated the CSS styling for the navigation menu + + +Add responsive design breakpoints for mobile devices +code + + +Implement dark mode theme variations +code + + +Create documentation for styling guidelines +architect + + open index.html -` + + +Example: Completion with next step suggestions + + +I've implemented the user authentication feature + + + +Implement authentication service tests +code + + +Add password reset functionality +code + + +Design social login integration architecture +architect + + +Create user authentication documentation +architect + + +Implement session management +code + + +npm run dev + + +Note: When providing next step suggestions: +1. Keep suggestions focused and directly related to the completed task +2. Order suggestions by priority or logical sequence +3. Provide minimum 2-4 suggestions and maximum 12 suggestions +4. Make each suggestion specific and actionable +5. Include appropriate mode for each suggestion based on the task type` } diff --git a/src/core/prompts/tools/index.ts b/src/core/prompts/tools/index.ts index 1b9b9a43d9..8719f8dff0 100644 --- a/src/core/prompts/tools/index.ts +++ b/src/core/prompts/tools/index.ts @@ -29,7 +29,7 @@ const toolDescriptionMap: Record string | undefined> list_code_definition_names: (args) => getListCodeDefinitionNamesDescription(args), browser_action: (args) => getBrowserActionDescription(args), ask_followup_question: () => getAskFollowupQuestionDescription(), - attempt_completion: () => getAttemptCompletionDescription(), + attempt_completion: (args) => getAttemptCompletionDescription(args), use_mcp_tool: (args) => getUseMcpToolDescription(args), access_mcp_resource: (args) => getAccessMcpResourceDescription(args), switch_mode: () => getSwitchModeDescription(), @@ -57,6 +57,7 @@ export function getToolDescriptionsForMode( diffStrategy, browserViewportSize, mcpHub, + experiments, } const tools = new Set() diff --git a/src/core/prompts/tools/types.ts b/src/core/prompts/tools/types.ts index 2c2a60dd2a..9c1da644a2 100644 --- a/src/core/prompts/tools/types.ts +++ b/src/core/prompts/tools/types.ts @@ -8,4 +8,5 @@ export type ToolArgs = { browserViewportSize?: string mcpHub?: McpHub toolOptions?: any + experiments?: Record } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 34abd38dbf..1635e351ad 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -156,6 +156,7 @@ export type ClineAsk = | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "next_step_suggest" export type ClineSay = | "task" @@ -181,6 +182,7 @@ export type ClineSay = | "new_task_started" | "new_task" | "checkpoint_saved" + | "next_step_suggest" export interface ClineSayTool { tool: diff --git a/src/utils/xml.ts b/src/utils/xml.ts new file mode 100644 index 0000000000..8ccd6e77ae --- /dev/null +++ b/src/utils/xml.ts @@ -0,0 +1,30 @@ +import { XMLParser } from "fast-xml-parser" + +/** + * Parses an XML string into a JavaScript object + * @param xmlString The XML string to parse + * @returns Parsed JavaScript object representation of the XML + * @throws Error if the XML is invalid or parsing fails + */ +export function parseXml(xmlString: string, stopNodes?: string[]): unknown { + const _stopNodes = stopNodes ?? [] + try { + const parser = new XMLParser({ + // Preserve attribute types (don't convert numbers/booleans) + ignoreAttributes: false, + attributeNamePrefix: "@_", + // Parse numbers and booleans in text nodes + parseAttributeValue: true, + parseTagValue: true, + // Trim whitespace from text nodes + trimValues: true, + stopNodes: _stopNodes, + }) + + return parser.parse(xmlString) + } catch (error) { + // Enhance error message for better debugging + const errorMessage = error instanceof Error ? error.message : "Unknown error" + throw new Error(`Failed to parse XML: ${errorMessage}`) + } +} diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 1533bba3a8..9336e9d639 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -22,6 +22,7 @@ import McpResourceRow from "../mcp/McpResourceRow" import McpToolRow from "../mcp/McpToolRow" import { highlightMentions } from "./TaskHeader" import { CheckpointSaved } from "./checkpoints/CheckpointSaved" +import NextStepSuggestionsWrapper from "./NextStepSuggestionsWrapper" interface ChatRowProps { message: ClineMessage @@ -31,6 +32,7 @@ interface ChatRowProps { isStreaming: boolean onToggleExpand: () => void onHeightChange: (isTaller: boolean) => void + onSuggestionClick?: (task: string, mode: string) => void } interface ChatRowContentProps extends Omit {} @@ -77,6 +79,7 @@ export const ChatRowContent = ({ isLast, isStreaming, onToggleExpand, + onSuggestionClick, }: ChatRowContentProps) => { const { mcpServers, alwaysAllowMcp, currentCheckpoint } = useExtensionState() const [reasoningCollapsed, setReasoningCollapsed] = useState(true) @@ -215,6 +218,14 @@ export const ChatRowContent = ({ style={{ color: normalColor, marginBottom: "-1.5px" }}>, Roo has a question:, ] + case "next_step_suggest": { + return [ + , + Roo has suggest prompt:, + ] + } default: return [null, null] } @@ -738,6 +749,15 @@ export const ChatRowContent = ({ checkpoint={message.checkpoint} /> ) + case "next_step_suggest": + return ( + + ) default: return ( <> diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index fe0dc7e168..8ac6d8479b 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -228,6 +228,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie setEnableButtons(false) } break + case "next_step_suggest": case "api_req_finished": case "task": case "error": @@ -394,6 +395,11 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie case "completion_result": case "resume_completed_task": // extension waiting for feedback. but we can just present a new task button + if (inputValue.trim() !== "") { + vscode.postMessage({ type: "newTask", text: inputValue }) + setInputValue("") + break + } startNewTask() break } @@ -402,7 +408,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie setEnableButtons(false) disableAutoScrollRef.current = false }, - [clineAsk, startNewTask], + [clineAsk, inputValue, startNewTask], ) const handleSecondaryButtonClick = useCallback( @@ -923,6 +929,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie isLast={index === groupedMessages.length - 1} onHeightChange={handleRowHeightChange} isStreaming={isStreaming} + onSuggestionClick={(task: string, mode: string) => { + handleSendMessage(`create new task for ${task} by using new_task tool in ${mode} mode`, []) + }} /> ) }, @@ -932,7 +941,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie groupedMessages.length, handleRowHeightChange, isStreaming, + toggleRowExpansion, + handleSendMessage, ], ) diff --git a/webview-ui/src/components/chat/NextStepSuggest.tsx b/webview-ui/src/components/chat/NextStepSuggest.tsx new file mode 100644 index 0000000000..cf32b437d9 --- /dev/null +++ b/webview-ui/src/components/chat/NextStepSuggest.tsx @@ -0,0 +1,104 @@ +import { useCallback, useRef, useState } from "react" +import { cn } from "../../lib/utils" +import { Button } from "../ui/button" +import { ChevronDown, ChevronUp } from "lucide-react" +import { Badge } from "../ui/badge" + +interface NextStepSuggestProps { + suggestions?: { task: string; mode: string; id?: string }[] + onSuggestionClick?: (task: string, mode: string) => void + ts: number +} + +const NextStepSuggest = ({ suggestions = [], onSuggestionClick, ts = 1 }: NextStepSuggestProps) => { + const [isExpanded, setIsExpanded] = useState(false) + const buttonRef = useRef(null) + + const handleSuggestionClick = useCallback( + (suggestion: { task: string; mode: string }) => { + onSuggestionClick?.(suggestion.task, suggestion.mode) + }, + [onSuggestionClick], + ) + + const toggleExpand = useCallback(() => { + setIsExpanded((prev) => !prev) + + // Use setTimeout to ensure the DOM has updated before scrolling + setTimeout(() => { + if (buttonRef.current) { + // Use scrollIntoView to ensure the button is visible + buttonRef.current.scrollIntoView({ behavior: "smooth", block: "nearest" }) + } + }, 100) // Increased timeout to ensure DOM updates + }, []) + + // Don't render if there are no suggestions or no click handler + if (!suggestions?.length || !onSuggestionClick) { + return null + } + + const displayedSuggestions = isExpanded ? suggestions : suggestions.slice(0, 1) + + return ( +
+
+
+ {displayedSuggestions.map((suggestion) => ( +
+ +
+ ))} + {suggestions.length > 1 && ( + + )} +
+
+
+ ) +} + +export default NextStepSuggest diff --git a/webview-ui/src/components/chat/NextStepSuggestionsWrapper.tsx b/webview-ui/src/components/chat/NextStepSuggestionsWrapper.tsx new file mode 100644 index 0000000000..2f0da2bebf --- /dev/null +++ b/webview-ui/src/components/chat/NextStepSuggestionsWrapper.tsx @@ -0,0 +1,42 @@ +import React, { useMemo } from "react" +import NextStepSuggest from "./NextStepSuggest" + +interface NextStepSuggestionsWrapperProps { + suggestion: string + partial: boolean + ts: number + onSuggestionClick?: (task: string, mode: string) => void +} + +const NextStepSuggestionsWrapper: React.FC = ({ + suggestion: suggestionRaw, + ts, + partial, + onSuggestionClick, +}) => { + const suggestions = useMemo(() => { + if (partial) { + return [] + } + + try { + const parsed = JSON.parse(suggestionRaw ?? "[]") + if (Array.isArray(parsed)) { + return parsed.filter((item) => typeof item === "object" && item.task && item.mode) + } + + return parsed + } catch (error) { + console.warn("Next step suggestions must be an array of task & mode objects", error) + return [] + } + }, [partial, suggestionRaw]) + + if (!suggestions.length) { + return null + } + + return +} + +export default NextStepSuggestionsWrapper diff --git a/webview-ui/src/components/ui/badge.tsx b/webview-ui/src/components/ui/badge.tsx index 32447ef41c..8e5b68fc3a 100644 --- a/webview-ui/src/components/ui/badge.tsx +++ b/webview-ui/src/components/ui/badge.tsx @@ -12,6 +12,10 @@ const badgeVariants = cva( secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80", outline: "text-muted-foreground border-vscode-input-border", + toolkit: + "bg-vscode-badge-background text-vscode-badge-foreground border border-vscode-button-border rounded-full text-xs font-normal", + "toolkit-no-border": + "bg-vscode-badge-background text-vscode-badge-foreground rounded-full text-xs font-normal shadow", }, }, defaultVariants: { diff --git a/webview-ui/src/components/ui/button.tsx b/webview-ui/src/components/ui/button.tsx index 9f60dfedee..4906f41920 100644 --- a/webview-ui/src/components/ui/button.tsx +++ b/webview-ui/src/components/ui/button.tsx @@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xs text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xs text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&>.start]:mr-2 [&>.content]:flex", { variants: { variant: { @@ -21,12 +21,22 @@ const buttonVariants = cva( link: "text-primary underline-offset-4 hover:underline cursor-pointer", combobox: "text-vscode-font-size font-normal text-popover-foreground bg-vscode-input-background border border-vscode-dropdown-border hover:bg-vscode-input-background/80 cursor-pointer", + "ui-toolkit-primary": + "font-display text-vscode-button-foreground bg-vscode-button-background border border-vscode-button-border rounded-[var(--size-cornerRadiusRound)] hover:bg-vscode-button-hoverBackground active:bg-vscode-button-background focus-visible:outline focus-visible:outline-[var(--size-borderWidth)] focus-visible:outline-vscode-focusBorder focus-visible:outline-offset-[calc(var(--size-borderWidth)*2)] disabled:opacity-[var(--opacity-disabled)] disabled:bg-vscode-button-background disabled:cursor-not-allowed cursor-pointer [&>svg]:w-[calc(var(--size-designUnit)*4px)] [&>svg]:h-[calc(var(--size-designUnit)*4px)] [&>.start]:mr-2 [&>.content]:flex", + "ui-toolkit-secondary": + "font-display text-vscode-button-secondaryForeground bg-vscode-button-secondaryBackground border border-vscode-button-border rounded-[var(--size-cornerRadiusRound)] hover:bg-vscode-button-secondaryHoverBackground active:bg-vscode-button-secondaryBackground focus-visible:outline focus-visible:outline-[var(--size-borderWidth)] focus-visible:outline-vscode-focusBorder focus-visible:outline-offset-[calc(var(--size-borderWidth)*2)] disabled:opacity-[var(--opacity-disabled)] disabled:bg-vscode-button-secondaryBackground disabled:cursor-not-allowed cursor-pointer [&>svg]:w-[calc(var(--size-designUnit)*4px)] [&>svg]:h-[calc(var(--size-designUnit)*4px)] [&>.start]:mr-2 [&>.content]:flex", + "ui-toolkit-icon": + "font-display text-vscode-foreground bg-vscode-button-iconBackground border-none rounded-[var(--size-button-iconCornerRadius)] hover:bg-vscode-button-iconHoverBackground hover:outline hover:outline-1 hover:outline-dotted hover:outline-vscode-contrastActiveBorder hover:outline-offset-[-1px] active:bg-vscode-button-iconHoverBackground focus-visible:outline focus-visible:outline-[var(--size-borderWidth)] focus-visible:outline-vscode-focusBorder focus-visible:outline-offset-[var(--size-button-iconFocusBorderOffset)] disabled:opacity-[var(--opacity-disabled)] disabled:bg-vscode-button-iconBackground disabled:cursor-not-allowed cursor-pointer [&>svg]:w-[calc(var(--size-designUnit)*4px)] [&>svg]:h-[calc(var(--size-designUnit)*4px)] [&>.content]:flex", + "ui-toolkit-primary-no-border": + "font-display text-vscode-button-foreground bg-vscode-button-background rounded-[var(--size-cornerRadiusRound)] hover:bg-vscode-button-hoverBackground active:bg-vscode-button-background focus-visible:outline focus-visible:outline-[var(--size-borderWidth)] focus-visible:outline-vscode-focusBorder focus-visible:outline-offset-[calc(var(--size-borderWidth)*2)] disabled:opacity-[var(--opacity-disabled)] disabled:bg-vscode-button-background disabled:cursor-not-allowed cursor-pointer [&>svg]:w-[calc(var(--size-designUnit)*4px)] [&>svg]:h-[calc(var(--size-designUnit)*4px)] [&>.start]:mr-2 [&>.content]:flex", }, size: { default: "h-7 px-3", sm: "h-6 px-2 text-sm", lg: "h-8 px-4 text-lg", icon: "h-7 w-7", + "ui-toolkit": "text-base p-[var(--size-button-paddingVertical)_var(--size-button-paddingHorizontal)]", + "ui-toolkit-icon": "p-[var(--size-button-iconPadding)]", }, }, defaultVariants: { @@ -45,7 +55,25 @@ export interface ButtonProps const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button" - return + + // Set size to "ui-toolkit" when using ui-toolkit variants if no size is specified + const adjustedSize = + !size && variant?.includes("ui-toolkit") + ? variant === "ui-toolkit-icon" + ? "ui-toolkit-icon" + : "ui-toolkit" + : size + + return ( + + ) }, ) Button.displayName = "Button" diff --git a/webview-ui/src/index.css b/webview-ui/src/index.css index fd058872a6..aef11223a8 100644 --- a/webview-ui/src/index.css +++ b/webview-ui/src/index.css @@ -96,6 +96,42 @@ --color-vscode-list-hoverForeground: var(--vscode-list-hoverForeground); --color-vscode-list-hoverBackground: var(--vscode-list-hoverBackground); --color-vscode-list-focusBackground: var(--vscode-list-focusBackground); + + /* Additional VSCode WebView UI Toolkit color tokens */ + --color-vscode-contrastActiveBorder: var(--vscode-contrastActiveBorder); + --color-vscode-contrastBorder: var(--vscode-contrastBorder); + --color-vscode-scrollbarSlider-background: var(--vscode-scrollbarSlider-background); + --color-vscode-scrollbarSlider-hoverBackground: var(--vscode-scrollbarSlider-hoverBackground); + --color-vscode-scrollbarSlider-activeBackground: var(--vscode-scrollbarSlider-activeBackground); + --color-vscode-checkbox-background: var(--vscode-checkbox-background); + --color-vscode-checkbox-border: var(--vscode-checkbox-border); + --color-vscode-checkbox-foreground: var(--vscode-checkbox-foreground); + --color-vscode-list-activeSelectionBackground: var(--vscode-list-activeSelectionBackground); + --color-vscode-list-activeSelectionForeground: var(--vscode-list-activeSelectionForeground); + --color-vscode-settings-dropdownListBorder: var(--vscode-settings-dropdownListBorder); + --color-vscode-progressBar-background: var(--vscode-progressBar-background); + --color-vscode-panelTitle-activeBorder: var(--vscode-panelTitle-activeBorder); + --color-vscode-panelTitle-activeForeground: var(--vscode-panelTitle-activeForeground); + --color-vscode-panelTitle-inactiveForeground: var(--vscode-panelTitle-inactiveForeground); + --color-vscode-panel-background: var(--vscode-panel-background); + --color-vscode-panel-border: var(--vscode-panel-border); + + /* Additional VSCode WebView UI Toolkit button tokens */ + --color-vscode-button-border: var(--vscode-button-border); + --color-vscode-button-hoverBackground: var(--vscode-button-hoverBackground); + --color-vscode-button-secondaryHoverBackground: var(--vscode-button-secondaryHoverBackground); + --color-vscode-button-iconBackground: var(--vscode-button-iconBackground, transparent); + --color-vscode-button-iconHoverBackground: var(--vscode-button-iconHoverBackground, rgba(90, 93, 94, 0.31)); + + /* Additional VSCode WebView UI Toolkit layout tokens */ + --size-cornerRadiusRound: calc(var(--vscode-cornerRadiusRound, 2px) * 1px); + --size-borderWidth: calc(var(--vscode-borderWidth, 1px) * 1px); + --size-button-iconCornerRadius: var(--vscode-button-iconCornerRadius, 5px); + --size-button-iconFocusBorderOffset: var(--vscode-button-iconFocusBorderOffset, 0px); + --size-button-paddingVertical: var(--vscode-button-paddingVertical, 4px); + --size-button-paddingHorizontal: var(--vscode-button-paddingHorizontal, 11px); + --size-button-iconPadding: var(--vscode-button-iconPadding, 3px); + --opacity-disabled: var(--vscode-disabledOpacity, 0.4); } @layer base {