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>
This commit is contained in:
@@ -92,6 +92,7 @@ static void print_help()
|
||||
std::printf(" %s/file write <p> <c>%s 写入文件\n", CLR_YELLOW, CLR_RESET);
|
||||
std::printf(" %s/save <path>%s 保存会话\n", CLR_YELLOW, CLR_RESET);
|
||||
std::printf(" %s/load <path>%s 恢复会话\n", CLR_YELLOW, CLR_RESET);
|
||||
std::printf(" %s/history [N]%s 查看会话历史(默认全部,可指定最近N条)\n", CLR_YELLOW, CLR_RESET);
|
||||
std::printf("\n直接输入问题即可与 AI 对话。\n\n");
|
||||
}
|
||||
|
||||
@@ -197,6 +198,9 @@ static void handle_command(const char* line)
|
||||
std::printf(" provider: %s\n", provider);
|
||||
std::printf(" AI 服务: %s\n", g_ai ? "就绪" : "不可用");
|
||||
std::printf(" Session 服务: %s\n", g_session ? "就绪" : "不可用");
|
||||
int hc = 0;
|
||||
if (g_session) g_session->history(&hc);
|
||||
std::printf(" history count: %d\n", hc);
|
||||
std::printf(" File IO 服务: %s\n", g_file_io ? "就绪" : "不可用");
|
||||
const dstalk_tools_service_t* tools = static_cast<const dstalk_tools_service_t*>(
|
||||
dstalk_service_query("tools", 1));
|
||||
@@ -261,6 +265,39 @@ static void handle_command(const char* line)
|
||||
return;
|
||||
}
|
||||
|
||||
// /history [N]
|
||||
if (std::strcmp(line, "/history") == 0 || std::strncmp(line, "/history ", 9) == 0) {
|
||||
if (!g_session) {
|
||||
std::printf(CLR_RED "[ERROR] session service unavailable\n" CLR_RESET);
|
||||
return;
|
||||
}
|
||||
int count = 0;
|
||||
const dstalk_message_t* history = g_session->history(&count);
|
||||
if (count == 0 || !history) {
|
||||
std::printf(CLR_DIM "(history is empty)\n" CLR_RESET);
|
||||
return;
|
||||
}
|
||||
int limit = count;
|
||||
const char* arg = line + 8;
|
||||
while (*arg == ' ') arg++;
|
||||
if (*arg != '\0') {
|
||||
char* end = nullptr;
|
||||
long n = std::strtol(arg, &end, 10);
|
||||
if (*end != '\0' || n <= 0) {
|
||||
std::printf(CLR_RED "[ERROR] /history N: N must be a positive integer\n" CLR_RESET);
|
||||
return;
|
||||
}
|
||||
limit = (n < count) ? static_cast<int>(n) : count;
|
||||
}
|
||||
int start = count - limit;
|
||||
for (int i = start; i < count; i++) {
|
||||
std::printf("[%s] %s\n",
|
||||
history[i].role ? history[i].role : "?",
|
||||
history[i].content ? history[i].content : "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// /save <path>
|
||||
if (std::strncmp(line, "/save ", 6) == 0) {
|
||||
const char* path = line + 6;
|
||||
|
||||
Reference in New Issue
Block a user