import { BaseAgent, CredoError } from "@credo-ts/core";

//#region ../tenants/src/TenantAgent.ts
var TenantAgent = class extends BaseAgent {
	constructor(agentContext) {
		super(agentContext.config, agentContext.dependencyManager);
		this.sessionHasEnded = false;
	}
	async initialize() {
		if (this.sessionHasEnded) throw new CredoError("Can't initialize agent after tenant sessions has been ended.");
		this._isInitialized = true;
	}
	async endSession() {
		this.logger.trace(`Ending session for agent context with contextCorrelationId '${this.agentContext.contextCorrelationId}'`);
		await this.agentContext.endSession();
		this._isInitialized = false;
		this.sessionHasEnded = true;
	}
};

//#endregion
export { TenantAgent };
//# sourceMappingURL=TenantAgent.mjs.map