chore: add WebSocket API with Mongoose, service management, and AI command execution

Add new WebSocket API module (api.c/api.h) using Mongoose library for real-time
window manager control, including workspace and client status endpoints.
Introduce service management module (services.h) with init/run/cleanup lifecycle.
Extend AI module to parse [WM_CMD:] directives from responses and forward JSON
commands to the API handler. Update config with api.enabled, api.port, and
services.path settings. Integrate new modules into main init/run/cleanup flow.
This commit is contained in:
2026-01-08 22:58:19 +00:00
parent 54565b21bd
commit 4793d372ac
16 changed files with 20963 additions and 6 deletions
+16
View File
@@ -0,0 +1,16 @@
/*
* DWN - Desktop Window Manager
* WebSocket API
*/
#ifndef DWN_API_H
#define DWN_API_H
#include <stdbool.h>
void api_init(void);
void api_process(void);
void api_cleanup(void);
void api_handle_json_command(const char *json_str);
#endif
+4
View File
@@ -60,6 +60,10 @@ struct Config {
bool autostart_xdg;
char autostart_path[512];
char services_path[512];
bool api_enabled;
int api_port;
int demo_step_delay_ms;
int demo_ai_timeout_ms;
int demo_window_timeout_ms;
+3013
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
/*
* DWN - Desktop Window Manager
* Service management
*/
#ifndef DWN_SERVICES_H
#define DWN_SERVICES_H
void services_init(void);
void services_run(void);
void services_cleanup(void);
#endif