@futdevpro/nts-dynamo 1.10.76 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/build/_collections/atlas-default-db-options.const.d.ts +28 -0
  2. package/build/_collections/atlas-default-db-options.const.d.ts.map +1 -0
  3. package/build/_collections/atlas-default-db-options.const.js +10 -0
  4. package/build/_collections/atlas-default-db-options.const.js.map +1 -0
  5. package/build/_collections/get-environment-settings.util.d.ts +3 -0
  6. package/build/_collections/get-environment-settings.util.d.ts.map +1 -0
  7. package/build/_collections/get-environment-settings.util.js +45 -0
  8. package/build/_collections/get-environment-settings.util.js.map +1 -0
  9. package/build/_collections/global-settings.const.d.ts.map +1 -1
  10. package/build/_collections/global-settings.const.js +9 -4
  11. package/build/_collections/global-settings.const.js.map +1 -1
  12. package/build/_models/control-models/app-params.control-model.d.ts +6 -0
  13. package/build/_models/control-models/app-params.control-model.d.ts.map +1 -1
  14. package/build/_models/control-models/app-params.control-model.js +29 -2
  15. package/build/_models/control-models/app-params.control-model.js.map +1 -1
  16. package/build/_models/control-models/app-params.control-model.spec.js +5 -4
  17. package/build/_models/control-models/app-params.control-model.spec.js.map +1 -1
  18. package/build/_models/control-models/endpoint-params.control-model.js +1 -1
  19. package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
  20. package/build/_models/interfaces/environment-settings.interface.d.ts +35 -0
  21. package/build/_models/interfaces/environment-settings.interface.d.ts.map +1 -0
  22. package/build/_models/interfaces/environment-settings.interface.js +3 -0
  23. package/build/_models/interfaces/environment-settings.interface.js.map +1 -0
  24. package/build/_models/interfaces/global-settings.interface.d.ts +34 -2
  25. package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
  26. package/build/_modules/custom-data/index.d.ts.map +1 -1
  27. package/build/_modules/custom-data/index.js +1 -0
  28. package/build/_modules/custom-data/index.js.map +1 -1
  29. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts +3 -0
  30. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts.map +1 -0
  31. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js +17 -0
  32. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js.map +1 -0
  33. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts +18 -0
  34. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts.map +1 -0
  35. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js +3 -0
  36. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js.map +1 -0
  37. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts +10 -0
  38. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts.map +1 -0
  39. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js +41 -0
  40. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js.map +1 -0
  41. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +14 -0
  42. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -0
  43. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +88 -0
  44. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -0
  45. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +10 -0
  46. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts.map +1 -0
  47. package/build/_modules/discord-assistant/_services/dias-io.control-service.js +39 -0
  48. package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -0
  49. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts +8 -0
  50. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts.map +1 -0
  51. package/build/_modules/discord-assistant/_services/dias-main.control-service.js +23 -0
  52. package/build/_modules/discord-assistant/_services/dias-main.control-service.js.map +1 -0
  53. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +13 -0
  54. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -0
  55. package/build/_modules/discord-assistant/_services/dias.service-base.js +61 -0
  56. package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -0
  57. package/build/_modules/discord-assistant/index.d.ts +10 -0
  58. package/build/_modules/discord-assistant/index.d.ts.map +1 -0
  59. package/build/_modules/discord-assistant/index.js +23 -0
  60. package/build/_modules/discord-assistant/index.js.map +1 -0
  61. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts +4 -0
  62. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts.map +1 -0
  63. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js +8 -0
  64. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js.map +1 -0
  65. package/build/_modules/discord-assistant-voiced/index.d.ts +3 -0
  66. package/build/_modules/discord-assistant-voiced/index.d.ts.map +1 -0
  67. package/build/_modules/discord-assistant-voiced/index.js +26 -0
  68. package/build/_modules/discord-assistant-voiced/index.js.map +1 -0
  69. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts +3 -0
  70. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts.map +1 -0
  71. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js +13 -0
  72. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js.map +1 -0
  73. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts +3 -0
  74. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts.map +1 -0
  75. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js +44 -0
  76. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js.map +1 -0
  77. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts +22 -0
  78. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts.map +1 -0
  79. package/build/_modules/discord-bot/_collections/dibo-operations.util.js +261 -0
  80. package/build/_modules/discord-bot/_collections/dibo-operations.util.js.map +1 -0
  81. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts +8 -0
  82. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts.map +1 -0
  83. package/build/_modules/discord-bot/_models/dibo-command.interface.js +3 -0
  84. package/build/_modules/discord-bot/_models/dibo-command.interface.js.map +1 -0
  85. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts +7 -0
  86. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts.map +1 -0
  87. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js +3 -0
  88. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js.map +1 -0
  89. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts +6 -0
  90. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts.map +1 -0
  91. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js +3 -0
  92. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js.map +1 -0
  93. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts +88 -0
  94. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts.map +1 -0
  95. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js +3 -0
  96. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js.map +1 -0
  97. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts +12 -0
  98. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts.map +1 -0
  99. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js +72 -0
  100. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js.map +1 -0
  101. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts +19 -0
  102. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts.map +1 -0
  103. package/build/_modules/discord-bot/_services/dibo-io.control-service.js +176 -0
  104. package/build/_modules/discord-bot/_services/dibo-io.control-service.js.map +1 -0
  105. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts +85 -0
  106. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts.map +1 -0
  107. package/build/_modules/discord-bot/_services/dibo-main.control-service.js +228 -0
  108. package/build/_modules/discord-bot/_services/dibo-main.control-service.js.map +1 -0
  109. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts +13 -0
  110. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts.map +1 -0
  111. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js +38 -0
  112. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js.map +1 -0
  113. package/build/_modules/discord-bot/index.d.ts +12 -0
  114. package/build/_modules/discord-bot/index.d.ts.map +1 -0
  115. package/build/_modules/discord-bot/index.js +30 -0
  116. package/build/_modules/discord-bot/index.js.map +1 -0
  117. package/build/_modules/oauth2/index.d.ts.map +1 -1
  118. package/build/_modules/oauth2/index.js +7 -0
  119. package/build/_modules/oauth2/index.js.map +1 -1
  120. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts +74 -0
  121. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts.map +1 -0
  122. package/build/_modules/open-ai/_collections/oai-chunking.util.js +385 -0
  123. package/build/_modules/open-ai/_collections/oai-chunking.util.js.map +1 -0
  124. package/build/_modules/open-ai/_collections/oai-document.util.d.ts +4 -0
  125. package/build/_modules/open-ai/_collections/oai-document.util.d.ts.map +1 -0
  126. package/build/_modules/open-ai/_collections/oai-document.util.js +12 -0
  127. package/build/_modules/open-ai/_collections/oai-document.util.js.map +1 -0
  128. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts +3 -0
  129. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts.map +1 -0
  130. package/build/_modules/open-ai/_collections/oai-global-settings.const.js +9 -0
  131. package/build/_modules/open-ai/_collections/oai-global-settings.const.js.map +1 -0
  132. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts +3 -0
  133. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts.map +1 -0
  134. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js +75 -0
  135. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js.map +1 -0
  136. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts +3 -0
  137. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts.map +1 -0
  138. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js +68 -0
  139. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js.map +1 -0
  140. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts +6 -0
  141. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts.map +1 -0
  142. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js +10 -0
  143. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js.map +1 -0
  144. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts +18 -0
  145. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -0
  146. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +40 -0
  147. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -0
  148. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts +7 -0
  149. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts.map +1 -0
  150. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js +3 -0
  151. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js.map +1 -0
  152. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts +14 -0
  153. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts.map +1 -0
  154. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js +3 -0
  155. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js.map +1 -0
  156. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +6 -0
  157. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts.map +1 -0
  158. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js +3 -0
  159. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js.map +1 -0
  160. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts +6 -0
  161. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -0
  162. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +3 -0
  163. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -0
  164. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts +52 -0
  165. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts.map +1 -0
  166. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js +3 -0
  167. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js.map +1 -0
  168. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts +13 -0
  169. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts.map +1 -0
  170. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js +3 -0
  171. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js.map +1 -0
  172. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts +18 -0
  173. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts.map +1 -0
  174. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js +80 -0
  175. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js.map +1 -0
  176. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts +13 -0
  177. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts.map +1 -0
  178. package/build/_modules/open-ai/_services/oai-chunk.service-base.js +170 -0
  179. package/build/_modules/open-ai/_services/oai-chunk.service-base.js.map +1 -0
  180. package/build/_modules/open-ai/_services/{embedding.control-service.d.ts → oai-embedding.control-service.d.ts} +3 -3
  181. package/build/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -0
  182. package/build/_modules/open-ai/_services/{embedding.control-service.js → oai-embedding.control-service.js} +5 -5
  183. package/build/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -0
  184. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +161 -0
  185. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -0
  186. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js +332 -0
  187. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -0
  188. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts +231 -0
  189. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -0
  190. package/build/_modules/open-ai/_services/oai-llm.service-base.js +438 -0
  191. package/build/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -0
  192. package/build/_modules/open-ai/_services/{vector-data.service.d.ts → oai-vector-data.service.d.ts} +4 -4
  193. package/build/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +1 -0
  194. package/build/_modules/open-ai/_services/{vector-data.service.js → oai-vector-data.service.js} +27 -7
  195. package/build/_modules/open-ai/_services/oai-vector-data.service.js.map +1 -0
  196. package/build/_modules/open-ai/index.d.ts +18 -4
  197. package/build/_modules/open-ai/index.d.ts.map +1 -1
  198. package/build/_modules/open-ai/index.js +35 -4
  199. package/build/_modules/open-ai/index.js.map +1 -1
  200. package/build/_modules/server/index.d.ts +1 -1
  201. package/build/_modules/server/index.d.ts.map +1 -1
  202. package/build/_modules/server/index.js +16 -2
  203. package/build/_modules/server/index.js.map +1 -1
  204. package/build/_modules/server/server-status/server-status.controller.d.ts.map +1 -1
  205. package/build/_modules/server/server-status/server-status.controller.js +10 -0
  206. package/build/_modules/server/server-status/server-status.controller.js.map +1 -1
  207. package/build/_modules/socket/index.d.ts.map +1 -1
  208. package/build/_modules/socket/index.js +18 -0
  209. package/build/_modules/socket/index.js.map +1 -1
  210. package/build/_modules/test/index.d.ts.map +1 -1
  211. package/build/_modules/test/index.js +5 -0
  212. package/build/_modules/test/index.js.map +1 -1
  213. package/build/_modules/usage/index.d.ts.map +1 -1
  214. package/build/_modules/usage/index.js +5 -0
  215. package/build/_modules/usage/index.js.map +1 -1
  216. package/build/_services/server/app.server.js +1 -2
  217. package/build/_services/server/app.server.js.map +1 -1
  218. package/build/index.d.ts +3 -1
  219. package/build/index.d.ts.map +1 -1
  220. package/build/index.js +26 -1
  221. package/build/index.js.map +1 -1
  222. package/package.json +40 -10
  223. package/src/_collections/atlas-default-db-options.const.ts +10 -0
  224. package/src/_collections/get-environment-settings.util.ts +49 -0
  225. package/src/_collections/global-settings.const.ts +15 -4
  226. package/src/_collections/sample.env +21 -0
  227. package/src/_models/control-models/app-params.control-model.spec.ts +5 -4
  228. package/src/_models/control-models/app-params.control-model.ts +31 -2
  229. package/src/_models/control-models/endpoint-params.control-model.ts +1 -1
  230. package/src/_models/interfaces/environment-settings.interface.ts +59 -0
  231. package/src/_models/interfaces/global-settings.interface.ts +41 -1
  232. package/src/_modules/custom-data/index.ts +3 -0
  233. package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +19 -0
  234. package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +20 -0
  235. package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +46 -0
  236. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +152 -0
  237. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +59 -0
  238. package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +28 -0
  239. package/src/_modules/discord-assistant/_services/dias.service-base.ts +81 -0
  240. package/src/_modules/discord-assistant/index.ts +36 -0
  241. package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +11 -0
  242. package/src/_modules/discord-assistant-voiced/index.ts +36 -0
  243. package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +17 -0
  244. package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +56 -0
  245. package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +372 -0
  246. package/src/_modules/discord-bot/_models/dibo-command.interface.ts +12 -0
  247. package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +8 -0
  248. package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +6 -0
  249. package/src/_modules/discord-bot/_models/global-bot-log-settings.interface.ts +98 -0
  250. package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +120 -0
  251. package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +245 -0
  252. package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +304 -0
  253. package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +60 -0
  254. package/src/_modules/discord-bot/index.ts +36 -0
  255. package/src/_modules/oauth2/index.ts +8 -0
  256. package/src/_modules/open-ai/_collections/oai-chunking.util.ts +496 -0
  257. package/src/_modules/open-ai/_collections/oai-document.util.ts +10 -0
  258. package/src/_modules/open-ai/_collections/oai-global-settings.const.ts +9 -0
  259. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +83 -0
  260. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +76 -0
  261. package/src/_modules/open-ai/_enums/oai-compare-result-type.enum.ts +7 -0
  262. package/src/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +45 -0
  263. package/src/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.ts +10 -0
  264. package/src/_modules/open-ai/_models/interfaces/oai-document-page.interface.ts +20 -0
  265. package/src/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +8 -0
  266. package/src/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +7 -0
  267. package/src/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +57 -0
  268. package/src/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.ts +18 -0
  269. package/src/_modules/open-ai/_models/oai-doc-chunk.data-model.ts +92 -0
  270. package/src/_modules/open-ai/_services/oai-chunk.service-base.ts +214 -0
  271. package/src/_modules/open-ai/_services/{embedding.control-service.ts → oai-embedding.control-service.ts} +2 -2
  272. package/src/_modules/open-ai/_services/oai-llm-chat.service-base.ts +609 -0
  273. package/src/_modules/open-ai/_services/oai-llm.service-base.ts +648 -0
  274. package/src/_modules/open-ai/_services/{vector-data.service.ts → oai-vector-data.service.ts} +32 -5
  275. package/src/_modules/open-ai/index.ts +42 -4
  276. package/src/_modules/server/index.ts +18 -2
  277. package/src/_modules/server/server-status/server-status.controller.ts +13 -0
  278. package/src/_modules/socket/index.ts +23 -0
  279. package/src/_modules/test/index.ts +8 -0
  280. package/src/_modules/usage/index.ts +8 -0
  281. package/src/_services/server/app.server.ts +1 -1
  282. package/src/index.ts +28 -1
  283. package/build/_modules/open-ai/_services/embedding.control-service.d.ts.map +0 -1
  284. package/build/_modules/open-ai/_services/embedding.control-service.js.map +0 -1
  285. package/build/_modules/open-ai/_services/gpt.service-base.d.ts +0 -98
  286. package/build/_modules/open-ai/_services/gpt.service-base.d.ts.map +0 -1
  287. package/build/_modules/open-ai/_services/gpt.service-base.js +0 -284
  288. package/build/_modules/open-ai/_services/gpt.service-base.js.map +0 -1
  289. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts +0 -21
  290. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts.map +0 -1
  291. package/build/_modules/open-ai/_services/open-ai.service-base.js +0 -50
  292. package/build/_modules/open-ai/_services/open-ai.service-base.js.map +0 -1
  293. package/build/_modules/open-ai/_services/vector-data.service.d.ts.map +0 -1
  294. package/build/_modules/open-ai/_services/vector-data.service.js.map +0 -1
  295. package/build/_services/server/env-set.d.ts +0 -2
  296. package/build/_services/server/env-set.d.ts.map +0 -1
  297. package/build/_services/server/env-set.js +0 -20
  298. package/build/_services/server/env-set.js.map +0 -1
  299. package/src/_modules/open-ai/_services/gpt.service-base.ts +0 -438
  300. package/src/_modules/open-ai/_services/open-ai.service-base.ts +0 -69
  301. package/src/_services/server/env-set.ts +0 -21
