refactor: migrate messaging plugins to sdk

This commit is contained in:
Peter Steinberger
2026-01-18 08:32:19 +00:00
parent 9241e21114
commit c5e19f5c67
63 changed files with 4082 additions and 376 deletions

View File

@@ -1,4 +1,5 @@
import { getChannelPlugin } from "../../channels/plugins/index.js";
import { getChatChannelMeta, normalizeChatChannelId } from "../../channels/registry.js";
import type { ChannelId } from "../../channels/plugins/types.js";
import type { OutboundDeliveryResult } from "./deliver.js";
@@ -28,8 +29,13 @@ type OutboundDeliveryMeta = {
meta?: Record<string, unknown>;
};
const resolveChannelLabel = (channel: string) =>
getChannelPlugin(channel as ChannelId)?.meta.label ?? channel;
const resolveChannelLabel = (channel: string) => {
const pluginLabel = getChannelPlugin(channel as ChannelId)?.meta.label;
if (pluginLabel) return pluginLabel;
const normalized = normalizeChatChannelId(channel);
if (normalized) return getChatChannelMeta(normalized).label;
return channel;
};
export function formatOutboundDeliverySummary(
channel: string,