openloops 0.1.9 → 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 (464) hide show
  1. package/dist/chunk-XRJFNASX.mjs +14 -0
  2. package/dist/common/clients/index.d.ts +3 -0
  3. package/dist/common/clients/index.js +26 -0
  4. package/dist/common/clients/index.mjs +3 -0
  5. package/dist/common/clients/llm-client.d.ts +30 -0
  6. package/dist/common/clients/llm-client.js +159 -0
  7. package/dist/common/clients/llm-client.mjs +126 -0
  8. package/dist/common/clients/sentry-client.d.ts +10 -0
  9. package/dist/common/clients/sentry-client.js +87 -0
  10. package/dist/common/clients/sentry-client.mjs +53 -0
  11. package/dist/common/clients/serper-client.d.ts +66 -0
  12. package/dist/common/clients/serper-client.js +74 -0
  13. package/dist/common/clients/serper-client.mjs +41 -0
  14. package/dist/common/core/base.app.d.ts +12 -0
  15. package/dist/common/core/base.app.js +57 -0
  16. package/dist/common/core/base.app.mjs +34 -0
  17. package/dist/common/core/base.entity.d.ts +55 -0
  18. package/dist/common/core/base.entity.js +208 -0
  19. package/dist/common/core/base.entity.mjs +179 -0
  20. package/dist/common/core/base.use-case.d.ts +15 -0
  21. package/dist/common/core/base.use-case.js +30 -0
  22. package/dist/common/core/base.use-case.mjs +7 -0
  23. package/dist/common/core/index.d.ts +1 -0
  24. package/dist/common/core/index.js +1 -0
  25. package/dist/common/core/index.mjs +0 -0
  26. package/dist/common/core/utils/delete-empty-fields.d.ts +1 -0
  27. package/dist/common/core/utils/delete-empty-fields.js +66 -0
  28. package/dist/common/core/utils/delete-empty-fields.mjs +43 -0
  29. package/dist/common/core/utils/flatten-object.d.ts +1 -0
  30. package/dist/common/core/utils/flatten-object.js +45 -0
  31. package/dist/common/core/utils/flatten-object.mjs +22 -0
  32. package/dist/common/core/utils/index.d.ts +3 -0
  33. package/dist/common/core/utils/index.js +26 -0
  34. package/dist/common/core/utils/index.mjs +3 -0
  35. package/dist/common/core/utils/is-plain-object.d.ts +1 -0
  36. package/dist/common/core/utils/is-plain-object.js +32 -0
  37. package/dist/common/core/utils/is-plain-object.mjs +9 -0
  38. package/dist/common/decorators/admin-only/admin-only.d.ts +2 -0
  39. package/dist/common/decorators/admin-only/admin-only.js +52 -0
  40. package/dist/common/decorators/admin-only/admin-only.mjs +28 -0
  41. package/dist/common/decorators/admin-only/index.d.ts +1 -0
  42. package/dist/common/decorators/admin-only/index.js +22 -0
  43. package/dist/common/decorators/admin-only/index.mjs +1 -0
  44. package/dist/common/decorators/index.d.ts +3 -0
  45. package/dist/common/decorators/index.js +26 -0
  46. package/dist/common/decorators/index.mjs +3 -0
  47. package/dist/common/decorators/mask-in-logs/index.d.ts +1 -0
  48. package/dist/common/decorators/mask-in-logs/index.js +22 -0
  49. package/dist/common/decorators/mask-in-logs/index.mjs +1 -0
  50. package/dist/common/decorators/mask-in-logs/mask-in-logs.d.ts +2 -0
  51. package/dist/common/decorators/mask-in-logs/mask-in-logs.js +53 -0
  52. package/dist/common/decorators/mask-in-logs/mask-in-logs.mjs +29 -0
  53. package/dist/common/decorators/owner-only/index.d.ts +1 -0
  54. package/dist/common/decorators/owner-only/index.js +22 -0
  55. package/dist/common/decorators/owner-only/index.mjs +1 -0
  56. package/dist/common/decorators/owner-only/owner-only.d.ts +2 -0
  57. package/dist/common/decorators/owner-only/owner-only.js +52 -0
  58. package/dist/common/decorators/owner-only/owner-only.mjs +28 -0
  59. package/dist/common/error/http-error.d.ts +11 -0
  60. package/dist/common/error/http-error.js +37 -0
  61. package/dist/common/error/http-error.mjs +14 -0
  62. package/dist/common/error/index.d.ts +2 -0
  63. package/dist/common/error/index.js +24 -0
  64. package/dist/common/error/index.mjs +2 -0
  65. package/dist/common/error/reportError.d.ts +2 -0
  66. package/dist/common/error/reportError.js +51 -0
  67. package/dist/common/error/reportError.mjs +28 -0
  68. package/dist/common/helpers/extract-json-from-text.d.ts +1 -0
  69. package/dist/common/helpers/extract-json-from-text.js +63 -0
  70. package/dist/common/helpers/extract-json-from-text.mjs +40 -0
  71. package/dist/common/helpers/index.d.ts +2 -0
  72. package/dist/common/helpers/index.js +24 -0
  73. package/dist/common/helpers/index.mjs +2 -0
  74. package/dist/common/helpers/sanitize-string.d.ts +1 -0
  75. package/dist/common/helpers/sanitize-string.js +45 -0
  76. package/dist/common/helpers/sanitize-string.mjs +12 -0
  77. package/dist/common/logger/index.d.ts +1 -0
  78. package/dist/common/logger/index.js +22 -0
  79. package/dist/common/logger/index.mjs +1 -0
  80. package/dist/common/logger/pino.d.ts +12 -0
  81. package/dist/common/logger/pino.js +70 -0
  82. package/dist/common/logger/pino.mjs +36 -0
  83. package/dist/common/repositories/index.d.ts +2 -0
  84. package/dist/common/repositories/index.js +24 -0
  85. package/dist/common/repositories/index.mjs +2 -0
  86. package/dist/common/repositories/mongo-db.client.d.ts +11 -0
  87. package/dist/common/repositories/mongo-db.client.js +79 -0
  88. package/dist/common/repositories/mongo-db.client.mjs +57 -0
  89. package/dist/common/repositories/mongo-db.repository.d.ts +87 -0
  90. package/dist/common/repositories/mongo-db.repository.js +219 -0
  91. package/dist/common/repositories/mongo-db.repository.mjs +196 -0
  92. package/dist/common/utils/secret-manager.d.ts +15 -0
  93. package/dist/common/utils/secret-manager.js +105 -0
  94. package/dist/common/utils/secret-manager.mjs +71 -0
  95. package/dist/index.d.ts +1 -10
  96. package/dist/index.js +22 -7
  97. package/dist/index.mjs +1 -1
  98. package/dist/services/agent/core/agent-loop.d.ts +38 -0
  99. package/dist/services/agent/core/agent-loop.js +29 -0
  100. package/dist/services/agent/core/agent-loop.mjs +6 -0
  101. package/dist/services/agent/core/agent-state.d.ts +42 -0
  102. package/dist/services/agent/core/agent-state.js +102 -0
  103. package/dist/services/agent/core/agent-state.mjs +78 -0
  104. package/dist/services/agent/core/agent.d.ts +70 -0
  105. package/dist/services/agent/core/agent.js +351 -0
  106. package/dist/services/agent/core/agent.mjs +327 -0
  107. package/dist/services/agent/core/index.d.ts +3 -122
  108. package/dist/services/agent/core/index.js +26 -7
  109. package/dist/services/agent/core/index.mjs +3 -1
  110. package/dist/services/agent/loops/index.d.ts +2 -116
  111. package/dist/services/agent/loops/index.js +24 -10
  112. package/dist/services/agent/loops/index.mjs +2 -4
  113. package/dist/services/agent/loops/plan-execute/index.d.ts +1 -0
  114. package/dist/services/agent/loops/plan-execute/index.js +22 -0
  115. package/dist/services/agent/loops/plan-execute/index.mjs +1 -0
  116. package/dist/services/agent/loops/plan-execute/plan-execute-loop.d.ts +27 -0
  117. package/dist/services/agent/loops/plan-execute/plan-execute-loop.js +242 -0
  118. package/dist/services/agent/loops/plan-execute/plan-execute-loop.mjs +226 -0
  119. package/dist/services/agent/loops/shared/index.d.ts +1 -0
  120. package/dist/services/agent/loops/shared/index.js +22 -0
  121. package/dist/services/agent/loops/shared/index.mjs +1 -0
  122. package/dist/services/agent/loops/shared/skills/action-planner.d.ts +35 -0
  123. package/dist/services/agent/loops/shared/skills/action-planner.js +68 -0
  124. package/dist/services/agent/loops/shared/skills/action-planner.mjs +45 -0
  125. package/dist/services/agent/loops/shared/skills/confirmation-gate.d.ts +9 -0
  126. package/dist/services/agent/loops/shared/skills/confirmation-gate.js +53 -0
  127. package/dist/services/agent/loops/shared/skills/confirmation-gate.mjs +30 -0
  128. package/dist/services/agent/loops/shared/skills/fast-responder.d.ts +9 -0
  129. package/dist/services/agent/loops/shared/skills/fast-responder.js +70 -0
  130. package/dist/services/agent/loops/shared/skills/fast-responder.mjs +47 -0
  131. package/dist/services/agent/loops/shared/skills/final-responder.d.ts +7 -0
  132. package/dist/services/agent/loops/shared/skills/final-responder.js +57 -0
  133. package/dist/services/agent/loops/shared/skills/final-responder.mjs +34 -0
  134. package/dist/services/agent/loops/shared/skills/index.d.ts +6 -0
  135. package/dist/services/agent/loops/shared/skills/index.js +32 -0
  136. package/dist/services/agent/loops/shared/skills/index.mjs +6 -0
  137. package/dist/services/agent/loops/shared/skills/state-observer.d.ts +10 -0
  138. package/dist/services/agent/loops/shared/skills/state-observer.js +57 -0
  139. package/dist/services/agent/loops/shared/skills/state-observer.mjs +34 -0
  140. package/dist/services/agent/loops/shared/skills/strategy-engine.d.ts +15 -0
  141. package/dist/services/agent/loops/shared/skills/strategy-engine.js +60 -0
  142. package/dist/services/agent/loops/shared/skills/strategy-engine.mjs +37 -0
  143. package/dist/services/agent/modules/chats/entities/agent-action.entity.d.ts +58 -0
  144. package/dist/services/agent/modules/chats/entities/agent-action.entity.js +151 -0
  145. package/dist/services/agent/modules/chats/entities/agent-action.entity.mjs +128 -0
  146. package/dist/services/agent/modules/chats/entities/agent-task.entity.d.ts +59 -0
  147. package/dist/services/agent/modules/chats/entities/agent-task.entity.js +231 -0
  148. package/dist/services/agent/modules/chats/entities/agent-task.entity.mjs +207 -0
  149. package/dist/services/agent/modules/chats/entities/chat-context.entity.d.ts +39 -0
  150. package/dist/services/agent/modules/chats/entities/chat-context.entity.js +70 -0
  151. package/dist/services/agent/modules/chats/entities/chat-context.entity.mjs +47 -0
  152. package/dist/services/agent/modules/chats/entities/chat-message.entity.d.ts +16 -0
  153. package/dist/services/agent/modules/chats/entities/chat-message.entity.js +58 -0
  154. package/dist/services/agent/modules/chats/entities/chat-message.entity.mjs +35 -0
  155. package/dist/services/agent/modules/chats/entities/chat-settings.entity.d.ts +17 -0
  156. package/dist/services/agent/modules/chats/entities/chat-settings.entity.js +63 -0
  157. package/dist/services/agent/modules/chats/entities/chat-settings.entity.mjs +40 -0
  158. package/dist/services/agent/modules/chats/entities/chat.entity.d.ts +50 -0
  159. package/dist/services/agent/modules/chats/entities/chat.entity.js +163 -0
  160. package/dist/services/agent/modules/chats/entities/chat.entity.mjs +140 -0
  161. package/dist/services/agent/modules/chats/entities/index.d.ts +1 -0
  162. package/dist/services/agent/modules/chats/entities/index.js +22 -0
  163. package/dist/services/agent/modules/chats/entities/index.mjs +1 -0
  164. package/dist/services/agent/modules/chats/lambdas/create-chat/create-chat.use-case.d.ts +14 -0
  165. package/dist/services/agent/modules/chats/lambdas/create-chat/create-chat.use-case.js +56 -0
  166. package/dist/services/agent/modules/chats/lambdas/create-chat/create-chat.use-case.mjs +27 -0
  167. package/dist/services/agent/modules/chats/lambdas/create-chat/index.d.ts +1 -0
  168. package/dist/services/agent/modules/chats/lambdas/create-chat/index.js +22 -0
  169. package/dist/services/agent/modules/chats/lambdas/create-chat/index.mjs +1 -0
  170. package/dist/services/agent/modules/chats/lambdas/delete-chat/delete-chat.use-case.d.ts +15 -0
  171. package/dist/services/agent/modules/chats/lambdas/delete-chat/delete-chat.use-case.js +61 -0
  172. package/dist/services/agent/modules/chats/lambdas/delete-chat/delete-chat.use-case.mjs +32 -0
  173. package/dist/services/agent/modules/chats/lambdas/delete-chat/index.d.ts +1 -0
  174. package/dist/services/agent/modules/chats/lambdas/delete-chat/index.js +22 -0
  175. package/dist/services/agent/modules/chats/lambdas/delete-chat/index.mjs +1 -0
  176. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/get-chat-by-id.use-case.d.ts +14 -0
  177. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/get-chat-by-id.use-case.js +52 -0
  178. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/get-chat-by-id.use-case.mjs +23 -0
  179. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/index.d.ts +1 -0
  180. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/index.js +22 -0
  181. package/dist/services/agent/modules/chats/lambdas/get-chat-by-id/index.mjs +1 -0
  182. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/index.d.ts +1 -0
  183. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/index.js +22 -0
  184. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/index.mjs +1 -0
  185. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/interrupt-execution.use-case.d.ts +14 -0
  186. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/interrupt-execution.use-case.js +64 -0
  187. package/dist/services/agent/modules/chats/lambdas/interrupt-execution/interrupt-execution.use-case.mjs +35 -0
  188. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/index.d.ts +1 -0
  189. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/index.js +22 -0
  190. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/index.mjs +1 -0
  191. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/list-chats-by-props.use-case.d.ts +16 -0
  192. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/list-chats-by-props.use-case.js +52 -0
  193. package/dist/services/agent/modules/chats/lambdas/list-chats-by-props/list-chats-by-props.use-case.mjs +23 -0
  194. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/index.d.ts +1 -0
  195. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/index.js +22 -0
  196. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/index.mjs +1 -0
  197. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/list-chats-by-user.use-case.d.ts +16 -0
  198. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/list-chats-by-user.use-case.js +59 -0
  199. package/dist/services/agent/modules/chats/lambdas/list-chats-by-user/list-chats-by-user.use-case.mjs +30 -0
  200. package/dist/services/agent/modules/chats/lambdas/update-chat/index.d.ts +1 -0
  201. package/dist/services/agent/modules/chats/lambdas/update-chat/index.js +22 -0
  202. package/dist/services/agent/modules/chats/lambdas/update-chat/index.mjs +1 -0
  203. package/dist/services/agent/modules/chats/lambdas/update-chat/update-chat.use-case.d.ts +15 -0
  204. package/dist/services/agent/modules/chats/lambdas/update-chat/update-chat.use-case.js +64 -0
  205. package/dist/services/agent/modules/chats/lambdas/update-chat/update-chat.use-case.mjs +35 -0
  206. package/dist/services/agent/modules/chats/repositories/chat.repository.d.ts +10 -0
  207. package/dist/services/agent/modules/chats/repositories/chat.repository.js +67 -0
  208. package/dist/services/agent/modules/chats/repositories/chat.repository.mjs +38 -0
  209. package/dist/services/agent/modules/chats/repositories/index.d.ts +1 -0
  210. package/dist/services/agent/modules/chats/repositories/index.js +22 -0
  211. package/dist/services/agent/modules/chats/repositories/index.mjs +1 -0
  212. package/dist/services/agent/modules/llmcalls/entities/index.d.ts +1 -0
  213. package/dist/services/agent/modules/llmcalls/entities/index.js +22 -0
  214. package/dist/services/agent/modules/llmcalls/entities/index.mjs +1 -0
  215. package/dist/services/agent/modules/llmcalls/entities/llmcall.entity.d.ts +23 -0
  216. package/dist/services/agent/modules/llmcalls/entities/llmcall.entity.js +71 -0
  217. package/dist/services/agent/modules/llmcalls/entities/llmcall.entity.mjs +48 -0
  218. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/create-llmcall.use-case.d.ts +14 -0
  219. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/create-llmcall.use-case.js +56 -0
  220. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/create-llmcall.use-case.mjs +27 -0
  221. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/index.d.ts +1 -0
  222. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/index.js +22 -0
  223. package/dist/services/agent/modules/llmcalls/lambdas/create-llmcall/index.mjs +1 -0
  224. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/delete-llmcall.use-case.d.ts +15 -0
  225. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/delete-llmcall.use-case.js +61 -0
  226. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/delete-llmcall.use-case.mjs +32 -0
  227. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/index.d.ts +1 -0
  228. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/index.js +22 -0
  229. package/dist/services/agent/modules/llmcalls/lambdas/delete-llmcall/index.mjs +1 -0
  230. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/get-llm-usage.use-case.d.ts +21 -0
  231. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/get-llm-usage.use-case.js +123 -0
  232. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/get-llm-usage.use-case.mjs +94 -0
  233. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/index.d.ts +1 -0
  234. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/index.js +22 -0
  235. package/dist/services/agent/modules/llmcalls/lambdas/get-llm-usage/index.mjs +1 -0
  236. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/get-llmcall-by-id.use-case.d.ts +14 -0
  237. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/get-llmcall-by-id.use-case.js +52 -0
  238. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/get-llmcall-by-id.use-case.mjs +23 -0
  239. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/index.d.ts +1 -0
  240. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/index.js +22 -0
  241. package/dist/services/agent/modules/llmcalls/lambdas/get-llmcall-by-id/index.mjs +1 -0
  242. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/index.d.ts +1 -0
  243. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/index.js +22 -0
  244. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/index.mjs +1 -0
  245. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/list-llmcalls-by-props.use-case.d.ts +16 -0
  246. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/list-llmcalls-by-props.use-case.js +52 -0
  247. package/dist/services/agent/modules/llmcalls/lambdas/list-llmcalls-by-props/list-llmcalls-by-props.use-case.mjs +23 -0
  248. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/index.d.ts +1 -0
  249. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/index.js +22 -0
  250. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/index.mjs +1 -0
  251. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/update-llmcall.use-case.d.ts +15 -0
  252. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/update-llmcall.use-case.js +62 -0
  253. package/dist/services/agent/modules/llmcalls/lambdas/update-llmcall/update-llmcall.use-case.mjs +33 -0
  254. package/dist/services/agent/modules/llmcalls/repositories/index.d.ts +1 -0
  255. package/dist/services/agent/modules/llmcalls/repositories/index.js +22 -0
  256. package/dist/services/agent/modules/llmcalls/repositories/index.mjs +1 -0
  257. package/dist/services/agent/modules/llmcalls/repositories/llmcall.repository.d.ts +10 -0
  258. package/dist/services/agent/modules/llmcalls/repositories/llmcall.repository.js +67 -0
  259. package/dist/services/agent/modules/llmcalls/repositories/llmcall.repository.mjs +38 -0
  260. package/dist/services/agent/modules/mcp-servers/entities/index.d.ts +1 -0
  261. package/dist/services/agent/modules/mcp-servers/entities/index.js +22 -0
  262. package/dist/services/agent/modules/mcp-servers/entities/index.mjs +1 -0
  263. package/dist/services/agent/modules/mcp-servers/entities/mcpserver.entity.d.ts +23 -0
  264. package/dist/services/agent/modules/mcp-servers/entities/mcpserver.entity.js +79 -0
  265. package/dist/services/agent/modules/mcp-servers/entities/mcpserver.entity.mjs +56 -0
  266. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/create-mcpserver.use-case.d.ts +14 -0
  267. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/create-mcpserver.use-case.js +56 -0
  268. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/create-mcpserver.use-case.mjs +27 -0
  269. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/index.d.ts +1 -0
  270. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/index.js +22 -0
  271. package/dist/services/agent/modules/mcp-servers/lambdas/create-mcpserver/index.mjs +1 -0
  272. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/delete-mcpserver.use-case.d.ts +15 -0
  273. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/delete-mcpserver.use-case.js +61 -0
  274. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/delete-mcpserver.use-case.mjs +32 -0
  275. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/index.d.ts +1 -0
  276. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/index.js +22 -0
  277. package/dist/services/agent/modules/mcp-servers/lambdas/delete-mcpserver/index.mjs +1 -0
  278. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/get-mcpserver-by-id.use-case.d.ts +14 -0
  279. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/get-mcpserver-by-id.use-case.js +52 -0
  280. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/get-mcpserver-by-id.use-case.mjs +23 -0
  281. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/index.d.ts +1 -0
  282. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/index.js +22 -0
  283. package/dist/services/agent/modules/mcp-servers/lambdas/get-mcpserver-by-id/index.mjs +1 -0
  284. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/index.d.ts +1 -0
  285. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/index.js +22 -0
  286. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/index.mjs +1 -0
  287. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/list-mcpservers-by-user.use-case.d.ts +16 -0
  288. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/list-mcpservers-by-user.use-case.js +59 -0
  289. package/dist/services/agent/modules/mcp-servers/lambdas/list-mcpservers-by-user/list-mcpservers-by-user.use-case.mjs +30 -0
  290. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/index.d.ts +1 -0
  291. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/index.js +22 -0
  292. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/index.mjs +1 -0
  293. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/update-mcpserver.use-case.d.ts +15 -0
  294. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/update-mcpserver.use-case.js +61 -0
  295. package/dist/services/agent/modules/mcp-servers/lambdas/update-mcpserver/update-mcpserver.use-case.mjs +32 -0
  296. package/dist/services/agent/modules/mcp-servers/repositories/index.d.ts +1 -0
  297. package/dist/services/agent/modules/mcp-servers/repositories/index.js +22 -0
  298. package/dist/services/agent/modules/mcp-servers/repositories/index.mjs +1 -0
  299. package/dist/services/agent/modules/mcp-servers/repositories/mcpserver.repository.d.ts +10 -0
  300. package/dist/services/agent/modules/mcp-servers/repositories/mcpserver.repository.js +67 -0
  301. package/dist/services/agent/modules/mcp-servers/repositories/mcpserver.repository.mjs +38 -0
  302. package/dist/services/agent/skills/index.d.ts +2 -14
  303. package/dist/services/agent/skills/index.js +24 -7
  304. package/dist/services/agent/skills/index.mjs +2 -1
  305. package/dist/services/agent/skills/shared/index.d.ts +1 -0
  306. package/dist/services/agent/skills/shared/index.js +22 -0
  307. package/dist/services/agent/skills/shared/index.mjs +1 -0
  308. package/dist/services/agent/skills/shared/shared-rules.d.ts +4 -0
  309. package/dist/services/agent/skills/shared/shared-rules.js +37 -0
  310. package/dist/services/agent/skills/shared/shared-rules.mjs +11 -0
  311. package/dist/services/agent/skills/skill-runner.d.ts +31 -0
  312. package/dist/services/agent/skills/skill-runner.js +121 -0
  313. package/dist/services/agent/skills/skill-runner.mjs +92 -0
  314. package/dist/services/agent/skills/skill.d.ts +33 -0
  315. package/dist/services/agent/skills/skill.js +128 -0
  316. package/dist/services/agent/skills/skill.mjs +105 -0
  317. package/dist/services/agent/tools/core/call-ai/call-ai.skill.d.ts +6 -0
  318. package/dist/services/agent/tools/core/call-ai/call-ai.skill.js +54 -0
  319. package/dist/services/agent/tools/core/call-ai/call-ai.skill.mjs +31 -0
  320. package/dist/services/agent/tools/core/call-ai/call-ai.tool.d.ts +2 -0
  321. package/dist/services/agent/tools/core/call-ai/call-ai.tool.js +68 -0
  322. package/dist/services/agent/tools/core/call-ai/call-ai.tool.mjs +45 -0
  323. package/dist/services/agent/tools/core/call-ai/index.d.ts +1 -0
  324. package/dist/services/agent/tools/core/call-ai/index.js +22 -0
  325. package/dist/services/agent/tools/core/call-ai/index.mjs +1 -0
  326. package/dist/services/agent/tools/core/index.d.ts +2 -0
  327. package/dist/services/agent/tools/core/index.js +24 -0
  328. package/dist/services/agent/tools/core/index.mjs +2 -0
  329. package/dist/services/agent/tools/core/web-search/index.d.ts +1 -0
  330. package/dist/services/agent/tools/core/web-search/index.js +22 -0
  331. package/dist/services/agent/tools/core/web-search/index.mjs +1 -0
  332. package/dist/services/agent/tools/core/web-search/web-search.tool.d.ts +2 -0
  333. package/dist/services/agent/tools/core/web-search/web-search.tool.js +51 -0
  334. package/dist/services/agent/tools/core/web-search/web-search.tool.mjs +30 -0
  335. package/dist/services/agent/tools/index.d.ts +2 -12
  336. package/dist/services/agent/tools/index.js +24 -7
  337. package/dist/services/agent/tools/index.mjs +2 -1
  338. package/dist/{tool-DMR_ZdjP.d.ts → services/agent/tools/tool.d.ts} +7 -9
  339. package/dist/services/agent/tools/tool.js +57 -0
  340. package/dist/services/agent/tools/tool.mjs +34 -0
  341. package/dist/services/agent/utils/rank-tools-by-keywords.d.ts +12 -0
  342. package/dist/services/agent/utils/rank-tools-by-keywords.js +65 -0
  343. package/dist/services/agent/utils/rank-tools-by-keywords.mjs +42 -0
  344. package/dist/services/app/core/app.d.ts +14 -0
  345. package/dist/services/app/core/app.js +60 -0
  346. package/dist/services/app/core/app.mjs +47 -0
  347. package/dist/{current-session-DC-SF7rl.d.mts → services/app/core/current-session.d.ts} +4 -5
  348. package/dist/services/app/core/current-session.js +124 -0
  349. package/dist/services/app/core/current-session.mjs +104 -0
  350. package/dist/services/app/core/current-user.d.ts +16 -0
  351. package/dist/services/app/core/current-user.js +84 -0
  352. package/dist/services/app/core/current-user.mjs +61 -0
  353. package/dist/services/app/core/index.d.ts +3 -60
  354. package/dist/services/app/core/index.js +26 -7
  355. package/dist/services/app/core/index.mjs +3 -1
  356. package/dist/services/app/modules/authentication/lambdas/login/index.d.ts +1 -0
  357. package/dist/services/app/modules/authentication/lambdas/login/index.js +22 -0
  358. package/dist/services/app/modules/authentication/lambdas/login/index.mjs +1 -0
  359. package/dist/services/app/modules/authentication/lambdas/login/login.use-case.d.ts +21 -0
  360. package/dist/services/app/modules/authentication/lambdas/login/login.use-case.js +89 -0
  361. package/dist/services/app/modules/authentication/lambdas/login/login.use-case.mjs +50 -0
  362. package/dist/services/app/modules/users/entities/index.d.ts +1 -0
  363. package/dist/services/app/modules/users/entities/index.js +22 -0
  364. package/dist/services/app/modules/users/entities/index.mjs +1 -0
  365. package/dist/services/app/modules/users/entities/user-acquisition.d.ts +12 -0
  366. package/dist/services/app/modules/users/entities/user-acquisition.js +55 -0
  367. package/dist/services/app/modules/users/entities/user-acquisition.mjs +26 -0
  368. package/dist/services/app/modules/users/entities/user-country.d.ts +11 -0
  369. package/dist/services/app/modules/users/entities/user-country.js +44 -0
  370. package/dist/services/app/modules/users/entities/user-country.mjs +21 -0
  371. package/dist/services/app/modules/users/entities/user-currency.d.ts +13 -0
  372. package/dist/services/app/modules/users/entities/user-currency.js +44 -0
  373. package/dist/services/app/modules/users/entities/user-currency.mjs +21 -0
  374. package/dist/services/app/modules/users/entities/user-email.value-object.d.ts +6 -0
  375. package/dist/services/app/modules/users/entities/user-email.value-object.js +43 -0
  376. package/dist/services/app/modules/users/entities/user-email.value-object.mjs +20 -0
  377. package/dist/services/app/modules/users/entities/user-language.d.ts +11 -0
  378. package/dist/services/app/modules/users/entities/user-language.js +44 -0
  379. package/dist/services/app/modules/users/entities/user-language.mjs +21 -0
  380. package/dist/services/app/modules/users/entities/user-marketing.d.ts +9 -0
  381. package/dist/services/app/modules/users/entities/user-marketing.js +53 -0
  382. package/dist/services/app/modules/users/entities/user-marketing.mjs +24 -0
  383. package/dist/services/app/modules/users/entities/user-notification-preferences.d.ts +11 -0
  384. package/dist/services/app/modules/users/entities/user-notification-preferences.js +41 -0
  385. package/dist/services/app/modules/users/entities/user-notification-preferences.mjs +18 -0
  386. package/dist/services/app/modules/users/entities/user-password.value-object.d.ts +8 -0
  387. package/dist/services/app/modules/users/entities/user-password.value-object.js +69 -0
  388. package/dist/services/app/modules/users/entities/user-password.value-object.mjs +36 -0
  389. package/dist/services/app/modules/users/entities/user-permissions.d.ts +21 -0
  390. package/dist/services/app/modules/users/entities/user-permissions.js +59 -0
  391. package/dist/services/app/modules/users/entities/user-permissions.mjs +36 -0
  392. package/dist/services/app/modules/users/entities/user-preferences.d.ts +25 -0
  393. package/dist/services/app/modules/users/entities/user-preferences.js +69 -0
  394. package/dist/services/app/modules/users/entities/user-preferences.mjs +46 -0
  395. package/dist/services/app/modules/users/entities/user-report-preferences.d.ts +16 -0
  396. package/dist/services/app/modules/users/entities/user-report-preferences.js +56 -0
  397. package/dist/services/app/modules/users/entities/user-report-preferences.mjs +33 -0
  398. package/dist/services/app/modules/users/entities/user-report-schedule.d.ts +11 -0
  399. package/dist/services/app/modules/users/entities/user-report-schedule.js +41 -0
  400. package/dist/services/app/modules/users/entities/user-report-schedule.mjs +18 -0
  401. package/dist/services/app/modules/users/entities/user-timezone.d.ts +11 -0
  402. package/dist/services/app/modules/users/entities/user-timezone.js +44 -0
  403. package/dist/services/app/modules/users/entities/user-timezone.mjs +21 -0
  404. package/dist/services/app/modules/users/entities/user.entity.d.ts +41 -0
  405. package/dist/services/app/modules/users/entities/user.entity.js +133 -0
  406. package/dist/services/app/modules/users/entities/user.entity.mjs +103 -0
  407. package/dist/services/app/modules/users/lambdas/create-user/create-user.use-case.d.ts +14 -0
  408. package/dist/services/app/modules/users/lambdas/create-user/create-user.use-case.js +58 -0
  409. package/dist/services/app/modules/users/lambdas/create-user/create-user.use-case.mjs +29 -0
  410. package/dist/services/app/modules/users/lambdas/create-user/index.d.ts +1 -0
  411. package/dist/services/app/modules/users/lambdas/create-user/index.js +22 -0
  412. package/dist/services/app/modules/users/lambdas/create-user/index.mjs +1 -0
  413. package/dist/services/app/modules/users/lambdas/delete-user/delete-user.use-case.d.ts +16 -0
  414. package/dist/services/app/modules/users/lambdas/delete-user/delete-user.use-case.js +61 -0
  415. package/dist/services/app/modules/users/lambdas/delete-user/delete-user.use-case.mjs +32 -0
  416. package/dist/services/app/modules/users/lambdas/delete-user/index.d.ts +1 -0
  417. package/dist/services/app/modules/users/lambdas/delete-user/index.js +22 -0
  418. package/dist/services/app/modules/users/lambdas/delete-user/index.mjs +1 -0
  419. package/dist/services/app/modules/users/lambdas/get-user-by-id/get-user-by-id.use-case.d.ts +14 -0
  420. package/dist/services/app/modules/users/lambdas/get-user-by-id/get-user-by-id.use-case.js +52 -0
  421. package/dist/services/app/modules/users/lambdas/get-user-by-id/get-user-by-id.use-case.mjs +23 -0
  422. package/dist/services/app/modules/users/lambdas/get-user-by-id/index.d.ts +1 -0
  423. package/dist/services/app/modules/users/lambdas/get-user-by-id/index.js +22 -0
  424. package/dist/services/app/modules/users/lambdas/get-user-by-id/index.mjs +1 -0
  425. package/dist/services/app/modules/users/lambdas/list-users-by-props/index.d.ts +1 -0
  426. package/dist/services/app/modules/users/lambdas/list-users-by-props/index.js +22 -0
  427. package/dist/services/app/modules/users/lambdas/list-users-by-props/index.mjs +1 -0
  428. package/dist/services/app/modules/users/lambdas/list-users-by-props/list-users-by-props.use-case.d.ts +16 -0
  429. package/dist/services/app/modules/users/lambdas/list-users-by-props/list-users-by-props.use-case.js +52 -0
  430. package/dist/services/app/modules/users/lambdas/list-users-by-props/list-users-by-props.use-case.mjs +23 -0
  431. package/dist/services/app/modules/users/lambdas/update-user/index.d.ts +1 -0
  432. package/dist/services/app/modules/users/lambdas/update-user/index.js +22 -0
  433. package/dist/services/app/modules/users/lambdas/update-user/index.mjs +1 -0
  434. package/dist/services/app/modules/users/lambdas/update-user/update-user.use-case.d.ts +15 -0
  435. package/dist/services/app/modules/users/lambdas/update-user/update-user.use-case.js +62 -0
  436. package/dist/services/app/modules/users/lambdas/update-user/update-user.use-case.mjs +33 -0
  437. package/dist/services/app/modules/users/repositories/index.d.ts +1 -0
  438. package/dist/services/app/modules/users/repositories/index.js +22 -0
  439. package/dist/services/app/modules/users/repositories/index.mjs +1 -0
  440. package/dist/services/app/modules/users/repositories/user.repository.d.ts +12 -0
  441. package/dist/services/app/modules/users/repositories/user.repository.js +83 -0
  442. package/dist/services/app/modules/users/repositories/user.repository.mjs +54 -0
  443. package/package.json +1 -1
  444. package/dist/agent-loop-C41Y1CGp.d.mts +0 -60
  445. package/dist/agent-loop-ZH4GRi4A.d.ts +0 -60
  446. package/dist/base.use-case-8K6_Ods0.d.mts +0 -14
  447. package/dist/base.use-case-ChEb3nh6.d.ts +0 -14
  448. package/dist/chunk-6PCVBY5G.mjs +0 -1
  449. package/dist/chunk-7WJ3XXSP.mjs +0 -7
  450. package/dist/chunk-CCRMOWMO.mjs +0 -1
  451. package/dist/chunk-ISOEJA2L.mjs +0 -1
  452. package/dist/chunk-XXB52O7H.mjs +0 -1
  453. package/dist/current-session-DC-SF7rl.d.ts +0 -130
  454. package/dist/current-user-4BppBUBP.d.mts +0 -264
  455. package/dist/current-user-4BppBUBP.d.ts +0 -264
  456. package/dist/index.d.mts +0 -10
  457. package/dist/services/agent/core/index.d.mts +0 -122
  458. package/dist/services/agent/loops/index.d.mts +0 -116
  459. package/dist/services/agent/skills/index.d.mts +0 -14
  460. package/dist/services/agent/tools/index.d.mts +0 -12
  461. package/dist/services/app/core/index.d.mts +0 -60
  462. package/dist/skill-CtYQbG6-.d.ts +0 -308
  463. package/dist/skill-DXNkK5FG.d.mts +0 -308
  464. package/dist/tool-BaG2a8Np.d.mts +0 -42
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var skill_exports = {};
20
+ __export(skill_exports, {
21
+ Skill: () => Skill
22
+ });
23
+ module.exports = __toCommonJS(skill_exports);
24
+ var import_tsyringe = require("tsyringe");
25
+ var import_helpers = require("@common/helpers");
26
+ var import_clients = require("@common/clients");
27
+ class Skill {
28
+ name;
29
+ version;
30
+ description;
31
+ temperature;
32
+ systemInstructions;
33
+ constructor(props) {
34
+ this.name = props.name;
35
+ this.version = props.version;
36
+ this.description = props.description;
37
+ this.temperature = props.temperature;
38
+ this.systemInstructions = props.systemInstructions;
39
+ }
40
+ async run(options) {
41
+ const { sessionId, answerId, userMessage, currentUser, currentSession, contextInjection = {}, input = {}, chat } = options;
42
+ try {
43
+ const llmClient = import_tsyringe.container.resolve(import_clients.LLMClient);
44
+ const currentCountryCode = currentSession?.location?.country;
45
+ const currentCurrencyCode = currentSession?.currencyCode;
46
+ const now = /* @__PURE__ */ new Date();
47
+ const timezone = currentSession?.location?.timezone;
48
+ const nowLocal = timezone ? now.toLocaleString("sv-SE", { timeZone: timezone }) : void 0;
49
+ const payload = {
50
+ SYSTEM_INSTRUCTIONS: {
51
+ ...this.systemInstructions
52
+ },
53
+ CONTEXT: {
54
+ now_utc: (/* @__PURE__ */ new Date()).toISOString(),
55
+ now_local: nowLocal,
56
+ timezone: currentSession?.location?.timezone,
57
+ day_of_week: (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long" }),
58
+ ...chat?.state?.language ? { detected_language: chat.state.language } : {},
59
+ ...currentUser ? {
60
+ user_details: {
61
+ first_name: currentUser?.firstName,
62
+ last_name: currentUser?.lastName,
63
+ // Configuración/Preferencias del usuario
64
+ preferred_language: currentUser?.language,
65
+ residence_country_code: currentUser?.preferences?.country?.isoCode,
66
+ preferred_currency_code: currentUser?.preferences?.currency?.isoCode
67
+ }
68
+ } : {},
69
+ ...currentSession ? {
70
+ session_details: {
71
+ current_location: {
72
+ country_code: currentCountryCode,
73
+ currency_code: currentCurrencyCode,
74
+ timezone_offset: currentSession?.timezoneOffset
75
+ },
76
+ client_info: {
77
+ platform: currentSession?.device?.os,
78
+ brand: currentSession?.device?.brand,
79
+ model: currentSession?.device?.model
80
+ }
81
+ }
82
+ } : {},
83
+ ...contextInjection
84
+ },
85
+ INPUT: {
86
+ ...userMessage ? { user_message: userMessage } : {},
87
+ ...input
88
+ }
89
+ };
90
+ const response = await llmClient.complete({
91
+ sessionId,
92
+ answerId,
93
+ taskName: this.name,
94
+ currentUser,
95
+ messages: [
96
+ {
97
+ role: "user",
98
+ timestamp: Date.now(),
99
+ content: [{ type: "text", text: JSON.stringify(payload) }]
100
+ }
101
+ ],
102
+ temperature: this.temperature ?? 0.7
103
+ });
104
+ const result = {
105
+ ...this.parseJsonResponse(response),
106
+ responseId: response.responseId ?? "",
107
+ costInUsd: response?.usage?.cost?.total
108
+ };
109
+ chat?.addTrace({ node: this.name, reasoning: result?.reasoning });
110
+ return result;
111
+ } catch (error) {
112
+ chat?.addTrace({ node: this.name, reasoning: `Failed: ${error?.message ?? error}` });
113
+ throw error;
114
+ }
115
+ }
116
+ parseJsonResponse(response) {
117
+ const rawContent = response?.content ?? [];
118
+ const text = rawContent[0]?.type === "text" ? rawContent[0].text : void 0;
119
+ if (!text) throw new Error("LLM response text is empty or invalid");
120
+ const content = (0, import_helpers.extractJSON)(text);
121
+ if (!content) throw new Error("Failed to extract JSON from LLM response");
122
+ return content;
123
+ }
124
+ }
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ Skill
128
+ });
@@ -0,0 +1,105 @@
1
+ import "../../../chunk-XRJFNASX.mjs";
2
+ import { container } from "tsyringe";
3
+ import { extractJSON } from "@common/helpers";
4
+ import { LLMClient } from "@common/clients";
5
+ class Skill {
6
+ name;
7
+ version;
8
+ description;
9
+ temperature;
10
+ systemInstructions;
11
+ constructor(props) {
12
+ this.name = props.name;
13
+ this.version = props.version;
14
+ this.description = props.description;
15
+ this.temperature = props.temperature;
16
+ this.systemInstructions = props.systemInstructions;
17
+ }
18
+ async run(options) {
19
+ const { sessionId, answerId, userMessage, currentUser, currentSession, contextInjection = {}, input = {}, chat } = options;
20
+ try {
21
+ const llmClient = container.resolve(LLMClient);
22
+ const currentCountryCode = currentSession?.location?.country;
23
+ const currentCurrencyCode = currentSession?.currencyCode;
24
+ const now = /* @__PURE__ */ new Date();
25
+ const timezone = currentSession?.location?.timezone;
26
+ const nowLocal = timezone ? now.toLocaleString("sv-SE", { timeZone: timezone }) : void 0;
27
+ const payload = {
28
+ SYSTEM_INSTRUCTIONS: {
29
+ ...this.systemInstructions
30
+ },
31
+ CONTEXT: {
32
+ now_utc: (/* @__PURE__ */ new Date()).toISOString(),
33
+ now_local: nowLocal,
34
+ timezone: currentSession?.location?.timezone,
35
+ day_of_week: (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long" }),
36
+ ...chat?.state?.language ? { detected_language: chat.state.language } : {},
37
+ ...currentUser ? {
38
+ user_details: {
39
+ first_name: currentUser?.firstName,
40
+ last_name: currentUser?.lastName,
41
+ // Configuración/Preferencias del usuario
42
+ preferred_language: currentUser?.language,
43
+ residence_country_code: currentUser?.preferences?.country?.isoCode,
44
+ preferred_currency_code: currentUser?.preferences?.currency?.isoCode
45
+ }
46
+ } : {},
47
+ ...currentSession ? {
48
+ session_details: {
49
+ current_location: {
50
+ country_code: currentCountryCode,
51
+ currency_code: currentCurrencyCode,
52
+ timezone_offset: currentSession?.timezoneOffset
53
+ },
54
+ client_info: {
55
+ platform: currentSession?.device?.os,
56
+ brand: currentSession?.device?.brand,
57
+ model: currentSession?.device?.model
58
+ }
59
+ }
60
+ } : {},
61
+ ...contextInjection
62
+ },
63
+ INPUT: {
64
+ ...userMessage ? { user_message: userMessage } : {},
65
+ ...input
66
+ }
67
+ };
68
+ const response = await llmClient.complete({
69
+ sessionId,
70
+ answerId,
71
+ taskName: this.name,
72
+ currentUser,
73
+ messages: [
74
+ {
75
+ role: "user",
76
+ timestamp: Date.now(),
77
+ content: [{ type: "text", text: JSON.stringify(payload) }]
78
+ }
79
+ ],
80
+ temperature: this.temperature ?? 0.7
81
+ });
82
+ const result = {
83
+ ...this.parseJsonResponse(response),
84
+ responseId: response.responseId ?? "",
85
+ costInUsd: response?.usage?.cost?.total
86
+ };
87
+ chat?.addTrace({ node: this.name, reasoning: result?.reasoning });
88
+ return result;
89
+ } catch (error) {
90
+ chat?.addTrace({ node: this.name, reasoning: `Failed: ${error?.message ?? error}` });
91
+ throw error;
92
+ }
93
+ }
94
+ parseJsonResponse(response) {
95
+ const rawContent = response?.content ?? [];
96
+ const text = rawContent[0]?.type === "text" ? rawContent[0].text : void 0;
97
+ if (!text) throw new Error("LLM response text is empty or invalid");
98
+ const content = extractJSON(text);
99
+ if (!content) throw new Error("Failed to extract JSON from LLM response");
100
+ return content;
101
+ }
102
+ }
103
+ export {
104
+ Skill
105
+ };
@@ -0,0 +1,6 @@
1
+ import { Skill } from '../../../skills/skill';
2
+ export type CallAiResponseSchema = {
3
+ result: string;
4
+ reasoning: string;
5
+ };
6
+ export declare const callAiSkill: Skill<CallAiResponseSchema>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var call_ai_skill_exports = {};
20
+ __export(call_ai_skill_exports, {
21
+ callAiSkill: () => callAiSkill
22
+ });
23
+ module.exports = __toCommonJS(call_ai_skill_exports);
24
+ var import_skill = require("../../../skills/skill");
25
+ var import_shared_rules = require("../../../skills/shared/shared-rules");
26
+ const callAiSkill = new import_skill.Skill({
27
+ name: "call-ai",
28
+ version: "1.0.0",
29
+ description: "Executes custom AI analysis, summarization, extraction, or transformation tasks using dynamic agent-provided instructions and input context.",
30
+ temperature: 0.3,
31
+ systemInstructions: {
32
+ instruction_set: {
33
+ goal: "Execute the given task according to the specified instruction prompt, analyzing or processing the provided input to produce a clear, high-quality result.",
34
+ role: "Flexible AI reasoning, analysis, summarization, and task execution engine",
35
+ logic_rules: [
36
+ "INSTRUCTION_EXECUTION: Strictly follow the custom guidelines, criteria, and role instructions defined in 'systemPrompt'.",
37
+ "TASK_PROCESSING: Process the provided 'input_data' or context thoroughly, applying reasoning, extraction, or summarization as requested.",
38
+ "REASONING_LOG: Provide a concise, step-by-step logical justification of the proposed strategy in 'reasoning' strictly in English.",
39
+ import_shared_rules.FORMATTING,
40
+ import_shared_rules.LATEX_FORMATTING,
41
+ import_shared_rules.CITATION_FORMATTING,
42
+ "STRICT_OUTPUT: Return ONLY the JSON object matching response_schema."
43
+ ],
44
+ response_schema: {
45
+ result: "string",
46
+ reasoning: "string"
47
+ }
48
+ }
49
+ }
50
+ });
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ callAiSkill
54
+ });
@@ -0,0 +1,31 @@
1
+ import "../../../../../chunk-XRJFNASX.mjs";
2
+ import { Skill } from "../../../skills/skill";
3
+ import { FORMATTING, LATEX_FORMATTING, CITATION_FORMATTING } from "../../../skills/shared/shared-rules";
4
+ const callAiSkill = new Skill({
5
+ name: "call-ai",
6
+ version: "1.0.0",
7
+ description: "Executes custom AI analysis, summarization, extraction, or transformation tasks using dynamic agent-provided instructions and input context.",
8
+ temperature: 0.3,
9
+ systemInstructions: {
10
+ instruction_set: {
11
+ goal: "Execute the given task according to the specified instruction prompt, analyzing or processing the provided input to produce a clear, high-quality result.",
12
+ role: "Flexible AI reasoning, analysis, summarization, and task execution engine",
13
+ logic_rules: [
14
+ "INSTRUCTION_EXECUTION: Strictly follow the custom guidelines, criteria, and role instructions defined in 'systemPrompt'.",
15
+ "TASK_PROCESSING: Process the provided 'input_data' or context thoroughly, applying reasoning, extraction, or summarization as requested.",
16
+ "REASONING_LOG: Provide a concise, step-by-step logical justification of the proposed strategy in 'reasoning' strictly in English.",
17
+ FORMATTING,
18
+ LATEX_FORMATTING,
19
+ CITATION_FORMATTING,
20
+ "STRICT_OUTPUT: Return ONLY the JSON object matching response_schema."
21
+ ],
22
+ response_schema: {
23
+ result: "string",
24
+ reasoning: "string"
25
+ }
26
+ }
27
+ }
28
+ });
29
+ export {
30
+ callAiSkill
31
+ };
@@ -0,0 +1,2 @@
1
+ import { Tool } from '../../tool';
2
+ export declare const callAiTool: Tool;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var call_ai_tool_exports = {};
20
+ __export(call_ai_tool_exports, {
21
+ callAiTool: () => callAiTool
22
+ });
23
+ module.exports = __toCommonJS(call_ai_tool_exports);
24
+ var import_call_ai = require("./call-ai.skill");
25
+ var import_tool = require("../../tool");
26
+ const callAiTool = new import_tool.Tool({
27
+ name: "call_ai",
28
+ description: import_call_ai.callAiSkill.description ?? "",
29
+ destructive: false,
30
+ parameters: {
31
+ type: "object",
32
+ properties: {
33
+ instructions: {
34
+ type: "string",
35
+ description: "System instructions or guidelines to perform the analysis, extraction, or transformation task."
36
+ },
37
+ input_data: {
38
+ type: "string",
39
+ description: "The raw text, data, or context to be processed."
40
+ },
41
+ temperature: {
42
+ type: "number",
43
+ description: "Optional sampling temperature (0.0 to 1.0) to control creativity or precision."
44
+ }
45
+ },
46
+ required: ["instructions", "input_data"]
47
+ },
48
+ handler: async (params) => {
49
+ const { payload, currentUser, sessionId, answerId } = params;
50
+ const { instructions, input_data } = payload;
51
+ if (!instructions) throw new Error("[call_ai_tool] Param instructions is required");
52
+ if (!input_data) throw new Error("[call_ai_tool] Param input_data is required");
53
+ const result = await import_call_ai.callAiSkill.run({
54
+ sessionId,
55
+ answerId,
56
+ input: input_data,
57
+ contextInjection: {
58
+ systemPrompt: instructions
59
+ },
60
+ currentUser
61
+ });
62
+ return { data: result };
63
+ }
64
+ });
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ callAiTool
68
+ });
@@ -0,0 +1,45 @@
1
+ import "../../../../../chunk-XRJFNASX.mjs";
2
+ import { callAiSkill } from "./call-ai.skill";
3
+ import { Tool } from "../../tool";
4
+ const callAiTool = new Tool({
5
+ name: "call_ai",
6
+ description: callAiSkill.description ?? "",
7
+ destructive: false,
8
+ parameters: {
9
+ type: "object",
10
+ properties: {
11
+ instructions: {
12
+ type: "string",
13
+ description: "System instructions or guidelines to perform the analysis, extraction, or transformation task."
14
+ },
15
+ input_data: {
16
+ type: "string",
17
+ description: "The raw text, data, or context to be processed."
18
+ },
19
+ temperature: {
20
+ type: "number",
21
+ description: "Optional sampling temperature (0.0 to 1.0) to control creativity or precision."
22
+ }
23
+ },
24
+ required: ["instructions", "input_data"]
25
+ },
26
+ handler: async (params) => {
27
+ const { payload, currentUser, sessionId, answerId } = params;
28
+ const { instructions, input_data } = payload;
29
+ if (!instructions) throw new Error("[call_ai_tool] Param instructions is required");
30
+ if (!input_data) throw new Error("[call_ai_tool] Param input_data is required");
31
+ const result = await callAiSkill.run({
32
+ sessionId,
33
+ answerId,
34
+ input: input_data,
35
+ contextInjection: {
36
+ systemPrompt: instructions
37
+ },
38
+ currentUser
39
+ });
40
+ return { data: result };
41
+ }
42
+ });
43
+ export {
44
+ callAiTool
45
+ };
@@ -0,0 +1 @@
1
+ export * from './call-ai.tool';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var call_ai_exports = {};
17
+ module.exports = __toCommonJS(call_ai_exports);
18
+ __reExport(call_ai_exports, require("./call-ai.tool"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./call-ai.tool")
22
+ });
@@ -0,0 +1 @@
1
+ export * from "./call-ai.tool";
@@ -0,0 +1,2 @@
1
+ export * from './web-search';
2
+ export * from './call-ai';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var core_exports = {};
17
+ module.exports = __toCommonJS(core_exports);
18
+ __reExport(core_exports, require("./web-search"), module.exports);
19
+ __reExport(core_exports, require("./call-ai"), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require("./web-search"),
23
+ ...require("./call-ai")
24
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./web-search";
2
+ export * from "./call-ai";
@@ -0,0 +1 @@
1
+ export * from './web-search.tool';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var web_search_exports = {};
17
+ module.exports = __toCommonJS(web_search_exports);
18
+ __reExport(web_search_exports, require("./web-search.tool"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./web-search.tool")
22
+ });
@@ -0,0 +1 @@
1
+ export * from "./web-search.tool";
@@ -0,0 +1,2 @@
1
+ import { Tool } from '../../tool';
2
+ export declare const webSearchTool: Tool;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var web_search_tool_exports = {};
20
+ __export(web_search_tool_exports, {
21
+ webSearchTool: () => webSearchTool
22
+ });
23
+ module.exports = __toCommonJS(web_search_tool_exports);
24
+ var import_tool = require("../../tool");
25
+ var import_serper_client = require("@common/clients/serper-client");
26
+ const webSearchTool = new import_tool.Tool({
27
+ name: "web_search",
28
+ description: "Search on web",
29
+ destructive: false,
30
+ parameters: {
31
+ type: "object",
32
+ properties: {
33
+ query: {
34
+ type: "string",
35
+ description: "search query"
36
+ }
37
+ },
38
+ required: ["query"]
39
+ },
40
+ handler: async (params) => {
41
+ if (!params) throw new Error("[web_search] params is required");
42
+ const { currentUser, sessionId, answerId, ...rest } = params;
43
+ const serperClient = new import_serper_client.SerperClient();
44
+ const results = await serperClient.searchOnGoogle(rest);
45
+ return { data: results };
46
+ }
47
+ });
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ webSearchTool
51
+ });
@@ -0,0 +1,30 @@
1
+ import "../../../../../chunk-XRJFNASX.mjs";
2
+ import { Tool } from "../../tool";
3
+ import {
4
+ SerperClient
5
+ } from "@common/clients/serper-client";
6
+ const webSearchTool = new Tool({
7
+ name: "web_search",
8
+ description: "Search on web",
9
+ destructive: false,
10
+ parameters: {
11
+ type: "object",
12
+ properties: {
13
+ query: {
14
+ type: "string",
15
+ description: "search query"
16
+ }
17
+ },
18
+ required: ["query"]
19
+ },
20
+ handler: async (params) => {
21
+ if (!params) throw new Error("[web_search] params is required");
22
+ const { currentUser, sessionId, answerId, ...rest } = params;
23
+ const serperClient = new SerperClient();
24
+ const results = await serperClient.searchOnGoogle(rest);
25
+ return { data: results };
26
+ }
27
+ });
28
+ export {
29
+ webSearchTool
30
+ };
@@ -1,12 +1,2 @@
1
- import { T as Tool } from '../../../tool-DMR_ZdjP.js';
2
- export { B as BaseParams } from '../../../tool-DMR_ZdjP.js';
3
- import '../../../current-user-4BppBUBP.js';
4
- import 'bson';
5
- import '@modelcontextprotocol/sdk/client/index.js';
6
- import '@modelcontextprotocol/sdk/types.js';
7
-
8
- declare const webSearchTool: Tool;
9
-
10
- declare const callAiTool: Tool;
11
-
12
- export { Tool, callAiTool, webSearchTool };
1
+ export * from './core';
2
+ export * from './tool';