Files
agent/skills/image/SKILL.md
T
kicer 767caa8574 feat(skills): 技能支持 MCP 后端(front matter mcp_tool)
SKILL.md 声明 mcp_tool 时,op=run 不落 executor 沙箱,由 core 直接 mcp.callTool
转发:凭证留在 core(沙箱的 env 白名单本就会丢掉 *KEY/*TOKEN),模型只看到技能清单
里的一行描述。配合 mcp_servers[].mode: silent,工具不再进每轮请求的 tools 数组。

- skills.js: runSkill 在 absolutizeArgs 之前分流(否则 URL / 含斜杠的 prompt 会被
  当路径改写);不做 input_schema.required 预检(参数与 op 相关,交给 MCP 服务)
- listSkills 带出 mcp_tool;设置页技能卡显示 mcp 后端徽章
- server.js: 启动期自检,缺失后端 warn、两条路并存 info
- 新增 skills/image、skills/video 两个纯文档技能(无 run.py)
- skills/README、README、app/AGENTS 同步
2026-10-21 09:08:57 +08:00

43 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: image
description: AI 生成图片(CogView)。op=create 传 prompt 拿 task_id,再 op=get 取图片 URL
mcp_tool: image_task
---
## 功能
调用智谱 CogView 生成图片。异步任务语义:提交立即返回 `task_id`,生成在服务端后台进行。
## 参数
`input_args` 原样透传给底层服务:
- `op=create`:`prompt` 必填。描述越具体越好(主体、风格、构图、光线、画面里的文字要求)。
- `op=get`:`task_id` 必填,取回任务状态;`SUCCESS` 时返回图片 URL。
## 用法
1. 提交
```
skill op=run name=image input_args={"op":"create","prompt":"一只橘猫趴在窗台上晒太阳,水彩风格"}
```
→ 返回 `task_id` 与 `task_status: PROCESSING`
2. 查询
```
skill op=run name=image input_args={"op":"get","task_id":"<上一步返回的 id>"}
```
→ `SUCCESS` 时返回 `Image N: <url>`
## 注意
- 生成通常 10~60 秒。看到 `PROCESSING` 就过几秒再查,不要连续轮询。
- 结果只有 URL,不落盘。要在会话里使用图片,用 `terminal` 下载:
`curl -fsSL -o out.png "<url>"`,之后 `read_file` 可以直接看图。
- 要让外部服务取这张图,先下载成本地文件,再用 `mint_public_link` 签发链接。
- 模型名与出图参数由服务端配置决定,调用时不需要也不该传。