Initial CST-Agent: portable Linux/Termux/Windows coding agent.

Vendored sashidown, OpenAI-compatible env (OPENAI_*), and bootstrap scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WHC
2026-09-07 22:42:32 +08:00
co-authored by Cursor
commit 1f1fcba7ad
75 changed files with 14940 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef MD_FSM_H
#define MD_FSM_H
#include <stdint.h>
#include <stddef.h>
#include "sashidown.h"
#ifndef likely
#define likely(x) __builtin_expect(!!(x), 1)
#endif
#ifndef unlikely
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
extern const uint8_t CH_HTML_ESCAPE[256];
extern const uint8_t CH_SCAN_STOP[256];
extern const uint8_t CH_JSON_ESCAPE[256];
int fsm_append(sashidown_ctx_t *ctx, char c);
int fsm_append_str(sashidown_ctx_t *ctx, const char *s);
int fsm_append_len(sashidown_ctx_t *restrict ctx, const char *restrict s, size_t n);
void fsm_append_fast(sashidown_ctx_t *ctx, char c);
void fsm_append_len_fast(sashidown_ctx_t *restrict ctx, const char *restrict s, size_t n);
void fsm_write_begin(sashidown_ctx_t *ctx);
void fsm_write_end(sashidown_ctx_t *ctx);
#define fsm_append_lit(ctx, s) fsm_append_len((ctx), (s), sizeof(s) - 1)
#endif /* MD_FSM_H */