/**
 * 用户统计响应
 * 
 */
import { z } from "zod";
import { PersonalityTraitsSchema, PERSONALITY_TRAITS_DEFAULTS } from "./personality_traits";
import { RecentMemorySchema } from "./recent_memory";

export const UserStatsResponseSchema = z.object({
  userId: z.string(),
  username: z.string(),
  platform: z.string(),
  intimacy: z.number(),
  relationshipStage: z.string(),
  dolBalance: z.number(),
  totalMessages: z.number(),
  lastMessageAt: z.string().default(""),
  accountCreatedAt: z.string().default(""),
  currentMood: z.string().default(""),
  personalityTraits: PersonalityTraitsSchema.default(PERSONALITY_TRAITS_DEFAULTS),
  recentMemories: z.array(RecentMemorySchema).default([]),
  promptTokensTotal: z.number().default(0),
  completionTokensTotal: z.number().default(0),
  cacheHitTokensTotal: z.number().default(0),
  tokensTotal: z.number().default(0),
});

export type UserStatsResponseInput = z.input<typeof UserStatsResponseSchema>;
export type UserStatsResponseData = z.output<typeof UserStatsResponseSchema>;
