/** Local pi chat mirroring to Telegram topics. */ export type TelegramBroadcastRole = "user" | "assistant"; export function shouldBroadcastLocalMessage(text: string): boolean { return !text.trimStart().startsWith("[telegram chat="); } export function buildTelegramBroadcastMessage(role: TelegramBroadcastRole, text: string): string { const prefix = role === "user" ? "👤 local:" : "🤖 pi:"; return `${prefix}\n${text.trim()}`; }