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:
165
skills/classroom-generator/SKILL.md
Normal file
165
skills/classroom-generator/SKILL.md
Normal file
@@ -0,0 +1,165 @@
|
||||
# Classroom Generator Skill
|
||||
|
||||
根据主题或文档生成互动课堂内容,包括大纲、场景、测验等。
|
||||
|
||||
## 触发词
|
||||
|
||||
生成课堂、创建课程、制作课件、课堂生成、classroom、generate lesson、create course
|
||||
|
||||
## 能力
|
||||
|
||||
- **大纲生成**: 根据主题生成结构化课堂大纲
|
||||
- **场景创建**: 为每个大纲条目生成丰富的教学场景
|
||||
- **测验生成**: 自动生成测验题目评估学习效果
|
||||
- **多风格支持**: 支持讲授式、讨论式、项目制学习 (PBL) 等教学风格
|
||||
- **多模态内容**: 支持文本、图像、公式、图表等内容类型
|
||||
|
||||
## 工具依赖
|
||||
|
||||
- whiteboard: 白板绘制能力
|
||||
- slideshow: 幻灯片控制能力
|
||||
- speech: 语音合成能力
|
||||
- quiz: 测验生成能力
|
||||
|
||||
## 输入参数
|
||||
|
||||
| 参数 | 类型 | 必需 | 描述 |
|
||||
|------|------|------|------|
|
||||
| topic | string | 是 | 课堂主题 |
|
||||
| document | string | 否 | 参考文档内容或 URL |
|
||||
| style | string | 否 | 教学风格: lecture/discussion/pbl |
|
||||
| level | string | 否 | 难度级别: beginner/intermediate/advanced |
|
||||
| duration | number | 否 | 预计时长(分钟) |
|
||||
| language | string | 否 | 输出语言: zh-CN/en-US |
|
||||
|
||||
## 输出格式
|
||||
|
||||
### 课堂大纲 (Stage 1)
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "课堂标题",
|
||||
"summary": "课堂简介",
|
||||
"objectives": ["学习目标1", "学习目标2"],
|
||||
"outline": [
|
||||
{
|
||||
"id": "scene_1",
|
||||
"title": "场景标题",
|
||||
"type": "slide|quiz|interactive|discussion",
|
||||
"duration": 5,
|
||||
"key_points": ["要点1", "要点2"]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 场景内容 (Stage 2)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "scene_1",
|
||||
"type": "slide",
|
||||
"content": {
|
||||
"title": "幻灯片标题",
|
||||
"slides": [...]
|
||||
},
|
||||
"actions": [
|
||||
{"type": "speech", "text": "讲解内容..."},
|
||||
{"type": "whiteboard", "action": "draw_chart", "params": {...}},
|
||||
{"type": "slideshow", "action": "spotlight", "params": {...}}
|
||||
],
|
||||
"notes": "教学备注"
|
||||
}
|
||||
```
|
||||
|
||||
## 工作流程
|
||||
|
||||
1. **分析输入**: 解析主题、文档、风格等参数
|
||||
2. **生成大纲**: 创建结构化课堂大纲
|
||||
3. **展开场景**: 为每个大纲条目生成详细场景
|
||||
4. **添加动作**: 为每个场景添加白板、语音、幻灯片等动作
|
||||
5. **生成测验**: 在适当位置插入测验题目
|
||||
6. **输出结果**: 返回完整课堂 JSON
|
||||
|
||||
## 示例用法
|
||||
|
||||
```
|
||||
用户: 生成一个关于 Rust 所有权的 30 分钟课堂
|
||||
助手: 我来为您生成 Rust 所有权的互动课堂...
|
||||
|
||||
[分析主题]
|
||||
[生成大纲]
|
||||
[展开场景]
|
||||
|
||||
课堂已生成!包含:
|
||||
- 5 个教学场景
|
||||
- 1 个互动测验
|
||||
- 预计时长 30 分钟
|
||||
|
||||
开始学习吗?
|
||||
```
|
||||
|
||||
## Agent 角色配置
|
||||
|
||||
生成课堂时,会创建以下 Agent 角色:
|
||||
|
||||
| 角色 | 职责 | 优先级 |
|
||||
|------|------|--------|
|
||||
| teacher | 主讲教师,负责核心内容讲解 | 10 |
|
||||
| assistant | 助教,负责补充说明和答疑 | 7 |
|
||||
| student_active | 活跃学生,主动提问和互动 | 5 |
|
||||
| student_note | 笔记员,整理和总结要点 | 4 |
|
||||
|
||||
## 提示模板
|
||||
|
||||
### 大纲生成提示
|
||||
|
||||
```
|
||||
你是一位专业的课程设计师。请根据以下信息生成一个结构化的课堂大纲:
|
||||
|
||||
主题: {{topic}}
|
||||
参考文档: {{document}}
|
||||
教学风格: {{style}}
|
||||
难度级别: {{level}}
|
||||
预计时长: {{duration}} 分钟
|
||||
|
||||
请生成:
|
||||
1. 课堂标题和简介
|
||||
2. 3-5 个学习目标
|
||||
3. 4-8 个教学场景(每个场景包含标题、类型、时长、关键点)
|
||||
|
||||
输出为 JSON 格式。
|
||||
```
|
||||
|
||||
### 场景展开提示
|
||||
|
||||
```
|
||||
你是一位经验丰富的教师。请根据以下大纲条目生成详细的教学场景:
|
||||
|
||||
场景标题: {{scene_title}}
|
||||
场景类型: {{scene_type}}
|
||||
关键点: {{key_points}}
|
||||
前序内容: {{previous_content}}
|
||||
|
||||
请生成:
|
||||
1. 场景的详细内容(幻灯片内容、讲解文本等)
|
||||
2. 需要执行的动作(白板绘制、语音讲解、幻灯片控制等)
|
||||
3. 教学备注
|
||||
|
||||
输出为 JSON 格式。
|
||||
```
|
||||
|
||||
## 输出规范
|
||||
|
||||
- 使用 JSON 格式输出结构化内容
|
||||
- 中文内容使用 UTF-8 编码
|
||||
- 动作参数需符合对应 Hand 的接口定义
|
||||
- 时长以分钟为单位
|
||||
- 所有 ID 使用 snake_case 格式
|
||||
|
||||
## 扩展能力
|
||||
|
||||
- **导出 PPTX**: 将课堂内容导出为 PowerPoint 演示文稿
|
||||
- **导出 HTML**: 将课堂内容导出为交互式网页
|
||||
- **导入文档**: 从 PDF/Word/Markdown 文档生成课堂
|
||||
- **自定义模板**: 支持自定义课堂模板和风格
|
||||
Reference in New Issue
Block a user