/** * Human-readable task name generator. * Format: AdjectiveNoun (e.g., "SwiftFalcon", "CalmPanda") * * Curated lists of ~120 adjectives and ~120 animals/nouns. * 120 × 120 = 14,400 combinations. */ const ADJECTIVES = [ "active", "agile", "alert", "ancient", "bold", "brave", "bright", "brilliant", "calm", "capable", "careful", "charming", "cheerful", "clever", "cloudy", "cold", "cool", "curious", "cute", "daring", "dark", "deep", "direct", "eager", "early", "electric", "elegant", "energetic", "enormous", "epic", "exact", "exotic", "fair", "fancy", "fast", "fierce", "firm", "flat", "flexible", "fresh", "friendly", "full", "fun", "funny", "gentle", "global", "golden", "good", "grand", "grateful", "great", "green", "happy", "hard", "heavy", "hidden", "honest", "hot", "huge", "icy", "ideal", "keen", "kind", "large", "lazy", "light", "lively", "local", "loud", "lucky", "magic", "mighty", "mild", "modern", "neat", "new", "nice", "noble", "odd", "old", "open", "patient", "perfect", "plain", "polite", "popular", "powerful", "precise", "pretty", "proud", "pure", "quick", "quiet", "rapid", "rare", "real", "rich", "robust", "round", "royal", "safe", "sharp", "short", "shy", "silent", "simple", "slim", "smart", "smooth", "soft", "solar", "solid", "steady", "strange", "strong", "sunny", "swift", "tall", "tame", "tiny", "tough", "true", "unique", "vast", "warm", "wild", "wise", "zany", "zen", ] as const; const NOUNS = [ "albatross", "ant", "antelope", "ape", "archer", "badger", "bass", "bat", "bear", "beaver", "bee", "beetle", "bird", "bison", "boar", "bobcat", "bull", "buzzard", "camel", "canary", "carp", "cat", "cedar", "cheetah", "chicken", "cobra", "cod", "condor", "coral", "cougar", "crab", "crane", "cricket", "crow", "deer", "dolphin", "dove", "dragon", "duck", "eagle", "eel", "elk", "falcon", "ferret", "finch", "flamingo", "fox", "frog", "gazelle", "gecko", "ghost", "gibbon", "goat", "goldfish", "goose", "gorilla", "halibut", "hamster", "hare", "hawk", "heron", "horse", "hummingbird", "hyena", "ibis", "iguana", "impala", "jackal", "jaguar", "jay", "jellyfish", "kangaroo", "kite", "kiwi", "koala", "krill", "lark", "lemur", "leopard", "lion", "lizard", "llama", "lobster", "lynx", "macaw", "magnet", "mammoth", "marmot", "mink", "mole", "monkey", "moose", "moth", "mouse", "newt", "ocelot", "octopus", "orca", "ostrich", "otter", "owl", "ox", "panda", "panther", "parrot", "peacock", "pelican", "penguin", "pike", "pony", "python", "quail", "rabbit", "raccoon", "ram", "raven", "robin", "rook", "sable", "salmon", "scorpion", "seal", "shark", "sheep", "snail", "sparrow", "spider", "squid", "squirrel", "stork", "swan", "tiger", "toad", "tortoise", "toucan", "trout", "tuna", "turkey", "turtle", "viper", "vulture", "walrus", "wasp", "whale", "wolf", "wombat", "woodpecker", "wren", "yak", "zebra", ] as const; function capitalize(s: string): string { return s.charAt(0).toUpperCase() + s.slice(1); } const usedNames = new Set(); /** * Generate a unique two-word identifier (e.g., "SwiftFalcon"). * Resets and starts over if all combinations exhausted. */ export function generateTaskName(): string { // Try random combinations first (50 attempts) for (let attempt = 0; attempt < 50; attempt++) { const adj = ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]!; const noun = NOUNS[Math.floor(Math.random() * NOUNS.length)]!; const name = `${capitalize(adj)}${capitalize(noun)}`; if (!usedNames.has(name)) { usedNames.add(name); return name; } } // Exhaustive search if random fails for (const adj of ADJECTIVES) { for (const noun of NOUNS) { const name = `${capitalize(adj)}${capitalize(noun)}`; if (!usedNames.has(name)) { usedNames.add(name); return name; } } } // All combinations exhausted — reset and start over usedNames.clear(); return generateTaskName(); }