diff --git a/core/core.ts b/core/core.ts index e31eb5c2e..3d1b2cc3c 100644 --- a/core/core.ts +++ b/core/core.ts @@ -435,6 +435,12 @@ export class Core { on("config/deleteRule", async (msg) => { try { const filepath = msg.data.filepath; + if ( + !isColocatedRulesFile(filepath) && + !isContinueConfigRelatedUri(filepath) + ) { + throw new Error("Only rule files can be deleted"); + } const fileExists = await this.ide.fileExists(filepath); if (fileExists) { await this.ide.removeFile(filepath);