feat(engine): 添加技能查看工具并优化异步任务管理 - 添加SkillViewTool到引擎加载器中,增强技能管理功能 - 在AgentLoop中引入_active_direct_task来跟踪活跃任务 - 实现直接任务执行时的同步处理逻辑 - 更新工具实例化方式以支持依赖注入 feat(config): 增加智能体运行时参数配置支持 - 扩展AgentDefaultsConfig添加max_tokens和temperature字段 - 实现配置解析函数_first_config_value处理多个配置源 - 支持通过Web API动态更新智能体运行时参数 - 添加前端页面配置表单和验证逻辑 refactor(provider): 统一最大令牌数参数类型为可选整型 - 将所有LLM提供者的max_tokens参数改为int | None类型 - 为AnthropicProvider实现模型特定的最大令牌数默认值 - 调整参数传递逻辑,优先级:调用参数 > 配置文件 > 模型默认值 - 移除硬编码的默认值,改用条件判断 feat(process): 增强事件投影功能 - 添加工具调用开始/结束事件的映射逻辑 - 实现技能激活事件的识别和展示 - 添加辅助函数处理工具调用名称和参数提取 - 优化运行记录关联逻辑,提升事件匹配准确性 fix(web): 更新网络请求客户端信任环境设置 - 将WebFetchTool和WebSearchTool的trust_env参数设为True - 确保HTTP客户端能够正确使用系统代理配置 - 修复可能的网络连接问题 test: 添加配置加载和事件投影相关测试 - 新增智能体默认参数配置测试用例 - 实现API配置持久化和重载测试 - 添加技能卡片和工具事件的投影测试 ```
191 lines
7.7 KiB
Markdown
191 lines
7.7 KiB
Markdown
---
|
|
name: officebench-mcp
|
|
description: Guidance for OfficeBench evaluation tasks. Use the registered mcp_officebench_* tools to inspect and edit OfficeBench files, spreadsheets, documents, emails, calendars, PDFs, and answer files.
|
|
always: true
|
|
tools:
|
|
- mcp_officebench_excel_read_file
|
|
- mcp_officebench_excel_set_cell
|
|
- mcp_officebench_excel_delete_cell
|
|
- mcp_officebench_excel_create_new_file
|
|
- mcp_officebench_excel_convert_to_pdf
|
|
- mcp_officebench_word_read_file
|
|
- mcp_officebench_word_write_to_file
|
|
- mcp_officebench_word_create_new_file
|
|
- mcp_officebench_word_convert_to_pdf
|
|
- mcp_officebench_email_list_emails
|
|
- mcp_officebench_email_read_email
|
|
- mcp_officebench_email_send_email
|
|
- mcp_officebench_calendar_create_event
|
|
- mcp_officebench_calendar_list_events
|
|
- mcp_officebench_calendar_delete_event
|
|
- mcp_officebench_pdf_read_file
|
|
- mcp_officebench_pdf_convert_to_word
|
|
- mcp_officebench_pdf_convert_to_image
|
|
- mcp_officebench_ocr_recognize_file
|
|
- mcp_officebench_shell_command
|
|
- mcp_officebench_shell_list_directory
|
|
- mcp_officebench_shell_read_file
|
|
- mcp_officebench_shell_write_file
|
|
- mcp_officebench_shell_copy_file
|
|
- mcp_officebench_system_finish_task
|
|
- mcp_officebench_system_get_status
|
|
- mcp_officebench_image_convert_to_pdf
|
|
---
|
|
|
|
# OfficeBench MCP Skill
|
|
|
|
Use this skill for OfficeBench evaluation runs. OfficeBench task files live in the OfficeBench MCP server, not in Beaver's local filesystem. Complete the task by calling real `mcp_officebench_*` tools.
|
|
|
|
## Critical Rules
|
|
|
|
1. Use actual Beaver tool calls only. Do not print XML, DSML, JSON, or markdown that describes a tool call.
|
|
2. Never invent tool names. If you need to find files, use `mcp_officebench_shell_list_directory` or `mcp_officebench_shell_command`.
|
|
3. Do not use Beaver local filesystem, local runtime, local terminal, or local code tools for OfficeBench files.
|
|
4. Paths are relative to `/testbed` in the OfficeBench MCP container, such as `data/score.xlsx`.
|
|
5. If the task context gives a `workspace_id`, pass that same `workspace_id` argument in every OfficeBench MCP tool call that supports it.
|
|
6. Inspect files before editing them.
|
|
7. Verify the requested output file or edited cell exists before finishing.
|
|
8. Finish every task with `mcp_officebench_system_finish_task`.
|
|
|
|
## Tool Names And Use
|
|
|
|
### Excel
|
|
|
|
Use these for `.xlsx` files:
|
|
|
|
- `mcp_officebench_excel_read_file`: read workbook sheets and cell values.
|
|
- Required: `file_path`
|
|
- Optional: `sheet_name`, `workspace_id`
|
|
- `mcp_officebench_excel_set_cell`: write one cell.
|
|
- Required: `file_path`, `row`, `col`, `value`
|
|
- Optional: `sheet_name`, `workspace_id`
|
|
- Rows and columns are 1-based.
|
|
- `mcp_officebench_excel_delete_cell`: clear one cell.
|
|
- Required: `file_path`, `row`, `col`
|
|
- Optional: `sheet_name`, `workspace_id`
|
|
- `mcp_officebench_excel_create_new_file`: create a workbook.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_excel_convert_to_pdf`: convert an Excel file to PDF.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
|
|
Typical Excel sequence:
|
|
|
|
1. Call `mcp_officebench_shell_list_directory` on `data`.
|
|
2. Call `mcp_officebench_excel_read_file` on the target workbook.
|
|
3. Identify the exact row and column.
|
|
4. Call `mcp_officebench_excel_set_cell`.
|
|
5. Read the workbook again or use status/listing to verify.
|
|
6. Call `mcp_officebench_system_finish_task`.
|
|
|
|
For the common task "change Bob's midterm1 score to 100 in score.xlsx", inspect `data/score.xlsx`, find Bob's row and the `midterm1` column, then call `mcp_officebench_excel_set_cell` with that row, that column, and value `100`.
|
|
|
|
### Word
|
|
|
|
Use these for `.docx` files:
|
|
|
|
- `mcp_officebench_word_read_file`: read all paragraphs.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_word_write_to_file`: overwrite or append text.
|
|
- Required: `file_path`, `text`
|
|
- Optional: `append`, `workspace_id`
|
|
- `mcp_officebench_word_create_new_file`: create a new Word document.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_word_convert_to_pdf`: convert Word to PDF.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
|
|
Preserve exact spelling, capitalization, punctuation, and line order from source files.
|
|
|
|
### Email
|
|
|
|
Use these for email tasks:
|
|
|
|
- `mcp_officebench_email_list_emails`: list available `.eml` messages.
|
|
- Optional: `folder`, `workspace_id`
|
|
- `mcp_officebench_email_read_email`: read one email.
|
|
- Required: `email_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_email_send_email`: create/send an email artifact.
|
|
- Required: `to`, `subject`, `body`
|
|
- Optional: `attachments`, `workspace_id`
|
|
|
|
For email-search tasks, final answers should use plain text with literal lines like `Subject: ...`. Do not add markdown labels.
|
|
|
|
### Calendar
|
|
|
|
Use these for calendar `.ics` tasks:
|
|
|
|
- `mcp_officebench_calendar_list_events`: inspect calendar events.
|
|
- Optional: `calendar_path`, `workspace_id`
|
|
- `mcp_officebench_calendar_create_event`: create an event.
|
|
- Required fields depend on the task; include summary/title, start, end, and target calendar when needed.
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_calendar_delete_event`: delete an event.
|
|
- Required fields depend on the task; inspect events first.
|
|
- Optional: `workspace_id`
|
|
|
|
Use the task's current date/time context when interpreting relative dates.
|
|
|
|
### PDF, OCR, And Images
|
|
|
|
Use these for PDF/image tasks:
|
|
|
|
- `mcp_officebench_pdf_read_file`: extract text from a PDF.
|
|
- Required: `pdf_file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_pdf_convert_to_word`: convert PDF to Word.
|
|
- Required: `pdf_file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_pdf_convert_to_image`: convert one PDF page to an image.
|
|
- Required: `pdf_file_path`
|
|
- Optional: `page_number`, `dpi`, `workspace_id`
|
|
- `mcp_officebench_ocr_recognize_file`: OCR an image.
|
|
- Required: `image_path`
|
|
- Optional: `language`, `workspace_id`
|
|
- `mcp_officebench_image_convert_to_pdf`: convert image to PDF.
|
|
- Required: `image_path`
|
|
- Optional: `output_path`, `workspace_id`
|
|
|
|
For conversion tasks, create the exact requested filename and verify it exists.
|
|
|
|
### Shell And System
|
|
|
|
Use these for safe file discovery and text files:
|
|
|
|
- `mcp_officebench_shell_list_directory`: list a directory.
|
|
- Optional: `path`, `workspace_id`
|
|
- `mcp_officebench_shell_read_file`: read text files such as `.txt`, `.csv`, `.json`, `.md`, `.xml`.
|
|
- Required: `file_path`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_shell_write_file`: write text files.
|
|
- Required: `file_path`, `content`
|
|
- Optional: `append`, `workspace_id`
|
|
- `mcp_officebench_shell_copy_file`: copy a file or directory.
|
|
- Required: `source`, `destination`
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_shell_command`: run shell commands inside the OfficeBench MCP container.
|
|
- Required: `command`
|
|
- Optional: `workdir`, `workspace_id`
|
|
- `mcp_officebench_system_get_status`: inspect filesystem/git status.
|
|
- Optional: `workspace_id`
|
|
- `mcp_officebench_system_finish_task`: mark the task complete and optionally write an answer.
|
|
- Optional: `answer`, `workspace_id`
|
|
|
|
Prefer dedicated Office tools for Office documents. Use shell tools for listing directories, copying/renaming files, and reading/writing plain text.
|
|
|
|
## Anti-Patterns
|
|
|
|
Do not do any of the following:
|
|
|
|
- Do not call `mcp_officebench_find_in_workspace`; that tool does not exist.
|
|
- Do not output `<tool_calls>`, `<invoke>`, DSML, or pseudo tool call text.
|
|
- Do not answer "done" without calling the required OfficeBench tools.
|
|
- Do not edit guessed paths without first listing or reading relevant files.
|
|
- Do not use `/testbed` as a literal prefix in path arguments unless a tool explicitly asks for an absolute path.
|
|
- Do not correct misspellings found in source data. Preserve source text exactly.
|
|
|