openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 2.17 kB
JavaScript
import{t as warnPluginSdkDeprecation}from"./sdk-deprecation-BDUCyBrU.mjs";import{t as getChannelPlugin}from"./registry-CpNh6QcT.mjs";
//!src/channels/plugins/conversation-bindings.ts
function warnLegacyBindingMethod(e){warnPluginSdkDeprecation({family:`channel-conversation-bindings`,method:e,replacement:`${e}Async`})}function setChannelConversationBindingIdleTimeoutBySessionKey(e){warnLegacyBindingMethod(`setChannelConversationBindingIdleTimeoutBySessionKey`);const t=getChannelPlugin(e.channelId)?.conversationBindings?.setIdleTimeoutBySessionKey;if(!t)return[];return t({targetSessionKey:e.targetSessionKey,accountId:e.accountId,idleTimeoutMs:e.idleTimeoutMs})}function setChannelConversationBindingMaxAgeBySessionKey(e){warnLegacyBindingMethod(`setChannelConversationBindingMaxAgeBySessionKey`);const t=getChannelPlugin(e.channelId)?.conversationBindings?.setMaxAgeBySessionKey;if(!t)return[];return t({targetSessionKey:e.targetSessionKey,accountId:e.accountId,maxAgeMs:e.maxAgeMs})}async function setChannelConversationBindingIdleTimeoutBySessionKeyAsync(e){const t=getChannelPlugin(e.channelId)?.conversationBindings;const n={targetSessionKey:e.targetSessionKey,accountId:e.accountId,idleTimeoutMs:e.idleTimeoutMs};if(t?.setIdleTimeoutBySessionKeyAsync)return await t.setIdleTimeoutBySessionKeyAsync(n);if(t?.setIdleTimeoutBySessionKey){warnLegacyBindingMethod(`ChannelConversationBindingSupport.setIdleTimeoutBySessionKey`);return t.setIdleTimeoutBySessionKey(n)}return[]}async function setChannelConversationBindingMaxAgeBySessionKeyAsync(e){const t=getChannelPlugin(e.channelId)?.conversationBindings;const n={targetSessionKey:e.targetSessionKey,accountId:e.accountId,maxAgeMs:e.maxAgeMs};if(t?.setMaxAgeBySessionKeyAsync)return await t.setMaxAgeBySessionKeyAsync(n);if(t?.setMaxAgeBySessionKey){warnLegacyBindingMethod(`ChannelConversationBindingSupport.setMaxAgeBySessionKey`);return t.setMaxAgeBySessionKey(n)}return[]}export{setChannelConversationBindingMaxAgeBySessionKeyAsync as i,setChannelConversationBindingIdleTimeoutBySessionKeyAsync as n,setChannelConversationBindingMaxAgeBySessionKey as r,setChannelConversationBindingIdleTimeoutBySessionKey as t};