# LagZero API Documentation ## IPC Interfaces The LagZero backend exposes several IPC interfaces for the frontend to interact with the core system. ### Categories API (`window.categories`) - `getAll()`: Promise - Returns all configured categories. - `save(category: Category)`: Promise - Creates or updates a category. - `delete(id: string)`: Promise - Deletes a category by ID. - `match(name: string, processes: string[])`: Promise - Attempts to auto-classify a game based on its name and process list using configured rules. ### Profiles API (`window.profiles`) - `getAll()`: Promise - Returns all configuration profiles. - `save(profile: ConfigProfile)`: Promise - Creates or updates a configuration profile. - `delete(id: string)`: Promise - Deletes a profile by ID. ### Proxy Monitor API (`window.proxyMonitor`) - `start(gameId: string, processNames: string[])`: Promise - Starts the intelligent proxy monitor for a specific game. - Enables chain proxy detection (child process monitoring). - `stop()`: Promise - Stops the current monitoring session. ### System API (`window.system`) - `scanProcesses()`: Promise - Returns a list of currently running process names. - `getProcessTree()`: Promise - Returns the full process tree (Windows only). ## Data Models ### Category ```typescript interface Category { id: string; name: string; parentId?: string; rules?: string[]; // Regex patterns for auto-classification icon?: string; order?: number; } ``` ### ConfigProfile ```typescript interface ConfigProfile { id: string; name: string; description?: string; rules: ConfigRule[]; chainProxy: boolean; } interface ConfigRule { type: 'process' | 'domain' | 'ip'; value: string[]; outbound: 'proxy' | 'direct' | 'block'; } ```