openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.07 kB
JavaScript
import{l as normalizeOptionalString,u as normalizeOptionalStringifiedId}from"./string-coerce-CpTFcSwY.mjs";import{t as INTERNAL_MESSAGE_CHANNEL}from"./message-channel-constants-BbP_hczw.mjs";import{n as normalizeMessageChannel}from"./message-channel-core-D_hPOadj.mjs";import{t as isDeliverableMessageChannel}from"./message-channel-normalize-hDAO6_JQ.mjs";import"./message-channel-514k57tV.mjs";
//!src/infra/outbound/best-effort-delivery.ts
function resolveExternalBestEffortDeliveryTarget(e){const t=normalizeMessageChannel(e.channel);const n=t&&isDeliverableMessageChannel(t)?t:void 0;const r=normalizeOptionalString(e.to);const i=Boolean(n&&r);return{deliver:i,channel:i?n:void 0,to:i?r:void 0,accountId:i?normalizeOptionalString(e.accountId):void 0,threadId:i&&e.threadId!=null&&e.threadId!==``?normalizeOptionalStringifiedId(e.threadId):void 0}}function shouldDowngradeDeliveryToSessionOnly(e){return e.wantsDelivery&&e.bestEffortDeliver&&e.resolvedChannel===`webchat`}export{shouldDowngradeDeliveryToSessionOnly as n,resolveExternalBestEffortDeliveryTarget as t};