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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/api/providers/pearai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export class PearAiHandler {
id: baseModel.id,
info: {
...baseModel.info,
// Inherit all capabilities from the underlying model
supportsImages: baseModel.info.supportsImages,
supportsComputerUse: baseModel.info.supportsComputerUse,
supportsPromptCache: baseModel.info.supportsPromptCache,
// Apply PearAI's price markup
inputPrice: (baseModel.info.inputPrice || 0) * 1.03,
outputPrice: (baseModel.info.outputPrice || 0) * 1.03,
cacheWritesPrice: baseModel.info.cacheWritesPrice ? baseModel.info.cacheWritesPrice * 1.03 : undefined,
Expand Down
30 changes: 15 additions & 15 deletions src/core/prompts/__tests__/__snapshots__/system.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SYSTEM_PROMPT should exclude diff strategy tool description when diffEnabled is false 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -324,7 +324,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should exclude diff strategy tool description when diffEnabled is undefined 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -647,7 +647,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should explicitly handle undefined mcpHub 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -970,7 +970,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should handle different browser viewport sizes 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -1342,7 +1342,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should include MCP server info when mcpHub is provided 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -1751,7 +1751,7 @@ class WeatherServer {

this.setupResourceHandlers();
this.setupToolHandlers();

// Error handling
this.server.onerror = (error) => console.error('[MCP Error]', error);
process.on('SIGINT', async () => {
Expand Down Expand Up @@ -2078,7 +2078,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should include browser actions when supportsComputerUse is true 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -2450,7 +2450,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should include diff strategy tool description when diffEnabled is true 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -2835,7 +2835,7 @@ Mock generic rules"
`;

exports[`SYSTEM_PROMPT should maintain consistent system prompt 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -3200,7 +3200,7 @@ Mock generic rules"
`;

exports[`addCustomInstructions should exclude MCP server creation info when disabled 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -3597,7 +3597,7 @@ Mock generic rules"
`;

exports[`addCustomInstructions should generate correct prompt for architect mode 1`] = `
"You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.
"You are PearAI Agent (Powered by Roo Code / Cline), an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.

====

Expand Down Expand Up @@ -3911,7 +3911,7 @@ Mock generic rules"
`;

exports[`addCustomInstructions should generate correct prompt for ask mode 1`] = `
"You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.
"You are PearAI Agent (Powered by Roo Code / Cline), a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.

====

Expand Down Expand Up @@ -4216,7 +4216,7 @@ Mock generic rules"
`;

exports[`addCustomInstructions should include MCP server creation info when enabled 1`] = `
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.

====

Expand Down Expand Up @@ -4625,7 +4625,7 @@ class WeatherServer {

this.setupResourceHandlers();
this.setupToolHandlers();

// Error handling
this.server.onerror = (error) => console.error('[MCP Error]', error);
process.on('SIGINT', async () => {
Expand Down Expand Up @@ -5092,7 +5092,7 @@ USER'S CUSTOM INSTRUCTIONS
The following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.

Mode-specific Instructions:
Custom mode instructions
Custom mode instructions

Rules:
# Rules from .clinerules-code:
Expand Down
2 changes: 1 addition & 1 deletion src/core/prompts/sections/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Both files should follow this structure:
{
"slug": "designer", // Required: unique slug with lowercase letters, numbers, and hyphens
"name": "Designer", // Required: mode display name
"roleDefinition": "You are Roo, a UI/UX expert specializing in design systems and frontend development. Your expertise includes:\\n- Creating and maintaining design systems\\n- Implementing responsive and accessible web interfaces\\n- Working with CSS, HTML, and modern frontend frameworks\\n- Ensuring consistent user experiences across platforms", // Required: non-empty
"roleDefinition": "You are PearAI Agent (Powered by Roo Code / Cline), a UI/UX expert specializing in design systems and frontend development. Your expertise includes:\\n- Creating and maintaining design systems\\n- Implementing responsive and accessible web interfaces\\n- Working with CSS, HTML, and modern frontend frameworks\\n- Ensuring consistent user experiences across platforms", // Required: non-empty
"groups": [ // Required: array of tool groups (can be empty)
"read", // Read files group (read_file, search_files, list_files, list_code_definition_names)
"edit", // Edit files group (apply_diff, write_to_file) - allows editing any file
Expand Down
4 changes: 2 additions & 2 deletions src/shared/__tests__/modes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ describe("FileRestrictionError", () => {
slug: "debug",
name: "Debug",
roleDefinition:
"You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
"You are PearAI Agent (Powered by Roo Code / Cline), an expert software debugger specializing in systematic problem diagnosis and resolution.",
groups: ["read", "edit", "browser", "command", "mcp"],
})
expect(debugMode?.customInstructions).toContain(
Expand All @@ -362,7 +362,7 @@ describe("FileRestrictionError", () => {
slug: "debug",
name: "Debug",
roleDefinition:
"You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
"You are PearAI Agent (Powered by Roo Code / Cline), an expert software debugger specializing in systematic problem diagnosis and resolution.",
})
})

Expand Down
10 changes: 8 additions & 2 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,11 @@ export const pearAiDefaultModelId: PearAiModelId = "pearai-model"
export const pearAiDefaultModelInfo: ModelInfo = {
maxTokens: 8192,
contextWindow: 64000,
supportsImages: false,
// Default values for required fields, but actual values will be inherited from underlying model
supportsPromptCache: true,
supportsImages: false,
supportsComputerUse: false,
// Base pricing
inputPrice: 0.014,
outputPrice: 0.28,
cacheWritesPrice: 0.27,
Expand All @@ -816,8 +819,11 @@ export const pearAiModels = {
"pearai-model": {
maxTokens: 8192,
contextWindow: 64000,
supportsImages: false,
// Default values for required fields, but actual values will be inherited from underlying model
supportsPromptCache: true,
supportsImages: false,
supportsComputerUse: false,
// Base pricing
inputPrice: 0.014,
outputPrice: 0.28,
cacheWritesPrice: 0.27,
Expand Down
8 changes: 4 additions & 4 deletions src/shared/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ export const modes: readonly ModeConfig[] = [
slug: "code",
name: "Code",
roleDefinition:
"You are Roo, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
"You are PearAI Agent (Powered by Roo Code / Cline), a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.",
groups: ["read", "edit", "browser", "command", "mcp"],
},
{
slug: "architect",
name: "Architect",
roleDefinition:
"You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.",
"You are PearAI Agent (Powered by Roo Code / Cline), an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.",
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
customInstructions:
"Depending on the user's request, you may need to do some information gathering (for example using read_file or search_files) to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. Once you've gained more context about the user's request, you should create a detailed plan for how to accomplish the task. (You can write the plan to a markdown file if it seems appropriate.)\n\nThen you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it. Finally once it seems like you've reached a good plan, use the switch_mode tool to request that the user switch to another mode to implement the solution.",
Expand All @@ -94,7 +94,7 @@ export const modes: readonly ModeConfig[] = [
slug: "ask",
name: "Ask",
roleDefinition:
"You are Roo, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
"You are PearAI Agent (Powered by Roo Code / Cline), a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
groups: ["read", "browser", "mcp"],
customInstructions:
"You can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code.",
Expand All @@ -103,7 +103,7 @@ export const modes: readonly ModeConfig[] = [
slug: "debug",
name: "Debug",
roleDefinition:
"You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution.",
"You are PearAI Agent (Powered by Roo Code / Cline), an expert software debugger specializing in systematic problem diagnosis and resolution.",
groups: ["read", "edit", "browser", "command", "mcp"],
customInstructions:
"Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem.",
Expand Down
9 changes: 6 additions & 3 deletions webview-ui/src/components/settings/ApiOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const ApiOptions = ({
)

const { selectedProvider, selectedModelId, selectedModelInfo } = useMemo(() => {
const result = normalizeApiConfiguration(apiConfiguration)
const result = normalizeApiConfiguration(apiConfiguration, pearAiModels)
if (result.selectedProvider === "pearai") {
return {
...result,
Expand Down Expand Up @@ -1503,7 +1503,10 @@ export function getOpenRouterAuthUrl(uriScheme?: string) {
return `https://openrouter.ai/auth?callback_url=${uriScheme || "vscode"}://rooveterinaryinc.roo-cline/openrouter`
}

export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
export function normalizeApiConfiguration(
apiConfiguration?: ApiConfiguration,
pearAiModelsQuery?: Record<string, ModelInfo>,
) {
const provider = apiConfiguration?.apiProvider || "anthropic"
const modelId = apiConfiguration?.apiModelId

Expand Down Expand Up @@ -1591,7 +1594,7 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
},
}
case "pearai": {
return getProviderData(pearAiModels, pearAiDefaultModelId)
return getProviderData(pearAiModelsQuery || pearAiModels, pearAiDefaultModelId)
}
default:
return getProviderData(anthropicModels, anthropicDefaultModelId)
Expand Down
Loading