/**
 * Canonical mode name constants + shared mutable mode state.
 *
 * Every mode name used anywhere in the codebase should reference these
 * constants instead of magic strings. This is the single source of truth.
 *
 * 0 internal imports — any layer can import from here.
 */
export const MODE = {
    INSTALLATION: 'installation',
    ACTION: 'action',
    PLAN: 'plan',
    ASK: 'ask',
    MANAGE: 'manage'
};
let _currentMode = '';
const _listeners = new Set();
/** Read the current agent mode. */
export function getCurrentMode() {
    return _currentMode;
}
/** Set the current agent mode and notify all listeners. */
export function setCurrentMode(mode) {
    if (mode === _currentMode)
        return;
    _currentMode = mode;
    for (const fn of _listeners)
        fn(mode);
}
/** Subscribe to mode changes. Returns an unsubscribe function. */
export function onModeChange(fn) {
    _listeners.add(fn);
    return () => _listeners.delete(fn);
}
//# sourceMappingURL=mode-names.js.map