refactor(gateway): split server runtime

This commit is contained in:
Peter Steinberger
2026-01-14 09:11:21 +00:00
parent ea018a68cc
commit d19bc1562b
30 changed files with 3486 additions and 2542 deletions

View File

@@ -0,0 +1,21 @@
import type { WizardSession } from "../wizard/session.js";
export function createWizardSessionTracker() {
const wizardSessions = new Map<string, WizardSession>();
const findRunningWizard = (): string | null => {
for (const [id, session] of wizardSessions) {
if (session.getStatus() === "running") return id;
}
return null;
};
const purgeWizardSession = (id: string) => {
const session = wizardSessions.get(id);
if (!session) return;
if (session.getStatus() === "running") return;
wizardSessions.delete(id);
};
return { wizardSessions, findRunningWizard, purgeWizardSession };
}