import type Database from 'better-sqlite3'; import { ForgettingPolicyService } from '../../../domains/forgetting/services/forgetting-policy-service.js'; import { getPerformanceMonitor } from '../../../domains/monitoring/services/performance-monitor.js'; import type { RuntimeDiagnosticsLogger } from '../../../domains/monitoring/services/runtime-diagnostics-logger.js'; import { ConsolidationScoreWorker } from '../../../workers/consolidation-score-worker.js'; import type { IntrospectionScanCache } from '../../../domains/memory/services/introspection-scan-cache.js'; import type { SleepConsolidationService } from '../../../domains/consolidation/services/sleep-consolidation-service.js'; import type { TelemetryRepository } from '../../../domains/telemetry/repositories/telemetry-repository.js'; import type { AnchorManager } from '../../../domains/anchor/services/anchor/anchor-manager.js'; import type { BatchJobConfig, BatchJobResult } from '../batch-scheduler-types.js'; import { BatchJobExecutionCoordinator } from '../batch-job-execution-coordinator.js'; import { JobQueue } from '../job-queue.js'; import { RetryManager } from '../retry-manager.js'; import { HealthChecker } from '../health-checker.js'; import { FileLogger } from '../file-logger.js'; import { RelationValidatorExecutor } from '../relation-validator-executor.js'; import type { BatchSchedulerLogMethod } from '../handlers/batch-scheduler-run-context.js'; import { type BatchSchedulerContextSource, type BatchSchedulerRecurringContextSource } from './batch-scheduler-context.js'; import type { BatchJobExecutionCoordinator as Coordinator } from '../batch-job-execution-coordinator.js'; export interface BatchSchedulerDependencyOverrides { jobQueue?: JobQueue; retryManager?: RetryManager; healthChecker?: HealthChecker; fileLogger?: FileLogger; relationValidatorExecutor?: RelationValidatorExecutor; diagnosticsLogger?: Pick; } export interface BatchSchedulerCoordinatorCallbacks { getConfig: () => BatchJobConfig; getIsRunning: () => boolean; lastExecution: Map; totalExecutions: Map; lastJobRunMeta: Map; writeDiagnosticsEvent: (event: Record) => Promise; log: BatchSchedulerLogMethod; checkSchedulerHealth: () => Promise; } export interface BatchSchedulerWiringResult { config: BatchJobConfig; forgettingService: ForgettingPolicyService; performanceMonitor: ReturnType; consolidationScoreWorker: ConsolidationScoreWorker | null; jobQueue: JobQueue; retryManager: RetryManager; healthChecker: HealthChecker; fileLogger: FileLogger; relationValidatorExecutor: RelationValidatorExecutor; diagnosticsLogger?: Pick; jobExecutionCoordinator: Coordinator; } export interface BatchSchedulerServiceState { db: Database.Database | null; config: BatchJobConfig; forgettingService: ForgettingPolicyService; performanceMonitor: ReturnType; healthChecker: HealthChecker; jobQueue: JobQueue; fileLogger: FileLogger; relationValidatorExecutor: RelationValidatorExecutor; consolidationScoreWorker: ConsolidationScoreWorker | null; introspectionScanCache: IntrospectionScanCache | null; sleepConsolidationService: SleepConsolidationService | null; telemetryCleanupRepository: TelemetryRepository | null; tripleExtractionBatchJob: BatchSchedulerContextSource['tripleExtractionBatchJob']; qualityMeasurementBatchJob: BatchSchedulerContextSource['qualityMeasurementBatchJob']; sleepConsolidationBatchJob: BatchSchedulerContextSource['sleepConsolidationBatchJob']; telemetryCleanupBatchJob: BatchSchedulerContextSource['telemetryCleanupBatchJob']; lastExecution: Map; totalExecutions: Map; anchorManager: AnchorManager | null; diagnosticsLogger?: Pick; startTime: Date | null; } export interface BatchSchedulerRecurringState { intervals: Map>; jobExecutionCoordinator: Coordinator; } export interface BatchSchedulerRecurringCallbacks { scheduleJob: (name: string, interval: number, job: () => Promise, priority: number) => void; runMemoryCleanup: () => Promise; runMemoryReviewCandidatesJob: () => Promise; runMonitoring: () => Promise; runHealthCheck: () => Promise; runConsolidationScoreIncremental: () => Promise; runWeeklyRelationValidation: () => Promise; runConsolidationScoreFullSweep: () => Promise; runTripleExtractionBatch: () => Promise; runMetaMemoryIntrospection: () => Promise; runQualityMeasurementBatch: () => Promise; runLogRotation: () => Promise; runSleepConsolidationBatch: () => Promise; runTelemetryCleanupBatch: () => Promise; runAnchorAutoRefresh: () => Promise; } export declare function createBatchSchedulerWiring(config: Partial | undefined, dependencies: BatchSchedulerDependencyOverrides | undefined, coordinatorCallbacks: BatchSchedulerCoordinatorCallbacks): BatchSchedulerWiringResult; export declare function getBatchSchedulerContextSource(state: BatchSchedulerServiceState, log: BatchSchedulerLogMethod, emitMemoryReviewCandidatesRunRecordFn: (result: BatchJobResult) => Promise): BatchSchedulerContextSource; export declare function getBatchSchedulerRecurringContextSource(state: BatchSchedulerServiceState, recurringState: BatchSchedulerRecurringState, callbacks: BatchSchedulerRecurringCallbacks, log: BatchSchedulerLogMethod, emitMemoryReviewCandidatesRunRecordFn: (result: BatchJobResult) => Promise): BatchSchedulerRecurringContextSource; export declare function buildBatchSchedulerRecurringScheduleContextFromSource(source: BatchSchedulerRecurringContextSource): import("../batch-recurring-schedules.js").BatchRecurringScheduleContext; export declare function getBatchSchedulerLoggingDeps(state: BatchSchedulerServiceState): { enableLogging: boolean; startTime: Date | null; jobQueue: JobQueue; fileLogger: FileLogger; }; export declare function getBatchSchedulerIntervalDeps(recurringState: BatchSchedulerRecurringState, jobQueue: JobQueue, log: BatchSchedulerLogMethod): { jobExecutionCoordinator: BatchJobExecutionCoordinator; intervals: Map; jobQueue: JobQueue; log: BatchSchedulerLogMethod; }; export declare function writeBatchSchedulerDiagnostics(diagnosticsLogger: Pick | undefined, event: Record): Promise; export declare function emitBatchSchedulerMemoryReviewCandidatesRunRecord(deps: { diagnosticsLogger?: Pick; log: BatchSchedulerLogMethod; writeDiagnosticsEvent: (event: Record) => Promise; }, result: BatchJobResult): Promise; export declare function logBatchScheduler(state: BatchSchedulerServiceState, message: string, data?: unknown, level?: 'info' | 'warn' | 'error'): void; export declare function setBatchSchedulerIntrospectionScanCache(state: BatchSchedulerServiceState, cache: IntrospectionScanCache | null): void; export declare function setBatchSchedulerSleepConsolidationService(state: BatchSchedulerServiceState, service: SleepConsolidationService | null): void; export declare function setBatchSchedulerTelemetryCleanupRepository(state: BatchSchedulerServiceState, repository: TelemetryRepository | null): void; export declare function setBatchSchedulerDiagnosticsLogger(state: BatchSchedulerServiceState, logger: Pick | undefined): void; export declare function setBatchSchedulerAnchorManager(state: BatchSchedulerServiceState, anchorManager: AnchorManager | null): void; //# sourceMappingURL=batch-scheduler-service-wiring.d.ts.map