"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemoryPromotionFlow = void 0;
const MemoryOrchestrator_1 = require("./MemoryOrchestrator");
class MemoryPromotionFlow {
    orchestrator;
    retrievalProviders;
    constructor(options = {}) {
        this.orchestrator = new MemoryOrchestrator_1.MemoryOrchestrator();
        this.retrievalProviders = options.retrievalProviders || ['local', 'mempalace'];
    }
    async promote(candidate, namespace, type = 'semantic') {
        await this.orchestrator.save({
            type,
            namespace,
            content: candidate.summary,
            summary: candidate.summary.slice(0, 180),
            tags: ['promotion', candidate.type],
            confidence: 0.78,
            sourceMissionId: candidate.sourceMissionId,
            dedupeKey: `promotion:${candidate.id}`,
            providers: ['local']
        });
    }
    async retrieve(query, namespace, types) {
        return this.orchestrator.search({
            query,
            namespace,
            types,
            topK: 8
        }, this.retrievalProviders);
    }
}
exports.MemoryPromotionFlow = MemoryPromotionFlow;
