diff --git a/evals/packages/types/src/roo-code.ts b/evals/packages/types/src/roo-code.ts index 3984d548828..4470d2c3ecb 100644 --- a/evals/packages/types/src/roo-code.ts +++ b/evals/packages/types/src/roo-code.ts @@ -706,7 +706,6 @@ export const clineAsks = [ "mistake_limit_reached", "browser_action_launch", "use_mcp_server", - "finishTask", ] as const export const clineAskSchema = z.enum(clineAsks) @@ -716,7 +715,6 @@ export type ClineAsk = z.infer // ClineSay export const clineSays = [ - "task", "error", "api_req_started", "api_req_finished", @@ -729,15 +727,12 @@ export const clineSays = [ "user_feedback", "user_feedback_diff", "command_output", - "tool", "shell_integration_warning", "browser_action", "browser_action_result", - "command", "mcp_server_request_started", "mcp_server_response", - "new_task_started", - "new_task", + "subtask_result", "checkpoint_saved", "rooignore_error", "diff_error", diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index a03d05ff73a..f2f7da56098 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -307,12 +307,10 @@ type ClineMessage = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" - | "finishTask" ) | undefined say?: | ( - | "task" | "error" | "api_req_started" | "api_req_finished" @@ -325,15 +323,11 @@ type ClineMessage = { | "user_feedback" | "user_feedback_diff" | "command_output" - | "tool" | "shell_integration_warning" | "browser_action" | "browser_action_result" - | "command" | "mcp_server_request_started" | "mcp_server_response" - | "new_task_started" - | "new_task" | "subtask_result" | "checkpoint_saved" | "rooignore_error" @@ -388,12 +382,10 @@ type RooCodeEvents = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" - | "finishTask" ) | undefined say?: | ( - | "task" | "error" | "api_req_started" | "api_req_finished" @@ -406,15 +398,11 @@ type RooCodeEvents = { | "user_feedback" | "user_feedback_diff" | "command_output" - | "tool" | "shell_integration_warning" | "browser_action" | "browser_action_result" - | "command" | "mcp_server_request_started" | "mcp_server_response" - | "new_task_started" - | "new_task" | "subtask_result" | "checkpoint_saved" | "rooignore_error" diff --git a/src/exports/types.ts b/src/exports/types.ts index a89b08c7601..9582a212796 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -312,12 +312,10 @@ type ClineMessage = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" - | "finishTask" ) | undefined say?: | ( - | "task" | "error" | "api_req_started" | "api_req_finished" @@ -330,15 +328,11 @@ type ClineMessage = { | "user_feedback" | "user_feedback_diff" | "command_output" - | "tool" | "shell_integration_warning" | "browser_action" | "browser_action_result" - | "command" | "mcp_server_request_started" | "mcp_server_response" - | "new_task_started" - | "new_task" | "subtask_result" | "checkpoint_saved" | "rooignore_error" @@ -397,12 +391,10 @@ type RooCodeEvents = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" - | "finishTask" ) | undefined say?: | ( - | "task" | "error" | "api_req_started" | "api_req_finished" @@ -415,15 +407,11 @@ type RooCodeEvents = { | "user_feedback" | "user_feedback_diff" | "command_output" - | "tool" | "shell_integration_warning" | "browser_action" | "browser_action_result" - | "command" | "mcp_server_request_started" | "mcp_server_response" - | "new_task_started" - | "new_task" | "subtask_result" | "checkpoint_saved" | "rooignore_error" diff --git a/src/schemas/index.ts b/src/schemas/index.ts index f08ae6d2fbe..6874783f48d 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -653,7 +653,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { customSupportPrompts: undefined, enhancementApiConfigId: undefined, cachedChromeHostUrl: undefined, - historyPreviewCollapsed: undefined, + historyPreviewCollapsed: undefined, } export const GLOBAL_SETTINGS_KEYS = Object.keys(globalSettingsRecord) as Keys[] @@ -741,7 +741,6 @@ export const clineAsks = [ "mistake_limit_reached", "browser_action_launch", "use_mcp_server", - "finishTask", ] as const export const clineAskSchema = z.enum(clineAsks) @@ -751,7 +750,6 @@ export type ClineAsk = z.infer // ClineSay export const clineSays = [ - "task", "error", "api_req_started", "api_req_finished", @@ -764,15 +762,11 @@ export const clineSays = [ "user_feedback", "user_feedback_diff", "command_output", - "tool", "shell_integration_warning", "browser_action", "browser_action_result", - "command", "mcp_server_request_started", "mcp_server_response", - "new_task_started", - "new_task", "subtask_result", "checkpoint_saved", "rooignore_error", diff --git a/src/shared/__tests__/combineApiRequests.test.ts b/src/shared/__tests__/combineApiRequests.test.ts index ea4e8b0b7b9..4a939e5f530 100644 --- a/src/shared/__tests__/combineApiRequests.test.ts +++ b/src/shared/__tests__/combineApiRequests.test.ts @@ -1,7 +1,7 @@ // npx jest src/shared/__tests__/combineApiRequests.test.ts import { combineApiRequests } from "../combineApiRequests" -import { ClineMessage } from "../ExtensionMessage" +import { ClineMessage, ClineSay } from "../ExtensionMessage" describe("combineApiRequests", () => { // Helper function to create a basic api_req_started message @@ -22,15 +22,10 @@ describe("combineApiRequests", () => { // Helper function to create a non-API message const createOtherMessage = ( - say: "text" | "task" | "error" | "command" = "text", + say: ClineSay = "text", text: string = "Hello world", ts: number = 999, - ): ClineMessage => ({ - type: "say", - say, - text, - ts, - }) + ): ClineMessage => ({ type: "say", say, text, ts }) describe("Basic functionality", () => { it("should combine a pair of api_req_started and api_req_finished messages", () => { @@ -141,7 +136,7 @@ describe("combineApiRequests", () => { it("should return original array when no API request messages exist", () => { const messages: ClineMessage[] = [ createOtherMessage("text", "Message 1", 999), - createOtherMessage("task", "Task message", 1000), + createOtherMessage("text", "Task message", 1000), createOtherMessage("error", "Error message", 1001), ] diff --git a/webview-ui/src/__tests__/ContextWindowProgress.test.tsx b/webview-ui/src/__tests__/ContextWindowProgress.test.tsx index c43ecd5d5ed..3e8373842a2 100644 --- a/webview-ui/src/__tests__/ContextWindowProgress.test.tsx +++ b/webview-ui/src/__tests__/ContextWindowProgress.test.tsx @@ -49,7 +49,7 @@ describe("ContextWindowProgress", () => { const renderComponent = (props: Record) => { // Create a simple mock of the task that avoids importing the actual types const defaultProps = { - task: { ts: Date.now(), type: "say" as const, say: "task" as const, text: "Test task" }, + task: { ts: Date.now(), type: "say" as const, say: "text" as const, text: "Test task" }, tokensIn: 100, tokensOut: 50, doesModelSupportPromptCache: true, diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index ad98f328877..046944a95a6 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -253,12 +253,10 @@ export const ChatRowContent = ({ overflowWrap: "anywhere", } - const tool = useMemo(() => { - if (message.ask === "tool" || message.say === "tool") { - return safeJsonParse(message.text) - } - return null - }, [message.ask, message.say, message.text]) + const tool = useMemo( + () => (message.ask === "tool" ? safeJsonParse(message.text) : null), + [message.ask, message.text], + ) const followUpData = useMemo(() => { if (message.type === "ask" && message.ask === "followup" && !message.partial) { diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index af002465a4f..20ffc73c3f0 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -289,7 +289,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction { value={(() => { const customMode = findModeBySlug(visualMode, customModes) const prompt = customModePrompts?.[visualMode] as PromptComponent - return customMode?.roleDefinition ?? prompt?.roleDefinition ?? getRoleDefinition(visualMode) + return ( + customMode?.roleDefinition ?? + prompt?.roleDefinition ?? + getRoleDefinition(visualMode) + ) })()} onChange={(e) => { const value =