export type ChatReplyPhase = | "idle" | "generating" | "recovering" | "completed" | "stopped" | "failed"; export type ChatReplyAnnouncer = | "none" | "reply_status_region" | "chat_notice_toast" | "conversation_alert"; const announcers = { idle: "none", generating: "reply_status_region", recovering: "chat_notice_toast", completed: "reply_status_region", stopped: "chat_notice_toast", failed: "conversation_alert", } as const satisfies Record; export function chatReplyAnnouncer(phase: ChatReplyPhase): ChatReplyAnnouncer { return announcers[phase]; } export function chatReplyAnnouncement(phase: ChatReplyPhase, replyOrdinal: number): string { if (chatReplyAnnouncer(phase) !== "reply_status_region") return ""; if (phase === "generating") return "Jyotisha 正在回答,完成后会提示你阅读。"; return `Jyotisha 已回答完毕,第 ${replyOrdinal} 条回答已显示在对话区末尾,可以开始阅读。`; }