@@ -48,7 +48,8 @@ import {
4848} from "../storage/state"
4949import { Task , cwd } from "../task"
5050import { ClineRulesToggles } from "@shared/cline-rules"
51- import { createRuleFile , refreshClineRulesToggles } from "../context/instructions/user-instructions/cline-rules"
51+ import { refreshClineRulesToggles } from "@core/context/instructions/user-instructions/cline-rules"
52+ import { refreshExternalRulesToggles } from "@core/context/instructions/user-instructions/external-rules"
5253
5354/*
5455https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
@@ -375,6 +376,7 @@ export class Controller {
375376 break
376377 case "refreshClineRules" :
377378 await refreshClineRulesToggles ( this . context , cwd )
379+ await refreshExternalRulesToggles ( this . context , cwd )
378380 await this . postStateToWebview ( )
379381 break
380382 case "openInBrowser" :
@@ -516,6 +518,32 @@ export class Controller {
516518 }
517519 break
518520 }
521+ case "toggleWindsurfRule" : {
522+ const { rulePath, enabled } = message
523+ if ( rulePath && typeof enabled === "boolean" ) {
524+ const toggles =
525+ ( ( await getWorkspaceState ( this . context , "localWindsurfRulesToggles" ) ) as ClineRulesToggles ) || { }
526+ toggles [ rulePath ] = enabled
527+ await updateWorkspaceState ( this . context , "localWindsurfRulesToggles" , toggles )
528+ await this . postStateToWebview ( )
529+ } else {
530+ console . error ( "toggleWindsurfRule: Missing or invalid parameters" )
531+ }
532+ break
533+ }
534+ case "toggleCursorRule" : {
535+ const { rulePath, enabled } = message
536+ if ( rulePath && typeof enabled === "boolean" ) {
537+ const toggles =
538+ ( ( await getWorkspaceState ( this . context , "localCursorRulesToggles" ) ) as ClineRulesToggles ) || { }
539+ toggles [ rulePath ] = enabled
540+ await updateWorkspaceState ( this . context , "localCursorRulesToggles" , toggles )
541+ await this . postStateToWebview ( )
542+ } else {
543+ console . error ( "toggleCursorRule: Missing or invalid parameters" )
544+ }
545+ break
546+ }
519547 case "requestTotalTasksSize" : {
520548 this . refreshTotalTasksSize ( )
521549 break
@@ -1765,6 +1793,12 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont
17651793 const localClineRulesToggles =
17661794 ( ( await getWorkspaceState ( this . context , "localClineRulesToggles" ) ) as ClineRulesToggles ) || { }
17671795
1796+ const localWindsurfRulesToggles =
1797+ ( ( await getWorkspaceState ( this . context , "localWindsurfRulesToggles" ) ) as ClineRulesToggles ) || { }
1798+
1799+ const localCursorRulesToggles =
1800+ ( ( await getWorkspaceState ( this . context , "localCursorRulesToggles" ) ) as ClineRulesToggles ) || { }
1801+
17681802 return {
17691803 version : this . context . extension ?. packageJSON ?. version ?? "" ,
17701804 apiConfiguration,
@@ -1789,6 +1823,8 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont
17891823 vscMachineId : vscode . env . machineId ,
17901824 globalClineRulesToggles : globalClineRulesToggles || { } ,
17911825 localClineRulesToggles : localClineRulesToggles || { } ,
1826+ localWindsurfRulesToggles : localWindsurfRulesToggles || { } ,
1827+ localCursorRulesToggles : localCursorRulesToggles || { } ,
17921828 shellIntegrationTimeout,
17931829 }
17941830 }
0 commit comments