import "node:crypto";
//#region src/cognitive/insight/fragment-types.ts
const FRAGMENT_TTL_MS = 336 * 60 * 60 * 1e3;
const FRAGMENT_HALF_LIFE_MS = 10080 * 60 * 1e3;
function isFragmentExpired(fragment, now) {
	return (now ?? Date.now()) > fragment.expiresAt;
}
function computeFragmentDecay(fragment, now) {
	const elapsed = (now ?? Date.now()) - fragment.createdAt;
	if (elapsed >= 12096e5) return 0;
	const base = fragment.initialStrength ?? fragment.strength;
	return Math.max(0, base * Math.pow(.5, elapsed / FRAGMENT_HALF_LIFE_MS));
}
//#endregion
export { computeFragmentDecay as n, isFragmentExpired as r, FRAGMENT_TTL_MS as t };
