Files
MailUI4Agents/plugins/homeagent-mail-bridge/plg.json
JianFeeeee fc33087982 feat: homeagent-mail-bridge —— TrueAgent 接入 AgentMail(MVP)
## 架构

TrueAgent 是单一常驻 agent 事件循环,没有 per-conversation session。
插件像 QQ 插件一样:所有邮件注入同一个事件循环,靠中断消息文本传递 context。
不做 platform_sessions 上报(无 sessions 可映射)。

## 工具

- read_inbox: 收件箱查询(渲染发件人/主题/正文/抄送/附件)
- send_mail: 三维地址发信(支持 reply_to)
- output_send__homeagent 输出通道(agent 可主动发信)

## 自动回信

InjectInputSync(阻塞)等待 agent 处理完毕 → 自动把 FinalText
发回给发件人(reply_to 指向原邮件)。agent 不需要记得调 send_mail。

试过 StageAfterOutput hook,但 before_output 看不到 ToolCalls
(read_inbox 调用在 turn 中间就被清掉了),导致自动回信不触发。
InjectInputSync 更可靠:TrueAgent 保证不重入。

## 基础设施

- 心跳 25 秒
- SSE 长连 + 自动重连(3 秒退避)
- 注册时自动注册密钥(AGENTMAIL_AGENT_KEY 环境变量)
- systemd drop-in 注入 AgentMail 环境变量

## 构建

plugindev build → dist/homeagent_linux_amd64.hmap
安装到 /home/newqqagent/plugins/homeagent-mail-bridge/
homeagent.service drop-in: /etc/systemd/system/homeagent.service.d/agentmail.conf

## 端到端验证

admin → homeagent@/tmp/homeagent.new(自动回信验证)
→ homeagent 读取邮件 + 自动回信「收到确认」→ 25 秒往返完成
2026-09-03 12:57:43 +08:00

16 lines
391 B
JSON
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": "homeagent-mail-bridge",
"name_zh": "AgentMail 桥接",
"name_en": "homeagent",
"version": "0.1.0",
"description": "HomeAgent 接入 AgentMail邮件驱动的多智能体协作",
"author": "AgentMail",
"entry": "plugin.bin",
"tags": ["mail", "agentmail"],
"targets": "linux/amd64",
"outdir": "dist",
"bundle": false,
"replaces": {},
"source_dirs": []
}