import { createLogger } from "../../../utils/logger/index.js";
import { init_logger } from "../../../utils/logger.js";
//#region src/agent/lifecycle/handlers/compaction.ts
init_logger();
const logger = createLogger("lifecycle-compaction");
const DEFAULT_CONFIG = {
	minMessages: 20,
	maxTokens: 8e3,
	preserveReasoning: true,
	accumulateUsage: true
};
var CompactionLifecycleHandler = class {
	name = "CompactionLifecycleHandler";
	config;
	constructor(config) {
		this.config = {
			...DEFAULT_CONFIG,
			...config
		};
	}
	async handle(event, _context) {
		const { sessionKey } = event;
		logger.debug({
			sessionKey,
			messageCount: event.payload?.usage?.total
		}, "Compaction lifecycle event received");
	}
	shouldCompact(messageCount) {
		return messageCount >= this.config.minMessages;
	}
};
//#endregion
export { CompactionLifecycleHandler };

//# sourceMappingURL=compaction.js.map