"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlanHistory = void 0;
const uuid_1 = require("uuid");
const emptyGenerationReferences = {
    test_examples: [],
};
class PlanHistory {
    constructor() {
        this.trainingSessionId = (0, uuid_1.v4)();
        this.chatHistory = [];
        this.generationReferences = emptyGenerationReferences;
    }
    reset() {
        this.trainingSessionId = (0, uuid_1.v4)();
        this.chatHistory = [];
        this.lastArtifact = undefined;
        this.generationReferences = emptyGenerationReferences;
    }
    addToChatHistory(chatHistoryItem) {
        this.chatHistory.push(chatHistoryItem);
    }
    setLastArtifact(lastArtifact) {
        this.lastArtifact = lastArtifact;
    }
    setGenerationReferences(generationReferences) {
        this.generationReferences =
            generationReferences ?? emptyGenerationReferences;
    }
    getPlanHistoryState() {
        return {
            chatHistory: this.chatHistory,
            lastArtifact: this.lastArtifact,
            generationReferences: this.generationReferences,
            trainingSessionId: this.trainingSessionId,
        };
    }
}
exports.PlanHistory = PlanHistory;
