Ship hermit binary (cst-agent symlink), ~/.config/hermit with legacy fallback, Hermit color theme and mini crab frames, plus SVG→PUA font build pipeline. Co-authored-by: Cursor <cursoragent@cursor.com>
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
#ifndef CST_HERMIT_GLYPH_H
|
|
#define CST_HERMIT_GLYPH_H
|
|
|
|
#include <stddef.h>
|
|
#include <wchar.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Product display name (user-visible). Binary install name is "hermit". */
|
|
#define HERMIT_NAME "Hermit"
|
|
#define HERMIT_BIN "hermit"
|
|
#define HERMIT_LEGACY_BIN "cst-agent"
|
|
#define HERMIT_CONFIG_DIR "hermit"
|
|
#define HERMIT_LEGACY_CONFIG_DIR "cst-agent"
|
|
|
|
/* Icon states mirror icons/agent-motion SVG set. */
|
|
typedef enum {
|
|
HERMIT_ST_IDLE = 0,
|
|
HERMIT_ST_QUESTION,
|
|
HERMIT_ST_THINKING,
|
|
HERMIT_ST_CODING,
|
|
HERMIT_ST_SUCCESS,
|
|
HERMIT_ST_ERROR,
|
|
HERMIT_ST_N
|
|
} hermit_state_t;
|
|
|
|
typedef enum {
|
|
HERMIT_ICON_AUTO = 0,
|
|
HERMIT_ICON_MINI,
|
|
HERMIT_ICON_FONT
|
|
} hermit_icon_mode_t;
|
|
|
|
/* HERMIT_<SUFFIX> then CST_<SUFFIX>. Never returns NULL (may be ""). */
|
|
const char *hermit_getenv(const char *suffix);
|
|
|
|
hermit_icon_mode_t hermit_icon_mode(void);
|
|
/* Effective mode after AUTO resolution (ascii forces MINI). */
|
|
hermit_icon_mode_t hermit_icon_mode_eff(int ascii);
|
|
|
|
/* Small badge UTF-8 (or ASCII). frame advances animation. */
|
|
const char *hermit_mini_badge(hermit_state_t st, int frame, int ascii);
|
|
|
|
/* Home shell crab: up to *nlines strings (not owned). Returns line count. */
|
|
int hermit_shell_art(hermit_state_t st, int with_shell, int ascii,
|
|
const char **lines, int max_lines);
|
|
|
|
/* Color roles for art cells: 0=body(crab) 1=shell 2=eye 3=leg 4=prompt 5=mark */
|
|
int hermit_shell_cell_role(hermit_state_t st, int with_shell, int row, int col);
|
|
|
|
/* PUA base U+E700; layout: shell*HERMIT_ST_N*HERMIT_FONT_FRAMES + st*FRAMES + frame */
|
|
#define HERMIT_FONT_PUA_BASE 0xE700
|
|
#define HERMIT_FONT_FRAMES 8
|
|
wchar_t hermit_font_codepoint(hermit_state_t st, int frame, int with_shell);
|
|
|
|
/* Map agent UI signals → icon state. */
|
|
hermit_state_t hermit_state_from_ui(int busy, int ask, int error);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|