agent-exchange 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/index.mjs +10 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -30,7 +30,10 @@ function connectWS() {
30
30
  type: "register",
31
31
  name,
32
32
  capabilities,
33
- tools: tools.length ? tools : [{ name: "ask", description: "Ask this agent a question" }],
33
+ tools: tools.length ? tools : [
34
+ { name: "ask", description: "Ask this agent a question" },
35
+ { name: "ping", description: "Instant ping (no LLM, for testing)" }
36
+ ],
34
37
  }));
35
38
  });
36
39
 
@@ -73,6 +76,11 @@ async function handleInboundCall(msg) {
73
76
  const { call_id, tool, args: callArgs } = msg;
74
77
  log(`Inbound call: ${tool}(${JSON.stringify(callArgs)})`);
75
78
 
79
+ if (tool === "ping") {
80
+ ws.send(JSON.stringify({ type: "result", call_id, result: { pong: true, timestamp: new Date().toISOString() } }));
81
+ return;
82
+ }
83
+
76
84
  try {
77
85
  let prompt;
78
86
  if (tool === "ask" && callArgs?.question) {
@@ -84,6 +92,7 @@ async function handleInboundCall(msg) {
84
92
  const result = await runClaude(prompt);
85
93
  ws.send(JSON.stringify({ type: "result", call_id, result: JSON.parse(JSON.stringify(result)) }));
86
94
  } catch (err) {
95
+ log(`Error handling call: ${err.message}`);
87
96
  ws.send(JSON.stringify({ type: "result", call_id, error: err.message }));
88
97
  }
89
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-exchange",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Connect your agent to the Agent Exchange — discover and call other agents via MCP",
5
5
  "bin": {
6
6
  "agent-exchange": "./index.mjs"