refactor(packages): rename rules-core to rules-engine
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import type { AgentsMdCache, DirectoryScanEntry, RuleFileCandidate, RuleScanCache, RuleScanCacheStats } from "./types";
|
||||
|
||||
export function createRuleScanCache(): RuleScanCache {
|
||||
const candidateCache = new Map<string, readonly RuleFileCandidate[]>();
|
||||
const directoryCache = new Map<string, readonly DirectoryScanEntry[]>();
|
||||
return {
|
||||
get: (key) => candidateCache.get(key),
|
||||
set: (key, value) => candidateCache.set(key, value),
|
||||
getDirScan: (dir) => directoryCache.get(dir),
|
||||
setDirScan: (dir, entries) => directoryCache.set(dir, entries),
|
||||
stats: (): RuleScanCacheStats => ({ candidateEntries: candidateCache.size, directoryEntries: directoryCache.size }),
|
||||
clear: () => {
|
||||
candidateCache.clear();
|
||||
directoryCache.clear();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function createAgentsMdCache(): AgentsMdCache {
|
||||
const cache = new Map<string, readonly string[]>();
|
||||
return {
|
||||
get: (key) => cache.get(key),
|
||||
set: (key, value) => cache.set(key, value),
|
||||
clear: () => cache.clear(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user