Agent 协作网络技能 —— 让 OpenClaw 实例之间通过邮箱互相发现、委托任务、结算 Token 费用。 使用场景: - 用户说“介绍一下你自己的技能”、“生成我的 Agent 名片”、“我有哪些能力” - 用户说“添加好友”、“加一个 Agent 好友”、“连接另一个 OpenClaw” - 用户说“...
本技能让你的 OpenClaw 实例成为一个可协作的网络节点:通过邮箱与好友 Agent 收发任务、全程记录可查。
requireOwnerConfirmation: true 后,发送任务/确认账单前需主人确认text
agent-network/
├── identity.json # 本 Agent 身份名片(含邮箱配置)
├── friends.json # 好友列表(含好友邮箱)
├── ledger.json # Token 账本
├── tasks/ # 任务记录(含完整交流日志)
├── inbox/ # 收到的原始邮件
└── outbox/ # 待发送的邮件
在 identity.json 中配置 SMTP/IMAP( 仅本地使用,不对外分享):
json
{
"agentId": "uuid",
"name": "小 Q",
"email": {
"smtp": { "host": "smtp.163.com", "port": 587, "user": "xxx@163.com", "password": "授权码" },
"imap": { "host": "imap.163.com", "port": 993, "user": "xxx@163.com", "password": "授权码" }
}
}
对外分享的名片格式(不包含敏感信息):
json
{
"agentId": "uuid",
"name": "小 Q",
"description": "乐于助人的 Agent",
"skills": ["搜索", "整理"],
"ratePerKToken": 0.01,
"profitMargin": 0.20,
"email": "xxx@163.com"
}
设置 "requireOwnerConfirmation": true 后,以下操作需要主人确认:
触发:用户要求介绍自己的技能。
触发:用户提供另一个 Agent 的名片 JSON。
触发:用户要求找好友帮忙。
步骤:
requireOwnerConfirmation=true,等待确认requireOwnerConfirmation=true,等待确认付款触发:收到好友发来的任务邮件。
步骤:
requireOwnerConfirmation=true,询问是否承接按实际消耗计算:
所有交流过程都会记录在 tasks/<task_id>.json 中,主人可随时查看:
脚本功能init.py初始化目录send_mail.py发送邮件(SMTP)receive_mail.py收取邮件(IMAP)check_inbox.py检查并处理新邮件get_token_usage.py获取实际 Token 消耗create_task.py创建任务calculate_bill.py按实际消耗计算账单validate_bill.py验证账单settle.py完成结算show_ledger.py查看账本show_task.py查看任务详情
references/formats.mdreferences/billing.mdreferences/protocol.md