@@ -0,0 +1,98 @@
1
+ import { GatewayIntentBits, Partials } from 'discord.js';
2
+ import { DyNTS_DiBo_Command } from './dibo-command.interface';
3
+
4
+ export interface DyNTS_DiBo_Global_Settings {
5
+ /**
6
+ * this setting will set the debug level for the bot
7
+ *
8
+ * 0 - no logs
9
+ * 1 - errors sending to report channel
10
+ * 2 - errors sending as response, will log events in console
11
+ * 3 - errors sending as response, creating reports to report channel, debug events are in console (default)
12
+ * 4 - errors and debug events are sending as response
13
+ * 5 - all events are sending as response (that are set to send)
14
+ * 6 - all debug logs are enabled
15
+ *
16
+ * _
17
+ */
18
+ debugLevel: number;
19
+
20
+ /**
21
+ * this setting will set the intents for the bot
22
+ */
23
+ intents: GatewayIntentBits[];
24
+
25
+ /**
26
+ * this setting will set the partials for the bot
27
+ */
28
+ partials: Partials[];
29
+
30
+ allowedUsers: 'all' | string[];
31
+
32
+ messageSettings: {
33
+ /**
34
+ * this setting will set the time limit for message fetching
35
+ * so we will stop fetching messages sent later than this time
36
+ */
37
+ messageFetchTimeLimit: number;
38
+ /**
39
+ * this setting will set the count limit for message fetching
40
+ * so we will stop fetching messages after this count
41
+ */
42
+ messageFetchCountLimit: number;
43
+ /**
44
+ * this setting will set the delay for message sending,
45
+ * so we won't flood the channel too fast
46
+ */
47
+ messageSendDelay: number;
48
+
49
+ /**
50
+ * this setting will be used to skip answering to messages
51
+ * if the message contains any of these flags, the bot will not answer
52
+ *
53
+ * @default [ '[BOT-SKIP]' ]
54
+ */
55
+ skipFlags: string[];
56
+ };
57
+
58
+ /**
59
+ * this setting will set the channel settings for the bot
60
+ */
61
+ channelSettings: {
62
+ /**
63
+ * this setting will set the name of the channel where the bot will send the reports
64
+ *
65
+ * @default 'bot-report'
66
+ */
67
+ reportChannelName: string;
68
+
69
+ /**
70
+ * this setting will set the channels where the bot will answer automatically
71
+ * whenever a message is sent in one of these channels, that is not from the bot
72
+ *
73
+ * it will be populated automatically from the default channels
74
+ */
75
+ allowedChannels: string[];
76
+ /**
77
+ * this setting will set if the bot can answer in Direct Messages Channels
78
+ *
79
+ * @default false
80
+ */
81
+ dmIsAllowed: boolean;
82
+
83
+ /**
84
+ * this setting will set the default channels where the bot will answer automatically
85
+ * whenever a message is sent in one of these channels, that is not from the bot
86
+ *
87
+ * @default [ 'bot-report' ]
88
+ */
89
+ defaultChannels: string[];
90
+ };
91
+
92
+ commandSettings: {
93
+ commandOperator: string;
94
+ commands: DyNTS_DiBo_Command[];
95
+ };
96
+
97
+ allowBotsInteractEachOther: boolean;
98
+ }
@@ -0,0 +1,120 @@
1
+
2
+ import { Guild, Message } from 'discord.js';
3
+
4
+ import { DyFM_Error } from '@futdevpro/fsm-dynamo';
5
+
6
+ import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
7
+ import { DyNTS_DiBo_Main_ControlService } from './dibo-main.control-service';
8
+ import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
9
+ import { DyNTS_DiBo_global_settings } from '../_collections/dibo-global-settings.conts';
10
+
11
+
12
+ export abstract class Commands_ControlService extends DyNTS_SingletonService {
13
+
14
+ static getInstance(): Commands_ControlService {
15
+ return Commands_ControlService.getSingletonInstance();
16
+ }
17
+
18
+ protected abstract getMainDiscordBotControlService(): DyNTS_DiBo_Main_ControlService;
19
+ protected readonly mainDiscordBot_CS: DyNTS_DiBo_Main_ControlService =
20
+ this.getMainDiscordBotControlService();
21
+
22
+ get discordServer(): Guild {
23
+ return this.mainDiscordBot_CS.discordServer;
24
+ }
25
+
26
+ protected constructor() {
27
+ super();
28
+
29
+ if (!this.discordServer) {
30
+ throw new DyFM_Error({
31
+ ...this.getDefaultErrorSettings(
32
+ 'constructor',
33
+ new Error(
34
+ 'Discord server not yet initialized, ' +
35
+ 'should only be called after DyNTS_DiBo_Main_ControlService.start'
36
+ ),
37
+ 'system-init'
38
+ ),
39
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-CCS-C00`,
40
+ })
41
+ }
42
+ }
43
+
44
+ async handleCommand(message: Message, issuer: string): Promise<void> {
45
+ try {
46
+ let haveCommandOperator = false;
47
+ let msg = message.content.replace(
48
+ `<@${this.mainDiscordBot_CS.client.user.id}>`, ''
49
+ ).trim();
50
+
51
+ if (!DyNTS_DiBo_global_settings.commandSettings.commandOperator) {
52
+ haveCommandOperator = true;
53
+ } else if (
54
+ msg.startsWith(DyNTS_DiBo_global_settings.commandSettings.commandOperator)
55
+ ) {
56
+ haveCommandOperator = true;
57
+ msg = msg.replace(DyNTS_DiBo_global_settings.commandSettings.commandOperator, '');
58
+ }
59
+
60
+ if (!haveCommandOperator) {
61
+ throw new DyFM_Error({
62
+ ...this.getDefaultErrorSettings(
63
+ 'handleCommand',
64
+ new Error('No command operator found in the message'),
65
+ issuer
66
+ ),
67
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-CCS-HC1`,
68
+ })
69
+ }
70
+
71
+ const commandExists = DyNTS_DiBo_global_settings.commandSettings.commands.find(
72
+ (command) => msg.startsWith(command.command)
73
+ );
74
+
75
+ if (!commandExists) {
76
+ throw new DyFM_Error({
77
+ ...this.getDefaultErrorSettings(
78
+ 'handleCommand',
79
+ new Error(`Command not found: "${msg.split(' ')[0]}"`),
80
+ issuer
81
+ ),
82
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-CCS-HC2`,
83
+ })
84
+ }
85
+
86
+ if (commandExists.permissionNeeded) {
87
+ const permissionNeeded = await commandExists.permissionNeeded(message);
88
+
89
+ if (!permissionNeeded) {
90
+ throw new DyFM_Error({
91
+ ...this.getDefaultErrorSettings(
92
+ 'handleCommand',
93
+ new Error('Permission needed'),
94
+ issuer
95
+ ),
96
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-CCS-HC3`,
97
+ })
98
+ }
99
+ }
100
+
101
+ await commandExists.commandHandler(message);
102
+ } catch (error) {
103
+ message.reply(
104
+ `Error occurred while handling the command:\n` +
105
+ DyFM_Error.getAnyMessage(error)
106
+ )
107
+
108
+ throw new DyFM_Error({
109
+ ...this.getDefaultErrorSettings('handleCommand', error, issuer),
110
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-CCS-HC0`,
111
+ })
112
+ }
113
+ }
114
+
115
+ }
116
+
117
+
118
+
119
+
120
+
@@ -0,0 +1,245 @@
1
+ import { Client, GatewayIntentBits, Guild, Collection, GuildMember, Message, TextChannel } from 'discord.js'
2
+ import * as dotenv from 'dotenv'
3
+ import { DyFM_Error, DyFM_Log, hour, week } from '@futdevpro/fsm-dynamo'
4
+ import { DyNTS_DiBo_Routines_ControlService } from './dibo-routines.control-service'
5
+ import { Commands_ControlService } from './dibo-commands.control-service'
6
+ import { DyNTS_SingletonService } from '../../../_services/base/singleton.service'
7
+ import { DyNTS_DiBo_Main_ControlService } from './dibo-main.control-service'
8
+ import { DyNTS_global_settings } from '../../../_collections/global-settings.const'
9
+ import { DyNTS_DiBo_global_settings } from '../_collections/dibo-global-settings.conts'
10
+
11
+ /* type T_Main_CS = DyNTS_DiBo_Main_ControlService; */
12
+
13
+ export abstract class DyNTS_DiBo_IO_ControlService extends DyNTS_SingletonService {
14
+
15
+ /* static getInstance(): DyNTS_DiBo_IO_ControlService {
16
+ return DyNTS_DiBo_IO_ControlService.getSingletonInstance();
17
+ } */
18
+
19
+ protected readonly mainDiscordBot_CS: DyNTS_DiBo_Main_ControlService;
20
+
21
+ get discordServer(): Guild {
22
+ return this.mainDiscordBot_CS.discordServer;
23
+ }
24
+ get botClientId(): string {
25
+ return this.mainDiscordBot_CS.botClientId;
26
+ }
27
+ get botDisplayName(): string {
28
+ return this.mainDiscordBot_CS.botDisplayName;
29
+ }
30
+
31
+ protected abstract getCommandsControlService(): Commands_ControlService;
32
+ protected readonly commands_CS: Commands_ControlService = this.getCommandsControlService();
33
+
34
+ protected constructor() {
35
+ super();
36
+
37
+ if (!this.discordServer) {
38
+ throw new DyFM_Error({
39
+ ...this.getDefaultErrorSettings(
40
+ 'constructor',
41
+ new Error(
42
+ 'Discord server not yet initialized, ' +
43
+ 'should only be called after DyNTS_DiBo_Main_ControlService.start'
44
+ ),
45
+ 'system-init'
46
+ ),
47
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-C000`,
48
+ })
49
+ }
50
+ }
51
+
52
+ async handleNewMessage(message: Message, issuer: string): Promise<void> {
53
+ try {
54
+ if (DyNTS_DiBo_global_settings.debugLevel >= 1) {
55
+ DyFM_Log.log(`incoming message: (${message.author.displayName}) ${message.content}`)
56
+ }
57
+
58
+ const isForYou = await this.getMessageIsForBotToHandle(message, issuer);
59
+
60
+ if (!isForYou) {
61
+ return;
62
+ }
63
+
64
+ const isHandledAsCommand = await this.handleIfCommand(message, issuer);
65
+
66
+ if (isHandledAsCommand) {
67
+ return;
68
+ }
69
+
70
+ await this.handleMessage(message, issuer);
71
+ } catch (error) {
72
+ DyFM_Error.logSimple('❌❌ Error handleNewMessage:', error);
73
+
74
+ if (DyNTS_DiBo_global_settings.debugLevel >= 1) {
75
+ await message.reply(
76
+ `[SYSTEM|ERROR] Error occurred while handling the message:\n` +
77
+ DyFM_Error.getAnyMessage(error)
78
+ ).catch(error => {
79
+ DyFM_Error.logSimple('❌❌ Error sending message to report channel:', error);
80
+ });
81
+ }
82
+
83
+ throw new DyFM_Error({
84
+ ...this.getDefaultErrorSettings('handleNewMessage', error, issuer),
85
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-MCS-H0`,
86
+ })
87
+ }
88
+ }
89
+
90
+ abstract handleMessage(message: Message, issuer: string): Promise<void>;
91
+
92
+ async getMessageIsForBotToHandle(message: Message, issuer: string): Promise<boolean> {
93
+ try {
94
+ const messageIsReplyTo: Message = message.channel.messages.cache.get(
95
+ message?.reference?.messageId
96
+ );
97
+ const isReplyForYou = messageIsReplyTo && messageIsReplyTo.author.id === this.botClientId;
98
+ const isPinged = message.content.includes(this.botClientId) ||
99
+ message.cleanContent.includes(`@${this.botDisplayName}`) ||
100
+ isReplyForYou;
101
+ const isOwnMessage = message.author.id === this.botClientId ||
102
+ message.author.displayName === this.botDisplayName;
103
+ const haveSkipFlags = DyNTS_DiBo_global_settings.messageSettings.skipFlags.some(
104
+ flag => message.content.includes(flag)
105
+ );
106
+ const channelName = (message.channel as TextChannel)?.name;
107
+ const isInDefaultChannel = DyNTS_DiBo_global_settings.channelSettings.defaultChannels.includes(
108
+ channelName
109
+ );
110
+ const isDMChannel = message.channel.isDMBased();
111
+ const isAllowedChannel = DyNTS_DiBo_global_settings.channelSettings.allowedChannels.includes(
112
+ channelName
113
+ ) || (isDMChannel && DyNTS_DiBo_global_settings.channelSettings.dmIsAllowed);
114
+ const isAllowedUser = DyNTS_DiBo_global_settings.allowedUsers === 'all' ||
115
+ DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.id) ||
116
+ DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.username) ||
117
+ DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.displayName);
118
+
119
+ if (!isAllowedChannel) {
120
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
121
+ DyFM_Log.warn('🚫❌ not allowed channel. END')
122
+ }
123
+
124
+ return false;
125
+ }
126
+
127
+ if (isOwnMessage) {
128
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
129
+ DyFM_Log.warn('🚫🤖 will not answer; own message')
130
+ }
131
+
132
+ return false;
133
+ }
134
+
135
+ if (haveSkipFlags) {
136
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
137
+ DyFM_Log.warn('🚫🏳️ not for me; this message have some skip flags:',
138
+ DyNTS_DiBo_global_settings.messageSettings.skipFlags.filter(
139
+ flag => message.content.includes(flag)
140
+ ),
141
+ message.content
142
+ )
143
+ }
144
+
145
+ return false;
146
+ }
147
+
148
+ if (
149
+ isPinged &&
150
+ !isOwnMessage &&
151
+ message.author.bot &&
152
+ !DyNTS_DiBo_global_settings.allowBotsInteractEachOther
153
+ ) {
154
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
155
+ DyFM_Log.warn('🚫🤖❌ not for me; this message is from a bot')
156
+ message.reply('[SYSTEM|REFUSE|BOT] You should not ping me!')
157
+ }
158
+
159
+ return false;
160
+ }
161
+
162
+ if (!isPinged && !isOwnMessage && !isInDefaultChannel) {
163
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
164
+ DyFM_Log.warn('🚫 not for me; not pinged, and not my message, and not in default channel')
165
+ }
166
+
167
+ return false;
168
+ }
169
+
170
+ if (!isAllowedUser) {
171
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
172
+ DyFM_Log.warn('🚫❌ not allowed user. END', message.author.username, message.author.displayName)
173
+ message.reply(
174
+ `[SYSTEM|REFUSE|USER] I'm sorry, but I'm not allowed to answer you!`
175
+ )
176
+ }
177
+
178
+ return false;
179
+ }
180
+
181
+ if (!message.channel.isTextBased()) {
182
+ if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
183
+ DyFM_Log.warn('🚫❌ not text based channel. END')
184
+ }
185
+
186
+ return false;
187
+ }
188
+
189
+ return true;
190
+ } catch (error) {
191
+ throw new DyFM_Error({
192
+ ...this.getDefaultErrorSettings('getMessageIsForBotToHandle', error, issuer),
193
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-MCS-G0`,
194
+ })
195
+ }
196
+ }
197
+
198
+ async handleIfCommand(message: Message, issuer: string): Promise<boolean> {
199
+ try {
200
+ const isCommand = await this.isCommand(message, issuer);
201
+
202
+ if (isCommand) {
203
+ await this.commands_CS.handleCommand(message, issuer);
204
+ }
205
+
206
+ return Boolean(isCommand);
207
+ } catch (error) {
208
+ throw new DyFM_Error({
209
+ ...this.getDefaultErrorSettings('handleIfCommand', error, issuer),
210
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-HIC0`,
211
+ })
212
+ }
213
+ }
214
+
215
+ async isCommand(message: Message, issuer: string): Promise<boolean> {
216
+ try {
217
+ let haveCommandOperator = false;
218
+
219
+ if (!DyNTS_DiBo_global_settings.commandSettings.commandOperator) {
220
+ haveCommandOperator = true;
221
+ } else if (
222
+ message.content.trim().startsWith(DyNTS_DiBo_global_settings.commandSettings.commandOperator)
223
+ ) {
224
+ haveCommandOperator = true;
225
+ }
226
+
227
+ if (!haveCommandOperator) {
228
+ return false;
229
+ }
230
+
231
+ const commandExists = DyNTS_DiBo_global_settings.commandSettings.commands.find(
232
+ (command) => message.content.trim().startsWith(
233
+ `${DyNTS_DiBo_global_settings.commandSettings.commandOperator}${command.command}`
234
+ )
235
+ );
236
+
237
+ return Boolean(commandExists);
238
+ } catch (error) {
239
+ throw new DyFM_Error({
240
+ ...this.getDefaultErrorSettings('isCommand', error, issuer),
241
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-IC0`,
242
+ })
243
+ }
244
+ }
245
+ }