import { z } from "zod"; import type { WhoopClient } from "../api/client.js"; import type { Workout } from "../api/types.js"; import { type SourceQuality } from "../tools/analytics-utils.js"; import { type PerformanceState } from "./schemas.js"; import type { TrainingSession } from "./session-grouping.js"; import { type ResolvedDiscipline } from "./sport-classifier.js"; import type { AuditLogPage } from "./audit-log.js"; export declare const KJ_PER_KCAL = 4.184; /** Injected by the server: stdio mode passes loaders, remote (HTTP) mode passes none. */ export interface PerformanceDeps { now?: Date; loadState?: () => Promise; readAudit?: (limit: number) => Promise; } export type { AuditLogPage }; /** Local write context. `directory` defaults to ~/.whoop-mcp. */ export interface PerformanceWriteDeps { directory?: string; now?: Date; actor?: "mcp_tool" | "dashboard"; } /** A validation failure whose message is safe and useful to show to the user verbatim. */ export declare class PerformanceInputError extends Error { constructor(message: string); } export declare function inputErrorFrom(error: z.ZodError): PerformanceInputError; export declare const candidateSchema: z.ZodObject<{ start: z.ZodString; kind: z.ZodEnum<{ workout: "workout"; session: "session"; }>; reason: z.ZodString; workout_ids: z.ZodArray; }, z.core.$strip>; export type Candidate = z.infer; /** Confirmed = any segment resolves to "hyrox" (user relabel or rule). Never auto-confirmed. */ export declare function classifySessions(sessions: TrainingSession[], disciplineOf: (workout: Workout) => ResolvedDiscipline): { confirmed: TrainingSession[]; candidates: Candidate[]; }; export declare const storeStatusSchema: z.ZodObject<{ status: z.ZodEnum<{ error: "error"; available: "available"; not_configured: "not_configured"; }>; message: z.ZodNullable; }, z.core.$strip>; export type StoreStatus = z.infer; export declare const isoDaySchema: z.ZodString; /** Never throws: a missing or broken local store degrades to WHOOP-only results. */ export declare function readPerformanceState(loadState: PerformanceDeps["loadState"]): Promise<{ state: PerformanceState; store: StoreStatus; }>; export declare function disciplineResolver(state: PerformanceState): (workout: Workout) => ResolvedDiscipline; export declare function loadWorkouts(client: WhoopClient, period: { start: string; end: string; }): Promise<{ records: Workout[]; quality: SourceQuality; }>; export interface WellnessDay { date: string; recovery_score: number | null; hrv_rmssd_milli: number | null; resting_heart_rate: number | null; spo2_pct: number | null; user_calibrating: boolean; sleep_hours: number | null; sleep_performance_pct: number | null; respiratory_rate: number | null; standing_sleep_debt_hours: number | null; sleep_stages?: { light_hours: number; deep_hours: number; rem_hours: number; awake_hours: number; }; } /** * One row per local wake-up day: the main (non-nap) scored sleep joined to its recovery by * `sleep_id`. Fetch failures are reported in quality, never thrown. */ export declare function loadWellness(client: WhoopClient, period: { start: string; end: string; }): Promise<{ days: WellnessDay[]; sources: Record; }>; export declare function baselineMean(days: WellnessDay[], before: string, pick: (day: WellnessDay) => number | null, windowDays?: number): { mean: number | null; count: number; }; export declare function shiftDay(day: string, days: number): string; /** Monday of the ISO week containing `day`. */ export declare function weekStart(day: string): string; export declare function durationSeconds(workout: Workout): number; export declare function workoutDay(workout: Workout): string; export declare function round(value: number, digits?: number): number; /** Resolves an optional `start`/`end` pair (YYYY-MM-DD or ISO datetime) with a default length. */ export declare function resolveWindow(params: { start?: string; end?: string; }, now: Date, defaultDays: number, maxDays: number): { start: string; end: string; }; export declare const windowInputShape: { start: z.ZodOptional; end: z.ZodOptional; }; //# sourceMappingURL=context.d.ts.map