@kadi.build/core 0.0.1-alpha.6 → 0.0.1-alpha.7

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.
@@ -13,157 +13,879 @@
13
13
  * 6000-6999: Configuration errors
14
14
  * 7000-7999: System/Internal errors
15
15
  */
16
+ export declare const CoreErrorCodes: {
17
+ readonly CORE_CONNECTION_FAILED: {
18
+ readonly code: "CORE_CONNECTION_FAILED";
19
+ readonly httpStatus: 503;
20
+ readonly message: "Failed to establish connection";
21
+ };
22
+ readonly CORE_CONNECTION_TIMEOUT: {
23
+ readonly code: "CORE_CONNECTION_TIMEOUT";
24
+ readonly httpStatus: 408;
25
+ readonly message: "Connection attempt timed out";
26
+ };
27
+ readonly CORE_CONNECTION_REFUSED: {
28
+ readonly code: "CORE_CONNECTION_REFUSED";
29
+ readonly httpStatus: 503;
30
+ readonly message: "Connection refused by remote server";
31
+ };
32
+ readonly CORE_BROKER_UNAVAILABLE: {
33
+ readonly code: "CORE_BROKER_UNAVAILABLE";
34
+ readonly httpStatus: 503;
35
+ readonly message: "Broker service is unavailable";
36
+ };
37
+ readonly CORE_BROKER_CONNECTION_LOST: {
38
+ readonly code: "CORE_BROKER_CONNECTION_LOST";
39
+ readonly httpStatus: 503;
40
+ readonly message: "Connection to broker was lost";
41
+ };
42
+ readonly CORE_AUTH_FAILED: {
43
+ readonly code: "CORE_AUTH_FAILED";
44
+ readonly httpStatus: 401;
45
+ readonly message: "Authentication failed";
46
+ };
47
+ readonly CORE_AUTH_HANDSHAKE_FAILED: {
48
+ readonly code: "CORE_AUTH_HANDSHAKE_FAILED";
49
+ readonly httpStatus: 400;
50
+ readonly message: "Authentication handshake failed";
51
+ };
52
+ readonly CORE_AUTH_TOKEN_INVALID: {
53
+ readonly code: "CORE_AUTH_TOKEN_INVALID";
54
+ readonly httpStatus: 401;
55
+ readonly message: "Invalid authentication token";
56
+ };
57
+ readonly CORE_ABILITY_NOT_FOUND: {
58
+ readonly code: "CORE_ABILITY_NOT_FOUND";
59
+ readonly httpStatus: 404;
60
+ readonly message: "Requested ability does not exist";
61
+ };
62
+ readonly CORE_ABILITY_LOAD_FAILED: {
63
+ readonly code: "CORE_ABILITY_LOAD_FAILED";
64
+ readonly httpStatus: 500;
65
+ readonly message: "Failed to load ability";
66
+ };
67
+ readonly CORE_ABILITY_NOT_ACCESSIBLE: {
68
+ readonly code: "CORE_ABILITY_NOT_ACCESSIBLE";
69
+ readonly httpStatus: 403;
70
+ readonly message: "Ability not accessible in current context";
71
+ };
72
+ readonly CORE_ABILITY_START_FAILED: {
73
+ readonly code: "CORE_ABILITY_START_FAILED";
74
+ readonly httpStatus: 500;
75
+ readonly message: "Failed to start ability process";
76
+ };
77
+ readonly CORE_ABILITY_TIMEOUT: {
78
+ readonly code: "CORE_ABILITY_TIMEOUT";
79
+ readonly httpStatus: 408;
80
+ readonly message: "Ability operation timed out";
81
+ };
82
+ readonly CORE_ABILITY_PATH_INVALID: {
83
+ readonly code: "CORE_ABILITY_PATH_INVALID";
84
+ readonly httpStatus: 400;
85
+ readonly message: "Invalid ability path or name format";
86
+ };
87
+ readonly CORE_ABILITY_MANIFEST_INVALID: {
88
+ readonly code: "CORE_ABILITY_MANIFEST_INVALID";
89
+ readonly httpStatus: 400;
90
+ readonly message: "Ability manifest file is invalid or missing";
91
+ };
92
+ readonly CORE_TOOL_NOT_FOUND: {
93
+ readonly code: "CORE_TOOL_NOT_FOUND";
94
+ readonly httpStatus: 404;
95
+ readonly message: "Requested tool does not exist";
96
+ };
97
+ readonly CORE_TOOL_INVOCATION_FAILED: {
98
+ readonly code: "CORE_TOOL_INVOCATION_FAILED";
99
+ readonly httpStatus: 500;
100
+ readonly message: "Tool invocation failed";
101
+ };
102
+ readonly CORE_TOOL_TIMEOUT: {
103
+ readonly code: "CORE_TOOL_TIMEOUT";
104
+ readonly httpStatus: 408;
105
+ readonly message: "Tool execution timed out";
106
+ };
107
+ readonly CORE_TOOL_INPUT_INVALID: {
108
+ readonly code: "CORE_TOOL_INPUT_INVALID";
109
+ readonly httpStatus: 400;
110
+ readonly message: "Tool input validation failed";
111
+ };
112
+ readonly CORE_PROTOCOL_UNSUPPORTED: {
113
+ readonly code: "CORE_PROTOCOL_UNSUPPORTED";
114
+ readonly httpStatus: 400;
115
+ readonly message: "Protocol not supported";
116
+ };
117
+ readonly CORE_PROTOCOL_VERSION_MISMATCH: {
118
+ readonly code: "CORE_PROTOCOL_VERSION_MISMATCH";
119
+ readonly httpStatus: 400;
120
+ readonly message: "Protocol version mismatch";
121
+ };
122
+ readonly CORE_MESSAGE_INVALID: {
123
+ readonly code: "CORE_MESSAGE_INVALID";
124
+ readonly httpStatus: 400;
125
+ readonly message: "Invalid message format";
126
+ };
127
+ readonly CORE_RPC_REQUEST_FAILED: {
128
+ readonly code: "CORE_RPC_REQUEST_FAILED";
129
+ readonly httpStatus: 500;
130
+ readonly message: "RPC request failed";
131
+ };
132
+ readonly CORE_CONFIG_INVALID: {
133
+ readonly code: "CORE_CONFIG_INVALID";
134
+ readonly httpStatus: 400;
135
+ readonly message: "Invalid configuration";
136
+ };
137
+ readonly CORE_CONFIG_MISSING: {
138
+ readonly code: "CORE_CONFIG_MISSING";
139
+ readonly httpStatus: 400;
140
+ readonly message: "Required configuration missing";
141
+ };
142
+ readonly CORE_CONFIG_PATH_INVALID: {
143
+ readonly code: "CORE_CONFIG_PATH_INVALID";
144
+ readonly httpStatus: 400;
145
+ readonly message: "Invalid configuration file path";
146
+ };
147
+ readonly CORE_INTERNAL_ERROR: {
148
+ readonly code: "CORE_INTERNAL_ERROR";
149
+ readonly httpStatus: 500;
150
+ readonly message: "An internal error occurred";
151
+ };
152
+ readonly CORE_NOT_IMPLEMENTED: {
153
+ readonly code: "CORE_NOT_IMPLEMENTED";
154
+ readonly httpStatus: 501;
155
+ readonly message: "Feature not yet implemented";
156
+ };
157
+ readonly CORE_SYSTEM_OVERLOADED: {
158
+ readonly code: "CORE_SYSTEM_OVERLOADED";
159
+ readonly httpStatus: 503;
160
+ readonly message: "System is currently overloaded";
161
+ };
162
+ };
163
+ export declare const BrokerErrorCodes: {
164
+ readonly BROKER_SESSION_NOT_INITIALIZED: {
165
+ readonly code: "BROKER_SESSION_NOT_INITIALIZED";
166
+ readonly httpStatus: 400;
167
+ readonly message: "Session not initialized";
168
+ };
169
+ readonly BROKER_SESSION_ALREADY_INITIALIZED: {
170
+ readonly code: "BROKER_SESSION_ALREADY_INITIALIZED";
171
+ readonly httpStatus: 409;
172
+ readonly message: "Session already initialized";
173
+ };
174
+ readonly BROKER_SESSION_INVALID_STATE: {
175
+ readonly code: "BROKER_SESSION_INVALID_STATE";
176
+ readonly httpStatus: 400;
177
+ readonly message: "Invalid session state";
178
+ };
179
+ readonly BROKER_SESSION_HANDSHAKE_FAILED: {
180
+ readonly code: "BROKER_SESSION_HANDSHAKE_FAILED";
181
+ readonly httpStatus: 400;
182
+ readonly message: "Handshake failed";
183
+ };
184
+ readonly BROKER_SESSION_NOT_FOUND: {
185
+ readonly code: "BROKER_SESSION_NOT_FOUND";
186
+ readonly httpStatus: 404;
187
+ readonly message: "Session not found";
188
+ };
189
+ readonly BROKER_SESSION_TIMEOUT: {
190
+ readonly code: "BROKER_SESSION_TIMEOUT";
191
+ readonly httpStatus: 408;
192
+ readonly message: "Session timeout";
193
+ };
194
+ readonly BROKER_SESSION_ROLE_INVALID: {
195
+ readonly code: "BROKER_SESSION_ROLE_INVALID";
196
+ readonly httpStatus: 400;
197
+ readonly message: "Invalid session role";
198
+ };
199
+ readonly BROKER_SESSION_KADI_HANDLER_FAILED: {
200
+ readonly code: "BROKER_SESSION_KADI_HANDLER_FAILED";
201
+ readonly httpStatus: 500;
202
+ readonly message: "KADI handler failed";
203
+ };
204
+ readonly BROKER_SESSION_RATE_LIMITED: {
205
+ readonly code: "BROKER_SESSION_RATE_LIMITED";
206
+ readonly httpStatus: 429;
207
+ readonly message: "Session rate limited";
208
+ };
209
+ readonly BROKER_SESSION_NOT_READY: {
210
+ readonly code: "BROKER_SESSION_NOT_READY";
211
+ readonly httpStatus: 400;
212
+ readonly message: "Session not ready";
213
+ };
214
+ readonly BROKER_AUTH_MISSING_CREDENTIALS: {
215
+ readonly code: "BROKER_AUTH_MISSING_CREDENTIALS";
216
+ readonly httpStatus: 401;
217
+ readonly message: "Missing credentials";
218
+ };
219
+ readonly BROKER_AUTH_SIGNATURE_INVALID: {
220
+ readonly code: "BROKER_AUTH_SIGNATURE_INVALID";
221
+ readonly httpStatus: 401;
222
+ readonly message: "Invalid signature";
223
+ };
224
+ readonly BROKER_AUTH_PUBLIC_KEY_INVALID: {
225
+ readonly code: "BROKER_AUTH_PUBLIC_KEY_INVALID";
226
+ readonly httpStatus: 401;
227
+ readonly message: "Invalid public key";
228
+ };
229
+ readonly BROKER_AUTH_NONCE_MISMATCH: {
230
+ readonly code: "BROKER_AUTH_NONCE_MISMATCH";
231
+ readonly httpStatus: 401;
232
+ readonly message: "Nonce mismatch";
233
+ };
234
+ readonly BROKER_AUTH_AGENT_UNKNOWN: {
235
+ readonly code: "BROKER_AUTH_AGENT_UNKNOWN";
236
+ readonly httpStatus: 404;
237
+ readonly message: "Unknown agent";
238
+ };
239
+ readonly BROKER_AUTH_SEQUENCE_ERROR: {
240
+ readonly code: "BROKER_AUTH_SEQUENCE_ERROR";
241
+ readonly httpStatus: 400;
242
+ readonly message: "Auth sequence error";
243
+ };
244
+ readonly BROKER_AGENT_NOT_AUTHENTICATED: {
245
+ readonly code: "BROKER_AGENT_NOT_AUTHENTICATED";
246
+ readonly httpStatus: 401;
247
+ readonly message: "Agent not authenticated";
248
+ };
249
+ readonly BROKER_AGENT_NETWORKS_MISSING: {
250
+ readonly code: "BROKER_AGENT_NETWORKS_MISSING";
251
+ readonly httpStatus: 400;
252
+ readonly message: "Networks required";
253
+ };
254
+ readonly BROKER_AGENT_NETWORKS_EMPTY: {
255
+ readonly code: "BROKER_AGENT_NETWORKS_EMPTY";
256
+ readonly httpStatus: 400;
257
+ readonly message: "No networks specified";
258
+ };
259
+ readonly BROKER_AGENT_ALREADY_REGISTERED: {
260
+ readonly code: "BROKER_AGENT_ALREADY_REGISTERED";
261
+ readonly httpStatus: 409;
262
+ readonly message: "Agent already registered";
263
+ };
264
+ readonly BROKER_AGENT_NOT_FOUND: {
265
+ readonly code: "BROKER_AGENT_NOT_FOUND";
266
+ readonly httpStatus: 404;
267
+ readonly message: "Agent not found";
268
+ };
269
+ readonly BROKER_AGENT_ID_NOT_SET: {
270
+ readonly code: "BROKER_AGENT_ID_NOT_SET";
271
+ readonly httpStatus: 400;
272
+ readonly message: "Agent ID required";
273
+ };
274
+ readonly BROKER_AGENT_METADATA_NOT_FOUND: {
275
+ readonly code: "BROKER_AGENT_METADATA_NOT_FOUND";
276
+ readonly httpStatus: 404;
277
+ readonly message: "Agent metadata not found";
278
+ };
279
+ readonly BROKER_NETWORK_NOT_FOUND: {
280
+ readonly code: "BROKER_NETWORK_NOT_FOUND";
281
+ readonly httpStatus: 404;
282
+ readonly message: "Network not found";
283
+ };
284
+ readonly BROKER_NETWORK_ACCESS_DENIED: {
285
+ readonly code: "BROKER_NETWORK_ACCESS_DENIED";
286
+ readonly httpStatus: 403;
287
+ readonly message: "Network access denied";
288
+ };
289
+ readonly BROKER_NETWORK_PUBLISH_DENIED: {
290
+ readonly code: "BROKER_NETWORK_PUBLISH_DENIED";
291
+ readonly httpStatus: 403;
292
+ readonly message: "Publish denied for network";
293
+ };
294
+ readonly BROKER_QUEUE_CONNECTION_FAILED: {
295
+ readonly code: "BROKER_QUEUE_CONNECTION_FAILED";
296
+ readonly httpStatus: 503;
297
+ readonly message: "Failed to connect to message queue";
298
+ };
299
+ readonly BROKER_QUEUE_PUBLISH_FAILED: {
300
+ readonly code: "BROKER_QUEUE_PUBLISH_FAILED";
301
+ readonly httpStatus: 503;
302
+ readonly message: "Failed to publish message to queue";
303
+ };
304
+ readonly BROKER_QUEUE_SUBSCRIBE_FAILED: {
305
+ readonly code: "BROKER_QUEUE_SUBSCRIBE_FAILED";
306
+ readonly httpStatus: 503;
307
+ readonly message: "Failed to subscribe to queue";
308
+ };
309
+ readonly BROKER_QUEUE_NOT_FOUND: {
310
+ readonly code: "BROKER_QUEUE_NOT_FOUND";
311
+ readonly httpStatus: 404;
312
+ readonly message: "Message queue does not exist";
313
+ };
314
+ readonly BROKER_SCHEMA_COMPILATION_ERROR: {
315
+ readonly code: "BROKER_SCHEMA_COMPILATION_ERROR";
316
+ readonly httpStatus: 400;
317
+ readonly message: "Failed to compile JSON Schema";
318
+ };
319
+ readonly BROKER_PROTOCOL_VERSION_UNSUPPORTED: {
320
+ readonly code: "BROKER_PROTOCOL_VERSION_UNSUPPORTED";
321
+ readonly httpStatus: 400;
322
+ readonly message: "Protocol version not supported";
323
+ };
324
+ readonly BROKER_PROTOCOL_METHOD_UNKNOWN: {
325
+ readonly code: "BROKER_PROTOCOL_METHOD_UNKNOWN";
326
+ readonly httpStatus: 400;
327
+ readonly message: "Unknown protocol method";
328
+ };
329
+ readonly BROKER_PROTOCOL_INVALID_MESSAGE: {
330
+ readonly code: "BROKER_PROTOCOL_INVALID_MESSAGE";
331
+ readonly httpStatus: 400;
332
+ readonly message: "Invalid message format";
333
+ };
334
+ readonly BROKER_PROTOCOL_MISSING_PARAMS: {
335
+ readonly code: "BROKER_PROTOCOL_MISSING_PARAMS";
336
+ readonly httpStatus: 400;
337
+ readonly message: "Required parameters missing";
338
+ };
339
+ readonly BROKER_MCP_ALREADY_INITIALIZED: {
340
+ readonly code: "BROKER_MCP_ALREADY_INITIALIZED";
341
+ readonly httpStatus: 409;
342
+ readonly message: "MCP bridge is already initialized";
343
+ };
344
+ readonly BROKER_MCP_NOT_INITIALIZED: {
345
+ readonly code: "BROKER_MCP_NOT_INITIALIZED";
346
+ readonly httpStatus: 400;
347
+ readonly message: "MCP bridge must be initialized first";
348
+ };
349
+ readonly BROKER_MCP_METHOD_UNKNOWN: {
350
+ readonly code: "BROKER_MCP_METHOD_UNKNOWN";
351
+ readonly httpStatus: 400;
352
+ readonly message: "Unknown MCP method";
353
+ };
354
+ readonly BROKER_MCP_CLIENT_NOT_READY: {
355
+ readonly code: "BROKER_MCP_CLIENT_NOT_READY";
356
+ readonly httpStatus: 400;
357
+ readonly message: "MCP client not ready - must initialize first";
358
+ };
359
+ readonly BROKER_MCP_HANDLER_FAILED: {
360
+ readonly code: "BROKER_MCP_HANDLER_FAILED";
361
+ readonly httpStatus: 500;
362
+ readonly message: "MCP message handler failed";
363
+ };
364
+ readonly BROKER_NAMESPACE_INVALID_FORMAT: {
365
+ readonly code: "BROKER_NAMESPACE_INVALID_FORMAT";
366
+ readonly httpStatus: 400;
367
+ readonly message: "Invalid namespace format";
368
+ };
369
+ readonly BROKER_NAMESPACE_RESERVED: {
370
+ readonly code: "BROKER_NAMESPACE_RESERVED";
371
+ readonly httpStatus: 400;
372
+ readonly message: "Namespace is reserved and cannot be used";
373
+ };
374
+ readonly BROKER_NAMESPACE_VERSION_INVALID: {
375
+ readonly code: "BROKER_NAMESPACE_VERSION_INVALID";
376
+ readonly httpStatus: 400;
377
+ readonly message: "Invalid namespace version format";
378
+ };
379
+ readonly BROKER_TOOL_KEY_INVALID: {
380
+ readonly code: "BROKER_TOOL_KEY_INVALID";
381
+ readonly httpStatus: 400;
382
+ readonly message: "Invalid tool key format";
383
+ };
384
+ readonly BROKER_EVENT_SUBSCRIPTION_INVALID: {
385
+ readonly code: "BROKER_EVENT_SUBSCRIPTION_INVALID";
386
+ readonly httpStatus: 400;
387
+ readonly message: "Invalid event subscription parameters";
388
+ };
389
+ readonly BROKER_EVENT_SUBSCRIPTION_FAILED: {
390
+ readonly code: "BROKER_EVENT_SUBSCRIPTION_FAILED";
391
+ readonly httpStatus: 500;
392
+ readonly message: "Failed to establish event subscription";
393
+ };
394
+ readonly BROKER_EVENT_PUBLISH_INVALID: {
395
+ readonly code: "BROKER_EVENT_PUBLISH_INVALID";
396
+ readonly httpStatus: 400;
397
+ readonly message: "Invalid event publish parameters";
398
+ };
399
+ readonly BROKER_EVENT_PUBLISH_FAILED: {
400
+ readonly code: "BROKER_EVENT_PUBLISH_FAILED";
401
+ readonly httpStatus: 500;
402
+ readonly message: "Failed to publish event";
403
+ };
404
+ readonly BROKER_EVENT_DELIVERY_FAILED: {
405
+ readonly code: "BROKER_EVENT_DELIVERY_FAILED";
406
+ readonly httpStatus: 500;
407
+ readonly message: "Failed to deliver event to subscriber";
408
+ };
409
+ readonly BROKER_EVENT_CHANNEL_INVALID: {
410
+ readonly code: "BROKER_EVENT_CHANNEL_INVALID";
411
+ readonly httpStatus: 400;
412
+ readonly message: "Invalid event channel format";
413
+ };
414
+ readonly BROKER_EVENT_NETWORK_ACCESS_DENIED: {
415
+ readonly code: "BROKER_EVENT_NETWORK_ACCESS_DENIED";
416
+ readonly httpStatus: 403;
417
+ readonly message: "Access denied to event network";
418
+ };
419
+ readonly BROKER_EVENT_QUEUE_ERROR: {
420
+ readonly code: "BROKER_EVENT_QUEUE_ERROR";
421
+ readonly httpStatus: 500;
422
+ readonly message: "Event queue operation failed";
423
+ };
424
+ readonly BROKER_EVENT_MESSAGE_INVALID: {
425
+ readonly code: "BROKER_EVENT_MESSAGE_INVALID";
426
+ readonly httpStatus: 400;
427
+ readonly message: "Invalid event message structure";
428
+ };
429
+ readonly BROKER_INVALID_INPUT: {
430
+ readonly code: "BROKER_INVALID_INPUT";
431
+ readonly httpStatus: 400;
432
+ readonly message: "Input validation failed against expected schema";
433
+ };
434
+ readonly BROKER_TOOL_NOT_IN_NETWORK: {
435
+ readonly code: "BROKER_TOOL_NOT_IN_NETWORK";
436
+ readonly httpStatus: 404;
437
+ readonly message: "Tool not available in accessible networks";
438
+ };
439
+ readonly BROKER_TOOL_NAME_REQUIRED: {
440
+ readonly code: "BROKER_TOOL_NAME_REQUIRED";
441
+ readonly httpStatus: 400;
442
+ readonly message: "Tool name is required for invocation";
443
+ };
444
+ readonly BROKER_TOOL_NO_PROVIDERS: {
445
+ readonly code: "BROKER_TOOL_NO_PROVIDERS";
446
+ readonly httpStatus: 503;
447
+ readonly message: "No active providers available for tool";
448
+ };
449
+ };
16
450
  export declare const ErrorCodes: {
17
- readonly CONNECTION_FAILED: {
18
- readonly code: "CONNECTION_FAILED";
451
+ readonly BROKER_SESSION_NOT_INITIALIZED: {
452
+ readonly code: "BROKER_SESSION_NOT_INITIALIZED";
453
+ readonly httpStatus: 400;
454
+ readonly message: "Session not initialized";
455
+ };
456
+ readonly BROKER_SESSION_ALREADY_INITIALIZED: {
457
+ readonly code: "BROKER_SESSION_ALREADY_INITIALIZED";
458
+ readonly httpStatus: 409;
459
+ readonly message: "Session already initialized";
460
+ };
461
+ readonly BROKER_SESSION_INVALID_STATE: {
462
+ readonly code: "BROKER_SESSION_INVALID_STATE";
463
+ readonly httpStatus: 400;
464
+ readonly message: "Invalid session state";
465
+ };
466
+ readonly BROKER_SESSION_HANDSHAKE_FAILED: {
467
+ readonly code: "BROKER_SESSION_HANDSHAKE_FAILED";
468
+ readonly httpStatus: 400;
469
+ readonly message: "Handshake failed";
470
+ };
471
+ readonly BROKER_SESSION_NOT_FOUND: {
472
+ readonly code: "BROKER_SESSION_NOT_FOUND";
473
+ readonly httpStatus: 404;
474
+ readonly message: "Session not found";
475
+ };
476
+ readonly BROKER_SESSION_TIMEOUT: {
477
+ readonly code: "BROKER_SESSION_TIMEOUT";
478
+ readonly httpStatus: 408;
479
+ readonly message: "Session timeout";
480
+ };
481
+ readonly BROKER_SESSION_ROLE_INVALID: {
482
+ readonly code: "BROKER_SESSION_ROLE_INVALID";
483
+ readonly httpStatus: 400;
484
+ readonly message: "Invalid session role";
485
+ };
486
+ readonly BROKER_SESSION_KADI_HANDLER_FAILED: {
487
+ readonly code: "BROKER_SESSION_KADI_HANDLER_FAILED";
488
+ readonly httpStatus: 500;
489
+ readonly message: "KADI handler failed";
490
+ };
491
+ readonly BROKER_SESSION_RATE_LIMITED: {
492
+ readonly code: "BROKER_SESSION_RATE_LIMITED";
493
+ readonly httpStatus: 429;
494
+ readonly message: "Session rate limited";
495
+ };
496
+ readonly BROKER_SESSION_NOT_READY: {
497
+ readonly code: "BROKER_SESSION_NOT_READY";
498
+ readonly httpStatus: 400;
499
+ readonly message: "Session not ready";
500
+ };
501
+ readonly BROKER_AUTH_MISSING_CREDENTIALS: {
502
+ readonly code: "BROKER_AUTH_MISSING_CREDENTIALS";
503
+ readonly httpStatus: 401;
504
+ readonly message: "Missing credentials";
505
+ };
506
+ readonly BROKER_AUTH_SIGNATURE_INVALID: {
507
+ readonly code: "BROKER_AUTH_SIGNATURE_INVALID";
508
+ readonly httpStatus: 401;
509
+ readonly message: "Invalid signature";
510
+ };
511
+ readonly BROKER_AUTH_PUBLIC_KEY_INVALID: {
512
+ readonly code: "BROKER_AUTH_PUBLIC_KEY_INVALID";
513
+ readonly httpStatus: 401;
514
+ readonly message: "Invalid public key";
515
+ };
516
+ readonly BROKER_AUTH_NONCE_MISMATCH: {
517
+ readonly code: "BROKER_AUTH_NONCE_MISMATCH";
518
+ readonly httpStatus: 401;
519
+ readonly message: "Nonce mismatch";
520
+ };
521
+ readonly BROKER_AUTH_AGENT_UNKNOWN: {
522
+ readonly code: "BROKER_AUTH_AGENT_UNKNOWN";
523
+ readonly httpStatus: 404;
524
+ readonly message: "Unknown agent";
525
+ };
526
+ readonly BROKER_AUTH_SEQUENCE_ERROR: {
527
+ readonly code: "BROKER_AUTH_SEQUENCE_ERROR";
528
+ readonly httpStatus: 400;
529
+ readonly message: "Auth sequence error";
530
+ };
531
+ readonly BROKER_AGENT_NOT_AUTHENTICATED: {
532
+ readonly code: "BROKER_AGENT_NOT_AUTHENTICATED";
533
+ readonly httpStatus: 401;
534
+ readonly message: "Agent not authenticated";
535
+ };
536
+ readonly BROKER_AGENT_NETWORKS_MISSING: {
537
+ readonly code: "BROKER_AGENT_NETWORKS_MISSING";
538
+ readonly httpStatus: 400;
539
+ readonly message: "Networks required";
540
+ };
541
+ readonly BROKER_AGENT_NETWORKS_EMPTY: {
542
+ readonly code: "BROKER_AGENT_NETWORKS_EMPTY";
543
+ readonly httpStatus: 400;
544
+ readonly message: "No networks specified";
545
+ };
546
+ readonly BROKER_AGENT_ALREADY_REGISTERED: {
547
+ readonly code: "BROKER_AGENT_ALREADY_REGISTERED";
548
+ readonly httpStatus: 409;
549
+ readonly message: "Agent already registered";
550
+ };
551
+ readonly BROKER_AGENT_NOT_FOUND: {
552
+ readonly code: "BROKER_AGENT_NOT_FOUND";
553
+ readonly httpStatus: 404;
554
+ readonly message: "Agent not found";
555
+ };
556
+ readonly BROKER_AGENT_ID_NOT_SET: {
557
+ readonly code: "BROKER_AGENT_ID_NOT_SET";
558
+ readonly httpStatus: 400;
559
+ readonly message: "Agent ID required";
560
+ };
561
+ readonly BROKER_AGENT_METADATA_NOT_FOUND: {
562
+ readonly code: "BROKER_AGENT_METADATA_NOT_FOUND";
563
+ readonly httpStatus: 404;
564
+ readonly message: "Agent metadata not found";
565
+ };
566
+ readonly BROKER_NETWORK_NOT_FOUND: {
567
+ readonly code: "BROKER_NETWORK_NOT_FOUND";
568
+ readonly httpStatus: 404;
569
+ readonly message: "Network not found";
570
+ };
571
+ readonly BROKER_NETWORK_ACCESS_DENIED: {
572
+ readonly code: "BROKER_NETWORK_ACCESS_DENIED";
573
+ readonly httpStatus: 403;
574
+ readonly message: "Network access denied";
575
+ };
576
+ readonly BROKER_NETWORK_PUBLISH_DENIED: {
577
+ readonly code: "BROKER_NETWORK_PUBLISH_DENIED";
578
+ readonly httpStatus: 403;
579
+ readonly message: "Publish denied for network";
580
+ };
581
+ readonly BROKER_QUEUE_CONNECTION_FAILED: {
582
+ readonly code: "BROKER_QUEUE_CONNECTION_FAILED";
583
+ readonly httpStatus: 503;
584
+ readonly message: "Failed to connect to message queue";
585
+ };
586
+ readonly BROKER_QUEUE_PUBLISH_FAILED: {
587
+ readonly code: "BROKER_QUEUE_PUBLISH_FAILED";
588
+ readonly httpStatus: 503;
589
+ readonly message: "Failed to publish message to queue";
590
+ };
591
+ readonly BROKER_QUEUE_SUBSCRIBE_FAILED: {
592
+ readonly code: "BROKER_QUEUE_SUBSCRIBE_FAILED";
593
+ readonly httpStatus: 503;
594
+ readonly message: "Failed to subscribe to queue";
595
+ };
596
+ readonly BROKER_QUEUE_NOT_FOUND: {
597
+ readonly code: "BROKER_QUEUE_NOT_FOUND";
598
+ readonly httpStatus: 404;
599
+ readonly message: "Message queue does not exist";
600
+ };
601
+ readonly BROKER_SCHEMA_COMPILATION_ERROR: {
602
+ readonly code: "BROKER_SCHEMA_COMPILATION_ERROR";
603
+ readonly httpStatus: 400;
604
+ readonly message: "Failed to compile JSON Schema";
605
+ };
606
+ readonly BROKER_PROTOCOL_VERSION_UNSUPPORTED: {
607
+ readonly code: "BROKER_PROTOCOL_VERSION_UNSUPPORTED";
608
+ readonly httpStatus: 400;
609
+ readonly message: "Protocol version not supported";
610
+ };
611
+ readonly BROKER_PROTOCOL_METHOD_UNKNOWN: {
612
+ readonly code: "BROKER_PROTOCOL_METHOD_UNKNOWN";
613
+ readonly httpStatus: 400;
614
+ readonly message: "Unknown protocol method";
615
+ };
616
+ readonly BROKER_PROTOCOL_INVALID_MESSAGE: {
617
+ readonly code: "BROKER_PROTOCOL_INVALID_MESSAGE";
618
+ readonly httpStatus: 400;
619
+ readonly message: "Invalid message format";
620
+ };
621
+ readonly BROKER_PROTOCOL_MISSING_PARAMS: {
622
+ readonly code: "BROKER_PROTOCOL_MISSING_PARAMS";
623
+ readonly httpStatus: 400;
624
+ readonly message: "Required parameters missing";
625
+ };
626
+ readonly BROKER_MCP_ALREADY_INITIALIZED: {
627
+ readonly code: "BROKER_MCP_ALREADY_INITIALIZED";
628
+ readonly httpStatus: 409;
629
+ readonly message: "MCP bridge is already initialized";
630
+ };
631
+ readonly BROKER_MCP_NOT_INITIALIZED: {
632
+ readonly code: "BROKER_MCP_NOT_INITIALIZED";
633
+ readonly httpStatus: 400;
634
+ readonly message: "MCP bridge must be initialized first";
635
+ };
636
+ readonly BROKER_MCP_METHOD_UNKNOWN: {
637
+ readonly code: "BROKER_MCP_METHOD_UNKNOWN";
638
+ readonly httpStatus: 400;
639
+ readonly message: "Unknown MCP method";
640
+ };
641
+ readonly BROKER_MCP_CLIENT_NOT_READY: {
642
+ readonly code: "BROKER_MCP_CLIENT_NOT_READY";
643
+ readonly httpStatus: 400;
644
+ readonly message: "MCP client not ready - must initialize first";
645
+ };
646
+ readonly BROKER_MCP_HANDLER_FAILED: {
647
+ readonly code: "BROKER_MCP_HANDLER_FAILED";
648
+ readonly httpStatus: 500;
649
+ readonly message: "MCP message handler failed";
650
+ };
651
+ readonly BROKER_NAMESPACE_INVALID_FORMAT: {
652
+ readonly code: "BROKER_NAMESPACE_INVALID_FORMAT";
653
+ readonly httpStatus: 400;
654
+ readonly message: "Invalid namespace format";
655
+ };
656
+ readonly BROKER_NAMESPACE_RESERVED: {
657
+ readonly code: "BROKER_NAMESPACE_RESERVED";
658
+ readonly httpStatus: 400;
659
+ readonly message: "Namespace is reserved and cannot be used";
660
+ };
661
+ readonly BROKER_NAMESPACE_VERSION_INVALID: {
662
+ readonly code: "BROKER_NAMESPACE_VERSION_INVALID";
663
+ readonly httpStatus: 400;
664
+ readonly message: "Invalid namespace version format";
665
+ };
666
+ readonly BROKER_TOOL_KEY_INVALID: {
667
+ readonly code: "BROKER_TOOL_KEY_INVALID";
668
+ readonly httpStatus: 400;
669
+ readonly message: "Invalid tool key format";
670
+ };
671
+ readonly BROKER_EVENT_SUBSCRIPTION_INVALID: {
672
+ readonly code: "BROKER_EVENT_SUBSCRIPTION_INVALID";
673
+ readonly httpStatus: 400;
674
+ readonly message: "Invalid event subscription parameters";
675
+ };
676
+ readonly BROKER_EVENT_SUBSCRIPTION_FAILED: {
677
+ readonly code: "BROKER_EVENT_SUBSCRIPTION_FAILED";
678
+ readonly httpStatus: 500;
679
+ readonly message: "Failed to establish event subscription";
680
+ };
681
+ readonly BROKER_EVENT_PUBLISH_INVALID: {
682
+ readonly code: "BROKER_EVENT_PUBLISH_INVALID";
683
+ readonly httpStatus: 400;
684
+ readonly message: "Invalid event publish parameters";
685
+ };
686
+ readonly BROKER_EVENT_PUBLISH_FAILED: {
687
+ readonly code: "BROKER_EVENT_PUBLISH_FAILED";
688
+ readonly httpStatus: 500;
689
+ readonly message: "Failed to publish event";
690
+ };
691
+ readonly BROKER_EVENT_DELIVERY_FAILED: {
692
+ readonly code: "BROKER_EVENT_DELIVERY_FAILED";
693
+ readonly httpStatus: 500;
694
+ readonly message: "Failed to deliver event to subscriber";
695
+ };
696
+ readonly BROKER_EVENT_CHANNEL_INVALID: {
697
+ readonly code: "BROKER_EVENT_CHANNEL_INVALID";
698
+ readonly httpStatus: 400;
699
+ readonly message: "Invalid event channel format";
700
+ };
701
+ readonly BROKER_EVENT_NETWORK_ACCESS_DENIED: {
702
+ readonly code: "BROKER_EVENT_NETWORK_ACCESS_DENIED";
703
+ readonly httpStatus: 403;
704
+ readonly message: "Access denied to event network";
705
+ };
706
+ readonly BROKER_EVENT_QUEUE_ERROR: {
707
+ readonly code: "BROKER_EVENT_QUEUE_ERROR";
708
+ readonly httpStatus: 500;
709
+ readonly message: "Event queue operation failed";
710
+ };
711
+ readonly BROKER_EVENT_MESSAGE_INVALID: {
712
+ readonly code: "BROKER_EVENT_MESSAGE_INVALID";
713
+ readonly httpStatus: 400;
714
+ readonly message: "Invalid event message structure";
715
+ };
716
+ readonly BROKER_INVALID_INPUT: {
717
+ readonly code: "BROKER_INVALID_INPUT";
718
+ readonly httpStatus: 400;
719
+ readonly message: "Input validation failed against expected schema";
720
+ };
721
+ readonly BROKER_TOOL_NOT_IN_NETWORK: {
722
+ readonly code: "BROKER_TOOL_NOT_IN_NETWORK";
723
+ readonly httpStatus: 404;
724
+ readonly message: "Tool not available in accessible networks";
725
+ };
726
+ readonly BROKER_TOOL_NAME_REQUIRED: {
727
+ readonly code: "BROKER_TOOL_NAME_REQUIRED";
728
+ readonly httpStatus: 400;
729
+ readonly message: "Tool name is required for invocation";
730
+ };
731
+ readonly BROKER_TOOL_NO_PROVIDERS: {
732
+ readonly code: "BROKER_TOOL_NO_PROVIDERS";
733
+ readonly httpStatus: 503;
734
+ readonly message: "No active providers available for tool";
735
+ };
736
+ readonly CORE_CONNECTION_FAILED: {
737
+ readonly code: "CORE_CONNECTION_FAILED";
19
738
  readonly httpStatus: 503;
20
739
  readonly message: "Failed to establish connection";
21
740
  };
22
- readonly CONNECTION_TIMEOUT: {
23
- readonly code: "CONNECTION_TIMEOUT";
741
+ readonly CORE_CONNECTION_TIMEOUT: {
742
+ readonly code: "CORE_CONNECTION_TIMEOUT";
24
743
  readonly httpStatus: 408;
25
744
  readonly message: "Connection attempt timed out";
26
745
  };
27
- readonly CONNECTION_REFUSED: {
28
- readonly code: "CONNECTION_REFUSED";
746
+ readonly CORE_CONNECTION_REFUSED: {
747
+ readonly code: "CORE_CONNECTION_REFUSED";
29
748
  readonly httpStatus: 503;
30
749
  readonly message: "Connection refused by remote server";
31
750
  };
32
- readonly BROKER_UNAVAILABLE: {
33
- readonly code: "BROKER_UNAVAILABLE";
751
+ readonly CORE_BROKER_UNAVAILABLE: {
752
+ readonly code: "CORE_BROKER_UNAVAILABLE";
34
753
  readonly httpStatus: 503;
35
754
  readonly message: "Broker service is unavailable";
36
755
  };
37
- readonly BROKER_CONNECTION_LOST: {
38
- readonly code: "BROKER_CONNECTION_LOST";
756
+ readonly CORE_BROKER_CONNECTION_LOST: {
757
+ readonly code: "CORE_BROKER_CONNECTION_LOST";
39
758
  readonly httpStatus: 503;
40
759
  readonly message: "Connection to broker was lost";
41
760
  };
42
- readonly AUTH_FAILED: {
43
- readonly code: "AUTH_FAILED";
761
+ readonly CORE_AUTH_FAILED: {
762
+ readonly code: "CORE_AUTH_FAILED";
44
763
  readonly httpStatus: 401;
45
764
  readonly message: "Authentication failed";
46
765
  };
47
- readonly AUTH_HANDSHAKE_FAILED: {
48
- readonly code: "AUTH_HANDSHAKE_FAILED";
766
+ readonly CORE_AUTH_HANDSHAKE_FAILED: {
767
+ readonly code: "CORE_AUTH_HANDSHAKE_FAILED";
49
768
  readonly httpStatus: 400;
50
769
  readonly message: "Authentication handshake failed";
51
770
  };
52
- readonly AUTH_TOKEN_INVALID: {
53
- readonly code: "AUTH_TOKEN_INVALID";
771
+ readonly CORE_AUTH_TOKEN_INVALID: {
772
+ readonly code: "CORE_AUTH_TOKEN_INVALID";
54
773
  readonly httpStatus: 401;
55
774
  readonly message: "Invalid authentication token";
56
775
  };
57
- readonly ABILITY_NOT_FOUND: {
58
- readonly code: "ABILITY_NOT_FOUND";
776
+ readonly CORE_ABILITY_NOT_FOUND: {
777
+ readonly code: "CORE_ABILITY_NOT_FOUND";
59
778
  readonly httpStatus: 404;
60
779
  readonly message: "Requested ability does not exist";
61
780
  };
62
- readonly ABILITY_LOAD_FAILED: {
63
- readonly code: "ABILITY_LOAD_FAILED";
781
+ readonly CORE_ABILITY_LOAD_FAILED: {
782
+ readonly code: "CORE_ABILITY_LOAD_FAILED";
64
783
  readonly httpStatus: 500;
65
784
  readonly message: "Failed to load ability";
66
785
  };
67
- readonly ABILITY_NOT_ACCESSIBLE: {
68
- readonly code: "ABILITY_NOT_ACCESSIBLE";
786
+ readonly CORE_ABILITY_NOT_ACCESSIBLE: {
787
+ readonly code: "CORE_ABILITY_NOT_ACCESSIBLE";
69
788
  readonly httpStatus: 403;
70
789
  readonly message: "Ability not accessible in current context";
71
790
  };
72
- readonly ABILITY_START_FAILED: {
73
- readonly code: "ABILITY_START_FAILED";
791
+ readonly CORE_ABILITY_START_FAILED: {
792
+ readonly code: "CORE_ABILITY_START_FAILED";
74
793
  readonly httpStatus: 500;
75
794
  readonly message: "Failed to start ability process";
76
795
  };
77
- readonly ABILITY_TIMEOUT: {
78
- readonly code: "ABILITY_TIMEOUT";
796
+ readonly CORE_ABILITY_TIMEOUT: {
797
+ readonly code: "CORE_ABILITY_TIMEOUT";
79
798
  readonly httpStatus: 408;
80
799
  readonly message: "Ability operation timed out";
81
800
  };
82
- readonly ABILITY_PATH_INVALID: {
83
- readonly code: "ABILITY_PATH_INVALID";
801
+ readonly CORE_ABILITY_PATH_INVALID: {
802
+ readonly code: "CORE_ABILITY_PATH_INVALID";
84
803
  readonly httpStatus: 400;
85
804
  readonly message: "Invalid ability path or name format";
86
805
  };
87
- readonly ABILITY_MANIFEST_INVALID: {
88
- readonly code: "ABILITY_MANIFEST_INVALID";
806
+ readonly CORE_ABILITY_MANIFEST_INVALID: {
807
+ readonly code: "CORE_ABILITY_MANIFEST_INVALID";
89
808
  readonly httpStatus: 400;
90
809
  readonly message: "Ability manifest file is invalid or missing";
91
810
  };
92
- readonly TOOL_NOT_FOUND: {
93
- readonly code: "TOOL_NOT_FOUND";
811
+ readonly CORE_TOOL_NOT_FOUND: {
812
+ readonly code: "CORE_TOOL_NOT_FOUND";
94
813
  readonly httpStatus: 404;
95
814
  readonly message: "Requested tool does not exist";
96
815
  };
97
- readonly TOOL_INVOCATION_FAILED: {
98
- readonly code: "TOOL_INVOCATION_FAILED";
816
+ readonly CORE_TOOL_INVOCATION_FAILED: {
817
+ readonly code: "CORE_TOOL_INVOCATION_FAILED";
99
818
  readonly httpStatus: 500;
100
819
  readonly message: "Tool invocation failed";
101
820
  };
102
- readonly TOOL_TIMEOUT: {
103
- readonly code: "TOOL_TIMEOUT";
821
+ readonly CORE_TOOL_TIMEOUT: {
822
+ readonly code: "CORE_TOOL_TIMEOUT";
104
823
  readonly httpStatus: 408;
105
824
  readonly message: "Tool execution timed out";
106
825
  };
107
- readonly TOOL_INPUT_INVALID: {
108
- readonly code: "TOOL_INPUT_INVALID";
826
+ readonly CORE_TOOL_INPUT_INVALID: {
827
+ readonly code: "CORE_TOOL_INPUT_INVALID";
109
828
  readonly httpStatus: 400;
110
829
  readonly message: "Tool input validation failed";
111
830
  };
112
- readonly PROTOCOL_UNSUPPORTED: {
113
- readonly code: "PROTOCOL_UNSUPPORTED";
831
+ readonly CORE_PROTOCOL_UNSUPPORTED: {
832
+ readonly code: "CORE_PROTOCOL_UNSUPPORTED";
114
833
  readonly httpStatus: 400;
115
834
  readonly message: "Protocol not supported";
116
835
  };
117
- readonly PROTOCOL_VERSION_MISMATCH: {
118
- readonly code: "PROTOCOL_VERSION_MISMATCH";
836
+ readonly CORE_PROTOCOL_VERSION_MISMATCH: {
837
+ readonly code: "CORE_PROTOCOL_VERSION_MISMATCH";
119
838
  readonly httpStatus: 400;
120
839
  readonly message: "Protocol version mismatch";
121
840
  };
122
- readonly MESSAGE_INVALID: {
123
- readonly code: "MESSAGE_INVALID";
841
+ readonly CORE_MESSAGE_INVALID: {
842
+ readonly code: "CORE_MESSAGE_INVALID";
124
843
  readonly httpStatus: 400;
125
844
  readonly message: "Invalid message format";
126
845
  };
127
- readonly RPC_REQUEST_FAILED: {
128
- readonly code: "RPC_REQUEST_FAILED";
846
+ readonly CORE_RPC_REQUEST_FAILED: {
847
+ readonly code: "CORE_RPC_REQUEST_FAILED";
129
848
  readonly httpStatus: 500;
130
849
  readonly message: "RPC request failed";
131
850
  };
132
- readonly CONFIG_INVALID: {
133
- readonly code: "CONFIG_INVALID";
851
+ readonly CORE_CONFIG_INVALID: {
852
+ readonly code: "CORE_CONFIG_INVALID";
134
853
  readonly httpStatus: 400;
135
854
  readonly message: "Invalid configuration";
136
855
  };
137
- readonly CONFIG_MISSING: {
138
- readonly code: "CONFIG_MISSING";
856
+ readonly CORE_CONFIG_MISSING: {
857
+ readonly code: "CORE_CONFIG_MISSING";
139
858
  readonly httpStatus: 400;
140
859
  readonly message: "Required configuration missing";
141
860
  };
142
- readonly CONFIG_PATH_INVALID: {
143
- readonly code: "CONFIG_PATH_INVALID";
861
+ readonly CORE_CONFIG_PATH_INVALID: {
862
+ readonly code: "CORE_CONFIG_PATH_INVALID";
144
863
  readonly httpStatus: 400;
145
864
  readonly message: "Invalid configuration file path";
146
865
  };
147
- readonly INTERNAL_ERROR: {
148
- readonly code: "INTERNAL_ERROR";
866
+ readonly CORE_INTERNAL_ERROR: {
867
+ readonly code: "CORE_INTERNAL_ERROR";
149
868
  readonly httpStatus: 500;
150
869
  readonly message: "An internal error occurred";
151
870
  };
152
- readonly NOT_IMPLEMENTED: {
153
- readonly code: "NOT_IMPLEMENTED";
871
+ readonly CORE_NOT_IMPLEMENTED: {
872
+ readonly code: "CORE_NOT_IMPLEMENTED";
154
873
  readonly httpStatus: 501;
155
874
  readonly message: "Feature not yet implemented";
156
875
  };
157
- readonly SYSTEM_OVERLOADED: {
158
- readonly code: "SYSTEM_OVERLOADED";
876
+ readonly CORE_SYSTEM_OVERLOADED: {
877
+ readonly code: "CORE_SYSTEM_OVERLOADED";
159
878
  readonly httpStatus: 503;
160
879
  readonly message: "System is currently overloaded";
161
880
  };
162
881
  };
882
+ export type CoreErrorCode = keyof typeof CoreErrorCodes;
883
+ export type BrokerErrorCode = keyof typeof BrokerErrorCodes;
163
884
  export type ErrorCode = keyof typeof ErrorCodes;
164
885
  export interface ErrorContext {
886
+ domain?: 'core' | 'broker';
165
887
  abilityName?: string;
166
- protocol?: string;
888
+ transport?: string;
167
889
  brokerUrl?: string;
168
890
  toolName?: string;
169
891
  method?: string;
@@ -194,7 +916,7 @@ export declare class KadiError extends Error {
194
916
  /**
195
917
  * Create an ability not found error
196
918
  */
197
- static abilityNotFound(abilityName: string, protocol?: string): KadiError;
919
+ static abilityNotFound(abilityName: string, transport?: string): KadiError;
198
920
  /**
199
921
  * Create a tool not found error
200
922
  */