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

Function handleRequestRules

src/core/webview/rulesMessageHandler.ts:20–31  ·  view source on GitHub ↗
(provider: ClineProvider, cwd: string)

Source from the content-addressed store, hash-verified

18}
19
20export async function handleRequestRules(provider: ClineProvider, cwd: string): Promise<RuleMetadata[]> {
21 try {
22 const modes = await provider.getModes()
23 const rules = await getRules(cwd, { modes })
24 await provider.postMessageToWebview({ type: "rules", rules })
25 return rules
26 } catch (error) {
27 provider.log(`Error fetching rules: ${getErrorMessage(error)}`)
28 await provider.postMessageToWebview({ type: "rules", rules: [] })
29 return []
30 }
31}
32
33export async function handleCreateRule(
34 provider: ClineProvider,

Callers 2

webviewMessageHandlerFunction · 0.90

Calls 5

getRulesFunction · 0.90
postMessageToWebviewMethod · 0.80
getErrorMessageFunction · 0.70
getModesMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected