feat: add generate_docx sandbox MCP tool for public Word downloads
Expose generate_docx in mindspace-sandbox-mcp so agents can write public/*.docx before linking HTML download pages, with tests mirroring the Mark summary flow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,7 +19,17 @@ description: 在工作区内用 Python 标准库(zipfile + XML)生成 Word .
|
||||
- 用户要 Word / docx / .doc 文档(输出 `.docx`)
|
||||
- 需要保存到 `oa/`、`private/`、`public/` 等分区
|
||||
|
||||
## 推荐命令
|
||||
## 推荐方式(优先)
|
||||
|
||||
**优先调用 sandbox-fs 的 `generate_docx` 工具**(与 `generate_long_image` 同级),直接写入 `public/文件名.docx` 或 `oa/文件名.docx`:
|
||||
|
||||
- `output_path`:如 `public/协和智慧门诊研究摘要.docx`
|
||||
- `title`:文档标题
|
||||
- `sections`:章节数组(`heading`、`paragraphs`、可选 `table`)
|
||||
|
||||
生成后必须 `list_dir public/` 确认目标文件已落盘,再写 HTML 下载链接。
|
||||
|
||||
## 备选命令(仅当 MCP 不可用时)
|
||||
|
||||
技能目录内有 `generate_docx.py`(仅依赖 Python 3 标准库):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user