Skip to content

Commit 28e7451

Browse files
committed
PR cleanup
1 parent 00bf914 commit 28e7451

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+152
-159
lines changed

.roomodes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"customModes": [
33
{
4-
"slug": "translator",
5-
"name": "Translator",
4+
"slug": "translate",
5+
"name": "Translate",
66
"roleDefinition": "You are Roo, a linguistic specialist focused on translating and managing localization files. Your responsibility is to help maintain and update translation files for the application, ensuring consistency and accuracy across all language resources.",
77
"groups": [
88
"read",

src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,27 @@ Example: Requesting to write to frontend-config.json
132132
</write_to_file>
133133
134134
## execute_command
135-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
135+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Prefer relative commands and paths that avoid location sensitivity for terminal consistency, e.g: \`touch ./testdata/example.file\`, \`dir ./examples/model1/data/yaml\`, or \`go test ./cmd/front --config ./cmd/front/config.yml\`. If directed by the user, you may open a terminal in a different directory by using the \`cwd\` parameter.
136136
Parameters:
137137
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
138+
- cwd: (optional) The working directory to execute the command in (default: /test/path)
138139
Usage:
139140
<execute_command>
140141
<command>Your command here</command>
142+
<cwd>Working directory path (optional)</cwd>
141143
</execute_command>
142144
143145
Example: Requesting to execute npm run dev
144146
<execute_command>
145147
<command>npm run dev</command>
146148
</execute_command>
147149
150+
Example: Requesting to execute ls in a specific directory if directed
151+
<execute_command>
152+
<command>ls -la</command>
153+
<cwd>/home/user/projects</cwd>
154+
</execute_command>
155+
148156
## ask_followup_question
149157
Description: Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.
150158
Parameters:
@@ -543,19 +551,27 @@ Example: Replace all occurrences of "old" with "new" using regex
543551
</search_and_replace>
544552
545553
## execute_command
546-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
554+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Prefer relative commands and paths that avoid location sensitivity for terminal consistency, e.g: \`touch ./testdata/example.file\`, \`dir ./examples/model1/data/yaml\`, or \`go test ./cmd/front --config ./cmd/front/config.yml\`. If directed by the user, you may open a terminal in a different directory by using the \`cwd\` parameter.
547555
Parameters:
548556
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
557+
- cwd: (optional) The working directory to execute the command in (default: /test/path)
549558
Usage:
550559
<execute_command>
551560
<command>Your command here</command>
561+
<cwd>Working directory path (optional)</cwd>
552562
</execute_command>
553563
554564
Example: Requesting to execute npm run dev
555565
<execute_command>
556566
<command>npm run dev</command>
557567
</execute_command>
558568
569+
Example: Requesting to execute ls in a specific directory if directed
570+
<execute_command>
571+
<command>ls -la</command>
572+
<cwd>/home/user/projects</cwd>
573+
</execute_command>
574+
559575
## ask_followup_question
560576
Description: Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.
561577
Parameters:
@@ -923,19 +939,27 @@ Example: Replace all occurrences of "old" with "new" using regex
923939
</search_and_replace>
924940
925941
## execute_command
926-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
942+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Prefer relative commands and paths that avoid location sensitivity for terminal consistency, e.g: \`touch ./testdata/example.file\`, \`dir ./examples/model1/data/yaml\`, or \`go test ./cmd/front --config ./cmd/front/config.yml\`. If directed by the user, you may open a terminal in a different directory by using the \`cwd\` parameter.
927943
Parameters:
928944
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
945+
- cwd: (optional) The working directory to execute the command in (default: /test/path)
929946
Usage:
930947
<execute_command>
931948
<command>Your command here</command>
949+
<cwd>Working directory path (optional)</cwd>
932950
</execute_command>
933951
934952
Example: Requesting to execute npm run dev
935953
<execute_command>
936954
<command>npm run dev</command>
937955
</execute_command>
938956
957+
Example: Requesting to execute ls in a specific directory if directed
958+
<execute_command>
959+
<command>ls -la</command>
960+
<cwd>/home/user/projects</cwd>
961+
</execute_command>
962+
939963
## ask_followup_question
940964
Description: Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.
941965
Parameters:

src/core/prompts/sections/custom-instructions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export async function addCustomInstructions(
4747

4848
// Add language preference if provided
4949
if (options.language) {
50-
sections.push(`Language Preference:\nYou should always speak and think in the "${options.language}" language.`)
50+
sections.push(
51+
`Language Preference:\nYou should always speak and think in the "${options.language}" language unless the user gives you instructions below to do otherwise.`,
52+
)
5153
}
5254

5355
// Add global instructions first

src/core/prompts/sections/rules.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
1616
} else {
1717
availableTools.push("write_to_file (for creating new files or complete file rewrites)")
1818
}
19-
2019
if (experiments?.["insert_content"]) {
2120
availableTools.push("insert_content (for adding lines to existing files)")
2221
}

src/core/prompts/system.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function generatePrompt(
3939
customModeConfigs?: ModeConfig[],
4040
globalCustomInstructions?: string,
4141
diffEnabled?: boolean,
42-
experiments?: Record<string, boolean> | boolean | undefined,
42+
experiments?: Record<string, boolean>,
4343
enableMcpServerCreation?: boolean,
4444
rooIgnoreInstructions?: string,
4545
): Promise<string> {
@@ -61,12 +61,6 @@ async function generatePrompt(
6161
: Promise.resolve(""),
6262
])
6363

64-
// Convert experiments to an object if it's a boolean
65-
const experimentSettings =
66-
typeof experiments === "boolean"
67-
? {} // Empty object if experiments is just a boolean
68-
: (experiments ?? {})
69-
7064
const basePrompt = `${roleDefinition}
7165
7266
${getSharedToolUseSection()}
@@ -79,7 +73,7 @@ ${getToolDescriptionsForMode(
7973
browserViewportSize,
8074
mcpHub,
8175
customModeConfigs,
82-
experimentSettings,
76+
experiments,
8377
)}
8478
8579
${getToolUseGuidelinesSection()}
@@ -90,7 +84,7 @@ ${getCapabilitiesSection(cwd, supportsComputerUse, mcpHub, effectiveDiffStrategy
9084
9185
${modesSection}
9286
93-
${getRulesSection(cwd, supportsComputerUse, effectiveDiffStrategy, experimentSettings)}
87+
${getRulesSection(cwd, supportsComputerUse, effectiveDiffStrategy, experiments)}
9488
9589
${getSystemInfoSection(cwd, mode, customModeConfigs)}
9690
@@ -113,7 +107,7 @@ export const SYSTEM_PROMPT = async (
113107
customModes?: ModeConfig[],
114108
globalCustomInstructions?: string,
115109
diffEnabled?: boolean,
116-
experiments?: Record<string, boolean> | boolean | undefined,
110+
experiments?: Record<string, boolean>,
117111
enableMcpServerCreation?: boolean,
118112
rooIgnoreInstructions?: string,
119113
): Promise<string> => {
@@ -157,11 +151,6 @@ ${customInstructions}`
157151

158152
// If diff is disabled, don't pass the diffStrategy
159153
const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined
160-
// Convert experiments to an object if it's a boolean
161-
const experimentSettings =
162-
typeof experiments === "boolean"
163-
? {} // Empty object if experiments is just a boolean
164-
: (experiments ?? {})
165154

166155
return generatePrompt(
167156
context,
@@ -175,7 +164,7 @@ ${customInstructions}`
175164
customModes,
176165
globalCustomInstructions,
177166
diffEnabled,
178-
experimentSettings,
167+
experiments,
179168
enableMcpServerCreation,
180169
rooIgnoreInstructions,
181170
)

src/core/prompts/tools/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ export function getToolDescriptionsForMode(
6161

6262
const tools = new Set<string>()
6363

64-
const experimentSettings = experiments ?? {}
65-
6664
// Add tools from mode's groups
6765
config.groups.forEach((groupEntry) => {
6866
const groupName = getGroupName(groupEntry)
6967
const toolGroup = TOOL_GROUPS[groupName]
7068
if (toolGroup) {
7169
toolGroup.tools.forEach((tool) => {
72-
if (isToolAllowedForMode(tool as ToolName, mode, customModes ?? [], experimentSettings)) {
70+
if (isToolAllowedForMode(tool as ToolName, mode, customModes ?? [], experiments ?? {})) {
7371
tools.add(tool)
7472
}
7573
})

webview-ui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ yarn-debug.log*
2323
yarn-error.log*
2424

2525
*storybook.log
26+
27+
tsconfig.tsbuildinfo

webview-ui/package-lock.json

Lines changed: 23 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@radix-ui/react-slot": "^1.1.2",
2929
"@radix-ui/react-tooltip": "^1.1.8",
3030
"@tailwindcss/vite": "^4.0.0",
31-
"@testing-library/dom": "^10.4.0",
3231
"@vscode/webview-ui-toolkit": "^1.4.0",
3332
"class-variance-authority": "^0.7.1",
3433
"clsx": "^2.1.1",

0 commit comments

Comments
 (0)