← 返回
未分类 Key 中文

A2a Register

Register, deregister, and manage this OpenClaw instance as an A2A agent in the A2A API Gateway. Use when: (1) registering this instance so other agents can d...
在A2A API Gateway中注册、注销并管理此OpenClaw实例为A2A代理。适用场景:1) 注册实例供其他代理发现和交互;2) 不再需要时注销;3) 更新元数据或配置。
thearchitectit thearchitectit 来源
未分类 clawhub v1.3.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 358
下载
💾 1
安装
1
版本
#latest

概述

A2A Register — Agent Registration Management

Register and manage this OpenClaw instance as an A2A agent in the A2A API Gateway. Other agents discover this instance through the gateway registry, so registration is required before receiving inbound tasks.

Sidecar Principle

This skill is strictly an OpenClaw sidecar — it uses the A2A API Gateway's existing admin API to register, deregister, heartbeat, and check status. The gateway's admin endpoints are the contract; OpenClaw is just a participant. Never assume what other registered agents look like or how they connect — they could be MC2, another OpenClaw, or anything else that speaks A2A. These scripts call the gateway's admin API as-is.

Configuration

All scripts read from a shared a2a.conf file (located in the a2a-client skill directory). The gateway URL must be configured — there are no hardcoded defaults.

Priority order: CLI flags → env vars → a2a.conf → auto-detected defaults

SettingAuto-detected DefaultDescription
---------------------------------------------
Gateway URLnone — requiredA2A API Gateway URL (A2A_GATEWAY_URL)
Agent Namehostname -s (lowercase)Display name (AGENT_NAME)
Agent Slughostname -s (lowercase)URL-safe identifier (AGENT_SLUG)
Agent URLhttp://{Tailscale IP}:{port}Agent endpoint (AGENT_URL)
Capabilitieschat,code,researchComma-separated (AGENT_CAPABILITIES)
Auth TypebearerAuth method (AGENT_AUTH_TYPE)
API KeyemptyFor listener auth (A2A_GATEWAY_API_KEY)

Quick Setup

# Interactive setup — creates a2a.conf for you
./a2a-setup.sh

# Non-interactive (env vars required)
A2A_GATEWAY_URL=http://GATEWAY_IP:8090 A2A_GATEWAY_API_KEY=your-key ./a2a-setup.sh --non-interactive

When to Use

  • Setup — First time configuring this instance for A2A
  • Register — When this OpenClaw instance needs to be discoverable by other A2A agents
  • Deregister — When going offline or removing this instance from the gateway
  • Heartbeat — Periodically signal that this instance is alive and reachable
  • Status — Check whether this instance is registered and view its current configuration

Tools

a2a-setup.sh — Interactive Configuration

./a2a-setup.sh [--non-interactive] [--conf PATH]

Creates or updates the shared a2a.conf file. In interactive mode, prompts for all values with auto-detected defaults. In non-interactive mode, reads from environment variables.

# Interactive (recommended first time)
./a2a-setup.sh

# Non-interactive (for scripting)
A2A_GATEWAY_URL=http://GATEWAY_IP:8090 \
A2A_GATEWAY_API_KEY=your-key \
AGENT_SLUG=my-agent \
./a2a-setup.sh --non-interactive

register.sh — Register This Agent

./register.sh [--gateway-url URL] [--name NAME] [--slug SLUG] [--url URL] [--capabilities CAPS]

Registers this OpenClaw instance in the A2A API Gateway. The script:

  1. Obtains a JWT via GET /v0/admin/bootstrap
  2. Checks if the agent slug already exists (GET /v0/admin/agents)
  3. If new → POST /v0/admin/agents to create it
  4. If exists → PUT /v0/admin/agents/{id} to update it

Idempotent — safe to run multiple times.

# Register with defaults (from a2a.conf / auto-detected)
./register.sh

# Override specific values
./register.sh --name "My Agent" --slug my-agent --url http://MY_IP:8100

# Override gateway URL
./register.sh --gateway-url http://GATEWAY_LAN_IP:8090

deregister.sh — Remove This Agent

./deregister.sh [--gateway-url URL] [--slug SLUG]

Removes this OpenClaw instance from the gateway registry. Other agents will no longer be able to discover or route tasks to it.

./deregister.sh

heartbeat.sh — Send Liveness Signal

./heartbeat.sh [--gateway-url URL] [--slug SLUG]

Sends a heartbeat to the gateway (PATCH /v0/admin/agents/{id}/heartbeat) to signal that this instance is alive and reachable. Useful for cron jobs or periodic health checks.

# One-time heartbeat
./heartbeat.sh

# In a cron (every 5 minutes)
*/5 * * * * /path/to/skills/a2a-register/heartbeat.sh

status.sh — Check Registration Status

./status.sh [--gateway-url URL] [--slug SLUG]

Checks whether this OpenClaw instance is registered in the gateway and shows its current configuration (URL, capabilities, status).

./status.sh

Typical Workflow

  1. Setup./a2a-setup.sh to create your a2a.conf
  2. Register./register.sh to add this instance to the gateway
  3. Start listener → Use a2a-server skill's start.sh to begin receiving tasks
  4. Heartbeat → Run ./heartbeat.sh periodically (or set up a cron)
  5. Status./status.sh to verify registration
  6. Deregister./deregister.sh when going offline

Gateway API

EndpointMethodPurpose
---------------------------
/v0/admin/bootstrapGETObtain admin JWT
/v0/admin/agentsGETList all registered agents
/v0/admin/agentsPOSTRegister a new agent
/v0/admin/agents/{id}PUTUpdate an existing agent
/v0/admin/agents/{id}DELETERemove an agent
/v0/admin/agents/{id}/heartbeatPATCHSignal liveness

Environment Variables

VariableDescription
-----------------------
A2A_GATEWAY_URLGateway URL (required if not in a2a.conf)
A2A_GATEWAY_API_KEYAPI key for listener auth
AGENT_NAMEAgent display name
AGENT_SLUGAgent identifier
AGENT_URLAgent endpoint URL
AGENT_CAPABILITIESComma-separated capabilities
LISTENER_PORTListener port (default: 8100)

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-05-07 16:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,110 📥 833,452
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 838 📥 315,766
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,398 📥 323,214