refactor: add inbound context helpers

This commit is contained in:
Peter Steinberger
2026-01-17 04:04:17 +00:00
parent a2b5b1f0cb
commit 388b2bce01
9 changed files with 224 additions and 0 deletions

11
src/channels/chat-type.ts Normal file
View File

@@ -0,0 +1,11 @@
export type NormalizedChatType = "direct" | "group" | "channel";
export function normalizeChatType(raw?: string): NormalizedChatType | undefined {
const value = raw?.trim().toLowerCase();
if (!value) return undefined;
if (value === "direct" || value === "dm") return "direct";
if (value === "group") return "group";
if (value === "channel" || value === "room") return "channel";
return undefined;
}