Files
WHCandCursor 5538ed3412
ci / tcc-check (push) Successful in 1m8s
ci / linux (aarch64, 0) (push) Failing after 1h0m3s
ci / linux (x86, 1) (push) Failing after 1h0m3s
ci / linux (x86_64, 1) (push) Failing after 1h0m2s
ci / windows (push) Failing after 50s
refactor: archive GUI clients; keep minimal TUI with hooks/API
Move Qt/Tauri/full Web SPA under archive/, ship hermit as CLI/TUI plus
libcstcore and cst-webui/1 HTTP+SSE (turn lifecycle hooks, capabilities).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-30 22:49:23 +08:00

44 lines
1.4 KiB
C

#ifndef CST_WEBUI_H
#define CST_WEBUI_H
/* Engine HTTP + SSE API (--web): remote mirror of cst_agent_hooks_t.
*
* The turn runs on a worker thread; every live hook fires a Server-Sent
* Event. Protocol: docs/webui.md / docs/webui-schema.md (cst-webui/1).
* The binary embeds a minimal health page; a full SPA lives under
* archive/web-spa (use --web-dev). */
#include "cst_agent.h"
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* What --web listens on when --web-port/CST_WEB_PORT says nothing (the
* README and --help quote this number, so keep them in sync). */
#define CST_WEBUI_DEFAULT_PORT 8787
typedef struct {
const char *host; /* NULL = 127.0.0.1; "0.0.0.0" = every interface */
int port; /* 0 = pick a free port */
const char *token; /* NULL = generate one when needed */
const char *root; /* serve static files from DIR instead of the
embedded health page (development / archived SPA) */
int open_browser; /* best-effort xdg-open / open / start */
/* Prompt to run once at startup (--web -p ...); NULL = wait for the UI. */
const char *prompt;
int perm_timeout_s; /* how long a permission question waits (0 = 600) */
} cst_webui_opts_t;
/* Serve until interrupted (Ctrl+C) or the event stream asks to quit.
* Returns the process exit code. */
int cst_webui_run(cst_agent_t *agent, const cst_webui_opts_t *opts);
#ifdef __cplusplus
}
#endif
#endif /* CST_WEBUI_H */