@@ -52,7 +52,7 @@ import { parseMentions } from "./mentions"
5252import { AssistantMessageContent , parseAssistantMessage , ToolParamName , ToolUseName } from "./assistant-message"
5353import { formatResponse } from "./prompts/responses"
5454import { SYSTEM_PROMPT } from "./prompts/system"
55- import { modes , defaultModeSlug , getModeBySlug , parseSlashCommand } from "../shared/modes"
55+ import { modes , defaultModeSlug , getModeBySlug } from "../shared/modes"
5656import { truncateHalfConversation } from "./sliding-window"
5757import { ClineProvider , GlobalFileNames } from "./webview/ClineProvider"
5858import { detectCodeOmission } from "../integrations/editor/detect-omission"
@@ -77,29 +77,6 @@ export class Cline {
7777 private terminalManager : TerminalManager
7878 private urlContentFetcher : UrlContentFetcher
7979 private browserSession : BrowserSession
80-
81- /**
82- * Processes a message for slash commands and handles mode switching if needed.
83- * @param message The message to process
84- * @returns The processed message with slash command removed if one was present
85- */
86- private async handleSlashCommand ( message : string ) : Promise < string > {
87- if ( ! message ) return message
88-
89- const { customModes } = ( await this . providerRef . deref ( ) ?. getState ( ) ) ?? { }
90- const slashCommand = parseSlashCommand ( message , customModes )
91-
92- if ( slashCommand ) {
93- // Switch mode before processing the remaining message
94- const provider = this . providerRef . deref ( )
95- if ( provider ) {
96- await provider . handleModeSwitch ( slashCommand . modeSlug )
97- return slashCommand . remainingMessage
98- }
99- }
100-
101- return message
102- }
10380 private didEditFile : boolean = false
10481 customInstructions ?: string
10582 diffStrategy ?: DiffStrategy
@@ -378,11 +355,6 @@ export class Cline {
378355 }
379356
380357 async handleWebviewAskResponse ( askResponse : ClineAskResponse , text ?: string , images ?: string [ ] ) {
381- // Process slash command if present
382- if ( text ) {
383- text = await this . handleSlashCommand ( text )
384- }
385-
386358 this . askResponse = askResponse
387359 this . askResponseText = text
388360 this . askResponseImages = images
@@ -465,22 +437,6 @@ export class Cline {
465437 this . apiConversationHistory = [ ]
466438 await this . providerRef . deref ( ) ?. postStateToWebview ( )
467439
468- // Check for slash command if task is provided
469- if ( task ) {
470- const { customModes } = ( await this . providerRef . deref ( ) ?. getState ( ) ) ?? { }
471- const slashCommand = parseSlashCommand ( task , customModes )
472-
473- if ( slashCommand ) {
474- // Switch mode before processing the remaining message
475- const provider = this . providerRef . deref ( )
476- if ( provider ) {
477- await provider . handleModeSwitch ( slashCommand . modeSlug )
478- // Update task to be just the remaining message
479- task = slashCommand . remainingMessage
480- }
481- }
482- }
483-
484440 await this . say ( "text" , task , images )
485441
486442 let imageBlocks : Anthropic . ImageBlockParam [ ] = formatResponse . imageBlocks ( images )
0 commit comments