@robota-sdk/agent-core 3.0.0-beta.1

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 (508) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/LICENSE +21 -0
  3. package/README.md +230 -0
  4. package/dist/abstracts/abstract-agent.d.ts +56 -0
  5. package/dist/abstracts/abstract-agent.d.ts.map +1 -0
  6. package/dist/abstracts/abstract-agent.js +55 -0
  7. package/dist/abstracts/abstract-agent.js.map +1 -0
  8. package/dist/abstracts/abstract-ai-provider.d.ts +187 -0
  9. package/dist/abstracts/abstract-ai-provider.d.ts.map +1 -0
  10. package/dist/abstracts/abstract-ai-provider.js +252 -0
  11. package/dist/abstracts/abstract-ai-provider.js.map +1 -0
  12. package/dist/abstracts/abstract-executor.d.ts +110 -0
  13. package/dist/abstracts/abstract-executor.d.ts.map +1 -0
  14. package/dist/abstracts/abstract-executor.js +156 -0
  15. package/dist/abstracts/abstract-executor.js.map +1 -0
  16. package/dist/abstracts/abstract-manager.d.ts +42 -0
  17. package/dist/abstracts/abstract-manager.d.ts.map +1 -0
  18. package/dist/abstracts/abstract-manager.js +49 -0
  19. package/dist/abstracts/abstract-manager.js.map +1 -0
  20. package/dist/abstracts/abstract-module.d.ts +365 -0
  21. package/dist/abstracts/abstract-module.d.ts.map +1 -0
  22. package/dist/abstracts/abstract-module.js +474 -0
  23. package/dist/abstracts/abstract-module.js.map +1 -0
  24. package/dist/abstracts/abstract-plugin.d.ts +369 -0
  25. package/dist/abstracts/abstract-plugin.d.ts.map +1 -0
  26. package/dist/abstracts/abstract-plugin.js +258 -0
  27. package/dist/abstracts/abstract-plugin.js.map +1 -0
  28. package/dist/abstracts/abstract-tool.d.ts +175 -0
  29. package/dist/abstracts/abstract-tool.d.ts.map +1 -0
  30. package/dist/abstracts/abstract-tool.js +140 -0
  31. package/dist/abstracts/abstract-tool.js.map +1 -0
  32. package/dist/abstracts/abstract-workflow-converter.d.ts +136 -0
  33. package/dist/abstracts/abstract-workflow-converter.d.ts.map +1 -0
  34. package/dist/abstracts/abstract-workflow-converter.js +252 -0
  35. package/dist/abstracts/abstract-workflow-converter.js.map +1 -0
  36. package/dist/abstracts/abstract-workflow-validator.d.ts +203 -0
  37. package/dist/abstracts/abstract-workflow-validator.d.ts.map +1 -0
  38. package/dist/abstracts/abstract-workflow-validator.js +447 -0
  39. package/dist/abstracts/abstract-workflow-validator.js.map +1 -0
  40. package/dist/abstracts/index.d.ts +6 -0
  41. package/dist/abstracts/index.d.ts.map +1 -0
  42. package/dist/abstracts/index.js +9 -0
  43. package/dist/abstracts/index.js.map +1 -0
  44. package/dist/agents/constants.d.ts +23 -0
  45. package/dist/agents/constants.d.ts.map +1 -0
  46. package/dist/agents/constants.js +22 -0
  47. package/dist/agents/constants.js.map +1 -0
  48. package/dist/agents/index.d.ts +1 -0
  49. package/dist/agents/index.d.ts.map +1 -0
  50. package/dist/agents/index.js +4 -0
  51. package/dist/agents/index.js.map +1 -0
  52. package/dist/agents/robota.test.d.ts +2 -0
  53. package/dist/agents/robota.test.d.ts.map +1 -0
  54. package/dist/agents/robota.test.js +416 -0
  55. package/dist/agents/robota.test.js.map +1 -0
  56. package/dist/browser/builtin-templates.json +107 -0
  57. package/dist/browser/index.d.ts +4237 -0
  58. package/dist/browser/index.js +4 -0
  59. package/dist/core/robota.d.ts +694 -0
  60. package/dist/core/robota.d.ts.map +1 -0
  61. package/dist/core/robota.js +1277 -0
  62. package/dist/core/robota.js.map +1 -0
  63. package/dist/executors/local-executor.d.ts +96 -0
  64. package/dist/executors/local-executor.d.ts.map +1 -0
  65. package/dist/executors/local-executor.js +197 -0
  66. package/dist/executors/local-executor.js.map +1 -0
  67. package/dist/executors/local-executor.test.d.ts +2 -0
  68. package/dist/executors/local-executor.test.d.ts.map +1 -0
  69. package/dist/executors/local-executor.test.js +192 -0
  70. package/dist/executors/local-executor.test.js.map +1 -0
  71. package/dist/index.d.ts +274 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +235 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/interfaces/agent.d.ts +198 -0
  76. package/dist/interfaces/agent.d.ts.map +1 -0
  77. package/dist/interfaces/agent.js +2 -0
  78. package/dist/interfaces/agent.js.map +1 -0
  79. package/dist/interfaces/event-service.d.ts +79 -0
  80. package/dist/interfaces/event-service.d.ts.map +1 -0
  81. package/dist/interfaces/event-service.js +2 -0
  82. package/dist/interfaces/event-service.js.map +1 -0
  83. package/dist/interfaces/executor.d.ts +128 -0
  84. package/dist/interfaces/executor.d.ts.map +1 -0
  85. package/dist/interfaces/executor.js +2 -0
  86. package/dist/interfaces/executor.js.map +1 -0
  87. package/dist/interfaces/history-module.d.ts +19 -0
  88. package/dist/interfaces/history-module.d.ts.map +1 -0
  89. package/dist/interfaces/history-module.js +2 -0
  90. package/dist/interfaces/history-module.js.map +1 -0
  91. package/dist/interfaces/index.d.ts +13 -0
  92. package/dist/interfaces/index.d.ts.map +1 -0
  93. package/dist/interfaces/index.js +4 -0
  94. package/dist/interfaces/index.js.map +1 -0
  95. package/dist/interfaces/manager.d.ts +142 -0
  96. package/dist/interfaces/manager.d.ts.map +1 -0
  97. package/dist/interfaces/manager.js +2 -0
  98. package/dist/interfaces/manager.js.map +1 -0
  99. package/dist/interfaces/messages.d.ts +75 -0
  100. package/dist/interfaces/messages.d.ts.map +1 -0
  101. package/dist/interfaces/messages.js +29 -0
  102. package/dist/interfaces/messages.js.map +1 -0
  103. package/dist/interfaces/progress-reporting.d.ts +86 -0
  104. package/dist/interfaces/progress-reporting.d.ts.map +1 -0
  105. package/dist/interfaces/progress-reporting.js +37 -0
  106. package/dist/interfaces/progress-reporting.js.map +1 -0
  107. package/dist/interfaces/provider.d.ts +217 -0
  108. package/dist/interfaces/provider.d.ts.map +1 -0
  109. package/dist/interfaces/provider.js +2 -0
  110. package/dist/interfaces/provider.js.map +1 -0
  111. package/dist/interfaces/service.d.ts +205 -0
  112. package/dist/interfaces/service.d.ts.map +1 -0
  113. package/dist/interfaces/service.js +6 -0
  114. package/dist/interfaces/service.js.map +1 -0
  115. package/dist/interfaces/tool.d.ts +248 -0
  116. package/dist/interfaces/tool.d.ts.map +1 -0
  117. package/dist/interfaces/tool.js +2 -0
  118. package/dist/interfaces/tool.js.map +1 -0
  119. package/dist/interfaces/types.d.ts +71 -0
  120. package/dist/interfaces/types.d.ts.map +1 -0
  121. package/dist/interfaces/types.js +33 -0
  122. package/dist/interfaces/types.js.map +1 -0
  123. package/dist/interfaces/workflow-converter.d.ts +193 -0
  124. package/dist/interfaces/workflow-converter.d.ts.map +1 -0
  125. package/dist/interfaces/workflow-converter.js +11 -0
  126. package/dist/interfaces/workflow-converter.js.map +1 -0
  127. package/dist/interfaces/workflow-validator.d.ts +209 -0
  128. package/dist/interfaces/workflow-validator.d.ts.map +1 -0
  129. package/dist/interfaces/workflow-validator.js +16 -0
  130. package/dist/interfaces/workflow-validator.js.map +1 -0
  131. package/dist/managers/agent-factory.d.ts +132 -0
  132. package/dist/managers/agent-factory.d.ts.map +1 -0
  133. package/dist/managers/agent-factory.js +284 -0
  134. package/dist/managers/agent-factory.js.map +1 -0
  135. package/dist/managers/agent-factory.test.d.ts +2 -0
  136. package/dist/managers/agent-factory.test.d.ts.map +1 -0
  137. package/dist/managers/agent-factory.test.js +249 -0
  138. package/dist/managers/agent-factory.test.js.map +1 -0
  139. package/dist/managers/agent-templates.d.ts +84 -0
  140. package/dist/managers/agent-templates.d.ts.map +1 -0
  141. package/dist/managers/agent-templates.js +159 -0
  142. package/dist/managers/agent-templates.js.map +1 -0
  143. package/dist/managers/ai-provider-manager.d.ts +80 -0
  144. package/dist/managers/ai-provider-manager.d.ts.map +1 -0
  145. package/dist/managers/ai-provider-manager.js +226 -0
  146. package/dist/managers/ai-provider-manager.js.map +1 -0
  147. package/dist/managers/conversation-history-manager.d.ts +455 -0
  148. package/dist/managers/conversation-history-manager.d.ts.map +1 -0
  149. package/dist/managers/conversation-history-manager.js +578 -0
  150. package/dist/managers/conversation-history-manager.js.map +1 -0
  151. package/dist/managers/conversation-history-manager.test.d.ts +2 -0
  152. package/dist/managers/conversation-history-manager.test.d.ts.map +1 -0
  153. package/dist/managers/conversation-history-manager.test.js +374 -0
  154. package/dist/managers/conversation-history-manager.test.js.map +1 -0
  155. package/dist/managers/index.d.ts +8 -0
  156. package/dist/managers/index.d.ts.map +1 -0
  157. package/dist/managers/index.js +8 -0
  158. package/dist/managers/index.js.map +1 -0
  159. package/dist/managers/module-registry.d.ts +161 -0
  160. package/dist/managers/module-registry.d.ts.map +1 -0
  161. package/dist/managers/module-registry.js +519 -0
  162. package/dist/managers/module-registry.js.map +1 -0
  163. package/dist/managers/module-type-registry.d.ts +113 -0
  164. package/dist/managers/module-type-registry.d.ts.map +1 -0
  165. package/dist/managers/module-type-registry.js +439 -0
  166. package/dist/managers/module-type-registry.js.map +1 -0
  167. package/dist/managers/plugins.d.ts +166 -0
  168. package/dist/managers/plugins.d.ts.map +1 -0
  169. package/dist/managers/plugins.js +339 -0
  170. package/dist/managers/plugins.js.map +1 -0
  171. package/dist/managers/tool-manager.d.ts +70 -0
  172. package/dist/managers/tool-manager.d.ts.map +1 -0
  173. package/dist/managers/tool-manager.js +138 -0
  174. package/dist/managers/tool-manager.js.map +1 -0
  175. package/dist/managers/tool-manager.test.d.ts +2 -0
  176. package/dist/managers/tool-manager.test.d.ts.map +1 -0
  177. package/dist/managers/tool-manager.test.js +186 -0
  178. package/dist/managers/tool-manager.test.js.map +1 -0
  179. package/dist/node/builtin-templates.json +107 -0
  180. package/dist/node/index.cjs +4 -0
  181. package/dist/node/index.d.cts +4237 -0
  182. package/dist/node/index.d.ts +4237 -0
  183. package/dist/node/index.js +4 -0
  184. package/dist/plugins/conversation-history/conversation-history-plugin.d.ts +67 -0
  185. package/dist/plugins/conversation-history/conversation-history-plugin.d.ts.map +1 -0
  186. package/dist/plugins/conversation-history/conversation-history-plugin.js +270 -0
  187. package/dist/plugins/conversation-history/conversation-history-plugin.js.map +1 -0
  188. package/dist/plugins/conversation-history/index.d.ts +3 -0
  189. package/dist/plugins/conversation-history/index.d.ts.map +1 -0
  190. package/dist/plugins/conversation-history/index.js +2 -0
  191. package/dist/plugins/conversation-history/index.js.map +1 -0
  192. package/dist/plugins/conversation-history/storages/database-storage.d.ts +19 -0
  193. package/dist/plugins/conversation-history/storages/database-storage.d.ts.map +1 -0
  194. package/dist/plugins/conversation-history/storages/database-storage.js +94 -0
  195. package/dist/plugins/conversation-history/storages/database-storage.js.map +1 -0
  196. package/dist/plugins/conversation-history/storages/file-storage.d.ts +15 -0
  197. package/dist/plugins/conversation-history/storages/file-storage.d.ts.map +1 -0
  198. package/dist/plugins/conversation-history/storages/file-storage.js +94 -0
  199. package/dist/plugins/conversation-history/storages/file-storage.js.map +1 -0
  200. package/dist/plugins/conversation-history/storages/index.d.ts +4 -0
  201. package/dist/plugins/conversation-history/storages/index.d.ts.map +1 -0
  202. package/dist/plugins/conversation-history/storages/index.js +4 -0
  203. package/dist/plugins/conversation-history/storages/index.js.map +1 -0
  204. package/dist/plugins/conversation-history/storages/memory-storage.d.ts +15 -0
  205. package/dist/plugins/conversation-history/storages/memory-storage.d.ts.map +1 -0
  206. package/dist/plugins/conversation-history/storages/memory-storage.js +33 -0
  207. package/dist/plugins/conversation-history/storages/memory-storage.js.map +1 -0
  208. package/dist/plugins/conversation-history/types.d.ts +61 -0
  209. package/dist/plugins/conversation-history/types.d.ts.map +1 -0
  210. package/dist/plugins/conversation-history/types.js +2 -0
  211. package/dist/plugins/conversation-history/types.js.map +1 -0
  212. package/dist/plugins/error-handling/context-adapter.d.ts +30 -0
  213. package/dist/plugins/error-handling/context-adapter.d.ts.map +1 -0
  214. package/dist/plugins/error-handling/context-adapter.js +41 -0
  215. package/dist/plugins/error-handling/context-adapter.js.map +1 -0
  216. package/dist/plugins/error-handling/error-handling-plugin.d.ts +49 -0
  217. package/dist/plugins/error-handling/error-handling-plugin.d.ts.map +1 -0
  218. package/dist/plugins/error-handling/error-handling-plugin.js +229 -0
  219. package/dist/plugins/error-handling/error-handling-plugin.js.map +1 -0
  220. package/dist/plugins/error-handling/index.d.ts +10 -0
  221. package/dist/plugins/error-handling/index.d.ts.map +1 -0
  222. package/dist/plugins/error-handling/index.js +10 -0
  223. package/dist/plugins/error-handling/index.js.map +1 -0
  224. package/dist/plugins/error-handling/types.d.ts +73 -0
  225. package/dist/plugins/error-handling/types.d.ts.map +1 -0
  226. package/dist/plugins/error-handling/types.js +14 -0
  227. package/dist/plugins/error-handling/types.js.map +1 -0
  228. package/dist/plugins/event-emitter/metrics.d.ts +17 -0
  229. package/dist/plugins/event-emitter/metrics.d.ts.map +1 -0
  230. package/dist/plugins/event-emitter/metrics.js +17 -0
  231. package/dist/plugins/event-emitter/metrics.js.map +1 -0
  232. package/dist/plugins/event-emitter/types.d.ts +112 -0
  233. package/dist/plugins/event-emitter/types.d.ts.map +1 -0
  234. package/dist/plugins/event-emitter/types.js +65 -0
  235. package/dist/plugins/event-emitter/types.js.map +1 -0
  236. package/dist/plugins/event-emitter-plugin.d.ts +222 -0
  237. package/dist/plugins/event-emitter-plugin.d.ts.map +1 -0
  238. package/dist/plugins/event-emitter-plugin.js +432 -0
  239. package/dist/plugins/event-emitter-plugin.js.map +1 -0
  240. package/dist/plugins/event-emitter-plugin.test.d.ts +2 -0
  241. package/dist/plugins/event-emitter-plugin.test.d.ts.map +1 -0
  242. package/dist/plugins/event-emitter-plugin.test.js +94 -0
  243. package/dist/plugins/event-emitter-plugin.test.js.map +1 -0
  244. package/dist/plugins/execution/execution-analytics-plugin.d.ts +129 -0
  245. package/dist/plugins/execution/execution-analytics-plugin.d.ts.map +1 -0
  246. package/dist/plugins/execution/execution-analytics-plugin.js +517 -0
  247. package/dist/plugins/execution/execution-analytics-plugin.js.map +1 -0
  248. package/dist/plugins/execution/index.d.ts +3 -0
  249. package/dist/plugins/execution/index.d.ts.map +1 -0
  250. package/dist/plugins/execution/index.js +2 -0
  251. package/dist/plugins/execution/index.js.map +1 -0
  252. package/dist/plugins/execution/types.d.ts +90 -0
  253. package/dist/plugins/execution/types.d.ts.map +1 -0
  254. package/dist/plugins/execution/types.js +2 -0
  255. package/dist/plugins/execution/types.js.map +1 -0
  256. package/dist/plugins/index.d.ts +10 -0
  257. package/dist/plugins/index.d.ts.map +1 -0
  258. package/dist/plugins/index.js +11 -0
  259. package/dist/plugins/index.js.map +1 -0
  260. package/dist/plugins/limits/types.d.ts +61 -0
  261. package/dist/plugins/limits/types.d.ts.map +1 -0
  262. package/dist/plugins/limits/types.js +2 -0
  263. package/dist/plugins/limits/types.js.map +1 -0
  264. package/dist/plugins/limits-plugin.d.ts +113 -0
  265. package/dist/plugins/limits-plugin.d.ts.map +1 -0
  266. package/dist/plugins/limits-plugin.js +380 -0
  267. package/dist/plugins/limits-plugin.js.map +1 -0
  268. package/dist/plugins/logging/formatters.d.ts +14 -0
  269. package/dist/plugins/logging/formatters.d.ts.map +1 -0
  270. package/dist/plugins/logging/formatters.js +24 -0
  271. package/dist/plugins/logging/formatters.js.map +1 -0
  272. package/dist/plugins/logging/index.d.ts +3 -0
  273. package/dist/plugins/logging/index.d.ts.map +1 -0
  274. package/dist/plugins/logging/index.js +2 -0
  275. package/dist/plugins/logging/index.js.map +1 -0
  276. package/dist/plugins/logging/logging-plugin.d.ts +91 -0
  277. package/dist/plugins/logging/logging-plugin.d.ts.map +1 -0
  278. package/dist/plugins/logging/logging-plugin.js +335 -0
  279. package/dist/plugins/logging/logging-plugin.js.map +1 -0
  280. package/dist/plugins/logging/storages/console-storage.d.ts +14 -0
  281. package/dist/plugins/logging/storages/console-storage.d.ts.map +1 -0
  282. package/dist/plugins/logging/storages/console-storage.js +38 -0
  283. package/dist/plugins/logging/storages/console-storage.js.map +1 -0
  284. package/dist/plugins/logging/storages/file-storage.d.ts +14 -0
  285. package/dist/plugins/logging/storages/file-storage.d.ts.map +1 -0
  286. package/dist/plugins/logging/storages/file-storage.js +41 -0
  287. package/dist/plugins/logging/storages/file-storage.js.map +1 -0
  288. package/dist/plugins/logging/storages/index.d.ts +5 -0
  289. package/dist/plugins/logging/storages/index.d.ts.map +1 -0
  290. package/dist/plugins/logging/storages/index.js +5 -0
  291. package/dist/plugins/logging/storages/index.js.map +1 -0
  292. package/dist/plugins/logging/storages/remote-storage.d.ts +20 -0
  293. package/dist/plugins/logging/storages/remote-storage.d.ts.map +1 -0
  294. package/dist/plugins/logging/storages/remote-storage.js +61 -0
  295. package/dist/plugins/logging/storages/remote-storage.js.map +1 -0
  296. package/dist/plugins/logging/storages/silent-storage.d.ts +10 -0
  297. package/dist/plugins/logging/storages/silent-storage.d.ts.map +1 -0
  298. package/dist/plugins/logging/storages/silent-storage.js +15 -0
  299. package/dist/plugins/logging/storages/silent-storage.js.map +1 -0
  300. package/dist/plugins/logging/types.d.ts +84 -0
  301. package/dist/plugins/logging/types.d.ts.map +1 -0
  302. package/dist/plugins/logging/types.js +2 -0
  303. package/dist/plugins/logging/types.js.map +1 -0
  304. package/dist/plugins/performance/collectors/system-metrics-collector.d.ts +12 -0
  305. package/dist/plugins/performance/collectors/system-metrics-collector.d.ts.map +1 -0
  306. package/dist/plugins/performance/collectors/system-metrics-collector.js +65 -0
  307. package/dist/plugins/performance/collectors/system-metrics-collector.js.map +1 -0
  308. package/dist/plugins/performance/index.d.ts +5 -0
  309. package/dist/plugins/performance/index.d.ts.map +1 -0
  310. package/dist/plugins/performance/index.js +4 -0
  311. package/dist/plugins/performance/index.js.map +1 -0
  312. package/dist/plugins/performance/performance-plugin.d.ts +49 -0
  313. package/dist/plugins/performance/performance-plugin.d.ts.map +1 -0
  314. package/dist/plugins/performance/performance-plugin.js +293 -0
  315. package/dist/plugins/performance/performance-plugin.js.map +1 -0
  316. package/dist/plugins/performance/storages/index.d.ts +2 -0
  317. package/dist/plugins/performance/storages/index.d.ts.map +1 -0
  318. package/dist/plugins/performance/storages/index.js +4 -0
  319. package/dist/plugins/performance/storages/index.js.map +1 -0
  320. package/dist/plugins/performance/storages/memory-storage.d.ts +19 -0
  321. package/dist/plugins/performance/storages/memory-storage.d.ts.map +1 -0
  322. package/dist/plugins/performance/storages/memory-storage.js +69 -0
  323. package/dist/plugins/performance/storages/memory-storage.js.map +1 -0
  324. package/dist/plugins/performance/types.d.ts +154 -0
  325. package/dist/plugins/performance/types.d.ts.map +1 -0
  326. package/dist/plugins/performance/types.js +2 -0
  327. package/dist/plugins/performance/types.js.map +1 -0
  328. package/dist/plugins/usage/aggregate-usage-stats.d.ts +12 -0
  329. package/dist/plugins/usage/aggregate-usage-stats.d.ts.map +1 -0
  330. package/dist/plugins/usage/aggregate-usage-stats.js +115 -0
  331. package/dist/plugins/usage/aggregate-usage-stats.js.map +1 -0
  332. package/dist/plugins/usage/index.d.ts +5 -0
  333. package/dist/plugins/usage/index.d.ts.map +1 -0
  334. package/dist/plugins/usage/index.js +4 -0
  335. package/dist/plugins/usage/index.js.map +1 -0
  336. package/dist/plugins/usage/storages/file-storage.d.ts +22 -0
  337. package/dist/plugins/usage/storages/file-storage.d.ts.map +1 -0
  338. package/dist/plugins/usage/storages/file-storage.js +111 -0
  339. package/dist/plugins/usage/storages/file-storage.js.map +1 -0
  340. package/dist/plugins/usage/storages/index.d.ts +5 -0
  341. package/dist/plugins/usage/storages/index.d.ts.map +1 -0
  342. package/dist/plugins/usage/storages/index.js +5 -0
  343. package/dist/plugins/usage/storages/index.js.map +1 -0
  344. package/dist/plugins/usage/storages/memory-storage.d.ts +22 -0
  345. package/dist/plugins/usage/storages/memory-storage.d.ts.map +1 -0
  346. package/dist/plugins/usage/storages/memory-storage.js +42 -0
  347. package/dist/plugins/usage/storages/memory-storage.js.map +1 -0
  348. package/dist/plugins/usage/storages/remote-storage.d.ts +26 -0
  349. package/dist/plugins/usage/storages/remote-storage.d.ts.map +1 -0
  350. package/dist/plugins/usage/storages/remote-storage.js +115 -0
  351. package/dist/plugins/usage/storages/remote-storage.js.map +1 -0
  352. package/dist/plugins/usage/storages/silent-storage.d.ts +19 -0
  353. package/dist/plugins/usage/storages/silent-storage.d.ts.map +1 -0
  354. package/dist/plugins/usage/storages/silent-storage.js +26 -0
  355. package/dist/plugins/usage/storages/silent-storage.js.map +1 -0
  356. package/dist/plugins/usage/types.d.ts +127 -0
  357. package/dist/plugins/usage/types.d.ts.map +1 -0
  358. package/dist/plugins/usage/types.js +2 -0
  359. package/dist/plugins/usage/types.js.map +1 -0
  360. package/dist/plugins/usage/usage-plugin.d.ts +67 -0
  361. package/dist/plugins/usage/usage-plugin.d.ts.map +1 -0
  362. package/dist/plugins/usage/usage-plugin.js +309 -0
  363. package/dist/plugins/usage/usage-plugin.js.map +1 -0
  364. package/dist/plugins/webhook/http-client.d.ts +30 -0
  365. package/dist/plugins/webhook/http-client.d.ts.map +1 -0
  366. package/dist/plugins/webhook/http-client.js +110 -0
  367. package/dist/plugins/webhook/http-client.js.map +1 -0
  368. package/dist/plugins/webhook/index.d.ts +9 -0
  369. package/dist/plugins/webhook/index.d.ts.map +1 -0
  370. package/dist/plugins/webhook/index.js +9 -0
  371. package/dist/plugins/webhook/index.js.map +1 -0
  372. package/dist/plugins/webhook/transformer.d.ts +63 -0
  373. package/dist/plugins/webhook/transformer.d.ts.map +1 -0
  374. package/dist/plugins/webhook/transformer.js +157 -0
  375. package/dist/plugins/webhook/transformer.js.map +1 -0
  376. package/dist/plugins/webhook/types.d.ts +183 -0
  377. package/dist/plugins/webhook/types.d.ts.map +1 -0
  378. package/dist/plugins/webhook/types.js +2 -0
  379. package/dist/plugins/webhook/types.js.map +1 -0
  380. package/dist/plugins/webhook/webhook-plugin.d.ts +92 -0
  381. package/dist/plugins/webhook/webhook-plugin.d.ts.map +1 -0
  382. package/dist/plugins/webhook/webhook-plugin.js +328 -0
  383. package/dist/plugins/webhook/webhook-plugin.js.map +1 -0
  384. package/dist/schemas/agent-template-schema.d.ts +137 -0
  385. package/dist/schemas/agent-template-schema.d.ts.map +1 -0
  386. package/dist/schemas/agent-template-schema.js +87 -0
  387. package/dist/schemas/agent-template-schema.js.map +1 -0
  388. package/dist/services/conversation-service/index.d.ts +88 -0
  389. package/dist/services/conversation-service/index.d.ts.map +1 -0
  390. package/dist/services/conversation-service/index.js +441 -0
  391. package/dist/services/conversation-service/index.js.map +1 -0
  392. package/dist/services/conversation-service/types.d.ts +32 -0
  393. package/dist/services/conversation-service/types.d.ts.map +1 -0
  394. package/dist/services/conversation-service/types.js +8 -0
  395. package/dist/services/conversation-service/types.js.map +1 -0
  396. package/dist/services/event-service.d.ts +61 -0
  397. package/dist/services/event-service.d.ts.map +1 -0
  398. package/dist/services/event-service.js +110 -0
  399. package/dist/services/event-service.js.map +1 -0
  400. package/dist/services/event-service.test.d.ts +2 -0
  401. package/dist/services/event-service.test.d.ts.map +1 -0
  402. package/dist/services/event-service.test.js +86 -0
  403. package/dist/services/event-service.test.js.map +1 -0
  404. package/dist/services/execution-service.d.ts +151 -0
  405. package/dist/services/execution-service.d.ts.map +1 -0
  406. package/dist/services/execution-service.js +1262 -0
  407. package/dist/services/execution-service.js.map +1 -0
  408. package/dist/services/execution-service.test.d.ts +2 -0
  409. package/dist/services/execution-service.test.d.ts.map +1 -0
  410. package/dist/services/execution-service.test.js +338 -0
  411. package/dist/services/execution-service.test.js.map +1 -0
  412. package/dist/services/history-module.d.ts +15 -0
  413. package/dist/services/history-module.d.ts.map +1 -0
  414. package/dist/services/history-module.js +42 -0
  415. package/dist/services/history-module.js.map +1 -0
  416. package/dist/services/in-memory-history-store.d.ts +12 -0
  417. package/dist/services/in-memory-history-store.d.ts.map +1 -0
  418. package/dist/services/in-memory-history-store.js +41 -0
  419. package/dist/services/in-memory-history-store.js.map +1 -0
  420. package/dist/services/index.d.ts +7 -0
  421. package/dist/services/index.d.ts.map +1 -0
  422. package/dist/services/index.js +13 -0
  423. package/dist/services/index.js.map +1 -0
  424. package/dist/services/task-events.d.ts +6 -0
  425. package/dist/services/task-events.d.ts.map +1 -0
  426. package/dist/services/task-events.js +6 -0
  427. package/dist/services/task-events.js.map +1 -0
  428. package/dist/services/tool-execution-service.d.ts +74 -0
  429. package/dist/services/tool-execution-service.d.ts.map +1 -0
  430. package/dist/services/tool-execution-service.js +189 -0
  431. package/dist/services/tool-execution-service.js.map +1 -0
  432. package/dist/services/user-events.d.ts +7 -0
  433. package/dist/services/user-events.d.ts.map +1 -0
  434. package/dist/services/user-events.js +6 -0
  435. package/dist/services/user-events.js.map +1 -0
  436. package/dist/tools/implementations/function-tool/index.d.ts +9 -0
  437. package/dist/tools/implementations/function-tool/index.d.ts.map +1 -0
  438. package/dist/tools/implementations/function-tool/index.js +13 -0
  439. package/dist/tools/implementations/function-tool/index.js.map +1 -0
  440. package/dist/tools/implementations/function-tool/schema-converter.d.ts +32 -0
  441. package/dist/tools/implementations/function-tool/schema-converter.d.ts.map +1 -0
  442. package/dist/tools/implementations/function-tool/schema-converter.js +164 -0
  443. package/dist/tools/implementations/function-tool/schema-converter.js.map +1 -0
  444. package/dist/tools/implementations/function-tool/types.d.ts +72 -0
  445. package/dist/tools/implementations/function-tool/types.d.ts.map +1 -0
  446. package/dist/tools/implementations/function-tool/types.js +14 -0
  447. package/dist/tools/implementations/function-tool/types.js.map +1 -0
  448. package/dist/tools/implementations/function-tool.d.ts +49 -0
  449. package/dist/tools/implementations/function-tool.d.ts.map +1 -0
  450. package/dist/tools/implementations/function-tool.js +223 -0
  451. package/dist/tools/implementations/function-tool.js.map +1 -0
  452. package/dist/tools/implementations/index.d.ts +4 -0
  453. package/dist/tools/implementations/index.d.ts.map +1 -0
  454. package/dist/tools/implementations/index.js +5 -0
  455. package/dist/tools/implementations/index.js.map +1 -0
  456. package/dist/tools/implementations/mcp-tool.d.ts +72 -0
  457. package/dist/tools/implementations/mcp-tool.d.ts.map +1 -0
  458. package/dist/tools/implementations/mcp-tool.js +246 -0
  459. package/dist/tools/implementations/mcp-tool.js.map +1 -0
  460. package/dist/tools/implementations/openapi-tool.d.ts +56 -0
  461. package/dist/tools/implementations/openapi-tool.d.ts.map +1 -0
  462. package/dist/tools/implementations/openapi-tool.js +324 -0
  463. package/dist/tools/implementations/openapi-tool.js.map +1 -0
  464. package/dist/tools/implementations/relay-mcp-tool.d.ts +38 -0
  465. package/dist/tools/implementations/relay-mcp-tool.d.ts.map +1 -0
  466. package/dist/tools/implementations/relay-mcp-tool.js +46 -0
  467. package/dist/tools/implementations/relay-mcp-tool.js.map +1 -0
  468. package/dist/tools/index.d.ts +3 -0
  469. package/dist/tools/index.d.ts.map +1 -0
  470. package/dist/tools/index.js +4 -0
  471. package/dist/tools/index.js.map +1 -0
  472. package/dist/tools/registry/index.d.ts +2 -0
  473. package/dist/tools/registry/index.d.ts.map +1 -0
  474. package/dist/tools/registry/index.js +3 -0
  475. package/dist/tools/registry/index.js.map +1 -0
  476. package/dist/tools/registry/tool-registry.d.ts +54 -0
  477. package/dist/tools/registry/tool-registry.d.ts.map +1 -0
  478. package/dist/tools/registry/tool-registry.js +146 -0
  479. package/dist/tools/registry/tool-registry.js.map +1 -0
  480. package/dist/utils/errors.d.ts +155 -0
  481. package/dist/utils/errors.d.ts.map +1 -0
  482. package/dist/utils/errors.js +203 -0
  483. package/dist/utils/errors.js.map +1 -0
  484. package/dist/utils/execution-proxy.d.ts +75 -0
  485. package/dist/utils/execution-proxy.d.ts.map +1 -0
  486. package/dist/utils/execution-proxy.js +230 -0
  487. package/dist/utils/execution-proxy.js.map +1 -0
  488. package/dist/utils/index.d.ts +11 -0
  489. package/dist/utils/index.d.ts.map +1 -0
  490. package/dist/utils/index.js +7 -0
  491. package/dist/utils/index.js.map +1 -0
  492. package/dist/utils/logger.d.ts +74 -0
  493. package/dist/utils/logger.d.ts.map +1 -0
  494. package/dist/utils/logger.js +143 -0
  495. package/dist/utils/logger.js.map +1 -0
  496. package/dist/utils/message-converter.d.ts +68 -0
  497. package/dist/utils/message-converter.d.ts.map +1 -0
  498. package/dist/utils/message-converter.js +87 -0
  499. package/dist/utils/message-converter.js.map +1 -0
  500. package/dist/utils/periodic-task.d.ts +14 -0
  501. package/dist/utils/periodic-task.d.ts.map +1 -0
  502. package/dist/utils/periodic-task.js +26 -0
  503. package/dist/utils/periodic-task.js.map +1 -0
  504. package/dist/utils/validation.d.ts +40 -0
  505. package/dist/utils/validation.d.ts.map +1 -0
  506. package/dist/utils/validation.js +162 -0
  507. package/dist/utils/validation.js.map +1 -0
  508. package/package.json +101 -0
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Service layer interfaces for the agents package
3
+ * Defines contracts for stateless service implementations
4
+ */
5
+ import type { TUniversalMessage } from './messages';
6
+ import type { IToolSchema, IAIProvider } from './provider';
7
+ import type { TUniversalValue } from './types';
8
+ import type { IToolCall } from './messages';
9
+ import type { IOwnerPathSegment, IEventService } from './event-service';
10
+ import type { TToolParameters, TToolMetadata } from './tool';
11
+ /**
12
+ * Reusable type definitions for service layer
13
+ */
14
+ /**
15
+ * Metadata type for conversation and execution context
16
+ * Used for storing additional information about conversations, responses, and execution
17
+ */
18
+ export type TConversationContextMetadata = Record<string, string | number | boolean | Date>;
19
+ /**
20
+ * Tool execution parameters type
21
+ * Used for passing parameters to tool execution methods
22
+ */
23
+ export type TToolExecutionParameters = Record<string, string | number | boolean | string[] | number[] | boolean[]>;
24
+ /**
25
+ * Execution metadata type
26
+ * Used for storing metadata about execution processes and options
27
+ */
28
+ export type TExecutionMetadata = Record<string, string | number | boolean | Date>;
29
+ /**
30
+ * Response metadata type
31
+ * Used for storing metadata about AI provider responses and streaming chunks
32
+ */
33
+ export type TResponseMetadata = Record<string, string | number | boolean | Date>;
34
+ /**
35
+ * Tool call data structure for function calls
36
+ */
37
+ /**
38
+ * Tool execution request
39
+ */
40
+ export interface IToolExecutionRequest {
41
+ toolName: string;
42
+ parameters: TToolParameters;
43
+ executionId?: string;
44
+ metadata?: TToolMetadata;
45
+ ownerType?: string;
46
+ ownerId?: string;
47
+ ownerPath?: IOwnerPathSegment[];
48
+ eventService?: IEventService;
49
+ baseEventService?: IEventService;
50
+ }
51
+ /**
52
+ * Conversation context containing messages and metadata
53
+ */
54
+ export interface IConversationContext {
55
+ /** All messages in the conversation */
56
+ messages: TUniversalMessage[];
57
+ /** System message for the conversation */
58
+ systemMessage?: string;
59
+ /** Model to use for generation */
60
+ model: string;
61
+ /** Provider to use for generation */
62
+ provider: string;
63
+ /** Temperature for generation */
64
+ temperature?: number;
65
+ /** Maximum tokens to generate */
66
+ maxTokens?: number;
67
+ /** Available tools */
68
+ tools?: IToolSchema[];
69
+ /** Additional metadata */
70
+ metadata?: TConversationContextMetadata;
71
+ }
72
+ /**
73
+ * Response from AI provider
74
+ */
75
+ export interface IConversationResponse {
76
+ /** Generated content */
77
+ content: string;
78
+ /** Tool calls if any */
79
+ toolCalls?: IToolCall[];
80
+ /** Usage statistics */
81
+ usage?: {
82
+ promptTokens: number;
83
+ completionTokens: number;
84
+ totalTokens: number;
85
+ };
86
+ /** Response metadata */
87
+ metadata?: TResponseMetadata;
88
+ /** Finish reason */
89
+ finishReason?: string;
90
+ }
91
+ /**
92
+ * Streaming response chunk
93
+ */
94
+ export interface IStreamingChunk {
95
+ /** Content delta */
96
+ delta: string;
97
+ /** Whether this is the final chunk */
98
+ done: boolean;
99
+ /** Tool calls if any */
100
+ toolCalls?: IToolCall[];
101
+ /** Usage statistics (only in final chunk) */
102
+ usage?: {
103
+ promptTokens: number;
104
+ completionTokens: number;
105
+ totalTokens: number;
106
+ };
107
+ }
108
+ /**
109
+ * Service options for conversation operations
110
+ */
111
+ export interface IConversationServiceOptions {
112
+ /** Maximum conversation history length */
113
+ maxHistoryLength?: number;
114
+ /** Whether to automatically retry on failure */
115
+ enableRetry?: boolean;
116
+ /** Maximum number of retries */
117
+ maxRetries?: number;
118
+ /** Retry delay in milliseconds */
119
+ retryDelay?: number;
120
+ /** Request timeout in milliseconds */
121
+ timeout?: number;
122
+ }
123
+ /**
124
+ * Context options for conversation preparation
125
+ */
126
+ export interface IContextOptions {
127
+ systemMessage?: string;
128
+ temperature?: number;
129
+ maxTokens?: number;
130
+ tools?: IToolSchema[];
131
+ metadata?: TConversationContextMetadata;
132
+ }
133
+ /**
134
+ * Execution service options
135
+ */
136
+ export interface IExecutionServiceOptions {
137
+ /** Maximum number of tool execution rounds */
138
+ maxToolRounds?: number;
139
+ /** Tool execution timeout */
140
+ toolTimeout?: number;
141
+ /** Whether to enable parallel tool execution */
142
+ enableParallelExecution?: boolean;
143
+ /** Additional execution metadata */
144
+ metadata?: TExecutionMetadata;
145
+ }
146
+ /**
147
+ * Interface for conversation service operations
148
+ * All methods should be stateless and pure functions
149
+ */
150
+ export interface IConversationService {
151
+ /**
152
+ * Prepare conversation context from messages and configuration
153
+ * Pure function that transforms inputs to context object
154
+ */
155
+ prepareContext(messages: TUniversalMessage[], model: string, provider: string, contextOptions?: IContextOptions, serviceOptions?: IConversationServiceOptions): IConversationContext;
156
+ /**
157
+ * Generate a response using the AI provider
158
+ * Stateless operation that handles the full request-response cycle
159
+ */
160
+ generateResponse(provider: IAIProvider, context: IConversationContext, serviceOptions?: IConversationServiceOptions): Promise<IConversationResponse>;
161
+ /**
162
+ * Generate streaming response using the AI provider
163
+ * Stateless streaming operation
164
+ */
165
+ generateStreamingResponse(provider: IAIProvider, context: IConversationContext, serviceOptions?: IConversationServiceOptions): AsyncGenerator<IStreamingChunk, void, never>;
166
+ /**
167
+ * Validate conversation context
168
+ * Pure validation function
169
+ */
170
+ validateContext(context: IConversationContext): {
171
+ isValid: boolean;
172
+ errors: string[];
173
+ };
174
+ }
175
+ /**
176
+ * Interface for tool execution service operations
177
+ */
178
+ export interface IToolExecutionService {
179
+ /**
180
+ * Execute a single tool
181
+ */
182
+ executeTool(toolName: string, parameters: TToolParameters): Promise<TUniversalValue>;
183
+ /**
184
+ * Execute multiple tools in parallel
185
+ */
186
+ executeToolsParallel(toolCalls: IToolExecutionRequest[]): Promise<TUniversalValue[]>;
187
+ /**
188
+ * Execute multiple tools sequentially
189
+ */
190
+ executeToolsSequential(toolCalls: IToolExecutionRequest[]): Promise<TUniversalValue[]>;
191
+ }
192
+ /**
193
+ * Interface for execution service operations
194
+ */
195
+ export interface IExecutionService {
196
+ /**
197
+ * Execute complete agent pipeline
198
+ */
199
+ execute(input: string, context: IConversationContext, options?: IExecutionServiceOptions): Promise<string>;
200
+ /**
201
+ * Execute streaming agent pipeline
202
+ */
203
+ executeStream(input: string, context: IConversationContext, options?: IExecutionServiceOptions): AsyncGenerator<string, void, never>;
204
+ }
205
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/interfaces/service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE7D;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAEnH;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,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AAM,EACb,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,wBAAwB,GACnC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;CAC1C"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Service layer interfaces for the agents package
3
+ * Defines contracts for stateless service implementations
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/interfaces/service.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,248 @@
1
+ import type { IToolSchema } from './provider';
2
+ import type { IEventService, IOwnerPathSegment } from './event-service';
3
+ import type { TContextData, TLoggerData, TToolParameters, TUniversalValue } from './types';
4
+ export type { TToolParameters } from './types';
5
+ export type TToolContextExtensionValue = TUniversalValue | Date | Error | TLoggerData | TContextData | TToolParameters | TToolMetadata;
6
+ /**
7
+ * Tool metadata structure - specific type definition
8
+ */
9
+ export type TToolMetadata = Record<string, string | number | boolean | string[] | number[] | boolean[] | TToolParameters>;
10
+ /**
11
+ * Tool execution data - domain payload for tool results.
12
+ *
13
+ * IMPORTANT:
14
+ * - This must support structured tool outputs without resorting to `any`.
15
+ * - Prefer `ToolResultData` (derived from the canonical `UniversalValue` axis).
16
+ */
17
+ /**
18
+ * Tool execution result - extended for ToolExecutionData compatibility
19
+ */
20
+ export interface IToolResult {
21
+ success: boolean;
22
+ data?: TUniversalValue;
23
+ error?: string;
24
+ metadata?: TToolMetadata;
25
+ [key: string]: TToolContextExtensionValue | undefined;
26
+ }
27
+ /**
28
+ * Enhanced tool execution result with additional metadata
29
+ */
30
+ export interface IToolExecutionResult {
31
+ /** Whether execution was successful */
32
+ success: boolean;
33
+ /** Tool name that was executed */
34
+ toolName?: string;
35
+ /** Execution result or data */
36
+ result?: TUniversalValue;
37
+ /** Error message if execution failed */
38
+ error?: string;
39
+ /** Execution duration in milliseconds */
40
+ duration?: number;
41
+ /** Unique execution ID */
42
+ executionId?: string;
43
+ /** Additional metadata */
44
+ metadata?: TToolMetadata;
45
+ }
46
+ /**
47
+ * Tool execution context - type-safe context for tool execution
48
+ * Enhanced with hierarchical execution tracking support
49
+ */
50
+ export interface IToolExecutionContext {
51
+ toolName: string;
52
+ parameters: TToolParameters;
53
+ executionId?: string;
54
+ userId?: string;
55
+ sessionId?: string;
56
+ metadata?: TToolMetadata;
57
+ /** Parent execution ID for hierarchical tool execution tracking */
58
+ parentExecutionId?: string;
59
+ /** Root execution ID (Team/Agent level) for complete execution tree tracking */
60
+ rootExecutionId?: string;
61
+ /** Execution depth level (0: Team, 1: Agent, 2: Tool, etc.) */
62
+ executionLevel?: number;
63
+ /** Execution path array showing the complete execution hierarchy */
64
+ executionPath?: string[];
65
+ /** Real-time execution data for accurate tracking (no simulation) */
66
+ realTimeData?: {
67
+ /** Actual execution start time */
68
+ startTime: Date;
69
+ /** Actual input parameters passed to the tool */
70
+ actualParameters: TToolParameters;
71
+ /** Tool-provided estimated duration (optional) */
72
+ estimatedDuration?: number;
73
+ };
74
+ /**
75
+ * Additional tool execution context extensions.
76
+ *
77
+ * IMPORTANT:
78
+ * - Avoid ad-hoc top-level fields to keep the contract stable.
79
+ * - Use this map for forward-compatible extra data with constrained value types.
80
+ */
81
+ extensions?: Record<string, TToolContextExtensionValue>;
82
+ /** Owner context propagated from EventService */
83
+ ownerType?: string;
84
+ ownerId?: string;
85
+ ownerPath?: IOwnerPathSegment[];
86
+ sourceId?: string;
87
+ /**
88
+ * Tool-call scoped EventService instance.
89
+ * Caller (ExecutionService/ToolExecutionService) is responsible for providing
90
+ * an ownerPath-bound EventService for this tool call.
91
+ */
92
+ eventService?: IEventService;
93
+ /**
94
+ * Unbound base EventService instance.
95
+ *
96
+ * Required when a tool needs to create another owner-bound EventService
97
+ * for a different owner (e.g., creating an agent from a tool call).
98
+ *
99
+ * NOTE: Do not wrap an already owner-bound EventService to bind a different owner.
100
+ * Owner-bound instances must not be layered across different owners.
101
+ */
102
+ baseEventService?: IEventService;
103
+ }
104
+ /**
105
+ * Parameter validation result
106
+ */
107
+ export interface IParameterValidationResult {
108
+ /** Whether parameters are valid */
109
+ isValid: boolean;
110
+ /** Validation error messages */
111
+ errors: string[];
112
+ }
113
+ /**
114
+ * Generic tool executor function
115
+ */
116
+ export type TToolExecutor<TParams = TToolParameters, TResult = TUniversalValue> = (parameters: TParams, context?: IToolExecutionContext) => Promise<TResult>;
117
+ /**
118
+ * OpenAPI specification configuration
119
+ */
120
+ export interface IOpenAPIToolConfig {
121
+ /** OpenAPI 3.0 specification */
122
+ spec: {
123
+ openapi: string;
124
+ info: {
125
+ title: string;
126
+ version: string;
127
+ description?: string;
128
+ };
129
+ servers?: Array<{
130
+ url: string;
131
+ description?: string;
132
+ }>;
133
+ paths: Record<string, Record<string, string | number | boolean | Record<string, string | number | boolean>>>;
134
+ components?: Record<string, Record<string, string | number | boolean>>;
135
+ };
136
+ /** Operation ID from the OpenAPI spec */
137
+ operationId: string;
138
+ /** Base URL for API calls */
139
+ baseURL: string;
140
+ /** Authentication configuration */
141
+ auth?: {
142
+ type: 'bearer' | 'apiKey' | 'basic';
143
+ token?: string;
144
+ apiKey?: string;
145
+ header?: string;
146
+ username?: string;
147
+ password?: string;
148
+ };
149
+ }
150
+ /**
151
+ * MCP (Model Context Protocol) configuration
152
+ */
153
+ export interface IMCPToolConfig {
154
+ /** MCP server endpoint */
155
+ endpoint: string;
156
+ /** Protocol version */
157
+ version?: string;
158
+ /** Authentication configuration */
159
+ auth?: {
160
+ type: 'bearer' | 'apiKey';
161
+ token: string;
162
+ };
163
+ /** Tool-specific configuration */
164
+ toolConfig?: Record<string, string | number | boolean>;
165
+ /** Timeout in milliseconds */
166
+ timeout?: number;
167
+ }
168
+ /**
169
+ * Base tool interface
170
+ */
171
+ export interface ITool {
172
+ /** Tool schema */
173
+ schema: IToolSchema;
174
+ /**
175
+ * Execute the tool with given parameters
176
+ */
177
+ execute(parameters: TToolParameters, context?: IToolExecutionContext): Promise<IToolResult>;
178
+ /**
179
+ * Validate tool parameters
180
+ */
181
+ validate(parameters: TToolParameters): boolean;
182
+ /**
183
+ * Validate tool parameters with detailed result
184
+ */
185
+ validateParameters(parameters: TToolParameters): IParameterValidationResult;
186
+ /**
187
+ * Get tool description
188
+ */
189
+ getDescription(): string;
190
+ }
191
+ /**
192
+ * Function tool implementation
193
+ */
194
+ export interface IFunctionTool extends ITool {
195
+ /** Function to execute */
196
+ fn: TToolExecutor;
197
+ }
198
+ /**
199
+ * Tool registry interface
200
+ */
201
+ export interface IToolRegistry {
202
+ /**
203
+ * Register a tool
204
+ */
205
+ register(tool: ITool): void;
206
+ /**
207
+ * Unregister a tool
208
+ */
209
+ unregister(name: string): void;
210
+ /**
211
+ * Get tool by name
212
+ */
213
+ get(name: string): ITool | undefined;
214
+ /**
215
+ * Get all registered tools
216
+ */
217
+ getAll(): ITool[];
218
+ /**
219
+ * Get tool schemas
220
+ */
221
+ getSchemas(): IToolSchema[];
222
+ /**
223
+ * Check if tool exists
224
+ */
225
+ has(name: string): boolean;
226
+ /**
227
+ * Clear all tools
228
+ */
229
+ clear(): void;
230
+ }
231
+ /**
232
+ * Tool factory interface
233
+ */
234
+ export interface IToolFactory {
235
+ /**
236
+ * Create function tool from schema and function
237
+ */
238
+ createFunctionTool(schema: IToolSchema, fn: TToolExecutor): IFunctionTool;
239
+ /**
240
+ * Create tool from OpenAPI specification
241
+ */
242
+ createOpenAPITool(config: IOpenAPIToolConfig): ITool;
243
+ /**
244
+ * Create MCP tool
245
+ */
246
+ createMCPTool(config: IMCPToolConfig): ITool;
247
+ }
248
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/interfaces/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM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AC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,GAAG,aAAa,CAAC;IAE1E;;OAEG;IACH,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,KAAK,CAAC;IAErD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,KAAK,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/interfaces/tool.ts"],"names":[],"mappings":""}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Agent-specific type definitions
3
+ * Local types for agent functionality - not forced to use base types unless needed for cross-connections
4
+ */
5
+ import type { TUniversalMessage } from './messages';
6
+ /**
7
+ * Primitive value types - foundation for all other types
8
+ * Extended to include null/undefined for agent contexts
9
+ */
10
+ export type TPrimitiveValue = string | number | boolean | null | undefined;
11
+ /**
12
+ * Universal value type axis (recursive, JSON-like + Date).
13
+ *
14
+ * IMPORTANT:
15
+ * - This axis is the single source of truth for payload/context/result values.
16
+ * - It must support nested objects/arrays without `any`/`unknown`.
17
+ */
18
+ export type TUniversalValue = TPrimitiveValue | Date | TUniversalArrayValue | IUniversalObjectValue;
19
+ export type TUniversalArrayValue = TUniversalValue[];
20
+ export interface IUniversalObjectValue {
21
+ [key: string]: TUniversalValue;
22
+ }
23
+ /**
24
+ * Metadata type - consistent across agent components
25
+ */
26
+ export type TMetadataValue = TPrimitiveValue | TUniversalArrayValue | Date;
27
+ export type TMetadata = Record<string, TMetadataValue>;
28
+ /**
29
+ * Context data type - for execution contexts
30
+ */
31
+ export type TContextData = Record<string, TUniversalValue>;
32
+ /**
33
+ * Logger data type - for logging contexts
34
+ */
35
+ export type TLoggerData = Record<string, TUniversalValue | Date | Error>;
36
+ /**
37
+ * Configuration types - for agent configuration
38
+ */
39
+ export type TComplexConfigValue = Record<string, TPrimitiveValue | TUniversalArrayValue | IUniversalObjectValue>;
40
+ export type TConfigValue = TPrimitiveValue | TUniversalArrayValue | IUniversalObjectValue | Array<TComplexConfigValue> | Array<Record<string, TPrimitiveValue | TUniversalArrayValue | IUniversalObjectValue>> | Array<TComplexConfigValue> | TComplexConfigValue;
41
+ export type TConfigData = Record<string, TConfigValue>;
42
+ /**
43
+ * Tool parameter value type - specific for tool parameters
44
+ */
45
+ export type TToolParameters = Record<string, TUniversalValue>;
46
+ /**
47
+ * Tool result data type - for tool execution results
48
+ */
49
+ /**
50
+ * Plugin context type - for plugin execution contexts
51
+ */
52
+ export interface IPluginContext {
53
+ input?: string;
54
+ response?: string;
55
+ messages?: TUniversalMessage[];
56
+ responseMessage?: TUniversalMessage;
57
+ metadata?: TMetadata;
58
+ error?: Error;
59
+ executionContext?: TContextData;
60
+ }
61
+ /**
62
+ * Type utility functions for safe type checking and validation
63
+ * @internal
64
+ */
65
+ export declare const TypeUtils: {
66
+ isPrimitive: (value: TUniversalValue) => value is TPrimitiveValue;
67
+ isArray: (value: TUniversalValue) => value is TUniversalArrayValue;
68
+ isObject: (value: TUniversalValue) => value is IUniversalObjectValue;
69
+ isUniversalValue: (value: TUniversalValue) => value is TUniversalValue;
70
+ };
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACrB,eAAe,GACf,IAAI,GACJ,oBAAoB,GACpB,qBAAqB,CAAC;AAE5B,MAAM,MAAM,oBAAoB,GAAG,eAAe,EAAE,CAAC;AAErD,MAAM,WAAW,qBAAqB;IAClC,CAAC,GAAG,EAAE,M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H,eAAO,MAAM,SAAS;yBACG,eAAe,KAAG,KAAK,IAAI,eAAe;qBAQ9C,eAAe,KAAG,KAAK,IAAI,oBAAoB;sBAI9C,eAAe,KAAG,KAAK,IAAI,qBAAqB;8BAQxC,eAAe,KAAG,KAAK,IAAI,eAAe;CAIvE,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Agent-specific type definitions
3
+ * Local types for agent functionality - not forced to use base types unless needed for cross-connections
4
+ */
5
+ /**
6
+ * Type utility functions for safe type checking and validation
7
+ * @internal
8
+ */
9
+ export const TypeUtils = {
10
+ isPrimitive: (value) => {
11
+ return value === null ||
12
+ value === undefined ||
13
+ typeof value === 'string' ||
14
+ typeof value === 'number' ||
15
+ typeof value === 'boolean';
16
+ },
17
+ isArray: (value) => {
18
+ return Array.isArray(value) && value.every(item => TypeUtils.isUniversalValue(item));
19
+ },
20
+ isObject: (value) => {
21
+ return typeof value === 'object' &&
22
+ value !== null &&
23
+ !Array.isArray(value) &&
24
+ !(value instanceof Date) &&
25
+ Object.values(value).every(val => TypeUtils.isUniversalValue(val));
26
+ },
27
+ isUniversalValue: (value) => {
28
+ if (value instanceof Date)
29
+ return true;
30
+ return TypeUtils.isPrimitive(value) || TypeUtils.isArray(value) || TypeUtils.isObject(value);
31
+ }
32
+ };
33
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiFH;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,WAAW,EAAE,CAAC,KAAsB,EAA4B,EAAE;QAC9D,OAAO,KAAK,KAAK,IAAI;YACjB,KAAK,KAAK,SAAS;YACnB,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,SAAS,CAAC;IACnC,CAAC;IAED,OAAO,EAAE,CAAC,KAAsB,EAAiC,EAAE;QAC/D,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,QAAQ,EAAE,CAAC,KAAsB,EAAkC,EAAE;QACjE,OAAO,OAAO,KAAK,KAAK,QAAQ;YAC5B,KAAK,KAAK,IAAI;YACd,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACrB,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,gBAAgB,EAAE,CAAC,KAAsB,EAA4B,EAAE;QACnE,IAAI,KAAK,YAAY,IAAI;YAAE,OAAO,IAAI,CAAC;QACvC,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjG,CAAC;CACJ,CAAC"}