@perkos/perkos-a2a 0.3.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "perkos-a2a",
3
3
  "name": "PerkOS A2A",
4
- "version": "0.3.5",
4
+ "version": "0.5.0",
5
5
  "description": "Agent-to-Agent (A2A) protocol communication for OpenClaw agents",
6
6
  "author": "PerkOS",
7
7
  "configSchema": {
@@ -17,49 +17,85 @@
17
17
  "default": 5050,
18
18
  "description": "Port for the A2A HTTP server (5050 default; macOS uses 5000 for AirPlay)"
19
19
  },
20
+ "mode": {
21
+ "type": "string",
22
+ "enum": ["full", "client-only", "relay", "auto"],
23
+ "default": "auto",
24
+ "description": "Server mode: full (listen + send), client-only (send only), relay (run as hub), auto (detect)"
25
+ },
20
26
  "skills": {
21
27
  "type": "array",
22
28
  "items": {
23
29
  "type": "object",
24
30
  "properties": {
25
- "id": {
26
- "type": "string"
27
- },
28
- "name": {
29
- "type": "string"
30
- },
31
- "description": {
32
- "type": "string"
33
- },
34
- "tags": {
35
- "type": "array",
36
- "items": {
37
- "type": "string"
38
- }
39
- }
31
+ "id": { "type": "string" },
32
+ "name": { "type": "string" },
33
+ "description": { "type": "string" },
34
+ "tags": { "type": "array", "items": { "type": "string" } }
40
35
  }
41
36
  },
42
37
  "description": "Skills this agent exposes via A2A"
43
38
  },
44
39
  "peers": {
45
40
  "type": "object",
46
- "additionalProperties": {
47
- "type": "string"
48
- },
41
+ "additionalProperties": { "type": "string" },
49
42
  "description": "Map of peer agent names to their A2A URLs"
43
+ },
44
+ "relay": {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "enabled": {
49
+ "type": "boolean",
50
+ "default": false,
51
+ "description": "Enable relay hub connection for NAT traversal"
52
+ },
53
+ "url": {
54
+ "type": "string",
55
+ "description": "WebSocket URL of the relay hub (e.g. wss://relay.perkos.xyz)"
56
+ },
57
+ "apiKey": {
58
+ "type": "string",
59
+ "description": "API key for authenticating with the relay hub"
60
+ },
61
+ "hubPort": {
62
+ "type": "number",
63
+ "default": 8787,
64
+ "description": "Port when running as relay hub (mode: relay)"
65
+ },
66
+ "hubApiKeys": {
67
+ "type": "array",
68
+ "items": { "type": "string" },
69
+ "description": "Valid API keys when running as relay hub"
70
+ }
71
+ },
72
+ "description": "Relay hub configuration for NAT traversal"
73
+ },
74
+ "auth": {
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "properties": {
78
+ "requireApiKey": {
79
+ "type": "boolean",
80
+ "default": false,
81
+ "description": "Require API key for incoming HTTP A2A requests"
82
+ },
83
+ "apiKeys": {
84
+ "type": "array",
85
+ "items": { "type": "string" },
86
+ "description": "Valid API keys for incoming requests"
87
+ }
88
+ },
89
+ "description": "Authentication configuration for A2A endpoints"
50
90
  }
51
91
  }
52
92
  },
53
93
  "uiHints": {
54
- "agentName": {
55
- "label": "Agent Name",
56
- "placeholder": "mimir"
57
- },
58
- "port": {
59
- "label": "A2A Server Port"
60
- },
61
- "peers": {
62
- "label": "Peer Agents (name \u2192 URL)"
63
- }
94
+ "agentName": { "label": "Agent Name", "placeholder": "mimir" },
95
+ "port": { "label": "A2A Server Port" },
96
+ "mode": { "label": "Server Mode" },
97
+ "peers": { "label": "Peer Agents (name -> URL)" },
98
+ "relay": { "label": "Relay Hub (NAT Traversal)" },
99
+ "auth": { "label": "Authentication" }
64
100
  }
