arela
Version:
AI-powered CTO with multi-agent orchestration, code summarization, visual testing (web + mobile) for blazing fast development.
61 lines • 1.83 kB
TypeScript
import type { SemanticContract } from "../extractor/types.js";
import type { TechnicalSummary } from "../synthesizer/types.js";
import type { CacheStats } from "./types.js";
export interface SemanticCacheOptions {
/**
* Override cache directory. Defaults to:
* <projectPath>/.arela/cache/summaries
*/
cacheDir?: string;
/**
* Time-to-live for entries in milliseconds.
* Defaults to 30 days.
*/
ttlMs?: number;
/**
* Maximum number of cache entries to keep.
* Defaults to 1000.
*/
maxEntries?: number;
/**
* Approximate price per LLM call in dollars,
* used for savings estimates.
*/
pricePerCall?: number;
/**
* Optional logger. Defaults to console.log.
*/
logger?: (message: string) => void;
}
export declare class SemanticCache {
private readonly cacheDir;
private readonly ttlMs;
private readonly maxEntries;
private readonly pricePerCall;
private readonly log;
private stats;
constructor(projectPath: string, options?: SemanticCacheOptions);
/**
* Get cached summary if semantic contract unchanged.
* Returns null on cache miss or expired entry.
*/
get(contract: SemanticContract): Promise<TechnicalSummary | null>;
/**
* Store summary in cache (overwriting any existing entry).
*/
set(contract: SemanticContract, summary: TechnicalSummary): Promise<void>;
/**
* Get cache statistics.
*/
getStats(): CacheStats;
/**
* Clear expired cache entries and return the number removed.
*/
cleanup(): Promise<number>;
/**
* Remove least-recently-cached entries when over size limit.
* Uses cachedAt as a proxy for recency.
*/
private enforceSizeLimit;
}
//# sourceMappingURL=semantic-cache.d.ts.map