Files
zclaw_openfang/docs/knowledge-base
iven 3ff08faa56 release(v0.2.0): streaming, MCP protocol, Browser Hand, security enhancements
## Major Features

### Streaming Response System
- Implement LlmDriver trait with `stream()` method returning async Stream
- Add SSE parsing for Anthropic and OpenAI API streaming
- Integrate Tauri event system for frontend streaming (`stream:chunk` events)
- Add StreamChunk types: Delta, ToolStart, ToolEnd, Complete, Error

### MCP Protocol Implementation
- Add MCP JSON-RPC 2.0 types (mcp_types.rs)
- Implement stdio-based MCP transport (mcp_transport.rs)
- Support tool discovery, execution, and resource operations

### Browser Hand Implementation
- Complete browser automation with Playwright-style actions
- Support Navigate, Click, Type, Scrape, Screenshot, Wait actions
- Add educational Hands: Whiteboard, Slideshow, Speech, Quiz

### Security Enhancements
- Implement command whitelist/blacklist for shell_exec tool
- Add SSRF protection with private IP blocking
- Create security.toml configuration file

## Test Improvements
- Fix test import paths (security-utils, setup)
- Fix vi.mock hoisting issues with vi.hoisted()
- Update test expectations for validateUrl and sanitizeFilename
- Add getUnsupportedLocalGatewayStatus mock

## Documentation Updates
- Update architecture documentation
- Improve configuration reference
- Add quick-start guide updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 03:24:24 +08:00
..

ZCLAW 知识库

记录开发过程中的经验、问题和解决方案,为项目演化提供知识储备。

目录结构

knowledge-base/
├── README.md                    # 本文件 - 索引
├── zclaw-technical-reference.md # ZCLAW 技术参考
├── websocket-protocol.md        # WebSocket 协议文档
├── configuration.md             # 配置系统文档
├── troubleshooting.md           # 常见问题排查
├── frontend-integration.md      # 前端集成模式
├── agent-provider-config.md     # Agent 和 LLM 提供商配置
├── tauri-desktop.md             # Tauri 桌面端开发笔记
├── feature-checklist.md         # 功能清单和验证状态
└── hands-integration-lessons.md # Hands 集成经验总结

快速索引

协议与通信

主题 文件 关键词
WebSocket 流式聊天 websocket-protocol.md 流式响应, 事件类型, 消息格式
REST API zclaw-technical-reference.md Agent, Hands, Health
配置系统 configuration.md TOML, 环境变量

故障排查

问题类型 文件 常见原因
连接失败 troubleshooting.md 端口、认证、配置
流式响应不工作 troubleshooting.md 事件类型、代理配置
LLM 错误 troubleshooting.md API Key 未配置

开发指南

主题 文件 说明
前端集成 frontend-integration.md React + Zustand 模式
Agent 配置 agent-provider-config.md LLM 提供商配置
Tauri 开发 tauri-desktop.md 桌面端开发注意事项
功能清单 feature-checklist.md 所有功能的验证状态
Hands 集成 hands-integration-lessons.md Hands 功能集成经验

版本历史

日期 版本 变更
2026-03-19 v2.0 重构为 ZCLAW 独立产品文档
2026-03-14 v1.1 添加 Hands 集成经验总结、功能清单
2026-03-14 v1.0 初始创建

贡献指南

当遇到以下情况时,请更新知识库:

  1. 发现协议与文档不一致 - 记录实际行为
  2. 解决了一个棘手的 bug - 记录根因和解决方案
  3. 找到了更好的实现方式 - 记录模式和最佳实践
  4. 踩了坑 - 记录避坑指南

文档格式

# 主题

## 问题描述
简要描述遇到的问题

## 根本原因
解释为什么会发生

## 解决方案
具体的解决步骤

## 代码示例
相关代码片段

## 相关文件
列出涉及的源文件