| import type { PicletType } from '../types/picletTypes'; | |
| // Discovery Status | |
| export enum DiscoveryStatus { | |
| NEW = 'new', | |
| VARIATION = 'variation', | |
| EXISTING = 'existing' | |
| } | |
| // PicletInstance - Individual monster instances discovered by players | |
| export interface PicletInstance { | |
| id?: number; | |
| // Basic Info | |
| typeId: string; // Unique identifier for this specific Piclet | |
| objectName: string; // Canonical object name (e.g., "pillow", "pyramid") | |
| nickname?: string; | |
| primaryType: PicletType; | |
| tier: string; // 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary' | |
| // Discovery Metadata | |
| isCanonical: boolean; // True if this is the canonical version | |
| canonicalId?: string; // Reference to canonical Piclet if this is a variation | |
| variationAttributes?: string[]; // e.g., ["velvet", "blue"] for variations | |
| discoveredBy?: string; // DEPRECATED: Legacy username field (use discovererUsername) | |
| discovererSub?: string; // HF user ID (stable primary key) | |
| discovererUsername?: string; // HF username (cached for display) | |
| discovererName?: string; // Display name (cached) | |
| discovererPicture?: string; // Avatar URL (cached) | |
| discoveredAt: Date; // When first discovered | |
| scanCount: number; // Total times this Piclet has been scanned | |
| // Collection Management | |
| isInCollection: boolean; // Whether player has discovered this | |
| collectedAt?: Date; // When player discovered it | |
| // Visual Data | |
| imageUrl: string; | |
| imageData?: string; // Base64 encoded image with transparency | |
| imageCaption: string; // Original caption from image | |
| visualDetails?: string; // Extra visual details for monster generation | |
| concept: string; // Generated monster concept | |
| description: string; // Generated monster description | |
| imagePrompt: string; // Prompt used for image generation | |
| // Physical Characteristics | |
| height?: string; // e.g., "1.2m", "3'5\"" | |
| weight?: string; // e.g., "15kg", "33 lbs" | |
| personality?: string; // e.g., "Playful and curious", "Shy but loyal" | |
| } | |
| // ActivityEntry - Recent discoveries and leaderboard | |
| export interface ActivityEntry { | |
| id?: number; | |
| // Type | |
| type: 'discovery' | 'variation' | 'milestone'; | |
| // Details | |
| title: string; | |
| description: string; | |
| picletTypeId: string; | |
| discovererName: string; | |
| discovererPicture?: string; // Avatar URL | |
| discovererSub?: string; // For linking to user profiles | |
| rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary'; | |
| // Timing | |
| createdAt: Date; | |
| } | |
| // GameState - Discovery progress and stats | |
| export interface GameState { | |
| id?: number; | |
| // Timing | |
| lastActivityRefresh: Date; | |
| lastPlayed: Date; | |
| // Discovery Stats | |
| totalDiscoveries: number; | |
| uniqueDiscoveries: number; // Canonical Piclets found | |
| variationsFound: number; | |
| rarityScore: number; // Sum of rarity points | |
| currentStreak: number; // Days in a row with discoveries | |
| // Cached server data | |
| lastServerSync?: Date; | |
| cachedLeaderboard?: LeaderboardEntry[]; | |
| } | |
| // LeaderboardEntry - For activity feed | |
| export interface LeaderboardEntry { | |
| username: string; | |
| totalDiscoveries: number; | |
| uniqueDiscoveries: number; | |
| rarityScore: number; | |
| rank: number; | |
| } | |
| // UserProfile - HuggingFace user profile data | |
| export interface UserProfile { | |
| sub: string; // HF user ID (primary key) | |
| preferred_username: string; // Current username | |
| name?: string; // Display name | |
| picture?: string; // Avatar URL | |
| lastSeen: Date; // Last OAuth login | |
| totalDiscoveries: number; // Cached stat | |
| uniqueDiscoveries: number; // Cached stat | |
| visibility: 'public' | 'private'; // Privacy setting (default: public) | |
| } | |
| // Trainer Scanning Progress - Track automated trainer piclet generation | |
| export interface TrainerScanProgress { | |
| id?: number; | |
| // Image Info | |
| imagePath: string; // e.g., "trainer_images/001_Willow_Snap/image_001.jpg" | |
| trainerName: string; // e.g., "001_Willow_Snap" | |
| imageIndex: number; // e.g., 1, 2, 3 for multiple images per trainer | |
| // Processing Status | |
| status: 'pending' | 'processing' | 'completed' | 'failed'; | |
| // Results | |
| picletInstanceId?: number; // ID of generated piclet if successful | |
| errorMessage?: string; // Error details if failed | |
| // Timing | |
| startedAt?: Date; | |
| completedAt?: Date; | |
| // Remote URL for reference | |
| remoteUrl: string; // Full HuggingFace URL | |
| } | |