Partitions sessions into N rooms, runs gamesPerRoom games per room in parallel via Promise.allSettled so a failure in one room never unwinds the others. Errors roll up into ScenarioResult.errors. Verified via tsx: listScenarios() returns [populate], getScenario() resolves by name and returns undefined for unknown names. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
537 B
TypeScript
23 lines
537 B
TypeScript
/**
|
|
* Scenario registry — name → Scenario mapping.
|
|
*
|
|
* Runner looks up scenarios by name. Add a new scenario by importing
|
|
* it here and adding an entry to `registry`. No filesystem scanning,
|
|
* no magic.
|
|
*/
|
|
|
|
import type { Scenario } from '../core/types';
|
|
import populate from './populate';
|
|
|
|
const registry: Record<string, Scenario> = {
|
|
populate,
|
|
};
|
|
|
|
export function getScenario(name: string): Scenario | undefined {
|
|
return registry[name];
|
|
}
|
|
|
|
export function listScenarios(): Scenario[] {
|
|
return Object.values(registry);
|
|
}
|