@ainetwork/adk 0.1.6 → 0.1.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.
Files changed (138) hide show
  1. package/dist/cjs/chunk-3JKRJYJ6.cjs +111 -0
  2. package/dist/cjs/chunk-3JKRJYJ6.cjs.map +1 -0
  3. package/dist/cjs/chunk-466ED5WN.cjs +41 -0
  4. package/dist/cjs/chunk-466ED5WN.cjs.map +1 -0
  5. package/dist/cjs/chunk-4ESGHH2M.cjs +20 -0
  6. package/dist/cjs/chunk-4ESGHH2M.cjs.map +1 -0
  7. package/dist/cjs/chunk-4HY26I2C.cjs +168 -0
  8. package/dist/cjs/chunk-4HY26I2C.cjs.map +1 -0
  9. package/dist/cjs/chunk-5OWM5IH4.cjs +20 -0
  10. package/dist/cjs/chunk-5OWM5IH4.cjs.map +1 -0
  11. package/dist/cjs/chunk-6S6GEY3D.cjs +37 -0
  12. package/dist/cjs/chunk-6S6GEY3D.cjs.map +1 -0
  13. package/dist/cjs/chunk-ICFTUZP5.cjs +111 -0
  14. package/dist/cjs/chunk-ICFTUZP5.cjs.map +1 -0
  15. package/dist/cjs/chunk-MMWEU2MO.cjs +100 -0
  16. package/dist/cjs/chunk-MMWEU2MO.cjs.map +1 -0
  17. package/dist/cjs/chunk-NYYEZ4ER.cjs +22 -0
  18. package/dist/cjs/chunk-NYYEZ4ER.cjs.map +1 -0
  19. package/dist/cjs/chunk-OBUCVZNU.cjs +37 -0
  20. package/dist/cjs/chunk-OBUCVZNU.cjs.map +1 -0
  21. package/dist/cjs/chunk-RMRFCEP4.cjs +8 -0
  22. package/dist/cjs/chunk-RMRFCEP4.cjs.map +1 -0
  23. package/dist/cjs/chunk-RPMERDHU.cjs +44 -0
  24. package/dist/cjs/chunk-RPMERDHU.cjs.map +1 -0
  25. package/dist/cjs/chunk-RWQDV2XY.cjs +166 -0
  26. package/dist/cjs/chunk-RWQDV2XY.cjs.map +1 -0
  27. package/dist/cjs/chunk-UQ72NNHV.cjs +225 -0
  28. package/dist/cjs/chunk-UQ72NNHV.cjs.map +1 -0
  29. package/dist/cjs/chunk-XZAKXJYO.cjs +20 -0
  30. package/dist/cjs/chunk-XZAKXJYO.cjs.map +1 -0
  31. package/dist/cjs/chunk-ZAZ3KYP5.cjs +43 -0
  32. package/dist/cjs/chunk-ZAZ3KYP5.cjs.map +1 -0
  33. package/dist/cjs/controllers/a2a.controller.cjs +3 -3
  34. package/dist/cjs/controllers/index.cjs +6 -6
  35. package/dist/cjs/controllers/index.cjs.map +1 -1
  36. package/dist/cjs/controllers/query.controller.cjs +2 -2
  37. package/dist/cjs/index.cjs +25 -24
  38. package/dist/cjs/index.cjs.map +1 -1
  39. package/dist/cjs/middlewares/error.middleware.cjs +3 -3
  40. package/dist/cjs/modules/a2a/a2a.module.cjs +3 -3
  41. package/dist/cjs/modules/index.cjs +9 -9
  42. package/dist/cjs/modules/index.cjs.map +1 -1
  43. package/dist/cjs/modules/mcp/mcp.module.cjs +3 -3
  44. package/dist/cjs/modules/models/base.model.cjs +2 -2
  45. package/dist/cjs/routes/a2a.routes.cjs +7 -7
  46. package/dist/cjs/routes/index.cjs +13 -12
  47. package/dist/cjs/routes/index.cjs.map +1 -1
  48. package/dist/cjs/routes/query.routes.cjs +7 -6
  49. package/dist/cjs/routes/query.routes.cjs.map +1 -1
  50. package/dist/cjs/services/a2a.service.cjs +3 -3
  51. package/dist/cjs/services/index.cjs +9 -5
  52. package/dist/cjs/services/index.cjs.map +1 -1
  53. package/dist/cjs/services/query-stream.service.cjs +9 -0
  54. package/dist/cjs/services/query-stream.service.cjs.map +1 -0
  55. package/dist/cjs/services/query.service.cjs +4 -4
  56. package/dist/cjs/types/memory.cjs +2 -2
  57. package/dist/cjs/types/stream.cjs +1 -0
  58. package/dist/cjs/types/stream.cjs.map +1 -0
  59. package/dist/cjs/utils/logger.cjs +2 -2
  60. package/dist/esm/{chunk-GZFRRFOE.js → chunk-2BITOA2R.js} +1 -1
  61. package/dist/esm/chunk-2BITOA2R.js.map +1 -0
  62. package/dist/esm/{chunk-BTZVK3EA.js → chunk-624FPEEV.js} +2 -2
  63. package/dist/esm/{chunk-U2Y64SAC.js → chunk-A3W52LKL.js} +4 -4
  64. package/dist/esm/{chunk-SQWZXP4P.js → chunk-DJRRMFKH.js} +2 -2
  65. package/dist/esm/chunk-EFMGNCWG.js +225 -0
  66. package/dist/esm/chunk-EFMGNCWG.js.map +1 -0
  67. package/dist/esm/{chunk-EODMRV4H.js → chunk-HAE333YO.js} +2 -2
  68. package/dist/esm/{chunk-ILFWNK3W.js → chunk-MAU2MAK2.js} +2 -2
  69. package/dist/esm/{chunk-N6T2JOGC.js → chunk-MC7CPQ6W.js} +2 -2
  70. package/dist/esm/{chunk-64GEXWSE.js → chunk-N7VYM2R5.js} +2 -1
  71. package/dist/esm/chunk-N7VYM2R5.js.map +1 -0
  72. package/dist/esm/{chunk-F727XG4N.js → chunk-VAZWF5IK.js} +1 -1
  73. package/dist/esm/{chunk-F727XG4N.js.map → chunk-VAZWF5IK.js.map} +1 -1
  74. package/dist/esm/chunk-WGHAZ4HG.js +44 -0
  75. package/dist/esm/chunk-WGHAZ4HG.js.map +1 -0
  76. package/dist/esm/{chunk-AQ5YZERE.js → chunk-Y6E73I7I.js} +2 -2
  77. package/dist/esm/{chunk-7QSZHJU5.js → chunk-YT6PD6UF.js} +4 -4
  78. package/dist/esm/chunk-ZFSIP5KN.js +43 -0
  79. package/dist/esm/chunk-ZFSIP5KN.js.map +1 -0
  80. package/dist/esm/controllers/a2a.controller.d.ts +1 -0
  81. package/dist/esm/controllers/a2a.controller.js +2 -2
  82. package/dist/esm/controllers/api/model.api.controller.d.ts +1 -0
  83. package/dist/esm/controllers/index.d.ts +2 -0
  84. package/dist/esm/controllers/index.js +3 -3
  85. package/dist/esm/controllers/query.controller.d.ts +5 -1
  86. package/dist/esm/controllers/query.controller.js +1 -1
  87. package/dist/esm/index.d.ts +2 -1
  88. package/dist/esm/index.js +16 -15
  89. package/dist/esm/index.js.map +1 -1
  90. package/dist/esm/middlewares/error.middleware.js +2 -2
  91. package/dist/esm/modules/a2a/a2a.module.js +2 -2
  92. package/dist/esm/modules/index.d.ts +1 -0
  93. package/dist/esm/modules/index.js +10 -10
  94. package/dist/esm/modules/mcp/mcp.module.js +2 -2
  95. package/dist/esm/modules/memory/base.memory.d.ts +3 -3
  96. package/dist/esm/modules/models/base.model.d.ts +13 -0
  97. package/dist/esm/modules/models/base.model.js +1 -1
  98. package/dist/esm/modules/models/model.module.d.ts +1 -0
  99. package/dist/esm/routes/a2a.routes.d.ts +1 -0
  100. package/dist/esm/routes/a2a.routes.js +6 -6
  101. package/dist/esm/routes/api/models.routes.d.ts +1 -0
  102. package/dist/esm/routes/api.routes.d.ts +1 -0
  103. package/dist/esm/routes/api.routes.js +2 -2
  104. package/dist/esm/routes/index.d.ts +1 -0
  105. package/dist/esm/routes/index.js +13 -12
  106. package/dist/esm/routes/query.routes.d.ts +2 -1
  107. package/dist/esm/routes/query.routes.js +6 -5
  108. package/dist/esm/services/a2a.service.d.ts +1 -0
  109. package/dist/esm/services/a2a.service.js +2 -2
  110. package/dist/esm/services/index.d.ts +3 -0
  111. package/dist/esm/services/index.js +9 -5
  112. package/dist/esm/services/query-stream.service.d.ts +74 -0
  113. package/dist/esm/services/query-stream.service.js +9 -0
  114. package/dist/esm/services/query-stream.service.js.map +1 -0
  115. package/dist/esm/services/query.service.d.ts +1 -0
  116. package/dist/esm/services/query.service.js +3 -3
  117. package/dist/esm/types/memory.d.ts +9 -1
  118. package/dist/esm/types/memory.js +1 -1
  119. package/dist/esm/types/stream.d.ts +47 -0
  120. package/dist/esm/types/stream.js +1 -0
  121. package/dist/esm/types/stream.js.map +1 -0
  122. package/dist/esm/utils/logger.d.ts +1 -0
  123. package/dist/esm/utils/logger.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/esm/chunk-64GEXWSE.js.map +0 -1
  126. package/dist/esm/chunk-GZFRRFOE.js.map +0 -1
  127. package/dist/esm/chunk-NH7BYWQV.js +0 -27
  128. package/dist/esm/chunk-NH7BYWQV.js.map +0 -1
  129. package/dist/esm/chunk-WIJDRP2A.js +0 -26
  130. package/dist/esm/chunk-WIJDRP2A.js.map +0 -1
  131. /package/dist/esm/{chunk-BTZVK3EA.js.map → chunk-624FPEEV.js.map} +0 -0
  132. /package/dist/esm/{chunk-U2Y64SAC.js.map → chunk-A3W52LKL.js.map} +0 -0
  133. /package/dist/esm/{chunk-SQWZXP4P.js.map → chunk-DJRRMFKH.js.map} +0 -0
  134. /package/dist/esm/{chunk-EODMRV4H.js.map → chunk-HAE333YO.js.map} +0 -0
  135. /package/dist/esm/{chunk-ILFWNK3W.js.map → chunk-MAU2MAK2.js.map} +0 -0
  136. /package/dist/esm/{chunk-N6T2JOGC.js.map → chunk-MC7CPQ6W.js.map} +0 -0
  137. /package/dist/esm/{chunk-AQ5YZERE.js.map → chunk-Y6E73I7I.js.map} +0 -0
  138. /package/dist/esm/{chunk-7QSZHJU5.js.map → chunk-YT6PD6UF.js.map} +0 -0
