Files
Jyotisha/frontend/src/lib/consultation-activity-labels.ts
T
Jesse_ChenandClaude Opus 5.5 cb3ee55837 feat(consult): one read-only evidence lookup per turn; settle open clauses at tool calls (BUG-1059)
read-consultation-evidence returns one closed-enum section (a formal varga,
research/extended vargas, a Western layer, yogas, Ashtakavarga, Shadbala,
transits, Chara Dasha, arudha, karakas, KP, gulika, kakshya, mahadashas,
thematic evidence) from this request's finished calculation, never
recalculates, answers unavailable on a cache miss and refuses a second call.
The receipt records the step and the write row shows 「正在多看一眼:…」.
A lookup after answer text went out keeps the released text whole: a verbatim
restart is dropped as it arrives (40-char confirmation), a continuation is
kept, and settlement still reads the step that wrote the answer; the lookup
runs on the answer clock without resetting it. A length continuation carries
the lookup result with the card. BUG-1059: the visible-text transformer's open
clause is settled at each tool call, so unpunctuated narration no longer
leaks into the answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
2026-09-27 02:54:11 +08:00

61 lines
2.6 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.
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: "这个主题的证据明细",
};
/** 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}`;
}