

import { AgentContext } from "./AgentContext.mjs";
import { CredoError } from "../../error/CredoError.mjs";
import "../../error/index.mjs";
import { injectable } from "../../plugins/index.mjs";
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";

//#region src/agent/context/DefaultAgentContextProvider.ts
var _ref;
let DefaultAgentContextProvider = class DefaultAgentContextProvider$1 {
	constructor(agentContext) {
		this.agentContext = agentContext;
	}
	async getAgentContextForContextCorrelationId(contextCorrelationId) {
		if (contextCorrelationId !== this.agentContext.contextCorrelationId) throw new CredoError(`Could not get agent context for contextCorrelationId '${contextCorrelationId}'. Only contextCorrelationId '${this.agentContext.contextCorrelationId}' is supported.`);
		return this.agentContext;
	}
	async getContextForInboundMessage(_, options) {
		if (options?.contextCorrelationId) return this.getAgentContextForContextCorrelationId(options.contextCorrelationId);
		return this.agentContext;
	}
	async endSessionForAgentContext(agentContext) {
		if (agentContext.contextCorrelationId !== this.agentContext.contextCorrelationId) throw new CredoError(`Could not end session for agent context with contextCorrelationId '${agentContext.contextCorrelationId}'. Only contextCorrelationId '${this.agentContext.contextCorrelationId}' is provided by this provider.`);
	}
	async deleteAgentContext(agentContext) {
		if (agentContext.contextCorrelationId !== this.agentContext.contextCorrelationId) throw new CredoError(`Could not delete agent context with contextCorrelationId '${agentContext.contextCorrelationId}'. Only contextCorrelationId '${this.agentContext.contextCorrelationId}' is provided by this provider.`);
		await agentContext.dependencyManager.deleteAgentContext(agentContext);
	}
};
DefaultAgentContextProvider = __decorate([injectable(), __decorateMetadata("design:paramtypes", [typeof (_ref = typeof AgentContext !== "undefined" && AgentContext) === "function" ? _ref : Object])], DefaultAgentContextProvider);

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