UNPKG

selenium-webdriver-mcp

Version:
41 lines 1.05 kB
export class StateManager { state; constructor() { this.state = { drivers: new Map(), currentSession: null, }; } getState() { return this.state; } getDriver() { if (!this.state.currentSession) { throw new Error('No active browser session'); } const driver = this.state.drivers.get(this.state.currentSession); if (!driver) { throw new Error('No active browser session'); } return driver; } setCurrentSession(sessionId) { this.state.currentSession = sessionId; } addDriver(sessionId, driver) { this.state.drivers.set(sessionId, driver); } removeDriver(sessionId) { this.state.drivers.delete(sessionId); } clearDrivers() { this.state.drivers.clear(); } getCurrentSession() { return this.state.currentSession; } resetCurrentSession() { this.state.currentSession = null; } } //# sourceMappingURL=helpers.js.map