Files
Jyotisha/frontend/src/lib/consultation-activity-labels.ts
T
jesse-uxandGrok (agent loop) a54f75e5e3 fix(capacity): limit each user and queue heavy compute briefly.
Consult, rectification turns, and report generation stop before a credit reservation when the product caps are hit. A full heavy-compute gate waits up to 8 seconds, and one consultation retries that 429 inside the same request.

Co-Authored-By: Grok (agent loop)
2026-10-15 13:33:06 +08:00

74 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* The first line of every consultation turn: on the client from the frame the
* question is sent, on the server as the first byte of the stream, before the
* turn is classified or the chart is read (TASK-consult-first-frame-and-pacing-20260928 D1).
*/
export const CONSULTATION_RECEIVED_LABEL = "收到,正在看你的问题…";
export const CONSULTATION_QUEUE_LABEL = "人有点多,排一下队";
export const CONSULTATION_QUEUE_FAILED_MESSAGE = "人有点多,这一轮没排上,点数已经退回。";
export const CONSULTATION_LOADING_METHOD_LABEL = "正在读取印度占星分析规则…";
export const CONSULTATION_CHART_CALCULATION_LABEL = "正在计算本命盘…";
export const CONSULTATION_EVIDENCE_VALIDATION_LABEL = "正在核对可用证据…";
export const CONSULTATION_COMPOSING_LABEL = "正在组织回答…";
export const CONSULTATION_DONE_SKILL_LABEL = "读取分析方法";
export const CONSULTATION_DONE_CHART_LABEL = "计算本命盘";
export function chartCalculationProgressLabel(current: number, total: number): string {
if (total <= 1) return CONSULTATION_CHART_CALCULATION_LABEL;
return `正在计算本命盘(第 ${current}/${total} 项)…`;
}
export function consultationWriteLabel(heading: string, live: boolean): string {
const title = heading.trim() || "回答";
return live ? `正在写${title}…` : `写${title}`;
}
const WESTERN_LAYER_LABELS: Readonly<Record<string, string>> = {
natal: "西洋本命",
transits: "西洋行运",
solar_return: "太阳回归",
secondary_progressions: "次限推运",
solar_arc_directions: "太阳弧",
converse_secondary_progressions: "逆推次限",
converse_solar_arc_directions: "逆推太阳弧",
midpoints: "中点",
lunar_return: "月亮回归",
transit_duration_scan: "行运时长扫描",
parans: "共升共落",
};
const LOOKUP_SECTION_LABELS: Readonly<Record<string, string>> = {
"varga:research_dn": "研究用分盘",
"varga:extended": "D81 / D108 / D144 分盘",
yogas: "格局明细",
ashtakavarga: "八分法(Ashtakavarga)",
shadbala: "六力(Shadbala)",
transits: "行运触发",
chara_dasha: "Chara 大运",
arudha_padas: "映点(Arudha)",
chara_karakas: "七个代表星(Chara Karaka)",
kp_cusps: "KP 宫头",
gulika: "Gulika",
kakshya: "Kakshya",
vimshottari_mahadashas: "全部大运起止",
domain_thematic_evidence: "这个主题的证据明细",
karakamsha: "灵魂星在九分盘的落点(Karakamsha)",
dispositor_chains: "宫主链",
inter_chart_linkage: "本命、九分盘、十分盘的联动",
argala: "门闩(Argala)",
moon_transit: "月亮行运",
};
/** Plain words for one evidence-lookup section (TASK-consult-evidence-card-20260927 T5). */
export function evidenceLookupSectionLabel(section: string): string {
if (section.startsWith("varga:D")) return `${section.slice("varga:".length)} 分盘`;
if (section.startsWith("western:")) return WESTERN_LAYER_LABELS[section.slice("western:".length)] ?? "西洋层";
return LOOKUP_SECTION_LABELS[section] ?? "一段盘面数据";
}
/** The activity row while the answer model looks up one section outside the card. */
export function evidenceLookupActivityLabel(section: string, live = true): string {
const label = evidenceLookupSectionLabel(section);
return live ? `正在多看一眼:${label}…` : `多看了一眼:${label}`;
}