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>
This commit is contained in:
+10
-1
@@ -348,7 +348,9 @@ void cst_curl_apply_ca(void *curl);
|
||||
* detail is the tail of the sandboxed output. */
|
||||
#define CST_PERM_SANDBOX "[sandbox] "
|
||||
|
||||
/* Live UI / observability hooks for a turn */
|
||||
/* Live UI / observability hooks for a turn. Every callback may be NULL.
|
||||
* Remote clients prefer the HTTP/SSE mirror (docs/webui.md); embedded
|
||||
* clients fill this struct (TUI, FFI). */
|
||||
typedef struct {
|
||||
void (*on_status)(const char *msg, void *ud);
|
||||
void (*on_assistant_delta)(const char *text, size_t len, void *ud);
|
||||
@@ -375,6 +377,13 @@ typedef struct {
|
||||
* reading the store. */
|
||||
void (*on_tool_images)(const ctl_tool_call_t *call,
|
||||
const cst_attachment_t *list, int n, void *ud);
|
||||
/* Turn lifecycle (once around cst_agent_run_turn_ex). */
|
||||
void (*on_turn_begin)(const char *user_text, void *ud);
|
||||
/* rc 0 = ok; non-zero = failure or cancel. err may be NULL or "". */
|
||||
void (*on_turn_end)(int rc, const char *err, void *ud);
|
||||
/* Structured error while a turn runs. kind is a short stable token
|
||||
* (llm | cancel | internal | …); message is human-readable. */
|
||||
void (*on_error)(const char *kind, const char *message, void *ud);
|
||||
void *userdata;
|
||||
} cst_agent_hooks_t;
|
||||
|
||||
|
||||
+7
-8
@@ -1,13 +1,12 @@
|
||||
#ifndef CST_WEBUI_H
|
||||
#define CST_WEBUI_H
|
||||
|
||||
/* The built-in WebUI: an HTTP + SSE front end for one agent process.
|
||||
/* Engine HTTP + SSE API (--web): remote mirror of cst_agent_hooks_t.
|
||||
*
|
||||
* It is a second implementation of the same interface the TUI uses
|
||||
* (cst_agent_hooks_t), which is why the engine needs no changes: the turn
|
||||
* runs on a worker thread and every live event goes out as a Server-Sent
|
||||
* Event. The protocol is documented in docs/webui.md and is meant to be
|
||||
* the contract a dedicated client speaks later. */
|
||||
* 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"
|
||||
|
||||
@@ -25,8 +24,8 @@ 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 the UI from this directory instead of the
|
||||
copy embedded in the binary (development) */
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user