import { z } from 'zod';

export const FeynmanEvaluationResultSchema = z.object({
  score: z.number().int().min(0).max(100),
  clarityLevel: z.enum(['crystal_clear', 'clear', 'mostly_clear', 'confusing', 'very_confusing']),
  summary: z.string().min(1).max(2000),
  strengths: z.array(z.string().max(500)).max(10).default([]),
  weaknesses: z.array(z.string().max(500)).max(10).default([]),
  blindSpots: z.array(z.string().max(500)).max(10).default([]),
  suggestions: z.array(z.string().max(500)).max(10).default([]),
  isBeginnerFriendly: z.boolean(),
  analogyQuality: z.enum(['excellent', 'good', 'acceptable', 'poor', 'none']).optional(),
  jargonUsage: z.enum(['none', 'minimal', 'moderate', 'heavy']),
});

export type FeynmanEvaluationResult = z.infer<typeof FeynmanEvaluationResultSchema>;

export const FEYNMAN_OUTPUT_SCHEMA_DESC = `{
  "score": 75,
  "clarityLevel": "mostly_clear",
  "summary": "用户用自己的话解释了核心概念，但缺少具体类比帮助理解。",
  "strengths": ["用简单语言重述了概念", "抓住了核心要点"],
  "weaknesses": ["缺少生活化类比", "部分术语未解释"],
  "blindSpots": ["没有说明为什么这个知识点重要", "没有举例应用场景"],
  "suggestions": ["尝试用一个日常生活中类比来解释", "补充一个具体的使用场景"],
  "isBeginnerFriendly": true,
  "analogyQuality": "poor",
  "jargonUsage": "moderate"
}`;
