import { type ModeDef } from '@moxxy/sdk'; export declare class ModeRegistry { private readonly modes; private active; private previous; private readonly changeListeners; /** Observe active-mode changes — used by the runner to broadcast * InfoChanged so remote clients track a mode switch (whether it came from * a `setMode` RPC or a mode handing off to another mode mid-session). */ onActiveChange(fn: () => void): () => void; /** * Register a mode. Throws on duplicate — use `replace()` for * overwrite. Auto-activates on first registration (modes need a default * for any session to work). */ register(mode: ModeDef): void; replace(mode: ModeDef): void; /** * Remove a mode. If it was active, the active slot is cleared — * callers must `setActive()` explicitly rather than silently picking * some arbitrary "next" mode. */ unregister(name: string): void; list(): ReadonlyArray; has(name: string): boolean; /** Active mode name, or null when none is active. Mirrors ActiveDefRegistry * so the manifest apply loop + `categories()` surface can treat modes * uniformly. (`mode` has no protected-floor concept here — `mode-default` * is a critical package, so the default is protected at the package level.) */ getActiveName(): string | null; /** * Name of the mode that was active before the current one, or null when * there is no history (session boot). Lets a transient mode (goal) revert * to whatever the user was in before arming it — carried onto the * ModeContext as `previousModeName` by run-turn. */ getPreviousActiveName(): string | null; setActive(name: string): void; getActive(): ModeDef; private activate; /** Fan out to change listeners, isolating each fault so a single throwing * observer (e.g. the runner's InfoChanged broadcast hitting a dead socket) * can't abort the rest or unwind into register()/replace()/setActive(). */ private notifyChange; } //# sourceMappingURL=modes.d.ts.map