feat: send workspace images to QQ chats
Worker results may report image attachments stored inside the workspace; the runtime validates them (containment, png/jpg magic, size) and delivers them with the pending event. Assistants gain a send_image action so users can ask for an image later. QQ uploads via /files with base64 file_data and sends msg_type 7 rich media, sharing the same msg_id/msg_seq counter as text replies; non-image adapters flatten images to text.
This commit is contained in:
@@ -172,6 +172,8 @@ Config v3 支持:
|
||||
- 同一 `msg_id` 的 `msg_seq` 必须由 Gateway 共享递增,正常回复、事件、补发不能各自从 1 开始。
|
||||
- `/status` 应能看到 `schedulerState`、`blockedReason`、`lastEventDelivery`、`lastEventError`、`lastEventAt`。
|
||||
|
||||
出站图片同样没有主动权限,走同一被动窗口与共享 `msg_seq`:Worker 把给用户看的 png/jpg 存到 workspace 内(建议 `.gori-outbox/`)并在 result envelope 的 `attachments` 上报,runtime 校验 workspace containment、magic bytes、单张 ≤10MB、最多 3 张;发送时先 `POST /v2/{groups|users}/{id}/files` 上传(`file_type: 1` + base64 `file_data` + `srv_send_msg: false`)再 `msg_type: 7` + `media.file_info` 发送,群/私聊上传的 file_info 不通用。落定事件先发文案再发图;窗口过期补发时按路径重读文件,文件没了降级为文本说明;上传/发送失败不阻断文本。用户后来说「把图发给我」时 Assistant 用 `send_image` action 发同一张图。
|
||||
|
||||
## 验收清单
|
||||
|
||||
部署完成后至少检查:
|
||||
|
||||
Reference in New Issue
Block a user