/** 용도 순서 — 누적 막대의 아래→위, 표의 정렬 기준. AI 쪽을 아래에 깐다(이 화면이 보려는 것). */ export const PURPOSES = ['search', 'user-fetch', 'training', 'search-engine', 'other'] as const; export type Purpose = (typeof PURPOSES)[number]; export const PURPOSE_LABEL: Record = { search: 'AI 검색 색인', 'user-fetch': 'AI 실시간 조회', training: 'AI 학습', 'search-engine': '검색엔진', other: '기타', }; export const PURPOSE_COLOR: Record = { search: '#2563eb', 'user-fetch': '#7c3aed', training: '#0d9488', 'search-engine': '#f59e0b', other: '#9ca3af', }; export function purposeLabel(value: string): string { return PURPOSE_LABEL[value as Purpose] ?? value; } /** 서버 시각(UTC ISO)을 KST 로 읽는다 — 운영자가 한국에 있지 않아도 같은 숫자를 본다. */ export function formatKst(iso?: string | null): string { if (!iso) return '—'; return new Date(iso).toLocaleString('ko-KR', { timeZone: 'Asia/Seoul', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', }); }