@kadi.build/core 0.0.1-alpha.1 → 0.0.1-alpha.10
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.
- package/README.md +1387 -214
- package/dist/abilities/AbilityCache.d.ts +242 -0
- package/dist/abilities/AbilityCache.d.ts.map +1 -0
- package/dist/abilities/AbilityCache.js +285 -0
- package/dist/abilities/AbilityCache.js.map +1 -0
- package/dist/abilities/AbilityContext.d.ts +215 -0
- package/dist/abilities/AbilityContext.d.ts.map +1 -0
- package/dist/abilities/AbilityContext.js +36 -0
- package/dist/abilities/AbilityContext.js.map +1 -0
- package/dist/abilities/AbilityLoader.d.ts +177 -0
- package/dist/abilities/AbilityLoader.d.ts.map +1 -0
- package/dist/abilities/AbilityLoader.js +277 -0
- package/dist/abilities/AbilityLoader.js.map +1 -0
- package/dist/abilities/AbilityProxy.d.ts +463 -0
- package/dist/abilities/AbilityProxy.d.ts.map +1 -0
- package/dist/abilities/AbilityProxy.js +511 -0
- package/dist/abilities/AbilityProxy.js.map +1 -0
- package/dist/abilities/AbilityValidator.d.ts +172 -0
- package/dist/abilities/AbilityValidator.d.ts.map +1 -0
- package/dist/abilities/AbilityValidator.js +253 -0
- package/dist/abilities/AbilityValidator.js.map +1 -0
- package/dist/abilities/index.d.ts +26 -0
- package/dist/abilities/index.d.ts.map +1 -0
- package/dist/abilities/index.js +23 -0
- package/dist/abilities/index.js.map +1 -0
- package/dist/abilities/types.d.ts +156 -0
- package/dist/abilities/types.d.ts.map +1 -0
- package/dist/abilities/types.js +10 -0
- package/dist/abilities/types.js.map +1 -0
- package/dist/api/index.d.ts +92 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +124 -0
- package/dist/api/index.js.map +1 -0
- package/dist/broker/BrokerConnection.d.ts +253 -0
- package/dist/broker/BrokerConnection.d.ts.map +1 -0
- package/dist/broker/BrokerConnection.js +434 -0
- package/dist/broker/BrokerConnection.js.map +1 -0
- package/dist/broker/BrokerConnectionManager.d.ts +216 -0
- package/dist/broker/BrokerConnectionManager.d.ts.map +1 -0
- package/dist/broker/BrokerConnectionManager.js +305 -0
- package/dist/broker/BrokerConnectionManager.js.map +1 -0
- package/dist/broker/BrokerProtocol.d.ts +280 -0
- package/dist/broker/BrokerProtocol.d.ts.map +1 -0
- package/dist/broker/BrokerProtocol.js +466 -0
- package/dist/broker/BrokerProtocol.js.map +1 -0
- package/dist/broker/index.d.ts +9 -0
- package/dist/broker/index.d.ts.map +1 -0
- package/dist/broker/index.js +9 -0
- package/dist/broker/index.js.map +1 -0
- package/dist/client/KadiClient.d.ts +270 -0
- package/dist/client/KadiClient.d.ts.map +1 -0
- package/dist/client/KadiClient.js +492 -0
- package/dist/client/KadiClient.js.map +1 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +138 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -0
- package/dist/config/ConfigLoader.js +226 -0
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/ConfigResolver.d.ts +135 -0
- package/dist/config/ConfigResolver.d.ts.map +1 -0
- package/dist/config/ConfigResolver.js +282 -0
- package/dist/config/ConfigResolver.js.map +1 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +8 -0
- package/dist/config/index.js.map +1 -0
- package/dist/errors/index.d.ts +9 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +8 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/events/EventHub.d.ts +172 -0
- package/dist/events/EventHub.d.ts.map +1 -0
- package/dist/events/EventHub.js +333 -0
- package/dist/events/EventHub.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +7 -0
- package/dist/events/index.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/messages/index.d.ts +33 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +33 -0
- package/dist/messages/index.js.map +1 -0
- package/dist/schemas/index.d.ts +19 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +25 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/kadi-extensions.d.ts +231 -0
- package/dist/schemas/kadi-extensions.d.ts.map +1 -0
- package/dist/schemas/kadi-extensions.js +14 -0
- package/dist/schemas/kadi-extensions.js.map +1 -0
- package/dist/schemas/mcp/schema.d.ts +1399 -0
- package/dist/schemas/mcp/schema.d.ts.map +1 -0
- package/dist/schemas/mcp/schema.js +53 -0
- package/dist/schemas/mcp/schema.js.map +1 -0
- package/dist/schemas/mcp/version.d.ts +37 -0
- package/dist/schemas/mcp/version.d.ts.map +1 -0
- package/dist/schemas/mcp/version.js +39 -0
- package/dist/schemas/mcp/version.js.map +1 -0
- package/dist/schemas/schema-builders.d.ts +178 -0
- package/dist/schemas/schema-builders.d.ts.map +1 -0
- package/dist/schemas/schema-builders.js +258 -0
- package/dist/schemas/schema-builders.js.map +1 -0
- package/dist/tools/ToolRegistry.d.ts +256 -0
- package/dist/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/tools/ToolRegistry.js +340 -0
- package/dist/tools/ToolRegistry.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/transports/BrokerTransport.d.ts +151 -0
- package/dist/transports/BrokerTransport.d.ts.map +1 -0
- package/dist/transports/BrokerTransport.js +261 -0
- package/dist/transports/BrokerTransport.js.map +1 -0
- package/dist/transports/NativeTransport.d.ts +149 -0
- package/dist/transports/NativeTransport.d.ts.map +1 -0
- package/dist/transports/NativeTransport.js +302 -0
- package/dist/transports/NativeTransport.js.map +1 -0
- package/dist/transports/StdioTransport.d.ts +172 -0
- package/dist/transports/StdioTransport.d.ts.map +1 -0
- package/dist/transports/StdioTransport.js +410 -0
- package/dist/transports/StdioTransport.js.map +1 -0
- package/dist/transports/index.d.ts +10 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports/index.js +9 -0
- package/dist/transports/index.js.map +1 -0
- package/dist/types/broker.d.ts +301 -0
- package/dist/types/broker.d.ts.map +1 -0
- package/dist/types/broker.js +46 -0
- package/dist/types/broker.js.map +1 -0
- package/dist/types/config.d.ts +325 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +17 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +178 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +165 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/events.d.ts +210 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +8 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/protocol.d.ts +48 -0
- package/dist/types/protocol.d.ts.map +1 -0
- package/dist/types/protocol.js +11 -0
- package/dist/types/protocol.js.map +1 -0
- package/dist/types/tools.d.ts +67 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +16 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/transport.d.ts +250 -0
- package/dist/types/transport.d.ts.map +1 -0
- package/dist/types/transport.js +18 -0
- package/dist/types/transport.js.map +1 -0
- package/dist/validation/SchemaValidator.d.ts +208 -0
- package/dist/validation/SchemaValidator.d.ts.map +1 -0
- package/dist/validation/SchemaValidator.js +411 -0
- package/dist/validation/SchemaValidator.js.map +1 -0
- package/dist/validation/index.d.ts +11 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +10 -0
- package/dist/validation/index.js.map +1 -0
- package/package.json +69 -5
- package/agent.json +0 -18
- package/broker.js +0 -214
- package/index.js +0 -370
- package/ipc.js +0 -220
- package/ipcInterfaces/pythonAbilityIPC.py +0 -177
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broker Protocol
|
|
3
|
+
*
|
|
4
|
+
* Implements the KADI broker protocol on top of BrokerConnection.
|
|
5
|
+
* Handles handshake, authentication, heartbeat, and capability registration.
|
|
6
|
+
*
|
|
7
|
+
* @module broker/BrokerProtocol
|
|
8
|
+
*/
|
|
9
|
+
import * as crypto from 'node:crypto';
|
|
10
|
+
import { KadiProtocolMethod } from '../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Protocol version
|
|
13
|
+
*/
|
|
14
|
+
export const PROTOCOL_VERSION = '2.0.0';
|
|
15
|
+
/**
|
|
16
|
+
* Broker Protocol
|
|
17
|
+
*
|
|
18
|
+
* Implements KADI broker protocol operations.
|
|
19
|
+
* Sits on top of BrokerConnection and provides high-level protocol methods.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const protocol = new BrokerProtocol(connection);
|
|
24
|
+
*
|
|
25
|
+
* // Perform handshake
|
|
26
|
+
* const result = await protocol.handshake({
|
|
27
|
+
* name: 'my-agent',
|
|
28
|
+
* version: '1.0.0',
|
|
29
|
+
* protocolVersion: PROTOCOL_VERSION,
|
|
30
|
+
* networks: ['global']
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Register capabilities
|
|
34
|
+
* await protocol.registerCapabilities({
|
|
35
|
+
* tools: [
|
|
36
|
+
* { name: 'add', description: 'Add numbers' }
|
|
37
|
+
* ]
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export class BrokerProtocol {
|
|
42
|
+
/**
|
|
43
|
+
* Underlying broker connection
|
|
44
|
+
*/
|
|
45
|
+
connection;
|
|
46
|
+
/**
|
|
47
|
+
* Heartbeat interval timer
|
|
48
|
+
*/
|
|
49
|
+
heartbeatTimer = null;
|
|
50
|
+
/**
|
|
51
|
+
* Ed25519 keypair for authentication
|
|
52
|
+
*/
|
|
53
|
+
publicKey;
|
|
54
|
+
privateKey;
|
|
55
|
+
/**
|
|
56
|
+
* Create a new BrokerProtocol
|
|
57
|
+
*
|
|
58
|
+
* @param connection - Broker connection to use
|
|
59
|
+
*/
|
|
60
|
+
constructor(connection) {
|
|
61
|
+
this.connection = connection;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Perform handshake with broker
|
|
65
|
+
*
|
|
66
|
+
* First step in establishing a session with the broker.
|
|
67
|
+
* The broker will assign an agent ID and confirm protocol compatibility.
|
|
68
|
+
*
|
|
69
|
+
* @param params - Handshake parameters
|
|
70
|
+
* @returns Handshake result with agent ID and broker info
|
|
71
|
+
*
|
|
72
|
+
* @throws {KadiError} If handshake fails
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const result = await protocol.handshake({
|
|
77
|
+
* name: 'calculator',
|
|
78
|
+
* version: '1.0.0',
|
|
79
|
+
* protocolVersion: PROTOCOL_VERSION,
|
|
80
|
+
* networks: ['global']
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* console.log('Assigned agent ID:', result.agentId);
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
async handshake(params) {
|
|
87
|
+
// Generate Ed25519 keypair for authentication if role requires it
|
|
88
|
+
if (params.role === 'agent' || params.role === 'ability') {
|
|
89
|
+
const keypair = crypto.generateKeyPairSync('ed25519', {
|
|
90
|
+
publicKeyEncoding: { type: 'spki', format: 'der' },
|
|
91
|
+
privateKeyEncoding: { type: 'pkcs8', format: 'der' }
|
|
92
|
+
});
|
|
93
|
+
this.publicKey = keypair.publicKey.toString('base64');
|
|
94
|
+
this.privateKey = keypair.privateKey.toString('base64');
|
|
95
|
+
}
|
|
96
|
+
// Step 1: Send hello message
|
|
97
|
+
const helloResponse = await this.connection.sendRequest({
|
|
98
|
+
jsonrpc: '2.0',
|
|
99
|
+
method: KadiProtocolMethod.HANDSHAKE,
|
|
100
|
+
params,
|
|
101
|
+
id: 1
|
|
102
|
+
});
|
|
103
|
+
// Step 2: Authenticate if required
|
|
104
|
+
let agentId = '';
|
|
105
|
+
if (helloResponse.requiredSteps.includes('authenticate') && helloResponse.nonce) {
|
|
106
|
+
agentId = await this.authenticate(helloResponse.nonce);
|
|
107
|
+
}
|
|
108
|
+
// Step 3: Return handshake result
|
|
109
|
+
const requiresRegistration = helloResponse.requiredSteps.includes('register_capabilities');
|
|
110
|
+
return {
|
|
111
|
+
agentId,
|
|
112
|
+
requiresRegistration
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Authenticate with broker using Ed25519 signature
|
|
117
|
+
*
|
|
118
|
+
* @param nonce - Challenge nonce from broker
|
|
119
|
+
* @returns Assigned agent ID
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
122
|
+
async authenticate(nonce) {
|
|
123
|
+
if (!this.publicKey || !this.privateKey) {
|
|
124
|
+
throw new Error('Keypair not generated - handshake must be called first');
|
|
125
|
+
}
|
|
126
|
+
// Sign the nonce with private key
|
|
127
|
+
const privateKey = crypto.createPrivateKey({
|
|
128
|
+
key: Buffer.from(this.privateKey, 'base64'),
|
|
129
|
+
format: 'der',
|
|
130
|
+
type: 'pkcs8'
|
|
131
|
+
});
|
|
132
|
+
const signature = crypto.sign(null, Buffer.from(nonce, 'utf8'), privateKey);
|
|
133
|
+
const result = await this.connection.sendRequest({
|
|
134
|
+
jsonrpc: '2.0',
|
|
135
|
+
method: KadiProtocolMethod.AUTHENTICATE,
|
|
136
|
+
params: {
|
|
137
|
+
publicKey: this.publicKey,
|
|
138
|
+
signature: signature.toString('base64'),
|
|
139
|
+
nonce,
|
|
140
|
+
wantNewId: true
|
|
141
|
+
},
|
|
142
|
+
id: 2
|
|
143
|
+
});
|
|
144
|
+
// Store agent ID from authentication response
|
|
145
|
+
this.connection.agentId = result.agentId;
|
|
146
|
+
return result.agentId;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Start heartbeat to keep connection alive
|
|
150
|
+
*
|
|
151
|
+
* Sends periodic heartbeat messages to the broker.
|
|
152
|
+
*
|
|
153
|
+
* @param intervalMs - Heartbeat interval in milliseconds
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* protocol.startHeartbeat(30000); // Every 30 seconds
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
startHeartbeat(intervalMs) {
|
|
161
|
+
if (this.heartbeatTimer) {
|
|
162
|
+
clearInterval(this.heartbeatTimer);
|
|
163
|
+
}
|
|
164
|
+
this.heartbeatTimer = setInterval(() => {
|
|
165
|
+
this.sendHeartbeat().catch(error => {
|
|
166
|
+
console.error('Heartbeat failed:', error);
|
|
167
|
+
});
|
|
168
|
+
}, intervalMs);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Stop heartbeat
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* protocol.stopHeartbeat();
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
stopHeartbeat() {
|
|
179
|
+
if (this.heartbeatTimer) {
|
|
180
|
+
clearInterval(this.heartbeatTimer);
|
|
181
|
+
this.heartbeatTimer = null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Send a single heartbeat
|
|
186
|
+
*
|
|
187
|
+
* @returns Promise that resolves when heartbeat is acknowledged
|
|
188
|
+
*/
|
|
189
|
+
async sendHeartbeat() {
|
|
190
|
+
if (!this.connection.isConnected) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
await this.connection.sendRequest({
|
|
194
|
+
jsonrpc: '2.0',
|
|
195
|
+
method: KadiProtocolMethod.HEARTBEAT,
|
|
196
|
+
params: {
|
|
197
|
+
timestamp: Date.now(),
|
|
198
|
+
agentId: this.connection.agentId
|
|
199
|
+
},
|
|
200
|
+
id: `heartbeat_${Date.now()}`
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Register capabilities (tools) with the broker
|
|
205
|
+
*
|
|
206
|
+
* Tells the broker what tools this agent provides.
|
|
207
|
+
* Other agents can then discover and invoke these tools.
|
|
208
|
+
*
|
|
209
|
+
* @param params - Capability registration parameters
|
|
210
|
+
*
|
|
211
|
+
* @throws {KadiError} If registration fails
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript
|
|
215
|
+
* await protocol.registerCapabilities({
|
|
216
|
+
* tools: [
|
|
217
|
+
* {
|
|
218
|
+
* name: 'calculate',
|
|
219
|
+
* description: 'Perform calculations',
|
|
220
|
+
* inputSchema: { type: 'object', ... },
|
|
221
|
+
* outputSchema: { type: 'object', ... }
|
|
222
|
+
* }
|
|
223
|
+
* ],
|
|
224
|
+
* networks: ['global']
|
|
225
|
+
* });
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
async registerCapabilities(params) {
|
|
229
|
+
await this.connection.sendRequest({
|
|
230
|
+
jsonrpc: '2.0',
|
|
231
|
+
method: KadiProtocolMethod.REGISTER_CAPABILITIES,
|
|
232
|
+
params: {
|
|
233
|
+
...params,
|
|
234
|
+
agentId: this.connection.agentId
|
|
235
|
+
},
|
|
236
|
+
id: `register_${Date.now()}`
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Unregister capabilities from the broker
|
|
241
|
+
*
|
|
242
|
+
* @param toolNames - Names of tools to unregister (empty = unregister all)
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```typescript
|
|
246
|
+
* // Unregister specific tools
|
|
247
|
+
* await protocol.unregisterCapabilities(['old-tool']);
|
|
248
|
+
*
|
|
249
|
+
* // Unregister all
|
|
250
|
+
* await protocol.unregisterCapabilities([]);
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
async unregisterCapabilities(_toolNames = []) {
|
|
254
|
+
// TODO: Broker doesn't support unregister yet
|
|
255
|
+
// Tools are automatically unregistered on disconnect
|
|
256
|
+
console.warn('unregisterCapabilities not yet implemented in broker');
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Discover agents on the network
|
|
260
|
+
*
|
|
261
|
+
* NOTE: Broker returns all tools with providers, we transform to agent-centric view client-side.
|
|
262
|
+
* Future enhancement: Add broker support for agent filtering to reduce network overhead.
|
|
263
|
+
*
|
|
264
|
+
* @param networks - Networks to search in
|
|
265
|
+
* @returns Array of discovered agents
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const agents = await protocol.discoverAgents(['global']);
|
|
270
|
+
* console.log('Found agents:', agents);
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
async discoverAgents(networks) {
|
|
274
|
+
const result = await this.connection.sendRequest({
|
|
275
|
+
jsonrpc: '2.0',
|
|
276
|
+
method: KadiProtocolMethod.LIST_TOOLS,
|
|
277
|
+
params: { networks, includeProviders: true },
|
|
278
|
+
id: `discover_${Date.now()}`
|
|
279
|
+
});
|
|
280
|
+
// Transform tools with providers into agent-centric view (client-side filtering)
|
|
281
|
+
const agentMap = new Map();
|
|
282
|
+
for (const tool of result.tools) {
|
|
283
|
+
if (tool.providers) {
|
|
284
|
+
for (const provider of tool.providers) {
|
|
285
|
+
const agentName = provider.displayName || provider.agentId;
|
|
286
|
+
if (!agentMap.has(agentName)) {
|
|
287
|
+
agentMap.set(agentName, new Set());
|
|
288
|
+
}
|
|
289
|
+
agentMap.get(agentName).add(tool.name);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Convert map to array format
|
|
294
|
+
return Array.from(agentMap.entries()).map(([name, capabilities]) => ({
|
|
295
|
+
name,
|
|
296
|
+
capabilities: Array.from(capabilities)
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Query capabilities of a specific agent
|
|
301
|
+
*
|
|
302
|
+
* NOTE: Broker doesn't support filtering by agentName yet, so we filter client-side.
|
|
303
|
+
* Future enhancement: Add broker support for agent filtering.
|
|
304
|
+
*
|
|
305
|
+
* @param agentName - Name of the agent
|
|
306
|
+
* @param networks - Networks to search in
|
|
307
|
+
* @returns Array of tool definitions
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```typescript
|
|
311
|
+
* const capabilities = await protocol.queryCapabilities('calculator', ['global']);
|
|
312
|
+
* console.log('Calculator tools:', capabilities);
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
async queryCapabilities(agentName, networks) {
|
|
316
|
+
const result = await this.connection.sendRequest({
|
|
317
|
+
jsonrpc: '2.0',
|
|
318
|
+
method: KadiProtocolMethod.LIST_TOOLS,
|
|
319
|
+
params: {
|
|
320
|
+
networks,
|
|
321
|
+
includeProviders: true
|
|
322
|
+
},
|
|
323
|
+
id: `query_${Date.now()}`
|
|
324
|
+
});
|
|
325
|
+
// Filter tools by agent name (client-side filtering)
|
|
326
|
+
return result.tools.filter(tool => {
|
|
327
|
+
if (!tool.providers)
|
|
328
|
+
return false;
|
|
329
|
+
return tool.providers.some(provider => provider.displayName === agentName || provider.agentId === agentName);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Invoke a tool on a remote agent
|
|
334
|
+
*
|
|
335
|
+
* @template T - Result type
|
|
336
|
+
* @param params - Tool invocation parameters
|
|
337
|
+
* @returns Tool invocation result
|
|
338
|
+
*
|
|
339
|
+
* @throws {KadiError} If invocation fails
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```typescript
|
|
343
|
+
* const result = await protocol.invokeTool<{ result: number }>({
|
|
344
|
+
* targetAgent: 'calculator',
|
|
345
|
+
* toolName: 'add',
|
|
346
|
+
* toolInput: { a: 5, b: 3 },
|
|
347
|
+
* timeout: 30000
|
|
348
|
+
* });
|
|
349
|
+
*
|
|
350
|
+
* console.log('Result:', result.result); // 8
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
async invokeTool(params) {
|
|
354
|
+
const result = await this.connection.sendRequest({
|
|
355
|
+
jsonrpc: '2.0',
|
|
356
|
+
method: KadiProtocolMethod.TOOL_INVOKE,
|
|
357
|
+
params: {
|
|
358
|
+
...params,
|
|
359
|
+
fromAgent: this.connection.agentId
|
|
360
|
+
},
|
|
361
|
+
id: params.requestId ?? `invoke_${Date.now()}`
|
|
362
|
+
});
|
|
363
|
+
return result;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Subscribe to events on specific channels
|
|
367
|
+
*
|
|
368
|
+
* NOTE: Currently subscribes to first channel only - broker supports one pattern per subscription.
|
|
369
|
+
* For multiple patterns, call this method multiple times.
|
|
370
|
+
*
|
|
371
|
+
* @param params - Event subscription parameters
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* await protocol.subscribeToEvents({
|
|
376
|
+
* channels: ['user.*'],
|
|
377
|
+
* networkId: 'global'
|
|
378
|
+
* });
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
async subscribeToEvents(params) {
|
|
382
|
+
// KADI broker expects { pattern: string }, not { channels: string[] }
|
|
383
|
+
// Extract first channel and send as pattern
|
|
384
|
+
const pattern = params.channels[0];
|
|
385
|
+
if (!pattern) {
|
|
386
|
+
throw new Error('At least one channel pattern is required for subscription');
|
|
387
|
+
}
|
|
388
|
+
await this.connection.sendRequest({
|
|
389
|
+
jsonrpc: '2.0',
|
|
390
|
+
method: KadiProtocolMethod.EVENT_SUBSCRIBE,
|
|
391
|
+
params: {
|
|
392
|
+
pattern // KADI protocol format
|
|
393
|
+
},
|
|
394
|
+
id: `subscribe_${Date.now()}`
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Unsubscribe from event channels
|
|
399
|
+
*
|
|
400
|
+
* NOTE: Currently unsubscribes from first channel only - broker supports one pattern per unsubscribe.
|
|
401
|
+
* For multiple patterns, call this method multiple times.
|
|
402
|
+
*
|
|
403
|
+
* @param params - Event unsubscribe parameters
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* await protocol.unsubscribeFromEvents({
|
|
408
|
+
* channels: ['user.*'],
|
|
409
|
+
* networkId: 'global'
|
|
410
|
+
* });
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
async unsubscribeFromEvents(params) {
|
|
414
|
+
// KADI broker expects { pattern: string }, not { channels: string[] }
|
|
415
|
+
// Extract first channel and send as pattern
|
|
416
|
+
const pattern = params.channels[0];
|
|
417
|
+
if (!pattern) {
|
|
418
|
+
throw new Error('At least one channel pattern is required for unsubscription');
|
|
419
|
+
}
|
|
420
|
+
await this.connection.sendRequest({
|
|
421
|
+
jsonrpc: '2.0',
|
|
422
|
+
method: KadiProtocolMethod.EVENT_UNSUBSCRIBE,
|
|
423
|
+
params: {
|
|
424
|
+
pattern // KADI protocol format
|
|
425
|
+
},
|
|
426
|
+
id: `unsubscribe_${Date.now()}`
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Publish an event to a channel
|
|
431
|
+
*
|
|
432
|
+
* @param params - Event publish parameters
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* await protocol.publishEvent({
|
|
437
|
+
* channel: 'user.login',
|
|
438
|
+
* data: { userId: '123', timestamp: Date.now() },
|
|
439
|
+
* networkId: 'global',
|
|
440
|
+
* hints: { latestOnly: true }
|
|
441
|
+
* });
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
async publishEvent(params) {
|
|
445
|
+
this.connection.sendNotification({
|
|
446
|
+
jsonrpc: '2.0',
|
|
447
|
+
method: KadiProtocolMethod.EVENT_PUBLISH,
|
|
448
|
+
params: {
|
|
449
|
+
...params,
|
|
450
|
+
fromAgent: this.connection.agentId
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Cleanup protocol resources
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* ```typescript
|
|
459
|
+
* protocol.cleanup();
|
|
460
|
+
* ```
|
|
461
|
+
*/
|
|
462
|
+
cleanup() {
|
|
463
|
+
this.stopHeartbeat();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
//# sourceMappingURL=BrokerProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrokerProtocol.js","sourceRoot":"","sources":["../../src/broker/BrokerProtocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAUtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACc,UAAU,CAAmB;IAE9C;;OAEG;IACK,cAAc,GAA0B,IAAI,CAAC;IAErD;;OAEG;IACK,SAAS,CAAU;IACnB,UAAU,CAAU;IAE5B;;;;OAIG;IACH,YAAY,UAA4B;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,SAAS,CAAC,MAAuB;QACrC,kEAAkE;QAClE,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACzD,MAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,EA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,OAAO,CAAE,uBAAuB;aACjC;YACD,EAAE,EAAE,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE;SAC9B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,qBAAqB,CAAC,MAA4B;QACtD,sEAAsE;QACtE,4CAA4C;QAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAChC,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,kBAAkB,CAAC,iBAAiB;YAC5C,MAAM,EAAE;gBACN,OAAO,CAAE,uBAAuB;aACjC;YACD,EAAE,EAAE,eAAe,IAAI,CAAC,GAAG,EAAE,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;YAC/B,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,kBAAkB,CAAC,aAAa;YACxC,MAAM,EAAE;gBACN,GAAG,MAAM;gBACT,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,OAAO;QACL,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broker Module
|
|
3
|
+
*
|
|
4
|
+
* Exports for broker connection and protocol management.
|
|
5
|
+
*/
|
|
6
|
+
export { BrokerConnection } from './BrokerConnection.js';
|
|
7
|
+
export { BrokerConnectionManager } from './BrokerConnectionManager.js';
|
|
8
|
+
export { BrokerProtocol, PROTOCOL_VERSION } from './BrokerProtocol.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/broker/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broker Module
|
|
3
|
+
*
|
|
4
|
+
* Exports for broker connection and protocol management.
|
|
5
|
+
*/
|
|
6
|
+
export { BrokerConnection } from './BrokerConnection.js';
|
|
7
|
+
export { BrokerConnectionManager } from './BrokerConnectionManager.js';
|
|
8
|
+
export { BrokerProtocol, PROTOCOL_VERSION } from './BrokerProtocol.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/broker/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|