// Client-side session-handle generator for the spawn form's instant reroll // (#23/#27). The spawn form rerolls without a round trip, so the wordlists // live here; nothing server-side generates handles. /** Musical adjectives — tempo, dynamics, and articulation markings. */ const ADJECTIVES = [ "allegro", "andante", "adagio", "presto", "vivace", "largo", "grave", "lento", "moderato", "crescendo", "staccato", "legato", "forte", "dolce", "agitato", "cantabile", "sostenuto", "tremolo", "rubato", "marcato", "brillante", "maestoso", "grazioso", "espressivo", "tranquillo", "animato", "spirito", "sotto", "vivo", "feroce", ]; /** Musical nouns — instruments and forms from the concert hall. */ const NOUNS = [ "cello", "violin", "viola", "oboe", "flute", "clarinet", "bassoon", "trumpet", "trombone", "tuba", "horn", "timpani", "harp", "piano", "organ", "lyre", "lute", "fugue", "sonata", "octave", "chord", "cadence", "prelude", "rondo", "nocturne", "scherzo", "refrain", "coda", "motif", "overture", ]; function pick(list: T[]): T { return list[Math.floor(Math.random() * list.length)]; } /** A fresh `adjective-noun` handle, e.g. `allegro-cello`. */ export function generateName(): string { return `${pick(ADJECTIVES)}-${pick(NOUNS)}`; }