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>
This commit is contained in:
125
hands/whiteboard.HAND.toml
Normal file
125
hands/whiteboard.HAND.toml
Normal file
@@ -0,0 +1,125 @@
|
||||
# Whiteboard Hand - 白板绘制能力包
|
||||
#
|
||||
# ZCLAW Hand 配置
|
||||
# 提供交互式白板绘制能力,支持文本、图形、公式、图表等
|
||||
|
||||
[hand]
|
||||
name = "whiteboard"
|
||||
version = "1.0.0"
|
||||
description = "白板绘制能力包 - 绘制文本、图形、公式、图表等教学内容"
|
||||
author = "ZCLAW Team"
|
||||
|
||||
type = "presentation"
|
||||
requires_approval = false
|
||||
timeout = 60
|
||||
max_concurrent = 1
|
||||
|
||||
tags = ["whiteboard", "drawing", "presentation", "education", "teaching"]
|
||||
|
||||
[hand.config]
|
||||
# 画布尺寸
|
||||
canvas_width = 1920
|
||||
canvas_height = 1080
|
||||
|
||||
# 默认画笔颜色
|
||||
default_color = "#333333"
|
||||
|
||||
# 默认线宽
|
||||
default_line_width = 2
|
||||
|
||||
# 支持的绘制动作
|
||||
supported_actions = [
|
||||
"draw_text",
|
||||
"draw_shape",
|
||||
"draw_line",
|
||||
"draw_chart",
|
||||
"draw_latex",
|
||||
"draw_table",
|
||||
"erase",
|
||||
"clear",
|
||||
"undo",
|
||||
"redo"
|
||||
]
|
||||
|
||||
# 字体配置
|
||||
[hand.config.fonts]
|
||||
text_font = "system-ui"
|
||||
math_font = "KaTeX_Main"
|
||||
code_font = "JetBrains Mono"
|
||||
|
||||
[hand.triggers]
|
||||
manual = true
|
||||
schedule = false
|
||||
webhook = false
|
||||
|
||||
[[hand.triggers.events]]
|
||||
type = "chat.intent"
|
||||
pattern = "画|绘制|白板|展示|draw|whiteboard|sketch"
|
||||
priority = 5
|
||||
|
||||
[hand.permissions]
|
||||
requires = [
|
||||
"whiteboard.draw",
|
||||
"whiteboard.clear",
|
||||
"whiteboard.export"
|
||||
]
|
||||
|
||||
roles = ["operator.read"]
|
||||
|
||||
[hand.rate_limit]
|
||||
max_requests = 100
|
||||
window_seconds = 3600
|
||||
|
||||
[hand.audit]
|
||||
log_inputs = true
|
||||
log_outputs = false # 绘制内容不记录
|
||||
retention_days = 7
|
||||
|
||||
# 绘制动作定义
|
||||
[[hand.actions]]
|
||||
id = "draw_text"
|
||||
name = "绘制文本"
|
||||
description = "在白板上绘制文本"
|
||||
params = { x = "number", y = "number", text = "string", font_size = "number?", color = "string?" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "draw_shape"
|
||||
name = "绘制图形"
|
||||
description = "绘制矩形、圆形、箭头等基本图形"
|
||||
params = { shape = "string", x = "number", y = "number", width = "number", height = "number", fill = "string?" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "draw_line"
|
||||
name = "绘制线条"
|
||||
description = "绘制直线或曲线"
|
||||
params = { points = "array", color = "string?", line_width = "number?" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "draw_chart"
|
||||
name = "绘制图表"
|
||||
description = "绘制柱状图、折线图、饼图等"
|
||||
params = { chart_type = "string", data = "object", x = "number", y = "number", width = "number", height = "number" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "draw_latex"
|
||||
name = "绘制公式"
|
||||
description = "渲染 LaTeX 数学公式"
|
||||
params = { latex = "string", x = "number", y = "number", font_size = "number?" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "draw_table"
|
||||
name = "绘制表格"
|
||||
description = "绘制数据表格"
|
||||
params = { headers = "array", rows = "array", x = "number", y = "number" }
|
||||
|
||||
[[hand.actions]]
|
||||
id = "clear"
|
||||
name = "清空画布"
|
||||
description = "清空白板所有内容"
|
||||
params = {}
|
||||
|
||||
[[hand.actions]]
|
||||
id = "export"
|
||||
name = "导出图片"
|
||||
description = "将白板内容导出为图片"
|
||||
params = { format = "string?" }
|
||||
Reference in New Issue
Block a user