@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,270 @@
1
+ import { AbstractPlugin, PluginCategory, PluginPriority } from '../../abstracts/abstract-plugin';
2
+ import { createLogger } from '../../utils/logger';
3
+ import { PluginError, ConfigurationError } from '../../utils/errors';
4
+ import { startPeriodicTask, stopPeriodicTask } from '../../utils/periodic-task';
5
+ import { MemoryHistoryStorage, FileHistoryStorage, DatabaseHistoryStorage } from './storages/index';
6
+ /**
7
+ * Plugin for managing conversation history
8
+ * Saves and loads conversation history using configurable storage strategies
9
+ */
10
+ export class ConversationHistoryPlugin extends AbstractPlugin {
11
+ name = 'ConversationHistoryPlugin';
12
+ version = '1.0.0';
13
+ storage;
14
+ pluginOptions;
15
+ logger;
16
+ currentConversationId;
17
+ batchSaveTimer;
18
+ pendingSaves = new Set();
19
+ constructor(options) {
20
+ super();
21
+ this.logger = createLogger('ConversationHistoryPlugin');
22
+ // Set plugin classification
23
+ this.category = PluginCategory.STORAGE;
24
+ this.priority = PluginPriority.HIGH;
25
+ // Validate options
26
+ this.validateOptions(options);
27
+ // Set defaults
28
+ this.pluginOptions = {
29
+ enabled: options.enabled ?? true,
30
+ storage: options.storage,
31
+ maxConversations: options.maxConversations ?? 100,
32
+ maxMessagesPerConversation: options.maxMessagesPerConversation ?? 1000,
33
+ filePath: options.filePath ?? './conversations.json',
34
+ connectionString: options.connectionString ?? '',
35
+ autoSave: options.autoSave ?? true,
36
+ saveInterval: options.saveInterval ?? 30000, // 30 seconds
37
+ // Add plugin options defaults
38
+ category: options.category ?? PluginCategory.STORAGE,
39
+ priority: options.priority ?? PluginPriority.HIGH,
40
+ moduleEvents: options.moduleEvents ?? [],
41
+ subscribeToAllModuleEvents: options.subscribeToAllModuleEvents ?? false,
42
+ };
43
+ // Initialize storage
44
+ this.storage = this.createStorage();
45
+ // Setup batch saving if not auto-saving
46
+ if (!this.pluginOptions.autoSave) {
47
+ this.setupBatchSaving();
48
+ }
49
+ this.logger.info('ConversationHistoryPlugin initialized', {
50
+ storage: this.pluginOptions.storage,
51
+ maxConversations: this.pluginOptions.maxConversations,
52
+ autoSave: this.pluginOptions.autoSave
53
+ });
54
+ }
55
+ /**
56
+ * Start a new conversation
57
+ */
58
+ async startConversation(conversationId) {
59
+ try {
60
+ this.currentConversationId = conversationId;
61
+ const entry = {
62
+ conversationId,
63
+ messages: [],
64
+ startTime: new Date(),
65
+ lastUpdated: new Date(),
66
+ metadata: {}
67
+ };
68
+ if (this.pluginOptions.autoSave) {
69
+ await this.storage.save(conversationId, entry);
70
+ }
71
+ else {
72
+ this.pendingSaves.add(conversationId);
73
+ }
74
+ this.logger.debug('Started new conversation', { conversationId });
75
+ }
76
+ catch (error) {
77
+ throw new PluginError('Failed to start conversation', this.name, { conversationId, error: error instanceof Error ? error.message : String(error) });
78
+ }
79
+ }
80
+ /**
81
+ * Add a message to the current conversation
82
+ */
83
+ async addMessage(message) {
84
+ if (!this.currentConversationId) {
85
+ throw new PluginError('No active conversation', this.name);
86
+ }
87
+ try {
88
+ const entry = await this.storage.load(this.currentConversationId) || {
89
+ conversationId: this.currentConversationId,
90
+ messages: [],
91
+ startTime: new Date(),
92
+ lastUpdated: new Date(),
93
+ metadata: {}
94
+ };
95
+ // Add message and trim if necessary
96
+ entry.messages.push(message);
97
+ if (entry.messages.length > this.pluginOptions.maxMessagesPerConversation) {
98
+ entry.messages = entry.messages.slice(-this.pluginOptions.maxMessagesPerConversation);
99
+ }
100
+ entry.lastUpdated = new Date();
101
+ if (this.pluginOptions.autoSave) {
102
+ await this.storage.save(this.currentConversationId, entry);
103
+ }
104
+ else {
105
+ this.pendingSaves.add(this.currentConversationId);
106
+ }
107
+ this.logger.debug('Added message to conversation', {
108
+ conversationId: this.currentConversationId,
109
+ messageRole: message.role,
110
+ messageLength: message.content?.length ?? 0
111
+ });
112
+ }
113
+ catch (error) {
114
+ throw new PluginError('Failed to add message to conversation', this.name, {
115
+ conversationId: this.currentConversationId,
116
+ error: error instanceof Error ? error.message : String(error)
117
+ });
118
+ }
119
+ }
120
+ /**
121
+ * Load conversation history
122
+ */
123
+ async loadConversation(conversationId) {
124
+ try {
125
+ const entry = await this.storage.load(conversationId);
126
+ this.logger.debug('Loaded conversation', {
127
+ conversationId,
128
+ found: !!entry,
129
+ messageCount: entry?.messages.length ?? 0
130
+ });
131
+ return entry;
132
+ }
133
+ catch (error) {
134
+ throw new PluginError('Failed to load conversation', this.name, { conversationId, error: error instanceof Error ? error.message : String(error) });
135
+ }
136
+ }
137
+ /**
138
+ * Get conversation history as messages
139
+ */
140
+ async getHistory(conversationId) {
141
+ const entry = await this.loadConversation(conversationId);
142
+ return entry?.messages ?? [];
143
+ }
144
+ /**
145
+ * List all conversation IDs
146
+ */
147
+ async listConversations() {
148
+ try {
149
+ return await this.storage.list();
150
+ }
151
+ catch (error) {
152
+ throw new PluginError('Failed to list conversations', this.name, { error: error instanceof Error ? error.message : String(error) });
153
+ }
154
+ }
155
+ /**
156
+ * Delete a conversation
157
+ */
158
+ async deleteConversation(conversationId) {
159
+ try {
160
+ const deleted = await this.storage.delete(conversationId);
161
+ this.pendingSaves.delete(conversationId);
162
+ this.logger.debug('Deleted conversation', { conversationId, deleted });
163
+ return deleted;
164
+ }
165
+ catch (error) {
166
+ throw new PluginError('Failed to delete conversation', this.name, { conversationId, error: error instanceof Error ? error.message : String(error) });
167
+ }
168
+ }
169
+ /**
170
+ * Clear all conversations
171
+ */
172
+ async clearAllConversations() {
173
+ try {
174
+ await this.storage.clear();
175
+ this.pendingSaves.clear();
176
+ this.logger.info('Cleared all conversations');
177
+ }
178
+ catch (error) {
179
+ throw new PluginError('Failed to clear conversations', this.name, { error: error instanceof Error ? error.message : String(error) });
180
+ }
181
+ }
182
+ /**
183
+ * Save pending conversations (for batch mode)
184
+ */
185
+ async savePending() {
186
+ if (this.pendingSaves.size === 0)
187
+ return;
188
+ const conversationIds = Array.from(this.pendingSaves);
189
+ this.logger.debug('Saving pending conversations', { count: conversationIds.length });
190
+ for (const conversationId of conversationIds) {
191
+ try {
192
+ const entry = await this.storage.load(conversationId);
193
+ if (entry) {
194
+ await this.storage.save(conversationId, entry);
195
+ }
196
+ this.pendingSaves.delete(conversationId);
197
+ }
198
+ catch (error) {
199
+ this.logger.error('Failed to save pending conversation', {
200
+ conversationId,
201
+ error: error instanceof Error ? error.message : String(error)
202
+ });
203
+ }
204
+ }
205
+ }
206
+ /**
207
+ * Cleanup resources
208
+ */
209
+ async destroy() {
210
+ try {
211
+ stopPeriodicTask(this.batchSaveTimer);
212
+ this.batchSaveTimer = undefined;
213
+ // Save any pending conversations
214
+ await this.savePending();
215
+ this.logger.info('ConversationHistoryPlugin destroyed');
216
+ }
217
+ catch (error) {
218
+ this.logger.error('Error during plugin cleanup', {
219
+ error: error instanceof Error ? error.message : String(error)
220
+ });
221
+ }
222
+ }
223
+ /**
224
+ * Validate plugin options
225
+ */
226
+ validateOptions(options) {
227
+ if (!options.storage) {
228
+ throw new ConfigurationError('Storage strategy is required');
229
+ }
230
+ if (!['memory', 'file', 'database'].includes(options.storage)) {
231
+ throw new ConfigurationError('Invalid storage strategy', { validStrategies: ['memory', 'file', 'database'], provided: options.storage });
232
+ }
233
+ if (options.storage === 'file' && !options.filePath) {
234
+ throw new ConfigurationError('File path is required for file storage strategy');
235
+ }
236
+ if (options.storage === 'database' && !options.connectionString) {
237
+ throw new ConfigurationError('Connection string is required for database storage strategy');
238
+ }
239
+ if (options.maxConversations !== undefined && options.maxConversations <= 0) {
240
+ throw new ConfigurationError('Max conversations must be positive');
241
+ }
242
+ if (options.maxMessagesPerConversation !== undefined && options.maxMessagesPerConversation <= 0) {
243
+ throw new ConfigurationError('Max messages per conversation must be positive');
244
+ }
245
+ }
246
+ /**
247
+ * Create storage instance based on strategy
248
+ */
249
+ createStorage() {
250
+ switch (this.pluginOptions.storage) {
251
+ case 'memory':
252
+ return new MemoryHistoryStorage(this.pluginOptions.maxConversations);
253
+ case 'file':
254
+ return new FileHistoryStorage(this.pluginOptions.filePath);
255
+ case 'database':
256
+ return new DatabaseHistoryStorage(this.pluginOptions.connectionString);
257
+ default:
258
+ throw new ConfigurationError('Unknown storage strategy', { strategy: this.pluginOptions.storage });
259
+ }
260
+ }
261
+ /**
262
+ * Setup batch saving timer
263
+ */
264
+ setupBatchSaving() {
265
+ this.batchSaveTimer = startPeriodicTask(this.logger, { name: 'ConversationHistoryPlugin.savePending', intervalMs: this.pluginOptions.saveInterval }, async () => {
266
+ await this.savePending();
267
+ });
268
+ }
269
+ }
270
+ //# sourceMappingURL=conversation-history-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-history-plugin.js","sourceRoot":"","sources":["../../../src/plugins/conversation-history/conversation-history-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjG,OAAO,EAAE,YAAY,EAAgB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAOhF,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACzB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAkF;IAC7H,IAAI,GAAG,2BAA2B,CAAC;IACnC,OAAO,GAAG,OAAO,CAAC;IAEV,OAAO,CAAkB;IACzB,aAAa,CAA8C;IAC3D,MAAM,CAAU;IAChB,qBAAqB,CAAU;IAC/B,cAAc,CAAY;IAC1B,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAEzC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IAAI,OAAO,CAAC,0BAA0B,IAAI,CAAC,EAAE,CAAC;YAC9F,MAAM,IAAI,kBAAkB,CAAC,gDAAgD,CAAC,CAAC;QACnF,CAAC;IACL,CAAC;IAED;;OAEG;IACK,aAAa;QACjB,QAAQ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YACjC,KAAK,QAAQ;gBACT,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;YACzE,KAAK,MAAM;gBACP,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC/D,KAAK,UAAU;gBACX,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;YAC3E;gBACI,MAAM,IAAI,kBAAkB,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3G,CAAC;IACL,CAAC;IAED;;OAEG;IACK,gBAAgB;QACpB,IAAI,CAAC,cAAc,GAAG,iBAAiB,CACnC,IAAI,CAAC,MAAM,EACX,EAAE,IAAI,EAAE,uCAAuC,EAAE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,EAC9F,KAAK,IAAI,EAAE;YACP,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CACJ,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,3 @@
1
+ export { ConversationHistoryPlugin } from './conversation-history-plugin';
2
+ export { type IConversationHistoryPluginOptions, type IConversationHistoryEntry, type THistoryStorageStrategy, type IHistoryStorage } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/conversation-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACH,KAAK,iCAAiC,EACtC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACvB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ConversationHistoryPlugin } from './conversation-history-plugin';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/conversation-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { IHistoryStorage, IConversationHistoryEntry } from '../types';
2
+ /**
3
+ * Database storage implementation
4
+ */
5
+ export declare class DatabaseHistoryStorage implements IHistoryStorage {
6
+ private connectionString;
7
+ private logger;
8
+ constructor(connectionString: string);
9
+ save(conversationId: string, _entry: IConversationHistoryEntry): Promise<void>;
10
+ load(conversationId: string): Promise<IConversationHistoryEntry | undefined>;
11
+ list(): Promise<string[]>;
12
+ delete(conversationId: string): Promise<boolean>;
13
+ clear(): Promise<void>;
14
+ /**
15
+ * Mask sensitive information in connection string for logging
16
+ */
17
+ private maskConnectionString;
18
+ }
19
+ //# sourceMappingURL=database-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database-storage.d.ts","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/database-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI3E;;GAEG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC1D,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,MAAM,CAAU;gBAEZ,gBAAgB,EAAE,MAAM;IAK9B,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAe9E,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAgB5E,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAczB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBhD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAG/B"}
@@ -0,0 +1,94 @@
1
+ import { createLogger } from '../../../utils/logger';
2
+ import { StorageError } from '../../../utils/errors';
3
+ /**
4
+ * Database storage implementation
5
+ */
6
+ export class DatabaseHistoryStorage {
7
+ connectionString;
8
+ logger;
9
+ constructor(connectionString) {
10
+ this.connectionString = connectionString;
11
+ this.logger = createLogger('DatabaseHistoryStorage');
12
+ }
13
+ async save(conversationId, _entry) {
14
+ try {
15
+ // Database operations would be implemented here
16
+ this.logger.warn('Database storage not fully implemented yet', {
17
+ conversationId,
18
+ connectionString: this.maskConnectionString()
19
+ });
20
+ }
21
+ catch (error) {
22
+ throw new StorageError('Failed to save conversation to database', {
23
+ conversationId,
24
+ error: error instanceof Error ? error.message : String(error)
25
+ });
26
+ }
27
+ }
28
+ async load(conversationId) {
29
+ try {
30
+ // Database operations would be implemented here
31
+ this.logger.warn('Database storage not fully implemented yet', {
32
+ conversationId,
33
+ connectionString: this.maskConnectionString()
34
+ });
35
+ return undefined;
36
+ }
37
+ catch (error) {
38
+ throw new StorageError('Failed to load conversation from database', {
39
+ conversationId,
40
+ error: error instanceof Error ? error.message : String(error)
41
+ });
42
+ }
43
+ }
44
+ async list() {
45
+ try {
46
+ // Database operations would be implemented here
47
+ this.logger.warn('Database storage not fully implemented yet', {
48
+ connectionString: this.maskConnectionString()
49
+ });
50
+ return [];
51
+ }
52
+ catch (error) {
53
+ throw new StorageError('Failed to list conversations from database', {
54
+ error: error instanceof Error ? error.message : String(error)
55
+ });
56
+ }
57
+ }
58
+ async delete(conversationId) {
59
+ try {
60
+ // Database operations would be implemented here
61
+ this.logger.warn('Database storage not fully implemented yet', {
62
+ conversationId,
63
+ connectionString: this.maskConnectionString()
64
+ });
65
+ return false;
66
+ }
67
+ catch (error) {
68
+ throw new StorageError('Failed to delete conversation from database', {
69
+ conversationId,
70
+ error: error instanceof Error ? error.message : String(error)
71
+ });
72
+ }
73
+ }
74
+ async clear() {
75
+ try {
76
+ // Database operations would be implemented here
77
+ this.logger.warn('Database storage not fully implemented yet', {
78
+ connectionString: this.maskConnectionString()
79
+ });
80
+ }
81
+ catch (error) {
82
+ throw new StorageError('Failed to clear conversations from database', {
83
+ error: error instanceof Error ? error.message : String(error)
84
+ });
85
+ }
86
+ }
87
+ /**
88
+ * Mask sensitive information in connection string for logging
89
+ */
90
+ maskConnectionString() {
91
+ return this.connectionString.replace(/(:\/\/[^:]+:)[^@]+(@)/, '$1***$2');
92
+ }
93
+ }
94
+ //# sourceMappingURL=database-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database-storage.js","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/database-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACvB,gBAAgB,CAAS;IACzB,MAAM,CAAU;IAExB,YAAY,gBAAwB;QAChC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,wBAAwB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAAsB,EAAE,MAAiC;QAChE,IAAI,CAAC;YACD,gDAAgD;YAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4CAA4C,EAAE;gBAC3D,cAAc;gBACd,gBAAgB,EAAE,IAAI,CAAC,oBAAoB,EAAE;aAChD,CAAC,CAAC;QACP,CAAC;QAAC,OAAO,KAAK,EAAE,CA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,IAAI,CAAC,4CAA4C,EAAE;gBAC3D,cAAc;gBACd,gBAAgB,EAAE,IAAI,CAAC,oBAAoB,EAAE;aAChD,CAAC,CAAC;YACH,OAAO,KAAK,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,YAAY,CAAC,6CAA6C,EAAE;gBAClE,cAAc;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC;YACD,gDAAgD;YAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4CAA4C,EAAE;gBAC3D,gBAAgB,EAAE,IAAI,CAAC,oBAAoB,EAAE;aAChD,CAAC,CAAC;QACP,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,YAAY,CAAC,6CAA6C,EAAE;gBAClE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED;;OAEG;IACK,oBAAoB;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;IAC7E,CAAC;CACJ"}
@@ -0,0 +1,15 @@
1
+ import type { IHistoryStorage, IConversationHistoryEntry } from '../types';
2
+ /**
3
+ * File storage implementation
4
+ */
5
+ export declare class FileHistoryStorage implements IHistoryStorage {
6
+ private filePath;
7
+ private logger;
8
+ constructor(filePath: string);
9
+ save(conversationId: string, _entry: IConversationHistoryEntry): Promise<void>;
10
+ load(conversationId: string): Promise<IConversationHistoryEntry | undefined>;
11
+ list(): Promise<string[]>;
12
+ delete(conversationId: string): Promise<boolean>;
13
+ clear(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=file-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.d.ts","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI3E;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe;IACtD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAU;gBAEZ,QAAQ,EAAE,MAAM;IAKtB,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9E,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAiB5E,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAezB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBhD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAa/B"}
@@ -0,0 +1,94 @@
1
+ import { createLogger } from '../../../utils/logger';
2
+ import { StorageError } from '../../../utils/errors';
3
+ /**
4
+ * File storage implementation
5
+ */
6
+ export class FileHistoryStorage {
7
+ filePath;
8
+ logger;
9
+ constructor(filePath) {
10
+ this.filePath = filePath;
11
+ this.logger = createLogger('FileHistoryStorage');
12
+ }
13
+ async save(conversationId, _entry) {
14
+ try {
15
+ // File operations would be implemented here
16
+ // This is a placeholder for actual file system operations
17
+ this.logger.warn('File storage not fully implemented yet', {
18
+ conversationId,
19
+ filePath: this.filePath
20
+ });
21
+ }
22
+ catch (error) {
23
+ throw new StorageError('Failed to save conversation to file', {
24
+ conversationId,
25
+ filePath: this.filePath,
26
+ error: error instanceof Error ? error.message : String(error)
27
+ });
28
+ }
29
+ }
30
+ async load(conversationId) {
31
+ try {
32
+ // File operations would be implemented here
33
+ this.logger.warn('File storage not fully implemented yet', {
34
+ conversationId,
35
+ filePath: this.filePath
36
+ });
37
+ return undefined;
38
+ }
39
+ catch (error) {
40
+ throw new StorageError('Failed to load conversation from file', {
41
+ conversationId,
42
+ filePath: this.filePath,
43
+ error: error instanceof Error ? error.message : String(error)
44
+ });
45
+ }
46
+ }
47
+ async list() {
48
+ try {
49
+ // File operations would be implemented here
50
+ this.logger.warn('File storage not fully implemented yet', {
51
+ filePath: this.filePath
52
+ });
53
+ return [];
54
+ }
55
+ catch (error) {
56
+ throw new StorageError('Failed to list conversations from file', {
57
+ filePath: this.filePath,
58
+ error: error instanceof Error ? error.message : String(error)
59
+ });
60
+ }
61
+ }
62
+ async delete(conversationId) {
63
+ try {
64
+ // File operations would be implemented here
65
+ this.logger.warn('File storage not fully implemented yet', {
66
+ conversationId,
67
+ filePath: this.filePath
68
+ });
69
+ return false;
70
+ }
71
+ catch (error) {
72
+ throw new StorageError('Failed to delete conversation from file', {
73
+ conversationId,
74
+ filePath: this.filePath,
75
+ error: error instanceof Error ? error.message : String(error)
76
+ });
77
+ }
78
+ }
79
+ async clear() {
80
+ try {
81
+ // File operations would be implemented here
82
+ this.logger.warn('File storage not fully implemented yet', {
83
+ filePath: this.filePath
84
+ });
85
+ }
86
+ catch (error) {
87
+ throw new StorageError('Failed to clear conversations from file', {
88
+ filePath: this.filePath,
89
+ error: error instanceof Error ? error.message : String(error)
90
+ });
91
+ }
92
+ }
93
+ }
94
+ //# sourceMappingURL=file-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.js","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/file-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACnB,QAAQ,CAAS;IACjB,MAAM,CA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AK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,4 @@
1
+ export { MemoryHistoryStorage } from './memory-storage';
2
+ export { FileHistoryStorage } from './file-storage';
3
+ export { DatabaseHistoryStorage } from './database-storage';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { MemoryHistoryStorage } from './memory-storage';
2
+ export { FileHistoryStorage } from './file-storage';
3
+ export { DatabaseHistoryStorage } from './database-storage';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { IHistoryStorage, IConversationHistoryEntry } from '../types';
2
+ /**
3
+ * Memory storage implementation
4
+ */
5
+ export declare class MemoryHistoryStorage implements IHistoryStorage {
6
+ private conversations;
7
+ private maxConversations;
8
+ constructor(maxConversations?: number);
9
+ save(conversationId: string, entry: IConversationHistoryEntry): Promise<void>;
10
+ load(conversationId: string): Promise<IConversationHistoryEntry | undefined>;
11
+ list(): Promise<string[]>;
12
+ delete(conversationId: string): Promise<boolean>;
13
+ clear(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=memory-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-storage.d.ts","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/memory-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE3E;;GAEG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IACxD,OAAO,CAAC,aAAa,CAAgD;IACrE,OAAO,CAAC,gBAAgB,CAAS;gBAErB,gBAAgB,GAAE,MAAY;IAIpC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7E,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAI5E,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Memory storage implementation
3
+ */
4
+ export class MemoryHistoryStorage {
5
+ conversations = new Map();
6
+ maxConversations;
7
+ constructor(maxConversations = 100) {
8
+ this.maxConversations = maxConversations;
9
+ }
10
+ async save(conversationId, entry) {
11
+ // Remove oldest conversation if limit exceeded
12
+ if (this.conversations.size >= this.maxConversations && !this.conversations.has(conversationId)) {
13
+ const oldestId = this.conversations.keys().next().value;
14
+ if (oldestId) {
15
+ this.conversations.delete(oldestId);
16
+ }
17
+ }
18
+ this.conversations.set(conversationId, { ...entry });
19
+ }
20
+ async load(conversationId) {
21
+ return this.conversations.get(conversationId);
22
+ }
23
+ async list() {
24
+ return Array.from(this.conversations.keys());
25
+ }
26
+ async delete(conversationId) {
27
+ return this.conversations.delete(conversationId);
28
+ }
29
+ async clear() {
30
+ this.conversations.clear();
31
+ }
32
+ }
33
+ //# sourceMappingURL=memory-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-storage.js","sourceRoot":"","sources":["../../../../src/plugins/conversation-history/storages/memory-storage.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,oBAAoB;IACrB,aAAa,GAAG,IAAI,GAAG,EAAqC,CAAC;IAC7D,gBAAgB,CAAS;IAEjC,YAAY,mBAA2B,GAAG;QACtC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAAsB,EAAE,KAAgC;QAC/D,+CAA+C;QAC/C,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9F,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YACxD,IAAI,QAAQ,EAAE,CAAC;gBACX,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACxC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAAsB;QAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,IAAI;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,cAAsB;QAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACJ"}