@ductape/sdk 0.1.8 → 0.1.10

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 (1000) hide show
  1. package/dist/agents/agent-context.d.ts +100 -0
  2. package/dist/agents/agent-context.js +604 -0
  3. package/dist/agents/agent-context.js.map +1 -0
  4. package/dist/agents/agent-executor.d.ts +180 -0
  5. package/dist/agents/agent-executor.js +715 -0
  6. package/dist/agents/agent-executor.js.map +1 -0
  7. package/dist/agents/agents.service.d.ts +310 -0
  8. package/dist/agents/agents.service.js +1255 -0
  9. package/dist/agents/agents.service.js.map +1 -0
  10. package/dist/agents/index.d.ts +55 -0
  11. package/dist/agents/index.js +110 -0
  12. package/dist/agents/index.js.map +1 -0
  13. package/dist/agents/memory-manager.d.ts +182 -0
  14. package/dist/agents/memory-manager.js +383 -0
  15. package/dist/agents/memory-manager.js.map +1 -0
  16. package/dist/agents/tool-registry.d.ts +141 -0
  17. package/dist/agents/tool-registry.js +355 -0
  18. package/dist/agents/tool-registry.js.map +1 -0
  19. package/dist/agents/types/agents.types.d.ts +1240 -0
  20. package/dist/agents/types/agents.types.js +12 -0
  21. package/dist/agents/types/agents.types.js.map +1 -0
  22. package/dist/agents/types/index.d.ts +6 -0
  23. package/dist/agents/types/index.js +23 -0
  24. package/dist/agents/types/index.js.map +1 -0
  25. package/dist/agents/vector-store-adapter.d.ts +108 -0
  26. package/dist/agents/vector-store-adapter.js +213 -0
  27. package/dist/agents/vector-store-adapter.js.map +1 -0
  28. package/dist/api/services/appApi.service.d.ts +78 -0
  29. package/dist/api/services/appApi.service.js +303 -0
  30. package/dist/api/services/appApi.service.js.map +1 -0
  31. package/dist/api/services/cloudApi.service.d.ts +31 -0
  32. package/dist/api/services/cloudApi.service.js +103 -0
  33. package/dist/api/services/cloudApi.service.js.map +1 -0
  34. package/dist/api/services/logsApi.service.d.ts +62 -0
  35. package/dist/api/services/logsApi.service.js +67 -0
  36. package/dist/api/services/logsApi.service.js.map +1 -0
  37. package/dist/api/services/pricingApi.service.d.ts +10 -0
  38. package/dist/api/services/pricingApi.service.js +34 -0
  39. package/dist/api/services/pricingApi.service.js.map +1 -0
  40. package/dist/api/services/processorApi.service.d.ts +927 -0
  41. package/dist/api/services/processorApi.service.js +787 -0
  42. package/dist/api/services/processorApi.service.js.map +1 -0
  43. package/dist/api/services/productsApi.service.d.ts +167 -0
  44. package/dist/api/services/productsApi.service.js +293 -0
  45. package/dist/api/services/productsApi.service.js.map +1 -0
  46. package/dist/api/services/resilienceApi.service.d.ts +106 -0
  47. package/dist/api/services/resilienceApi.service.js +224 -0
  48. package/dist/api/services/resilienceApi.service.js.map +1 -0
  49. package/dist/api/services/secretsApi.service.d.ts +51 -0
  50. package/dist/api/services/secretsApi.service.js +126 -0
  51. package/dist/api/services/secretsApi.service.js.map +1 -0
  52. package/dist/api/services/userApi.service.d.ts +10 -0
  53. package/dist/api/services/userApi.service.js +20 -0
  54. package/dist/api/services/userApi.service.js.map +1 -0
  55. package/dist/api/services/webhooksApi.service.d.ts +14 -0
  56. package/dist/api/services/webhooksApi.service.js +65 -0
  57. package/dist/api/services/webhooksApi.service.js.map +1 -0
  58. package/dist/api/services/workflowApi.service.d.ts +199 -0
  59. package/dist/api/services/workflowApi.service.js +201 -0
  60. package/dist/api/services/workflowApi.service.js.map +1 -0
  61. package/dist/api/services/workspaceApi.service.d.ts +20 -0
  62. package/dist/api/services/workspaceApi.service.js +54 -0
  63. package/dist/api/services/workspaceApi.service.js.map +1 -0
  64. package/dist/api/urls.d.ts +145 -0
  65. package/dist/api/urls.js +195 -0
  66. package/dist/api/urls.js.map +1 -0
  67. package/dist/api/utils/auth.utils.d.ts +10 -0
  68. package/dist/api/utils/auth.utils.js +24 -0
  69. package/dist/api/utils/auth.utils.js.map +1 -0
  70. package/dist/api/utils/cache.utils.d.ts +3 -0
  71. package/dist/api/utils/cache.utils.js +18 -0
  72. package/dist/api/utils/cache.utils.js.map +1 -0
  73. package/dist/api/utils/integration-api-error.d.ts +6 -0
  74. package/dist/api/utils/integration-api-error.js +45 -0
  75. package/dist/api/utils/integration-api-error.js.map +1 -0
  76. package/dist/api/utils/strings.utils.d.ts +7 -0
  77. package/dist/api/utils/strings.utils.js +64 -0
  78. package/dist/api/utils/strings.utils.js.map +1 -0
  79. package/dist/apps/services/app.service.d.ts +126 -0
  80. package/dist/apps/services/app.service.js +1436 -0
  81. package/dist/apps/services/app.service.js.map +1 -0
  82. package/dist/apps/utils/auth-context-manager.d.ts +137 -0
  83. package/dist/apps/utils/auth-context-manager.js +248 -0
  84. package/dist/apps/utils/auth-context-manager.js.map +1 -0
  85. package/dist/apps/utils/credential-manager.d.ts +128 -0
  86. package/dist/apps/utils/credential-manager.js +199 -0
  87. package/dist/apps/utils/credential-manager.js.map +1 -0
  88. package/dist/apps/utils/index.d.ts +10 -0
  89. package/dist/apps/utils/index.js +54 -0
  90. package/dist/apps/utils/index.js.map +1 -0
  91. package/dist/apps/utils/input-helpers.d.ts +67 -0
  92. package/dist/apps/utils/input-helpers.js +185 -0
  93. package/dist/apps/utils/input-helpers.js.map +1 -0
  94. package/dist/apps/utils/input-resolver.d.ts +165 -0
  95. package/dist/apps/utils/input-resolver.js +477 -0
  96. package/dist/apps/utils/input-resolver.js.map +1 -0
  97. package/dist/apps/utils/oauth-manager.d.ts +196 -0
  98. package/dist/apps/utils/oauth-manager.js +429 -0
  99. package/dist/apps/utils/oauth-manager.js.map +1 -0
  100. package/dist/apps/utils/objects.utils.d.ts +4 -0
  101. package/dist/apps/utils/objects.utils.js +59 -0
  102. package/dist/apps/utils/objects.utils.js.map +1 -0
  103. package/dist/apps/utils/string.utils.d.ts +9 -0
  104. package/dist/apps/utils/string.utils.js +89 -0
  105. package/dist/apps/utils/string.utils.js.map +1 -0
  106. package/dist/apps/validators/index.d.ts +17 -0
  107. package/dist/apps/validators/index.js +39 -0
  108. package/dist/apps/validators/index.js.map +1 -0
  109. package/dist/apps/validators/joi-validators/create.app.validator.d.ts +3 -0
  110. package/dist/apps/validators/joi-validators/create.app.validator.js +43 -0
  111. package/dist/apps/validators/joi-validators/create.app.validator.js.map +1 -0
  112. package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +3 -0
  113. package/dist/apps/validators/joi-validators/create.appAction.validator.js +72 -0
  114. package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -0
  115. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.d.ts +7 -0
  116. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +81 -0
  117. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +1 -0
  118. package/dist/apps/validators/joi-validators/create.appAuth.validator.d.ts +3 -0
  119. package/dist/apps/validators/joi-validators/create.appAuth.validator.js +64 -0
  120. package/dist/apps/validators/joi-validators/create.appAuth.validator.js.map +1 -0
  121. package/dist/apps/validators/joi-validators/create.appBody.validators.d.ts +4 -0
  122. package/dist/apps/validators/joi-validators/create.appBody.validators.js +44 -0
  123. package/dist/apps/validators/joi-validators/create.appBody.validators.js.map +1 -0
  124. package/dist/apps/validators/joi-validators/create.appConstants.validator.d.ts +4 -0
  125. package/dist/apps/validators/joi-validators/create.appConstants.validator.js +45 -0
  126. package/dist/apps/validators/joi-validators/create.appConstants.validator.js.map +1 -0
  127. package/dist/apps/validators/joi-validators/create.appEnv.validator.d.ts +4 -0
  128. package/dist/apps/validators/joi-validators/create.appEnv.validator.js +50 -0
  129. package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +1 -0
  130. package/dist/apps/validators/joi-validators/create.appVariable.validator.d.ts +4 -0
  131. package/dist/apps/validators/joi-validators/create.appVariable.validator.js +47 -0
  132. package/dist/apps/validators/joi-validators/create.appVariable.validator.js.map +1 -0
  133. package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +4 -0
  134. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +60 -0
  135. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -0
  136. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.d.ts +3 -0
  137. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js +48 -0
  138. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js.map +1 -0
  139. package/dist/apps/validators/joi-validators/sample.validator.d.ts +6 -0
  140. package/dist/apps/validators/joi-validators/sample.validator.js +65 -0
  141. package/dist/apps/validators/joi-validators/sample.validator.js.map +1 -0
  142. package/dist/apps/validators/joi-validators/update.app.validator.d.ts +4 -0
  143. package/dist/apps/validators/joi-validators/update.app.validator.js +66 -0
  144. package/dist/apps/validators/joi-validators/update.app.validator.js.map +1 -0
  145. package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +4 -0
  146. package/dist/apps/validators/joi-validators/update.appAction.validator.js +76 -0
  147. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -0
  148. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +3 -0
  149. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +57 -0
  150. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -0
  151. package/dist/apps/validators/joi-validators/update.appAuth.validator.d.ts +4 -0
  152. package/dist/apps/validators/joi-validators/update.appAuth.validator.js +52 -0
  153. package/dist/apps/validators/joi-validators/update.appAuth.validator.js.map +1 -0
  154. package/dist/apps/validators/joi-validators/update.appConstants.validator.d.ts +4 -0
  155. package/dist/apps/validators/joi-validators/update.appConstants.validator.js +45 -0
  156. package/dist/apps/validators/joi-validators/update.appConstants.validator.js.map +1 -0
  157. package/dist/apps/validators/joi-validators/update.appEnv.validator.d.ts +4 -0
  158. package/dist/apps/validators/joi-validators/update.appEnv.validator.js +50 -0
  159. package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +1 -0
  160. package/dist/apps/validators/joi-validators/update.appVariables.validator.d.ts +4 -0
  161. package/dist/apps/validators/joi-validators/update.appVariables.validator.js +47 -0
  162. package/dist/apps/validators/joi-validators/update.appVariables.validator.js.map +1 -0
  163. package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +4 -0
  164. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +59 -0
  165. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -0
  166. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.d.ts +3 -0
  167. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js +48 -0
  168. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js.map +1 -0
  169. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.d.ts +3 -0
  170. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js +60 -0
  171. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js.map +1 -0
  172. package/dist/bin.d.ts +26 -0
  173. package/dist/bin.js +28 -0
  174. package/dist/bin.js.map +1 -0
  175. package/dist/brokers/brokers.service.d.ts +438 -0
  176. package/dist/brokers/brokers.service.js +1315 -0
  177. package/dist/brokers/brokers.service.js.map +1 -0
  178. package/dist/brokers/index.d.ts +46 -0
  179. package/dist/brokers/index.js +83 -0
  180. package/dist/brokers/index.js.map +1 -0
  181. package/dist/brokers/types/index.d.ts +569 -0
  182. package/dist/brokers/types/index.js +8 -0
  183. package/dist/brokers/types/index.js.map +1 -0
  184. package/dist/brokers/utils/broker.util.d.ts +33 -0
  185. package/dist/brokers/utils/broker.util.js +125 -0
  186. package/dist/brokers/utils/broker.util.js.map +1 -0
  187. package/dist/brokers/utils/providers/aws-sqs.service.d.ts +16 -0
  188. package/dist/brokers/utils/providers/aws-sqs.service.js +71 -0
  189. package/dist/brokers/utils/providers/aws-sqs.service.js.map +1 -0
  190. package/dist/brokers/utils/providers/google-pubsub.service.d.ts +16 -0
  191. package/dist/brokers/utils/providers/google-pubsub.service.js +43 -0
  192. package/dist/brokers/utils/providers/google-pubsub.service.js.map +1 -0
  193. package/dist/brokers/utils/providers/index.d.ts +6 -0
  194. package/dist/brokers/utils/providers/index.js +16 -0
  195. package/dist/brokers/utils/providers/index.js.map +1 -0
  196. package/dist/brokers/utils/providers/kafka.service.d.ts +23 -0
  197. package/dist/brokers/utils/providers/kafka.service.js +131 -0
  198. package/dist/brokers/utils/providers/kafka.service.js.map +1 -0
  199. package/dist/brokers/utils/providers/nats.service.d.ts +18 -0
  200. package/dist/brokers/utils/providers/nats.service.js +63 -0
  201. package/dist/brokers/utils/providers/nats.service.js.map +1 -0
  202. package/dist/brokers/utils/providers/rabbitmq.service.d.ts +25 -0
  203. package/dist/brokers/utils/providers/rabbitmq.service.js +138 -0
  204. package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -0
  205. package/dist/brokers/utils/providers/redis.service.d.ts +18 -0
  206. package/dist/brokers/utils/providers/redis.service.js +93 -0
  207. package/dist/brokers/utils/providers/redis.service.js.map +1 -0
  208. package/dist/cache/cache.manager.d.ts +308 -0
  209. package/dist/cache/cache.manager.js +900 -0
  210. package/dist/cache/cache.manager.js.map +1 -0
  211. package/dist/cache/cache.service.d.ts +194 -0
  212. package/dist/cache/cache.service.js +601 -0
  213. package/dist/cache/cache.service.js.map +1 -0
  214. package/dist/cache/index.d.ts +52 -0
  215. package/dist/cache/index.js +81 -0
  216. package/dist/cache/index.js.map +1 -0
  217. package/dist/cache/types/index.d.ts +114 -0
  218. package/dist/cache/types/index.js +6 -0
  219. package/dist/cache/types/index.js.map +1 -0
  220. package/dist/clients/apps.client.d.ts +4 -0
  221. package/dist/clients/apps.client.js +31 -0
  222. package/dist/clients/apps.client.js.map +1 -0
  223. package/dist/clients/email.client.d.ts +4 -0
  224. package/dist/clients/email.client.js +29 -0
  225. package/dist/clients/email.client.js.map +1 -0
  226. package/dist/clients/expo.client.d.ts +3 -0
  227. package/dist/clients/expo.client.js +28 -0
  228. package/dist/clients/expo.client.js.map +1 -0
  229. package/dist/clients/function.client.d.ts +3 -0
  230. package/dist/clients/function.client.js +27 -0
  231. package/dist/clients/function.client.js.map +1 -0
  232. package/dist/clients/http.client.d.ts +3 -0
  233. package/dist/clients/http.client.js +27 -0
  234. package/dist/clients/http.client.js.map +1 -0
  235. package/dist/clients/logs.client.d.ts +4 -0
  236. package/dist/clients/logs.client.js +34 -0
  237. package/dist/clients/logs.client.js.map +1 -0
  238. package/dist/clients/pricing.client.d.ts +4 -0
  239. package/dist/clients/pricing.client.js +34 -0
  240. package/dist/clients/pricing.client.js.map +1 -0
  241. package/dist/clients/products.client.d.ts +3 -0
  242. package/dist/clients/products.client.js +32 -0
  243. package/dist/clients/products.client.js.map +1 -0
  244. package/dist/clients/users.client.d.ts +4 -0
  245. package/dist/clients/users.client.js +34 -0
  246. package/dist/clients/users.client.js.map +1 -0
  247. package/dist/clients/webhooks.client.d.ts +4 -0
  248. package/dist/clients/webhooks.client.js +34 -0
  249. package/dist/clients/webhooks.client.js.map +1 -0
  250. package/dist/clients/workspace.client.d.ts +7 -0
  251. package/dist/clients/workspace.client.js +39 -0
  252. package/dist/clients/workspace.client.js.map +1 -0
  253. package/dist/cloud/cloud-runtime.util.d.ts +22 -0
  254. package/dist/cloud/cloud-runtime.util.js +61 -0
  255. package/dist/cloud/cloud-runtime.util.js.map +1 -0
  256. package/dist/cloud/cloud.service.d.ts +43 -0
  257. package/dist/cloud/cloud.service.js +121 -0
  258. package/dist/cloud/cloud.service.js.map +1 -0
  259. package/dist/cloud/index.d.ts +5 -0
  260. package/dist/cloud/index.js +25 -0
  261. package/dist/cloud/index.js.map +1 -0
  262. package/dist/cloud/types/cloud.types.d.ts +140 -0
  263. package/dist/cloud/types/cloud.types.js +6 -0
  264. package/dist/cloud/types/cloud.types.js.map +1 -0
  265. package/dist/cloud/types/index.d.ts +1 -0
  266. package/dist/cloud/types/index.js +18 -0
  267. package/dist/cloud/types/index.js.map +1 -0
  268. package/dist/database/actions/action-manager.d.ts +170 -0
  269. package/dist/database/actions/action-manager.js +465 -0
  270. package/dist/database/actions/action-manager.js.map +1 -0
  271. package/dist/database/actions/index.d.ts +6 -0
  272. package/dist/database/actions/index.js +13 -0
  273. package/dist/database/actions/index.js.map +1 -0
  274. package/dist/database/adapters/adapter.factory.d.ts +62 -0
  275. package/dist/database/adapters/adapter.factory.js +97 -0
  276. package/dist/database/adapters/adapter.factory.js.map +1 -0
  277. package/dist/database/adapters/base.adapter.d.ts +423 -0
  278. package/dist/database/adapters/base.adapter.js +260 -0
  279. package/dist/database/adapters/base.adapter.js.map +1 -0
  280. package/dist/database/adapters/cassandra.adapter.d.ts +92 -0
  281. package/dist/database/adapters/cassandra.adapter.js +1091 -0
  282. package/dist/database/adapters/cassandra.adapter.js.map +1 -0
  283. package/dist/database/adapters/dynamodb.adapter.d.ts +110 -0
  284. package/dist/database/adapters/dynamodb.adapter.js +1564 -0
  285. package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
  286. package/dist/database/adapters/index.d.ts +11 -0
  287. package/dist/database/adapters/index.js +27 -0
  288. package/dist/database/adapters/index.js.map +1 -0
  289. package/dist/database/adapters/mariadb.adapter.d.ts +100 -0
  290. package/dist/database/adapters/mariadb.adapter.js +247 -0
  291. package/dist/database/adapters/mariadb.adapter.js.map +1 -0
  292. package/dist/database/adapters/mongodb.adapter.d.ts +121 -0
  293. package/dist/database/adapters/mongodb.adapter.js +1284 -0
  294. package/dist/database/adapters/mongodb.adapter.js.map +1 -0
  295. package/dist/database/adapters/mysql.adapter.d.ts +86 -0
  296. package/dist/database/adapters/mysql.adapter.js +1371 -0
  297. package/dist/database/adapters/mysql.adapter.js.map +1 -0
  298. package/dist/database/adapters/postgresql.adapter.d.ts +90 -0
  299. package/dist/database/adapters/postgresql.adapter.js +1487 -0
  300. package/dist/database/adapters/postgresql.adapter.js.map +1 -0
  301. package/dist/database/databases.service.d.ts +1526 -0
  302. package/dist/database/databases.service.js +3370 -0
  303. package/dist/database/databases.service.js.map +1 -0
  304. package/dist/database/index.d.ts +46 -0
  305. package/dist/database/index.js +109 -0
  306. package/dist/database/index.js.map +1 -0
  307. package/dist/database/migrations/index.d.ts +6 -0
  308. package/dist/database/migrations/index.js +12 -0
  309. package/dist/database/migrations/index.js.map +1 -0
  310. package/dist/database/migrations/migration-engine.d.ts +136 -0
  311. package/dist/database/migrations/migration-engine.js +1421 -0
  312. package/dist/database/migrations/migration-engine.js.map +1 -0
  313. package/dist/database/operators/aggregation-builder.d.ts +67 -0
  314. package/dist/database/operators/aggregation-builder.js +841 -0
  315. package/dist/database/operators/aggregation-builder.js.map +1 -0
  316. package/dist/database/operators/index.d.ts +7 -0
  317. package/dist/database/operators/index.js +15 -0
  318. package/dist/database/operators/index.js.map +1 -0
  319. package/dist/database/operators/query-builder.d.ts +69 -0
  320. package/dist/database/operators/query-builder.js +447 -0
  321. package/dist/database/operators/query-builder.js.map +1 -0
  322. package/dist/database/presave/decrypt.d.ts +25 -0
  323. package/dist/database/presave/decrypt.js +146 -0
  324. package/dist/database/presave/decrypt.js.map +1 -0
  325. package/dist/database/presave/index.d.ts +9 -0
  326. package/dist/database/presave/index.js +18 -0
  327. package/dist/database/presave/index.js.map +1 -0
  328. package/dist/database/presave/presave-processor.d.ts +148 -0
  329. package/dist/database/presave/presave-processor.js +702 -0
  330. package/dist/database/presave/presave-processor.js.map +1 -0
  331. package/dist/database/schema/index.d.ts +7 -0
  332. package/dist/database/schema/index.js +13 -0
  333. package/dist/database/schema/index.js.map +1 -0
  334. package/dist/database/schema/schema-manager.d.ts +258 -0
  335. package/dist/database/schema/schema-manager.js +638 -0
  336. package/dist/database/schema/schema-manager.js.map +1 -0
  337. package/dist/database/transactions/index.d.ts +6 -0
  338. package/dist/database/transactions/index.js +13 -0
  339. package/dist/database/transactions/index.js.map +1 -0
  340. package/dist/database/transactions/transaction-manager.d.ts +113 -0
  341. package/dist/database/transactions/transaction-manager.js +344 -0
  342. package/dist/database/transactions/transaction-manager.js.map +1 -0
  343. package/dist/database/triggers/index.d.ts +7 -0
  344. package/dist/database/triggers/index.js +14 -0
  345. package/dist/database/triggers/index.js.map +1 -0
  346. package/dist/database/triggers/trigger-processor.d.ts +239 -0
  347. package/dist/database/triggers/trigger-processor.js +1034 -0
  348. package/dist/database/triggers/trigger-processor.js.map +1 -0
  349. package/dist/database/types/action.interface.d.ts +148 -0
  350. package/dist/database/types/action.interface.js +6 -0
  351. package/dist/database/types/action.interface.js.map +1 -0
  352. package/dist/database/types/aggregation.interface.d.ts +185 -0
  353. package/dist/database/types/aggregation.interface.js +6 -0
  354. package/dist/database/types/aggregation.interface.js.map +1 -0
  355. package/dist/database/types/connection.interface.d.ts +141 -0
  356. package/dist/database/types/connection.interface.js +6 -0
  357. package/dist/database/types/connection.interface.js.map +1 -0
  358. package/dist/database/types/dashboard.interface.d.ts +74 -0
  359. package/dist/database/types/dashboard.interface.js +7 -0
  360. package/dist/database/types/dashboard.interface.js.map +1 -0
  361. package/dist/database/types/enums.d.ts +195 -0
  362. package/dist/database/types/enums.js +244 -0
  363. package/dist/database/types/enums.js.map +1 -0
  364. package/dist/database/types/index.d.ts +15 -0
  365. package/dist/database/types/index.js +31 -0
  366. package/dist/database/types/index.js.map +1 -0
  367. package/dist/database/types/migration.interface.d.ts +686 -0
  368. package/dist/database/types/migration.interface.js +9 -0
  369. package/dist/database/types/migration.interface.js.map +1 -0
  370. package/dist/database/types/presave.interface.d.ts +292 -0
  371. package/dist/database/types/presave.interface.js +60 -0
  372. package/dist/database/types/presave.interface.js.map +1 -0
  373. package/dist/database/types/query.interface.d.ts +205 -0
  374. package/dist/database/types/query.interface.js +6 -0
  375. package/dist/database/types/query.interface.js.map +1 -0
  376. package/dist/database/types/schema.interface.d.ts +412 -0
  377. package/dist/database/types/schema.interface.js +6 -0
  378. package/dist/database/types/schema.interface.js.map +1 -0
  379. package/dist/database/types/transaction.interface.d.ts +84 -0
  380. package/dist/database/types/transaction.interface.js +6 -0
  381. package/dist/database/types/transaction.interface.js.map +1 -0
  382. package/dist/database/types/trigger.interface.d.ts +612 -0
  383. package/dist/database/types/trigger.interface.js +121 -0
  384. package/dist/database/types/trigger.interface.js.map +1 -0
  385. package/dist/database/types/write.interface.d.ts +216 -0
  386. package/dist/database/types/write.interface.js +6 -0
  387. package/dist/database/types/write.interface.js.map +1 -0
  388. package/dist/database/utils/database-error.d.ts +96 -0
  389. package/dist/database/utils/database-error.js +221 -0
  390. package/dist/database/utils/database-error.js.map +1 -0
  391. package/dist/database/utils/index.d.ts +6 -0
  392. package/dist/database/utils/index.js +11 -0
  393. package/dist/database/utils/index.js.map +1 -0
  394. package/dist/graph/adapters/adapter.factory.d.ts +47 -0
  395. package/dist/graph/adapters/adapter.factory.js +77 -0
  396. package/dist/graph/adapters/adapter.factory.js.map +1 -0
  397. package/dist/graph/adapters/arangodb.adapter.d.ts +86 -0
  398. package/dist/graph/adapters/arangodb.adapter.js +1588 -0
  399. package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
  400. package/dist/graph/adapters/base.adapter.d.ts +264 -0
  401. package/dist/graph/adapters/base.adapter.js +156 -0
  402. package/dist/graph/adapters/base.adapter.js.map +1 -0
  403. package/dist/graph/adapters/index.d.ts +11 -0
  404. package/dist/graph/adapters/index.js +21 -0
  405. package/dist/graph/adapters/index.js.map +1 -0
  406. package/dist/graph/adapters/memgraph.adapter.d.ts +110 -0
  407. package/dist/graph/adapters/memgraph.adapter.js +1452 -0
  408. package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
  409. package/dist/graph/adapters/neo4j.adapter.d.ts +81 -0
  410. package/dist/graph/adapters/neo4j.adapter.js +1317 -0
  411. package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
  412. package/dist/graph/adapters/neptune.adapter.d.ts +82 -0
  413. package/dist/graph/adapters/neptune.adapter.js +1369 -0
  414. package/dist/graph/adapters/neptune.adapter.js.map +1 -0
  415. package/dist/graph/graphs.service.d.ts +633 -0
  416. package/dist/graph/graphs.service.js +2684 -0
  417. package/dist/graph/graphs.service.js.map +1 -0
  418. package/dist/graph/index.d.ts +58 -0
  419. package/dist/graph/index.js +77 -0
  420. package/dist/graph/index.js.map +1 -0
  421. package/dist/graph/transactions/index.d.ts +4 -0
  422. package/dist/graph/transactions/index.js +9 -0
  423. package/dist/graph/transactions/index.js.map +1 -0
  424. package/dist/graph/transactions/transaction-manager.d.ts +61 -0
  425. package/dist/graph/transactions/transaction-manager.js +126 -0
  426. package/dist/graph/transactions/transaction-manager.js.map +1 -0
  427. package/dist/graph/types/connection.interface.d.ts +161 -0
  428. package/dist/graph/types/connection.interface.js +9 -0
  429. package/dist/graph/types/connection.interface.js.map +1 -0
  430. package/dist/graph/types/enums.d.ts +101 -0
  431. package/dist/graph/types/enums.js +114 -0
  432. package/dist/graph/types/enums.js.map +1 -0
  433. package/dist/graph/types/index.d.ts +13 -0
  434. package/dist/graph/types/index.js +20 -0
  435. package/dist/graph/types/index.js.map +1 -0
  436. package/dist/graph/types/node.interface.d.ts +248 -0
  437. package/dist/graph/types/node.interface.js +9 -0
  438. package/dist/graph/types/node.interface.js.map +1 -0
  439. package/dist/graph/types/query.interface.d.ts +175 -0
  440. package/dist/graph/types/query.interface.js +9 -0
  441. package/dist/graph/types/query.interface.js.map +1 -0
  442. package/dist/graph/types/relationship.interface.d.ts +207 -0
  443. package/dist/graph/types/relationship.interface.js +9 -0
  444. package/dist/graph/types/relationship.interface.js.map +1 -0
  445. package/dist/graph/types/schema.interface.d.ts +295 -0
  446. package/dist/graph/types/schema.interface.js +9 -0
  447. package/dist/graph/types/schema.interface.js.map +1 -0
  448. package/dist/graph/types/transaction.interface.d.ts +55 -0
  449. package/dist/graph/types/transaction.interface.js +9 -0
  450. package/dist/graph/types/transaction.interface.js.map +1 -0
  451. package/dist/graph/types/traversal.interface.d.ts +181 -0
  452. package/dist/graph/types/traversal.interface.js +9 -0
  453. package/dist/graph/types/traversal.interface.js.map +1 -0
  454. package/dist/graph/utils/graph-error.d.ts +71 -0
  455. package/dist/graph/utils/graph-error.js +142 -0
  456. package/dist/graph/utils/graph-error.js.map +1 -0
  457. package/dist/graph/utils/index.d.ts +4 -0
  458. package/dist/graph/utils/index.js +9 -0
  459. package/dist/graph/utils/index.js.map +1 -0
  460. package/dist/imports/imports.repo.d.ts +0 -0
  461. package/dist/imports/imports.repo.js +1 -0
  462. package/dist/imports/imports.repo.js.map +1 -0
  463. package/dist/imports/imports.service.d.ts +23 -0
  464. package/dist/imports/imports.service.js +71 -0
  465. package/dist/imports/imports.service.js.map +1 -0
  466. package/dist/imports/imports.types.d.ts +350 -0
  467. package/dist/imports/imports.types.js +33 -0
  468. package/dist/imports/imports.types.js.map +1 -0
  469. package/dist/imports/openAPI3.0.types.d.ts +52 -0
  470. package/dist/imports/openAPI3.0.types.js +3 -0
  471. package/dist/imports/openAPI3.0.types.js.map +1 -0
  472. package/dist/imports/repos/openApi.repo.d.ts +6 -0
  473. package/dist/imports/repos/openApi.repo.js +422 -0
  474. package/dist/imports/repos/openApi.repo.js.map +1 -0
  475. package/dist/imports/repos/postmanV21.repo.d.ts +14 -0
  476. package/dist/imports/repos/postmanV21.repo.js +257 -0
  477. package/dist/imports/repos/postmanV21.repo.js.map +1 -0
  478. package/dist/imports/utils/imports.utils.d.ts +80 -0
  479. package/dist/imports/utils/imports.utils.js +114 -0
  480. package/dist/imports/utils/imports.utils.js.map +1 -0
  481. package/dist/imports/validators/index.d.ts +0 -0
  482. package/dist/imports/validators/index.js +1 -0
  483. package/dist/imports/validators/index.js.map +1 -0
  484. package/dist/imports/validators/joi-validators/postmanV21.validator.d.ts +5 -0
  485. package/dist/imports/validators/joi-validators/postmanV21.validator.js +96 -0
  486. package/dist/imports/validators/joi-validators/postmanV21.validator.js.map +1 -0
  487. package/dist/index.d.ts +4233 -0
  488. package/dist/index.js +5930 -0
  489. package/dist/index.js.map +1 -0
  490. package/dist/init.interface.d.ts +407 -0
  491. package/dist/init.interface.js +3 -0
  492. package/dist/init.interface.js.map +1 -0
  493. package/dist/inputs/inputs.repo.d.ts +7 -0
  494. package/dist/inputs/inputs.repo.js +16 -0
  495. package/dist/inputs/inputs.repo.js.map +1 -0
  496. package/dist/inputs/inputs.service.d.ts +61 -0
  497. package/dist/inputs/inputs.service.js +468 -0
  498. package/dist/inputs/inputs.service.js.map +1 -0
  499. package/dist/inputs/utils/inputs.utils.create.d.ts +11 -0
  500. package/dist/inputs/utils/inputs.utils.create.js +273 -0
  501. package/dist/inputs/utils/inputs.utils.create.js.map +1 -0
  502. package/dist/inputs/validators/inputs.validator.parse.d.ts +4 -0
  503. package/dist/inputs/validators/inputs.validator.parse.js +53 -0
  504. package/dist/inputs/validators/inputs.validator.parse.js.map +1 -0
  505. package/dist/jobs/index.d.ts +38 -0
  506. package/dist/jobs/index.js +50 -0
  507. package/dist/jobs/index.js.map +1 -0
  508. package/dist/jobs/jobs.service.d.ts +154 -0
  509. package/dist/jobs/jobs.service.js +491 -0
  510. package/dist/jobs/jobs.service.js.map +1 -0
  511. package/dist/jobs/jobs.state.d.ts +113 -0
  512. package/dist/jobs/jobs.state.js +447 -0
  513. package/dist/jobs/jobs.state.js.map +1 -0
  514. package/dist/jobs/types.d.ts +449 -0
  515. package/dist/jobs/types.js +74 -0
  516. package/dist/jobs/types.js.map +1 -0
  517. package/dist/logs/logs.repo.d.ts +6 -0
  518. package/dist/logs/logs.repo.js +12 -0
  519. package/dist/logs/logs.repo.js.map +1 -0
  520. package/dist/logs/logs.service.d.ts +30 -0
  521. package/dist/logs/logs.service.js +89 -0
  522. package/dist/logs/logs.service.js.map +1 -0
  523. package/dist/logs/logs.types.d.ts +85 -0
  524. package/dist/logs/logs.types.js +52 -0
  525. package/dist/logs/logs.types.js.map +1 -0
  526. package/dist/logs/utils/logs.utils.create.d.ts +0 -0
  527. package/dist/logs/utils/logs.utils.create.js +1 -0
  528. package/dist/logs/utils/logs.utils.create.js.map +1 -0
  529. package/dist/logs/utils/logs.utils.errors.d.ts +2 -0
  530. package/dist/logs/utils/logs.utils.errors.js +8 -0
  531. package/dist/logs/utils/logs.utils.errors.js.map +1 -0
  532. package/dist/models/index.d.ts +6 -0
  533. package/dist/models/index.js +11 -0
  534. package/dist/models/index.js.map +1 -0
  535. package/dist/models/models.service.d.ts +137 -0
  536. package/dist/models/models.service.js +195 -0
  537. package/dist/models/models.service.js.map +1 -0
  538. package/dist/notifications/index.d.ts +13 -0
  539. package/dist/notifications/index.js +26 -0
  540. package/dist/notifications/index.js.map +1 -0
  541. package/dist/notifications/notifications.service.d.ts +270 -0
  542. package/dist/notifications/notifications.service.js +912 -0
  543. package/dist/notifications/notifications.service.js.map +1 -0
  544. package/dist/notifications/types/index.d.ts +4 -0
  545. package/dist/notifications/types/index.js +21 -0
  546. package/dist/notifications/types/index.js.map +1 -0
  547. package/dist/notifications/types/notifications.types.d.ts +456 -0
  548. package/dist/notifications/types/notifications.types.js +51 -0
  549. package/dist/notifications/types/notifications.types.js.map +1 -0
  550. package/dist/parsers/index.d.ts +3 -0
  551. package/dist/parsers/index.js +27 -0
  552. package/dist/parsers/index.js.map +1 -0
  553. package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
  554. package/dist/parsers/pipelines/postman.pipelines.js +103 -0
  555. package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
  556. package/dist/parsers/types/postman.types.d.ts +200 -0
  557. package/dist/parsers/types/postman.types.js +3 -0
  558. package/dist/parsers/types/postman.types.js.map +1 -0
  559. package/dist/parsers/utils/postman.utils.d.ts +12 -0
  560. package/dist/parsers/utils/postman.utils.js +116 -0
  561. package/dist/parsers/utils/postman.utils.js.map +1 -0
  562. package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
  563. package/dist/parsers/validators/postman-auth.validators.js +127 -0
  564. package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
  565. package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
  566. package/dist/parsers/validators/postman-request.validators.js +139 -0
  567. package/dist/parsers/validators/postman-request.validators.js.map +1 -0
  568. package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
  569. package/dist/parsers/validators/postman-response.validators.js +150 -0
  570. package/dist/parsers/validators/postman-response.validators.js.map +1 -0
  571. package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
  572. package/dist/parsers/validators/postman-variable.validators.js +163 -0
  573. package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
  574. package/dist/pricing/pricing.repo.d.ts +0 -0
  575. package/dist/pricing/pricing.repo.js +1 -0
  576. package/dist/pricing/pricing.repo.js.map +1 -0
  577. package/dist/pricing/pricing.service.d.ts +24 -0
  578. package/dist/pricing/pricing.service.js +51 -0
  579. package/dist/pricing/pricing.service.js.map +1 -0
  580. package/dist/pricing/pricing.types.d.ts +76 -0
  581. package/dist/pricing/pricing.types.js +21 -0
  582. package/dist/pricing/pricing.types.js.map +1 -0
  583. package/dist/pricing/utils/string.utils.d.ts +1 -0
  584. package/dist/pricing/utils/string.utils.js +9 -0
  585. package/dist/pricing/utils/string.utils.js.map +1 -0
  586. package/dist/processor/repos/mongo.repo.d.ts +39 -0
  587. package/dist/processor/repos/mongo.repo.js +260 -0
  588. package/dist/processor/repos/mongo.repo.js.map +1 -0
  589. package/dist/processor/repos/postgres.repo.d.ts +31 -0
  590. package/dist/processor/repos/postgres.repo.js +185 -0
  591. package/dist/processor/repos/postgres.repo.js.map +1 -0
  592. package/dist/processor/repos/sms.repo.d.ts +39 -0
  593. package/dist/processor/repos/sms.repo.js +124 -0
  594. package/dist/processor/repos/sms.repo.js.map +1 -0
  595. package/dist/processor/services/processor.service.d.ts +465 -0
  596. package/dist/processor/services/processor.service.js +5343 -0
  597. package/dist/processor/services/processor.service.js.map +1 -0
  598. package/dist/processor/services/request.service.d.ts +36 -0
  599. package/dist/processor/services/request.service.js +304 -0
  600. package/dist/processor/services/request.service.js.map +1 -0
  601. package/dist/processor/types/request.types.d.ts +14 -0
  602. package/dist/processor/types/request.types.js +3 -0
  603. package/dist/processor/types/request.types.js.map +1 -0
  604. package/dist/processor/utils/processor.utils.d.ts +104 -0
  605. package/dist/processor/utils/processor.utils.js +1066 -0
  606. package/dist/processor/utils/processor.utils.js.map +1 -0
  607. package/dist/processor/utils/request.utils.d.ts +20 -0
  608. package/dist/processor/utils/request.utils.js +113 -0
  609. package/dist/processor/utils/request.utils.js.map +1 -0
  610. package/dist/processor/utils/storage.util.d.ts +8 -0
  611. package/dist/processor/utils/storage.util.js +106 -0
  612. package/dist/processor/utils/storage.util.js.map +1 -0
  613. package/dist/products/services/products.service.d.ts +579 -0
  614. package/dist/products/services/products.service.js +5853 -0
  615. package/dist/products/services/products.service.js.map +1 -0
  616. package/dist/products/utils/crypt.utils.d.ts +1 -0
  617. package/dist/products/utils/crypt.utils.js +17 -0
  618. package/dist/products/utils/crypt.utils.js.map +1 -0
  619. package/dist/products/utils/functions.utils.d.ts +13 -0
  620. package/dist/products/utils/functions.utils.js +294 -0
  621. package/dist/products/utils/functions.utils.js.map +1 -0
  622. package/dist/products/utils/objects.utils.d.ts +13 -0
  623. package/dist/products/utils/objects.utils.js +89 -0
  624. package/dist/products/utils/objects.utils.js.map +1 -0
  625. package/dist/products/utils/string.utils.d.ts +12 -0
  626. package/dist/products/utils/string.utils.js +168 -0
  627. package/dist/products/utils/string.utils.js.map +1 -0
  628. package/dist/products/validators/index.d.ts +33 -0
  629. package/dist/products/validators/index.js +75 -0
  630. package/dist/products/validators/index.js.map +1 -0
  631. package/dist/products/validators/joi-validators/create.html.validator.d.ts +2 -0
  632. package/dist/products/validators/joi-validators/create.html.validator.js +55 -0
  633. package/dist/products/validators/joi-validators/create.html.validator.js.map +1 -0
  634. package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
  635. package/dist/products/validators/joi-validators/create.productAgent.validator.js +266 -0
  636. package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
  637. package/dist/products/validators/joi-validators/create.productApp.validator.d.ts +4 -0
  638. package/dist/products/validators/joi-validators/create.productApp.validator.js +61 -0
  639. package/dist/products/validators/joi-validators/create.productApp.validator.js.map +1 -0
  640. package/dist/products/validators/joi-validators/create.productCache.validator.d.ts +3 -0
  641. package/dist/products/validators/joi-validators/create.productCache.validator.js +46 -0
  642. package/dist/products/validators/joi-validators/create.productCache.validator.js.map +1 -0
  643. package/dist/products/validators/joi-validators/create.productDatabase.validator.d.ts +3 -0
  644. package/dist/products/validators/joi-validators/create.productDatabase.validator.js +77 -0
  645. package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -0
  646. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +7 -0
  647. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +194 -0
  648. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -0
  649. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.d.ts +4 -0
  650. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js +63 -0
  651. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js.map +1 -0
  652. package/dist/products/validators/joi-validators/create.productEnv.validator.d.ts +3 -0
  653. package/dist/products/validators/joi-validators/create.productEnv.validator.js +45 -0
  654. package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -0
  655. package/dist/products/validators/joi-validators/create.productFallback.validator.d.ts +3 -0
  656. package/dist/products/validators/joi-validators/create.productFallback.validator.js +64 -0
  657. package/dist/products/validators/joi-validators/create.productFallback.validator.js.map +1 -0
  658. package/dist/products/validators/joi-validators/create.productFeature.validator.d.ts +14 -0
  659. package/dist/products/validators/joi-validators/create.productFeature.validator.js +140 -0
  660. package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +1 -0
  661. package/dist/products/validators/joi-validators/create.productFunction.validator.d.ts +3 -0
  662. package/dist/products/validators/joi-validators/create.productFunction.validator.js +57 -0
  663. package/dist/products/validators/joi-validators/create.productFunction.validator.js.map +1 -0
  664. package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
  665. package/dist/products/validators/joi-validators/create.productGraph.validator.js +89 -0
  666. package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
  667. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
  668. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
  669. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
  670. package/dist/products/validators/joi-validators/create.productJob.validator.d.ts +12 -0
  671. package/dist/products/validators/joi-validators/create.productJob.validator.js +60 -0
  672. package/dist/products/validators/joi-validators/create.productJob.validator.js.map +1 -0
  673. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.d.ts +3 -0
  674. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +52 -0
  675. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -0
  676. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.d.ts +3 -0
  677. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +193 -0
  678. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -0
  679. package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +3 -0
  680. package/dist/products/validators/joi-validators/create.productModel.validator.js +132 -0
  681. package/dist/products/validators/joi-validators/create.productModel.validator.js.map +1 -0
  682. package/dist/products/validators/joi-validators/create.productNotification.validator.d.ts +4 -0
  683. package/dist/products/validators/joi-validators/create.productNotification.validator.js +241 -0
  684. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -0
  685. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.d.ts +3 -0
  686. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +57 -0
  687. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js.map +1 -0
  688. package/dist/products/validators/joi-validators/create.productNotifications.validator.d.ts +0 -0
  689. package/dist/products/validators/joi-validators/create.productNotifications.validator.js +1 -0
  690. package/dist/products/validators/joi-validators/create.productNotifications.validator.js.map +1 -0
  691. package/dist/products/validators/joi-validators/create.productQuota.validator.d.ts +3 -0
  692. package/dist/products/validators/joi-validators/create.productQuota.validator.js +67 -0
  693. package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +1 -0
  694. package/dist/products/validators/joi-validators/create.productStorage.validator.d.ts +3 -0
  695. package/dist/products/validators/joi-validators/create.productStorage.validator.js +158 -0
  696. package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -0
  697. package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
  698. package/dist/products/validators/joi-validators/create.productVector.validator.js +136 -0
  699. package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
  700. package/dist/products/validators/joi-validators/create.products.validator.d.ts +3 -0
  701. package/dist/products/validators/joi-validators/create.products.validator.js +43 -0
  702. package/dist/products/validators/joi-validators/create.products.validator.js.map +1 -0
  703. package/dist/products/validators/joi-validators/create.requestAction.validator.d.ts +2 -0
  704. package/dist/products/validators/joi-validators/create.requestAction.validator.js +45 -0
  705. package/dist/products/validators/joi-validators/create.requestAction.validator.js.map +1 -0
  706. package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +3 -0
  707. package/dist/products/validators/joi-validators/create.userAuth.validator.js +48 -0
  708. package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -0
  709. package/dist/products/validators/joi-validators/register.productWebhooks.validator.d.ts +3 -0
  710. package/dist/products/validators/joi-validators/register.productWebhooks.validator.js +48 -0
  711. package/dist/products/validators/joi-validators/register.productWebhooks.validator.js.map +1 -0
  712. package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +3 -0
  713. package/dist/products/validators/joi-validators/update.dataValue.validator.js +104 -0
  714. package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -0
  715. package/dist/products/validators/joi-validators/update.productApp.validator.d.ts +3 -0
  716. package/dist/products/validators/joi-validators/update.productApp.validator.js +42 -0
  717. package/dist/products/validators/joi-validators/update.productApp.validator.js.map +1 -0
  718. package/dist/products/validators/joi-validators/update.productCache.validator.d.ts +3 -0
  719. package/dist/products/validators/joi-validators/update.productCache.validator.js +45 -0
  720. package/dist/products/validators/joi-validators/update.productCache.validator.js.map +1 -0
  721. package/dist/products/validators/joi-validators/update.productDatabase.validator.d.ts +3 -0
  722. package/dist/products/validators/joi-validators/update.productDatabase.validator.js +76 -0
  723. package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -0
  724. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +3 -0
  725. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +79 -0
  726. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -0
  727. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.d.ts +4 -0
  728. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js +64 -0
  729. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js.map +1 -0
  730. package/dist/products/validators/joi-validators/update.productEnv.validator.d.ts +3 -0
  731. package/dist/products/validators/joi-validators/update.productEnv.validator.js +46 -0
  732. package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -0
  733. package/dist/products/validators/joi-validators/update.productFallback.validator.d.ts +3 -0
  734. package/dist/products/validators/joi-validators/update.productFallback.validator.js +60 -0
  735. package/dist/products/validators/joi-validators/update.productFallback.validator.js.map +1 -0
  736. package/dist/products/validators/joi-validators/update.productFeature.validator.d.ts +3 -0
  737. package/dist/products/validators/joi-validators/update.productFeature.validator.js +53 -0
  738. package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +1 -0
  739. package/dist/products/validators/joi-validators/update.productFunction.validator.d.ts +3 -0
  740. package/dist/products/validators/joi-validators/update.productFunction.validator.js +41 -0
  741. package/dist/products/validators/joi-validators/update.productFunction.validator.js.map +1 -0
  742. package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
  743. package/dist/products/validators/joi-validators/update.productGraph.validator.js +88 -0
  744. package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
  745. package/dist/products/validators/joi-validators/update.productJob.validator.d.ts +3 -0
  746. package/dist/products/validators/joi-validators/update.productJob.validator.js +50 -0
  747. package/dist/products/validators/joi-validators/update.productJob.validator.js.map +1 -0
  748. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.d.ts +3 -0
  749. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +52 -0
  750. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -0
  751. package/dist/products/validators/joi-validators/update.productNotification.validator.d.ts +3 -0
  752. package/dist/products/validators/joi-validators/update.productNotification.validator.js +47 -0
  753. package/dist/products/validators/joi-validators/update.productNotification.validator.js.map +1 -0
  754. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.d.ts +3 -0
  755. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +58 -0
  756. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +1 -0
  757. package/dist/products/validators/joi-validators/update.productQuota.validator.d.ts +3 -0
  758. package/dist/products/validators/joi-validators/update.productQuota.validator.js +64 -0
  759. package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +1 -0
  760. package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +3 -0
  761. package/dist/products/validators/joi-validators/update.userAuth.validator.js +48 -0
  762. package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -0
  763. package/dist/resilience/fallback.service.d.ts +143 -0
  764. package/dist/resilience/fallback.service.js +771 -0
  765. package/dist/resilience/fallback.service.js.map +1 -0
  766. package/dist/resilience/healthcheck.service.d.ts +165 -0
  767. package/dist/resilience/healthcheck.service.js +1019 -0
  768. package/dist/resilience/healthcheck.service.js.map +1 -0
  769. package/dist/resilience/index.d.ts +104 -0
  770. package/dist/resilience/index.js +140 -0
  771. package/dist/resilience/index.js.map +1 -0
  772. package/dist/resilience/quota.service.d.ts +85 -0
  773. package/dist/resilience/quota.service.js +523 -0
  774. package/dist/resilience/quota.service.js.map +1 -0
  775. package/dist/resilience/resilience.service.d.ts +98 -0
  776. package/dist/resilience/resilience.service.js +560 -0
  777. package/dist/resilience/resilience.service.js.map +1 -0
  778. package/dist/resilience/types/index.d.ts +515 -0
  779. package/dist/resilience/types/index.js +29 -0
  780. package/dist/resilience/types/index.js.map +1 -0
  781. package/dist/runtime/runtime-defaults.d.ts +28 -0
  782. package/dist/runtime/runtime-defaults.js +38 -0
  783. package/dist/runtime/runtime-defaults.js.map +1 -0
  784. package/dist/secrets/index.d.ts +10 -0
  785. package/dist/secrets/index.js +33 -0
  786. package/dist/secrets/index.js.map +1 -0
  787. package/dist/secrets/secrets.resolver.d.ts +52 -0
  788. package/dist/secrets/secrets.resolver.js +236 -0
  789. package/dist/secrets/secrets.resolver.js.map +1 -0
  790. package/dist/secrets/secrets.service.d.ts +93 -0
  791. package/dist/secrets/secrets.service.js +246 -0
  792. package/dist/secrets/secrets.service.js.map +1 -0
  793. package/dist/secrets/secrets.types.d.ts +188 -0
  794. package/dist/secrets/secrets.types.js +87 -0
  795. package/dist/secrets/secrets.types.js.map +1 -0
  796. package/dist/sessions/index.d.ts +50 -0
  797. package/dist/sessions/index.js +96 -0
  798. package/dist/sessions/index.js.map +1 -0
  799. package/dist/sessions/sessions.helper.d.ts +88 -0
  800. package/dist/sessions/sessions.helper.js +190 -0
  801. package/dist/sessions/sessions.helper.js.map +1 -0
  802. package/dist/sessions/sessions.resolver.d.ts +188 -0
  803. package/dist/sessions/sessions.resolver.js +603 -0
  804. package/dist/sessions/sessions.resolver.js.map +1 -0
  805. package/dist/sessions/sessions.service.d.ts +196 -0
  806. package/dist/sessions/sessions.service.js +993 -0
  807. package/dist/sessions/sessions.service.js.map +1 -0
  808. package/dist/sessions/types/index.d.ts +347 -0
  809. package/dist/sessions/types/index.js +6 -0
  810. package/dist/sessions/types/index.js.map +1 -0
  811. package/dist/storage/index.d.ts +66 -0
  812. package/dist/storage/index.js +99 -0
  813. package/dist/storage/index.js.map +1 -0
  814. package/dist/storage/storage.service.d.ts +179 -0
  815. package/dist/storage/storage.service.js +938 -0
  816. package/dist/storage/storage.service.js.map +1 -0
  817. package/dist/storage/types/index.d.ts +273 -0
  818. package/dist/storage/types/index.js +6 -0
  819. package/dist/storage/types/index.js.map +1 -0
  820. package/dist/storage/utils/storage.util.d.ts +62 -0
  821. package/dist/storage/utils/storage.util.js +623 -0
  822. package/dist/storage/utils/storage.util.js.map +1 -0
  823. package/dist/types/actions.types.d.ts +0 -0
  824. package/dist/types/actions.types.js +1 -0
  825. package/dist/types/actions.types.js.map +1 -0
  826. package/dist/types/appBuilder.types.d.ts +316 -0
  827. package/dist/types/appBuilder.types.js +3 -0
  828. package/dist/types/appBuilder.types.js.map +1 -0
  829. package/dist/types/database.types.d.ts +9 -0
  830. package/dist/types/database.types.js +3 -0
  831. package/dist/types/database.types.js.map +1 -0
  832. package/dist/types/enums.d.ts +232 -0
  833. package/dist/types/enums.js +262 -0
  834. package/dist/types/enums.js.map +1 -0
  835. package/dist/types/index.d.ts +12 -0
  836. package/dist/types/index.js +29 -0
  837. package/dist/types/index.js.map +1 -0
  838. package/dist/types/index.types.d.ts +37 -0
  839. package/dist/types/index.types.js +18 -0
  840. package/dist/types/index.types.js.map +1 -0
  841. package/dist/types/inputs.types.d.ts +114 -0
  842. package/dist/types/inputs.types.js +44 -0
  843. package/dist/types/inputs.types.js.map +1 -0
  844. package/dist/types/logs.types.d.ts +19 -0
  845. package/dist/types/logs.types.js +8 -0
  846. package/dist/types/logs.types.js.map +1 -0
  847. package/dist/types/pricing.types.d.ts +4 -0
  848. package/dist/types/pricing.types.js +3 -0
  849. package/dist/types/pricing.types.js.map +1 -0
  850. package/dist/types/processor.types.d.ts +602 -0
  851. package/dist/types/processor.types.js +19 -0
  852. package/dist/types/processor.types.js.map +1 -0
  853. package/dist/types/productsBuilder.types.d.ts +1583 -0
  854. package/dist/types/productsBuilder.types.js +303 -0
  855. package/dist/types/productsBuilder.types.js.map +1 -0
  856. package/dist/types/request-tracker.interface.d.ts +0 -0
  857. package/dist/types/request-tracker.interface.js +1 -0
  858. package/dist/types/request-tracker.interface.js.map +1 -0
  859. package/dist/types/requests.types.d.ts +8 -0
  860. package/dist/types/requests.types.js +3 -0
  861. package/dist/types/requests.types.js.map +1 -0
  862. package/dist/types/workspaces.types.d.ts +28 -0
  863. package/dist/types/workspaces.types.js +4 -0
  864. package/dist/types/workspaces.types.js.map +1 -0
  865. package/dist/utils/constants.d.ts +1 -0
  866. package/dist/utils/constants.js +5 -0
  867. package/dist/utils/constants.js.map +1 -0
  868. package/dist/utils/index.d.ts +2 -0
  869. package/dist/utils/index.js +109 -0
  870. package/dist/utils/index.js.map +1 -0
  871. package/dist/vector/actions/action-manager.d.ts +140 -0
  872. package/dist/vector/actions/action-manager.js +356 -0
  873. package/dist/vector/actions/action-manager.js.map +1 -0
  874. package/dist/vector/adapters/base.adapter.d.ts +169 -0
  875. package/dist/vector/adapters/base.adapter.js +218 -0
  876. package/dist/vector/adapters/base.adapter.js.map +1 -0
  877. package/dist/vector/adapters/index.d.ts +10 -0
  878. package/dist/vector/adapters/index.js +19 -0
  879. package/dist/vector/adapters/index.js.map +1 -0
  880. package/dist/vector/adapters/memory.adapter.d.ts +85 -0
  881. package/dist/vector/adapters/memory.adapter.js +505 -0
  882. package/dist/vector/adapters/memory.adapter.js.map +1 -0
  883. package/dist/vector/adapters/pinecone.adapter.d.ts +52 -0
  884. package/dist/vector/adapters/pinecone.adapter.js +433 -0
  885. package/dist/vector/adapters/pinecone.adapter.js.map +1 -0
  886. package/dist/vector/adapters/qdrant.adapter.d.ts +56 -0
  887. package/dist/vector/adapters/qdrant.adapter.js +442 -0
  888. package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
  889. package/dist/vector/adapters/weaviate.adapter.d.ts +68 -0
  890. package/dist/vector/adapters/weaviate.adapter.js +661 -0
  891. package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
  892. package/dist/vector/index.d.ts +37 -0
  893. package/dist/vector/index.js +72 -0
  894. package/dist/vector/index.js.map +1 -0
  895. package/dist/vector/types/action.interface.d.ts +195 -0
  896. package/dist/vector/types/action.interface.js +100 -0
  897. package/dist/vector/types/action.interface.js.map +1 -0
  898. package/dist/vector/types/connection.interface.d.ts +151 -0
  899. package/dist/vector/types/connection.interface.js +8 -0
  900. package/dist/vector/types/connection.interface.js.map +1 -0
  901. package/dist/vector/types/embedding.interface.d.ts +144 -0
  902. package/dist/vector/types/embedding.interface.js +8 -0
  903. package/dist/vector/types/embedding.interface.js.map +1 -0
  904. package/dist/vector/types/enums.d.ts +104 -0
  905. package/dist/vector/types/enums.js +113 -0
  906. package/dist/vector/types/enums.js.map +1 -0
  907. package/dist/vector/types/index.d.ts +11 -0
  908. package/dist/vector/types/index.js +23 -0
  909. package/dist/vector/types/index.js.map +1 -0
  910. package/dist/vector/types/vector.interface.d.ts +315 -0
  911. package/dist/vector/types/vector.interface.js +8 -0
  912. package/dist/vector/types/vector.interface.js.map +1 -0
  913. package/dist/vector/utils/index.d.ts +7 -0
  914. package/dist/vector/utils/index.js +13 -0
  915. package/dist/vector/utils/index.js.map +1 -0
  916. package/dist/vector/utils/metadata-schema.d.ts +14 -0
  917. package/dist/vector/utils/metadata-schema.js +79 -0
  918. package/dist/vector/utils/metadata-schema.js.map +1 -0
  919. package/dist/vector/utils/vector-error.d.ts +69 -0
  920. package/dist/vector/utils/vector-error.js +116 -0
  921. package/dist/vector/utils/vector-error.js.map +1 -0
  922. package/dist/vector/vector-database.service.d.ts +511 -0
  923. package/dist/vector/vector-database.service.js +1073 -0
  924. package/dist/vector/vector-database.service.js.map +1 -0
  925. package/dist/vector/vector.service.d.ts +283 -0
  926. package/dist/vector/vector.service.js +544 -0
  927. package/dist/vector/vector.service.js.map +1 -0
  928. package/dist/warehouse/executor/index.d.ts +5 -0
  929. package/dist/warehouse/executor/index.js +12 -0
  930. package/dist/warehouse/executor/index.js.map +1 -0
  931. package/dist/warehouse/executor/joins/index.d.ts +5 -0
  932. package/dist/warehouse/executor/joins/index.js +11 -0
  933. package/dist/warehouse/executor/joins/index.js.map +1 -0
  934. package/dist/warehouse/executor/joins/join-executor.d.ts +101 -0
  935. package/dist/warehouse/executor/joins/join-executor.js +493 -0
  936. package/dist/warehouse/executor/joins/join-executor.js.map +1 -0
  937. package/dist/warehouse/executor/joins/semantic-join.d.ts +64 -0
  938. package/dist/warehouse/executor/joins/semantic-join.js +241 -0
  939. package/dist/warehouse/executor/joins/semantic-join.js.map +1 -0
  940. package/dist/warehouse/executor/single-source-executor.d.ts +155 -0
  941. package/dist/warehouse/executor/single-source-executor.js +573 -0
  942. package/dist/warehouse/executor/single-source-executor.js.map +1 -0
  943. package/dist/warehouse/index.d.ts +79 -0
  944. package/dist/warehouse/index.js +111 -0
  945. package/dist/warehouse/index.js.map +1 -0
  946. package/dist/warehouse/parser/index.d.ts +4 -0
  947. package/dist/warehouse/parser/index.js +10 -0
  948. package/dist/warehouse/parser/index.js.map +1 -0
  949. package/dist/warehouse/parser/query-parser.d.ts +181 -0
  950. package/dist/warehouse/parser/query-parser.js +415 -0
  951. package/dist/warehouse/parser/query-parser.js.map +1 -0
  952. package/dist/warehouse/registry/data-source-registry.d.ts +207 -0
  953. package/dist/warehouse/registry/data-source-registry.js +396 -0
  954. package/dist/warehouse/registry/data-source-registry.js.map +1 -0
  955. package/dist/warehouse/registry/index.d.ts +4 -0
  956. package/dist/warehouse/registry/index.js +9 -0
  957. package/dist/warehouse/registry/index.js.map +1 -0
  958. package/dist/warehouse/transactions/index.d.ts +4 -0
  959. package/dist/warehouse/transactions/index.js +9 -0
  960. package/dist/warehouse/transactions/index.js.map +1 -0
  961. package/dist/warehouse/transactions/saga-orchestrator.d.ts +92 -0
  962. package/dist/warehouse/transactions/saga-orchestrator.js +383 -0
  963. package/dist/warehouse/transactions/saga-orchestrator.js.map +1 -0
  964. package/dist/warehouse/types/index.d.ts +9 -0
  965. package/dist/warehouse/types/index.js +33 -0
  966. package/dist/warehouse/types/index.js.map +1 -0
  967. package/dist/warehouse/types/join.interface.d.ts +225 -0
  968. package/dist/warehouse/types/join.interface.js +87 -0
  969. package/dist/warehouse/types/join.interface.js.map +1 -0
  970. package/dist/warehouse/types/query.interface.d.ts +232 -0
  971. package/dist/warehouse/types/query.interface.js +9 -0
  972. package/dist/warehouse/types/query.interface.js.map +1 -0
  973. package/dist/warehouse/types/transaction.interface.d.ts +236 -0
  974. package/dist/warehouse/types/transaction.interface.js +74 -0
  975. package/dist/warehouse/types/transaction.interface.js.map +1 -0
  976. package/dist/warehouse/types/where.interface.d.ts +208 -0
  977. package/dist/warehouse/types/where.interface.js +89 -0
  978. package/dist/warehouse/types/where.interface.js.map +1 -0
  979. package/dist/warehouse/warehouse.service.d.ts +200 -0
  980. package/dist/warehouse/warehouse.service.js +470 -0
  981. package/dist/warehouse/warehouse.service.js.map +1 -0
  982. package/dist/workflows/index.d.ts +30 -0
  983. package/dist/workflows/index.js +64 -0
  984. package/dist/workflows/index.js.map +1 -0
  985. package/dist/workflows/types/index.d.ts +6 -0
  986. package/dist/workflows/types/index.js +23 -0
  987. package/dist/workflows/types/index.js.map +1 -0
  988. package/dist/workflows/types/workflows.types.d.ts +1095 -0
  989. package/dist/workflows/types/workflows.types.js +13 -0
  990. package/dist/workflows/types/workflows.types.js.map +1 -0
  991. package/dist/workflows/workflow-builder.d.ts +70 -0
  992. package/dist/workflows/workflow-builder.js +353 -0
  993. package/dist/workflows/workflow-builder.js.map +1 -0
  994. package/dist/workflows/workflow-executor.d.ts +289 -0
  995. package/dist/workflows/workflow-executor.js +2467 -0
  996. package/dist/workflows/workflow-executor.js.map +1 -0
  997. package/dist/workflows/workflows.service.d.ts +412 -0
  998. package/dist/workflows/workflows.service.js +2233 -0
  999. package/dist/workflows/workflows.service.js.map +1 -0
  1000. package/package.json +3 -2
