/** * Delx Wellness shared profile store — canonical source. * * Single source of truth for user wellness context across the 14+ MCP * connectors in the Delx Wellness ecosystem. Stored at: * * ~/.delx-wellness/profile.json * * Every connector that wants to read/write user profile data vendors a * COPY of this file into `src/services/profile-store.ts` (keeps each * connector self-contained, no extra npm dep). When the schema changes, * bump v1 → v2 here AND copy the same change into every connector. * * Schema is intentionally identical to * `delx-wellness-hermes/src/wellness-profile.ts` (v1) so the Hermes / * OpenClaw profile packs can hand off seamlessly via the migration * helper below. * * PRIVACY CONTRACT (enforced at validation time): * ✘ NEVER stores OAuth tokens, API keys, refresh tokens, cookies, * session ids, raw provider secrets. * ✘ NEVER stores diagnostic biomarkers (HRV, glucose, BP) — those live * in the connector's own data flow. * ✓ Stores only what the user explicitly typed into onboarding: * preferred name, body basics, goals, devices, training context, * nutrition context, exercise preferences, agent preferences, * safety flags. */ export type WellnessLanguage = "en" | "pt-BR"; export type WellnessUnits = "metric" | "imperial"; export type WellnessReplyStyle = "concise" | "detailed"; export interface WellnessProfile { preferred_name: string; language: WellnessLanguage; timezone: string; units: WellnessUnits; /** Either an integer year (e.g. "1985") or a stated age (e.g. "39"). Optional. */ age_or_birth_year: string; /** Free-form, e.g. "178 cm" or "5'10\"". */ height: string; /** Free-form, e.g. "72 kg" or "158 lb". */ weight: string; /** Free-form context for cycle-aware coaching, e.g. "female (menstruating)". Optional. */ sex_or_gender_context: string; } export interface WellnessGoals { primary: string; secondary: string[]; training_focus: string; recovery_focus: string; nutrition_focus: string; sleep_focus: string; biggest_friction: string; } export interface WellnessDevices { connected: string[]; desired: string[]; primary_recovery_source: string; primary_activity_source: string; primary_nutrition_source: string; } export interface WellnessTraining { sports: string[]; weekly_schedule: string; equipment: string[]; location: string[]; preferred_duration_minutes: string; exercises_to_avoid: string[]; limitations: string[]; } export interface WellnessNutrition { dietary_preferences: string[]; restrictions_or_allergies: string[]; protein_target_g: string; hydration_target_ml: string; calorie_target: string; } export interface WellnessPreferences { language_priority: WellnessLanguage[]; reply_style: WellnessReplyStyle; telegram_style: WellnessReplyStyle; ask_before_logging: boolean; include_exercise_videos_when_available: boolean; } export interface WellnessSafety { injuries_or_pain: string[]; medical_constraints: string[]; conservative_flags: string[]; } export interface WellnessProfileDocument { schema: "delx-wellness-profile/v1"; generated_by: string; version: 1; profile: WellnessProfile; goals: WellnessGoals; devices: WellnessDevices; training: WellnessTraining; nutrition: WellnessNutrition; preferences: WellnessPreferences; safety: WellnessSafety; notes: string; updated_at?: string; } export interface OnboardingQuestion { id: string; prompt: string; category: "profile" | "goals" | "devices" | "training" | "nutrition" | "exercise" | "preferences" | "safety"; required: boolean; } export interface OnboardingFlow { locale: WellnessLanguage; questions: OnboardingQuestion[]; storage_path: string; privacy_note: string; } export declare const DEFAULT_PROFILE: WellnessProfileDocument; /** Returns the absolute storage path. Useful in privacy_audit responses. */ export declare function getProfilePath(): string; /** * Read the canonical profile. Returns a fresh DEFAULT_PROFILE if no file * exists (and does not create the file — call updateProfile to persist). * * Auto-migrates from Hermes / OpenClaw profile if found and the canonical * file is missing. */ export declare function getProfile(): Promise; /** * Persist a partial patch to the canonical profile. Validates the patch * against the schema before writing, rejecting unknown top-level keys and * any field that smells like a secret (oauth, token, secret, password, * cookie, refresh). */ export declare function updateProfile(patch: Partial): Promise; /** * One-time migration from the Hermes or OpenClaw profile pack location. * Only runs if the canonical file does NOT exist. Idempotent. */ export declare function migrateFromLegacy(): Promise<{ migrated: boolean; from?: string; }>; /** Return the 11-question onboarding flow in the requested locale. */ export declare function getOnboardingQuestions(locale?: WellnessLanguage): OnboardingQuestion[]; export declare function getOnboardingFlow(locale?: WellnessLanguage): OnboardingFlow; /** One-line summary for agent context handoff. */ export declare function buildProfileSummary(profile: WellnessProfileDocument): string; export declare function missingCriticalFields(profile: WellnessProfileDocument): string[];