@@ -1,14 +1,18 @@
1
+ import {
2
+ QueryStreamService
3
+ } from "../chunk-EFMGNCWG.js";
1
4
  import {
2
5
  A2AService
3
- } from "../chunk-AQ5YZERE.js";
6
+ } from "../chunk-Y6E73I7I.js";
4
7
  import {
5
8
  QueryService
6
- } from "../chunk-N6T2JOGC.js";
7
- import "../chunk-F727XG4N.js";
9
+ } from "../chunk-MC7CPQ6W.js";
10
+ import "../chunk-VAZWF5IK.js";
8
11
  import "../chunk-FI2UQLVC.js";
9
- import "../chunk-64GEXWSE.js";
12
+ import "../chunk-N7VYM2R5.js";
10
13
  export {
11
14
  A2AService,
12
- QueryService
15
+ QueryService,
16
+ QueryStreamService
13
17
  };
14
18
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,74 @@
1
+ import { Response } from 'express';
2
+ import { A2AModule } from '../modules/a2a/a2a.module.js';
3
+ import { MCPModule } from '../modules/mcp/mcp.module.js';
4
+ import { SessionObject } from '../types/memory.js';
5
+ import { MemoryModule } from '../modules/memory/memory.module.js';
6
+ import { StreamEvent } from '../types/stream.js';
7
+ import { ModelModule } from '../modules/models/model.module.js';
8
+ import { AinAgentPrompts } from '../types/agent.js';
9
+ import '@a2a-js/sdk';
10
+ import '../modules/a2a/a2a.tool.js';
11
+ import '@a2a-js/sdk/client';
12
+ import '../types/tool.js';
13
+ import '@modelcontextprotocol/sdk/types.js';
14
+ import '../types/mcp.js';
15
+ import '@modelcontextprotocol/sdk/client/stdio.js';
16
+ import '../modules/mcp/mcp.tool.js';
17
+ import '../modules/memory/base.memory.js';
18
+ import '../modules/models/base.model.js';
19
+ import 'http-status-codes';
20
+
21
+ /**
22
+ * Service for processing user queries through the agent's AI pipeline.
23
+ *
24
+ * Orchestrates the query processing workflow including intent detection,
25
+ * model inference, tool execution, and response generation. Manages
26
+ * conversation context and coordinates between different modules.
27
+ */
28
+ declare class QueryStreamService {
29
+ private modelModule;
30
+ private a2aModule?;
31
+ private mcpModule?;
32
+ private memoryModule?;
33
+ private prompts?;
34
+ constructor(modelModule: ModelModule, a2aModule?: A2AModule, mcpModule?: MCPModule, memoryModule?: MemoryModule, prompts?: AinAgentPrompts);
35
+ /**
36
+ * Detects the intent from a user query.
37
+ *
38
+ * @param query - The user's input query
39
+ * @returns The detected intent (currently returns the query as-is)
40
+ * @todo Implement actual intent detection logic
41
+ */
42
+ private intentTriggering;
43
+ /**
44
+ * Fulfills the detected intent by generating a response.
45
+ *
46
+ * Manages the complete inference loop including:
47
+ * - Loading prompts and conversation history
48
+ * - Collecting available tools from modules
49
+ * - Executing model inference with tool support
50
+ * - Processing tool calls iteratively until completion
51
+ *
52
+ * @param query - The user's input query
53
+ * @param sessionId - Session identifier for context
54
+ * @param sessionHistory - Previous conversation history
55
+ * @returns Object containing process steps and final response
56
+ */
57
+ intentFulfilling(query: string, sessionId: string, sessionHistory: SessionObject): AsyncGenerator<StreamEvent>;
58
+ /**
59
+ * Main entry point for processing user queries.
60
+ *
61
+ * Handles the complete query lifecycle:
62
+ * 1. Loads session history from memory
63
+ * 2. Detects intent from the query
64
+ * 3. Fulfills the intent with AI response
65
+ * 4. Updates conversation history
66
+ *
67
+ * @param query - The user's input query
68
+ * @param sessionId - Unique session identifier
69
+ * @returns Object containing the AI-generated response
70
+ */
71
+ handleQueryStream(query: string, sessionId: string, res: Response, userId?: string): Promise<void>;
72
+ }
73
+
74
+ export { QueryStreamService };
@@ -0,0 +1,9 @@
1
+ import {
2
+ QueryStreamService
3
+ } from "../chunk-EFMGNCWG.js";
4
+ import "../chunk-FI2UQLVC.js";
5
+ import "../chunk-N7VYM2R5.js";
6
+ export {
7
+ QueryStreamService
8
+ };
9
+ //# sourceMappingURL=query-stream.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -14,6 +14,7 @@ import '../modules/mcp/mcp.tool.js';
14
14
  import '../modules/memory/base.memory.js';
