beddel 0.2.2 → 0.3.0

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 (357) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +117 -14
  3. package/dist/agents/chat/chat.handler.d.ts +12 -0
  4. package/dist/agents/chat/chat.handler.d.ts.map +1 -0
  5. package/dist/agents/chat/chat.handler.js +145 -0
  6. package/dist/agents/chat/chat.handler.js.map +1 -0
  7. package/dist/agents/chat/chat.schema.d.ts +38 -0
  8. package/dist/agents/chat/chat.schema.d.ts.map +1 -0
  9. package/dist/agents/chat/chat.schema.js +31 -0
  10. package/dist/agents/chat/chat.schema.js.map +1 -0
  11. package/dist/agents/chat/chat.types.d.ts +42 -0
  12. package/dist/agents/chat/chat.types.d.ts.map +1 -0
  13. package/dist/agents/chat/chat.types.js +6 -0
  14. package/dist/agents/chat/chat.types.js.map +1 -0
  15. package/dist/agents/chat/chat.yaml +148 -0
  16. package/dist/agents/chat/index.d.ts +16 -0
  17. package/dist/agents/chat/index.d.ts.map +1 -0
  18. package/dist/agents/chat/index.js +21 -0
  19. package/dist/agents/chat/index.js.map +1 -0
  20. package/dist/agents/chromadb/chromadb.handler.d.ts +12 -0
  21. package/dist/agents/chromadb/chromadb.handler.d.ts.map +1 -0
  22. package/dist/agents/chromadb/chromadb.handler.js +139 -0
  23. package/dist/agents/chromadb/chromadb.handler.js.map +1 -0
  24. package/dist/agents/chromadb/chromadb.schema.d.ts +36 -0
  25. package/dist/agents/chromadb/chromadb.schema.d.ts.map +1 -0
  26. package/dist/agents/chromadb/chromadb.schema.js +33 -0
  27. package/dist/agents/chromadb/chromadb.schema.js.map +1 -0
  28. package/dist/agents/chromadb/chromadb.types.d.ts +49 -0
  29. package/dist/agents/chromadb/chromadb.types.d.ts.map +1 -0
  30. package/dist/agents/chromadb/chromadb.types.js +6 -0
  31. package/dist/agents/chromadb/chromadb.types.js.map +1 -0
  32. package/dist/agents/chromadb/chromadb.yaml +128 -0
  33. package/dist/agents/chromadb/index.d.ts +15 -0
  34. package/dist/agents/chromadb/index.d.ts.map +1 -0
  35. package/dist/agents/chromadb/index.js +20 -0
  36. package/dist/agents/chromadb/index.js.map +1 -0
  37. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts +8 -0
  38. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts.map +1 -0
  39. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js +61 -0
  40. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js.map +1 -0
  41. package/dist/agents/gemini-vectorize/gemini-vectorize.schema.d.ts +22 -0
  42. package/dist/agents/gemini-vectorize/gemini-vectorize.schema.d.ts.map +1 -0
  43. package/dist/agents/gemini-vectorize/gemini-vectorize.schema.js +20 -0
  44. package/dist/agents/gemini-vectorize/gemini-vectorize.schema.js.map +1 -0
  45. package/dist/agents/gemini-vectorize/gemini-vectorize.types.d.ts +32 -0
  46. package/dist/agents/gemini-vectorize/gemini-vectorize.types.d.ts.map +1 -0
  47. package/dist/agents/gemini-vectorize/gemini-vectorize.types.js +6 -0
  48. package/dist/agents/gemini-vectorize/gemini-vectorize.types.js.map +1 -0
  49. package/dist/agents/gemini-vectorize/gemini-vectorize.yaml +84 -0
  50. package/dist/agents/gemini-vectorize/index.d.ts +15 -0
  51. package/dist/agents/gemini-vectorize/index.d.ts.map +1 -0
  52. package/dist/agents/gemini-vectorize/index.js +20 -0
  53. package/dist/agents/gemini-vectorize/index.js.map +1 -0
  54. package/dist/agents/gitmcp/gitmcp.handler.d.ts +12 -0
  55. package/dist/agents/gitmcp/gitmcp.handler.d.ts.map +1 -0
  56. package/dist/agents/gitmcp/gitmcp.handler.js +95 -0
  57. package/dist/agents/gitmcp/gitmcp.handler.js.map +1 -0
  58. package/dist/agents/gitmcp/gitmcp.schema.d.ts +17 -0
  59. package/dist/agents/gitmcp/gitmcp.schema.d.ts.map +1 -0
  60. package/dist/agents/gitmcp/gitmcp.schema.js +18 -0
  61. package/dist/agents/gitmcp/gitmcp.schema.js.map +1 -0
  62. package/dist/agents/gitmcp/gitmcp.types.d.ts +31 -0
  63. package/dist/agents/gitmcp/gitmcp.types.d.ts.map +1 -0
  64. package/dist/agents/gitmcp/gitmcp.types.js +6 -0
  65. package/dist/agents/gitmcp/gitmcp.types.js.map +1 -0
  66. package/dist/agents/gitmcp/gitmcp.yaml +71 -0
  67. package/dist/agents/gitmcp/index.d.ts +16 -0
  68. package/dist/agents/gitmcp/index.d.ts.map +1 -0
  69. package/dist/agents/gitmcp/index.js +21 -0
  70. package/dist/agents/gitmcp/index.js.map +1 -0
  71. package/dist/agents/image/image.handler.d.ts +8 -0
  72. package/dist/agents/image/image.handler.d.ts.map +1 -0
  73. package/dist/agents/image/image.handler.js +69 -0
  74. package/dist/agents/image/image.handler.js.map +1 -0
  75. package/dist/agents/image/image.schema.d.ts +29 -0
  76. package/dist/agents/image/image.schema.d.ts.map +1 -0
  77. package/dist/agents/image/image.schema.js +26 -0
  78. package/dist/agents/image/image.schema.js.map +1 -0
  79. package/dist/agents/image/image.types.d.ts +43 -0
  80. package/dist/agents/image/image.types.d.ts.map +1 -0
  81. package/dist/agents/image/image.types.js +6 -0
  82. package/dist/agents/image/image.types.js.map +1 -0
  83. package/{src/agents/image-agent.yaml → dist/agents/image/image.yaml} +21 -21
  84. package/dist/agents/image/index.d.ts +14 -0
  85. package/dist/agents/image/index.d.ts.map +1 -0
  86. package/dist/agents/image/index.js +19 -0
  87. package/dist/agents/image/index.js.map +1 -0
  88. package/dist/agents/index.d.ts +104 -0
  89. package/dist/agents/index.d.ts.map +1 -0
  90. package/dist/agents/index.js +82 -0
  91. package/dist/agents/index.js.map +1 -0
  92. package/dist/agents/joker/index.d.ts +14 -0
  93. package/dist/agents/joker/index.d.ts.map +1 -0
  94. package/dist/agents/joker/index.js +19 -0
  95. package/dist/agents/joker/index.js.map +1 -0
  96. package/dist/agents/joker/joker.handler.d.ts +8 -0
  97. package/dist/agents/joker/joker.handler.d.ts.map +1 -0
  98. package/dist/agents/joker/joker.handler.js +44 -0
  99. package/dist/agents/joker/joker.handler.js.map +1 -0
  100. package/dist/agents/joker/joker.schema.d.ts +12 -0
  101. package/dist/agents/joker/joker.schema.d.ts.map +1 -0
  102. package/dist/agents/joker/joker.schema.js +13 -0
  103. package/dist/agents/joker/joker.schema.js.map +1 -0
  104. package/dist/agents/joker/joker.types.d.ts +36 -0
  105. package/dist/agents/joker/joker.types.d.ts.map +1 -0
  106. package/dist/agents/joker/joker.types.js +6 -0
  107. package/dist/agents/joker/joker.types.js.map +1 -0
  108. package/{src/agents/joker-agent.yaml → dist/agents/joker/joker.yaml} +4 -4
  109. package/dist/agents/llm/index.d.ts +15 -0
  110. package/dist/agents/llm/index.d.ts.map +1 -0
  111. package/dist/agents/llm/index.js +20 -0
  112. package/dist/agents/llm/index.js.map +1 -0
  113. package/dist/agents/llm/llm.handler.d.ts +8 -0
  114. package/dist/agents/llm/llm.handler.d.ts.map +1 -0
  115. package/dist/agents/llm/llm.handler.js +64 -0
  116. package/dist/agents/llm/llm.handler.js.map +1 -0
  117. package/dist/agents/llm/llm.schema.d.ts +26 -0
  118. package/dist/agents/llm/llm.schema.d.ts.map +1 -0
  119. package/dist/agents/llm/llm.schema.js +23 -0
  120. package/dist/agents/llm/llm.schema.js.map +1 -0
  121. package/dist/agents/llm/llm.types.d.ts +34 -0
  122. package/dist/agents/llm/llm.types.d.ts.map +1 -0
  123. package/dist/agents/llm/llm.types.js +7 -0
  124. package/dist/agents/llm/llm.types.js.map +1 -0
  125. package/dist/agents/llm/llm.yaml +87 -0
  126. package/dist/agents/mcp-tool/index.d.ts +14 -0
  127. package/dist/agents/mcp-tool/index.d.ts.map +1 -0
  128. package/dist/agents/mcp-tool/index.js +19 -0
  129. package/dist/agents/mcp-tool/index.js.map +1 -0
  130. package/dist/agents/mcp-tool/mcp-tool.handler.d.ts +12 -0
  131. package/dist/agents/mcp-tool/mcp-tool.handler.d.ts.map +1 -0
  132. package/dist/agents/mcp-tool/mcp-tool.handler.js +116 -0
  133. package/dist/agents/mcp-tool/mcp-tool.handler.js.map +1 -0
  134. package/dist/agents/mcp-tool/mcp-tool.schema.d.ts +19 -0
  135. package/dist/agents/mcp-tool/mcp-tool.schema.d.ts.map +1 -0
  136. package/dist/agents/mcp-tool/mcp-tool.schema.js +20 -0
  137. package/dist/agents/mcp-tool/mcp-tool.schema.js.map +1 -0
  138. package/dist/agents/mcp-tool/mcp-tool.types.d.ts +31 -0
  139. package/dist/agents/mcp-tool/mcp-tool.types.d.ts.map +1 -0
  140. package/dist/agents/mcp-tool/mcp-tool.types.js +6 -0
  141. package/dist/agents/mcp-tool/mcp-tool.types.js.map +1 -0
  142. package/dist/agents/mcp-tool/mcp-tool.yaml +71 -0
  143. package/dist/agents/rag/index.d.ts +15 -0
  144. package/dist/agents/rag/index.d.ts.map +1 -0
  145. package/dist/agents/rag/index.js +20 -0
  146. package/dist/agents/rag/index.js.map +1 -0
  147. package/dist/agents/rag/rag.handler.d.ts +9 -0
  148. package/dist/agents/rag/rag.handler.d.ts.map +1 -0
  149. package/dist/agents/rag/rag.handler.js +78 -0
  150. package/dist/agents/rag/rag.handler.js.map +1 -0
  151. package/dist/agents/rag/rag.schema.d.ts +27 -0
  152. package/dist/agents/rag/rag.schema.d.ts.map +1 -0
  153. package/dist/agents/rag/rag.schema.js +24 -0
  154. package/dist/agents/rag/rag.schema.js.map +1 -0
  155. package/dist/agents/rag/rag.types.d.ts +42 -0
  156. package/dist/agents/rag/rag.types.d.ts.map +1 -0
  157. package/dist/agents/rag/rag.types.js +7 -0
  158. package/dist/agents/rag/rag.types.js.map +1 -0
  159. package/dist/agents/rag/rag.yaml +89 -0
  160. package/dist/agents/{agentRegistry.d.ts → registry/agentRegistry.d.ts} +30 -1
  161. package/dist/agents/registry/agentRegistry.d.ts.map +1 -0
  162. package/dist/agents/{agentRegistry.js → registry/agentRegistry.js} +187 -5
  163. package/dist/agents/registry/agentRegistry.js.map +1 -0
  164. package/dist/agents/registry/index.d.ts +6 -0
  165. package/dist/agents/registry/index.d.ts.map +1 -0
  166. package/dist/agents/registry/index.js +10 -0
  167. package/dist/agents/registry/index.js.map +1 -0
  168. package/dist/agents/translator/index.d.ts +14 -0
  169. package/dist/agents/translator/index.d.ts.map +1 -0
  170. package/dist/agents/translator/index.js +19 -0
  171. package/dist/agents/translator/index.js.map +1 -0
  172. package/dist/agents/translator/translator.handler.d.ts +8 -0
  173. package/dist/agents/translator/translator.handler.d.ts.map +1 -0
  174. package/dist/agents/translator/translator.handler.js +81 -0
  175. package/dist/agents/translator/translator.handler.js.map +1 -0
  176. package/dist/agents/translator/translator.schema.d.ts +27 -0
  177. package/dist/agents/translator/translator.schema.d.ts.map +1 -0
  178. package/dist/agents/translator/translator.schema.js +28 -0
  179. package/dist/agents/translator/translator.schema.js.map +1 -0
  180. package/dist/agents/translator/translator.types.d.ts +41 -0
  181. package/dist/agents/translator/translator.types.d.ts.map +1 -0
  182. package/dist/agents/translator/translator.types.js +6 -0
  183. package/dist/agents/translator/translator.types.js.map +1 -0
  184. package/{src/agents/translator-agent.yaml → dist/agents/translator/translator.yaml} +27 -27
  185. package/dist/client/index.d.ts +89 -0
  186. package/dist/client/index.d.ts.map +1 -0
  187. package/dist/client/index.js +93 -0
  188. package/dist/client/index.js.map +1 -0
  189. package/dist/client/types.d.ts +17 -0
  190. package/dist/client/types.d.ts.map +1 -0
  191. package/dist/client/types.js +7 -0
  192. package/dist/client/types.js.map +1 -0
  193. package/dist/firebase/tenantManager.d.ts +34 -2
  194. package/dist/firebase/tenantManager.d.ts.map +1 -1
  195. package/dist/firebase/tenantManager.js +67 -1
  196. package/dist/firebase/tenantManager.js.map +1 -1
  197. package/dist/index.d.ts +10 -4
  198. package/dist/index.d.ts.map +1 -1
  199. package/dist/index.js +24 -7
  200. package/dist/index.js.map +1 -1
  201. package/dist/runtime/declarativeAgentRuntime.d.ts +17 -52
  202. package/dist/runtime/declarativeAgentRuntime.d.ts.map +1 -1
  203. package/dist/runtime/declarativeAgentRuntime.js +259 -361
  204. package/dist/runtime/declarativeAgentRuntime.js.map +1 -1
  205. package/dist/runtime/index.d.ts +14 -0
  206. package/dist/runtime/index.d.ts.map +1 -0
  207. package/dist/runtime/index.js +38 -0
  208. package/dist/runtime/index.js.map +1 -0
  209. package/dist/runtime/llmProviderFactory.d.ts +47 -0
  210. package/dist/runtime/llmProviderFactory.d.ts.map +1 -0
  211. package/dist/runtime/llmProviderFactory.js +119 -0
  212. package/dist/runtime/llmProviderFactory.js.map +1 -0
  213. package/dist/runtime/workflowExecutor.d.ts +31 -0
  214. package/dist/runtime/workflowExecutor.d.ts.map +1 -0
  215. package/dist/runtime/workflowExecutor.js +80 -0
  216. package/dist/runtime/workflowExecutor.js.map +1 -0
  217. package/dist/server/api/graphql.js +3 -3
  218. package/dist/server/api/graphql.js.map +1 -1
  219. package/dist/server/index.d.ts +2 -2
  220. package/dist/server/index.d.ts.map +1 -1
  221. package/dist/server/index.js +2 -2
  222. package/dist/server/index.js.map +1 -1
  223. package/dist/shared/index.d.ts +7 -0
  224. package/dist/shared/index.d.ts.map +1 -0
  225. package/dist/shared/index.js +23 -0
  226. package/dist/shared/index.js.map +1 -0
  227. package/dist/shared/types/agent.types.d.ts +63 -0
  228. package/dist/shared/types/agent.types.d.ts.map +1 -0
  229. package/dist/shared/types/agent.types.js +18 -0
  230. package/dist/shared/types/agent.types.js.map +1 -0
  231. package/dist/shared/types/execution.types.d.ts +42 -0
  232. package/dist/shared/types/execution.types.d.ts.map +1 -0
  233. package/dist/shared/types/execution.types.js +7 -0
  234. package/dist/shared/types/execution.types.js.map +1 -0
  235. package/dist/shared/types/index.d.ts +7 -0
  236. package/dist/shared/types/index.d.ts.map +1 -0
  237. package/dist/shared/types/index.js +23 -0
  238. package/dist/shared/types/index.js.map +1 -0
  239. package/dist/shared/types/schema.types.d.ts +52 -0
  240. package/dist/shared/types/schema.types.d.ts.map +1 -0
  241. package/dist/shared/types/schema.types.js +7 -0
  242. package/dist/shared/types/schema.types.js.map +1 -0
  243. package/dist/shared/utils/index.d.ts +5 -0
  244. package/dist/shared/utils/index.d.ts.map +1 -0
  245. package/dist/shared/utils/index.js +21 -0
  246. package/dist/shared/utils/index.js.map +1 -0
  247. package/dist/shared/utils/validation.d.ts +42 -0
  248. package/dist/shared/utils/validation.d.ts.map +1 -0
  249. package/dist/shared/utils/validation.js +93 -0
  250. package/dist/shared/utils/validation.js.map +1 -0
  251. package/dist/tenant/TenantManager.d.ts +152 -0
  252. package/dist/tenant/TenantManager.d.ts.map +1 -0
  253. package/dist/tenant/TenantManager.js +392 -0
  254. package/dist/tenant/TenantManager.js.map +1 -0
  255. package/dist/tenant/index.d.ts +47 -0
  256. package/dist/tenant/index.d.ts.map +1 -0
  257. package/dist/tenant/index.js +74 -0
  258. package/dist/tenant/index.js.map +1 -0
  259. package/dist/tenant/interfaces.d.ts +170 -0
  260. package/dist/tenant/interfaces.d.ts.map +1 -0
  261. package/dist/tenant/interfaces.js +67 -0
  262. package/dist/tenant/interfaces.js.map +1 -0
  263. package/dist/tenant/providerFactory.d.ts +43 -0
  264. package/dist/tenant/providerFactory.d.ts.map +1 -0
  265. package/dist/tenant/providerFactory.js +70 -0
  266. package/dist/tenant/providerFactory.js.map +1 -0
  267. package/dist/tenant/providerRegistry.d.ts +47 -0
  268. package/dist/tenant/providerRegistry.d.ts.map +1 -0
  269. package/dist/tenant/providerRegistry.js +79 -0
  270. package/dist/tenant/providerRegistry.js.map +1 -0
  271. package/dist/tenant/providers/FirebaseTenantProvider.d.ts +41 -0
  272. package/dist/tenant/providers/FirebaseTenantProvider.d.ts.map +1 -0
  273. package/dist/tenant/providers/FirebaseTenantProvider.js +290 -0
  274. package/dist/tenant/providers/FirebaseTenantProvider.js.map +1 -0
  275. package/dist/tenant/providers/InMemoryTenantProvider.d.ts +18 -0
  276. package/dist/tenant/providers/InMemoryTenantProvider.d.ts.map +1 -0
  277. package/dist/tenant/providers/InMemoryTenantProvider.js +137 -0
  278. package/dist/tenant/providers/InMemoryTenantProvider.js.map +1 -0
  279. package/package.json +46 -10
  280. package/src/agents/chat/chat.handler.ts +211 -0
  281. package/src/agents/chat/chat.schema.ts +33 -0
  282. package/src/agents/chat/chat.types.ts +46 -0
  283. package/src/agents/chat/chat.yaml +148 -0
  284. package/src/agents/chat/index.ts +21 -0
  285. package/src/agents/chromadb/chromadb.handler.ts +130 -0
  286. package/src/agents/chromadb/chromadb.schema.ts +35 -0
  287. package/src/agents/chromadb/chromadb.types.ts +52 -0
  288. package/src/agents/chromadb/chromadb.yaml +128 -0
  289. package/src/agents/chromadb/index.ts +20 -0
  290. package/src/agents/gemini-vectorize/gemini-vectorize.handler.ts +75 -0
  291. package/src/agents/gemini-vectorize/gemini-vectorize.schema.ts +22 -0
  292. package/src/agents/gemini-vectorize/gemini-vectorize.types.ts +34 -0
  293. package/src/agents/gemini-vectorize/gemini-vectorize.yaml +84 -0
  294. package/src/agents/gemini-vectorize/index.ts +20 -0
  295. package/src/agents/gitmcp/gitmcp.handler.ts +122 -0
  296. package/src/agents/gitmcp/gitmcp.schema.ts +20 -0
  297. package/src/agents/gitmcp/gitmcp.types.ts +33 -0
  298. package/src/agents/gitmcp/gitmcp.yaml +71 -0
  299. package/src/agents/gitmcp/index.ts +21 -0
  300. package/src/agents/image/image.handler.ts +86 -0
  301. package/src/agents/image/image.schema.ts +28 -0
  302. package/src/agents/image/image.types.ts +46 -0
  303. package/src/agents/image/image.yaml +86 -0
  304. package/src/agents/image/index.ts +19 -0
  305. package/src/agents/index.ts +63 -0
  306. package/src/agents/joker/index.ts +19 -0
  307. package/src/agents/joker/joker.handler.ts +55 -0
  308. package/src/agents/joker/joker.schema.ts +15 -0
  309. package/src/agents/joker/joker.types.ts +38 -0
  310. package/src/agents/joker/joker.yaml +47 -0
  311. package/src/agents/llm/index.ts +20 -0
  312. package/src/agents/llm/llm.handler.ts +82 -0
  313. package/src/agents/llm/llm.schema.ts +25 -0
  314. package/src/agents/llm/llm.types.ts +37 -0
  315. package/src/agents/llm/llm.yaml +87 -0
  316. package/src/agents/mcp-tool/index.ts +19 -0
  317. package/src/agents/mcp-tool/mcp-tool.handler.ts +112 -0
  318. package/src/agents/mcp-tool/mcp-tool.schema.ts +22 -0
  319. package/src/agents/mcp-tool/mcp-tool.types.ts +33 -0
  320. package/src/agents/mcp-tool/mcp-tool.yaml +71 -0
  321. package/src/agents/rag/index.ts +20 -0
  322. package/src/agents/rag/rag.handler.ts +95 -0
  323. package/src/agents/rag/rag.schema.ts +26 -0
  324. package/src/agents/rag/rag.types.ts +45 -0
  325. package/src/agents/rag/rag.yaml +89 -0
  326. package/src/agents/{agentRegistry.ts → registry/agentRegistry.ts} +195 -6
  327. package/src/agents/registry/index.ts +6 -0
  328. package/src/agents/translator/index.ts +19 -0
  329. package/src/agents/translator/translator.handler.ts +97 -0
  330. package/src/agents/translator/translator.schema.ts +30 -0
  331. package/src/agents/translator/translator.types.ts +43 -0
  332. package/src/agents/translator/translator.yaml +80 -0
  333. package/src/client/index.ts +53 -0
  334. package/src/client/types.ts +38 -0
  335. package/src/index.ts +56 -5
  336. package/src/runtime/declarativeAgentRuntime.ts +378 -495
  337. package/src/runtime/index.ts +36 -0
  338. package/src/runtime/llmProviderFactory.ts +145 -0
  339. package/src/runtime/workflowExecutor.ts +107 -0
  340. package/src/server/api/graphql.ts +1 -1
  341. package/src/server/index.ts +2 -2
  342. package/src/shared/index.ts +7 -0
  343. package/src/shared/types/agent.types.ts +100 -0
  344. package/src/shared/types/execution.types.ts +45 -0
  345. package/src/shared/types/index.ts +7 -0
  346. package/src/shared/types/schema.types.ts +55 -0
  347. package/src/shared/utils/index.ts +5 -0
  348. package/src/shared/utils/validation.ts +100 -0
  349. package/src/tenant/TenantManager.ts +488 -0
  350. package/src/tenant/index.ts +101 -0
  351. package/src/tenant/interfaces.ts +231 -0
  352. package/src/tenant/providerFactory.ts +75 -0
  353. package/src/tenant/providerRegistry.ts +86 -0
  354. package/src/tenant/providers/InMemoryTenantProvider.ts +168 -0
  355. package/dist/agents/agentRegistry.d.ts.map +0 -1
  356. package/dist/agents/agentRegistry.js.map +0 -1
  357. package/src/firebase/tenantManager.ts +0 -443
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Runtime Module - Server-only exports
3
+ *
4
+ * This module provides the declarative agent runtime and workflow execution.
5
+ * All exports in this module are server-only.
6
+ */
7
+
8
+ // Main runtime exports
9
+ export { DeclarativeAgentInterpreter, declarativeInterpreter } from './declarativeAgentRuntime';
10
+ export type { YamlAgentDefinition, YamlAgentInterpreterOptions, YamlExecutionResult } from './declarativeAgentRuntime';
11
+
12
+ // Workflow executor exports
13
+ export {
14
+ executeWorkflowStep,
15
+ getAvailableStepTypes,
16
+ isStepTypeSupported,
17
+ // Individual handlers for direct use
18
+ executeJokeHandler,
19
+ executeTranslationHandler,
20
+ executeImageHandler,
21
+ executeMcpToolHandler,
22
+ executeVectorizeHandler,
23
+ executeChromaDBHandler,
24
+ executeGitMcpHandler,
25
+ executeRagHandler,
26
+ executeLlmHandler,
27
+ executeChatHandler,
28
+ } from './workflowExecutor';
29
+
30
+ // LLM Provider Factory exports
31
+ export { LLMProviderFactory, extractProviderConfig } from './llmProviderFactory';
32
+ export type { LLMProviderType, LLMProviderConfig } from './llmProviderFactory';
33
+
34
+ // Schema compiler exports
35
+ export { DeclarativeSchemaCompiler, DeclarativeSchemaValidationError } from './schemaCompiler';
36
+ export type { DeclarativeSchemaPhase } from './schemaCompiler';
@@ -0,0 +1,145 @@
1
+ import 'server-only';
2
+
3
+ /**
4
+ * LLM Provider Factory - Centralized provider creation and configuration
5
+ *
6
+ * Provides a single point of configuration for LLM providers, enabling:
7
+ * - Centralized API key validation
8
+ * - Easy provider switching (Google, OpenAI, Anthropic, etc.)
9
+ * - Retry/fallback logic between providers
10
+ * - Consistent error handling
11
+ */
12
+
13
+ import { createGoogleGenerativeAI } from '@ai-sdk/google';
14
+ import type { LanguageModel } from 'ai';
15
+
16
+ /**
17
+ * Supported LLM provider types
18
+ */
19
+ export type LLMProviderType = 'google' | 'openai' | 'anthropic';
20
+
21
+ /**
22
+ * Provider configuration
23
+ */
24
+ export interface LLMProviderConfig {
25
+ provider: LLMProviderType;
26
+ apiKey: string;
27
+ model?: string;
28
+ baseURL?: string;
29
+ }
30
+
31
+ /**
32
+ * Default models for each provider
33
+ */
34
+ const DEFAULT_MODELS: Record<LLMProviderType, string> = {
35
+ google: 'models/gemini-2.5-flash',
36
+ openai: 'gpt-4-turbo',
37
+ anthropic: 'claude-3-5-sonnet-20241022',
38
+ };
39
+
40
+ /**
41
+ * LLM Provider Factory
42
+ *
43
+ * Centralizes provider creation and configuration across all agents
44
+ */
45
+ export class LLMProviderFactory {
46
+ /**
47
+ * Create a language model instance
48
+ */
49
+ static createLanguageModel(config: LLMProviderConfig): LanguageModel {
50
+ this.validateConfig(config);
51
+
52
+ switch (config.provider) {
53
+ case 'google':
54
+ return this.createGoogleProvider(config);
55
+ case 'openai':
56
+ throw new Error('OpenAI provider not yet implemented');
57
+ case 'anthropic':
58
+ throw new Error('Anthropic provider not yet implemented');
59
+ default:
60
+ throw new Error(`Unsupported provider: ${config.provider}`);
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Create Google Generative AI provider
66
+ */
67
+ private static createGoogleProvider(config: LLMProviderConfig): LanguageModel {
68
+ const google = createGoogleGenerativeAI({
69
+ apiKey: config.apiKey,
70
+ ...(config.baseURL && { baseURL: config.baseURL }),
71
+ });
72
+
73
+ const model = config.model || DEFAULT_MODELS.google;
74
+ return google(model);
75
+ }
76
+
77
+ /**
78
+ * Validate provider configuration
79
+ */
80
+ private static validateConfig(config: LLMProviderConfig): void {
81
+ if (!config.apiKey?.trim()) {
82
+ throw new Error(`Missing API key for provider: ${config.provider}`);
83
+ }
84
+
85
+ if (!config.provider) {
86
+ throw new Error('Provider type is required');
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Get default model for a provider
92
+ */
93
+ static getDefaultModel(provider: LLMProviderType): string {
94
+ return DEFAULT_MODELS[provider];
95
+ }
96
+
97
+ /**
98
+ * Validate API key format (basic check)
99
+ */
100
+ static validateApiKey(apiKey: string, provider: LLMProviderType): boolean {
101
+ if (!apiKey?.trim()) {
102
+ return false;
103
+ }
104
+
105
+ // Provider-specific validation can be added here
106
+ switch (provider) {
107
+ case 'google':
108
+ // Google API keys typically start with 'AIza'
109
+ return apiKey.startsWith('AIza') || apiKey.length > 20;
110
+ case 'openai':
111
+ return apiKey.startsWith('sk-');
112
+ case 'anthropic':
113
+ return apiKey.startsWith('sk-ant-');
114
+ default:
115
+ return true;
116
+ }
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Helper function to extract provider config from props
122
+ */
123
+ export function extractProviderConfig(
124
+ props: Record<string, string>,
125
+ defaultProvider: LLMProviderType = 'google'
126
+ ): LLMProviderConfig {
127
+ const apiKey = props.gemini_api_key || props.openai_api_key || props.anthropic_api_key;
128
+
129
+ if (!apiKey) {
130
+ throw new Error('Missing required prop: API key (gemini_api_key, openai_api_key, or anthropic_api_key)');
131
+ }
132
+
133
+ // Determine provider from key name
134
+ let provider: LLMProviderType = defaultProvider;
135
+ if (props.openai_api_key) provider = 'openai';
136
+ if (props.anthropic_api_key) provider = 'anthropic';
137
+ if (props.gemini_api_key) provider = 'google';
138
+
139
+ return {
140
+ provider,
141
+ apiKey: apiKey.trim(),
142
+ model: props.model,
143
+ baseURL: props.base_url,
144
+ };
145
+ }
@@ -0,0 +1,107 @@
1
+ import 'server-only';
2
+
3
+ /**
4
+ * Workflow Executor - Server-only workflow step execution
5
+ * Delegates to individual agent handlers based on step type
6
+ */
7
+
8
+ import type { ExecutionContext } from '../types/executionContext';
9
+ import type { WorkflowStepType } from '../shared/types/agent.types';
10
+ import { LEGACY_STEP_TYPE_MAP } from '../shared/types/agent.types';
11
+
12
+ // Import handlers from each agent
13
+ import { executeJokeHandler } from '../agents/joker/joker.handler';
14
+ import { executeTranslationHandler } from '../agents/translator/translator.handler';
15
+ import { executeImageHandler } from '../agents/image/image.handler';
16
+ import { executeMcpToolHandler } from '../agents/mcp-tool/mcp-tool.handler';
17
+ import { executeVectorizeHandler } from '../agents/gemini-vectorize/gemini-vectorize.handler';
18
+ import { executeChromaDBHandler } from '../agents/chromadb/chromadb.handler';
19
+ import { executeGitMcpHandler } from '../agents/gitmcp/gitmcp.handler';
20
+ import { executeRagHandler } from '../agents/rag/rag.handler';
21
+ import { executeLlmHandler } from '../agents/llm/llm.handler';
22
+ import { executeChatHandler } from '../agents/chat/chat.handler';
23
+
24
+ /**
25
+ * Handler function type - uses any for params to allow flexible handler signatures
26
+ */
27
+ type HandlerFunction = (
28
+ params: any,
29
+ props: Record<string, string>,
30
+ context: ExecutionContext
31
+ ) => Promise<unknown>;
32
+
33
+ /**
34
+ * Map of workflow step types to their handlers
35
+ * Preferred step type names only - legacy names resolved via LEGACY_STEP_TYPE_MAP
36
+ */
37
+ const handlerMap: Record<string, HandlerFunction> = {
38
+ 'joke': executeJokeHandler,
39
+ 'translation': executeTranslationHandler,
40
+ 'image': executeImageHandler,
41
+ 'mcp-tool': executeMcpToolHandler,
42
+ 'vectorize': executeVectorizeHandler,
43
+ 'chromadb': executeChromaDBHandler,
44
+ 'gitmcp': executeGitMcpHandler,
45
+ 'rag': executeRagHandler,
46
+ 'llm': executeLlmHandler,
47
+ 'chat': executeChatHandler,
48
+ };
49
+
50
+ /**
51
+ * Resolve step type, handling legacy names with deprecation warning
52
+ */
53
+ function resolveStepType(stepType: string, context: ExecutionContext): string {
54
+ if (stepType in LEGACY_STEP_TYPE_MAP) {
55
+ const preferred = LEGACY_STEP_TYPE_MAP[stepType];
56
+ context.log(
57
+ `[DEPRECATION WARNING] Step type '${stepType}' is deprecated. Use '${preferred}' instead.`
58
+ );
59
+ return preferred;
60
+ }
61
+ return stepType;
62
+ }
63
+
64
+ /**
65
+ * Execute a workflow step by delegating to the appropriate handler
66
+ */
67
+ export async function executeWorkflowStep(
68
+ stepType: WorkflowStepType | string,
69
+ params: Record<string, unknown>,
70
+ props: Record<string, string>,
71
+ context: ExecutionContext
72
+ ): Promise<unknown> {
73
+ const resolvedType = resolveStepType(stepType, context);
74
+ const handler = handlerMap[resolvedType];
75
+ if (!handler) {
76
+ throw new Error(`Unknown workflow step type: ${stepType}`);
77
+ }
78
+ return handler(params, props, context);
79
+ }
80
+
81
+ /**
82
+ * Get all available workflow step types
83
+ */
84
+ export function getAvailableStepTypes(): string[] {
85
+ return Object.keys(handlerMap);
86
+ }
87
+
88
+ /**
89
+ * Check if a step type is supported (including legacy names)
90
+ */
91
+ export function isStepTypeSupported(stepType: string): boolean {
92
+ return stepType in handlerMap || stepType in LEGACY_STEP_TYPE_MAP;
93
+ }
94
+
95
+ // Export individual handlers for direct use
96
+ export {
97
+ executeJokeHandler,
98
+ executeTranslationHandler,
99
+ executeImageHandler,
100
+ executeMcpToolHandler,
101
+ executeVectorizeHandler,
102
+ executeChromaDBHandler,
103
+ executeGitMcpHandler,
104
+ executeRagHandler,
105
+ executeLlmHandler,
106
+ executeChatHandler,
107
+ };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { GraphQLError, GraphQLScalarType, Kind, type ValueNode } from "graphql";
6
6
  import { createSchema, createYoga } from "graphql-yoga";
7
- import { agentRegistry } from "../../agents/agentRegistry";
7
+ import { agentRegistry } from "../../agents/registry";
8
8
  import {
9
9
  getClientByApiKey,
10
10
  getEndpointByName,
@@ -2,5 +2,5 @@ export * from "./types";
2
2
  export * from "./errors";
3
3
  export * from "./kvStore";
4
4
  export * from "./runtimeSecurity";
5
- export { agentRegistry } from "../agents/agentRegistry";
6
- export type { AgentRegistration } from "../agents/agentRegistry";
5
+ export { agentRegistry } from "../agents/registry";
6
+ export type { AgentRegistration } from "../agents/registry";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared Module - Client-safe types and utilities
3
+ * This module can be safely imported in both client and server environments
4
+ */
5
+
6
+ export * from './types';
7
+ export * from './utils';
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Shared Agent Types - Safe for client and server
3
+ * These types contain no sensitive data and can be used in both environments
4
+ */
5
+
6
+ /**
7
+ * Agent metadata - safe for client display
8
+ */
9
+ export interface AgentMetadata {
10
+ id: string;
11
+ name: string;
12
+ description: string;
13
+ category: string;
14
+ route: string;
15
+ tags?: string[];
16
+ }
17
+
18
+ /**
19
+ * Generic agent response wrapper
20
+ */
21
+ export interface AgentResponse<T = unknown> {
22
+ success: boolean;
23
+ data?: T;
24
+ error?: string;
25
+ timestamp?: string;
26
+ }
27
+
28
+ /**
29
+ * Execution step tracking for workflow visualization
30
+ */
31
+ export interface ExecutionStep {
32
+ agent: string;
33
+ action: string;
34
+ status: 'running' | 'success' | 'error';
35
+ startTime: number;
36
+ endTime?: number;
37
+ duration?: number;
38
+ input?: Record<string, unknown>;
39
+ output?: Record<string, unknown>;
40
+ error?: string;
41
+ description?: string;
42
+ phase?: 'orchestration' | 'vectorization' | 'storage' | 'retrieval' | 'ingestion' | 'generation';
43
+ }
44
+
45
+ /**
46
+ * Workflow step types supported by the runtime
47
+ *
48
+ * PREFERRED: Use the English step type names (joke, translation, image, vectorize)
49
+ *
50
+ * DEPRECATED: The following legacy names are supported for backward compatibility
51
+ * but will be removed in a future major version:
52
+ * - genkit-joke → use 'joke'
53
+ * - genkit-translation → use 'translation'
54
+ * - genkit-image → use 'image'
55
+ * - gemini-vectorize → use 'vectorize'
56
+ */
57
+ export type WorkflowStepType =
58
+ // Preferred step types (use these)
59
+ | 'joke'
60
+ | 'translation'
61
+ | 'image'
62
+ | 'vectorize'
63
+ | 'mcp-tool'
64
+ | 'chromadb'
65
+ | 'gitmcp'
66
+ | 'rag'
67
+ | 'llm'
68
+ | 'chat'
69
+ | 'output-generator'
70
+ | 'builtin-agent'
71
+ | 'custom-action'
72
+ // Legacy step types (deprecated - will be removed in v1.0)
73
+ | 'genkit-joke'
74
+ | 'genkit-translation'
75
+ | 'genkit-image'
76
+ | 'gemini-vectorize';
77
+
78
+ /**
79
+ * Maps legacy step type names to their preferred equivalents
80
+ * @deprecated Use preferred step type names directly
81
+ */
82
+ export const LEGACY_STEP_TYPE_MAP: Record<string, WorkflowStepType> = {
83
+ 'genkit-joke': 'joke',
84
+ 'genkit-translation': 'translation',
85
+ 'genkit-image': 'image',
86
+ 'gemini-vectorize': 'vectorize',
87
+ };
88
+
89
+ /**
90
+ * Agent categories for organization
91
+ */
92
+ export type AgentCategory =
93
+ | 'utility'
94
+ | 'translation'
95
+ | 'image'
96
+ | 'mcp'
97
+ | 'vectorization'
98
+ | 'storage'
99
+ | 'retrieval'
100
+ | 'orchestration';
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Execution Types - Shared between client and server
3
+ * Used for tracking and displaying execution progress
4
+ */
5
+
6
+ /**
7
+ * Execution result from a workflow step
8
+ */
9
+ export interface ExecutionResult<T = unknown> {
10
+ success: boolean;
11
+ data?: T;
12
+ error?: string;
13
+ duration?: number;
14
+ metadata?: Record<string, unknown>;
15
+ }
16
+
17
+ /**
18
+ * Workflow execution status
19
+ */
20
+ export type ExecutionStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
21
+
22
+ /**
23
+ * Workflow execution summary
24
+ */
25
+ export interface ExecutionSummary {
26
+ agentId: string;
27
+ status: ExecutionStatus;
28
+ startTime: number;
29
+ endTime?: number;
30
+ totalDuration?: number;
31
+ stepsCompleted: number;
32
+ totalSteps: number;
33
+ error?: string;
34
+ }
35
+
36
+ /**
37
+ * Execution log entry
38
+ */
39
+ export interface ExecutionLogEntry {
40
+ timestamp: number;
41
+ level: 'info' | 'warn' | 'error' | 'debug';
42
+ message: string;
43
+ step?: string;
44
+ metadata?: Record<string, unknown>;
45
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared Types - Re-exports for client and server
3
+ */
4
+
5
+ export * from './agent.types';
6
+ export * from './execution.types';
7
+ export * from './schema.types';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Schema Types - Shared type definitions for agent schemas
3
+ * Used for input/output validation on both client and server
4
+ */
5
+
6
+ /**
7
+ * JSON Schema-like type definition
8
+ */
9
+ export interface SchemaProperty {
10
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
11
+ description?: string;
12
+ enum?: string[];
13
+ items?: SchemaProperty;
14
+ properties?: Record<string, SchemaProperty>;
15
+ required?: string[];
16
+ default?: unknown;
17
+ minLength?: number;
18
+ maxLength?: number;
19
+ minimum?: number;
20
+ maximum?: number;
21
+ pattern?: string;
22
+ }
23
+
24
+ /**
25
+ * Agent schema definition
26
+ */
27
+ export interface AgentSchemaDefinition {
28
+ input: {
29
+ type: 'object';
30
+ properties: Record<string, SchemaProperty>;
31
+ required?: string[];
32
+ };
33
+ output: {
34
+ type: 'object';
35
+ properties: Record<string, SchemaProperty>;
36
+ required?: string[];
37
+ };
38
+ }
39
+
40
+ /**
41
+ * Validation result
42
+ */
43
+ export interface ValidationResult {
44
+ valid: boolean;
45
+ errors?: ValidationError[];
46
+ }
47
+
48
+ /**
49
+ * Validation error detail
50
+ */
51
+ export interface ValidationError {
52
+ path: string;
53
+ message: string;
54
+ code: string;
55
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared Utilities - Re-exports
3
+ */
4
+
5
+ export * from './validation';
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Validation Utilities - Shared validation helpers
3
+ * Safe for use in both client and server environments
4
+ */
5
+
6
+ import type { ValidationResult, ValidationError } from '../types/schema.types';
7
+
8
+ /**
9
+ * Validate that a value is a non-empty string
10
+ */
11
+ export function isNonEmptyString(value: unknown): value is string {
12
+ return typeof value === 'string' && value.trim().length > 0;
13
+ }
14
+
15
+ /**
16
+ * Validate that a value is a positive number
17
+ */
18
+ export function isPositiveNumber(value: unknown): value is number {
19
+ return typeof value === 'number' && value > 0 && !isNaN(value);
20
+ }
21
+
22
+ /**
23
+ * Validate that a value is a valid URL
24
+ */
25
+ export function isValidUrl(value: unknown): value is string {
26
+ if (typeof value !== 'string') return false;
27
+ try {
28
+ new URL(value);
29
+ return true;
30
+ } catch {
31
+ return false;
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Validate resolution format (e.g., "1024x1024")
37
+ */
38
+ export function isValidResolution(value: unknown): value is string {
39
+ if (typeof value !== 'string') return false;
40
+ return /^\d+x\d+$/.test(value);
41
+ }
42
+
43
+ /**
44
+ * Validate language code (e.g., "en", "pt", "es")
45
+ */
46
+ export function isValidLanguageCode(value: unknown): value is string {
47
+ if (typeof value !== 'string') return false;
48
+ return /^[a-z]{2}(-[A-Z]{2})?$/.test(value);
49
+ }
50
+
51
+ /**
52
+ * Create a validation result with errors
53
+ */
54
+ export function createValidationResult(errors: ValidationError[]): ValidationResult {
55
+ return {
56
+ valid: errors.length === 0,
57
+ errors: errors.length > 0 ? errors : undefined,
58
+ };
59
+ }
60
+
61
+ /**
62
+ * Create a validation error
63
+ */
64
+ export function createValidationError(
65
+ path: string,
66
+ message: string,
67
+ code: string
68
+ ): ValidationError {
69
+ return { path, message, code };
70
+ }
71
+
72
+ /**
73
+ * Sanitize string input by trimming whitespace
74
+ */
75
+ export function sanitizeString(value: unknown): string {
76
+ if (typeof value !== 'string') return '';
77
+ return value.trim();
78
+ }
79
+
80
+ /**
81
+ * Validate required fields in an object
82
+ */
83
+ export function validateRequiredFields(
84
+ obj: Record<string, unknown>,
85
+ requiredFields: string[]
86
+ ): ValidationError[] {
87
+ const errors: ValidationError[] = [];
88
+
89
+ for (const field of requiredFields) {
90
+ if (obj[field] === undefined || obj[field] === null) {
91
+ errors.push(createValidationError(
92
+ field,
93
+ `Missing required field: ${field}`,
94
+ 'REQUIRED_FIELD_MISSING'
95
+ ));
96
+ }
97
+ }
98
+
99
+ return errors;
100
+ }