Initial dstalk project: core DLL + CLI + BearSSL TLS

- Core DLL: AI API client (DeepSeek/OpenAI compatible), HTTP(S) via Boost.Beast
- BearSSL vendored as TLS backend (MIT license, replacing OpenSSL)
- CLI frontend with ANSI colors, /help /model /file /save /load commands
- WinHTTP alternative HTTP client for Windows
- GPLv3 license with linking exception
- Build: CMake + Ninja + Clang, dependencies via Conan2

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 16:42:42 +08:00
parent f74ead4d73
commit c9fb924a1c
327 changed files with 80579 additions and 2 deletions

57
dstalk-gui/src/main.cpp Normal file
View File

@@ -0,0 +1,57 @@
#include <cstdio>
#include <cstdlib>
#include <SDL3/SDL.h>
#include "dstalk/dstalk_api.h"
int main(int argc, char* argv[])
{
if (dstalk_init(nullptr) != 0) {
std::fprintf(stderr, "[dstalk] 初始化失败\n");
return 1;
}
if (!SDL_Init(SDL_INIT_VIDEO)) {
std::fprintf(stderr, "[dstalk] SDL 初始化失败: %s\n", SDL_GetError());
dstalk_destroy();
return 1;
}
SDL_Window* window = SDL_CreateWindow(
"dstalk", 1024, 768, SDL_WINDOW_RESIZABLE);
if (!window) {
std::fprintf(stderr, "[dstalk] 窗口创建失败: %s\n", SDL_GetError());
SDL_Quit();
dstalk_destroy();
return 1;
}
SDL_Renderer* renderer = SDL_CreateRenderer(window, nullptr);
if (!renderer) {
SDL_DestroyWindow(window);
SDL_Quit();
dstalk_destroy();
return 1;
}
/* TODO: 主循环 — SDL 事件处理, UI 渲染, 调用 dstalk_chat */
bool running = true;
SDL_Event event;
while (running) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_EVENT_QUIT) {
running = false;
}
}
SDL_SetRenderDrawColor(renderer, 0x1E, 0x1E, 0x2E, 0xFF);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
}
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
dstalk_destroy();
return 0;
}