refactor(hands): 移除空壳 Hand — Whiteboard/Slideshow/Speech (Phase 5)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

删除 3 个仅含 UI 占位的 Hand,清理 Rust 实现与前端引用:
- Rust: whiteboard.rs(422行) + slideshow.rs(797行) + speech.rs(442行)
- 前端: WhiteboardCanvas + SlideshowRenderer + speech-synth + 相关类型/常量
- 配置: 3 个 HAND.toml
- 净减 ~5400 行,Hands 9→6(启用) + Quiz/Browser/Researcher/Collector/Clip/Twitter/Reminder
This commit is contained in:
iven
2026-04-17 19:55:59 +08:00
parent 14fa7e150a
commit cb9e48f11d
21 changed files with 11 additions and 3014 deletions

View File

@@ -1,119 +0,0 @@
# Slideshow Hand - 幻灯片控制能力包
#
# ZCLAW Hand 配置
# 提供幻灯片演示控制能力,支持翻页、聚焦、激光笔等
[hand]
name = "slideshow"
version = "1.0.0"
description = "幻灯片控制能力包 - 控制演示文稿的播放、导航和标注"
author = "ZCLAW Team"
type = "presentation"
requires_approval = false
timeout = 30
max_concurrent = 1
tags = ["slideshow", "presentation", "slides", "education", "teaching"]
[hand.config]
# 支持的幻灯片格式
supported_formats = ["pptx", "pdf", "html", "markdown"]
# 自动翻页间隔0 表示禁用
auto_advance_interval = 0
# 是否显示进度条
show_progress = true
# 是否显示页码
show_page_number = true
# 激光笔颜色
laser_color = "#ff0000"
# 聚焦框颜色
spotlight_color = "#ffcc00"
[hand.triggers]
manual = true
schedule = false
webhook = false
[[hand.triggers.events]]
type = "chat.intent"
pattern = "幻灯片|演示|翻页|下一页|上一页|slide|presentation|next|prev"
priority = 5
[hand.permissions]
requires = [
"slideshow.navigate",
"slideshow.annotate",
"slideshow.control"
]
roles = ["operator.read"]
[hand.rate_limit]
max_requests = 200
window_seconds = 3600
[hand.audit]
log_inputs = true
log_outputs = false
retention_days = 7
# 幻灯片动作定义
[[hand.actions]]
id = "next_slide"
name = "下一页"
description = "切换到下一张幻灯片"
params = {}
[[hand.actions]]
id = "prev_slide"
name = "上一页"
description = "切换到上一张幻灯片"
params = {}
[[hand.actions]]
id = "goto_slide"
name = "跳转到指定页"
description = "跳转到指定编号的幻灯片"
params = { slide_number = "number" }
[[hand.actions]]
id = "spotlight"
name = "聚焦元素"
description = "用高亮框聚焦指定元素"
params = { element_id = "string", duration = "number?" }
[[hand.actions]]
id = "laser"
name = "激光笔"
description = "在幻灯片上显示激光笔指示"
params = { x = "number", y = "number", duration = "number?" }
[[hand.actions]]
id = "highlight"
name = "高亮区域"
description = "高亮显示幻灯片上的区域"
params = { x = "number", y = "number", width = "number", height = "number", color = "string?" }
[[hand.actions]]
id = "play_animation"
name = "播放动画"
description = "触发幻灯片上的动画效果"
params = { animation_id = "string" }
[[hand.actions]]
id = "pause"
name = "暂停"
description = "暂停自动播放"
params = {}
[[hand.actions]]
id = "resume"
name = "继续"
description = "继续自动播放"
params = {}

View File

@@ -1,127 +0,0 @@
# Speech Hand - 语音合成能力包
#
# ZCLAW Hand 配置
# 提供文本转语音 (TTS) 能力,支持多种语音和语言
[hand]
name = "speech"
version = "1.0.0"
description = "语音合成能力包 - 将文本转换为自然语音输出"
author = "ZCLAW Team"
type = "media"
requires_approval = false
timeout = 120
max_concurrent = 3
tags = ["speech", "tts", "voice", "audio", "education", "accessibility", "demo"]
[hand.config]
# TTS 提供商: browser, azure, openai, elevenlabs, local
provider = "browser"
# 默认语音
default_voice = "default"
# 默认语速 (0.5 - 2.0)
default_rate = 1.0
# 默认音调 (0.5 - 2.0)
default_pitch = 1.0
# 默认音量 (0 - 1.0)
default_volume = 1.0
# 语言代码
default_language = "zh-CN"
# 是否缓存音频
cache_audio = true
# Azure TTS 配置 (如果 provider = "azure")
[hand.config.azure]
# voice_name = "zh-CN-XiaoxiaoNeural"
# region = "eastasia"
# OpenAI TTS 配置 (如果 provider = "openai")
[hand.config.openai]
# model = "tts-1"
# voice = "alloy"
# 浏览器 TTS 配置 (如果 provider = "browser")
[hand.config.browser]
# 使用系统默认语音
use_system_voice = true
# 语音名称映射
voice_mapping = { "zh-CN" = "Microsoft Huihui", "en-US" = "Microsoft David" }
[hand.triggers]
manual = true
schedule = false
webhook = false
[[hand.triggers.events]]
type = "chat.intent"
pattern = "朗读|念|说|播放语音|speak|read|say|tts"
priority = 5
[hand.permissions]
requires = [
"speech.synthesize",
"speech.play",
"speech.stop"
]
roles = ["operator.read"]
[hand.rate_limit]
max_requests = 100
window_seconds = 3600
[hand.audit]
log_inputs = true
log_outputs = false # 音频不记录
retention_days = 3
# 语音动作定义
[[hand.actions]]
id = "speak"
name = "朗读文本"
description = "将文本转换为语音并播放"
params = { text = "string", voice = "string?", rate = "number?", pitch = "number?" }
[[hand.actions]]
id = "speak_ssml"
name = "朗读 SSML"
description = "使用 SSML 标记朗读文本(支持更精细控制)"
params = { ssml = "string", voice = "string?" }
[[hand.actions]]
id = "pause"
name = "暂停播放"
description = "暂停当前语音播放"
params = {}
[[hand.actions]]
id = "resume"
name = "继续播放"
description = "继续暂停的语音播放"
params = {}
[[hand.actions]]
id = "stop"
name = "停止播放"
description = "停止当前语音播放"
params = {}
[[hand.actions]]
id = "list_voices"
name = "列出可用语音"
description = "获取可用的语音列表"
params = { language = "string?" }
[[hand.actions]]
id = "set_voice"
name = "设置默认语音"
description = "更改默认语音设置"
params = { voice = "string", language = "string?" }

View File

@@ -1,126 +0,0 @@
# 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 = "将白板内容导出为图片(⚠️ 导出功能开发中,当前返回占位数据)"
demo = true
params = { format = "string?" }