// 本章注入透明(B0/F1)纯逻辑:入选理由 / 实体类型 → 中文徽标。 // 纯函数,便于 node 环境单测;渲染层只管样式。 import type { components } from "@/lib/api/schema"; export type InjectionResponse = components["schemas"]["InjectionResponse"]; export type InjectionEntity = components["schemas"]["InjectionEntity"]; // SelectionReason → 作者可读徽标(对齐 ARCH §3.4 的四来源)。 export const REASON_LABELS: Record = { explicit_beat: "本章点名", main_character: "主角常驻", recent_digest: "近章出现", foreshadow_window: "伏笔窗口", }; // EntityKind → 中文。 export const KIND_LABELS: Record = { character: "角色", world_entity: "设定", }; // 未知 code 时回退原值(不吞,便于发现新理由)。 export function reasonLabel(reason: string): string { return REASON_LABELS[reason] ?? reason; } export function kindLabel(kind: string): string { return KIND_LABELS[kind] ?? kind; }