A second implementation of cst_agent_hooks_t next to the TUI: the turn runs on a worker thread, the hooks publish events into a ring buffer that SSE clients read, so the engine itself needs no changes. - src/net.c, include/cst_net.h: POSIX/Winsock sockets, non-blocking connect - src/http_srv.c, include/cst_http.h: HTTP/1.1, keep-alive, chunked streaming, body caps (413), Expect: 100-continue, connection cap, exact routing - src/web_md.c, include/cst_web_md.h: streaming markdown -> sanitized HTML (tag/attribute allowlist, javascript: URLs and off-site images dropped) - src/webui.c, include/cst_webui.h: event ring + SSE broadcast, all routes, token (Bearer/Cookie/query) and loopback Host checks, 3 s auto-deny when no client is attached - src/webui_stub.c, CST_WEBUI=0 / CST_BUILD_WEBUI=OFF: build without the WebUI - web/: no-build front end (transcript, approvals, todo, sessions, image upload, status bar) - docs/webui.md: engine API v1 - events, requests, security model - tests/test_webui.c, scripts/e2e_webui.sh: unit tests plus an end-to-end run driven by a recorded SSE stream (no API key needed) - src/main.c: --web --web-port --web-host --web-token --web-dev --web-open and CST_WEB_PORT/HOST/TOKEN/ROOT An empty POST body is now accepted without Content-Length (RFC 9112 6.3) so curl-driven clients can reach cancel/undo/compact/quit; CMakeList's core tests learned about sashidown and test_webui, and CST_WEBUI=0 defines CST_NO_WEBUI.
16 lines
380 B
C
16 lines
380 B
C
#include "cst_agent.h"
|
|
#include "cst_webui.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef CST_NO_WEBUI
|
|
int cst_webui_run(cst_agent_t *agent, const cst_webui_opts_t *opts) {
|
|
(void)agent;
|
|
(void)opts;
|
|
fprintf(stderr,
|
|
"the WebUI was not built into this binary (CST_BUILD_WEBUI=OFF).\n"
|
|
"Use --headless --prompt '...' or build with make CST_WEBUI=1\n");
|
|
return 1;
|
|
}
|
|
#endif
|