fix(web): narrow natal-minute consultation mode for the production build

BUG-341 added declared_birth_window, but the natal-minute helper still returned boolean, so next build could not pass that mode into serverChartFromProfile.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-21 20:37:44 +08:00
co-authored by Cursor
parent ecb72cc5de
commit eeee0e49af
3 changed files with 28 additions and 1 deletions
@@ -13,6 +13,11 @@ import { getGeneralJyotishAgent } from "../src/mastra/index.ts";
import type { ResolvedLanguageModel } from "../src/mastra/model.ts";
test("general-no-birth-time is an explicit server mode that never runs a chart workflow", () => {
const source = readFileSync(new URL("../src/lib/consultation-birth-time-mode.ts", import.meta.url), "utf8");
assert.match(
source,
/export function isNatalMinuteConsultationMode\(\s*mode: ConsultationBirthTimeMode,\s*\): mode is NatalMinuteConsultationMode/,
);
assert.equal(consultationBirthTimeModeSchema.safeParse("verified_chart").success, true);
assert.equal(consultationBirthTimeModeSchema.safeParse("unverified_birth_time").success, true);
assert.equal(consultationBirthTimeModeSchema.safeParse("declared_birth_window").success, true);