Files
dstalk/docs/README.md
XiuChengWu 5766938524
Some checks failed
CI / Determine matrix (push) Has been cancelled
CI / ${{ matrix.os }} / ${{ matrix.build_type }} (push) Has been cancelled
Wave 5+6: plugin ABI hardening, build modernization, ABI/security docs
Wave 5 (9 parallel agents):
- W1.1 atomic diag callback + DLL handle release on shutdown (lin)
- W2.1 unify cross-DLL heap discipline (host->alloc/free/strdup) (chen)
- W2.2 secure_zero api_key on shutdown for deepseek/anthropic (cao)
- W3 CMake modernization: target-based cxx_std_20, dstalk_boost_config
  INTERFACE lib, root-level RUNTIME_OUTPUT_DIRECTORY (hu)
- W4 GitHub Actions CI with dynamic Linux/Windows matrix (ma)
- W5.1 SSE buffer_body to cut peak memory ~67% on 32K streams (zhou)
- W6.1 LSP JSON-RPC frame parser hardened against header reordering (sun)
- W7 smoke test: copy plugin DLLs post-build + Boost.JSON src.hpp fix
  for full 9-plugin load coverage (wang)
- W8.1 README slimmed 398->92, Diataxis docs/ skeleton (deng)

Wave 6 (6 parallel agents):
- W9.1 docs/explanation: architecture + plugin-lifecycle (deng)
- W9.3 log credential leak audit (0 vulns, audit trail in
  docs/explanation/security-logging.md) (cao)
- W9.4 docs/reference/plugin-abi.md - 7-point ABI contract (lin)
- W9.6 CLI /history command + status integration (zhao)
- W9.8 plugin_loader fault tolerance: per-plugin failure no longer
  aborts dstalk_init (huang)
- W9.10 host_api unit tests: tests/host_api_test.cpp, 8 cases (liu)

CEO oversight (preexisting bugs fixed during Wave 5 verification):
- lsp_plugin.cpp:449 forward decl mismatch (int vs void)
- tools_plugin.cpp:109 missing forward decl

Multi-agent collaboration framework:
- agents/WORKFLOW.md: 6-stage protocol, two-tier governance,
  prompt template, technical constraints registry

Build: cmake --build 0 error / 0 warning. Tests: 2/2 100% pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-27 05:39:10 +08:00

3.1 KiB

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 补充或修正文档内容。