diff --git a/src/shared/proto-conversions/file/rule-files-conversion.ts b/src/shared/proto-conversions/file/rule-files-conversion.ts deleted file mode 100644 index ed8a2b33..00000000 --- a/src/shared/proto-conversions/file/rule-files-conversion.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { RuleFileRequest } from "@shared/proto/cline/file" - -// Helper for creating delete requests -export const DeleteRuleFileRequest = { - create: (params: { rulePath: string; isGlobal: boolean; metadata?: any; type?: string }): RuleFileRequest => { - return RuleFileRequest.create({ - rulePath: params.rulePath, - isGlobal: params.isGlobal, - metadata: params.metadata, - type: params.type, - }) - }, -} - -// Helper for creating create requests -export const CreateRuleFileRequest = { - create: (params: { filename: string; isGlobal: boolean; metadata?: any; type?: string }): RuleFileRequest => { - return RuleFileRequest.create({ - filename: params.filename, - isGlobal: params.isGlobal, - metadata: params.metadata, - type: params.type, - }) - }, -} diff --git a/webview-ui/src/components/cline-rules/NewRuleRow.tsx b/webview-ui/src/components/cline-rules/NewRuleRow.tsx index 894c4d3f..4f113e64 100644 --- a/webview-ui/src/components/cline-rules/NewRuleRow.tsx +++ b/webview-ui/src/components/cline-rules/NewRuleRow.tsx @@ -1,4 +1,4 @@ -import { CreateRuleFileRequest } from "@shared/proto-conversions/file/rule-files-conversion" +import { RuleFileRequest } from "@shared/proto/index.cline" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { useEffect, useRef, useState } from "react" import { useClickAway } from "react-use" @@ -63,7 +63,7 @@ const NewRuleRow: React.FC = ({ isGlobal, ruleType }) => { try { await FileServiceClient.createRuleFile( - CreateRuleFileRequest.create({ + RuleFileRequest.create({ isGlobal, filename: finalFilename, type: ruleType || "cline", diff --git a/webview-ui/src/components/cline-rules/RuleRow.tsx b/webview-ui/src/components/cline-rules/RuleRow.tsx index 5df032fb..010fb181 100644 --- a/webview-ui/src/components/cline-rules/RuleRow.tsx +++ b/webview-ui/src/components/cline-rules/RuleRow.tsx @@ -1,5 +1,5 @@ import { StringRequest } from "@shared/proto/cline/common" -import { DeleteRuleFileRequest } from "@shared/proto-conversions/file/rule-files-conversion" +import { RuleFileRequest } from "@shared/proto/index.cline" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { FileServiceClient } from "@/services/grpc-client" @@ -64,9 +64,9 @@ const RuleRow: React.FC<{ const handleDeleteClick = () => { FileServiceClient.deleteRuleFile( - DeleteRuleFileRequest.create({ - rulePath: rulePath, - isGlobal: isGlobal, + RuleFileRequest.create({ + rulePath, + isGlobal, type: ruleType || "cline", }), ).catch((err) => console.error("Failed to delete rule file:", err))