@@ -0,0 +1,1255 @@
1
+ "use strict";
2
+ /**
3
+ * Agents Service
4
+ *
5
+ * Main service class for agentic workflows operations.
6
+ * Provides CRUD operations and execution for Ductape Agents.
7
+ *
8
+ * Agentic workflows extend Ductape's workflow engine to support AI-driven,
9
+ * autonomous multi-step processes where an LLM dynamically decides the
10
+ * next action based on observations and reasoning.
11
+ */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ var __importDefault = (this && this.__importDefault) || function (mod) {
46
+ return (mod && mod.__esModule) ? mod : { "default": mod };
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.agentsService = exports.AgentsService = exports.AgentError = void 0;
50
+ const crypto_1 = require("crypto");
51
+ const products_service_1 = __importDefault(require("../products/services/products.service"));
52
+ const processor_service_1 = __importDefault(require("../processor/services/processor.service"));
53
+ const logs_service_1 = __importDefault(require("../logs/logs.service"));
54
+ const logs_types_1 = require("../logs/logs.types");
55
+ const processor_utils_1 = require("../processor/utils/processor.utils");
56
+ const productsBuilder_types_1 = require("../types/productsBuilder.types");
57
+ const tool_registry_1 = require("./tool-registry");
58
+ const agent_executor_1 = require("./agent-executor");
59
+ const quota_service_1 = require("../resilience/quota.service");
60
+ const fallback_service_1 = require("../resilience/fallback.service");
61
+ const healthcheck_service_1 = require("../resilience/healthcheck.service");
62
+ const secrets_1 = require("../secrets");
63
+ /**
64
+ * Error class for agent-related errors
65
+ */
66
+ class AgentError extends Error {
67
+ constructor(message, code, details) {
68
+ super(message);
69
+ this.code = code;
70
+ this.details = details;
71
+ this.name = 'AgentError';
72
+ }
73
+ static configurationError(message) {
74
+ return new AgentError(message, 'CONFIGURATION_ERROR');
75
+ }
76
+ static validationError(message, details) {
77
+ return new AgentError(message, 'VALIDATION_ERROR', details);
78
+ }
79
+ static notFoundError(message) {
80
+ return new AgentError(message, 'NOT_FOUND');
81
+ }
82
+ static executionError(message, details) {
83
+ return new AgentError(message, 'EXECUTION_ERROR', details);
84
+ }
85
+ }
86
+ exports.AgentError = AgentError;
87
+ /**
88
+ * Main Agents Service class
89
+ * Provides unified interface for agent management and execution
90
+ */
91
+ class AgentsService {
92
+ /**
93
+ * Create a new AgentsService instance
94
+ * @param config - Optional configuration for authentication and workspace context
95
+ */
96
+ constructor(config) {
97
+ /** Service configuration */
98
+ this.config = null;
99
+ /** ProductBuilder instances cache (keyed by product tag) */
100
+ this.productBuilders = new Map();
101
+ /** Local agent definitions */
102
+ this.localAgents = new Map();
103
+ /** Tool registries per agent */
104
+ this.toolRegistries = new Map();
105
+ /** Active executors (for status/signal handling) */
106
+ this.activeExecutors = new Map();
107
+ /** LogService instance for logging operations */
108
+ this.logService = null;
109
+ /** Current product ID for logging */
110
+ this.productId = '';
111
+ this.config = config || null;
112
+ this._privateKey = config ? config.private_key : '';
113
+ }
114
+ // ==================== CONFIGURATION ====================
115
+ /**
116
+ * Update service configuration
117
+ */
118
+ updateConfig(config) {
119
+ this.config = config;
120
+ }
121
+ /**
122
+ * Get service configuration
123
+ */
124
+ getConfig() {
125
+ return this.config;
126
+ }
127
+ // ==================== PRODUCT BUILDER MANAGEMENT ====================
128
+ /**
129
+ * Create a new ProductBuilder instance
130
+ */
131
+ createNewProductBuilder() {
132
+ if (!this.config) {
133
+ throw AgentError.configurationError('AgentsService not configured. Please provide config when initializing.');
134
+ }
135
+ return new products_service_1.default({
136
+ workspace_id: this.config.workspace_id,
137
+ public_key: this.config.public_key,
138
+ user_id: this.config.user_id,
139
+ token: this.config.token,
140
+ env_type: this.config.env_type,
141
+ });
142
+ }
143
+ /**
144
+ * Get or create a ProductBuilder instance for the given product tag
145
+ */
146
+ async getProductBuilder(productTag) {
147
+ let builder = this.productBuilders.get(productTag);
148
+ if (!builder) {
149
+ builder = this.createNewProductBuilder();
150
+ await builder.initializeProductByTag(productTag);
151
+ this.productBuilders.set(productTag, builder);
152
+ this.productId = builder.fetchProductId() || '';
153
+ }
154
+ return builder;
155
+ }
156
+ /**
157
+ * Initialize logging service
158
+ */
159
+ initializeLogService() {
160
+ var _a;
161
+ if (!this.logService && this.config) {
162
+ this.logService = new logs_service_1.default({
163
+ product_id: this.productId,
164
+ workspace_id: this.config.workspace_id,
165
+ public_key: this.config.public_key,
166
+ user_id: this.config.user_id,
167
+ token: this.config.token,
168
+ env_type: this.config.env_type,
169
+ workspace_private_key: (_a = this._privateKey) !== null && _a !== void 0 ? _a : undefined,
170
+ });
171
+ }
172
+ }
173
+ /**
174
+ * Create a new ProcessorService instance
175
+ */
176
+ createNewProcessor() {
177
+ if (!this.config) {
178
+ throw AgentError.configurationError('AgentsService not configured. Please provide config when initializing.');
179
+ }
180
+ return new processor_service_1.default({
181
+ workspace_id: this.config.workspace_id,
182
+ public_key: this.config.public_key,
183
+ user_id: this.config.user_id,
184
+ token: this.config.token,
185
+ env_type: this.config.env_type,
186
+ redis_client: this.config.redis_client,
187
+ private_key: this._privateKey,
188
+ });
189
+ }
190
+ /**
191
+ * Create a resilience service wrapper for agent operations
192
+ */
193
+ createResilienceService() {
194
+ if (!this.config) {
195
+ return undefined;
196
+ }
197
+ const serviceConfig = {
198
+ workspace_id: this.config.workspace_id,
199
+ public_key: this.config.public_key,
200
+ user_id: this.config.user_id,
201
+ token: this.config.token,
202
+ env_type: this.config.env_type,
203
+ private_key: this._privateKey,
204
+ access_key: this.config.access_key,
205
+ };
206
+ // Create individual services
207
+ const quotaService = new quota_service_1.QuotaService(serviceConfig);
208
+ const fallbackService = new fallback_service_1.FallbackService(serviceConfig);
209
+ const healthcheckService = new healthcheck_service_1.HealthcheckService(serviceConfig);
210
+ // Return a wrapper that delegates to the appropriate service
211
+ return {
212
+ async runQuota(options) {
213
+ return quotaService.run({
214
+ product: options.product,
215
+ env: options.env,
216
+ tag: options.tag,
217
+ input: options.input,
218
+ session: options.session,
219
+ });
220
+ },
221
+ async runFallback(options) {
222
+ return fallbackService.run({
223
+ product: options.product,
224
+ env: options.env,
225
+ tag: options.tag,
226
+ input: options.input,
227
+ session: options.session,
228
+ });
229
+ },
230
+ async checkHealth(options) {
231
+ return healthcheckService.getStatus({
232
+ product: options.product,
233
+ env: options.env,
234
+ tag: options.tag,
235
+ });
236
+ },
237
+ async getQuotaStatus(options) {
238
+ // This would need to be implemented in QuotaService
239
+ // For now, return basic status
240
+ return {
241
+ tag: options.tag,
242
+ totalQuota: undefined,
243
+ usedQuota: undefined,
244
+ remainingQuota: undefined,
245
+ providers: [],
246
+ };
247
+ },
248
+ };
249
+ }
250
+ /**
251
+ * Get context services for agent execution
252
+ */
253
+ getContextServices(resilienceConfig) {
254
+ return {
255
+ config: this.config,
256
+ processorService: this.createNewProcessor(),
257
+ resilienceService: this.createResilienceService(),
258
+ resilienceConfig,
259
+ // Note: These services would be injected from the main Ductape class
260
+ // databaseService, graphService, storageService, brokersService
261
+ };
262
+ }
263
+ // ==================== AGENT DEFINITION ====================
264
+ /**
265
+ * Define a new agent and optionally persist to database
266
+ *
267
+ * @example
268
+ * ```ts
269
+ * // Define and persist to database
270
+ * const agent = await ductape.agents.define({
271
+ * product: 'my-product',
272
+ * tag: 'customer-support',
273
+ * name: 'Customer Support Agent',
274
+ * model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' },
275
+ * systemPrompt: 'You are a helpful customer support agent...',
276
+ * tools: [
277
+ * {
278
+ * tag: 'lookup-order',
279
+ * description: 'Look up order details',
280
+ * parameters: { orderId: { type: 'string', description: 'Order ID' } },
281
+ * handler: async (ctx, params) => ctx.database.query({ ... }),
282
+ * },
283
+ * ],
284
+ * });
285
+ * ```
286
+ */
287
+ async define(options) {
288
+ var _a;
289
+ // Validate required fields
290
+ if (!options.tag) {
291
+ throw AgentError.validationError('Agent tag is required');
292
+ }
293
+ if (!options.name) {
294
+ throw AgentError.validationError('Agent name is required');
295
+ }
296
+ if (!options.model) {
297
+ throw AgentError.validationError('Agent model configuration is required');
298
+ }
299
+ if (!options.systemPrompt) {
300
+ throw AgentError.validationError('Agent system prompt is required');
301
+ }
302
+ // Create tool registry
303
+ const toolRegistry = new tool_registry_1.ToolRegistry();
304
+ if (options.tools && options.tools.length > 0) {
305
+ toolRegistry.registerMany(options.tools);
306
+ }
307
+ // Store tool registry (with handlers for local execution)
308
+ this.toolRegistries.set(options.tag, toolRegistry);
309
+ // Get tool schemas (without handlers for storage)
310
+ const toolSchemas = toolRegistry.getSchemas();
311
+ // Create defined agent (without handlers for storage)
312
+ const definedAgent = {
313
+ tag: options.tag,
314
+ name: options.name,
315
+ description: options.description,
316
+ model: options.model,
317
+ modelConfig: options.modelConfig,
318
+ systemPrompt: options.systemPrompt,
319
+ toolSchemas,
320
+ termination: options.termination,
321
+ memory: options.memory,
322
+ humanInLoop: options.humanInLoop,
323
+ streaming: options.streaming,
324
+ inputSchema: options.inputSchema,
325
+ envs: options.envs,
326
+ resilience: options.resilience,
327
+ };
328
+ // Store locally
329
+ this.localAgents.set(options.tag, definedAgent);
330
+ // If product is specified, persist to database
331
+ if (options.product) {
332
+ try {
333
+ const productBuilder = await this.getProductBuilder(options.product);
334
+ // Convert to IProductAgent format for storage
335
+ const productAgent = {
336
+ tag: options.tag,
337
+ name: options.name,
338
+ description: options.description,
339
+ model: options.model, // Model is a tag reference to product-level model config
340
+ modelConfig: options.modelConfig,
341
+ systemPrompt: options.systemPrompt,
342
+ tools: toolSchemas.map((schema) => ({
343
+ tag: schema.tag,
344
+ name: schema.name,
345
+ description: schema.description,
346
+ parameters: schema.parameters,
347
+ requiresConfirmation: schema.requiresConfirmation,
348
+ costEstimate: schema.costEstimate,
349
+ timeout: schema.timeout,
350
+ retries: schema.retries,
351
+ })),
352
+ termination: options.termination ? {
353
+ maxIterations: options.termination.maxIterations,
354
+ maxTokens: options.termination.maxTokens,
355
+ timeout: typeof options.termination.timeout === 'string'
356
+ ? parseInt(options.termination.timeout)
357
+ : options.termination.timeout,
358
+ allowManualStop: options.termination.allowManualStop,
359
+ } : undefined,
360
+ memory: options.memory ? {
361
+ shortTerm: options.memory.shortTerm,
362
+ longTerm: options.memory.longTerm,
363
+ } : undefined,
364
+ humanInLoop: options.humanInLoop ? {
365
+ enabled: options.humanInLoop.enabled,
366
+ alwaysRequireApproval: options.humanInLoop.alwaysRequireApproval,
367
+ approvalTimeout: typeof options.humanInLoop.approvalTimeout === 'string'
368
+ ? parseInt(options.humanInLoop.approvalTimeout)
369
+ : options.humanInLoop.approvalTimeout,
370
+ approvalWebhook: options.humanInLoop.approvalWebhook,
371
+ approvalBroker: options.humanInLoop.approvalBroker,
372
+ } : undefined,
373
+ streaming: options.streaming ? {
374
+ enabled: options.streaming.enabled,
375
+ events: options.streaming.events,
376
+ webhook: options.streaming.webhook,
377
+ broker: options.streaming.broker,
378
+ } : undefined,
379
+ inputSchema: options.inputSchema,
380
+ envs: (_a = options.envs) === null || _a === void 0 ? void 0 : _a.map((env) => ({
381
+ slug: env.slug,
382
+ active: env.active,
383
+ model: env.model, // Model tag override for this environment
384
+ modelConfig: env.modelConfig,
385
+ toolOverrides: env.toolOverrides,
386
+ })),
387
+ resilience: options.resilience,
388
+ };
389
+ await productBuilder.createAgent(productAgent);
390
+ }
391
+ catch (error) {
392
+ // Log but don't fail - agent is still stored locally
393
+ console.warn(`Failed to persist agent to database: ${error}`);
394
+ }
395
+ }
396
+ return definedAgent;
397
+ }
398
+ /**
399
+ * Register a defined agent with a product (persists to database)
400
+ *
401
+ * @example
402
+ * ```ts
403
+ * await ductape.agents.register('my-product', agent);
404
+ * ```
405
+ */
406
+ async register(product, agent) {
407
+ var _a, _b, _c, _d, _e, _f, _g;
408
+ const process_id = (0, processor_utils_1.generateObjectId)();
409
+ // Initialize logging
410
+ await this.getProductBuilder(product);
411
+ this.initializeLogService();
412
+ const baseLogs = {
413
+ product_tag: product,
414
+ workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '',
415
+ env: '',
416
+ process_id,
417
+ type: logs_types_1.LogEventTypes.WORKFLOW,
418
+ parent_tag: agent.tag,
419
+ data: { agent: agent.tag, operation: 'register' },
420
+ };
421
+ (_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
422
+ try {
423
+ const productBuilder = await this.getProductBuilder(product);
424
+ // Convert to IProductAgent format and persist to database
425
+ const productAgent = {
426
+ tag: agent.tag,
427
+ name: agent.name,
428
+ description: agent.description,
429
+ model: agent.model, // Model is a tag reference to product-level model config
430
+ modelConfig: agent.modelConfig,
431
+ systemPrompt: agent.systemPrompt,
432
+ tools: agent.toolSchemas.map((schema) => ({
433
+ tag: schema.tag,
434
+ name: schema.name,
435
+ description: schema.description,
436
+ parameters: schema.parameters,
437
+ requiresConfirmation: schema.requiresConfirmation,
438
+ costEstimate: schema.costEstimate,
439
+ timeout: schema.timeout,
440
+ retries: schema.retries,
441
+ })),
442
+ termination: agent.termination ? {
443
+ maxIterations: agent.termination.maxIterations,
444
+ maxTokens: agent.termination.maxTokens,
445
+ timeout: typeof agent.termination.timeout === 'string'
446
+ ? parseInt(agent.termination.timeout)
447
+ : agent.termination.timeout,
448
+ allowManualStop: agent.termination.allowManualStop,
449
+ } : undefined,
450
+ memory: agent.memory ? {
451
+ shortTerm: agent.memory.shortTerm,
452
+ longTerm: agent.memory.longTerm,
453
+ } : undefined,
454
+ humanInLoop: agent.humanInLoop ? {
455
+ enabled: agent.humanInLoop.enabled,
456
+ alwaysRequireApproval: agent.humanInLoop.alwaysRequireApproval,
457
+ approvalTimeout: typeof agent.humanInLoop.approvalTimeout === 'string'
458
+ ? parseInt(agent.humanInLoop.approvalTimeout)
459
+ : agent.humanInLoop.approvalTimeout,
460
+ approvalWebhook: agent.humanInLoop.approvalWebhook,
461
+ approvalBroker: agent.humanInLoop.approvalBroker,
462
+ } : undefined,
463
+ streaming: agent.streaming ? {
464
+ enabled: agent.streaming.enabled,
465
+ events: agent.streaming.events,
466
+ webhook: agent.streaming.webhook,
467
+ broker: agent.streaming.broker,
468
+ } : undefined,
469
+ inputSchema: agent.inputSchema,
470
+ envs: (_c = agent.envs) === null || _c === void 0 ? void 0 : _c.map((env) => ({
471
+ slug: env.slug,
472
+ active: env.active,
473
+ model: env.model, // Model tag override for this environment
474
+ modelConfig: env.modelConfig,
475
+ toolOverrides: env.toolOverrides,
476
+ })),
477
+ resilience: agent.resilience,
478
+ };
479
+ await productBuilder.createAgent(productAgent);
480
+ // Also store locally for immediate execution
481
+ this.localAgents.set(agent.tag, agent);
482
+ (_d = this.logService) === null || _d === void 0 ? void 0 : _d.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - success', successful_execution: true, status: logs_types_1.LogEventStatus.SUCCESS }));
483
+ (_e = this.logService) === null || _e === void 0 ? void 0 : _e.publish();
484
+ }
485
+ catch (error) {
486
+ (_f = this.logService) === null || _f === void 0 ? void 0 : _f.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - failed', failed_execution: true, data: { agent: agent.tag, operation: 'register', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
487
+ await ((_g = this.logService) === null || _g === void 0 ? void 0 : _g.publish());
488
+ throw AgentError.executionError(`Failed to register agent: ${error}`, { agent: agent.tag });
489
+ }
490
+ }
491
+ // ==================== AGENT EXECUTION ====================
492
+ /**
493
+ * Run an agent
494
+ *
495
+ * @example
496
+ * ```ts
497
+ * const result = await ductape.agents.run({
498
+ * product: 'my-product',
499
+ * env: 'production',
500
+ * tag: 'customer-support',
501
+ * input: {
502
+ * ticketId: 'TICKET-123',
503
+ * message: 'I need help with my order',
504
+ * },
505
+ * });
506
+ * ```
507
+ */
508
+ async run(options) {
509
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
510
+ const process_id = (0, processor_utils_1.generateObjectId)();
511
+ const startTime = Date.now();
512
+ // Session log fields (will be populated if session is provided)
513
+ let sessionLogFields = {};
514
+ let resolvedOptions = options;
515
+ // Initialize logging
516
+ const productBuilder = await this.getProductBuilder(options.product);
517
+ this.initializeLogService();
518
+ // Process session if provided - verify and resolve $Session{} references
519
+ if (options.session) {
520
+ const privateKey = productBuilder.fetchPrivateKey();
521
+ if (privateKey) {
522
+ const { processSessionForExecution } = await Promise.resolve().then(() => __importStar(require('../sessions')));
523
+ const sessionResult = await processSessionForExecution(options.session, privateKey, options, options.env, {
524
+ fetchSessionSelector: async (sessionTag) => {
525
+ const sessionConfig = await productBuilder.fetchSession(sessionTag);
526
+ return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
527
+ },
528
+ });
529
+ if (sessionResult.error) {
530
+ throw AgentError.executionError(`Session validation failed: ${sessionResult.error}`);
531
+ }
532
+ resolvedOptions = sessionResult.input;
533
+ sessionLogFields = sessionResult.logFields;
534
+ }
535
+ }
536
+ const baseLogs = Object.assign({ product_tag: options.product, workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '', env: options.env, process_id, type: logs_types_1.LogEventTypes.WORKFLOW, parent_tag: options.tag, data: { agent: options.tag, operation: 'run' } }, sessionLogFields);
537
+ (_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
538
+ try {
539
+ // Get agent definition - first check local, then fetch from database
540
+ let agent = this.localAgents.get(resolvedOptions.tag);
541
+ let toolRegistry = this.toolRegistries.get(resolvedOptions.tag);
542
+ if (!agent) {
543
+ // Try to fetch from database
544
+ const storedAgent = await productBuilder.fetchAgent(resolvedOptions.tag);
545
+ if (!storedAgent) {
546
+ throw AgentError.notFoundError(`Agent '${resolvedOptions.tag}' not found`);
547
+ }
548
+ // Convert IProductAgent to IDefinedAgent
549
+ agent = this.convertProductAgentToDefinedAgent(storedAgent);
550
+ // Store locally for future use
551
+ this.localAgents.set(resolvedOptions.tag, agent);
552
+ // Create tool registry from stored schemas (without handlers)
553
+ toolRegistry = new tool_registry_1.ToolRegistry();
554
+ // Note: Tools from database won't have handlers - they need handlerRef or runtime registration
555
+ for (const tool of storedAgent.tools || []) {
556
+ toolRegistry.register({
557
+ tag: tool.tag,
558
+ name: tool.name,
559
+ description: tool.description,
560
+ parameters: tool.parameters,
561
+ requiresConfirmation: tool.requiresConfirmation,
562
+ costEstimate: tool.costEstimate,
563
+ timeout: tool.timeout,
564
+ retries: tool.retries,
565
+ // Handler will need to be resolved from handlerRef or provided at runtime
566
+ handler: tool.handlerRef
567
+ ? this.createHandlerFromRef(tool.handlerRef, resolvedOptions.product, resolvedOptions.env)
568
+ : async () => { throw new Error(`No handler for tool '${tool.tag}'. Provide handlerRef or register handler at runtime.`); },
569
+ });
570
+ }
571
+ this.toolRegistries.set(resolvedOptions.tag, toolRegistry);
572
+ }
573
+ if (!toolRegistry) {
574
+ throw AgentError.notFoundError(`Tool registry for agent '${resolvedOptions.tag}' not found`);
575
+ }
576
+ // Resolve model config from the model tag
577
+ const modelConfig = await productBuilder.fetchModel(agent.model);
578
+ if (!modelConfig) {
579
+ throw AgentError.notFoundError(`Model '${agent.model}' not found`);
580
+ }
581
+ // Find the env-specific config
582
+ const envConfig = modelConfig.envs.find(e => e.slug === resolvedOptions.env);
583
+ if (!envConfig) {
584
+ throw AgentError.configurationError(`Model '${agent.model}' has no configuration for environment '${resolvedOptions.env}'`);
585
+ }
586
+ // Decrypt API key using product private key, or resolve secret reference
587
+ const privateKey = productBuilder.fetchPrivateKey();
588
+ let apiKey = envConfig.apiKey;
589
+ if (apiKey) {
590
+ // Check if it's a secret reference
591
+ if ((0, secrets_1.isSecretReference)(apiKey).isSecret) {
592
+ const secretsService = (0, secrets_1.getSecretsService)();
593
+ if (secretsService) {
594
+ const resolved = await secretsService.resolve(apiKey, { env: resolvedOptions.env });
595
+ apiKey = resolved.value;
596
+ }
597
+ else {
598
+ throw AgentError.configurationError(`Model API key contains secret reference '${apiKey}' but secrets service is not initialized. ` +
599
+ `Please ensure the Ductape client is properly initialized.`);
600
+ }
601
+ }
602
+ else if (privateKey) {
603
+ // Try to decrypt if it's not a secret reference
604
+ try {
605
+ const { decrypt } = await Promise.resolve().then(() => __importStar(require('../processor/utils/processor.utils')));
606
+ apiKey = decrypt(apiKey, privateKey);
607
+ }
608
+ catch (e) {
609
+ // If decryption fails, try using the key as-is (might be unencrypted in dev)
610
+ console.warn('Failed to decrypt model API key, using as-is');
611
+ }
612
+ }
613
+ }
614
+ // Also resolve any secret references in baseUrl
615
+ let baseUrl = envConfig.baseUrl;
616
+ if (baseUrl && (0, secrets_1.isSecretReference)(baseUrl).isSecret) {
617
+ const secretsService = (0, secrets_1.getSecretsService)();
618
+ if (secretsService) {
619
+ const resolved = await secretsService.resolve(baseUrl, { env: resolvedOptions.env });
620
+ baseUrl = resolved.value;
621
+ }
622
+ else {
623
+ throw AgentError.configurationError(`Model baseUrl contains secret reference but secrets service is not initialized.`);
624
+ }
625
+ }
626
+ // Get environment-specific agent config if available
627
+ const agentEnvConfig = (_c = agent.envs) === null || _c === void 0 ? void 0 : _c.find(e => e.slug === resolvedOptions.env);
628
+ // Build the resolved LLM config with overrides
629
+ // Precedence: model entity < agent.modelConfig < agentEnvConfig.modelConfig < resolvedOptions.modelConfig
630
+ const resolvedModelConfig = {
631
+ provider: modelConfig.provider,
632
+ model: modelConfig.model,
633
+ // Start with model entity values, then apply overrides
634
+ temperature: (_j = (_g = (_e = (_d = resolvedOptions.modelConfig) === null || _d === void 0 ? void 0 : _d.temperature) !== null && _e !== void 0 ? _e : (_f = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _f === void 0 ? void 0 : _f.temperature) !== null && _g !== void 0 ? _g : (_h = agent.modelConfig) === null || _h === void 0 ? void 0 : _h.temperature) !== null && _j !== void 0 ? _j : modelConfig.temperature,
635
+ maxTokens: (_q = (_o = (_l = (_k = resolvedOptions.modelConfig) === null || _k === void 0 ? void 0 : _k.maxTokens) !== null && _l !== void 0 ? _l : (_m = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _m === void 0 ? void 0 : _m.maxTokens) !== null && _o !== void 0 ? _o : (_p = agent.modelConfig) === null || _p === void 0 ? void 0 : _p.maxTokens) !== null && _q !== void 0 ? _q : modelConfig.maxTokens,
636
+ topP: (_w = (_u = (_s = (_r = resolvedOptions.modelConfig) === null || _r === void 0 ? void 0 : _r.topP) !== null && _s !== void 0 ? _s : (_t = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _t === void 0 ? void 0 : _t.topP) !== null && _u !== void 0 ? _u : (_v = agent.modelConfig) === null || _v === void 0 ? void 0 : _v.topP) !== null && _w !== void 0 ? _w : modelConfig.topP,
637
+ stopSequences: (_2 = (_0 = (_y = (_x = resolvedOptions.modelConfig) === null || _x === void 0 ? void 0 : _x.stopSequences) !== null && _y !== void 0 ? _y : (_z = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _z === void 0 ? void 0 : _z.stopSequences) !== null && _0 !== void 0 ? _0 : (_1 = agent.modelConfig) === null || _1 === void 0 ? void 0 : _1.stopSequences) !== null && _2 !== void 0 ? _2 : modelConfig.stopSequences,
638
+ timeout: (_8 = (_6 = (_4 = (_3 = resolvedOptions.modelConfig) === null || _3 === void 0 ? void 0 : _3.timeout) !== null && _4 !== void 0 ? _4 : (_5 = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _5 === void 0 ? void 0 : _5.timeout) !== null && _6 !== void 0 ? _6 : (_7 = agent.modelConfig) === null || _7 === void 0 ? void 0 : _7.timeout) !== null && _8 !== void 0 ? _8 : modelConfig.timeout,
639
+ apiKey,
640
+ baseUrl,
641
+ };
642
+ // Create executor with resolved model config
643
+ const executor = new agent_executor_1.AgentExecutor(agent, toolRegistry, this.getContextServices(agent.resilience), resolvedOptions, (0, agent_executor_1.createLLMProvider)(resolvedModelConfig), resolvedModelConfig);
644
+ // Store executor for signal handling
645
+ const executionId = executor.getState().execution_id;
646
+ this.activeExecutors.set(executionId, executor);
647
+ // Execute agent
648
+ const result = await executor.execute();
649
+ // Cleanup
650
+ this.activeExecutors.delete(executionId);
651
+ (_9 = this.logService) === null || _9 === void 0 ? void 0 : _9.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - success', successful_execution: result.status === 'completed', failed_execution: result.status === 'failed', data: {
652
+ agent: resolvedOptions.tag,
653
+ operation: 'run',
654
+ execution_id: result.execution_id,
655
+ iterations: result.iterations,
656
+ status: result.status,
657
+ }, status: result.status === 'completed' ? logs_types_1.LogEventStatus.SUCCESS : logs_types_1.LogEventStatus.FAIL }));
658
+ (_10 = this.logService) === null || _10 === void 0 ? void 0 : _10.publish();
659
+ return result;
660
+ }
661
+ catch (error) {
662
+ (_11 = this.logService) === null || _11 === void 0 ? void 0 : _11.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - failed', failed_execution: true, data: { agent: resolvedOptions.tag, operation: 'run', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
663
+ await ((_12 = this.logService) === null || _12 === void 0 ? void 0 : _12.publish());
664
+ throw AgentError.executionError(`Failed to run agent: ${error}`, { agent: resolvedOptions.tag });
665
+ }
666
+ }
667
+ // ==================== DISPATCH (SCHEDULED EXECUTION) ====================
668
+ /**
669
+ * Dispatch an agent for scheduled or deferred execution
670
+ *
671
+ * @example
672
+ * ```ts
673
+ * const job = await ductape.agents.dispatch({
674
+ * product: 'my-product',
675
+ * env: 'production',
676
+ * agent: 'daily-report-agent',
677
+ * input: { reportType: 'daily' },
678
+ * schedule: { cron: '0 9 * * *' }, // Daily at 9 AM
679
+ * });
680
+ * ```
681
+ */
682
+ async dispatch(options) {
683
+ var _a, _b, _c, _d, _e, _f;
684
+ const process_id = (0, processor_utils_1.generateObjectId)();
685
+ const processorService = this.createNewProcessor();
686
+ const productBuilder = await this.getProductBuilder(options.product);
687
+ const schedule = options.schedule || {};
688
+ const startAt = typeof schedule.start_at === 'string'
689
+ ? new Date(schedule.start_at).getTime()
690
+ : schedule.start_at || Date.now();
691
+ const jobTag = `agent:${options.agent}`;
692
+ // Initialize logging
693
+ this.initializeLogService();
694
+ const baseLogs = {
695
+ product_tag: options.product,
696
+ workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '',
697
+ env: options.env,
698
+ process_id,
699
+ type: logs_types_1.LogEventTypes.WORKFLOW,
700
+ parent_tag: options.agent,
701
+ data: { agent: options.agent, operation: 'dispatch' },
702
+ };
703
+ (_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
704
+ try {
705
+ // Check if job exists, if not create it
706
+ const existingJob = await productBuilder.fetchJob(jobTag);
707
+ if (!existingJob) {
708
+ await productBuilder.createJob({
709
+ tag: jobTag,
710
+ name: `Agent: ${options.agent}`,
711
+ description: `Auto-created job for agent ${options.agent}`,
712
+ type: productsBuilder_types_1.JobEventTypes.ACTION, // Agent executions are actions
713
+ app: options.agent,
714
+ event: 'execute',
715
+ executions: 0,
716
+ intervals: schedule.every || 0,
717
+ start_at: startAt,
718
+ });
719
+ }
720
+ const jobInput = {
721
+ product: options.product,
722
+ env: options.env,
723
+ event: jobTag,
724
+ input: options.input,
725
+ retries: options.retries || 0,
726
+ start_at: startAt,
727
+ session: options.session,
728
+ cache: options.cache,
729
+ repeat: schedule.cron || schedule.every
730
+ ? {
731
+ cron: schedule.cron,
732
+ every: schedule.every,
733
+ limit: schedule.limit,
734
+ endDate: schedule.endDate,
735
+ tz: schedule.tz,
736
+ }
737
+ : undefined,
738
+ };
739
+ await processorService.processJob(jobInput);
740
+ const isRecurring = !!(schedule.cron || schedule.every);
741
+ let nextRunAt;
742
+ if (isRecurring && schedule.every) {
743
+ nextRunAt = startAt + schedule.every;
744
+ }
745
+ const job_id = (0, crypto_1.randomUUID)();
746
+ (_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - success', successful_execution: true, data: { agent: options.agent, operation: 'dispatch', job_id }, status: logs_types_1.LogEventStatus.SUCCESS }));
747
+ (_d = this.logService) === null || _d === void 0 ? void 0 : _d.publish();
748
+ return {
749
+ job_id,
750
+ status: startAt > Date.now() ? 'scheduled' : 'queued',
751
+ scheduled_at: startAt,
752
+ recurring: isRecurring,
753
+ next_run_at: nextRunAt,
754
+ };
755
+ }
756
+ catch (error) {
757
+ (_e = this.logService) === null || _e === void 0 ? void 0 : _e.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - failed', failed_execution: true, data: { agent: options.agent, operation: 'dispatch', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
758
+ await ((_f = this.logService) === null || _f === void 0 ? void 0 : _f.publish());
759
+ throw error;
760
+ }
761
+ }
762
+ // ==================== SIGNALS ====================
763
+ /**
764
+ * Send a signal to a running agent
765
+ *
766
+ * @example
767
+ * ```ts
768
+ * // Stop an agent
769
+ * await ductape.agents.signal({
770
+ * product: 'my-product',
771
+ * env: 'production',
772
+ * execution_id: 'exec-123',
773
+ * signal: 'stop',
774
+ * });
775
+ *
776
+ * // Approve a tool call
777
+ * await ductape.agents.signal({
778
+ * product: 'my-product',
779
+ * env: 'production',
780
+ * execution_id: 'exec-123',
781
+ * signal: 'approve',
782
+ * payload: { toolCallId: 'tc-456' },
783
+ * });
784
+ * ```
785
+ */
786
+ async signal(options) {
787
+ const executor = this.activeExecutors.get(options.execution_id);
788
+ if (!executor) {
789
+ throw AgentError.notFoundError(`Agent execution '${options.execution_id}' not found or not active`);
790
+ }
791
+ switch (options.signal) {
792
+ case 'stop':
793
+ executor.handleStop();
794
+ break;
795
+ case 'pause':
796
+ executor.handlePause();
797
+ break;
798
+ case 'resume':
799
+ executor.handleResume();
800
+ break;
801
+ case 'approve':
802
+ executor.handleApproval(true, options.payload);
803
+ break;
804
+ case 'reject':
805
+ executor.handleApproval(false);
806
+ break;
807
+ default:
808
+ throw AgentError.validationError(`Unknown signal: ${options.signal}`);
809
+ }
810
+ }
811
+ // ==================== STATUS ====================
812
+ /**
813
+ * Get the status of an agent execution
814
+ *
815
+ * @example
816
+ * ```ts
817
+ * const status = await ductape.agents.status({
818
+ * product: 'my-product',
819
+ * env: 'production',
820
+ * execution_id: 'exec-123',
821
+ * });
822
+ * ```
823
+ */
824
+ async status(options) {
825
+ const executor = this.activeExecutors.get(options.execution_id);
826
+ if (!executor) {
827
+ // Could query from database for completed executions
828
+ return null;
829
+ }
830
+ return executor.getState();
831
+ }
832
+ /**
833
+ * List agent executions
834
+ *
835
+ * @example
836
+ * ```ts
837
+ * const executions = await ductape.agents.list({
838
+ * product: 'my-product',
839
+ * env: 'production',
840
+ * agent: 'customer-support',
841
+ * status: 'completed',
842
+ * limit: 10,
843
+ * });
844
+ * ```
845
+ */
846
+ async list(options) {
847
+ // For now, return active executions
848
+ // In production, would query from database
849
+ const executions = [];
850
+ for (const [executionId, executor] of this.activeExecutors) {
851
+ const state = executor.getState();
852
+ // Apply filters
853
+ if (options.agent && state.agent_tag !== options.agent) {
854
+ continue;
855
+ }
856
+ if (options.status) {
857
+ const statuses = Array.isArray(options.status) ? options.status : [options.status];
858
+ if (!statuses.includes(state.status)) {
859
+ continue;
860
+ }
861
+ }
862
+ executions.push({
863
+ execution_id: state.execution_id,
864
+ agent_tag: state.agent_tag,
865
+ status: state.status,
866
+ startedAt: state.startedAt,
867
+ completedAt: state.status !== 'running' ? state.updatedAt : undefined,
868
+ iterations: state.iteration,
869
+ usage: state.usage,
870
+ });
871
+ }
872
+ // Pagination
873
+ const page = options.page || 1;
874
+ const limit = options.limit || 10;
875
+ const start = (page - 1) * limit;
876
+ const paginatedExecutions = executions.slice(start, start + limit);
877
+ return {
878
+ executions: paginatedExecutions,
879
+ total: executions.length,
880
+ page,
881
+ limit,
882
+ };
883
+ }
884
+ // ==================== TOOL MANAGEMENT ====================
885
+ /**
886
+ * Add a tool to an agent
887
+ *
888
+ * @example
889
+ * ```ts
890
+ * await ductape.agents.addTool('customer-support', {
891
+ * tag: 'new-tool',
892
+ * description: 'A new tool',
893
+ * parameters: { ... },
894
+ * handler: async (ctx, params) => { ... },
895
+ * });
896
+ * ```
897
+ */
898
+ addTool(agentTag, tool) {
899
+ const registry = this.toolRegistries.get(agentTag);
900
+ if (!registry) {
901
+ throw AgentError.notFoundError(`Agent '${agentTag}' not found`);
902
+ }
903
+ registry.register(tool);
904
+ // Update agent definition
905
+ const agent = this.localAgents.get(agentTag);
906
+ if (agent) {
907
+ agent.toolSchemas = registry.getSchemas();
908
+ }
909
+ }
910
+ /**
911
+ * Remove a tool from an agent
912
+ */
913
+ removeTool(agentTag, toolTag) {
914
+ const registry = this.toolRegistries.get(agentTag);
915
+ if (!registry) {
916
+ return false;
917
+ }
918
+ const removed = registry.unregister(toolTag);
919
+ // Update agent definition
920
+ if (removed) {
921
+ const agent = this.localAgents.get(agentTag);
922
+ if (agent) {
923
+ agent.toolSchemas = registry.getSchemas();
924
+ }
925
+ }
926
+ return removed;
927
+ }
928
+ /**
929
+ * Get tools for an agent
930
+ */
931
+ getTools(agentTag) {
932
+ const registry = this.toolRegistries.get(agentTag);
933
+ if (!registry) {
934
+ return [];
935
+ }
936
+ return registry.getSchemas();
937
+ }
938
+ // ==================== AGENT AS TOOL ====================
939
+ /**
940
+ * Convert an agent into a tool that can be used by another agent
941
+ *
942
+ * This enables multi-agent orchestration where a "manager" agent can
943
+ * delegate tasks to specialized agents.
944
+ *
945
+ * @example
946
+ * ```ts
947
+ * // Define specialized agents
948
+ * const researchAgent = await ductape.agents.define({
949
+ * tag: 'research-agent',
950
+ * name: 'Research Agent',
951
+ * // ...
952
+ * });
953
+ *
954
+ * const writerAgent = await ductape.agents.define({
955
+ * tag: 'writer-agent',
956
+ * name: 'Writer Agent',
957
+ * // ...
958
+ * });
959
+ *
960
+ * // Create a manager agent that can delegate to specialists
961
+ * const managerAgent = await ductape.agents.define({
962
+ * tag: 'manager-agent',
963
+ * name: 'Project Manager',
964
+ * tools: [
965
+ * ductape.agents.asTool({
966
+ * agentTag: 'research-agent',
967
+ * product: 'my-product',
968
+ * options: {
969
+ * toolDescription: 'Delegate research tasks to the research specialist',
970
+ * },
971
+ * }),
972
+ * ductape.agents.asTool({
973
+ * agentTag: 'writer-agent',
974
+ * product: 'my-product',
975
+ * options: {
976
+ * toolDescription: 'Delegate writing tasks to the writing specialist',
977
+ * },
978
+ * }),
979
+ * ],
980
+ * });
981
+ * ```
982
+ */
983
+ asTool(definition) {
984
+ const { agentTag, product, env, options = {} } = definition;
985
+ // Get the agent definition to extract metadata
986
+ const agent = this.localAgents.get(agentTag);
987
+ // Build input schema - either from options or use a generic input schema
988
+ const inputSchema = options.inputSchema || {
989
+ task: {
990
+ type: 'string',
991
+ description: 'The task or instruction to give to the agent',
992
+ required: true,
993
+ },
994
+ context: {
995
+ type: 'object',
996
+ description: 'Additional context or data to pass to the agent',
997
+ },
998
+ };
999
+ // Create the tool
1000
+ const tool = {
1001
+ tag: options.toolTag || `agent:${agentTag}`,
1002
+ name: options.toolName || (agent === null || agent === void 0 ? void 0 : agent.name) || agentTag,
1003
+ description: options.toolDescription ||
1004
+ (agent === null || agent === void 0 ? void 0 : agent.description) ||
1005
+ `Delegate task to the ${agentTag} agent`,
1006
+ parameters: inputSchema,
1007
+ requiresConfirmation: options.requiresConfirmation,
1008
+ timeout: options.timeout,
1009
+ retries: options.retries,
1010
+ handler: async (ctx, params) => {
1011
+ var _a;
1012
+ // Transform input if transformer provided
1013
+ const input = options.inputTransform
1014
+ ? options.inputTransform(params)
1015
+ : params;
1016
+ // Build the input message for the sub-agent
1017
+ const inputMessage = typeof input === 'string'
1018
+ ? input
1019
+ : input.task ||
1020
+ JSON.stringify(input);
1021
+ // Run the sub-agent
1022
+ // When delegating to sub-agent, append agent tag to session for traceability
1023
+ const subAgentSession = ctx.session ? `${ctx.session}:${agentTag}` : undefined;
1024
+ const result = await this.run({
1025
+ product,
1026
+ env: env || ctx.env,
1027
+ tag: agentTag,
1028
+ input: typeof inputMessage === 'string' ? { message: inputMessage } : inputMessage,
1029
+ session: subAgentSession,
1030
+ });
1031
+ // Transform output if transformer provided
1032
+ if (options.outputTransform) {
1033
+ return options.outputTransform(result);
1034
+ }
1035
+ // Return full details or just output based on options
1036
+ if (options.includeDetails) {
1037
+ return {
1038
+ agent: agentTag,
1039
+ status: result.status,
1040
+ output: result.output,
1041
+ iterations: result.iterations,
1042
+ toolCalls: (_a = result.toolCalls) === null || _a === void 0 ? void 0 : _a.map((tc) => ({
1043
+ tool: tc.tool,
1044
+ success: tc.success,
1045
+ })),
1046
+ executionTime: result.executionTime,
1047
+ };
1048
+ }
1049
+ // Default: return just the output
1050
+ return result.output;
1051
+ },
1052
+ };
1053
+ return tool;
1054
+ }
1055
+ /**
1056
+ * Create an agent tool from a handlerRef string
1057
+ *
1058
+ * @example
1059
+ * ```ts
1060
+ * // In tool definition
1061
+ * {
1062
+ * tag: 'delegate-research',
1063
+ * handlerRef: 'agent:research-agent',
1064
+ * }
1065
+ * ```
1066
+ */
1067
+ createAgentToolFromRef(handlerRef, product, env) {
1068
+ // Parse handlerRef: "agent:agent-tag" or "agent:agent-tag:options"
1069
+ const parts = handlerRef.split(':');
1070
+ if (parts[0] !== 'agent') {
1071
+ throw AgentError.validationError(`Invalid agent handlerRef format: ${handlerRef}. Expected "agent:agent-tag"`);
1072
+ }
1073
+ const agentTag = parts[1];
1074
+ return async (ctx, params) => {
1075
+ const input = typeof params === 'string'
1076
+ ? params
1077
+ : params.task || JSON.stringify(params);
1078
+ // When delegating to sub-agent, append agent tag to session for traceability
1079
+ const subAgentSession = ctx.session ? `${ctx.session}:${agentTag}` : undefined;
1080
+ const result = await this.run({
1081
+ product,
1082
+ env,
1083
+ tag: agentTag,
1084
+ input: typeof input === 'string' ? { message: input } : input,
1085
+ session: subAgentSession,
1086
+ });
1087
+ return result.output;
1088
+ };
1089
+ }
1090
+ // ==================== UTILITIES ====================
1091
+ /**
1092
+ * Get a defined agent by tag
1093
+ */
1094
+ getAgent(tag) {
1095
+ return this.localAgents.get(tag);
1096
+ }
1097
+ /**
1098
+ * List all defined agents
1099
+ */
1100
+ listAgents() {
1101
+ return Array.from(this.localAgents.values());
1102
+ }
1103
+ /**
1104
+ * Delete an agent definition
1105
+ */
1106
+ deleteAgent(tag) {
1107
+ this.toolRegistries.delete(tag);
1108
+ return this.localAgents.delete(tag);
1109
+ }
1110
+ /**
1111
+ * Clear all agent definitions
1112
+ */
1113
+ clearAll() {
1114
+ this.localAgents.clear();
1115
+ this.toolRegistries.clear();
1116
+ this.activeExecutors.clear();
1117
+ }
1118
+ // ==================== PRIVATE HELPERS ====================
1119
+ /**
1120
+ * Convert a stored IProductAgent to IDefinedAgent format
1121
+ */
1122
+ convertProductAgentToDefinedAgent(storedAgent) {
1123
+ var _a;
1124
+ return {
1125
+ tag: storedAgent.tag,
1126
+ name: storedAgent.name,
1127
+ description: storedAgent.description,
1128
+ model: storedAgent.model, // Model tag reference - resolved at runtime
1129
+ modelConfig: storedAgent.modelConfig,
1130
+ systemPrompt: storedAgent.systemPrompt,
1131
+ toolSchemas: (storedAgent.tools || []).map((tool) => ({
1132
+ tag: tool.tag,
1133
+ name: tool.name,
1134
+ description: tool.description,
1135
+ parameters: tool.parameters,
1136
+ requiresConfirmation: tool.requiresConfirmation,
1137
+ costEstimate: tool.costEstimate,
1138
+ timeout: tool.timeout,
1139
+ retries: tool.retries,
1140
+ })),
1141
+ termination: storedAgent.termination ? {
1142
+ maxIterations: storedAgent.termination.maxIterations,
1143
+ maxTokens: storedAgent.termination.maxTokens,
1144
+ timeout: storedAgent.termination.timeout,
1145
+ allowManualStop: storedAgent.termination.allowManualStop,
1146
+ } : undefined,
1147
+ memory: storedAgent.memory ? {
1148
+ shortTerm: storedAgent.memory.shortTerm,
1149
+ longTerm: storedAgent.memory.longTerm,
1150
+ } : undefined,
1151
+ humanInLoop: storedAgent.humanInLoop ? {
1152
+ enabled: storedAgent.humanInLoop.enabled,
1153
+ alwaysRequireApproval: storedAgent.humanInLoop.alwaysRequireApproval,
1154
+ approvalTimeout: storedAgent.humanInLoop.approvalTimeout,
1155
+ approvalWebhook: storedAgent.humanInLoop.approvalWebhook,
1156
+ approvalBroker: storedAgent.humanInLoop.approvalBroker,
1157
+ } : undefined,
1158
+ streaming: storedAgent.streaming ? {
1159
+ enabled: storedAgent.streaming.enabled,
1160
+ events: storedAgent.streaming.events,
1161
+ webhook: storedAgent.streaming.webhook,
1162
+ broker: storedAgent.streaming.broker,
1163
+ } : undefined,
1164
+ inputSchema: storedAgent.inputSchema,
1165
+ envs: (_a = storedAgent.envs) === null || _a === void 0 ? void 0 : _a.map((env) => ({
1166
+ slug: env.slug,
1167
+ active: env.active,
1168
+ model: env.model, // Model tag override - resolved at runtime
1169
+ modelConfig: env.modelConfig,
1170
+ toolOverrides: env.toolOverrides,
1171
+ })),
1172
+ resilience: storedAgent.resilience,
1173
+ };
1174
+ }
1175
+ /**
1176
+ * Create a handler function from a handlerRef string
1177
+ * Format: "type:tag:event" (e.g., "action:payment-app:process-payment", "feature:checkout-flow")
1178
+ */
1179
+ createHandlerFromRef(handlerRef, product, env) {
1180
+ const parts = handlerRef.split(':');
1181
+ const type = parts[0];
1182
+ const tag = parts[1];
1183
+ const event = parts[2];
1184
+ return async (ctx, params) => {
1185
+ switch (type) {
1186
+ case 'action':
1187
+ return ctx.action.run({
1188
+ app: tag,
1189
+ event,
1190
+ input: params,
1191
+ });
1192
+ case 'feature':
1193
+ return ctx.feature.run({
1194
+ feature: tag,
1195
+ input: params,
1196
+ });
1197
+ case 'database':
1198
+ return ctx.database.execute({
1199
+ database: tag,
1200
+ event,
1201
+ input: params,
1202
+ });
1203
+ case 'graph':
1204
+ return ctx.graph.execute({
1205
+ graph: tag,
1206
+ action: event,
1207
+ input: params,
1208
+ });
1209
+ case 'storage':
1210
+ return ctx.storage.upload({
1211
+ storage: tag,
1212
+ event,
1213
+ input: params,
1214
+ });
1215
+ case 'notification':
1216
+ await ctx.notification.send({
1217
+ notification: tag,
1218
+ event,
1219
+ input: params,
1220
+ });
1221
+ return { success: true };
1222
+ case 'publish':
1223
+ await ctx.messaging.produce({
1224
+ event: `${tag}:${event}`,
1225
+ message: (params || {}),
1226
+ });
1227
+ return { success: true };
1228
+ case 'agent':
1229
+ // Delegate to another agent
1230
+ // Format: "agent:agent-tag"
1231
+ const input = typeof params === 'string'
1232
+ ? params
1233
+ : params.task || JSON.stringify(params);
1234
+ // When delegating to sub-agent, append agent tag to session for traceability
1235
+ const subAgentSession = ctx.session ? `${ctx.session}:${tag}` : undefined;
1236
+ const result = await this.run({
1237
+ product,
1238
+ env,
1239
+ tag,
1240
+ input: typeof input === 'string' ? { message: input } : input,
1241
+ session: subAgentSession,
1242
+ });
1243
+ return result.output;
1244
+ default:
1245
+ throw new Error(`Unknown handler type: ${type}`);
1246
+ }
1247
+ };
1248
+ }
1249
+ }
1250
+ exports.AgentsService = AgentsService;
1251
+ // Export singleton instance for convenience
1252
+ exports.agentsService = new AgentsService();
1253
+ // Default export
1254
+ exports.default = AgentsService;
1255
+ //# sourceMappingURL=agents.service.js.map