refactor: extend channel plugin boundary

This commit is contained in:
Peter Steinberger
2026-01-20 11:49:31 +00:00
parent 439044068a
commit 9a2bf57e1c
31 changed files with 234 additions and 162 deletions

View File

@@ -33,17 +33,21 @@ function toChannelMeta(params: {
const label = params.channel.label?.trim();
if (!label) return null;
const selectionLabel = params.channel.selectionLabel?.trim() || label;
const detailLabel = params.channel.detailLabel?.trim();
const docsPath = params.channel.docsPath?.trim() || `/channels/${params.id}`;
const blurb = params.channel.blurb?.trim() || "";
const systemImage = params.channel.systemImage?.trim();
return {
id: params.id,
label,
selectionLabel,
...(detailLabel ? { detailLabel } : {}),
docsPath,
docsLabel: params.channel.docsLabel?.trim() || undefined,
blurb,
...(params.channel.aliases ? { aliases: params.channel.aliases } : {}),
...(params.channel.preferOver ? { preferOver: params.channel.preferOver } : {}),
...(params.channel.order !== undefined ? { order: params.channel.order } : {}),
...(params.channel.selectionDocsPrefix
? { selectionDocsPrefix: params.channel.selectionDocsPrefix }
@@ -52,6 +56,7 @@ function toChannelMeta(params: {
? { selectionDocsOmitLabel: params.channel.selectionDocsOmitLabel }
: {}),
...(params.channel.selectionExtras ? { selectionExtras: params.channel.selectionExtras } : {}),
...(systemImage ? { systemImage } : {}),
...(params.channel.showConfigured !== undefined
? { showConfigured: params.channel.showConfigured }
: {}),

View File

@@ -74,10 +74,13 @@ export type ChannelMeta = {
selectionDocsPrefix?: string;
selectionDocsOmitLabel?: boolean;
selectionExtras?: string[];
detailLabel?: string;
systemImage?: string;
showConfigured?: boolean;
quickstartAllowFrom?: boolean;
forceAccountBinding?: boolean;
preferSessionLookupForAnnounceTarget?: boolean;
preferOver?: string[];
};
export type ChannelAccountSnapshot = {