Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { INTERNAL_MESSAGE_CHANNEL, normalizeMessageChannel } from "../../utils/message-channel.js";
export function resolveReplyRoutingDecision(params: {
provider?: string;
surface?: string;
explicitDeliverRoute?: boolean;
originatingChannel?: string;
originatingTo?: string;
suppressDirectUserDelivery?: boolean;
isRoutableChannel: (channel: string | undefined) => boolean;
}) {
const originatingChannel = normalizeMessageChannel(params.originatingChannel);
const providerChannel = normalizeMessageChannel(params.provider);
const surfaceChannel = normalizeMessageChannel(params.surface);
const currentSurface = providerChannel ?? surfaceChannel;
const isInternalWebchatTurn =
currentSurface === INTERNAL_MESSAGE_CHANNEL &&
(surfaceChannel === INTERNAL_MESSAGE_CHANNEL || !surfaceChannel) &&
params.explicitDeliverRoute !== true;
const shouldRouteToOriginating = Boolean(
!params.suppressDirectUserDelivery &&
!isInternalWebchatTurn &&
params.isRoutableChannel(originatingChannel) &&
params.originatingTo &&
originatingChannel !== currentSurface,
);
return {
originatingChannel,
currentSurface,
isInternalWebchatTurn,
shouldRouteToOriginating,
shouldSuppressTyping:
params.suppressDirectUserDelivery === true ||
shouldRouteToOriginating ||
originatingChannel === INTERNAL_MESSAGE_CHANNEL,
};
}
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland