

const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
const require_CredoError = require('../../error/CredoError.js');
require('../../error/index.js');
const require_AgentContext = require('./AgentContext.js');
require('../../plugins/index.js');
const require_decorateMetadata = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
let tsyringe = require("tsyringe");
tsyringe = require_rolldown_runtime.__toESM(tsyringe);

//#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 require_CredoError.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 require_CredoError.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 require_CredoError.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 = require_decorate.__decorate([(0, tsyringe.injectable)(), require_decorateMetadata.__decorateMetadata("design:paramtypes", [typeof (_ref = typeof require_AgentContext.AgentContext !== "undefined" && require_AgentContext.AgentContext) === "function" ? _ref : Object])], DefaultAgentContextProvider);

//#endregion
Object.defineProperty(exports, 'DefaultAgentContextProvider', {
  enumerable: true,
  get: function () {
    return DefaultAgentContextProvider;
  }
});