@nxuss/lemma 0.1.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.
Files changed (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +311 -0
  3. package/dist/cloud/KeyManager.d.ts +29 -0
  4. package/dist/cloud/KeyManager.d.ts.map +1 -0
  5. package/dist/cloud/KeyManager.js +142 -0
  6. package/dist/cloud/KeyManager.js.map +1 -0
  7. package/dist/cloud/TenantCache.d.ts +29 -0
  8. package/dist/cloud/TenantCache.d.ts.map +1 -0
  9. package/dist/cloud/TenantCache.js +162 -0
  10. package/dist/cloud/TenantCache.js.map +1 -0
  11. package/dist/cloud/index.d.ts +4 -0
  12. package/dist/cloud/index.d.ts.map +1 -0
  13. package/dist/cloud/index.js +23 -0
  14. package/dist/cloud/index.js.map +1 -0
  15. package/dist/cloud/server.d.ts +17 -0
  16. package/dist/cloud/server.d.ts.map +1 -0
  17. package/dist/cloud/server.js +189 -0
  18. package/dist/cloud/server.js.map +1 -0
  19. package/dist/cloud/types.d.ts +35 -0
  20. package/dist/cloud/types.d.ts.map +1 -0
  21. package/dist/cloud/types.js +14 -0
  22. package/dist/cloud/types.js.map +1 -0
  23. package/dist/config/index.d.ts +44 -0
  24. package/dist/config/index.d.ts.map +1 -0
  25. package/dist/config/index.js +161 -0
  26. package/dist/config/index.js.map +1 -0
  27. package/dist/consensus/ConsensusEngine.d.ts +119 -0
  28. package/dist/consensus/ConsensusEngine.d.ts.map +1 -0
  29. package/dist/consensus/ConsensusEngine.js +314 -0
  30. package/dist/consensus/ConsensusEngine.js.map +1 -0
  31. package/dist/consensus/ModelPool.d.ts +103 -0
  32. package/dist/consensus/ModelPool.d.ts.map +1 -0
  33. package/dist/consensus/ModelPool.js +276 -0
  34. package/dist/consensus/ModelPool.js.map +1 -0
  35. package/dist/consensus/index.d.ts +8 -0
  36. package/dist/consensus/index.d.ts.map +1 -0
  37. package/dist/consensus/index.js +13 -0
  38. package/dist/consensus/index.js.map +1 -0
  39. package/dist/core/AgentRegistry.d.ts +89 -0
  40. package/dist/core/AgentRegistry.d.ts.map +1 -0
  41. package/dist/core/AgentRegistry.js +264 -0
  42. package/dist/core/AgentRegistry.js.map +1 -0
  43. package/dist/core/DashboardBroadcaster.d.ts +67 -0
  44. package/dist/core/DashboardBroadcaster.d.ts.map +1 -0
  45. package/dist/core/DashboardBroadcaster.js +264 -0
  46. package/dist/core/DashboardBroadcaster.js.map +1 -0
  47. package/dist/core/OrchestrationEngine.d.ts +84 -0
  48. package/dist/core/OrchestrationEngine.d.ts.map +1 -0
  49. package/dist/core/OrchestrationEngine.js +455 -0
  50. package/dist/core/OrchestrationEngine.js.map +1 -0
  51. package/dist/core/SubconsciousEngine.d.ts +53 -0
  52. package/dist/core/SubconsciousEngine.d.ts.map +1 -0
  53. package/dist/core/SubconsciousEngine.js +273 -0
  54. package/dist/core/SubconsciousEngine.js.map +1 -0
  55. package/dist/core/WebSocketServer.d.ts +89 -0
  56. package/dist/core/WebSocketServer.d.ts.map +1 -0
  57. package/dist/core/WebSocketServer.js +416 -0
  58. package/dist/core/WebSocketServer.js.map +1 -0
  59. package/dist/core/index.d.ts +15 -0
  60. package/dist/core/index.d.ts.map +1 -0
  61. package/dist/core/index.js +24 -0
  62. package/dist/core/index.js.map +1 -0
  63. package/dist/core/router.d.ts +105 -0
  64. package/dist/core/router.d.ts.map +1 -0
  65. package/dist/core/router.js +420 -0
  66. package/dist/core/router.js.map +1 -0
  67. package/dist/embed/index.d.ts +153 -0
  68. package/dist/embed/index.d.ts.map +1 -0
  69. package/dist/embed/index.js +408 -0
  70. package/dist/embed/index.js.map +1 -0
  71. package/dist/embed.d.ts +11 -0
  72. package/dist/embed.d.ts.map +1 -0
  73. package/dist/embed.js +19 -0
  74. package/dist/embed.js.map +1 -0
  75. package/dist/index.d.ts +83 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +176 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/protocol/flows.d.ts +126 -0
  80. package/dist/protocol/flows.d.ts.map +1 -0
  81. package/dist/protocol/flows.js +347 -0
  82. package/dist/protocol/flows.js.map +1 -0
  83. package/dist/protocol/iap.d.ts +54 -0
  84. package/dist/protocol/iap.d.ts.map +1 -0
  85. package/dist/protocol/iap.js +108 -0
  86. package/dist/protocol/iap.js.map +1 -0
  87. package/dist/protocol/index.d.ts +23 -0
  88. package/dist/protocol/index.d.ts.map +1 -0
  89. package/dist/protocol/index.js +45 -0
  90. package/dist/protocol/index.js.map +1 -0
  91. package/dist/protocol/types.d.ts +332 -0
  92. package/dist/protocol/types.d.ts.map +1 -0
  93. package/dist/protocol/types.js +57 -0
  94. package/dist/protocol/types.js.map +1 -0
  95. package/dist/protocol/utils.d.ts +130 -0
  96. package/dist/protocol/utils.d.ts.map +1 -0
  97. package/dist/protocol/utils.js +292 -0
  98. package/dist/protocol/utils.js.map +1 -0
  99. package/dist/protocol/validators.d.ts +54 -0
  100. package/dist/protocol/validators.d.ts.map +1 -0
  101. package/dist/protocol/validators.js +344 -0
  102. package/dist/protocol/validators.js.map +1 -0
  103. package/dist/security/AuthManager.d.ts +73 -0
  104. package/dist/security/AuthManager.d.ts.map +1 -0
  105. package/dist/security/AuthManager.js +102 -0
  106. package/dist/security/AuthManager.js.map +1 -0
  107. package/dist/security/MessageSanitizer.d.ts +51 -0
  108. package/dist/security/MessageSanitizer.d.ts.map +1 -0
  109. package/dist/security/MessageSanitizer.js +166 -0
  110. package/dist/security/MessageSanitizer.js.map +1 -0
  111. package/dist/security/RateLimiter.d.ts +46 -0
  112. package/dist/security/RateLimiter.d.ts.map +1 -0
  113. package/dist/security/RateLimiter.js +133 -0
  114. package/dist/security/RateLimiter.js.map +1 -0
  115. package/dist/security/SecurityMiddleware.d.ts +88 -0
  116. package/dist/security/SecurityMiddleware.d.ts.map +1 -0
  117. package/dist/security/SecurityMiddleware.js +146 -0
  118. package/dist/security/SecurityMiddleware.js.map +1 -0
  119. package/dist/security/index.d.ts +35 -0
  120. package/dist/security/index.d.ts.map +1 -0
  121. package/dist/security/index.js +42 -0
  122. package/dist/security/index.js.map +1 -0
  123. package/dist/speculative/PredictionEngine.d.ts +99 -0
  124. package/dist/speculative/PredictionEngine.d.ts.map +1 -0
  125. package/dist/speculative/PredictionEngine.js +291 -0
  126. package/dist/speculative/PredictionEngine.js.map +1 -0
  127. package/dist/speculative/SpeculativeCache.d.ts +117 -0
  128. package/dist/speculative/SpeculativeCache.d.ts.map +1 -0
  129. package/dist/speculative/SpeculativeCache.js +292 -0
  130. package/dist/speculative/SpeculativeCache.js.map +1 -0
  131. package/dist/speculative/SpeculativeEngine.d.ts +114 -0
  132. package/dist/speculative/SpeculativeEngine.d.ts.map +1 -0
  133. package/dist/speculative/SpeculativeEngine.js +244 -0
  134. package/dist/speculative/SpeculativeEngine.js.map +1 -0
  135. package/dist/speculative/WorkerPool.d.ts +109 -0
  136. package/dist/speculative/WorkerPool.d.ts.map +1 -0
  137. package/dist/speculative/WorkerPool.js +327 -0
  138. package/dist/speculative/WorkerPool.js.map +1 -0
  139. package/dist/speculative/index.d.ts +10 -0
  140. package/dist/speculative/index.d.ts.map +1 -0
  141. package/dist/speculative/index.js +17 -0
  142. package/dist/speculative/index.js.map +1 -0
  143. package/dist/subconscious/EmbeddingService.d.ts +73 -0
  144. package/dist/subconscious/EmbeddingService.d.ts.map +1 -0
  145. package/dist/subconscious/EmbeddingService.js +196 -0
  146. package/dist/subconscious/EmbeddingService.js.map +1 -0
  147. package/dist/subconscious/SemanticCache.d.ts +82 -0
  148. package/dist/subconscious/SemanticCache.d.ts.map +1 -0
  149. package/dist/subconscious/SemanticCache.js +164 -0
  150. package/dist/subconscious/SemanticCache.js.map +1 -0
  151. package/dist/subconscious/SubconsciousEngine.d.ts +121 -0
  152. package/dist/subconscious/SubconsciousEngine.d.ts.map +1 -0
  153. package/dist/subconscious/SubconsciousEngine.js +241 -0
  154. package/dist/subconscious/SubconsciousEngine.js.map +1 -0
  155. package/dist/subconscious/VectorStore.d.ts +54 -0
  156. package/dist/subconscious/VectorStore.d.ts.map +1 -0
  157. package/dist/subconscious/VectorStore.js +168 -0
  158. package/dist/subconscious/VectorStore.js.map +1 -0
  159. package/dist/subconscious/cache.d.ts +34 -0
  160. package/dist/subconscious/cache.d.ts.map +1 -0
  161. package/dist/subconscious/cache.js +156 -0
  162. package/dist/subconscious/cache.js.map +1 -0
  163. package/dist/subconscious/embeddings.d.ts +25 -0
  164. package/dist/subconscious/embeddings.d.ts.map +1 -0
  165. package/dist/subconscious/embeddings.js +65 -0
  166. package/dist/subconscious/embeddings.js.map +1 -0
  167. package/dist/subconscious/index.d.ts +12 -0
  168. package/dist/subconscious/index.d.ts.map +1 -0
  169. package/dist/subconscious/index.js +19 -0
  170. package/dist/subconscious/index.js.map +1 -0
  171. package/dist/types/index.d.ts +286 -0
  172. package/dist/types/index.d.ts.map +1 -0
  173. package/dist/types/index.js +43 -0
  174. package/dist/types/index.js.map +1 -0
  175. package/dist/utils/logger.d.ts +63 -0
  176. package/dist/utils/logger.d.ts.map +1 -0
  177. package/dist/utils/logger.js +126 -0
  178. package/dist/utils/logger.js.map +1 -0
  179. package/package.json +99 -0
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Inter-Agent Protocol (I.A.P.) v1.0
3
+ * Standardized communication layer for autonomous AI agents
4
+ */
5
+ import { IAPMessage, HandshakePayload, TaskRequest, TaskResponse } from '../types/index';
6
+ export type AgentHandshake = HandshakePayload;
7
+ export interface TaskBid {
8
+ taskId: string;
9
+ agentId: string;
10
+ bidAmount: number;
11
+ estimatedTime?: number;
12
+ confidence?: number;
13
+ metadata?: Record<string, any>;
14
+ }
15
+ export declare class IAPProtocol {
16
+ static readonly VERSION = "1.0.0";
17
+ /**
18
+ * Create a handshake message
19
+ */
20
+ static createHandshake(handshake: HandshakePayload): IAPMessage;
21
+ /**
22
+ * Create a task request message
23
+ */
24
+ static createTaskRequest(request: TaskRequest): IAPMessage;
25
+ /**
26
+ * Create a task response message
27
+ */
28
+ static createTaskResponse(response: TaskResponse): IAPMessage;
29
+ /**
30
+ * Create a task bid message
31
+ */
32
+ static createTaskBid(bid: TaskBid): IAPMessage;
33
+ /**
34
+ * Create a heartbeat message
35
+ */
36
+ static createHeartbeat(agentId: string): IAPMessage;
37
+ /**
38
+ * Create an error message
39
+ */
40
+ static createError(error: string, details?: Record<string, unknown>): IAPMessage;
41
+ /**
42
+ * Validate an IAP message
43
+ */
44
+ static validate(message: unknown): message is IAPMessage;
45
+ /**
46
+ * Parse a raw message string into an IAP message
47
+ */
48
+ static parse(raw: string): IAPMessage;
49
+ /**
50
+ * Serialize an IAP message to string
51
+ */
52
+ static serialize(message: IAPMessage): string;
53
+ }
54
+ //# sourceMappingURL=iap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iap.d.ts","sourceRoot":"","sources":["../../src/protocol/iap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAkB,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGzG,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE9C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAElC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,UAAU;IAQ/D;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU;IAQ1D;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,UAAU;IAQ7D;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU;IAQ9C;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;IAQnD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU;IAQhF;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,UAAU;IAexD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAYrC;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM;CAG9C"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ /**
3
+ * Inter-Agent Protocol (I.A.P.) v1.0
4
+ * Standardized communication layer for autonomous AI agents
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.IAPProtocol = void 0;
8
+ const index_1 = require("../types/index");
9
+ class IAPProtocol {
10
+ /**
11
+ * Create a handshake message
12
+ */
13
+ static createHandshake(handshake) {
14
+ return {
15
+ type: index_1.IAPMessageType.HANDSHAKE,
16
+ payload: handshake,
17
+ timestamp: Date.now(),
18
+ };
19
+ }
20
+ /**
21
+ * Create a task request message
22
+ */
23
+ static createTaskRequest(request) {
24
+ return {
25
+ type: index_1.IAPMessageType.TASK_REQUEST,
26
+ payload: request,
27
+ timestamp: Date.now(),
28
+ };
29
+ }
30
+ /**
31
+ * Create a task response message
32
+ */
33
+ static createTaskResponse(response) {
34
+ return {
35
+ type: index_1.IAPMessageType.TASK_RESPONSE,
36
+ payload: response,
37
+ timestamp: Date.now(),
38
+ };
39
+ }
40
+ /**
41
+ * Create a task bid message
42
+ */
43
+ static createTaskBid(bid) {
44
+ return {
45
+ type: index_1.IAPMessageType.TASK_ASSIGN,
46
+ payload: bid,
47
+ timestamp: Date.now(),
48
+ };
49
+ }
50
+ /**
51
+ * Create a heartbeat message
52
+ */
53
+ static createHeartbeat(agentId) {
54
+ return {
55
+ type: index_1.IAPMessageType.HEARTBEAT,
56
+ payload: { agentId },
57
+ timestamp: Date.now(),
58
+ };
59
+ }
60
+ /**
61
+ * Create an error message
62
+ */
63
+ static createError(error, details) {
64
+ return {
65
+ type: index_1.IAPMessageType.ERROR,
66
+ payload: { error, ...details },
67
+ timestamp: Date.now(),
68
+ };
69
+ }
70
+ /**
71
+ * Validate an IAP message
72
+ */
73
+ static validate(message) {
74
+ if (typeof message !== 'object' || message === null) {
75
+ return false;
76
+ }
77
+ const msg = message;
78
+ if (!msg.type || !msg.payload || !msg.timestamp) {
79
+ return false;
80
+ }
81
+ // Check if type is a valid IAPMessageType enum value
82
+ return Object.values(index_1.IAPMessageType).includes(msg.type);
83
+ }
84
+ /**
85
+ * Parse a raw message string into an IAP message
86
+ */
87
+ static parse(raw) {
88
+ try {
89
+ const parsed = JSON.parse(raw);
90
+ if (!this.validate(parsed)) {
91
+ throw new Error('Invalid IAP message format');
92
+ }
93
+ return parsed;
94
+ }
95
+ catch (error) {
96
+ throw new Error(`Failed to parse IAP message: ${error}`);
97
+ }
98
+ }
99
+ /**
100
+ * Serialize an IAP message to string
101
+ */
102
+ static serialize(message) {
103
+ return JSON.stringify(message);
104
+ }
105
+ }
106
+ exports.IAPProtocol = IAPProtocol;
107
+ IAPProtocol.VERSION = '1.0.0';
108
+ //# sourceMappingURL=iap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iap.js","sourceRoot":"","sources":["../../src/protocol/iap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0CAAyG;AAczG,MAAa,WAAW;IAGtB;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,SAA2B;QAChD,OAAO;YACL,IAAI,EAAE,sBAAc,CA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O,KAAK,CAAC;QACf,CAAC;QAED,MAAM,GAAG,GAAG,OAA8B,CAAC;QAE3C,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,qDAAqD;QACrD,OAAO,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAsB,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,OAAmB;QAClC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;;AA3GH,kCA4GC;AA3GiB,mBAAO,GAAG,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Inter-Agent Protocol (I.A.P.) v1.0.0
3
+ *
4
+ * Main entry point for the protocol implementation
5
+ */
6
+ export * from './types';
7
+ export * from './validators';
8
+ export * from './flows';
9
+ export * from './utils';
10
+ export declare const IAP_VERSION = "1.0.0";
11
+ export declare const IAP_NAME = "Inter-Agent Protocol";
12
+ /**
13
+ * Protocol metadata
14
+ */
15
+ export declare const PROTOCOL_INFO: {
16
+ name: string;
17
+ version: string;
18
+ description: string;
19
+ repository: string;
20
+ documentation: string;
21
+ license: string;
22
+ };
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Inter-Agent Protocol (I.A.P.) v1.0.0
4
+ *
5
+ * Main entry point for the protocol implementation
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.PROTOCOL_INFO = exports.IAP_NAME = exports.IAP_VERSION = void 0;
23
+ // Export all types
24
+ __exportStar(require("./types"), exports);
25
+ // Export validators
26
+ __exportStar(require("./validators"), exports);
27
+ // Export flows
28
+ __exportStar(require("./flows"), exports);
29
+ // Export utilities
30
+ __exportStar(require("./utils"), exports);
31
+ // Version information
32
+ exports.IAP_VERSION = '1.0.0';
33
+ exports.IAP_NAME = 'Inter-Agent Protocol';
34
+ /**
35
+ * Protocol metadata
36
+ */
37
+ exports.PROTOCOL_INFO = {
38
+ name: exports.IAP_NAME,
39
+ version: exports.IAP_VERSION,
40
+ description: 'Standardized communication protocol for autonomous AI agents',
41
+ repository: 'https://github.com/subconscious-router/iap',
42
+ documentation: 'https://docs.subconscious-router.dev/iap',
43
+ license: 'MIT'
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,mBAAmB;AACnB,0CAAwB;AAExB,oBAAoB;AACpB,+CAA6B;AAE7B,eAAe;AACf,0CAAwB;AAExB,mBAAmB;AACnB,0CAAwB;AAExB,sBAAsB;AACT,QAAA,WAAW,GAAG,OAAO,CAAC;AACtB,QAAA,QAAQ,GAAG,sBAAsB,CAAC;AAE/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,gBAAQ;IACd,OAAO,EAAE,mBAAW;IACpB,WAAW,EAAE,8DAA8D;IAC3E,UAAU,EAAE,4CAA4C;IACxD,aAAa,EAAE,0CAA0C;IACzD,OAAO,EAAE,KAAK;CACf,CAAC"}
@@ -0,0 +1,332 @@
1
+ /**
2
+ * Inter-Agent Protocol (I.A.P.) v1.0.0
3
+ *
4
+ * TypeScript type definitions for standardized agent-to-agent communication
5
+ * via the Subconscious Router.
6
+ */
7
+ /**
8
+ * Unique identifier for agents in the network
9
+ */
10
+ export type AgentId = string;
11
+ /**
12
+ * Unique identifier for tasks
13
+ */
14
+ export type TaskId = string;
15
+ /**
16
+ * Unique identifier for messages
17
+ */
18
+ export type MessageId = string;
19
+ /**
20
+ * Timestamp in ISO 8601 format
21
+ */
22
+ export type Timestamp = string;
23
+ /**
24
+ * Capability types that agents can advertise
25
+ */
26
+ export declare enum CapabilityType {
27
+ TEXT_GENERATION = "text_generation",
28
+ CODE_EXECUTION = "code_execution",
29
+ WEB_SEARCH = "web_search",
30
+ DATA_ANALYSIS = "data_analysis",
31
+ IMAGE_GENERATION = "image_generation",
32
+ FILE_OPERATIONS = "file_operations",
33
+ API_INTEGRATION = "api_integration",
34
+ CUSTOM = "custom"
35
+ }
36
+ /**
37
+ * Message types in the I.A.P. protocol
38
+ */
39
+ export declare enum MessageType {
40
+ HANDSHAKE = "handshake",
41
+ HANDSHAKE_ACK = "handshake_ack",
42
+ CAPABILITY_DISCOVERY = "capability_discovery",
43
+ CAPABILITY_RESPONSE = "capability_response",
44
+ TASK_PROPOSAL = "task_proposal",
45
+ TASK_BID = "task_bid",
46
+ TASK_ASSIGNMENT = "task_assignment",
47
+ TASK_ACCEPTANCE = "task_acceptance",
48
+ TASK_REJECTION = "task_rejection",
49
+ CONTEXT_TRANSFER = "context_transfer",
50
+ TASK_RESULT = "task_result",
51
+ ERROR = "error",
52
+ HEARTBEAT = "heartbeat",
53
+ DISCONNECT = "disconnect"
54
+ }
55
+ /**
56
+ * Status of a task in the system
57
+ */
58
+ export declare enum TaskStatus {
59
+ PROPOSED = "proposed",
60
+ BIDDING = "bidding",
61
+ ASSIGNED = "assigned",
62
+ IN_PROGRESS = "in_progress",
63
+ COMPLETED = "completed",
64
+ FAILED = "failed",
65
+ CANCELLED = "cancelled"
66
+ }
67
+ /**
68
+ * Describes a specific capability/tool available to an agent
69
+ */
70
+ export interface AgentCapability {
71
+ /** Unique identifier for this capability */
72
+ id: string;
73
+ /** Type of capability */
74
+ type: CapabilityType;
75
+ /** Human-readable name */
76
+ name: string;
77
+ /** Detailed description of what this capability does */
78
+ description: string;
79
+ /** JSON Schema describing input parameters */
80
+ inputSchema?: Record<string, any>;
81
+ /** JSON Schema describing output format */
82
+ outputSchema?: Record<string, any>;
83
+ /** Estimated cost in tokens or API credits */
84
+ estimatedCost?: number;
85
+ /** Average execution time in milliseconds */
86
+ averageLatency?: number;
87
+ /** Additional metadata */
88
+ metadata?: Record<string, any>;
89
+ }
90
+ /**
91
+ * Initial handshake message sent by an agent joining the network
92
+ */
93
+ export interface AgentHandshake {
94
+ /** Unique identifier for this agent */
95
+ agentId: AgentId;
96
+ /** Human-readable agent name */
97
+ name: string;
98
+ /** Agent version (semantic versioning) */
99
+ version: string;
100
+ /** Framework or platform (e.g., "LangChain", "CrewAI", "AutoGPT") */
101
+ framework?: string;
102
+ /** List of capabilities this agent provides */
103
+ capabilities: AgentCapability[];
104
+ /** Maximum concurrent tasks this agent can handle */
105
+ maxConcurrentTasks?: number;
106
+ /** Agent's current load (0.0 to 1.0) */
107
+ currentLoad?: number;
108
+ /** Additional metadata about the agent */
109
+ metadata?: Record<string, any>;
110
+ /** Protocol version this agent supports */
111
+ protocolVersion: string;
112
+ }
113
+ /**
114
+ * Acknowledgment of successful handshake
115
+ */
116
+ export interface HandshakeAck {
117
+ /** Router's acknowledgment */
118
+ success: boolean;
119
+ /** Assigned session ID */
120
+ sessionId: string;
121
+ /** Router version */
122
+ routerVersion: string;
123
+ /** Number of currently connected agents */
124
+ connectedAgents: number;
125
+ /** Optional welcome message or instructions */
126
+ message?: string;
127
+ }
128
+ /**
129
+ * Request to discover available capabilities in the network
130
+ */
131
+ export interface CapabilityDiscovery {
132
+ /** Agent requesting discovery */
133
+ requesterId: AgentId;
134
+ /** Optional filter by capability type */
135
+ filterByType?: CapabilityType[];
136
+ /** Optional filter by minimum performance criteria */
137
+ minPerformance?: {
138
+ maxLatency?: number;
139
+ maxCost?: number;
140
+ };
141
+ }
142
+ /**
143
+ * Response containing available capabilities
144
+ */
145
+ export interface CapabilityResponse {
146
+ /** Map of agent IDs to their capabilities */
147
+ agents: Record<AgentId, {
148
+ name: string;
149
+ capabilities: AgentCapability[];
150
+ currentLoad: number;
151
+ }>;
152
+ /** Total number of available agents */
153
+ totalAgents: number;
154
+ /** Timestamp of response */
155
+ timestamp: Timestamp;
156
+ }
157
+ /**
158
+ * Proposal for a task to be executed
159
+ */
160
+ export interface TaskProposal {
161
+ /** Unique task identifier */
162
+ taskId: TaskId;
163
+ /** Agent proposing the task */
164
+ proposerId: AgentId;
165
+ /** Human-readable task description */
166
+ description: string;
167
+ /** Required capability type */
168
+ requiredCapability: CapabilityType;
169
+ /** Specific capability ID if known */
170
+ specificCapabilityId?: string;
171
+ /** Input parameters for the task */
172
+ input: Record<string, any>;
173
+ /** Maximum acceptable latency in milliseconds */
174
+ maxLatency?: number;
175
+ /** Maximum acceptable cost */
176
+ maxCost?: number;
177
+ /** Priority level (1-10, higher is more urgent) */
178
+ priority?: number;
179
+ /** Deadline for task completion */
180
+ deadline?: Timestamp;
181
+ /** Context data needed for execution */
182
+ context?: Record<string, any>;
183
+ }
184
+ /**
185
+ * Bid from an agent to execute a proposed task
186
+ */
187
+ export interface TaskBid {
188
+ /** Reference to the task being bid on */
189
+ taskId: TaskId;
190
+ /** Agent making the bid */
191
+ bidderId: AgentId;
192
+ /** Estimated execution time in milliseconds */
193
+ estimatedLatency: number;
194
+ /** Estimated cost in tokens or credits */
195
+ estimatedCost: number;
196
+ /** Confidence score (0.0 to 1.0) in successful execution */
197
+ confidence: number;
198
+ /** Agent's current queue depth */
199
+ queueDepth: number;
200
+ /** Earliest time the agent can start (if queued) */
201
+ earliestStartTime?: Timestamp;
202
+ /** Additional notes or conditions */
203
+ notes?: string;
204
+ }
205
+ /**
206
+ * Assignment of a task to a specific agent
207
+ */
208
+ export interface TaskAssignment {
209
+ /** Task being assigned */
210
+ taskId: TaskId;
211
+ /** Agent assigned to execute */
212
+ assignedTo: AgentId;
213
+ /** Original proposer */
214
+ proposerId: AgentId;
215
+ /** Timestamp of assignment */
216
+ assignedAt: Timestamp;
217
+ /** Expected completion time */
218
+ expectedCompletion?: Timestamp;
219
+ }
220
+ /**
221
+ * Transfer of context/state between agents
222
+ */
223
+ export interface ContextTransfer {
224
+ /** Source agent */
225
+ fromAgent: AgentId;
226
+ /** Destination agent */
227
+ toAgent: AgentId;
228
+ /** Related task ID */
229
+ taskId: TaskId;
230
+ /** Context type identifier */
231
+ contextType: string;
232
+ /** The actual context data */
233
+ data: Record<string, any>;
234
+ /** Optional embedding vector for semantic indexing */
235
+ embedding?: number[];
236
+ /** Compression format if data is compressed */
237
+ compression?: 'gzip' | 'brotli' | 'none';
238
+ /** Checksum for data integrity */
239
+ checksum?: string;
240
+ }
241
+ /**
242
+ * Result of a completed task
243
+ */
244
+ export interface TaskResult {
245
+ /** Task that was completed */
246
+ taskId: TaskId;
247
+ /** Agent that executed the task */
248
+ executorId: AgentId;
249
+ /** Execution status */
250
+ status: TaskStatus;
251
+ /** Output data */
252
+ output?: Record<string, any>;
253
+ /** Error information if failed */
254
+ error?: {
255
+ code: string;
256
+ message: string;
257
+ details?: any;
258
+ };
259
+ /** Actual execution time in milliseconds */
260
+ actualLatency: number;
261
+ /** Actual cost incurred */
262
+ actualCost: number;
263
+ /** Timestamp of completion */
264
+ completedAt: Timestamp;
265
+ /** Optional metadata about execution */
266
+ metadata?: Record<string, any>;
267
+ }
268
+ /**
269
+ * Error message
270
+ */
271
+ export interface ErrorMessage {
272
+ /** Error code */
273
+ code: string;
274
+ /** Human-readable error message */
275
+ message: string;
276
+ /** Related message ID if applicable */
277
+ relatedMessageId?: MessageId;
278
+ /** Related task ID if applicable */
279
+ relatedTaskId?: TaskId;
280
+ /** Additional error details */
281
+ details?: any;
282
+ /** Whether the error is recoverable */
283
+ recoverable: boolean;
284
+ }
285
+ /**
286
+ * Base message structure for all I.A.P. messages
287
+ */
288
+ export interface IAPMessage {
289
+ /** Unique message identifier */
290
+ messageId: MessageId;
291
+ /** Type of message */
292
+ type: MessageType;
293
+ /** Sender agent ID */
294
+ from: AgentId;
295
+ /** Recipient agent ID (or 'router' for broadcast) */
296
+ to: AgentId | 'router';
297
+ /** Message timestamp */
298
+ timestamp: Timestamp;
299
+ /** Protocol version */
300
+ protocolVersion: string;
301
+ /** Message payload (type depends on message type) */
302
+ payload: AgentHandshake | HandshakeAck | CapabilityDiscovery | CapabilityResponse | TaskProposal | TaskBid | TaskAssignment | TaskResult | ContextTransfer | ErrorMessage | Record<string, any>;
303
+ /** Optional correlation ID for request-response tracking */
304
+ correlationId?: string;
305
+ /** Optional metadata */
306
+ metadata?: Record<string, any>;
307
+ }
308
+ /**
309
+ * Heartbeat message to maintain connection
310
+ */
311
+ export interface Heartbeat {
312
+ /** Agent sending heartbeat */
313
+ agentId: AgentId;
314
+ /** Current load (0.0 to 1.0) */
315
+ currentLoad: number;
316
+ /** Number of active tasks */
317
+ activeTasks: number;
318
+ /** Uptime in seconds */
319
+ uptime: number;
320
+ }
321
+ /**
322
+ * Disconnect notification
323
+ */
324
+ export interface DisconnectMessage {
325
+ /** Agent disconnecting */
326
+ agentId: AgentId;
327
+ /** Reason for disconnect */
328
+ reason: string;
329
+ /** Whether disconnect is graceful */
330
+ graceful: boolean;
331
+ }
332
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,oBAAY,cAAc;IACxB,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,QAA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 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * Inter-Agent Protocol (I.A.P.) v1.0.0
4
+ *
5
+ * TypeScript type definitions for standardized agent-to-agent communication
6
+ * via the Subconscious Router.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TaskStatus = exports.MessageType = exports.CapabilityType = void 0;
10
+ /**
11
+ * Capability types that agents can advertise
12
+ */
13
+ var CapabilityType;
14
+ (function (CapabilityType) {
15
+ CapabilityType["TEXT_GENERATION"] = "text_generation";
16
+ CapabilityType["CODE_EXECUTION"] = "code_execution";
17
+ CapabilityType["WEB_SEARCH"] = "web_search";
18
+ CapabilityType["DATA_ANALYSIS"] = "data_analysis";
19
+ CapabilityType["IMAGE_GENERATION"] = "image_generation";
20
+ CapabilityType["FILE_OPERATIONS"] = "file_operations";
21
+ CapabilityType["API_INTEGRATION"] = "api_integration";
22
+ CapabilityType["CUSTOM"] = "custom";
23
+ })(CapabilityType || (exports.CapabilityType = CapabilityType = {}));
24
+ /**
25
+ * Message types in the I.A.P. protocol
26
+ */
27
+ var MessageType;
28
+ (function (MessageType) {
29
+ MessageType["HANDSHAKE"] = "handshake";
30
+ MessageType["HANDSHAKE_ACK"] = "handshake_ack";
31
+ MessageType["CAPABILITY_DISCOVERY"] = "capability_discovery";
32
+ MessageType["CAPABILITY_RESPONSE"] = "capability_response";
33
+ MessageType["TASK_PROPOSAL"] = "task_proposal";
34
+ MessageType["TASK_BID"] = "task_bid";
35
+ MessageType["TASK_ASSIGNMENT"] = "task_assignment";
36
+ MessageType["TASK_ACCEPTANCE"] = "task_acceptance";
37
+ MessageType["TASK_REJECTION"] = "task_rejection";
38
+ MessageType["CONTEXT_TRANSFER"] = "context_transfer";
39
+ MessageType["TASK_RESULT"] = "task_result";
40
+ MessageType["ERROR"] = "error";
41
+ MessageType["HEARTBEAT"] = "heartbeat";
42
+ MessageType["DISCONNECT"] = "disconnect";
43
+ })(MessageType || (exports.MessageType = MessageType = {}));
44
+ /**
45
+ * Status of a task in the system
46
+ */
47
+ var TaskStatus;
48
+ (function (TaskStatus) {
49
+ TaskStatus["PROPOSED"] = "proposed";
50
+ TaskStatus["BIDDING"] = "bidding";
51
+ TaskStatus["ASSIGNED"] = "assigned";
52
+ TaskStatus["IN_PROGRESS"] = "in_progress";
53
+ TaskStatus["COMPLETED"] = "completed";
54
+ TaskStatus["FAILED"] = "failed";
55
+ TaskStatus["CANCELLED"] = "cancelled";
56
+ })(TaskStatus || (exports.TaskStatus = TaskStatus = {}));
57
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAsBH;;GAEG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qDAAmC,CAAA;IACnC,mDAAiC,CAAA;IACjC,2CAAyB,CAAA;IACzB,iDAA+B,CAAA;IAC/B,uDAAqC,CAAA;IACrC,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,mCAAiB,CAAA;AACnB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAED;;GAEG;AACH,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,sCAAuB,CAAA;IACvB,8CAA+B,CAAA;IAC/B,4DAA6C,CAAA;IAC7C,0DAA2C,CAAA;IAC3C,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;IACrB,kDAAmC,CAAA;IACnC,kDAAmC,CAAA;IACnC,gDAAiC,CAAA;IACjC,oDAAqC,CAAA;IACrC,0CAA2B,CAAA;IAC3B,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;AAC3B,CAAC,EAfW,WAAW,2BAAX,WAAW,QAetB;AAED;;GAEG;AACH,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,yCAA2B,CAAA;IAC3B,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;AACzB,CAAC,EARW,UAAU,0BAAV,UAAU,QAQrB"}