Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

579 B
Raw Blame
import type { createTranslator } from "@pibot/i18n";
import { type Message, replyCitationCheck } from "@pibot/protocol";

export function replyCitationText(
  message: Pick<Message, "role" | "usage">,
  t: ReturnType<typeof createTranslator>,
): string[] {
  const check = message.role === "assistant" ? replyCitationCheck(message) : undefined;
  return check
    ? [
        ...(check.unread ? [t("chat.citationsUnread", { count: check.unread })] : []),
        ...(check.incomplete ? [t("chat.citationsIncomplete")] : []),
        t("chat.citationsScope"),
      ]
    : [];
}