feat(health): wire H5 health page, WeChat channel, and observation API.

Expose /health and /api/health/observations behind MEMIND_HEALTH_ENABLED, redirect ordinary chat health intents without persisting, and run a dedicated WeChat menu flow with confirm-before-write semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-09-02 10:05:56 +08:00
parent f96fdcb3b9
commit 7bf16500a1
22 changed files with 1132 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
import { apiFetch } from './core';
export async function listHealthObservations(limit = 50) {
const data = await apiFetch(`/health/observations?limit=${limit}`);
return Array.isArray(data?.observations) ? data.observations : [];
}
export async function saveConfirmedBloodPressure(input: {
systolic: number;
diastolic: number;
context: 'morning' | 'evening' | 'other';
observedAt?: number;
}) {
return apiFetch('/health/observations', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
confirmed: true,
metricSet: 'blood_pressure',
systolic: input.systolic,
diastolic: input.diastolic,
context: input.context,
observedAt: input.observedAt ?? Date.now(),
source: 'manual',
}),
});
}