openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 2.9 kB
JavaScript
import{n as listBundledChannelCatalogEntries}from"./bundled-channel-catalog-read-CX1nvZIw.mjs";import{i as normalizeChatChannelId}from"./ids-CXs0NhN-.mjs";import{c as normalizeGatewayClientMode,i as GATEWAY_CLIENT_NAMES,l as normalizeGatewayClientName,r as GATEWAY_CLIENT_MODES}from"./client-info-Dr3-kuD1.mjs";import{t as INTERNAL_MESSAGE_CHANNEL}from"./message-channel-constants-BbP_hczw.mjs";import{t as findChatChannelMeta}from"./chat-meta-CPf8a-2D.mjs";import{r as getRegisteredChannelPluginMeta}from"./registry-yecJKTDP.mjs";import{n as normalizeMessageChannel}from"./message-channel-core-D_hPOadj.mjs";import"./message-channel-normalize-hDAO6_JQ.mjs";
//!src/utils/message-channel.ts
function isGatewayCliClient(e){return normalizeGatewayClientMode(e?.mode)===GATEWAY_CLIENT_MODES.CLI}function isEphemeralGatewayClient(e){const t=normalizeGatewayClientMode(e?.mode);return t===GATEWAY_CLIENT_MODES.CLI||t===GATEWAY_CLIENT_MODES.BACKEND||t===GATEWAY_CLIENT_MODES.PROBE}function isOperatorUiClient(e){const t=normalizeGatewayClientName(e?.id);return t===GATEWAY_CLIENT_NAMES.CONTROL_UI||t===GATEWAY_CLIENT_NAMES.BROWSER_COPILOT||t===GATEWAY_CLIENT_NAMES.TUI}function isBrowserOperatorUiClient(e){const t=normalizeGatewayClientName(e?.id);return t===GATEWAY_CLIENT_NAMES.CONTROL_UI||t===GATEWAY_CLIENT_NAMES.BROWSER_COPILOT}function isBrowserCopilotClient(e){return normalizeGatewayClientName(e?.id)===GATEWAY_CLIENT_NAMES.BROWSER_COPILOT}function isInternalMessageChannel(e){return normalizeMessageChannel(e)===INTERNAL_MESSAGE_CHANNEL}function isWebchatClient(e){if(normalizeGatewayClientMode(e?.mode)===GATEWAY_CLIENT_MODES.WEBCHAT)return true;return normalizeGatewayClientName(e?.id)===GATEWAY_CLIENT_NAMES.WEBCHAT_UI}const PROGRESS_CARD_RENDERER_PLATFORMS=/* @__PURE__ */ new Set([`web`,`ios`,`android`,`macos`,`darwin`]);function isProgressCardRendererClient(e){const t=normalizeGatewayClientName(e?.clientId);const n=t===GATEWAY_CLIENT_NAMES.CONTROL_UI||t===GATEWAY_CLIENT_NAMES.WEBCHAT_UI||t===GATEWAY_CLIENT_NAMES.IOS_APP||t===GATEWAY_CLIENT_NAMES.ANDROID_APP||t===GATEWAY_CLIENT_NAMES.MACOS_APP;const r=e?.platform?.trim().toLowerCase();return n||(r?PROGRESS_CARD_RENDERER_PLATFORMS.has(r):false)}function isMarkdownCapableMessageChannel(e){const t=normalizeMessageChannel(e);if(!t)return false;if(t===`webchat`||t===`tui`)return true;const n=normalizeChatChannelId(t);if(n){const e=findChatChannelMeta(n);if(e)return e.markdownCapable===true;const t=listBundledChannelCatalogEntries().find(e=>e.id===n);if(t)return t.channel.markdownCapable===true}return getRegisteredChannelPluginMeta(t)?.markdownCapable===true}export{isInternalMessageChannel as a,isProgressCardRendererClient as c,isGatewayCliClient as i,isWebchatClient as l,isBrowserOperatorUiClient as n,isMarkdownCapableMessageChannel as o,isEphemeralGatewayClient as r,isOperatorUiClient as s,isBrowserCopilotClient as t};