Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
import { safeReadStorage, safeWriteStorage } from '../lib/safeStorage';
export const HIDDEN_KEY = 'portos.voice.hidden';
export const VISIBILITY_EVENT = 'portos:voice:visibility';
export const ENGAGE_EVENT = 'portos:voice:engage';
export const DISENGAGE_EVENT = 'portos:voice:disengage';
// Sentinel '0' = explicitly engaged. Anything else (including key absent)
// means hidden — keeps legacy users hidden by default after the flip.
export const readVoiceHidden = () => safeReadStorage(HIDDEN_KEY) !== '0';
export const writeVoiceHidden = (hidden) => {
safeWriteStorage(HIDDEN_KEY, hidden ? '1' : '0');
if (typeof window !== 'undefined') window.dispatchEvent(new Event(VISIBILITY_EVENT));
};
// Storage events fire for every localStorage write in any tab; gate to our key
// (or null = clear) so unrelated writes don't churn voice components.
export const isVoiceHiddenStorageEvent = (event) =>
!event || event.key === HIDDEN_KEY || event.key === null;