openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 2.04 kB
JavaScript
import{t as DEFAULT_ACCOUNT_ID}from"./account-id-3yqrEsRn.mjs";import{i as getLoadedChannelPluginForRead}from"./registry-loaded-BEn6LBRM.mjs";import{i as resolveChannelDefaultAccountId}from"./helpers-1A2j6LGz.mjs";import{r as resolveOutboundChannelPlugin}from"./channel-resolution-DC4uO43j.mjs";import{i as resolveChannelTarget}from"./target-resolver-DE3emqE4.mjs";import{a as resolveOutboundSessionRoute}from"./outbound-session-CHdHqfxF.mjs";import{d as mapAllowFromEntries}from"./channel-config-helpers-CNBYUNFE.mjs";import{i as resolveProactiveDeliveryTargetWithSessionRoute}from"./targets-DMMK26tO.mjs";import{t as resolveFirstBoundAccountId}from"./bound-account-read-Bp11qm11.mjs";
//!src/cron/isolated-agent/delivery-target.runtime.ts
function resolveChannelDefaultAccountIdForDelivery(e){const t=resolveOutboundChannelPlugin({...e,allowBootstrap:true});const n=t?resolveChannelDefaultAccountId({plugin:t,cfg:e.cfg}):void 0;return n==="default"?void 0:n}async function resolveChannelTargetForDelivery(e){const t=resolveOutboundChannelPlugin({channel:e.channel,cfg:e.cfg,agentId:e.agentId,allowBootstrap:true});try{return await resolveChannelTarget({cfg:e.cfg,channel:e.channel,input:e.input,accountId:e.accountId,unknownTargetMode:`normalized`,plugin:t})}catch(e){return{ok:false,error:e instanceof Error?e:new Error(String(e))}}}async function resolveOutboundSessionRouteForDelivery(e){const t=resolveOutboundChannelPlugin({channel:e.channel,cfg:e.cfg,agentId:e.agentId,allowBootstrap:true});return await resolveOutboundSessionRoute({...e,plugin:t})}function channelCanResolveOutboundSessionRoute(e){return Boolean(resolveOutboundChannelPlugin({channel:e.channel,cfg:e.cfg,agentId:e.agentId,allowBootstrap:true})?.messaging?.resolveOutboundSessionRoute)}export{channelCanResolveOutboundSessionRoute,getLoadedChannelPluginForRead,mapAllowFromEntries,resolveChannelDefaultAccountIdForDelivery,resolveChannelTargetForDelivery,resolveFirstBoundAccountId,resolveOutboundSessionRouteForDelivery,resolveProactiveDeliveryTargetWithSessionRoute};