From a041e871be2afd0708b1bdcd88366958b9217ce9 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 12:32:59 -0400
Subject: [PATCH 01/12] Progress
---
src/activate/registerCommands.ts | 18 ++++++++
webview-ui/src/creator/Creator.tsx | 74 +++++++++++++++++++++---------
2 files changed, 71 insertions(+), 21 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 4a48fbb9b65..4c6b6bd2302 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -41,6 +41,24 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
"roo-cline.helpButtonClicked": () => {
vscode.env.openExternal(vscode.Uri.parse("https://docs.roocode.com"))
},
+ "roo-cline.createInAgent": async (args: any) => {
+ const sidebarProvider = ClineProvider.getSidebarInstance()
+ if (sidebarProvider) {
+ // Start a new chat in the sidebar
+ vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
+ await sidebarProvider.clearTask()
+ await sidebarProvider.handleModeSwitch("code")
+ await sidebarProvider.postStateToWebview()
+ await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
+
+ // Send the completion result directly
+ await sidebarProvider.postMessageToWebview({
+ type: "invoke",
+ invoke: "sendMessage",
+ text: args.text,
+ })
+ }
+ },
"roo-cline.executeCreatorPlan": async (args: any) => {
const sidebarProvider = ClineProvider.getSidebarInstance()
if (sidebarProvider) {
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index fa2b8c439b4..3d9de90d815 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -88,6 +88,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const [wasStreaming, setWasStreaming] = useState(false)
const [editingFilePath, setEditingFilePath] = useState(null)
+ const [includePlanningPhase, setIncludePlanningPhase] = useState(true)
// UI layout depends on the last 2 messages
// (since it relies on the content of these messages, we are deep comparing. i.e. the button state after hitting button sets enableButtons to false, and this effect otherwise would have to true again even if messages didn't change
@@ -403,16 +404,28 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
break
case "completion_result":
case "resume_completed_task":
- vscode.postMessage({
- type: "invoke",
- invoke: "executeCommand",
- command: "roo-cline.executeCreatorPlan",
- args: {
- filePath: editingFilePath,
- // code: 'function test() { return true; }',
- // context: 'This is a test context'
- },
- })
+ if (includePlanningPhase) {
+ vscode.postMessage({
+ type: "invoke",
+ invoke: "executeCommand",
+ command: "roo-cline.executeCreatorPlan",
+ args: {
+ filePath: editingFilePath,
+ includePlanning: true
+ },
+ })
+ } else {
+ // When skipping planning, send directly to agent sidebar
+ vscode.postMessage({
+ type: "invoke",
+ invoke: "executeCommand",
+ command: "roo-cline.createInAgent",
+ args: {
+ text: lastMessage?.text || "",
+ mode: "code"
+ },
+ })
+ }
break
}
setTextAreaDisabled(true)
@@ -1018,6 +1031,25 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
overflow: "hidden",
}}
className={`min-w-2xl ${task ? "max-w-2xl" : "max-w-5xl"} mx-auto flex justify-center borderr border-solid`}>
+
+ setIncludePlanningPhase(e.target.checked)}
+ style={{ cursor: 'pointer' }}
+ />
+
+ Include Planning Phase
+
+
+
{!task && (
@@ -1158,19 +1190,19 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
padding: `${primaryButtonText || secondaryButtonText || isStreaming ? "10" : "0"}px 0px 0px 0px`,
}}>
{primaryButtonText && !isStreaming && (
-
handlePrimaryButtonClick(inputValue, selectedImages)}>
- {primaryButtonText}
-
+ marginRight: secondaryButtonText ? "6px" : "0",
+ borderRadius: 8,
+ }}
+ onClick={(e) => handlePrimaryButtonClick(inputValue, selectedImages)}>
+ {primaryButtonText}
+
)}
{(secondaryButtonText || isStreaming) && (
Date: Sat, 29 Mar 2025 12:56:53 -0400
Subject: [PATCH 02/12] Progress, include planning phases checkbox logic is
working
---
webview-ui/src/creator/Creator.tsx | 70 ++++++++++++++++++------------
1 file changed, 42 insertions(+), 28 deletions(-)
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index 3d9de90d815..3489eed6892 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -1,4 +1,4 @@
-import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
+import { VSCodeButton, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
import debounce from "debounce"
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
import { useDeepCompareEffect, useEvent, useMount } from "react-use"
@@ -32,6 +32,7 @@ import { getApiMetrics } from "../../../src/shared/getApiMetrics"
import { McpServer, McpTool } from "../../../src/shared/mcp"
import { AudioType } from "../../../src/shared/WebviewMessage"
import SplitView from "./SplitView"
+import { set } from "zod"
interface ChatViewProps {
isHidden?: boolean
@@ -313,7 +314,22 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
text = text.trim()
if (text || images.length > 0) {
if (messages.length === 0) {
- vscode.postMessage({ type: "newTask", text, images })
+ console.log("I AM IN handleSendMessage messages is 0", includePlanningPhase)
+ if (includePlanningPhase) {
+ console.log('Starting new task with planning phase');
+ vscode.postMessage({ type: "newTask", text, images })
+ } else {
+ console.log('Skipping planning phase, sending directly to agent');
+ vscode.postMessage({
+ type: "invoke",
+ invoke: "executeCommand",
+ command: "roo-cline.createInAgent",
+ args: {
+ text,
+ mode: "code"
+ },
+ })
+ }
} else if (clineAsk) {
switch (clineAsk) {
case "followup":
@@ -348,7 +364,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
disableAutoScrollRef.current = false
}
},
- [messages.length, clineAsk, setMode],
+ [messages.length, clineAsk, setMode, setIncludePlanningPhase],
)
const handleSetChatBoxMessage = useCallback(
@@ -404,6 +420,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
break
case "completion_result":
case "resume_completed_task":
+ console.log("I AM IN resume_completed_task", includePlanningPhase)
if (includePlanningPhase) {
vscode.postMessage({
type: "invoke",
@@ -1031,32 +1048,29 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
overflow: "hidden",
}}
className={`min-w-2xl ${task ? "max-w-2xl" : "max-w-5xl"} mx-auto flex justify-center borderr border-solid`}>
-
- setIncludePlanningPhase(e.target.checked)}
- style={{ cursor: 'pointer' }}
- />
-
- Include Planning Phase
-
-
-
{!task && (
-
+ <>
+
+
+ {
+ const newValue = !includePlanningPhase;
+ console.log('Checkbox changed - includePlanningPhase:', newValue);
+ setIncludePlanningPhase(newValue);
+ }}
+ >
+ Include Planning Phase
+
+
+
+
+ >
)}
{task && (
Date: Sat, 29 Mar 2025 13:24:03 -0400
Subject: [PATCH 03/12] Progress, include planning phases checkbox logic is
working and creatorMode is being passed around partially
---
src/activate/registerCommands.ts | 5 ++++-
src/core/webview/ClineProvider.ts | 13 +++++++------
src/shared/api.ts | 4 ++--
webview-ui/src/creator/Creator.tsx | 8 +++++---
4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 4c6b6bd2302..2ce0aa9fe96 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -45,9 +45,12 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
const sidebarProvider = ClineProvider.getSidebarInstance()
if (sidebarProvider) {
// Start a new chat in the sidebar
+ console.log("I AM IN createInAgent and creatorMode is", args.creatorMode)
vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
await sidebarProvider.clearTask()
- await sidebarProvider.handleModeSwitch("code")
+ console.log("I AM IN about to call handleModeSwitch", args.creatorMode)
+ await sidebarProvider.handleModeSwitch("code", args.creatorMode)
+ console.log("I AM IN just called handleModeSwitch", args.creatorMode)
await sidebarProvider.postStateToWebview()
await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts
index af40475129e..2a0e598aef2 100644
--- a/src/core/webview/ClineProvider.ts
+++ b/src/core/webview/ClineProvider.ts
@@ -334,7 +334,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.outputChannel.appendLine("Webview view resolved")
}
- public async initClineWithTask(task?: string, images?: string[]) {
+ public async initClineWithTask(task?: string, images?: string[], creatorMode?: boolean) {
await this.clearTask()
const {
apiConfiguration,
@@ -353,7 +353,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
provider: this,
apiConfiguration: {
...apiConfiguration,
- creatorMode: mode === "creator",
+ creatorMode: mode === "creator" || creatorMode,
},
customInstructions: effectiveInstructions,
enableDiff: diffEnabled,
@@ -365,7 +365,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
})
}
- public async initClineWithHistoryItem(historyItem: HistoryItem) {
+ public async initClineWithHistoryItem(historyItem: HistoryItem, creatorMode?: boolean) {
await this.clearTask()
const {
@@ -386,7 +386,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
provider: this,
apiConfiguration: {
...apiConfiguration,
- creatorMode: mode === "creator",
+ creatorMode: mode === "creator" || creatorMode,
},
customInstructions: effectiveInstructions,
enableDiff: diffEnabled,
@@ -1663,7 +1663,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
* Handle switching to a new mode, including updating the associated API configuration
* @param newMode The mode to switch to
*/
- public async handleModeSwitch(newMode: Mode) {
+ public async handleModeSwitch(newMode: Mode, creatorMode?: boolean) {
+ console.log("I AM IN handleModeSwitch and creatorMode is", creatorMode)
await this.updateGlobalState("mode", newMode)
// Load the saved API config for the new mode if it exists
@@ -1995,7 +1996,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
if (id !== this.cline?.taskId) {
// non-current task
const { historyItem } = await this.getTaskWithId(id)
- await this.initClineWithHistoryItem(historyItem) // clears existing task
+ await this.initClineWithHistoryItem(historyItem, this.isCreator) // clears existing task
}
await this.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
}
diff --git a/src/shared/api.ts b/src/shared/api.ts
index 408d7c1dddf..8f0ca78b135 100644
--- a/src/shared/api.ts
+++ b/src/shared/api.ts
@@ -793,9 +793,9 @@ export const unboundDefaultModelInfo: ModelInfo = {
}
// CHANGE AS NEEDED FOR TESTING
// PROD:
-export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
+// export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
// DEV:
-// export const PEARAI_URL = "http://localhost:8000/integrations/cline"
+export const PEARAI_URL = "http://localhost:8000/integrations/cline"
// PearAI
export type PearAiModelId = keyof typeof pearAiModels
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index 3489eed6892..907429290ac 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -326,7 +326,8 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
command: "roo-cline.createInAgent",
args: {
text,
- mode: "code"
+ mode: "code",
+ creatorMode: true
},
})
}
@@ -364,7 +365,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
disableAutoScrollRef.current = false
}
},
- [messages.length, clineAsk, setMode, setIncludePlanningPhase],
+ [messages.length, clineAsk, setMode, includePlanningPhase],
)
const handleSetChatBoxMessage = useCallback(
@@ -439,7 +440,8 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
command: "roo-cline.createInAgent",
args: {
text: lastMessage?.text || "",
- mode: "code"
+ mode: "code",
+ creatorMode: true
},
})
}
From e92e1d0ca9d30f533d455988bb8e7a734c349e00 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 13:56:20 -0400
Subject: [PATCH 04/12] Progress, true on server
---
src/activate/registerCommands.ts | 14 ++++++++------
src/api/providers/pearai.ts | 1 +
src/core/webview/ClineProvider.ts | 3 +++
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 2ce0aa9fe96..66a3d6628bd 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -54,12 +54,14 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
await sidebarProvider.postStateToWebview()
await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
- // Send the completion result directly
- await sidebarProvider.postMessageToWebview({
- type: "invoke",
- invoke: "sendMessage",
- text: args.text,
- })
+ await sidebarProvider.initClineWithTask(args.text, undefined, args.creatorMode)
+
+ // // Send the completion result directly
+ // await sidebarProvider.postMessageToWebview({
+ // type: "invoke",
+ // invoke: "sendMessage",
+ // text: args.text,
+ // })
}
},
"roo-cline.executeCreatorPlan": async (args: any) => {
diff --git a/src/api/providers/pearai.ts b/src/api/providers/pearai.ts
index 4a90eccfb64..6a4b7a360bc 100644
--- a/src/api/providers/pearai.ts
+++ b/src/api/providers/pearai.ts
@@ -17,6 +17,7 @@ export class PearAiHandler {
private handler!: AnthropicHandler | DeepSeekHandler
constructor(options: ApiHandlerOptions) {
+ console.dir("PearAI Handler initialized with creatorMode:", options.creatorMode)
if (!options.pearaiApiKey) {
vscode.window.showErrorMessage("PearAI API key not found.", "Login to PearAI").then(async (selection) => {
if (selection === "Login to PearAI") {
diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts
index 2a0e598aef2..1189b594e19 100644
--- a/src/core/webview/ClineProvider.ts
+++ b/src/core/webview/ClineProvider.ts
@@ -347,6 +347,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
experiments,
} = await this.getState()
+ console.log("IM IN INIT CLINE mode: ", mode)
+ console.log("IM IN INIT CLINE creatorMode", creatorMode)
+
const modePrompt = customModePrompts?.[mode] as PromptComponent
const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")
this.cline = new Cline({
From 9def681ddb9c87906197679601d0d5993622c069 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 13:59:59 -0400
Subject: [PATCH 05/12] Renamed isCreatorView
---
src/activate/registerCommands.ts | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 66a3d6628bd..650fcd7249a 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -75,6 +75,7 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
// Create the template message using the args
+ // Todo: add structure to it i.e. You should have these sections: Architecutre, Features, etc.
let executePlanTemplate = `This file contains detailed plan to my task. please read it and Execute the plan accordingly.
File: ${args.filePath || "No file specified"}`
@@ -89,11 +90,15 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
executePlanTemplate += `Additional context: ${args.context}`
}
- await sidebarProvider.postMessageToWebview({
- type: "invoke",
- invoke: "sendMessage",
- text: executePlanTemplate,
- })
+ args.text = executePlanTemplate
+
+ await sidebarProvider.initClineWithTask(args.text, undefined, args.creatorMode)
+
+ // await sidebarProvider.postMessageToWebview({
+ // type: "invoke",
+ // invoke: "sendMessage",
+ // text: executePlanTemplate,
+ // })
}
},
}
From 656d12c28fb511667e780370c471530b16d52c5f Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 14:06:32 -0400
Subject: [PATCH 06/12] Renamed isCreatorView
---
src/core/webview/ClineProvider.ts | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts
index 1189b594e19..9eae255ea27 100644
--- a/src/core/webview/ClineProvider.ts
+++ b/src/core/webview/ClineProvider.ts
@@ -74,17 +74,17 @@ export class ClineProvider implements vscode.WebviewViewProvider {
private latestAnnouncementId = "jan-21-2025-custom-modes" // update to some unique identifier when we add a new announcement
configManager: ConfigManager
customModesManager: CustomModesManager
- private isCreator: boolean = false
+ private isCreatorView: boolean = false
constructor(
readonly context: vscode.ExtensionContext,
private readonly outputChannel: vscode.OutputChannel,
- isCreator: boolean = false,
+ isCreatorView: boolean = false,
) {
- this.outputChannel.appendLine(`creator = ${isCreator}`)
- this.isCreator = isCreator
+ this.outputChannel.appendLine(`creator = ${isCreatorView}`)
+ this.isCreatorView = isCreatorView
console.dir("CREATOR")
- console.dir(this.isCreator)
+ console.dir(this.isCreatorView)
this.outputChannel.appendLine("ClineProvider instantiated")
ClineProvider.activeInstances.add(this)
this.workspaceTracker = new WorkspaceTracker(this)
@@ -135,7 +135,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}
public static getSidebarInstance(): ClineProvider | undefined {
- const sidebar = Array.from(this.activeInstances).find((instance) => !instance.isCreator)
+ const sidebar = Array.from(this.activeInstances).find((instance) => !instance.isCreatorView)
if (!sidebar?.view?.visible) {
vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
@@ -439,7 +439,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
- window.isCreator="${this.isCreator}";
+ window.isCreator="${this.isCreatorView}";
`
@@ -453,7 +453,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
]
console.dir("CREATORRRRRR")
- console.dir(this.isCreator)
+ console.dir(this.isCreatorView)
return /*html*/ `
@@ -1999,7 +1999,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
if (id !== this.cline?.taskId) {
// non-current task
const { historyItem } = await this.getTaskWithId(id)
- await this.initClineWithHistoryItem(historyItem, this.isCreator) // clears existing task
+ await this.initClineWithHistoryItem(historyItem) // clears existing task
}
await this.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
}
From 06170605f857a8be36eba9aa38ec81d846e3c58f Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 18:01:23 -0400
Subject: [PATCH 07/12] Progress
---
src/activate/registerCommands.ts | 2 +-
src/api/providers/pearai.ts | 2 ++
src/shared/creator-mode.ts | 1 +
src/shared/modes.ts | 2 ++
webview-ui/src/creator/Creator.tsx | 10 ++++++++--
5 files changed, 14 insertions(+), 3 deletions(-)
create mode 100644 src/shared/creator-mode.ts
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 650fcd7249a..434b55933ca 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -92,7 +92,7 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
args.text = executePlanTemplate
- await sidebarProvider.initClineWithTask(args.text, undefined, args.creatorMode)
+ await sidebarProvider.initClineWithTask(args.text, undefined, true)
// await sidebarProvider.postMessageToWebview({
// type: "invoke",
diff --git a/src/api/providers/pearai.ts b/src/api/providers/pearai.ts
index 6a4b7a360bc..21c6ed9d57d 100644
--- a/src/api/providers/pearai.ts
+++ b/src/api/providers/pearai.ts
@@ -18,6 +18,8 @@ export class PearAiHandler {
constructor(options: ApiHandlerOptions) {
console.dir("PearAI Handler initialized with creatorMode:", options.creatorMode)
+ console.dir("PearAI Handler initialized with pearaiApiKey:")
+ console.dir(options.pearaiApiKey)
if (!options.pearaiApiKey) {
vscode.window.showErrorMessage("PearAI API key not found.", "Login to PearAI").then(async (selection) => {
if (selection === "Login to PearAI") {
diff --git a/src/shared/creator-mode.ts b/src/shared/creator-mode.ts
new file mode 100644
index 00000000000..7a4c1568702
--- /dev/null
+++ b/src/shared/creator-mode.ts
@@ -0,0 +1 @@
+export const CREATOR_MODE_PLANNING_PROMPT = `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. Focus on breaking down complex tasks into manageable steps, considering technical requirements, potential challenges, and best practices. The plan should be clear enough that it can be directly implemented by switching to Code mode afterward. (Directly write the plan to a markdown file instead of showing it as normal response.)\n\nOnce you create and write the plan, you mark the task as completed. You only make plans and you should not ask or switch to any other mode.`
\ No newline at end of file
diff --git a/src/shared/modes.ts b/src/shared/modes.ts
index 4bc586d9774..649c5447cd8 100644
--- a/src/shared/modes.ts
+++ b/src/shared/modes.ts
@@ -1,6 +1,7 @@
import * as vscode from "vscode"
import { TOOL_GROUPS, ToolGroup, ALWAYS_AVAILABLE_TOOLS } from "./tool-groups"
import { addCustomInstructions } from "../core/prompts/sections/custom-instructions"
+import { CREATOR_MODE_PLANNING_PROMPT } from "./creator-mode"
// Mode types
export type Mode = string
@@ -80,6 +81,7 @@ export const modes: readonly ModeConfig[] = [
roleDefinition:
"You are PearAI Agent (Powered by Roo Code / Cline), a creative and systematic software architect focused on turning high-level ideas into actionable plans. Your primary goal is to help users transform their ideas into structured action plans.",
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
+ customInstructions: CREATOR_MODE_PLANNING_PROMPT,
},
{
slug: "code",
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index 907429290ac..d6990b33b8e 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -88,7 +88,10 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const [isAtBottom, setIsAtBottom] = useState(false)
const [wasStreaming, setWasStreaming] = useState(false)
- const [editingFilePath, setEditingFilePath] = useState(null)
+ const [editingFilePath, setEditingFilePath] = useState(() => {
+ console.log('Initial editingFilePath:', null)
+ return null
+ })
const [includePlanningPhase, setIncludePlanningPhase] = useState(true)
// UI layout depends on the last 2 messages
@@ -97,6 +100,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const secondLastMessage = useMemo(() => messages.at(-2), [messages])
const handleEditPlan = useCallback((path: string) => {
+ console.log('Setting editingFilePath:', path)
setEditingFilePath(path)
}, [])
@@ -422,6 +426,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
case "completion_result":
case "resume_completed_task":
console.log("I AM IN resume_completed_task", includePlanningPhase)
+ console.log("I AM IN resume_completed_task HERES THE PATH", editingFilePath)
if (includePlanningPhase) {
vscode.postMessage({
type: "invoke",
@@ -1287,7 +1292,8 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
isNewTask={taskHistory.length === 0}
/>
- {editingFilePath && setEditingFilePath(null)} />}
+ {editingFilePath && {
+ }} />}
)
}
From 68ad3b55bc4af0dced062259998508ce2f204e2f Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 18:30:21 -0400
Subject: [PATCH 08/12] Progress
---
webview-ui/src/creator/Creator.tsx | 46 +++++++++++++++---------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index d6990b33b8e..31298f79ead 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -1057,20 +1057,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
className={`min-w-2xl ${task ? "max-w-2xl" : "max-w-5xl"} mx-auto flex justify-center borderr border-solid`}>
{!task && (
<>
-
-
- {
- const newValue = !includePlanningPhase;
- console.log('Checkbox changed - includePlanningPhase:', newValue);
- setIncludePlanningPhase(newValue);
- }}
- >
- Include Planning Phase
-
-
-
@@ -1110,15 +1096,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
// This ensures it takes its natural height when there's space
// but becomes scrollable when the viewport is too small
*/}
- {!task && (
-
- )}
{task && (
<>
@@ -1291,6 +1268,29 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setMode={setMode}
isNewTask={taskHistory.length === 0}
/>
+
+
+ {
+ const newValue = !includePlanningPhase;
+ console.log('Checkbox changed - includePlanningPhase:', newValue);
+ setIncludePlanningPhase(newValue);
+ }}
+ >
+ Include Planning Phase
+
+
+
+ {!task && (
+
+ )}
{editingFilePath && {
}} />}
From ca25ed6aa71628314964e4f154a0a6bd3e1e1512 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 18:37:37 -0400
Subject: [PATCH 09/12] Progress
---
webview-ui/src/creator/Creator.tsx | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/webview-ui/src/creator/Creator.tsx b/webview-ui/src/creator/Creator.tsx
index 31298f79ead..59a930121aa 100644
--- a/webview-ui/src/creator/Creator.tsx
+++ b/webview-ui/src/creator/Creator.tsx
@@ -437,18 +437,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
includePlanning: true
},
})
- } else {
- // When skipping planning, send directly to agent sidebar
- vscode.postMessage({
- type: "invoke",
- invoke: "executeCommand",
- command: "roo-cline.createInAgent",
- args: {
- text: lastMessage?.text || "",
- mode: "code",
- creatorMode: true
- },
- })
}
break
}
@@ -1319,3 +1307,4 @@ const ScrollToBottomButton = styled.div`
`
export default ChatView
+
From 81b99e9faddc6f82daffbee38f4eaf984bda4677 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sat, 29 Mar 2025 19:32:26 -0400
Subject: [PATCH 10/12] Working
---
src/activate/registerCommands.ts | 13 -------------
src/core/webview/ClineProvider.ts | 5 ++---
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 434b55933ca..26ac39eb95a 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -55,13 +55,6 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
await sidebarProvider.initClineWithTask(args.text, undefined, args.creatorMode)
-
- // // Send the completion result directly
- // await sidebarProvider.postMessageToWebview({
- // type: "invoke",
- // invoke: "sendMessage",
- // text: args.text,
- // })
}
},
"roo-cline.executeCreatorPlan": async (args: any) => {
@@ -93,12 +86,6 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
args.text = executePlanTemplate
await sidebarProvider.initClineWithTask(args.text, undefined, true)
-
- // await sidebarProvider.postMessageToWebview({
- // type: "invoke",
- // invoke: "sendMessage",
- // text: executePlanTemplate,
- // })
}
},
}
diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts
index 9eae255ea27..0b6ac3466d7 100644
--- a/src/core/webview/ClineProvider.ts
+++ b/src/core/webview/ClineProvider.ts
@@ -356,7 +356,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
provider: this,
apiConfiguration: {
...apiConfiguration,
- creatorMode: mode === "creator" || creatorMode,
+ creatorMode: creatorMode,
},
customInstructions: effectiveInstructions,
enableDiff: diffEnabled,
@@ -389,7 +389,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
provider: this,
apiConfiguration: {
...apiConfiguration,
- creatorMode: mode === "creator" || creatorMode,
+ creatorMode: creatorMode,
},
customInstructions: effectiveInstructions,
enableDiff: diffEnabled,
@@ -1820,7 +1820,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
if (this.cline) {
this.cline.api = buildApiHandler({
...apiConfiguration,
- creatorMode: mode === "creator",
})
}
}
From a522ddbd5b18d6179795f715f34fb6e8747057ee Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sun, 30 Mar 2025 00:23:58 -0400
Subject: [PATCH 11/12] Removed prints
---
src/api/providers/pearai.ts | 3 -
src/core/webview/ClineProvider.ts | 4 --
src/integrations/editor/DiffViewProvider.ts | 4 +-
src/shared/api.ts | 4 +-
.../src/components/mcp/McpEnabledToggle.tsx | 2 +-
webview-ui/src/components/mcp/McpView.tsx | 4 +-
.../src/components/prompts/PromptsView.tsx | 4 +-
webview-ui/src/creator/Creator.tsx | 57 ++++++++-----------
8 files changed, 34 insertions(+), 48 deletions(-)
diff --git a/src/api/providers/pearai.ts b/src/api/providers/pearai.ts
index 21c6ed9d57d..4a90eccfb64 100644
--- a/src/api/providers/pearai.ts
+++ b/src/api/providers/pearai.ts
@@ -17,9 +17,6 @@ export class PearAiHandler {
private handler!: AnthropicHandler | DeepSeekHandler
constructor(options: ApiHandlerOptions) {
- console.dir("PearAI Handler initialized with creatorMode:", options.creatorMode)
- console.dir("PearAI Handler initialized with pearaiApiKey:")
- console.dir(options.pearaiApiKey)
if (!options.pearaiApiKey) {
vscode.window.showErrorMessage("PearAI API key not found.", "Login to PearAI").then(async (selection) => {
if (selection === "Login to PearAI") {
diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts
index 0b6ac3466d7..9ac96e2332b 100644
--- a/src/core/webview/ClineProvider.ts
+++ b/src/core/webview/ClineProvider.ts
@@ -347,9 +347,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
experiments,
} = await this.getState()
- console.log("IM IN INIT CLINE mode: ", mode)
- console.log("IM IN INIT CLINE creatorMode", creatorMode)
-
const modePrompt = customModePrompts?.[mode] as PromptComponent
const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")
this.cline = new Cline({
@@ -1667,7 +1664,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
* @param newMode The mode to switch to
*/
public async handleModeSwitch(newMode: Mode, creatorMode?: boolean) {
- console.log("I AM IN handleModeSwitch and creatorMode is", creatorMode)
await this.updateGlobalState("mode", newMode)
// Load the saved API config for the new mode if it exists
diff --git a/src/integrations/editor/DiffViewProvider.ts b/src/integrations/editor/DiffViewProvider.ts
index ee24d7db4ee..56d20cf630f 100644
--- a/src/integrations/editor/DiffViewProvider.ts
+++ b/src/integrations/editor/DiffViewProvider.ts
@@ -158,7 +158,7 @@ export class DiffViewProvider {
Getting diagnostics before and after the file edit is a better approach than
automatically tracking problems in real-time. This method ensures we only
report new problems that are a direct result of this specific edit.
- Since these are new problems resulting from Roo's edit, we know they're
+ Since these are new problems resulting from Agent's edit, we know they're
directly related to the work he's doing. This eliminates the risk of Roo
going off-task or getting distracted by unrelated issues, which was a problem
with the previous auto-debug approach. Some users' machines may be slow to
@@ -294,7 +294,7 @@ export class DiffViewProvider {
query: Buffer.from(this.originalContent ?? "").toString("base64"),
}),
uri,
- `${fileName}: ${fileExists ? "Original ↔ Roo's Changes" : "New File"} (Editable)`,
+ `${fileName}: ${fileExists ? "Original ↔ Agent's Changes" : "New File"} (Editable)`,
)
// This may happen on very slow machines ie project idx
setTimeout(() => {
diff --git a/src/shared/api.ts b/src/shared/api.ts
index 8f0ca78b135..408d7c1dddf 100644
--- a/src/shared/api.ts
+++ b/src/shared/api.ts
@@ -793,9 +793,9 @@ export const unboundDefaultModelInfo: ModelInfo = {
}
// CHANGE AS NEEDED FOR TESTING
// PROD:
-// export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
+export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
// DEV:
-export const PEARAI_URL = "http://localhost:8000/integrations/cline"
+// export const PEARAI_URL = "http://localhost:8000/integrations/cline"
// PearAI
export type PearAiModelId = keyof typeof pearAiModels
diff --git a/webview-ui/src/components/mcp/McpEnabledToggle.tsx b/webview-ui/src/components/mcp/McpEnabledToggle.tsx
index 9e7831ea2ba..74fa9bce0e2 100644
--- a/webview-ui/src/components/mcp/McpEnabledToggle.tsx
+++ b/webview-ui/src/components/mcp/McpEnabledToggle.tsx
@@ -25,7 +25,7 @@ const McpEnabledToggle = () => {
color: "var(--vscode-descriptionForeground)",
}}>
When enabled, Roo will be able to interact with MCP servers for advanced functionality. If you're not
- using MCP, you can disable this to reduce Roo's token usage.
+ using MCP, you can disable this to reduce Agent's token usage.
)
diff --git a/webview-ui/src/components/mcp/McpView.tsx b/webview-ui/src/components/mcp/McpView.tsx
index adb6b47343d..778555f94e9 100644
--- a/webview-ui/src/components/mcp/McpView.tsx
+++ b/webview-ui/src/components/mcp/McpView.tsx
@@ -63,7 +63,7 @@ const McpView = ({ onDone }: McpViewProps) => {
Model Context Protocol
{" "}
enables communication with locally running MCP servers that provide additional tools and resources
- to extend Roo's capabilities. You can use{" "}
+ to extend Agent's capabilities. You can use{" "}
community-made servers
{" "}
@@ -91,7 +91,7 @@ const McpView = ({ onDone }: McpViewProps) => {
color: "var(--vscode-descriptionForeground)",
}}>
When enabled, Roo can help you create new MCP servers via commands like "add a new tool
- to...". If you don't need to create MCP servers you can disable this to reduce Roo's
+ to...". If you don't need to create MCP servers you can disable this to reduce Agent's
token usage.
diff --git a/webview-ui/src/components/prompts/PromptsView.tsx b/webview-ui/src/components/prompts/PromptsView.tsx
index 061fa789de4..31a7dd5b115 100644
--- a/webview-ui/src/components/prompts/PromptsView.tsx
+++ b/webview-ui/src/components/prompts/PromptsView.tsx
@@ -688,7 +688,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
)}
- Define Roo's expertise and personality for this mode. This description shapes how Roo
+ Define Agent's expertise and personality for this mode. This description shapes how Roo
presents itself and approaches tasks.
{
color: "var(--vscode-descriptionForeground)",
marginBottom: "8px",
}}>
- Define Roo's expertise and personality for this mode.
+ Define Agent's expertise and personality for this mode.
(false)
const [editingFilePath, setEditingFilePath] = useState(() => {
- console.log('Initial editingFilePath:', null)
return null
})
const [includePlanningPhase, setIncludePlanningPhase] = useState(true)
@@ -100,7 +99,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const secondLastMessage = useMemo(() => messages.at(-2), [messages])
const handleEditPlan = useCallback((path: string) => {
- console.log('Setting editingFilePath:', path)
setEditingFilePath(path)
}, [])
@@ -201,7 +199,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setTextAreaDisabled(isPartial)
setClineAsk("completion_result")
setEnableButtons(!isPartial)
- setPrimaryButtonText("Create in Agent")
+ setPrimaryButtonText("Create!")
setSecondaryButtonText(undefined)
break
case "resume_task":
@@ -216,7 +214,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setTextAreaDisabled(false)
setClineAsk("resume_completed_task")
setEnableButtons(true)
- setPrimaryButtonText("Create in Agent")
+ setPrimaryButtonText("Create!")
setSecondaryButtonText(undefined)
setDidClickCancel(false)
break
@@ -318,12 +316,11 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
text = text.trim()
if (text || images.length > 0) {
if (messages.length === 0) {
- console.log("I AM IN handleSendMessage messages is 0", includePlanningPhase)
if (includePlanningPhase) {
- console.log('Starting new task with planning phase');
+ console.log("Starting new task with planning phase")
vscode.postMessage({ type: "newTask", text, images })
} else {
- console.log('Skipping planning phase, sending directly to agent');
+ console.log("Skipping planning phase, sending directly to agent")
vscode.postMessage({
type: "invoke",
invoke: "executeCommand",
@@ -331,7 +328,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
args: {
text,
mode: "code",
- creatorMode: true
+ creatorMode: true,
},
})
}
@@ -425,8 +422,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
break
case "completion_result":
case "resume_completed_task":
- console.log("I AM IN resume_completed_task", includePlanningPhase)
- console.log("I AM IN resume_completed_task HERES THE PATH", editingFilePath)
if (includePlanningPhase) {
vscode.postMessage({
type: "invoke",
@@ -434,7 +429,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
command: "roo-cline.executeCreatorPlan",
args: {
filePath: editingFilePath,
- includePlanning: true
+ includePlanning: true,
},
})
}
@@ -445,7 +440,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setEnableButtons(false)
disableAutoScrollRef.current = false
},
- [clineAsk, editingFilePath],
+ [clineAsk, editingFilePath, includePlanningPhase],
)
const handleSecondaryButtonClick = useCallback(
@@ -1045,7 +1040,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
className={`min-w-2xl ${task ? "max-w-2xl" : "max-w-5xl"} mx-auto flex justify-center borderr border-solid`}>
{!task && (
<>
-
+
@@ -1176,19 +1173,19 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
padding: `${primaryButtonText || secondaryButtonText || isStreaming ? "10" : "0"}px 0px 0px 0px`,
}}>
{primaryButtonText && !isStreaming && (
-
handlePrimaryButtonClick(inputValue, selectedImages)}>
- {primaryButtonText}
-
+ marginRight: secondaryButtonText ? "6px" : "0",
+ borderRadius: 8,
+ }}
+ onClick={(e) => handlePrimaryButtonClick(inputValue, selectedImages)}>
+ {primaryButtonText}
+
)}
{(secondaryButtonText || isStreaming) && (
{
- const newValue = !includePlanningPhase;
- console.log('Checkbox changed - includePlanningPhase:', newValue);
- setIncludePlanningPhase(newValue);
- }}
- >
+ const newValue = !includePlanningPhase
+ setIncludePlanningPhase(newValue)
+ }}>
Include Planning Phase
@@ -1280,8 +1275,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
/>
)}
- {editingFilePath && {
- }} />}
+ {editingFilePath && {}} />}
)
}
@@ -1307,4 +1301,3 @@ const ScrollToBottomButton = styled.div`
`
export default ChatView
-
From dcc73f626240dc030927463c09999979afd6bc72 Mon Sep 17 00:00:00 2001
From: nang-dev
Date: Sun, 30 Mar 2025 00:25:30 -0400
Subject: [PATCH 12/12] Removed prints
---
src/activate/registerCommands.ts | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts
index 26ac39eb95a..1875c55e4ed 100644
--- a/src/activate/registerCommands.ts
+++ b/src/activate/registerCommands.ts
@@ -45,12 +45,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
const sidebarProvider = ClineProvider.getSidebarInstance()
if (sidebarProvider) {
// Start a new chat in the sidebar
- console.log("I AM IN createInAgent and creatorMode is", args.creatorMode)
vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
await sidebarProvider.clearTask()
- console.log("I AM IN about to call handleModeSwitch", args.creatorMode)
await sidebarProvider.handleModeSwitch("code", args.creatorMode)
- console.log("I AM IN just called handleModeSwitch", args.creatorMode)
await sidebarProvider.postStateToWebview()
await sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })