UNPKG

arela

Version:

AI-powered CTO with multi-agent orchestration, code summarization, visual testing (web + mobile) for blazing fast development.

70 lines 1.94 kB
/** * Checks if memory (RAG index, Graph DB) is stale and auto-updates if needed * * Triggers: * - On every CLI command (via preAction hook) * - On MCP server start * - Before expensive operations (search, analyze) * * Strategy: * - Check file age every 5 minutes (don't spam) * - If >1 hour old → update in background (non-blocking) * - If >24 hours old → update now (blocking, critical) */ export declare class StalenessChecker { private lastCheck; private checkInterval; private maxAge; private blockingThreshold; private cwd; constructor(options?: { cwd?: string; checkInterval?: number; maxAge?: number; blockingThreshold?: number; }); /** * Check if memory is stale and update if needed * Called on every CLI command via preAction hook */ checkAndUpdate(options?: { silent?: boolean; }): Promise<void>; /** * Get age of file in milliseconds * Returns Infinity if file doesn't exist */ private getFileAge; /** * Format age in human-readable format */ private formatAge; /** * Update memory in background (non-blocking) * Spawns detached process that continues after parent exits */ private updateInBackground; /** * Update memory now (blocking) * Waits for update to complete before continuing */ private updateBlocking; /** * Force update now (for manual refresh) */ forceUpdate(): Promise<void>; /** * Get staleness info (for status commands) */ getStalenessInfo(): { ragAge: number; graphAge: number; isStale: boolean; isVeryStale: boolean; }; } /** * Get global staleness checker instance */ export declare function getStalenessChecker(options?: ConstructorParameters<typeof StalenessChecker>[0]): StalenessChecker; //# sourceMappingURL=staleness-checker.d.ts.map