15
15
  import '../types/memory.js';
16
16
  import '../modules/models/base.model.js';
17
+ import '../types/stream.js';
17
18
  import 'http-status-codes';
18
19
 
19
20
  /**
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  QueryService
3
- } from "../chunk-N6T2JOGC.js";
4
- import "../chunk-F727XG4N.js";
3
+ } from "../chunk-MC7CPQ6W.js";
4
+ import "../chunk-VAZWF5IK.js";
5
5
  import "../chunk-FI2UQLVC.js";
6
- import "../chunk-64GEXWSE.js";
6
+ import "../chunk-N7VYM2R5.js";
7
7
  export {
8
8
  QueryService
9
9
  };
@@ -54,6 +54,11 @@ type ChatObject = {
54
54
  [key: string]: unknown;
55
55
  };
56
56
  };
57
+ type SessionMetadata = {
58
+ title?: string;
59
+ sessionId: string;
60
+ updatedAt: number;
61
+ };
57
62
  /**
58
63
  * Represents a conversation session containing multiple chat messages.
59
64
  *
@@ -71,6 +76,7 @@ type ChatObject = {
71
76
  * ```
72
77
  */
73
78
  type SessionObject = {
79
+ title?: string;
74
80
  /** Collection of chat messages indexed by unique chat ID */
75
81
  chats: {
76
82
  [chatId: string]: ChatObject;
@@ -79,6 +85,8 @@ type SessionObject = {
79
85
  interface Intent {
80
86
  name: string;
81
87
  description: string;
88
+ prompt?: string;
89
+ llm?: string;
82
90
  }
83
91
 
84
- export { type ChatContentObject, type ChatObject, ChatRole, type Intent, MemoryType, type SessionObject };
92
+ export { type ChatContentObject, type ChatObject, ChatRole, type Intent, MemoryType, type SessionMetadata, type SessionObject };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ChatRole,
3
3
  MemoryType
4
- } from "../chunk-F727XG4N.js";
4
+ } from "../chunk-VAZWF5IK.js";
5
5
  export {
6
6
  ChatRole,
7
7
  MemoryType
@@ -0,0 +1,47 @@
1
+ import { ToolCall } from './tool.js';
2
+ import '@a2a-js/sdk';
3
+ import '@a2a-js/sdk/client';
4
+ import '@modelcontextprotocol/sdk/types.js';
5
+
6
+ type StreamEvent = {
7
+ event: "tool_start" | "tool_output" | "text_chunk" | "error";
8
+ data: Record<string, any>;
9
+ };
10
+ /**
11
+ * Tool call delta for streaming tool invocations
12
+ */
13
+ interface ToolCallDelta {
14
+ index: number;
15
+ id?: string;
16
+ type?: "function";
17
+ function?: ToolCall;
18
+ }
19
+ /**
20
+ * Normalized stream chunk interface for all LLM providers.
21
+ *
22
+ * This interface provides a consistent structure for stream responses
23
+ * across different AI model providers (OpenAI, Gemini, Claude, etc.)
24
+ */
25
+ interface StreamChunk {
26
+ /** Text content delta from the model */
27
+ delta?: {
28
+ role?: string;
29
+ content?: string;
30
+ tool_calls?: ToolCallDelta[];
31
+ };
32
+ /** Indicates if the stream has finished and why */
33
+ finish_reason?: "stop" | "length" | "tool_calls" | "content_filter" | null;
34
+ /** Provider-specific metadata */
35
+ metadata?: Record<string, unknown>;
36
+ }
37
+ /**
38
+ * Async iterable stream interface for LLM responses
39
+ */
40
+ interface LLMStream extends AsyncIterable<StreamChunk> {
41
+ /** Cancels the stream */
42
+ cancel?: () => void;
43
+ /** Stream metadata */
44
+ metadata?: Record<string, unknown>;
45
+ }
46
+
47
+ export type { LLMStream, StreamChunk, StreamEvent, ToolCallDelta };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -5,6 +5,7 @@ declare const getLogger: (service: string) => winston.Logger;
5
5
  declare const loggers: {
6
6
  readonly agent: winston.Logger;
7
7
  readonly intent: winston.Logger;
8
+ readonly intentStream: winston.Logger;
8
9
  readonly mcp: winston.Logger;
9
10
  readonly a2a: winston.Logger;
10
11
  readonly model: winston.Logger;
@@ -2,7 +2,7 @@ import {
2
2
  getLogger,
3
3
  logger,
4
4
  loggers
5
- } from "../chunk-64GEXWSE.js";
5
+ } from "../chunk-N7VYM2R5.js";
6
6
  export {
7
7
  getLogger,
8
8
  logger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainetwork/adk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "AI Network Agent Development Kit",
5
5
  "repository": "git@github.com:ainetwork-ai/ain-adk.git",
6
6
  "author": "AI Network (https://ainetwork.ai)",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/logger.ts"],"sourcesContent":["import winston from \"winston\";\n\nconst { combine, timestamp, printf, colorize, errors } = winston.format;\n\nconst createLogger = (service: string) => {\n\tconst logger = winston.createLogger({\n\t\tlevel: (process.env.LOG_LEVEL || \"info\").toLowerCase(),\n\t\tformat: combine(\n\t\t\terrors({ stack: true }),\n\t\t\tcolorize(),\n\t\t\ttimestamp({ format: \"HH:mm:ss\" }),\n\t\t\tprintf(({ level, message, timestamp, service, stack, ...meta }) => {\n\t\t\t\tconst metaStr = Object.keys(meta).length\n\t\t\t\t\t? ` | ${JSON.stringify(meta)}`\n\t\t\t\t\t: \"\";\n\t\t\t\tconst errorStack = stack ? `\\n${stack}` : \"\";\n\t\t\t\treturn `${timestamp} [${service}] ${level}: ${message}${metaStr}${errorStack}`;\n\t\t\t}),\n\t\t),\n\t\tdefaultMeta: { service },\n\t\ttransports: [new winston.transports.Console()],\n\t});\n\n\treturn logger;\n};\n\n// Default logger instance\nexport const logger = createLogger(\"ain-adk\");\n\n// Factory function for creating service-specific loggers\nexport const getLogger = (service: string) => createLogger(service);\n\n// Convenience methods for different components\nexport const loggers = {\n\tagent: getLogger(\"AINAgent\"),\n\tintent: getLogger(\"Intent\"),\n\tmcp: getLogger(\"MCPModule\"),\n\ta2a: getLogger(\"A2AModule\"),\n\tmodel: getLogger(\"Model\"),\n\tserver: getLogger(\"A2AServer\"),\n\tfol: getLogger(\"FOL\"),\n} as const;\n"],"mappings":";AAAA,OAAO,aAAa;AAEpB,IAAM,EAAE,SAAS,WAAW,QAAQ,UAAU,OAAO,IAAI,QAAQ;AAEjE,IAAM,eAAe,CAAC,YAAoB;AACzC,QAAMA,UAAS,QAAQ,aAAa;AAAA,IACnC,QAAQ,QAAQ,IAAI,aAAa,QAAQ,YAAY;AAAA,IACrD,QAAQ;AAAA,MACP,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,MACtB,SAAS;AAAA,MACT,UAAU,EAAE,QAAQ,WAAW,CAAC;AAAA,MAChC,OAAO,CAAC,EAAE,OAAO,SAAS,WAAAC,YAAW,SAAAC,UAAS,OAAO,GAAG,KAAK,MAAM;AAClE,cAAM,UAAU,OAAO,KAAK,IAAI,EAAE,SAC/B,MAAM,KAAK,UAAU,IAAI,CAAC,KAC1B;AACH,cAAM,aAAa,QAAQ;AAAA,EAAK,KAAK,KAAK;AAC1C,eAAO,GAAGD,UAAS,KAAKC,QAAO,KAAK,KAAK,KAAK,OAAO,GAAG,OAAO,GAAG,UAAU;AAAA,MAC7E,CAAC;AAAA,IACF;AAAA,IACA,aAAa,EAAE,QAAQ;AAAA,IACvB,YAAY,CAAC,IAAI,QAAQ,WAAW,QAAQ,CAAC;AAAA,EAC9C,CAAC;AAED,SAAOF;AACR;AAGO,IAAM,SAAS,aAAa,SAAS;AAGrC,IAAM,YAAY,CAAC,YAAoB,aAAa,OAAO;AAG3D,IAAM,UAAU;AAAA,EACtB,OAAO,UAAU,UAAU;AAAA,EAC3B,QAAQ,UAAU,QAAQ;AAAA,EAC1B,KAAK,UAAU,WAAW;AAAA,EAC1B,KAAK,UAAU,WAAW;AAAA,EAC1B,OAAO,UAAU,OAAO;AAAA,EACxB,QAAQ,UAAU,WAAW;AAAA,EAC7B,KAAK,UAAU,KAAK;AACrB;","names":["logger","timestamp","service"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/modules/models/base.model.ts"],"sourcesContent":["import type { SessionObject } from \"@/types/memory.js\";\nimport type { FetchResponse, IAgentTool } from \"@/types/tool.js\";\n\n/**\n * Abstract base class for AI model implementations.\n *\n * Provides a common interface for different AI model providers (OpenAI, Gemini, etc.)\n * to integrate with the AIN-ADK framework. Each model implementation must handle\n * message formatting, tool conversion, and API communication.\n *\n * @typeParam MessageType - The message format used by the specific model API\n * @typeParam FunctionType - The function/tool format used by the specific model API\n */\nexport abstract class BaseModel<MessageType, FunctionType> {\n\t/**\n\t * Generates an array of messages from session history and current query.\n\t *\n\t * @param sessionHistory - Previous conversation history\n\t * @param query - Current user query\n\t * @param systemPrompt - Optional system prompt to set context\n\t * @returns Array of messages formatted for the specific model API\n\t */\n\tabstract generateMessages(params: {\n\t\tquery: string;\n\t\tsessionHistory?: SessionObject;\n\t\tsystemPrompt?: string;\n\t}): MessageType[];\n\n\t/**\n\t * Appends a new message to the existing message array.\n\t *\n\t * @param messages - Existing message array to expand\n\t * @param message - New message content to append\n\t */\n\tabstract appendMessages(messages: MessageType[], message: string): void;\n\n\t/**\n\t * Converts protocol-agnostic tools to model-specific function format.\n\t *\n\t * @param tools - Array of agent tools from MCP or A2A sources\n\t * @returns Array of functions in the format required by the model API\n\t */\n\tabstract convertToolsToFunctions(tools: IAgentTool[]): FunctionType[];\n\n\t/**\n\t * Fetches a response from the model API without tool support.\n\t *\n\t * @param messages - Array of messages to send to the model\n\t * @returns Promise resolving to the model's response\n\t */\n\tabstract fetch(messages: MessageType[]): Promise<FetchResponse>;\n\n\t/**\n\t * Fetches a response from the model API with tool/function support.\n\t *\n\t * @param messages - Array of messages to send to the model\n\t * @param functions - Array of available functions/tools the model can call\n\t * @returns Promise resolving to the model's response, possibly including tool calls\n\t */\n\tabstract fetchWithContextMessage(\n\t\tmessages: MessageType[],\n\t\tfunctions: FunctionType[],\n\t): Promise<FetchResponse>;\n}\n"],"mappings":";AAaO,IAAe,YAAf,MAAoD;AAkD3D;","names":[]}
@@ -1,27 +0,0 @@
1
- import {
2
- QueryController
3
- } from "./chunk-WIJDRP2A.js";
4
- import {
5
- QueryService
6
- } from "./chunk-N6T2JOGC.js";
7
-
8
- // src/routes/query.routes.ts
9
- import { Router } from "express";
10
- var createQueryRouter = (agent) => {
11
- const router = Router();
12
- const queryService = new QueryService(
13
- agent.modelModule,
14
- agent.a2aModule,
15
- agent.mcpModule,
16
- agent.memoryModule,
17
- agent.manifest.prompts
18
- );
19
- const queryController = new QueryController(queryService);
20
- router.post("/query", queryController.handleQueryRequest);
21
- return router;
22
- };
23
-
24
- export {
25
- createQueryRouter
26
- };
27
- //# sourceMappingURL=chunk-NH7BYWQV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/routes/query.routes.ts"],"sourcesContent":["import { Router } from \"express\";\nimport { QueryController } from \"@/controllers/query.controller.js\";\nimport type { AINAgent } from \"@/index.js\";\nimport { QueryService } from \"@/services/query.service.js\";\n\nexport const createQueryRouter = (agent: AINAgent): Router => {\n\tconst router = Router();\n\n\tconst queryService = new QueryService(\n\t\tagent.modelModule,\n\t\tagent.a2aModule,\n\t\tagent.mcpModule,\n\t\tagent.memoryModule,\n\t\tagent.manifest.prompts,\n\t);\n\tconst queryController = new QueryController(queryService);\n\trouter.post(\"/query\", queryController.handleQueryRequest);\n\n\treturn router;\n};\n"],"mappings":";;;;;;;;AAAA,SAAS,cAAc;AAKhB,IAAM,oBAAoB,CAAC,UAA4B;AAC7D,QAAM,SAAS,OAAO;AAEtB,QAAM,eAAe,IAAI;AAAA,IACxB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM,SAAS;AAAA,EAChB;AACA,QAAM,kBAAkB,IAAI,gBAAgB,YAAY;AACxD,SAAO,KAAK,UAAU,gBAAgB,kBAAkB;AAExD,SAAO;AACR;","names":[]}
@@ -1,26 +0,0 @@
1
- // src/controllers/query.controller.ts
2
- var QueryController = class {
3
- queryService;
4
- constructor(queryService) {
5
- this.queryService = queryService;
6
- }
7
- handleQueryRequest = async (req, res, next) => {
8
- try {
9
- const { message, sessionId } = req.body;
10
- const userId = res.locals.userId;
11
- const result = await this.queryService.handleQuery(
12
- message,
13
- sessionId,
14
- userId
15
- );
16
- res.status(200).json(result);
17
- } catch (error) {
18
- next(error);
19
- }
20
- };
21
- };
22
-
23
- export {
24
- QueryController
25
- };
26
- //# sourceMappingURL=chunk-WIJDRP2A.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/controllers/query.controller.ts"],"sourcesContent":["import type { NextFunction, Request, Response } from \"express\";\nimport type { QueryService } from \"@/services\";\n\nexport class QueryController {\n\tprivate queryService;\n\n\tconstructor(queryService: QueryService) {\n\t\tthis.queryService = queryService;\n\t}\n\n\tpublic handleQueryRequest = async (\n\t\treq: Request,\n\t\tres: Response,\n\t\tnext: NextFunction,\n\t) => {\n\t\ttry {\n\t\t\tconst { message, sessionId } = req.body;\n\t\t\tconst userId = res.locals.userId;\n\n\t\t\tconst result = await this.queryService.handleQuery(\n\t\t\t\tmessage,\n\t\t\t\tsessionId,\n\t\t\t\tuserId,\n\t\t\t);\n\n\t\t\tres.status(200).json(result);\n\t\t} catch (error) {\n\t\t\tnext(error);\n\t\t}\n\t};\n}\n"],"mappings":";AAGO,IAAM,kBAAN,MAAsB;AAAA,EACpB;AAAA,EAER,YAAY,cAA4B;AACvC,SAAK,eAAe;AAAA,EACrB;AAAA,EAEO,qBAAqB,OAC3B,KACA,KACA,SACI;AACJ,QAAI;AACH,YAAM,EAAE,SAAS,UAAU,IAAI,IAAI;AACnC,YAAM,SAAS,IAAI,OAAO;AAE1B,YAAM,SAAS,MAAM,KAAK,aAAa;AAAA,QACtC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,UAAI,OAAO,GAAG,EAAE,KAAK,MAAM;AAAA,IAC5B,SAAS,OAAO;AACf,WAAK,KAAK;AAAA,IACX;AAAA,EACD;AACD;","names":[]}