UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

49 lines (48 loc) 1.95 kB
import { t as getLoadedChannelPluginForRead } from "./registry-loaded-read-7phT5GIn.js"; import { r as resolveOutboundChannelPlugin } from "./channel-resolution-azq0u3DK.js"; import { m as mapAllowFromEntries } from "./channel-config-helpers-lj5quus3.js"; import { n as resolveOutboundSessionRoute } from "./outbound-session-Cm9TjWfF.js"; import { i as resolveChannelTarget } from "./target-resolver-CUW6ke8W.js"; import { t as resolveFirstBoundAccountId } from "./bound-account-read-D_n-0uLw.js"; //#region src/cron/isolated-agent/delivery-target.runtime.ts /** Resolves a cron delivery target through channel plugins with bootstrap allowed. */ async function resolveChannelTargetForDelivery(params) { resolveOutboundChannelPlugin({ channel: params.channel, cfg: params.cfg, allowBootstrap: true }); try { return await resolveChannelTarget({ cfg: params.cfg, channel: params.channel, input: params.input, accountId: params.accountId, unknownTargetMode: "normalized" }); } catch (err) { return { ok: false, error: err instanceof Error ? err : new Error(String(err)) }; } } /** Resolves the outbound session route used for cron delivery threading and mirrors. */ async function resolveOutboundSessionRouteForDelivery(params) { resolveOutboundChannelPlugin({ channel: params.channel, cfg: params.cfg, allowBootstrap: true }); return await resolveOutboundSessionRoute(params); } /** Returns whether a channel can canonicalize outbound cron delivery sessions. */ function channelCanResolveOutboundSessionRoute(params) { return Boolean(resolveOutboundChannelPlugin({ channel: params.channel, cfg: params.cfg, allowBootstrap: true })?.messaging?.resolveOutboundSessionRoute); } //#endregion export { channelCanResolveOutboundSessionRoute, getLoadedChannelPluginForRead, mapAllowFromEntries, resolveChannelTargetForDelivery, resolveFirstBoundAccountId, resolveOutboundSessionRouteForDelivery };