- W12.1 context_plugin (engineer-zhou): wrap C ABI surface in try/catch, add OOM-safe strdup_message_fields helper, make g_max_tokens drive message-count trim (option A). - W12.2 config refactor (architect-lin): introduce plugins/config/include/toml_parse.h to eliminate 74-line parser duplication; config_plugin delegates to host->config_get/set, collapsing the dual-store data island; ConfigStore::get() now copies via thread_local std::string to remove c_str() dangling under concurrent set(). Zero ABI changes. - W12.3 CLI command parsing (engineer-zhao): guard /clear and /context on missing session service; refactor /file dispatch so bare /file write hits usage instead of unknown-command. - W12.4 build path unification (devops-hu): set per-target RUNTIME_OUTPUT_DIRECTORY on dstalk-cli; remove stale build/dstalk-cli/dstalk-cli.exe so build/bin/ is the sole binary. - W12.5 STATUS.md auto-refresh (engineer-li): run W11.6 script to regenerate STATUS from live profile/group data. - W12.6 plugin-abi.md (writer-deng): add §8 exception safety across ABI boundary and §9 string return lifetime; reference real audit-found violations as anti-examples. Verified: cmake build 0 error 0 warning, ctest 4/4 pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
dstalk 文档
文档采用 Diataxis 框架组织: 教程 / 操作指南 / 解释 / 参考 四类分离。
已有文档
教程 (Tutorials) — 从零开始的学习路径
| 文档 | 说明 |
|---|---|
| 快速入门 | 5 步上手: 安装工具链、编译、配置、运行、第一个对话 |
解释 (Explanation) — 背景与设计决策
| 文档 | 说明 |
|---|---|
| 架构哲学 | 为什么是插件架构, host/plugin/service 三层模型, service registry 和 event bus 的职责, C ABI 的选择理由 |
| 插件生命周期 | DLL 加载与拓扑排序, on_init/on_shutdown 契约, 跨 DLL 堆分配与 ABI 纪律 |
参考 (Reference) — 精确的技术描述
| 文档 | 说明 |
|---|---|
| CLI 命令速查 | 全部 CLI 命令的别名、作用与示例 |
| Plugin ABI 契约 | 跨 DLL 通信的 C ABI 规范:内存所有权、堆纪律、回调线程安全 |
未来计划
教程
- 插件开发入门 (
tutorial/plugin-dev.md) — TODO: 写一个 Hello World 插件, 注册服务并调用 - LSP 集成教程 (
tutorial/lsp-setup.md) — TODO: 配置 clangd 并在 dstalk 中使用诊断/补全
操作指南 (How-to Guides) — 解决具体问题
- 切换 AI 后端 (
how-to/switch-provider.md) — TODO: 在 DeepSeek / Anthropic / OpenAI 间切换 - 配置 API Key (
how-to/config-api-key.md) — TODO: config.toml 各项配置说明与安全建议 - 使用 File 命令管理项目文件 (
how-to/file-commands.md) — TODO: 列目录、查看、读写文件的工作流 - 自定义前端开发 (
how-to/custom-frontend.md) — TODO: 基于 C ABI 编写自己的前端程序 - 批处理模式 (
how-to/batch-mode.md) — TODO:--batch标志与非交互式使用
解释 (Explanation) — 背景与设计决策
- 架构哲学 (
explanation/architecture.md) — 插件架构、三层模型、service registry/event bus、C ABI 选择 - 插件生命周期 (
explanation/plugin-lifecycle.md) — DLL 加载、拓扑排序、on_init/on_shutdown 契约、ABI 纪律 - 为什么用 C/C++ (
explanation/why-cpp.md) — TODO: 启动速度、内存占用、运行时依赖、嵌入能力的对比分析 - Diataxis 文档框架 (
explanation/diataxis.md) — TODO: 本文档组织方式的设计思路
参考
- API 参考 (
reference/api.md) — TODO: dstalk_host.h 完整 API 说明与调用示例 - 配置参考 (
reference/config.md) — TODO: config.toml 所有字段的详细说明 - 服务接口参考 (
reference/services.md) — TODO: dstalk_services.h 中所有 vtable 接口定义
文档约定
- 命令以
$前缀表示, 在终端中运行 - 代码块标注语言 (
c,toml, ```bash 等) - 表示计划中未完成的文档
贡献文档
文档使用 Markdown 编写, 存放在 docs/ 目录下。
欢迎通过 PR 补充或修正文档内容。