refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -56,11 +56,11 @@ export function classifySessionKind(params: {
return "other";
}
export function deriveProvider(params: {
export function deriveChannel(params: {
key: string;
kind: SessionKind;
provider?: string | null;
lastProvider?: string | null;
channel?: string | null;
lastChannel?: string | null;
}): string {
if (
params.kind === "cron" ||
@@ -68,10 +68,10 @@ export function deriveProvider(params: {
params.kind === "node"
)
return "internal";
const provider = normalizeKey(params.provider ?? undefined);
if (provider) return provider;
const lastProvider = normalizeKey(params.lastProvider ?? undefined);
if (lastProvider) return lastProvider;
const channel = normalizeKey(params.channel ?? undefined);
if (channel) return channel;
const lastChannel = normalizeKey(params.lastChannel ?? undefined);
if (lastChannel) return lastChannel;
const parts = params.key.split(":").filter(Boolean);
if (parts.length >= 3 && (parts[1] === "group" || parts[1] === "channel")) {
return parts[0];