import type { KnowledgeSemanticSelfImproveInput, KnowledgeSemanticSelfImproveResult } from './types.js'; /** Default floor for background self-improvement scheduling (ms). */ export declare const DEFAULT_SELF_IMPROVE_MIN_DELAY_MS = 5000; /** Default zero-gap backoff window; matches the hourly reindex cadence (ms). */ export declare const DEFAULT_SELF_IMPROVE_ZERO_GAP_BACKOFF_MS = 3600000; /** * Max distinct scope keys with a pending background run. A burst across MORE * distinct scopes (the incident touched ~1,400 distinct sources) collapses * into one queued global sweep instead of N concurrent runs. */ export declare const MAX_PENDING_BACKGROUND_KEYS = 8; /** Hard bound on retained scheduling-state entries (evicted oldest-first). */ export declare const MAX_BACKGROUND_STATE_ENTRIES = 256; /** The coalescing scope key for a self-improve input. */ export declare function selfImprovementRunKey(input: KnowledgeSemanticSelfImproveInput): string; export interface BackgroundSelfImproveSchedulerDeps { /** Execute the run (the semantic service's selfImprove with stopWhenPaused). */ readonly run: (input: KnowledgeSemanticSelfImproveInput) => Promise; /** Whether a gap repairer is configured (no repairer = nothing to schedule). */ readonly enabled: () => boolean; /** Governor pause probe (rechecked at fire time). */ readonly isPaused?: (() => boolean) | undefined; /** Governor critical-tier admission gate. */ readonly admit?: ((label: string) => { allowed: boolean; reason?: string | undefined; }) | undefined; readonly minDelayMs: () => number; readonly backoffMs: () => number; readonly now: () => number; readonly schedule: (callback: () => void, delayMs: number) => void; } export declare class BackgroundSelfImproveScheduler { private readonly deps; private readonly state; constructor(deps: BackgroundSelfImproveSchedulerDeps); /** Drop settled state entries (not pending, backoff expired) and bound the map. */ private prune; queue(input: KnowledgeSemanticSelfImproveInput, delayMs?: number): void; } //# sourceMappingURL=background-scheduler.d.ts.map