Nothing in the workspace depended on it — session handles are generated client-side in web/src/names.ts, which carried its own copy of the wordlists. Also drops two unused deps: rust-embed (no crate used it; maestro-web embeds via include_dir) and urlencoding in maestro-cli. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
// 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<T>(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)}`;
|
|
}
|