65
- }
101
+ }
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@perkos/perkos-a2a",
3
- "version": "0.3.5",
3
+ "version": "0.5.0",
4
4
  "description": "A2A Protocol communication plugin for OpenClaw \u2014 Agent-to-Agent protocol implementation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
+ "bin",
10
11
  "skills",
11
12
  "openclaw.plugin.json"
12
13
  ],
14
+ "bin": {
15
+ "a2a-relay": "./bin/relay.ts"
16
+ },
13
17
  "scripts": {
14
18
  "build": "tsc",
15
19
  "dev": "tsc --watch",
@@ -41,13 +45,15 @@
41
45
  "url": "https://github.com/PerkOS-xyz/PerkOS-A2A"
42
46
  },
43
47
  "dependencies": {
44
- "express": "^4.21.0"
48
+ "express": "^4.21.0",
49
+ "ws": "^8.18.0"
45
50
  },
46
51
  "devDependencies": {
47
52
  "@sinclair/typebox": "^0.34.0",
48
53
  "typescript": "^5.7.0",
49
54
  "@types/express": "^5.0.0",
50
- "@types/node": "^22.0.0"
55
+ "@types/node": "^22.0.0",
56
+ "@types/ws": "^8.5.0"
51
57
  },
52
58
  "peerDependencies": {
53
59
  "openclaw": ">=2026.3.0"
@@ -0,0 +1,68 @@
1
+ # PerkOS A2A - Agent Skill Guide
2
+
3
+ ## Overview
4
+
5
+ The PerkOS A2A plugin enables communication between OpenClaw agents using Google's Agent-to-Agent (A2A) protocol. Use these tools to delegate work, discover peers, and track task progress.
6
+
7
+ ## Tools
8
+
9
+ ### a2a_discover
10
+
11
+ Discover all peer agents in the council. Returns each agent's online/offline status, description, and skills.
12
+
13
+ **When to use:** Before sending a task, to check which agents are available and what they can do.
14
+
15
+ **Parameters:** None
16
+
17
+ **Example:**
18
+ ```
19
+ Use a2a_discover to see which agents are online.
20
+ ```
21
+
22
+ ### a2a_send_task
23
+
24
+ Send a task to a specific peer agent. The task is delivered via JSON-RPC and queued for processing.
25
+
26
+ **When to use:** When you need another agent to perform work -- research, code generation, data processing, etc.
27
+
28
+ **Parameters:**
29
+ - `target` (required): Name of the peer agent (must match a key in the peers config)
30
+ - `message` (required): The task description/instructions to send
31
+
32
+ **Example:**
33
+ ```
34
+ Use a2a_send_task to ask "mimir" to "Research the latest A2A protocol specification changes"
35
+ ```
36
+
37
+ ### a2a_task_status
38
+
39
+ Check the status of a previously sent task by its ID.
40
+
41
+ **When to use:** After sending a task, to poll for completion or check progress.
42
+
43
+ **Parameters:**
44
+ - `target` (required): Name of the agent that received the task
45
+ - `taskId` (required): The task ID returned from a2a_send_task
46
+
47
+ **Task states:** submitted, working, completed, failed, canceled
48
+
49
+ ## Workflows
50
+
51
+ ### Delegate and check back
52
+
53
+ 1. `a2a_discover` -- see who's online
54
+ 2. `a2a_send_task` -- send the task to a capable peer
55
+ 3. `a2a_task_status` -- check on progress (may need to poll)
56
+
57
+ ### Multi-agent coordination
58
+
59
+ 1. Discover available agents
60
+ 2. Send different subtasks to different agents based on their skills
61
+ 3. Collect results via task status checks
62
+ 4. Combine outputs for the user
63
+
64
+ ## Notes
65
+
66
+ - Tasks are asynchronous. After sending, the peer agent processes independently.
67
+ - If the plugin is in client-only mode, you can send tasks but peers cannot send tasks to you.
68
+ - Peer URLs must be configured in the plugin config before you can communicate with them.