/** * A single prediction made by an agent. */ export interface Prediction { /** Unique prediction ID */ id: string; /** What the agent predicted */ prediction: string; /** Confidence level (0-1) */ confidence: number; /** When the prediction was made (ISO date string) */ madeAt: string; /** Optional deadline by which the prediction should be resolved (ISO date string) */ resolveBy?: string; /** Actual outcome (set when resolved) */ outcome?: string; /** Whether the prediction was accurate (set when resolved) */ accurate?: boolean; /** When the prediction was resolved (ISO date string) */ resolvedAt?: string; } /** * Persisted predictions data structure. */ export interface PredictionsData { /** All predictions (resolved and unresolved) */ predictions: Prediction[]; /** Overall calibration score (0-1, higher = better calibrated) */ calibrationScore: number; } /** * Service for tracking agent prediction accuracy and calibration. * * Agents make predictions with confidence levels, then resolve them * with actual outcomes. The calibration score measures how well * an agent's confidence maps to actual accuracy. * * Storage: ~/.crewly/agents/{sessionName}/predictions.json */ export declare class PredictionCalibrationService { /** * Get the file path for an agent's predictions. * * @param sessionName - Agent session name * @returns Absolute path to predictions.json */ private getFilePath; /** * Read predictions data from disk. * * @param sessionName - Agent session name * @returns Predictions data, or empty default if file doesn't exist */ getPredictions(sessionName: string): Promise; /** * Record a new prediction. * * @param sessionName - Agent session name * @param prediction - What is being predicted * @param confidence - Confidence level (0-1) * @param resolveBy - Optional ISO date by which the prediction should be resolved * @returns The created prediction */ makePrediction(sessionName: string, prediction: string, confidence: number, resolveBy?: string): Promise; /** * Resolve a prediction with its actual outcome. * * @param sessionName - Agent session name * @param id - Prediction ID to resolve * @param outcome - What actually happened * @param accurate - Whether the prediction was accurate * @returns The resolved prediction, or null if not found */ resolvePrediction(sessionName: string, id: string, outcome: string, accurate: boolean): Promise; /** * Get the agent's current calibration score. * * @param sessionName - Agent session name * @returns Calibration score (0-1), or 0 if no resolved predictions */ getCalibrationScore(sessionName: string): Promise; /** * Calculate calibration score from resolved predictions. * * Uses a simplified Brier-like score: for each resolved prediction, * compares confidence to actual accuracy. Perfect calibration = 1.0. * * @param predictions - All predictions * @returns Calibration score (0-1) */ private calculateCalibrationScore; /** * Persist predictions data to disk. * * @param sessionName - Agent session name * @param data - Predictions data to save */ private save; } //# sourceMappingURL=prediction-calibration.service.d.ts.map