Fix API section, binary name, and remaining inaccuracies
Major: Public C API section now shows the real dstalk_host.h API with service-vtable pattern (dstalk_service_query + 8 vtable types) instead of the fabricated flat C API from dstalk_api.h which does not exist. Other fixes: - Binary name: dstalk-core.dll → dstalk.dll (matching CMake target) - Test count: 8 → 9 (added network_plugin_test.cpp) - Features card: updated ABI description to mention service vtables - Terminal demo: file path dstalk_api.h → dstalk_host.h - Tech stack: header reference dstalk_api.h → dstalk_host.h - Docs row: added docs/explanation/ (architecture, plugin-lifecycle, security-logging) - en.html favicon: translated remaining Chinese 图层 1 → Layer 1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
78
index.html
78
index.html
@@ -3,10 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="dstalk 是基于 DeepSeek V4、兼容 OpenAI / Anthropic API 的 C/C++ AI 编程 CLI,采用 dstalk-core.dll 插件宿主 + 多前端解耦架构。">
|
||||
<meta name="description" content="dstalk 是基于 DeepSeek V4、兼容 OpenAI / Anthropic API 的 C/C++ AI 编程 CLI,采用 dstalk.dll 插件宿主 + 多前端解耦架构。">
|
||||
<meta name="theme-color" content="#0b1020">
|
||||
<meta property="og:title" content="dstalk — C/C++ AI 编程 CLI">
|
||||
<meta property="og:description" content="DeepSeek V4 驱动,C ABI 可嵌入,dstalk-core.dll 作为插件宿主,9 个功能插件覆盖 AI、网络、会话、LSP 与工具。">
|
||||
<meta property="og:description" content="DeepSeek V4 驱动,C ABI 可嵌入,dstalk.dll 作为插件宿主,9 个功能插件覆盖 AI、网络、会话、LSP 与工具。">
|
||||
<meta property="og:type" content="website">
|
||||
<link rel="alternate" hreflang="zh-CN" href="https://dstalk.top/">
|
||||
<link rel="alternate" hreflang="en" href="https://dstalk.top/en.html">
|
||||
@@ -213,7 +213,7 @@
|
||||
<div>
|
||||
<div class="eyebrow">dstalk.top 是 dstalk 项目的官方网站</div>
|
||||
<h1><span>ds</span>talk</h1>
|
||||
<p class="lead">基于 DeepSeek V4 大模型、兼容 OpenAI / Anthropic API 的 AI 编程 CLI。核心采用 C11 / C++20 编写,以 dstalk-core.dll 作为插件宿主暴露稳定 C ABI,9 个功能插件 (AI、网络、LSP、会话、文件、工具等) 编译为独立 DLL,通过统一接口接入 CLI、SDL3 GUI 与第三方宿主。</p>
|
||||
<p class="lead">基于 DeepSeek V4 大模型、兼容 OpenAI / Anthropic API 的 AI 编程 CLI。核心采用 C11 / C++20 编写,以 dstalk.dll 作为插件宿主暴露稳定 C ABI,9 个功能插件 (AI、网络、LSP、会话、文件、工具等) 编译为独立 DLL,通过统一接口接入 CLI、SDL3 GUI 与第三方宿主。</p>
|
||||
<div class="actions">
|
||||
<a class="btn btn-primary" href="#quickstart">开始使用</a>
|
||||
<a class="btn btn-secondary" href="https://git.pulsareon.com/pulsareon/dstalk">查看源代码</a>
|
||||
@@ -226,7 +226,7 @@
|
||||
<span class="badge">GPL v3.0</span>
|
||||
</div>
|
||||
<div class="stats" aria-label="项目状态">
|
||||
<span class="stat"><strong>核心</strong>dstalk-core.dll (插件宿主)</span>
|
||||
<span class="stat"><strong>核心</strong>dstalk.dll (插件宿主)</span>
|
||||
<span class="stat"><strong>前端</strong>CLI + SDL3 GUI</span>
|
||||
<span class="stat"><strong>插件</strong>deepseek · anthropic · network · lsp · session · context · config · file-io · tools</span>
|
||||
</div>
|
||||
@@ -243,8 +243,8 @@ AI: dstalk-core 是插件宿主,负责插件加载、服务注册、
|
||||
事件总线和配置管理;AI、网络、会话、LSP、文件 IO
|
||||
等能力都由独立插件提供,前端只处理输入与渲染。
|
||||
|
||||
> /file read dstalk-core/include/dstalk/dstalk_api.h
|
||||
<span class="dim">--- dstalk-core/include/dstalk/dstalk_api.h ---</span></code></pre>
|
||||
> /file read dstalk-core/include/dstalk/dstalk_host.h
|
||||
<span class="dim">--- dstalk-core/include/dstalk/dstalk_host.h ---</span></code></pre>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -256,7 +256,7 @@ AI: dstalk-core 是插件宿主,负责插件加载、服务注册、
|
||||
</div>
|
||||
<div class="cards">
|
||||
<article class="card"><div class="icon">C</div><h3>零 Node.js 运行时</h3><p>核心以 C11 / C++20 构建,目标是毫秒级启动和更低内存占用,适合终端长期交互。</p></article>
|
||||
<article class="card"><div class="icon">ABI</div><h3>稳定 C ABI</h3><p>公开 dstalk_init、dstalk_chat、dstalk_file_read 等 C 函数,方便 C/C++、Python、Rust、C#、Go 嵌入。</p></article>
|
||||
<article class="card"><div class="icon">ABI</div><h3>稳定 C ABI</h3><p>公开 dstalk_init、dstalk_service_query 等宿主函数和 8 种服务 vtable (AI、会话、HTTP、文件、LSP 等),方便 C/C++、Python、Rust、C#、Go 嵌入。</p></article>
|
||||
<article class="card"><div class="icon">AI</div><h3>多 API 兼容</h3><p>内置 DeepSeek 与 Anthropic 两个 AI 插件,兼容 OpenAI 风格接口;通过 config.toml 中的 ai.provider 一键切换。</p></article>
|
||||
<article class="card"><div class="icon">CLI</div><h3>CLI 与 GUI 双前端</h3><p>dstalk-cli 提供 ANSI 终端 UI,dstalk-gui 基于 SDL3 跨平台窗口,共享同一组核心能力。</p></article>
|
||||
<article class="card"><div class="icon">PLG</div><h3>插件化宿主</h3><p>核心仅做插件加载、服务注册、事件总线和配置管理;AI、网络、LSP、会话等能力均为独立 DLL,可以替换或扩展。</p></article>
|
||||
@@ -300,7 +300,7 @@ build/dstalk-cli/dstalk-cli.exe config.toml</code></pre>
|
||||
<section id="architecture" class="container section">
|
||||
<div class="section-head">
|
||||
<h2>插件宿主 + 多前端解耦架构</h2>
|
||||
<p>dstalk-core.dll 作为插件宿主,负责插件加载、服务注册、事件总线和配置管理;AI、网络、LSP、会话、文件 IO、工具等 9 个功能插件编译为独立 DLL,前端只通过 C ABI 触达核心能力。GUI 通过 CMake 选项 DSTALK_BUILD_GUI 启用。</p>
|
||||
<p>dstalk.dll 作为插件宿主,负责插件加载、服务注册、事件总线和配置管理;AI、网络、LSP、会话、文件 IO、工具等 9 个功能插件编译为独立 DLL,前端只通过 C ABI 触达核心能力。GUI 通过 CMake 选项 DSTALK_BUILD_GUI 启用。</p>
|
||||
</div>
|
||||
<div class="terminal architecture">
|
||||
<div class="terminal-top"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="terminal-title">architecture</span></div>
|
||||
@@ -310,7 +310,7 @@ build/dstalk-cli/dstalk-cli.exe config.toml</code></pre>
|
||||
└───────────────────────┬─────────────────────────────┘
|
||||
│ C ABI
|
||||
┌───────────────────────▼─────────────────────────────┐
|
||||
│ dstalk-core.dll — 插件宿主 │
|
||||
│ dstalk.dll — 插件宿主 │
|
||||
│ 插件加载 · 服务注册 · 事件总线 · 配置管理 │
|
||||
├───────────────┬───────────────┬─────────────────────┤
|
||||
│ deepseek (ai) │ anthropic (ai)│ network (http) │
|
||||
@@ -329,12 +329,12 @@ build/dstalk-cli/dstalk-cli.exe config.toml</code></pre>
|
||||
<div class="panel table-wrap">
|
||||
<table>
|
||||
<tr><th>模块</th><th>当前技术</th><th>状态</th></tr>
|
||||
<tr><td>核心库</td><td>C11 / C++20,dstalk-core.dll,插件宿主,公开 C ABI</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>CLI 前端</td><td>ANSI 终端 UI,调用 dstalk/dstalk_api.h</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>核心库</td><td>C11 / C++20,dstalk.dll,插件宿主,公开 C ABI</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>CLI 前端</td><td>ANSI 终端 UI,调用 dstalk/dstalk_host.h</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>GUI 前端</td><td>SDL3 图形化前端,CMake 选项 DSTALK_BUILD_GUI 启用</td><td><span class="ok">已就位</span></td></tr>
|
||||
<tr><td>插件</td><td>9 个功能插件 (deepseek · anthropic · network · lsp · session · context · config · file-io · tools),独立 DLL</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>测试</td><td>8 个测试文件覆盖插件宿主、事件总线、服务注册、插件加载及各 AI 插件,CTest 集成</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>文档</td><td>docs/tutorial、docs/reference (commands、plugin-abi)</td><td><span class="ok">已发布</span></td></tr>
|
||||
<tr><td>测试</td><td>9 个测试文件覆盖插件宿主、事件总线、服务注册、插件加载及各 AI 插件,CTest 集成</td><td><span class="ok">已启用</span></td></tr>
|
||||
<tr><td>文档</td><td>docs/tutorial、docs/reference (commands、plugin-abi)、docs/explanation (architecture、plugin-lifecycle、security-logging)</td><td><span class="ok">已发布</span></td></tr>
|
||||
<tr><td>示例</td><td>examples/example_plugin 展示插件开发模板</td><td><span class="ok">已提供</span></td></tr>
|
||||
<tr><td>依赖管理</td><td>Conan2,boost/1.86.0,openssl/3.4.1</td><td><span class="ok">已配置</span></td></tr>
|
||||
<tr><td>构建系统</td><td>CMake 3.21+,Ninja,LLVM/Clang,CMakePresets</td><td><span class="ok">已配置</span></td></tr>
|
||||
@@ -364,27 +364,49 @@ build/dstalk-cli/dstalk-cli.exe config.toml</code></pre>
|
||||
<section id="api" class="container section">
|
||||
<div class="section-head">
|
||||
<h2>公开 C API</h2>
|
||||
<p>dstalk-core 通过 dstalk-core/include/dstalk/dstalk_api.h 暴露函数,前端和第三方宿主都通过同一组接口调用核心能力。</p>
|
||||
<p>dstalk 通过 4 个公开头文件暴露能力:dstalk_host.h 管理宿主生命周期与插件,dstalk_services.h 定义 8 种服务 vtable,dstalk_lsp.h 提供独立 LSP 客户端,dstalk_types.h 共享消息与事件类型。前端通过 dstalk_service_query() 获取服务指针,再经函数指针调用具体能力。</p>
|
||||
</div>
|
||||
<div class="terminal">
|
||||
<div class="terminal-top"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="terminal-title">dstalk_api.h</span></div>
|
||||
<pre><code>int dstalk_init(const char* config_path);
|
||||
void dstalk_destroy(void);
|
||||
<div class="terminal-top"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="terminal-title">dstalk_host.h — 宿主 API</span></div>
|
||||
<pre><code><span class="dim">// 生命周期</span>
|
||||
int dstalk_init(const char* config_path);
|
||||
void dstalk_shutdown(void);
|
||||
|
||||
void dstalk_set_api_key(const char* api_key);
|
||||
void dstalk_set_base_url(const char* base_url);
|
||||
void dstalk_set_model(const char* model);
|
||||
<span class="dim">// 插件管理</span>
|
||||
int dstalk_plugin_load(const char* path);
|
||||
int dstalk_plugin_unload(int plugin_id);
|
||||
int dstalk_plugin_list(char** output_json);
|
||||
void*dstalk_service_query(const char* name, int min_version);
|
||||
|
||||
int dstalk_chat(const char* input, char** output);
|
||||
int dstalk_chat_stream(const char* input, dstalk_stream_cb cb, void* userdata);
|
||||
void dstalk_free_string(char* str);
|
||||
<span class="dim">// 事件系统</span>
|
||||
int dstalk_event_subscribe(int type, dstalk_event_handler_fn fn, void* ud);
|
||||
int dstalk_event_emit(int type, const void* data);
|
||||
void dstalk_event_unsubscribe(int sub_id);
|
||||
|
||||
void dstalk_session_clear(void);
|
||||
int dstalk_session_save(const char* path);
|
||||
int dstalk_session_load(const char* path);
|
||||
<span class="dim">// 配置 / 内存 / 诊断</span>
|
||||
const char* dstalk_config_get(const char* key);
|
||||
int dstalk_config_set(const char* key, const char* value);
|
||||
void*dstalk_alloc(size_t size);
|
||||
void dstalk_free(void* ptr);
|
||||
char*dstalk_strdup(const char* s);
|
||||
void dstalk_set_diag_callback(dstalk_diag_cb cb);</code></pre>
|
||||
</div>
|
||||
<div class="terminal" style="margin-top:16px">
|
||||
<div class="terminal-top"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="terminal-title">dstalk_services.h — 服务 vtable 示例</span></div>
|
||||
<pre><code><span class="dim">// AI 服务: dstalk_service_query("ai.deepseek", 0)</span>
|
||||
typedef struct {
|
||||
int (*configure)(const char* provider, const char* base_url,
|
||||
const char* api_key, const char* model,
|
||||
int max_tokens, double temperature);
|
||||
dstalk_chat_result_t (*chat)(const dstalk_message_t* history,
|
||||
int len, const char* input, const char* tools_json);
|
||||
dstalk_chat_result_t (*chat_stream)(...);
|
||||
void (*free_result)(dstalk_chat_result_t* result);
|
||||
} dstalk_ai_service_t;
|
||||
|
||||
int dstalk_file_read(const char* path, char** content);
|
||||
int dstalk_file_write(const char* path, const char* content);</code></pre>
|
||||
<span class="dim">// 同模式: dstalk_session_service_t, dstalk_http_service_t,</span>
|
||||
<span class="dim">// dstalk_file_io_service_t, dstalk_config_service_t,</span>
|
||||
<span class="dim">// dstalk_tools_service_t, dstalk_lsp_service_t</span></code></pre>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user