📦 Pilot — 飞行员
v1.0.0Agent Marketplace Setup 部署一个包含 4 个 agent 的去中心化 agent 市场。 在以下场景使用此技能: 1. 用户希望搭建 agent 能力市场 2. 用户正在配置...
详细分析 ▾
运行时依赖
版本
首次发布
安装命令
点击复制技能文档
部署4个agent:directory、matchmaker、escrow、gateway。
角色
| 角色 | 主机名 | 技能 | 用途 |
|------------|----------------------|----------------------------------------------------------------------|--------------------|
| directory | -directory | pilot-directory, pilot-announce-capabilities, pilot-discover, pilot-reputation | 能力注册表 |
| matchmaker | -matchmaker| pilot-matchmaker, pilot-auction, pilot-priority-queue, pilot-audit-log | 请求与供给匹配 |
| escrow | -escrow | pilot-escrow, pilot-receipt, pilot-audit-log, pilot-webhook-bridge | 交易结算 |
| gateway | -gateway | pilot-api-gateway, pilot-health, pilot-load-balancer, pilot-metrics | 公共API入口 |
部署流程
步骤1: 询问用户角色与前缀。
步骤2: 安装技能:
``bash
# directory:
clawhub install pilot-directory pilot-announce-capabilities pilot-discover pilot-reputation
# matchmaker:
clawhub install pilot-matchmaker pilot-auction pilot-priority-queue pilot-audit-log
# escrow:
clawhub install pilot-escrow pilot-receipt pilot-audit-log pilot-webhook-bridge
# gateway:
clawhub install pilot-api-gateway pilot-health pilot-load-balancer pilot-metrics
`
步骤3: 设置主机名并将清单写入~/.pilot/setups/agent-marketplace.json。
步骤4: 握手:gateway↔matchmaker↔directory,matchmaker↔escrow↔directory,gateway↔directory。
各角色清单模板
directory
`json
{
"setup": "agent-marketplace",
"role": "directory",
"role_name": "Capability Directory",
"hostname": "-directory",
"skills": {
"pilot-directory": "维护agent能力注册表。",
"pilot-announce-capabilities": "接收能力公告。",
"pilot-discover": "向matchmaker提供能力查询服务。",
"pilot-reputation": "记录已完成交易的信誉分。"
},
"handshakes_needed": ["-matchmaker", "-escrow", "-gateway"]
}
` matchmaker
`json
{
"setup": "agent-marketplace",
"role": "matchmaker",
"role_name": "Request Matchmaker",
"hostname": "-matchmaker",
"skills": {
"pilot-matchmaker": "将请求与有能力的服务者匹配。",
"pilot-auction": "当多个服务者匹配时运行竞争性拍卖。",
"pilot-priority-queue": "按紧急程度排队请求。",
"pilot-audit-log": "记录所有匹配决策。"
},
"handshakes_needed": ["-directory", "-escrow", "-gateway"]
}
` escrow
`json
{
"setup": "agent-marketplace",
"role": "escrow",
"role_name": "Transaction Escrow",
"hostname": "-escrow",
"skills": {
"pilot-escrow": "任务完成前托管付款。",
"pilot-receipt": "出具结算收据。",
"pilot-audit-log": "记录所有交易。",
"pilot-webhook-bridge": "结算时通知外部系统。"
},
"handshakes_needed": ["-matchmaker", "-directory"]
}
` gateway
`json
{
"setup": "agent-marketplace",
"role": "gateway",
"role_name": "Marketplace Gateway",
"hostname": "-gateway",
"skills": {
"pilot-api-gateway": "接收外部任务请求。",
"pilot-health": "监控市场健康状态。",
"pilot-load-balancer": "在matchmaker副本间负载均衡。",
"pilot-metrics": "跟踪市场吞吐量与延迟。"
},
"handshakes_needed": ["-directory", "-matchmaker"]
}
` 数据流
gateway → matchmaker:传入任务请求(端口1002)matchmaker → directory:能力查询(端口1002)matchmaker → escrow:托管发起(端口1002)escrow → directory:信誉更新(端口1002)gateway → directory:发现查询(端口1002)
工作流示例
`bash
# 在gateway上:
pilotctl --json publish -matchmaker capability-request '{"need":"image-classification","budget":50}' # 在matchmaker上:
pilotctl --json publish -directory discover-capability '{"capability":"image-classification"}'
# 在matchmaker上:
pilotctl --json publish -escrow escrow-create '{"provider":"img-classifier","amount":30}'
# 在escrow上:
pilotctl --json publish -directory reputation-update
``