MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / handleOpenRulesDirectory

Function handleOpenRulesDirectory

src/core/webview/rulesMessageHandler.ts:100–118  ·  view source on GitHub ↗
(
	provider: ClineProvider,
	cwd: string,
	message: WebviewMessage,
)

Source from the content-addressed store, hash-verified

98}
99
100export async function handleOpenRulesDirectory(
101 provider: ClineProvider,
102 cwd: string,
103 message: WebviewMessage,
104): Promise<void> {
105 try {
106 const values = message.values ?? {}
107 const directoryPath = getRulesDirectoryPath(cwd, {
108 scope: values.scope,
109 kind: values.kind,
110 modeSlug: values.modeSlug,
111 } as CreateRuleInput)
112 openFile(directoryPath)
113 } catch (error) {
114 const errorMessage = getErrorMessage(error)
115 provider.log(`Error opening rules directory: ${errorMessage}`)
116 vscode.window.showErrorMessage(`Failed to open rules directory: ${errorMessage}`)
117 }
118}
119
120async function refreshRules(provider: ClineProvider, cwd: string): Promise<RuleMetadata[]> {
121 const modes = await provider.getModes()

Callers 2

webviewMessageHandlerFunction · 0.90

Calls 5

getRulesDirectoryPathFunction · 0.90
openFileFunction · 0.90
getErrorMessageFunction · 0.70
logMethod · 0.65
showErrorMessageMethod · 0.45

Tested by

no test coverage detected