import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'; import { WorkspaceWarden } from './workspace-warden.js'; import { WindowGuard } from './window-guard.js'; import { ContainerSupervisor } from './container-supervisor.js'; import { EntryUX } from './entry-ux.js'; import { DBusService } from './dbus-service.js'; import { log, error } from './util/logger.js'; export default class DashwardExtension extends Extension { private warden?: WorkspaceWarden; private guard?: WindowGuard; private container?: ContainerSupervisor; private entry?: EntryUX; private dbus?: DBusService; override enable(): void { log(`enable: ${this.metadata.uuid} v${this.metadata.version}`); try { this.warden = new WorkspaceWarden(); } catch (e) { error(`WorkspaceWarden init failed: ${String(e)}`); // Don't proceed if the warden didn't come up — everything else // depends on the dashboard workspace existing. return; } try { this.guard = new WindowGuard(this.warden); } catch (e) { error(`WindowGuard init failed: ${String(e)}`); // Dashboard workspace exists but is undefended. Continue so disable() // can still tear down the warden cleanly. } // P3+ components still placeholders, wired in their own phases. // this.container = new ContainerSupervisor(this.warden, this.guard); // this.entry = new EntryUX(); // this.dbus = new DBusService(); } override disable(): void { log('disable'); this.dbus?.dispose(); this.entry?.dispose(); this.container?.dispose(); this.guard?.dispose(); this.warden?.dispose(); this.dbus = undefined; this.entry = undefined; this.container = undefined; this.guard = undefined; this.warden = undefined; } }