@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,180 @@
1
+ # @robota-sdk/agent-core
2
+
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Add environment-specific builds and conditional exports for optimal browser compatibility
8
+
9
+ This update introduces major build optimizations for better browser performance:
10
+
11
+ ## 🚀 Environment-Specific Builds
12
+ - **Node.js builds**: `dist/node/` with full ESM and CJS support
13
+ - **Browser builds**: `dist/browser/` with optimized ESM bundles
14
+ - **Automatic selection**: Bundlers automatically choose the right build
15
+
16
+ ## 📦 Bundle Size Optimizations
17
+ - **team package**: 36% smaller browser bundles (37.52KB → 24.12KB)
18
+ - **sessions package**: 48% smaller browser bundles (10.64KB → 5.55KB)
19
+ - **Tree-shaking**: Eliminates Node.js-specific code from browser builds
20
+ - **Production optimizations**: Removes console logs and debug code in browser builds
21
+
22
+ ## 🔧 Conditional Exports
23
+
24
+ All packages now support conditional exports for seamless environment detection:
25
+
26
+ ```json
27
+ {
28
+ "exports": {
29
+ "node": "./dist/node/index.js",
30
+ "browser": "./dist/browser/index.js",
31
+ "default": "./dist/node/index.js"
32
+ }
33
+ }
34
+ ```
35
+
36
+ ## 🌐 Enhanced Browser Support
37
+ - **Zero breaking changes**: Existing code continues to work unchanged
38
+ - **Better performance**: Optimized bundles for faster loading
39
+ - **Smaller footprint**: Reduced JavaScript bundle sizes for web applications
40
+ - **Universal API**: Same API works across all environments
41
+
42
+ This update completes the browser compatibility optimization phase, making Robota SDK production-ready for web applications with optimal performance characteristics.
43
+
44
+ ## 2.0.8
45
+
46
+ ### Patch Changes
47
+
48
+ - # Model Configuration Refactoring
49
+
50
+ ## 🚀 **Breaking Changes**
51
+
52
+ ### **Provider Interface Simplification**
53
+ - **OpenAI Provider**: Removed `model`, `temperature`, `maxTokens`, `topP` from provider options
54
+ - **Anthropic Provider**: Removed `model`, `temperature`, `maxTokens` from provider options
55
+ - **Google Provider**: Removed `model`, `temperature`, `maxTokens` from provider options
56
+ - **All Providers**: `client` is now optional, automatically created from `apiKey`
57
+
58
+ ### **Centralized Model Configuration**
59
+ - Model configuration is now exclusively handled through `defaultModel` in Robota constructor
60
+ - Providers are simplified to handle only connection-related settings
61
+ - Runtime model switching via `setModel()` method is now the recommended approach
62
+
63
+ ## ✨ **Improvements**
64
+
65
+ ### **Simplified Provider Creation**
66
+
67
+ ```typescript
68
+ // Before
69
+ const provider = new OpenAIProvider({
70
+ client: openaiClient,
71
+ model: 'gpt-3.5-turbo',
72
+ });
73
+
74
+ // After
75
+ const provider = new OpenAIProvider({
76
+ apiKey: process.env.OPENAI_API_KEY,
77
+ });
78
+ ```
79
+
80
+ ### **Enhanced Validation**
81
+ - Added strict validation for required model configuration
82
+ - Removed default model fallbacks to prevent ambiguous behavior
83
+ - Clear error messages when model is not specified
84
+
85
+ ### **Documentation Updates**
86
+ - Updated all README files with new usage patterns
87
+ - Regenerated API documentation
88
+ - Updated all example files (11 examples)
89
+
90
+ ## 🔧 **Migration Guide**
91
+ 1. **Remove model settings from Provider constructors**
92
+ 2. **Use `apiKey` instead of `client` injection (recommended)**
93
+ 3. **Ensure `defaultModel` is properly configured in Robota constructor**
94
+ 4. **Update any hardcoded model references to use runtime switching**
95
+
96
+ ## 🎯 **Benefits**
97
+ - **Eliminates configuration confusion** - Single source of truth for models
98
+ - **Simplifies provider setup** - Just provide API credentials
99
+ - **Enables better runtime control** - Centralized model management
100
+ - **Improves consistency** - All providers follow same pattern
101
+
102
+ ## 2.0.7
103
+
104
+ ### Patch Changes
105
+
106
+ - Browser compatibility improvements
107
+ - feat: Implement SimpleLogger system to replace direct console usage for better browser compatibility
108
+ - feat: Centralize SimpleLogger in @robota-sdk/agent-core package and export for other packages
109
+ - feat: Add support for silent and stderr-only logging modes via SilentLogger and StderrLogger
110
+ - refactor: Update all packages (@robota-sdk/agent-provider-openai, @robota-sdk/agent-provider-anthropic, etc.) to use centralized SimpleLogger
111
+ - chore: Add ESLint rules to prevent direct console usage while allowing legitimate cases
112
+ - fix: Remove unused AIProvider import from examples to clean up warnings
113
+
114
+ These changes ensure the SDK works properly in browser environments by removing Node.js-specific console behavior while maintaining full backward compatibility.
115
+
116
+ ## 2.0.6
117
+
118
+ ### Patch Changes
119
+
120
+ - Add browser compatibility by removing Node.js dependencies
121
+ - Replace NodeJS.Timeout with cross-platform TimerId type
122
+ - Remove process.env dependency from logger configuration
123
+ - Replace Node.js crypto module with jsSHA library for webhook signatures
124
+ - Update OpenAI stream handlers to work in browser environments
125
+ - Maintain 100% backward compatibility with existing Node.js applications
126
+
127
+ This update enables Robota SDK to run seamlessly in both Node.js and browser environments without breaking changes.
128
+
129
+ ## 2.0.5
130
+
131
+ ### Patch Changes
132
+
133
+ - ## 🎯 TypeScript Declaration File Optimization
134
+
135
+ ## 2.0.4
136
+
137
+ ### Patch Changes
138
+
139
+ - 9f17ac6: Restore README.md files and prevent deletion during build process
140
+
141
+ ## 2.0.3
142
+
143
+ ## 2.0.2
144
+
145
+ ### Patch Changes
146
+
147
+ - Fix npm package documentation by ensuring README.md files are included
148
+
149
+ ## 2.0.1
150
+
151
+ ### Patch Changes
152
+
153
+ - Remove unused dependencies from agents and sessions packages
154
+
155
+ ## 2.0.0
156
+
157
+ ### Major Changes
158
+
159
+ - a3a464c: # Robota SDK v2.0.0-rc.1 - Unified Architecture
160
+
161
+ ## 🚀 Major Changes
162
+
163
+ ### New Unified Core
164
+ - **@robota-sdk/agent-core**: New unified core package consolidating all functionality
165
+ - **Zero `any` types**: Complete TypeScript type safety across all packages
166
+ - **Provider-agnostic design**: Seamless switching between OpenAI, Anthropic, and Google
167
+
168
+ ### Key Features
169
+ - **Multi-Provider Support**: Dynamic provider switching with type safety
170
+ - **Advanced Function Calling**: Type-safe tool system with Zod validation
171
+ - **Real-time Streaming**: Improved streaming with proper error handling
172
+ - **Task Delegation**: Improved delegated workflow support
173
+ - **Plugin Architecture**: Comprehensive plugin system with facade pattern
174
+
175
+ ### Breaking Changes
176
+ - `@robota-sdk/core` functionality moved to `@robota-sdk/agent-core`
177
+ - Redesigned provider interfaces with generic type parameters
178
+ - Updated agent configuration format
179
+
180
+ Complete architecture overhaul focused on type safety and developer experience.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Robota Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ # @robota-sdk/agent-core
2
+
3
+ The comprehensive AI agent framework with type-safe architecture and advanced plugin system.
4
+
5
+ ## Overview
6
+
7
+ The `@robota-sdk/agent-core` package is the unified core of the Robota SDK, providing a complete AI agent system with advanced capabilities for conversation management, tool execution, and extensible plugin architecture.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @robota-sdk/agent-core
13
+ # or
14
+ pnpm add @robota-sdk/agent-core
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```typescript
20
+ import { Robota } from '@robota-sdk/agent-core';
21
+ import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
22
+
23
+ const openaiProvider = new OpenAIProvider({ apiKey: 'sk-...' });
24
+
25
+ const agent = new Robota({
26
+ name: 'MyAgent',
27
+ aiProviders: [openaiProvider],
28
+ defaultModel: {
29
+ provider: 'openai',
30
+ model: 'gpt-4',
31
+ systemMessage: 'You are a helpful assistant.',
32
+ },
33
+ });
34
+
35
+ const response = await agent.run('Hello, world!');
36
+ console.log(response);
37
+ ```
38
+
39
+ ### Browser Quick Start
40
+
41
+ ```typescript
42
+ import { Robota, LoggingPlugin, UsagePlugin } from '@robota-sdk/agent-core';
43
+ import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
44
+
45
+ const openaiProvider = new OpenAIProvider({
46
+ apiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY, // or proxy endpoint
47
+ });
48
+
49
+ // Browser-optimized configuration
50
+ const agent = new Robota({
51
+ name: 'BrowserAgent',
52
+ aiProviders: [openaiProvider],
53
+ defaultModel: {
54
+ provider: 'openai',
55
+ model: 'gpt-3.5-turbo',
56
+ },
57
+ plugins: [
58
+ new LoggingPlugin({ strategy: 'console' }), // Console logging
59
+ new UsagePlugin({ strategy: 'memory' }), // Memory storage
60
+ ],
61
+ });
62
+
63
+ const response = await agent.run('Hello from browser!');
64
+ console.log(response);
65
+ ```
66
+
67
+ ## Key Features
68
+
69
+ ### 🌐 Cross-Platform Compatibility
70
+
71
+ - **Universal Runtime Support**: Works seamlessly in Node.js, browsers, and WebWorkers
72
+ - **Zero Breaking Changes**: Existing Node.js code runs unchanged in browsers
73
+ - **Pure JavaScript Implementation**: No Node.js-specific dependencies in core functionality
74
+ - **Browser-Optimized Storage**: Memory-based alternatives for file system operations
75
+ - **Secure API Patterns**: Proxy server support for secure browser deployments
76
+
77
+ ### 🤖 Agent System
78
+
79
+ - **Type-Safe Architecture**: Full TypeScript support with generic type parameters
80
+ - **Robota Class**: Complete AI agent implementation with conversation + tool system + plugin integration
81
+ - **Stateless Service Layer**: ConversationService, ToolExecutionService, ExecutionService for business logic
82
+ - **Manager Layer**: AIProviders, Tools, AgentFactory, Plugins, ConversationHistory for resource management
83
+ - **Parallel Tool Execution**: Concurrent multi-tool calling support
84
+
85
+ ### 🌊 Streaming Response System
86
+
87
+ - **Real-time Streaming**: Full streaming support across all AI providers
88
+ - **Modular Architecture**: Separate streaming/parsing logic for each provider
89
+ - **Provider Support**: OpenAI, Anthropic, Google with dedicated stream handlers
90
+
91
+ ### 🔧 Tool System
92
+
93
+ - **Type-Safe Tools**: `BaseTool<TParameters, TResult>` with compile-time type checking
94
+ - **ToolRegistry**: Schema storage and validation system
95
+ - **Function Tools**: Zod schema-based function tool implementation
96
+ - **OpenAPI/MCP Support**: Basic structure for extensibility
97
+
98
+ ## Recent Updates
99
+
100
+ - Tool execution results preserve `executionId` mappings for both success and failure to keep deterministic ordering.
101
+
102
+ ### 🔌 Plugin System
103
+
104
+ Eight core plugins with type-safe configuration and BasePluginOptions integration:
105
+
106
+ - **ConversationHistoryPlugin**: Comprehensive conversation storage with support for memory, file, and database backends. Features auto-save, batch processing, and configurable limits.
107
+ - **UsagePlugin**: Advanced usage analytics including token counting, cost calculation, aggregated statistics, and multiple storage strategies (memory/file/remote).
108
+ - **LoggingPlugin**: Multi-level logging system with console, file, and remote endpoints. Supports custom formatters, batch processing, and structured logging.
109
+ - **PerformancePlugin**: Real-time performance monitoring including execution time tracking, memory usage, CPU metrics, and customizable performance thresholds.
110
+ - **ErrorHandlingPlugin**: Robust error management with multiple strategies (simple, exponential-backoff, circuit-breaker, silent) and custom error handlers.
111
+ - **LimitsPlugin**: Advanced rate limiting with token bucket, sliding window, and fixed window strategies. Supports cost tracking and custom calculators.
112
+ - **EventEmitterPlugin**: Comprehensive event system with async/sync event handling, filtering, buffering, and lifecycle event tracking.
113
+ - **WebhookPlugin**: HTTP webhook notifications with batch processing, retry logic, custom transformers, and concurrent request management.
114
+
115
+ #### Plugin Features
116
+
117
+ - **Type Safety**: All plugins extend BasePluginOptions for consistent configuration
118
+ - **Lifecycle Integration**: Automatic integration with agent lifecycle events
119
+ - **Resource Management**: Built-in cleanup and resource optimization
120
+ - **Performance Monitoring**: All plugins include built-in statistics and monitoring
121
+ - **Error Resilience**: Graceful error handling across all plugin operations
122
+
123
+ #### Plugin Control and Configuration
124
+
125
+ - **Clear Disable Options**: Every plugin provides multiple ways to disable functionality
126
+ - **No Arbitrary Decisions**: Plugins avoid making policy decisions without explicit configuration
127
+ - **Explicit Configuration**: All automatic behaviors can be controlled through configuration
128
+ - **Silent Modes**: Most plugins support 'silent' strategies for performance-critical scenarios
129
+
130
+ ```typescript
131
+ // Complete plugin disable
132
+ const agent = new Robota({
133
+ plugins: [], // No plugins
134
+ });
135
+
136
+ // Selective plugin disable
137
+ const agent = new Robota({
138
+ plugins: [
139
+ new LoggingPlugin({ strategy: 'silent', enabled: false }),
140
+ new LimitsPlugin({ strategy: 'none' }),
141
+ new UsagePlugin({ strategy: 'silent' }),
142
+ ],
143
+ });
144
+ ```
145
+
146
+ #### Plugin Documentation
147
+
148
+ - **[Plugin Guide](./docs/PLUGINS.md)**: Unified plugin behavior and configuration guide
149
+
150
+ ### 🔒 Type Safety Features
151
+
152
+ - **Generic Type Parameters**: `BaseAgent<TConfig, TContext, TMessage>`
153
+ - **Provider Agnostic**: Dynamic provider registration with type safety
154
+ - **Extended RunContext**: Provider-specific options with type preservation
155
+ - **Plugin Type Parameters**: `BasePlugin<TOptions, TStats>` for specialized configurations
156
+
157
+ ## Architecture
158
+
159
+ ### Core Abstraction Layers
160
+
161
+ ```
162
+ BaseAgent<TConfig, TContext, TMessage> (Abstract Class)
163
+ └── Robota (Implementation - AI conversation + tool system + plugins)
164
+
165
+ BaseAIProvider<TConfig, TMessage, TResponse>
166
+ ├── OpenAIProvider (via @robota-sdk/agent-provider-openai)
167
+ ├── AnthropicProvider (via @robota-sdk/agent-provider-anthropic)
168
+ └── GoogleProvider (via @robota-sdk/agent-provider-google)
169
+
170
+ BaseTool<TParameters, TResult>
171
+ ├── FunctionTool (Zod schema-based)
172
+ ├── OpenAPITool (API specification-based)
173
+ └── MCPTool (Model Context Protocol)
174
+
175
+ BasePlugin<TOptions, TStats>
176
+ ├── Core Plugins (8 essential plugins)
177
+ └── Custom Plugins (User-defined extensions)
178
+ ```
179
+
180
+ ### Module Structure
181
+
182
+ ```
183
+ packages/agents/src/
184
+ ├── abstracts/ # Abstract base classes with type parameters
185
+ ├── interfaces/ # Type-safe interface definitions
186
+ ├── agents/ # Main agent system
187
+ │ ├── managers/ # Resource managers
188
+ │ ├── services/ # Stateless business logic
189
+ │ └── tools/ # Tool system
190
+ ├── plugins/ # Plugin system with Facade pattern
191
+ └── utils/ # Core utilities
192
+ ```
193
+
194
+ ## Development
195
+
196
+ See [Development Guide](./docs/DEVELOPMENT.md) for development guidelines.
197
+
198
+ ## API Reference
199
+
200
+ See [api.md](api.md) for complete API documentation.
201
+
202
+ ## Architecture Guide
203
+
204
+ See [Architecture](./docs/ARCHITECTURE.md) for detailed architecture information.
205
+
206
+ ## Examples
207
+
208
+ - [Basic Usage](../../../docs/examples/basic-usage.md)
209
+ - [Browser Usage](../../../docs/examples/browser-usage.md) 🌐
210
+ - [Tool Integration](../../../docs/examples/tool-integration.md)
211
+ - [Plugin Development](../../../docs/examples/plugin-development.md)
212
+ - [Streaming Responses](../../../docs/examples/streaming.md)
213
+
214
+ ## Package Compatibility
215
+
216
+ ### Integrated Packages
217
+
218
+ - **@robota-sdk/agent-provider-openai**: Complete agents standard migration
219
+ - **@robota-sdk/agent-provider-anthropic**: Complete agents standard migration
220
+ - **@robota-sdk/agent-provider-google**: Complete agents standard migration
221
+ - **@robota-sdk/agent-team**: assignTask MCP tool collection (team creation removed)
222
+
223
+ ### Deprecated Packages
224
+
225
+ - **@robota-sdk/core**: Deprecated - functionality moved to agents
226
+ - **@robota-sdk/agent-tools**: Deprecated - functionality moved to agents
227
+
228
+ ## License
229
+
230
+ MIT
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @fileoverview Abstract Agent Base Class
3
+ *
4
+ * 🎯 ABSTRACT CLASS - DO NOT DEPEND ON CONCRETE IMPLEMENTATIONS
5
+ *
6
+ * This class defines the foundational lifecycle for agent implementations.
7
+ * Subclasses provide provider/tool-specific behavior while inheriting the
8
+ * shared guarantees around initialization, history, and disposal.
9
+ */
10
+ import type { IAgent, IAgentConfig, TUniversalMessage, IRunOptions } from '../interfaces/agent';
11
+ export declare abstract class AbstractAgent<TConfig = IAgentConfig, TContext = IRunOptions, TMessage = TUniversalMessage> implements IAgent<TConfig, TContext, TMessage> {
12
+ protected history: TMessage[];
13
+ protected isInitialized: boolean;
14
+ protected config?: TConfig;
15
+ /**
16
+ * Initialize the agent (subclass responsibility)
17
+ */
18
+ protected abstract initialize(): Promise<void>;
19
+ /**
20
+ * Configure the agent with type-safe configuration
21
+ */
22
+ configure(config: TConfig): Promise<void>;
23
+ /**
24
+ * Run agent with user input and type-safe context
25
+ */
26
+ abstract run(input: string, context?: TContext): Promise<string>;
27
+ /**
28
+ * Run agent with streaming response and type-safe context
29
+ */
30
+ abstract runStream(input: string, context?: TContext): AsyncGenerator<string, void, never>;
31
+ /**
32
+ * Get conversation history with type-safe messages
33
+ */
34
+ getHistory(): TMessage[];
35
+ /**
36
+ * Clear conversation history
37
+ */
38
+ clearHistory(): void;
39
+ /**
40
+ * Add message to history
41
+ */
42
+ protected addMessage(message: TMessage): void;
43
+ /**
44
+ * Validate user input
45
+ */
46
+ protected validateInput(input: string): void;
47
+ /**
48
+ * Ensure agent is initialized before running
49
+ */
50
+ protected ensureInitialized(): Promise<void>;
51
+ /**
52
+ * Cleanup resources
53
+ */
54
+ dispose(): Promise<void>;
55
+ }
56
+ //# sourceMappingURL=abstract-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstract-agent.d.ts","sourceRoot":"","sources":["../../src/abstracts/abstract-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEhG,8BAAsB,aAAa,CAC/B,OAAO,GAAG,YAAY,EACtB,QAAQ,GAAG,WAAW,EACtB,QAAQ,GAAG,iBAAiB,CAC9B,YAAW,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;IAC5C,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAM;IACnC,SAAS,CAAC,aAAa,UAAS;IAChC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9C;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/C;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAEhE;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC;IAE1F;;OAEG;IACH,UAAU,IAAI,QAAQ,EAAE;IAIxB;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI;IAI7C;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5C;;OAEG;cACa,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOlD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjC"}
@@ -0,0 +1,55 @@
1
+ export class AbstractAgent {
2
+ history = [];
3
+ isInitialized = false;
4
+ config;
5
+ /**
6
+ * Configure the agent with type-safe configuration
7
+ */
8
+ async configure(config) {
9
+ this.config = config;
10
+ await this.ensureInitialized();
11
+ }
12
+ /**
13
+ * Get conversation history with type-safe messages
14
+ */
15
+ getHistory() {
16
+ return [...this.history];
17
+ }
18
+ /**
19
+ * Clear conversation history
20
+ */
21
+ clearHistory() {
22
+ this.history = [];
23
+ }
24
+ /**
25
+ * Add message to history
26
+ */
27
+ addMessage(message) {
28
+ this.history.push(message);
29
+ }
30
+ /**
31
+ * Validate user input
32
+ */
33
+ validateInput(input) {
34
+ if (!input || typeof input !== 'string') {
35
+ throw new Error('Input must be a non-empty string');
36
+ }
37
+ }
38
+ /**
39
+ * Ensure agent is initialized before running
40
+ */
41
+ async ensureInitialized() {
42
+ if (!this.isInitialized) {
43
+ await this.initialize();
44
+ this.isInitialized = true;
45
+ }
46
+ }
47
+ /**
48
+ * Cleanup resources
49
+ */
50
+ async dispose() {
51
+ this.clearHistory();
52
+ this.isInitialized = false;
53
+ }
54
+ }
55
+ //# sourceMappingURL=abstract-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstract-agent.js","sourceRoot":"","sources":["../../src/abstracts/abstract-agent.ts"],"names":[],"mappings":"AAWA,MAAM,OAAgB,aAAa;IAKrB,OAAO,GAAe,EAAE,CAAC;IACzB,aAAa,GAAG,KAAK,CAAC;IACtB,MAAM,CAAW;IAO3B;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAYD;;OAEG;IACH,UAAU;QACN,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,YAAY;QACR,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACO,UAAU,CAAC,OAAiB;QAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,KAAa;QACjC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,iBAAiB;QAC7B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACT,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;CACJ"}