export class TaskStateStore {
    summary = "";
    nextStep = "";
    ageInTurns = 0;
    lastSlot = undefined;
    lastUpdatedTurn = 0;
    onTurn(slot, turnIndex) {
        this.ageInTurns += 1;
        if (slot) {
            this.lastSlot = slot;
        }
        this.lastUpdatedTurn = turnIndex;
    }
    update(summary, nextStep, turnIndex) {
        if (summary && summary.trim().length > 0) {
            this.summary = summary.trim();
        }
        if (nextStep && nextStep.trim().length > 0) {
            this.nextStep = nextStep.trim();
        }
        this.ageInTurns = 0;
        this.lastUpdatedTurn = turnIndex;
    }
    snapshot() {
        return {
            summary: this.summary,
            nextStep: this.nextStep,
            ageInTurns: this.ageInTurns,
            lastSlot: this.lastSlot,
            lastUpdatedTurn: this.lastUpdatedTurn,
        };
    }
}
//# sourceMappingURL=task-state-store.js.map