//#region src/cognitive/scheduler/event-sources/persona-change-source.ts
/**
* Event source triggered by significant changes to the user's persona.
* Fires when the persona's domain structure changes significantly
* (new domain discovered, domain depth crosses a threshold, etc.)
*/
var PersonaChangeSource = class {
	constructor() {
		this.listeners = [];
		this.previousDomainCount = 0;
	}
	onEvent(listener) {
		this.listeners.push(listener);
	}
	/**
	* Call this after persona updates to check if a significant change occurred.
	*/
	checkPersonaUpdate(domainCount, newDomains) {
		if (Math.abs(domainCount - this.previousDomainCount) >= 2 || newDomains.length >= 2) {
			const event = {
				type: "persona_change",
				timestamp: Date.now(),
				payload: {
					newDomains,
					domainCount
				}
			};
			for (const listener of this.listeners) listener(event);
		}
		this.previousDomainCount = domainCount;
	}
};
//#endregion
export { PersonaChangeSource };
