"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LifecycleTracker = void 0;
class LifecycleTracker {
    createEntry(event, details) {
        return {
            timestamp: Date.now(),
            event,
            details,
        };
    }
    computeVersion(history) {
        const updateEvents = history.filter((h) => h.event === 'created' || h.event === 'updated' || h.event === 'accepted' || h.event === 'rejected');
        return updateEvents.length;
    }
    shouldDecay(lastSeen, maxIdleDays = 30) {
        const idleDays = (Date.now() - lastSeen) / (1000 * 60 * 60 * 24);
        return idleDays > maxIdleDays;
    }
    shouldRevive(currentQuality, threshold = 30) {
        return currentQuality < threshold;
    }
}
exports.LifecycleTracker = LifecycleTracker;
//# sourceMappingURL=pattern-lifecycle.js.map