No Node.js runtime
The core is built with C11 / C++20 for fast startup and lower memory usage in long-lived terminal sessions.
diff --git a/en.html b/en.html index 82c899c..d322303 100644 --- a/en.html +++ b/en.html @@ -3,10 +3,10 @@
- + - + @@ -213,7 +213,7 @@An AI coding CLI compatible with OpenAI-style APIs and Anthropic APIs. The core is written in C11 / C++20 and ships dstalk_core.dll as a plugin host that exposes a stable C ABI. Nine functional plugins (AI, networking, LSP, sessions, files, tools, and more) compile to standalone DLLs and plug into the CLI, the SDL3 GUI, and any third-party host.
+An AI coding CLI compatible with OpenAI-style APIs and Anthropic APIs. The core is written in C11 / C++20 and ships dstalk_core.dll as a plugin host that exposes a stable C ABI. Ten functional plugins (AI, endpoint management, networking, LSP, sessions, files, tools, and more) compile to standalone DLLs and plug into the CLI, the SDL3 GUI, the Boost.Beast Web frontend, and any third-party host.
The core is built with C11 / C++20 for fast startup and lower memory usage in long-lived terminal sessions.
Public host functions such as dstalk_init and dstalk_service_query, plus 8 service vtables (AI, session, HTTP, file I/O, LSP, and more) make it easy to embed from C/C++, Python, Rust, C#, and Go.
Two AI plugins ship in the box: OpenAI-compatible and Anthropic. Switch between OpenAI-style APIs and Anthropic APIs via ai.provider in config.toml.
dstalk-cli is an ANSI terminal UI; dstalk-gui is a cross-platform SDL3 window. Both share the same plugin host and core capabilities.
The core only handles plugin loading, service registry, event bus, and configuration. AI, networking, LSP, and sessions are independent DLLs you can replace or extend.
Public host functions such as dstalk_init and dstalk_service_query, plus 9 service vtables (AI, endpoint management, session, HTTP, file I/O, LSP, and more) make it easy to embed from C/C++, Python, Rust, C#, and Go.
OpenAI-compatible and Anthropic AI plugins ship in the box, while ai_endpoint_mgr manages multiple named endpoints. Frontends route through the active endpoint first, and /status shows sanitized endpoint state.
dstalk-cli is an ANSI terminal UI, dstalk-gui is a cross-platform SDL3 window, and dstalk-web is powered by Boost.Beast + SSE. All three share the same core capabilities.
The core only handles plugin loading, service registry, event bus, and configuration. AI, endpoint management, networking, LSP, and sessions are independent DLLs you can replace or extend.
Released under GNU GPL v3.0, with example plugins, unit tests, and tutorial docs. Suitable for learning, customization, and local workflow extensions.
dstalk_core.dll acts as a plugin host responsible for plugin loading, service registry, event bus, and configuration. Nine functional plugins — AI, networking, LSP, sessions, files, tools, and more — compile to standalone DLLs, while frontends reach the core only through the C ABI. The GUI is opt-in via the CMake option DSTALK_BUILD_GUI.
+dstalk_core.dll acts as a plugin host responsible for plugin loading, service registry, event bus, and configuration. Ten functional plugins — AI, endpoint management, networking, LSP, sessions, files, tools, and more — compile to standalone DLLs, while frontends reach the core only through the C ABI. The GUI and Web frontends are opt-in via DSTALK_BUILD_GUI / DSTALK_BUILD_WEB.
┌─────────────────────────────────────────────────────┐
│ Frontends │
-│ dstalk-cli (ANSI UI) dstalk-gui (SDL3) │
+│ dstalk-cli (ANSI) dstalk-gui (SDL3) dstalk-web (SSE) │
└───────────────────────┬─────────────────────────────┘
│ C ABI
┌───────────────────────▼─────────────────────────────┐
@@ -316,9 +326,9 @@ build/bin/dstalk_cli.exe config.toml
│ Plugin Loader · Service Registry · Event Bus · │
│ Config Manager │
├───────────────┬───────────────┬─────────────────────┤
-│ openai (ai) │ anthropic (ai)│ network (http) │
-│ lsp (client) │ session │ context │
-│ config │ file-io │ tools │
+│ openai (ai) │ anthropic (ai)│ endpoint_mgr │
+│ network(http)│ lsp (client) │ session │
+│ context │ config │ file-io · tools │
└───────────────┴───────────────┴─────────────────────┘
Boost.JSON · Boost.Asio / Beast · OpenSSL TLS
| Commands | Description | Example |
|---|---|---|
| /help | Show help | /help |
| /help / /h | Show the command list | /help |
| /quit / /q | Quit the program | /quit |
| /clear | Clear the current conversation context | /clear |
| /model <name> | Switch the current model | /model gpt-4o |
| /file read <path> | Read file content and print it to the terminal | /file read README.md |
| /context | Show the current token count and message count | /context |
| /status | Show sanitized runtime status without printing the full API key | /status |
| /model <name> | Switch the current model; in multi-endpoint mode it updates the active endpoint | /model gpt-4o |
| /file list [path] | List directory contents; omit path to list the current directory | /file list src/ |
| /file show <path> | Show file content | /file show README.md |
| /file read <path> | Read file content (same as /file show) | /file read config.toml |
| /file write <path> <content> | Write content to a file | /file write note.txt hello |
| /save <path> / /load <path> | Save or restore a session | /save session.json |
dstalk exposes its capabilities through four public headers: dstalk_host.h manages the host lifecycle and plugins, dstalk_services.h defines 8 service vtables, dstalk_lsp.h provides a standalone LSP client, and dstalk_types.h shares message and event types. Frontends call dstalk_service_query() to obtain a service pointer, then invoke capabilities through function pointers.
+dstalk exposes its capabilities through four public headers: dstalk_host.h manages the host lifecycle and plugins, dstalk_services.h defines 9 service vtables including ai_endpoint_mgr, dstalk_lsp.h provides a standalone LSP client, and dstalk_types.h shares message and event types. Frontends call dstalk_service_query() to obtain a service pointer, then invoke capabilities through function pointers.
// AI service: dstalk_service_query("ai.openai", 0)
+// AI service: dstalk_service_query("ai_openai", 1)
typedef struct {
int (*configure)(const char* provider, const char* base_url,
const char* api_key, const char* model,
@@ -407,24 +424,26 @@ typedef struct {
void (*free_result)(dstalk_chat_result_t* result);
} dstalk_ai_service_t;
-// Same pattern: dstalk_session_service_t, dstalk_http_service_t,
-// dstalk_file_io_service_t, dstalk_config_service_t,
-// dstalk_tools_service_t, dstalk_lsp_service_t
+// endpoint manager: dstalk_service_query("ai_endpoint_mgr", 1)
+// Same pattern: dstalk_ai_endpoint_mgr_t, dstalk_session_service_t,
+// dstalk_http_service_t, dstalk_file_io_service_t,
+// dstalk_config_service_t, dstalk_tools_service_t, dstalk_lsp_service_t
The plugin host, CLI, SDL3 GUI, nine core plugins, tests, and documentation are already in place. Future work focuses on deeper capabilities and ecosystem expansion.
+The plugin host, CLI, SDL3 GUI, Boost.Beast Web frontend, ten core plugins, tests, and documentation are already in place. Future work focuses on deeper capabilities and ecosystem expansion.
| Phase | Scope | Status |
|---|---|---|
| Skeleton | Project skeleton, CMake/Ninja build, Conan dependencies, DLL exports, frontend main loop | Done |
| Plugin host | Plugin loader, service registry, event bus, configuration; 9 core plugins (openai · anthropic · network · lsp · session · context · config · file-io · tools) | Done |
| Chat capability | HTTPS networking, OpenAI-compatible / Anthropic API adapters, streaming output, multi-turn sessions, file I/O tools | Available |
| GUI frontend | SDL3 graphical window (DSTALK_BUILD_GUI), an optional frontend sharing the same plugin host as the CLI | Optional build |
| Plugin host | Plugin loader, service registry, event bus, configuration; 10 core plugins (openai · anthropic · endpoint_mgr · network · lsp · session · context · config · file-io · tools) | Done |
| Chat capability | HTTPS networking, OpenAI-compatible / Anthropic API adapters, streaming output, multi-turn sessions, tool calling, and file I/O | Available |
| Multi-endpoint | ai_endpoint_mgr manages multiple named AI endpoints; frontends route through the active endpoint first and /status returns sanitized state | Available |
| GUI / Web frontends | SDL3 graphical window and Boost.Beast Web + SSE, optional frontends sharing the same plugin host as the CLI | Optional build |
| Next phase | Deeper LSP integration, third-party plugin SDK, cross-platform distribution, ongoing documentation | Planned |
dstalk is an open project. Developers interested in C/C++, terminal UX, AI API adapters, GUI, documentation, and testing are welcome to participate.
The core, CLI, SDL3 GUI, and nine plugins (AI, networking, LSP, sessions, files, tools, and more) all welcome patches; build scripts and cross-platform compatibility have headroom too.
The core, CLI, SDL3 GUI, Web frontend, and 10 plugins (AI, endpoint management, networking, LSP, sessions, files, tools, and more) all welcome patches; build scripts and cross-platform compatibility have headroom too.
Use examples/example_plugin and docs/reference/plugin-abi.md as a starting point — register new services through the C ABI to bring your own models, tools, or data sources into dstalk.
docs/tutorial and docs/reference are taking shape; help expand tutorials, command references, plugin-ABI notes, and the coverage of host_api_test / smoke_test.
兼容 OpenAI 风格接口与 Anthropic API 的 AI 编程 CLI。核心采用 C11 / C++20 编写,以 dstalk_core.dll 作为插件宿主暴露稳定 C ABI,9 个功能插件 (AI、网络、LSP、会话、文件、工具等) 编译为独立 DLL,通过统一接口接入 CLI、SDL3 GUI 与第三方宿主。
+兼容 OpenAI 风格接口与 Anthropic API 的 AI 编程 CLI。核心采用 C11 / C++20 编写,以 dstalk_core.dll 作为插件宿主暴露稳定 C ABI,10 个功能插件(AI、endpoint 管理、网络、LSP、会话、文件、工具等)编译为独立 DLL,通过统一接口接入 CLI、SDL3 GUI、Boost.Beast Web 前端与第三方宿主。
核心以 C11 / C++20 构建,目标是毫秒级启动和更低内存占用,适合终端长期交互。
公开 dstalk_init、dstalk_service_query 等宿主函数和 8 种服务 vtable (AI、会话、HTTP、文件、LSP 等),方便 C/C++、Python、Rust、C#、Go 嵌入。
内置 OpenAI-compatible 与 Anthropic 两个 AI 插件;通过 config.toml 中的 ai.provider 在 OpenAI 风格接口与 Anthropic API 之间切换。
dstalk-cli 提供 ANSI 终端 UI,dstalk-gui 基于 SDL3 跨平台窗口,共享同一组核心能力。
核心仅做插件加载、服务注册、事件总线和配置管理;AI、网络、LSP、会话等能力均为独立 DLL,可以替换或扩展。
公开 dstalk_init、dstalk_service_query 等宿主函数和 9 种服务 vtable(AI、endpoint 管理、会话、HTTP、文件、LSP 等),方便 C/C++、Python、Rust、C#、Go 嵌入。
内置 OpenAI-compatible 与 Anthropic 两个 AI 插件,并通过 ai_endpoint_mgr 管理多个命名 endpoint;前端优先按 active endpoint 路由,/status 可查看脱敏状态。
dstalk-cli 提供 ANSI 终端 UI,dstalk-gui 基于 SDL3 跨平台窗口,dstalk-web 基于 Boost.Beast + SSE;三者共享同一组核心能力。
核心仅做插件加载、服务注册、事件总线和配置管理;AI、endpoint 管理、网络、LSP、会话等能力均为独立 DLL,可以替换或扩展。
项目采用 GNU GPL v3.0,附带示例插件、单元测试与教程文档,适合学习、二次开发和本地工作流定制。
dstalk_core.dll 作为插件宿主,负责插件加载、服务注册、事件总线和配置管理;AI、网络、LSP、会话、文件 IO、工具等 9 个功能插件编译为独立 DLL,前端只通过 C ABI 触达核心能力。GUI 通过 CMake 选项 DSTALK_BUILD_GUI 启用。
+dstalk_core.dll 作为插件宿主,负责插件加载、服务注册、事件总线和配置管理;AI、endpoint 管理、网络、LSP、会话、文件 IO、工具等 10 个功能插件编译为独立 DLL,前端只通过 C ABI 触达核心能力。GUI 与 Web 分别通过 CMake 选项 DSTALK_BUILD_GUI / DSTALK_BUILD_WEB 启用。
┌─────────────────────────────────────────────────────┐
│ Frontends │
-│ dstalk-cli (ANSI UI) dstalk-gui (SDL3) │
+│ dstalk-cli (ANSI) dstalk-gui (SDL3) dstalk-web (SSE) │
└───────────────────────┬─────────────────────────────┘
│ C ABI
┌───────────────────────▼─────────────────────────────┐
│ dstalk_core.dll — 插件宿主 │
│ 插件加载 · 服务注册 · 事件总线 · 配置管理 │
├───────────────┬───────────────┬─────────────────────┤
-│ openai (ai) │ anthropic (ai)│ network (http) │
-│ lsp (client) │ session │ context │
-│ config │ file-io │ tools │
+│ openai (ai) │ anthropic (ai)│ endpoint_mgr │
+│ network(http)│ lsp (client) │ session │
+│ context │ config │ file-io · tools │
└───────────────┴───────────────┴─────────────────────┘
Boost.JSON · Boost.Asio / Beast · OpenSSL TLS
| 命令 | 说明 | 示例 |
|---|---|---|
| /help | 显示帮助 | /help |
| /help / /h | 显示命令列表 | /help |
| /quit / /q | 退出程序 | /quit |
| /clear | 清空当前会话上下文 | /clear |
| /model <name> | 切换当前模型 | /model gpt-4o |
| /file read <path> | 读取文件内容并输出到终端 | /file read README.md |
| /context | 显示当前 Token 数和消息条数 | /context |
| /status | 显示当前运行状态(脱敏,不打印完整 API Key) | /status |
| /model <name> | 切换当前模型;多 endpoint 模式下作用于 active endpoint | /model gpt-4o |
| /file list [path] | 列出目录内容,不填 path 列出当前目录 | /file list src/ |
| /file show <path> | 查看文件内容 | /file show README.md |
| /file read <path> | 读取文件内容(同 /file show) | /file read config.toml |
| /file write <path> <content> | 写入文件内容 | /file write note.txt hello |
| /save <path> / /load <path> | 保存或恢复会话 | /save session.json |
dstalk 通过 4 个公开头文件暴露能力:dstalk_host.h 管理宿主生命周期与插件,dstalk_services.h 定义 8 种服务 vtable,dstalk_lsp.h 提供独立 LSP 客户端,dstalk_types.h 共享消息与事件类型。前端通过 dstalk_service_query() 获取服务指针,再经函数指针调用具体能力。
+dstalk 通过 4 个公开头文件暴露能力:dstalk_host.h 管理宿主生命周期与插件,dstalk_services.h 定义 9 种服务 vtable(含 ai_endpoint_mgr),dstalk_lsp.h 提供独立 LSP 客户端,dstalk_types.h 共享消息与事件类型。前端通过 dstalk_service_query() 获取服务指针,再经函数指针调用具体能力。
// AI 服务: dstalk_service_query("ai.openai", 0)
+// AI 服务: dstalk_service_query("ai_openai", 1)
typedef struct {
int (*configure)(const char* provider, const char* base_url,
const char* api_key, const char* model,
@@ -404,24 +421,26 @@ typedef struct {
void (*free_result)(dstalk_chat_result_t* result);
} dstalk_ai_service_t;
-// 同模式: dstalk_session_service_t, dstalk_http_service_t,
-// dstalk_file_io_service_t, dstalk_config_service_t,
-// dstalk_tools_service_t, dstalk_lsp_service_t
+// endpoint manager: dstalk_service_query("ai_endpoint_mgr", 1)
+// 同模式: dstalk_ai_endpoint_mgr_t, dstalk_session_service_t,
+// dstalk_http_service_t, dstalk_file_io_service_t,
+// dstalk_config_service_t, dstalk_tools_service_t, dstalk_lsp_service_t
插件宿主、CLI、SDL3 GUI、9 个核心插件、测试与文档已经就位;后续聚焦在能力深化与生态扩展。
+插件宿主、CLI、SDL3 GUI、Boost.Beast Web、10 个核心插件、测试与文档已经就位;后续聚焦在能力深化与生态扩展。
| 阶段 | 内容 | 状态 |
|---|---|---|
| 骨架 | 项目骨架、CMake/Ninja 构建、Conan 依赖、DLL 导出、前端主循环 | 已完成 |
| 插件宿主 | 插件加载、服务注册、事件总线、配置管理;9 个核心插件 (openai · anthropic · network · lsp · session · context · config · file-io · tools) | 已完成 |
| 对话能力 | HTTPS 网络层、OpenAI-compatible / Anthropic API 适配、流式输出、多轮会话、文件读写工具 | 已可用 |
| GUI 前端 | SDL3 图形化窗口 (DSTALK_BUILD_GUI),作为可选前端与 CLI 共享插件宿主 | 可选构建 |
| 插件宿主 | 插件加载、服务注册、事件总线、配置管理;10 个核心插件(openai · anthropic · endpoint_mgr · network · lsp · session · context · config · file-io · tools) | 已完成 |
| 对话能力 | HTTPS 网络层、OpenAI-compatible / Anthropic API 适配、流式输出、多轮会话、工具调用与文件读写 | 已可用 |
| 多 endpoint | ai_endpoint_mgr 管理多个命名 AI endpoint,前端优先按 active endpoint 路由,/status 输出脱敏状态 | 已可用 |
| GUI / Web 前端 | SDL3 图形化窗口与 Boost.Beast Web + SSE,作为可选前端与 CLI 共享插件宿主 | 可选构建 |
| 下一阶段 | LSP 集成深化、第三方插件 SDK、跨平台分发与文档持续完善 | 计划中 |
dstalk 是开放项目,欢迎对 C/C++、命令行体验、AI API 适配、GUI、文档和测试感兴趣的开发者一起参与。
核心、CLI、SDL3 GUI 与 9 个插件 (AI、网络、LSP、会话、文件、工具等) 都欢迎补丁,跨平台兼容与构建脚本也有空间。
核心、CLI、SDL3 GUI、Web 前端与 10 个插件(AI、endpoint 管理、网络、LSP、会话、文件、工具等)都欢迎补丁,跨平台兼容与构建脚本也有空间。
参考 examples/example_plugin 和 docs/reference/plugin-abi.md,通过 C ABI 注册新服务,把自己的模型、工具或数据源接入 dstalk。
docs/tutorial、docs/reference 已经成形,欢迎补充教程、命令速查、插件 ABI 说明,以及 host_api_test / smoke_test 的覆盖面。