/**
 * 서버 컨텍스트 모듈
 * @memento/core: createToolContext 등 export
 */
export function createServerContext(db, services) {
    return { db, services };
}
export function createToolContext(serverContextOrDb, services) {
    if (services !== undefined) {
        const db = serverContextOrDb;
        const serverContext = createServerContext(db, services);
        return createToolContextFromServerContext(serverContext);
    }
    const serverContext = serverContextOrDb;
    return createToolContextFromServerContext(serverContext);
}
function createToolContextFromServerContext(serverContext) {
    return {
        db: serverContext.db,
        services: {
            searchEngine: serverContext.services.searchEngine,
            hybridSearchEngine: serverContext.services.hybridSearchEngine,
            vectorSearchEngine: serverContext.services.vectorSearchEngine,
            embeddingService: serverContext.services.embeddingService,
            forgettingPolicyService: serverContext.services.forgettingPolicyService,
            performanceMonitor: serverContext.services.performanceMonitor,
            databaseOptimizer: serverContext.services.databaseOptimizer,
            errorLoggingService: serverContext.services.errorLoggingService,
            performanceAlertService: serverContext.services.performanceAlertService,
            consolidationScoreService: serverContext.services.consolidationScoreService,
            writeCoalescingManager: serverContext.services.writeCoalescingManager,
            anchorManager: serverContext.services.anchorManager,
            relationGraph: serverContext.services.relationGraph,
            failureDetector: serverContext.services.failureDetector,
            reflexionWorker: serverContext.services.reflexionWorker,
            metaMemoryService: serverContext.services.metaMemoryService,
            batchScheduler: serverContext.services.batchScheduler,
            introspectionScanCache: serverContext.services.introspectionScanCache,
            telemetryService: serverContext.services.telemetryService
        }
    };
}
//# sourceMappingURL=context.js.map