@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,380 @@
1
+ import { AbstractPlugin, PluginCategory, PluginPriority } from '../abstracts/abstract-plugin';
2
+ import { createLogger } from '../utils/logger';
3
+ import { PluginError } from '../utils/errors';
4
+ /**
5
+ * Plugin for rate limiting and resource control
6
+ * Enforces limits on token usage, request frequency, and costs
7
+ */
8
+ export class LimitsPlugin extends AbstractPlugin {
9
+ name = 'LimitsPlugin';
10
+ version = '1.0.0';
11
+ pluginOptions;
12
+ logger;
13
+ windows = new Map();
14
+ buckets = new Map();
15
+ requestCounts = new Map();
16
+ constructor(options) {
17
+ super();
18
+ this.logger = createLogger('LimitsPlugin');
19
+ // Validate options
20
+ this.validateOptions(options);
21
+ // Set defaults
22
+ this.pluginOptions = {
23
+ enabled: options.enabled ?? true,
24
+ strategy: options.strategy,
25
+ maxTokens: options.maxTokens ?? 100000,
26
+ maxRequests: options.maxRequests ?? 1000,
27
+ timeWindow: options.timeWindow ?? 3600000, // 1 hour
28
+ maxCost: options.maxCost ?? 10.0, // $10
29
+ tokenCostPer1000: options.tokenCostPer1000 ?? 0.002, // $0.002 per 1K tokens
30
+ refillRate: options.refillRate ?? 100, // tokens per second
31
+ bucketSize: options.bucketSize ?? 10000,
32
+ costCalculator: options.costCalculator ?? this.defaultCostCalculator.bind(this),
33
+ // Add plugin options defaults
34
+ category: options.category ?? PluginCategory.LIMITS,
35
+ priority: options.priority ?? PluginPriority.NORMAL,
36
+ moduleEvents: options.moduleEvents ?? [],
37
+ subscribeToAllModuleEvents: options.subscribeToAllModuleEvents ?? false
38
+ };
39
+ this.logger.info('LimitsPlugin initialized', {
40
+ strategy: this.pluginOptions.strategy,
41
+ maxTokens: this.pluginOptions.maxTokens,
42
+ maxRequests: this.pluginOptions.maxRequests,
43
+ timeWindow: this.pluginOptions.timeWindow
44
+ });
45
+ }
46
+ /**
47
+ * Check limits before execution
48
+ */
49
+ async beforeExecution(context) {
50
+ if (this.pluginOptions.strategy === 'none') {
51
+ return;
52
+ }
53
+ const key = this.getKey(context);
54
+ try {
55
+ switch (this.pluginOptions.strategy) {
56
+ case 'token-bucket':
57
+ await this.checkTokenBucket(key, context);
58
+ break;
59
+ case 'sliding-window':
60
+ await this.checkSlidingWindow(key, context);
61
+ break;
62
+ case 'fixed-window':
63
+ await this.checkFixedWindow(key, context);
64
+ break;
65
+ }
66
+ this.logger.debug('Limits check passed', {
67
+ strategy: this.pluginOptions.strategy,
68
+ key
69
+ });
70
+ }
71
+ catch (error) {
72
+ this.logger.warn('Limits check failed', {
73
+ strategy: this.pluginOptions.strategy,
74
+ key,
75
+ error: error instanceof Error ? error.message : String(error)
76
+ });
77
+ throw error;
78
+ }
79
+ }
80
+ /**
81
+ * Update limits after execution
82
+ */
83
+ async afterExecution(context, result) {
84
+ if (this.pluginOptions.strategy === 'none') {
85
+ return;
86
+ }
87
+ const key = this.getKey(context);
88
+ const tokensUsed = result?.tokensUsed || 0;
89
+ const cost = this.pluginOptions.costCalculator(tokensUsed, context.config?.['model'] || 'unknown');
90
+ try {
91
+ switch (this.pluginOptions.strategy) {
92
+ case 'token-bucket':
93
+ this.updateTokenBucket(key, tokensUsed, cost);
94
+ break;
95
+ case 'sliding-window':
96
+ case 'fixed-window':
97
+ this.updateWindow(key, tokensUsed, cost);
98
+ break;
99
+ }
100
+ this.logger.debug('Limits updated after execution', {
101
+ strategy: this.pluginOptions.strategy,
102
+ key,
103
+ tokensUsed,
104
+ cost
105
+ });
106
+ }
107
+ catch (error) {
108
+ this.logger.error('Failed to update limits', {
109
+ strategy: this.pluginOptions.strategy,
110
+ key,
111
+ error: error instanceof Error ? error.message : String(error)
112
+ });
113
+ }
114
+ }
115
+ /**
116
+ * Token bucket rate limiting
117
+ */
118
+ async checkTokenBucket(key, context) {
119
+ const bucket = this.getBucket(key);
120
+ const now = Date.now();
121
+ // Refill bucket
122
+ const timePassed = (now - bucket.lastRefill) / 1000;
123
+ const tokensToAdd = timePassed * this.pluginOptions.refillRate;
124
+ bucket.tokens = Math.min(this.pluginOptions.bucketSize, bucket.tokens + tokensToAdd);
125
+ bucket.lastRefill = now;
126
+ // Check if we can process this request
127
+ const estimatedTokens = this.estimateTokens(context);
128
+ if (bucket.tokens < estimatedTokens) {
129
+ throw new PluginError(`Token bucket depleted. Available: ${Math.floor(bucket.tokens)}, Required: ${estimatedTokens}`, this.name, { availableTokens: bucket.tokens, requiredTokens: estimatedTokens });
130
+ }
131
+ // Check time window limits for requests and cost
132
+ if (now - bucket.windowStart >= this.pluginOptions.timeWindow) {
133
+ bucket.requests = 0;
134
+ bucket.cost = 0;
135
+ bucket.windowStart = now;
136
+ }
137
+ if (bucket.requests >= this.pluginOptions.maxRequests) {
138
+ throw new PluginError(`Request limit exceeded. Max: ${this.pluginOptions.maxRequests}`, this.name, { currentRequests: bucket.requests, maxRequests: this.pluginOptions.maxRequests });
139
+ }
140
+ const estimatedCost = this.pluginOptions.costCalculator(estimatedTokens, context.config?.model || 'unknown');
141
+ if (bucket.cost + estimatedCost > this.pluginOptions.maxCost) {
142
+ throw new PluginError(`Cost limit exceeded. Current: $${bucket.cost.toFixed(4)}, Estimated: $${estimatedCost.toFixed(4)}, Max: $${this.pluginOptions.maxCost}`, this.name, { currentCost: bucket.cost, estimatedCost, maxCost: this.pluginOptions.maxCost });
143
+ }
144
+ // Reserve tokens
145
+ bucket.tokens -= estimatedTokens;
146
+ bucket.requests++;
147
+ }
148
+ /**
149
+ * Sliding window rate limiting
150
+ */
151
+ async checkSlidingWindow(key, context) {
152
+ const now = Date.now();
153
+ const window = this.getWindow(key);
154
+ // For sliding window, we track usage more granularly
155
+ // This is a simplified implementation
156
+ if (now - window.windowStart < this.pluginOptions.timeWindow) {
157
+ const estimatedTokens = this.estimateTokens(context);
158
+ const estimatedCost = this.pluginOptions.costCalculator(estimatedTokens, context.config?.model || 'unknown');
159
+ if (window.tokens + estimatedTokens > this.pluginOptions.maxTokens) {
160
+ throw new PluginError(`Token limit exceeded in sliding window. Current: ${window.tokens}, Estimated: ${estimatedTokens}, Max: ${this.pluginOptions.maxTokens}`, this.name, { currentTokens: window.tokens, estimatedTokens, maxTokens: this.pluginOptions.maxTokens });
161
+ }
162
+ if (window.count >= this.pluginOptions.maxRequests) {
163
+ throw new PluginError(`Request limit exceeded in sliding window. Current: ${window.count}, Max: ${this.pluginOptions.maxRequests}`, this.name, { currentRequests: window.count, maxRequests: this.pluginOptions.maxRequests });
164
+ }
165
+ if (window.cost + estimatedCost > this.pluginOptions.maxCost) {
166
+ throw new PluginError(`Cost limit exceeded in sliding window. Current: $${window.cost.toFixed(4)}, Estimated: $${estimatedCost.toFixed(4)}, Max: $${this.pluginOptions.maxCost}`, this.name, { currentCost: window.cost, estimatedCost, maxCost: this.pluginOptions.maxCost });
167
+ }
168
+ }
169
+ else {
170
+ // Reset window
171
+ window.count = 0;
172
+ window.tokens = 0;
173
+ window.cost = 0;
174
+ window.windowStart = now;
175
+ }
176
+ window.count++;
177
+ }
178
+ /**
179
+ * Fixed window rate limiting
180
+ */
181
+ async checkFixedWindow(key, context) {
182
+ const now = Date.now();
183
+ const window = this.getWindow(key);
184
+ // Reset window if expired
185
+ if (now - window.windowStart >= this.pluginOptions.timeWindow) {
186
+ window.count = 0;
187
+ window.tokens = 0;
188
+ window.cost = 0;
189
+ window.windowStart = now;
190
+ }
191
+ const estimatedTokens = this.estimateTokens(context);
192
+ const estimatedCost = this.pluginOptions.costCalculator(estimatedTokens, context.config?.model || 'unknown');
193
+ if (window.tokens + estimatedTokens > this.pluginOptions.maxTokens) {
194
+ throw new PluginError(`Token limit exceeded in fixed window. Current: ${window.tokens}, Estimated: ${estimatedTokens}, Max: ${this.pluginOptions.maxTokens}`, this.name, { currentTokens: window.tokens, estimatedTokens, maxTokens: this.pluginOptions.maxTokens });
195
+ }
196
+ if (window.count >= this.pluginOptions.maxRequests) {
197
+ throw new PluginError(`Request limit exceeded in fixed window. Current: ${window.count}, Max: ${this.pluginOptions.maxRequests}`, this.name, { currentRequests: window.count, maxRequests: this.pluginOptions.maxRequests });
198
+ }
199
+ if (window.cost + estimatedCost > this.pluginOptions.maxCost) {
200
+ throw new PluginError(`Cost limit exceeded in fixed window. Current: $${window.cost.toFixed(4)}, Estimated: $${estimatedCost.toFixed(4)}, Max: $${this.pluginOptions.maxCost}`, this.name, { currentCost: window.cost, estimatedCost, maxCost: this.pluginOptions.maxCost });
201
+ }
202
+ window.count++;
203
+ }
204
+ /**
205
+ * Update token bucket after execution
206
+ */
207
+ updateTokenBucket(key, _tokensUsed, cost) {
208
+ const bucket = this.getBucket(key);
209
+ bucket.cost += cost;
210
+ }
211
+ /**
212
+ * Update window after execution
213
+ */
214
+ updateWindow(key, tokensUsed, cost) {
215
+ const window = this.getWindow(key);
216
+ window.tokens += tokensUsed;
217
+ window.cost += cost;
218
+ }
219
+ /**
220
+ * Get or create token bucket for key
221
+ */
222
+ getBucket(key) {
223
+ if (!this.buckets.has(key)) {
224
+ this.buckets.set(key, {
225
+ tokens: this.pluginOptions.bucketSize,
226
+ lastRefill: Date.now(),
227
+ requests: 0,
228
+ cost: 0,
229
+ windowStart: Date.now()
230
+ });
231
+ }
232
+ return this.buckets.get(key);
233
+ }
234
+ /**
235
+ * Get or create window for key
236
+ */
237
+ getWindow(key) {
238
+ if (!this.windows.has(key)) {
239
+ this.windows.set(key, {
240
+ count: 0,
241
+ tokens: 0,
242
+ cost: 0,
243
+ windowStart: Date.now()
244
+ });
245
+ }
246
+ return this.windows.get(key);
247
+ }
248
+ /**
249
+ * Generate key for rate limiting (user/session based)
250
+ */
251
+ getKey(context) {
252
+ return context.userId || context.sessionId || context['executionId'] || 'default';
253
+ }
254
+ /**
255
+ * Estimate tokens needed for request
256
+ */
257
+ estimateTokens(context) {
258
+ // Simple estimation - in real implementation, this would be more sophisticated
259
+ const messageLength = context.messages?.reduce((total, msg) => total + (msg.content?.length || 0), 0) || 0;
260
+ // Rough estimation: 1 token per 4 characters
261
+ return Math.ceil(messageLength / 4) + 100; // Add some buffer
262
+ }
263
+ /**
264
+ * Default cost calculator
265
+ */
266
+ defaultCostCalculator(tokens, model) {
267
+ // Different models have different costs
268
+ const modelCosts = {
269
+ 'gpt-4': 0.03,
270
+ 'gpt-4-turbo': 0.01,
271
+ 'gpt-3.5-turbo': 0.002,
272
+ 'claude-3-opus': 0.015,
273
+ 'claude-3-sonnet': 0.003,
274
+ 'claude-3-haiku': 0.00025
275
+ };
276
+ const costPer1000 = modelCosts[model] || this.pluginOptions.tokenCostPer1000;
277
+ return (tokens / 1000) * costPer1000;
278
+ }
279
+ /**
280
+ * Validate plugin options
281
+ */
282
+ validateOptions(options) {
283
+ if (options.strategy === 'none') {
284
+ this.logger.info('LimitsPlugin configured with "none" strategy - no rate limiting will be applied');
285
+ return;
286
+ }
287
+ if (!options.strategy) {
288
+ throw new PluginError('Strategy must be specified for limits plugin. Use "none" to disable rate limiting, or choose from: token-bucket, sliding-window, fixed-window', this.name, { availableStrategies: ['none', 'token-bucket', 'sliding-window', 'fixed-window'] });
289
+ }
290
+ const validStrategies = ['none', 'token-bucket', 'sliding-window', 'fixed-window'];
291
+ if (!validStrategies.includes(options.strategy)) {
292
+ throw new PluginError(`Invalid strategy "${options.strategy}". Must be one of: ${validStrategies.join(', ')}`, this.name, { provided: options.strategy, validStrategies });
293
+ }
294
+ // Token bucket strategy validation
295
+ if (options.strategy === 'token-bucket') {
296
+ if (options.bucketSize !== undefined && options.bucketSize <= 0) {
297
+ throw new PluginError('Bucket size must be positive for token-bucket strategy', this.name, { strategy: options.strategy, bucketSize: options.bucketSize });
298
+ }
299
+ if (options.refillRate !== undefined && options.refillRate < 0) {
300
+ throw new PluginError('Refill rate must be non-negative for token-bucket strategy', this.name, { strategy: options.strategy, refillRate: options.refillRate });
301
+ }
302
+ }
303
+ // Sliding/Fixed window strategy validation
304
+ if (['sliding-window', 'fixed-window'].includes(options.strategy)) {
305
+ if (options.timeWindow !== undefined && options.timeWindow <= 0) {
306
+ throw new PluginError(`Time window must be positive for ${options.strategy} strategy`, this.name, { strategy: options.strategy, timeWindow: options.timeWindow });
307
+ }
308
+ }
309
+ // Common validations for all strategies
310
+ if (options.maxRequests !== undefined && options.maxRequests < 0) {
311
+ throw new PluginError('Max requests must be non-negative', this.name, { strategy: options.strategy, maxRequests: options.maxRequests });
312
+ }
313
+ if (options.maxTokens !== undefined && options.maxTokens < 0) {
314
+ throw new PluginError('Max tokens must be non-negative', this.name, { strategy: options.strategy, maxTokens: options.maxTokens });
315
+ }
316
+ if (options.maxCost !== undefined && options.maxCost < 0) {
317
+ throw new PluginError('Max cost must be non-negative', this.name, { strategy: options.strategy, maxCost: options.maxCost });
318
+ }
319
+ if (options.tokenCostPer1000 !== undefined && options.tokenCostPer1000 < 0) {
320
+ throw new PluginError('Token cost per 1000 must be non-negative', this.name, { strategy: options.strategy, tokenCostPer1000: options.tokenCostPer1000 });
321
+ }
322
+ }
323
+ /**
324
+ * Get current limits status
325
+ *
326
+ * REASON: Limits status contains mixed data types (numbers, strings, arrays, objects) for comprehensive status reporting
327
+ * ALTERNATIVES_CONSIDERED:
328
+ * 1. Strict interface definitions (too rigid for dynamic status data)
329
+ * 2. Union types (becomes unwieldy for status reporting)
330
+ * 3. Generic constraints (too complex for status methods)
331
+ * 4. Separate status types (breaks existing functionality)
332
+ * 5. Type assertions (decreases type safety)
333
+ * TODO: Consider specific status interface if patterns emerge
334
+ */
335
+ getLimitsStatus(key) {
336
+ if (key) {
337
+ const bucket = this.buckets.get(key);
338
+ const window = this.windows.get(key);
339
+ return {
340
+ strategy: this.pluginOptions.strategy,
341
+ key,
342
+ bucket: bucket ? {
343
+ availableTokens: Math.floor(bucket.tokens),
344
+ requests: bucket.requests,
345
+ cost: bucket.cost
346
+ } : null,
347
+ window: window ? {
348
+ count: window.count,
349
+ tokens: window.tokens,
350
+ cost: window.cost,
351
+ windowStart: window.windowStart
352
+ } : null
353
+ };
354
+ }
355
+ return {
356
+ strategy: this.pluginOptions.strategy,
357
+ totalKeys: this.buckets.size + this.windows.size,
358
+ bucketKeys: Array.from(this.buckets.keys()),
359
+ windowKeys: Array.from(this.windows.keys())
360
+ };
361
+ }
362
+ /**
363
+ * Reset limits for a key or all keys
364
+ */
365
+ resetLimits(key) {
366
+ if (key) {
367
+ this.buckets.delete(key);
368
+ this.windows.delete(key);
369
+ this.requestCounts.delete(key);
370
+ this.logger.info('Limits reset for key', { key });
371
+ }
372
+ else {
373
+ this.buckets.clear();
374
+ this.windows.clear();
375
+ this.requestCounts.clear();
376
+ this.logger.info('All limits reset');
377
+ }
378
+ }
379
+ }
380
+ //# sourceMappingURL=limits-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits-plugin.js","sourceRoot":"","sources":["../../src/plugins/limits-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EAGd,cAAc,EACd,cAAc,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA0C9C;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAoC;IAClE,IAAI,GAAG,cAAc,CAAC;IACtB,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,CAAiC;IAC9C,MAAM,CAAU;IAChB,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC1C,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC1C,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElD,YAAY,OAA6B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;QAE3C,mBAAmB;QACnB,IAAI,CAAC,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AAC;CACJ"}
@@ -0,0 +1,14 @@
1
+ import type { ILogEntry, ILogFormatter } from './types';
2
+ /**
3
+ * Default console formatter
4
+ */
5
+ export declare class ConsoleLogFormatter implements ILogFormatter {
6
+ format(entry: ILogEntry): string;
7
+ }
8
+ /**
9
+ * JSON formatter for file/remote logging
10
+ */
11
+ export declare class JsonLogFormatter implements ILogFormatter {
12
+ format(entry: ILogEntry): string;
13
+ }
14
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/plugins/logging/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,aAAa;IACrD,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;CAOnC;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IAClD,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;CAMnC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Default console formatter
3
+ */
4
+ export class ConsoleLogFormatter {
5
+ format(entry) {
6
+ const timestamp = entry.timestamp.toISOString();
7
+ const level = entry.level.toUpperCase().padStart(5);
8
+ const contextStr = entry.context ? ` | ${JSON.stringify(entry.context)}` : '';
9
+ const metadataStr = entry.metadata ? ` | ${JSON.stringify(entry.metadata)}` : '';
10
+ return `[${timestamp}] ${level} | ${entry.message}${contextStr}${metadataStr}`;
11
+ }
12
+ }
13
+ /**
14
+ * JSON formatter for file/remote logging
15
+ */
16
+ export class JsonLogFormatter {
17
+ format(entry) {
18
+ return JSON.stringify({
19
+ ...entry,
20
+ timestamp: entry.timestamp.toISOString()
21
+ });
22
+ }
23
+ }
24
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/plugins/logging/formatters.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC5B,MAAM,CAAC,KAAgB;QACnB,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,OAAO,IAAI,SAAS,KAAK,KAAK,MAAM,KAAK,CAAC,OAAO,GAAG,UAAU,GAAG,WAAW,EAAE,CAAC;IACnF,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACzB,MAAM,CAAC,KAAgB;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;YAClB,GAAG,KAAK;YACR,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE;SAC3C,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -0,0 +1,3 @@
1
+ export { LoggingPlugin } from './logging-plugin';
2
+ export type { ILoggingPluginOptions, TLoggingStrategy, TLogLevel, ILogEntry, ILogFormatter, ILogStorage, ILoggingPluginStats } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/logging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EACR,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,EACX,mBAAmB,EACtB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { LoggingPlugin } from './logging-plugin';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/logging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { AbstractPlugin } from '../../abstracts/abstract-plugin';
2
+ import type { IEventEmitterEventData, TEventName } from '../event-emitter-plugin';
3
+ import { TLogLevel, ILogEntry, ILoggingPluginOptions, ILoggingPluginStats } from './types';
4
+ /**
5
+ * Logging context data - structured data for log entries
6
+ */
7
+ export interface ILoggingContextData extends Record<string, string | number | boolean | Date | undefined> {
8
+ userInput?: string;
9
+ duration?: number;
10
+ toolName?: string;
11
+ success?: boolean;
12
+ executionId?: string;
13
+ operation?: string;
14
+ errorMessage?: string;
15
+ errorStack?: string;
16
+ inputLength?: number;
17
+ responseLength?: number;
18
+ hasOptions?: boolean;
19
+ modelName?: string;
20
+ }
21
+ /**
22
+ * Plugin for logging agent operations
23
+ * Supports multiple logging strategies: console, file, remote, silent
24
+ */
25
+ export declare class LoggingPlugin extends AbstractPlugin<ILoggingPluginOptions, ILoggingPluginStats> {
26
+ name: string;
27
+ version: string;
28
+ private storage;
29
+ private pluginOptions;
30
+ private logger;
31
+ private simpleLogger;
32
+ private logLevels;
33
+ constructor(options: ILoggingPluginOptions);
34
+ /**
35
+ * Handle module events for logging
36
+ */
37
+ onModuleEvent(eventName: TEventName, eventData: IEventEmitterEventData): Promise<void>;
38
+ /**
39
+ * Log a message
40
+ */
41
+ log(level: TLogLevel, message: string, context?: ILoggingContextData, metadata?: ILogEntry['metadata']): Promise<void>;
42
+ /**
43
+ * Log debug message
44
+ */
45
+ debug(message: string, context?: ILoggingContextData, metadata?: ILogEntry['metadata']): Promise<void>;
46
+ /**
47
+ * Log info message
48
+ */
49
+ info(message: string, context?: ILoggingContextData, metadata?: ILogEntry['metadata']): Promise<void>;
50
+ /**
51
+ * Log warning message
52
+ */
53
+ warn(message: string, context?: ILoggingContextData, metadata?: ILogEntry['metadata']): Promise<void>;
54
+ /**
55
+ * Log error message
56
+ */
57
+ error(message: string, error?: Error, context?: ILoggingContextData, metadata?: ILogEntry['metadata']): Promise<void>;
58
+ /**
59
+ * Log execution start
60
+ */
61
+ logExecutionStart(executionId: string, userInput: string, metadata?: ILogEntry['metadata']): Promise<void>;
62
+ /**
63
+ * Log execution completion
64
+ */
65
+ logExecutionComplete(executionId: string, duration: number, metadata?: ILogEntry['metadata']): Promise<void>;
66
+ /**
67
+ * Log tool execution
68
+ */
69
+ logToolExecution(toolName: string, executionId: string, duration?: number, success?: boolean, metadata?: ILogEntry['metadata']): Promise<void>;
70
+ /**
71
+ * Flush any pending logs
72
+ */
73
+ flush(): Promise<void>;
74
+ /**
75
+ * Cleanup resources
76
+ */
77
+ destroy(): Promise<void>;
78
+ /**
79
+ * Check if message should be logged based on level
80
+ */
81
+ private shouldLog;
82
+ /**
83
+ * Validate plugin options
84
+ */
85
+ private validateOptions;
86
+ /**
87
+ * Create storage instance based on strategy
88
+ */
89
+ private createStorage;
90
+ }
91
+ //# sourceMappingURL=logging-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging-plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/logging/logging-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkC,MAAM,iCAAiC,CAAC;AAIjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGlF,OAAO,EACH,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,mBAAmB,EAGtB,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM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