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:
@@ -4,7 +4,10 @@ import { SubscribeModal } from '../components/SubscribeModal';
|
||||
import { useTKMindChat } from '../hooks/useTKMindChat';
|
||||
import type { CapabilityMap, PortalUser } from '../types';
|
||||
|
||||
type ChatContextValue = ReturnType<typeof useTKMindChat>;
|
||||
type ChatContextValue = ReturnType<typeof useTKMindChat> & {
|
||||
goalRunEnabled?: boolean;
|
||||
healthEnabled?: boolean;
|
||||
};
|
||||
|
||||
const ChatContext = createContext<ChatContextValue | null>(null);
|
||||
|
||||
@@ -13,6 +16,7 @@ export function ChatProvider({
|
||||
capabilities,
|
||||
grantedSkills,
|
||||
goalRunEnabled,
|
||||
healthEnabled,
|
||||
onUserUpdate,
|
||||
children,
|
||||
}: {
|
||||
@@ -20,13 +24,14 @@ export function ChatProvider({
|
||||
capabilities?: CapabilityMap | null;
|
||||
grantedSkills?: string[];
|
||||
goalRunEnabled?: boolean;
|
||||
healthEnabled?: boolean;
|
||||
onUserUpdate?: (user: PortalUser) => void;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const chat = useTKMindChat(user, onUserUpdate, capabilities, grantedSkills);
|
||||
|
||||
return (
|
||||
<ChatContext.Provider value={{ ...chat, goalRunEnabled }}>
|
||||
<ChatContext.Provider value={{ ...chat, goalRunEnabled, healthEnabled }}>
|
||||
{children}
|
||||
{typeof chat.balanceCents === 'number' && chat.rechargePrompt && (
|
||||
<RechargeModal
|
||||
|
||||
Reference in New Issue
Block a user