import { s as normalizeOptionalString } from "./string-coerce-CIT1-v_a.js";
import { v as resolveSessionAgentId } from "./agent-scope-BA9YeMqS.js";
//#region src/infra/outbound/session-context.ts
function buildOutboundSessionContext(params) {
	const key = normalizeOptionalString(params.sessionKey);
	const explicitAgentId = normalizeOptionalString(params.agentId);
	const derivedAgentId = key ? resolveSessionAgentId({
		sessionKey: key,
		config: params.cfg
	}) : void 0;
	const agentId = explicitAgentId ?? derivedAgentId;
	if (!key && !agentId) return;
	return {
		...key ? { key } : {},
		...agentId ? { agentId } : {}
	};
}
//#endregion
export { buildOutboundSessionContext as t };
