fix: clean up onboarding + channel selection types

This commit is contained in:
Peter Steinberger
2026-01-15 05:12:29 +00:00
parent 9c02ea9098
commit 57c66fe813
7 changed files with 56 additions and 37 deletions

View File

@@ -11,7 +11,7 @@ export type MessageChannelId = DeliverableMessageChannel;
const getMessageChannels = () => listDeliverableMessageChannels();
function isKnownChannel(value: string): value is MessageChannelId {
function isKnownChannel(value: string): boolean {
return getMessageChannels().includes(value as MessageChannelId);
}
@@ -46,7 +46,7 @@ export async function listConfiguredMessageChannels(
for (const plugin of listChannelPlugins()) {
if (!isKnownChannel(plugin.id)) continue;
if (await isPluginConfigured(plugin, cfg)) {
channels.push(plugin.id);
channels.push(plugin.id as MessageChannelId);
}
}
return channels;
@@ -62,7 +62,7 @@ export async function resolveMessageChannelSelection(params: {
throw new Error(`Unknown channel: ${normalized}`);
}
return {
channel: normalized,
channel: normalized as MessageChannelId,
configured: await listConfiguredMessageChannels(params.cfg),
};
}