@yrpri/api 9.0.139 → 9.0.141

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 (322) hide show
  1. package/agents/assistants/agentAssistant.js +4 -3
  2. package/agents/assistants/baseAssistant.js +72 -71
  3. package/agents/assistants/baseAssistantWithVoice.js +6 -5
  4. package/agents/assistants/modes/agentDirectConnection.js +8 -7
  5. package/agents/assistants/modes/agentSelectionMode.js +2 -1
  6. package/agents/assistants/modes/baseAssistantMode.js +3 -2
  7. package/agents/assistants/modes/tools/agentTools.js +11 -10
  8. package/agents/assistants/modes/tools/loginTools.js +7 -6
  9. package/agents/assistants/modes/tools/models/agents.js +6 -5
  10. package/agents/assistants/modes/tools/models/subscriptions.js +7 -6
  11. package/agents/assistants/modes/tools/navigationTools.js +7 -6
  12. package/agents/assistants/modes/tools/subscriptionTools.js +12 -11
  13. package/agents/assistants/modes/tools/workflowConverstationTools.js +7 -6
  14. package/agents/assistants/voiceAssistant.js +45 -44
  15. package/agents/controllers/agentProductController.js +8 -7
  16. package/agents/controllers/agentSubscriptionController.js +13 -12
  17. package/agents/controllers/assistantsController.js +45 -44
  18. package/agents/controllers/policySynthAgents.js +33 -32
  19. package/agents/managers/emailInvitesManager.js +4 -3
  20. package/agents/managers/newAiModelSetup.js +46 -45
  21. package/agents/managers/notificationAgentQueueManager.js +55 -54
  22. package/agents/managers/subscriptionManager.js +24 -23
  23. package/agents/models/agentProduct.js +2 -1
  24. package/agents/models/agentProductBoosterPurchase.js +2 -1
  25. package/agents/models/testData/createEvolyAgentProduct.js +7 -6
  26. package/agents/models/testData/old/updateAgentWorkflowConfiguration.js +5 -4
  27. package/agents/models/testData/updateAgentWorkflowConfiguration.js +5 -4
  28. package/agents/tools/setTemplateWorkflowCommunityId.js +6 -5
  29. package/app.d.ts +2 -1
  30. package/app.js +60 -34
  31. package/authorization.cjs +4 -4
  32. package/controllers/allOurIdeas.js +45 -44
  33. package/controllers/groups.cjs +4 -9
  34. package/controllers/images.cjs +8 -8
  35. package/controllers/index.cjs +1 -1
  36. package/controllers/points.cjs +1 -1
  37. package/controllers/posts.cjs +3 -3
  38. package/deleteUnwantedDeclerations.cjs +6 -5
  39. package/models/community.cjs +1 -1
  40. package/models/domain.cjs +7 -7
  41. package/models/image.cjs +2 -2
  42. package/models/index.cjs +8 -4
  43. package/models/post.cjs +10 -10
  44. package/models/user.cjs +1 -1
  45. package/models/video.cjs +4 -4
  46. package/package.json +5 -5
  47. package/scripts/addRatingUsersToGroup.js +1 -1
  48. package/scripts/addUserToOrganization.js +8 -8
  49. package/scripts/agents/changeModelForWorkflowGroupTemplate.js +13 -12
  50. package/scripts/agents/generateAgentWorkflowTemplateFromAgentClass.js +5 -4
  51. package/scripts/analyseRatingsForCommunity.js +2 -2
  52. package/scripts/analyzeAndFixBrokenPointUsers.js +3 -3
  53. package/scripts/analyzeEndorsementsByCountry.js +7 -7
  54. package/scripts/analyzePostsForCommunity.js +1 -1
  55. package/scripts/bulkStatusUpdates/listUpdates.js +2 -2
  56. package/scripts/bulkStatusUpdates/mergeLatestPostsToUpdate.js +5 -5
  57. package/scripts/bulkStatusUpdates/performUpdate.js +9 -9
  58. package/scripts/bulkStatusUpdates/performUpdateForGroup.cjs +12 -11
  59. package/scripts/bulkStatusUpdates/performUpdateForStatus.js +15 -15
  60. package/scripts/change/changeVideoAspectTo.js +3 -3
  61. package/scripts/change/setUseNewVersion.cjs +5 -4
  62. package/scripts/changeCommunityGroupcount.js +3 -3
  63. package/scripts/changeCommunityPostCount.js +3 -3
  64. package/scripts/changeGroupPostCount.js +3 -3
  65. package/scripts/changeLanguage.js +4 -4
  66. package/scripts/changeOfficalStatus.js +3 -3
  67. package/scripts/cleanups/deleteAnonNotifications.cjs +8 -7
  68. package/scripts/cleanups/deleteLinkGroupsWithDeletedCommunities.js +8 -8
  69. package/scripts/cleanups/deleteYearOldNotifications.cjs +6 -5
  70. package/scripts/cleanups/removeAllUsersFromHiddenPublicGroup.js +5 -5
  71. package/scripts/clearAllEndorsementInGroup.js +5 -5
  72. package/scripts/cloning/clearUsersForCommunitiesFromUrl.js +3 -3
  73. package/scripts/cloning/cloneFromUrlScript.js +4 -4
  74. package/scripts/cloning/cloneWBFromUrlScriptAndCreateLinks.js +6 -6
  75. package/scripts/cloning/cloneWBFromUrlScriptNoUsersOrPoints.js +6 -6
  76. package/scripts/cloning/cloneWBSerbianFromUrlScriptAndCreateLinks.js +6 -6
  77. package/scripts/cloning/copyCommunityConfigAndTranslationsFromURL.js +3 -3
  78. package/scripts/cloning/copyCommunityOneGroupToDomainNoUsersNoEndorsements.js +2 -2
  79. package/scripts/cloning/copyCommunityToDomainNoUsersNoEndorsements.js +2 -2
  80. package/scripts/cloning/copyCommunityToDomainWithEverything.js +2 -2
  81. package/scripts/cloning/copyCommunityToDomainWithOnlyGroups.js +3 -3
  82. package/scripts/cloning/copyGroupConfigAndTranslationsFromURL.js +3 -3
  83. package/scripts/cloning/copyPostToGroupOld.js +12 -12
  84. package/scripts/cloning/copyPostVideosFromURL.js +3 -3
  85. package/scripts/cloning/copyPostWithOutAnyVotingOrActivities.js +2 -2
  86. package/scripts/cloning/deepCloneSerbianWBFromUrlScriptAndCreateLinks.js +7 -7
  87. package/scripts/cloning/deepCloneWBFromUrlScriptAndCreateLinks.js +6 -6
  88. package/scripts/cloning/setAdminsFromURL.js +5 -5
  89. package/scripts/cloning/setExternalIdsFromURL.js +3 -3
  90. package/scripts/countCommunity.js +11 -11
  91. package/scripts/countCommunityUsers.js +4 -4
  92. package/scripts/countDelayedNotifications.js +3 -3
  93. package/scripts/countGroup.js +11 -11
  94. package/scripts/countStuff.js +3 -3
  95. package/scripts/countUniqueVotersInAGroup.js +3 -3
  96. package/scripts/createInvitesAndShow.js +2 -2
  97. package/scripts/database/sync_database.js +2 -2
  98. package/scripts/database/sync_dev_database.js +3 -3
  99. package/scripts/debugNotifications.js +5 -5
  100. package/scripts/deleteAllNewsFeeds.js +2 -2
  101. package/scripts/deleteCategory.js +1 -1
  102. package/scripts/deleteOldAppActivities.js +5 -4
  103. package/scripts/deletePostContactDataForCommunity.js +5 -4
  104. package/scripts/destroy/destroy_all_but_one_domain.js +59 -59
  105. package/scripts/displayAuthorForPost.js +1 -1
  106. package/scripts/domains/createDomain.js +5 -4
  107. package/scripts/domains/importDomainsFromXls.js +7 -6
  108. package/scripts/endorsementFraudDetection/analyseEndorsementsForCommunity.js +2 -2
  109. package/scripts/endorsementFraudDetection/bulkDeleteDuplicateEndorsmentsFromUrl.js +9 -9
  110. package/scripts/exportAllStatusChanges.js +5 -5
  111. package/scripts/exportEndorsementsForCommunity.js +5 -5
  112. package/scripts/exportPointQualitiesForCommunity.js +5 -5
  113. package/scripts/exportPostsAndPointsForCommunity.js +9 -9
  114. package/scripts/exportPostsDataSetForDomain.js +12 -12
  115. package/scripts/exportPostsForGroup.js +7 -7
  116. package/scripts/exportRatingsForPost.js +2 -2
  117. package/scripts/exportUserEndorsementsWithUserAnalysis.js +6 -6
  118. package/scripts/exportUsersForCommunity.js +3 -3
  119. package/scripts/exportUsersForDomain.js +3 -3
  120. package/scripts/exportUsersForGroup.js +3 -3
  121. package/scripts/exports/ratingDistribution.js +6 -6
  122. package/scripts/exports/whoEndorsedWhatByCommunity.js +2 -2
  123. package/scripts/findUnusedClientImports.js +2 -2
  124. package/scripts/fixAllPostPointCounts.js +1 -1
  125. package/scripts/fixAnonNotificationsSettings.js +5 -5
  126. package/scripts/fixCountKopavogur.js +1 -1
  127. package/scripts/fixEndorsementsAfterCopyPostToGroup.js +10 -10
  128. package/scripts/fixExternalUserId.js +2 -2
  129. package/scripts/fixGroupAccess.js +3 -3
  130. package/scripts/fixGroupIdeasAndPointsCount.js +2 -2
  131. package/scripts/fixNotificationSettings.js +4 -4
  132. package/scripts/fixSurveyRadioBakedInSubCodes.js +6 -6
  133. package/scripts/fixWrongUserIdForStatusUpdates.js +6 -5
  134. package/scripts/gallery/exportGalleryData.js +2 -2
  135. package/scripts/gallery/importGalleryForCommunity.js +14 -14
  136. package/scripts/gallery/readJsonAndDownloadImagesVersion2.js +6 -6
  137. package/scripts/gallery/refreshAcApiPostIdsForCommunity.js +5 -5
  138. package/scripts/genderAnalysis.js +10 -10
  139. package/scripts/genderAnalysisByStatus.js +4 -4
  140. package/scripts/importAllLocalesFromLocalFolders.js +7 -7
  141. package/scripts/importDomain.js +131 -131
  142. package/scripts/keys/addOidcToDomain.cjs +10 -9
  143. package/scripts/landUseGame/export3Ddata.js +15 -15
  144. package/scripts/listLanguagesForGroup.js +6 -6
  145. package/scripts/loadTestCreateDummyContentForGroup.js +2 -2
  146. package/scripts/makeRecursiveMapData.js +4 -4
  147. package/scripts/mapping/community_map_csv.js +5 -5
  148. package/scripts/moveCommunityToDomain.js +3 -3
  149. package/scripts/moveGroupToCommunity.js +3 -3
  150. package/scripts/movePostToGroup.js +5 -5
  151. package/scripts/movePostsToGroupsRecountGroupFromUrl.js +6 -6
  152. package/scripts/oldMovePostToGroup.js +9 -9
  153. package/scripts/processCsvForPdfUrls.js +2 -2
  154. package/scripts/processCsvForTranslationAndToxicity.js +10 -10
  155. package/scripts/recount/recount_recursive_communities.js +6 -6
  156. package/scripts/recountALLCommunityGroupCounts.js +4 -4
  157. package/scripts/recountAll.js +3 -3
  158. package/scripts/recountCommunitesFromUrl.js +3 -3
  159. package/scripts/recountCommunity.js +2 -2
  160. package/scripts/recountGroup.js +5 -5
  161. package/scripts/recountGroupNoUserChange.js +5 -5
  162. package/scripts/resetAllEndorsementsForGroup.js +3 -3
  163. package/scripts/resetEnTranslationForGroup.js +5 -5
  164. package/scripts/setAdminOnAll.cjs +15 -14
  165. package/scripts/setDomainAdmin.cjs +7 -6
  166. package/scripts/setDomainLocales.js +2 -2
  167. package/scripts/setEarlQuestionIdOnGroup.cjs +5 -4
  168. package/scripts/setLanguageOnGroupCommunitesFromUrl.js +3 -3
  169. package/scripts/setMemberOfAll.js +14 -14
  170. package/scripts/setNewUserForContentOfCommunity.js +9 -9
  171. package/scripts/setOfficialStatusOnAllPostsForCommunity.js +1 -1
  172. package/scripts/setUserOnAll.js +14 -14
  173. package/scripts/showCategoryForGroup.js +1 -1
  174. package/scripts/showOldActivityTypes.js +3 -3
  175. package/scripts/showPostsMissingCategoryForGroup.js +2 -2
  176. package/scripts/showStatuses.js +4 -4
  177. package/scripts/showUniqueVotersInCommunity.js +4 -4
  178. package/scripts/showUserAgentsAndIpsForEmails.js +4 -4
  179. package/scripts/simpleExportForGroupsForCommunity.js +5 -5
  180. package/scripts/simpleExportForPointsForCommunity.js +5 -5
  181. package/scripts/simpleExportForPostsForCommunity.js +5 -5
  182. package/scripts/testForEndorsments.js +4 -4
  183. package/scripts/undeleteGroupAndAllContent.js +8 -8
  184. package/scripts/undeletePost.js +7 -7
  185. package/scripts/unlinkSsn.js +4 -4
  186. package/scripts/updateFromAlthingi.js +8 -8
  187. package/scripts/users/createUserAddDomain.js +6 -5
  188. package/scripts/users/importUsersForDomainsFromXls.js +4 -3
  189. package/scripts/users/listDomainUsersWithSsn.js +6 -5
  190. package/scripts/users/removeUserFromDomain.js +6 -5
  191. package/scripts/users/updatePasswordFromSsn.js +5 -4
  192. package/scripts/users/updateUserSsnFromEmail.js +5 -4
  193. package/services/controllers/activities.cjs +1 -1
  194. package/services/controllers/news_feeds.cjs +1 -1
  195. package/services/controllers/notifications.cjs +1 -1
  196. package/services/controllers/recommendations.cjs +1 -1
  197. package/services/engine/allOurIdeas/aiHelper.js +10 -9
  198. package/services/engine/analytics/export_anon_community_activities.js +3 -3
  199. package/services/engine/analytics/importer.js +10 -10
  200. package/services/engine/analytics/plausible/manager.cjs +4 -4
  201. package/services/engine/analytics/statsCalc.cjs +1 -1
  202. package/services/engine/analytics/utils.cjs +11 -10
  203. package/services/engine/marketing/campaign.cjs +1 -0
  204. package/services/engine/moderation/fraud/CreateFraudAuditReport.cjs +2 -1
  205. package/services/engine/moderation/fraud/FraudBase.cjs +3 -2
  206. package/services/engine/moderation/fraud/FraudDeleteBase.cjs +5 -4
  207. package/services/engine/moderation/fraud/FraudGetBase.cjs +2 -1
  208. package/services/engine/moderation/fraud/FraudGetEndorsements.cjs +2 -1
  209. package/services/engine/moderation/fraud/FraudGetPointQualities.cjs +2 -1
  210. package/services/engine/moderation/fraud/FraudGetPoints.cjs +2 -1
  211. package/services/engine/moderation/fraud/FraudGetPosts.cjs +2 -1
  212. package/services/engine/moderation/fraud/FraudGetRatings.cjs +2 -1
  213. package/services/engine/moderation/fraud/FraudScannerNotifier.cjs +10 -9
  214. package/services/engine/moderation/get_moderation_items.cjs +1 -1
  215. package/services/engine/moderation/image_labeling/ImageLabelingBase.cjs +1 -1
  216. package/services/engine/moderation/process_moderation_items.cjs +1 -1
  217. package/services/engine/moderation/toxicity_analysis.cjs +1 -1
  218. package/services/engine/news_feeds/generate_dynamically.cjs +1 -1
  219. package/services/engine/news_feeds/generate_from_notifications.cjs +1 -1
  220. package/services/engine/notifications/emails_utils.cjs +2 -2
  221. package/services/engine/notifications/generate_point_notifications.cjs +1 -1
  222. package/services/engine/notifications/generate_post_notifications.cjs +1 -1
  223. package/services/engine/notifications/process_delayed_notifications.cjs +38 -38
  224. package/services/engine/notifications/process_general_notifications.cjs +1 -0
  225. package/services/engine/old/exporters/categories_dataset.js +11 -11
  226. package/services/engine/old/exporters/sentiment_dataset.js +12 -12
  227. package/services/engine/recommendations/events_importer.cjs +5 -5
  228. package/services/engine/recommendations/events_manager.cjs +1 -1
  229. package/services/engine/reports/add_points_to_sheet.cjs +3 -2
  230. package/services/engine/reports/commonUtils.js +3 -2
  231. package/services/engine/reports/common_utils.cjs +8 -8
  232. package/services/engine/reports/docx_group_report.cjs +1 -1
  233. package/services/engine/reports/xlsAllOurIdeasExport.js +16 -15
  234. package/services/engine/reports/xls_community_users_report.cjs +2 -2
  235. package/services/engine/reports/xls_group_report.cjs +1 -1
  236. package/services/llms/baseChatBot.js +12 -11
  237. package/services/llms/imageGeneration/chatGptImageGenerator.js +3 -2
  238. package/services/llms/imageGeneration/collectionImageGenerator.js +7 -6
  239. package/services/llms/imageGeneration/dalleImageGenerator.js +6 -5
  240. package/services/llms/imageGeneration/fluxImageGenerator.js +5 -4
  241. package/services/llms/imageGeneration/imageProcessorService.js +2 -1
  242. package/services/llms/imageGeneration/imagenImageGenerator.js +8 -7
  243. package/services/llms/imageGeneration/s3Service.js +12 -11
  244. package/services/llms/llmTranslation.js +30 -29
  245. package/services/models/ac_activity.cjs +1 -1
  246. package/services/models/ac_notification.cjs +1 -1
  247. package/services/models/ac_translation_cache.cjs +11 -11
  248. package/services/scripts/analytics/setup_all_plausible_goals.cjs +3 -2
  249. package/services/scripts/fix_old_delayed_notifications.js +3 -3
  250. package/services/scripts/kue_status.js +11 -11
  251. package/services/scripts/kue_watch_stuck_jobs.js +6 -6
  252. package/services/scripts/translation_clear_language.js +21 -21
  253. package/services/scripts/translation_delete.js +4 -4
  254. package/services/scripts/translation_replace_text_from_url.js +4 -4
  255. package/services/scripts/translation_update.js +4 -4
  256. package/services/scripts/translations_list.js +5 -5
  257. package/services/utils/airbrake.cjs +2 -1
  258. package/services/utils/redisConnection.cjs +6 -5
  259. package/services/utils/translation_helpers.cjs +3 -2
  260. package/services/utils/updateAllLocalesFromEn.js +20 -19
  261. package/services/utils/updateLocaleFolders.js +7 -6
  262. package/services/workers/activity.cjs +1 -1
  263. package/services/workers/anonymizations.cjs +1 -1
  264. package/services/workers/bulk_status_update.cjs +2 -2
  265. package/services/workers/delayed_jobs.cjs +1 -1
  266. package/services/workers/deletions.cjs +1 -1
  267. package/services/workers/email.cjs +1 -1
  268. package/services/workers/fraud_management.cjs +3 -3
  269. package/services/workers/generativeAi.js +6 -5
  270. package/services/workers/main.cjs +1 -1
  271. package/services/workers/marketing.cjs +1 -1
  272. package/services/workers/moderation.cjs +1 -1
  273. package/services/workers/notification_delivery.cjs +1 -1
  274. package/services/workers/notification_news_feed.cjs +1 -1
  275. package/services/workers/queue.cjs +2 -2
  276. package/services/workers/recount.cjs +1 -1
  277. package/services/workers/reports.cjs +1 -1
  278. package/services/workers/similarities.cjs +4 -2
  279. package/services/workers/speech_to_text.cjs +1 -1
  280. package/utils/airbrake.cjs +2 -1
  281. package/utils/cjsCodeReview.js +7 -6
  282. package/utils/community_mapping_tools.cjs +3 -2
  283. package/utils/copy_utils.cjs +32 -31
  284. package/utils/export_utils.cjs +7 -7
  285. package/utils/generateDocumentation.js +10 -9
  286. package/utils/logger.cjs +2 -23
  287. package/utils/logger.d.cts +1 -1
  288. package/utils/loggerAirbrakeTransport.cjs +52 -0
  289. package/utils/loggerAirbrakeTransport.d.cts +15 -0
  290. package/utils/loggerAirbrakeTransportTs.d.ts +15 -0
  291. package/utils/loggerAirbrakeTransportTs.js +45 -0
  292. package/utils/loggerCore.cjs +29 -0
  293. package/utils/loggerCore.d.cts +2 -0
  294. package/utils/loggerCoreTs.d.ts +2 -0
  295. package/utils/loggerCoreTs.js +23 -0
  296. package/utils/loggerTs.d.ts +1 -2
  297. package/utils/loggerTs.js +2 -25
  298. package/utils/manifest_generator.cjs +1 -0
  299. package/utils/recount_utils.cjs +6 -5
  300. package/utils/seedModels.js +50 -49
  301. package/utils/sitemap_generator.cjs +4 -4
  302. package/utils/ypLanguages.js +2 -2
  303. package/webSockets.js +8 -7
  304. package/services/utils/logger.cjs +0 -25
  305. package/services/utils/logger.d.cts +0 -2
  306. package/src/agents/assistants/assistant.d.ts +0 -156
  307. package/src/controllers/audios.d.ts +0 -5
  308. package/src/controllers/categories.d.ts +0 -5
  309. package/src/controllers/communities.d.ts +0 -5
  310. package/src/controllers/domains.d.ts +0 -5
  311. package/src/controllers/groups.d.ts +0 -5
  312. package/src/controllers/images.d.ts +0 -5
  313. package/src/controllers/points.d.ts +0 -5
  314. package/src/controllers/posts.d.ts +0 -5
  315. package/src/controllers/ratings.d.ts +0 -5
  316. package/src/controllers/users.d.ts +0 -5
  317. package/src/controllers/videos.d.ts +0 -5
  318. package/src/models/index.d.ts +0 -84
  319. package/src/services/controllers/activities.d.ts +0 -5
  320. package/src/services/controllers/notifications.d.ts +0 -5
  321. package/src/utils/copy_utils.d.ts +0 -4
  322. package/src/utils/manifest_generator.d.ts +0 -18
@@ -1,6 +1,7 @@
1
1
  import express from "express";
2
2
  import { marked } from "marked";
3
3
  import HTMLtoDOCX from "html-to-docx";
4
+ import log from "../../utils/loggerTs.js";
4
5
  import auth from "../../authorization.cjs";
5
6
  import { YpAgentAssistant } from "../assistants/agentAssistant.js";
6
7
  import { YpAgentProductBundle } from "../models/agentProductBundle.js";
@@ -33,7 +34,7 @@ export class AssistantController {
33
34
  this.voiceAssistantInstances = new Map();
34
35
  this.initializeModels = async () => {
35
36
  try {
36
- console.log(`All Models Loaded Init`);
37
+ log.info(`All Models Loaded Init`);
37
38
  // Call associate method to set up associations
38
39
  for (const modelName of Object.keys(models)) {
39
40
  if (models[modelName].associate) {
@@ -41,10 +42,10 @@ export class AssistantController {
41
42
  //await models[modelName].associate(models);
42
43
  }
43
44
  }
44
- console.log("All agentmodels initialized successfully.");
45
+ log.info("All agentmodels initialized successfully.");
45
46
  }
46
47
  catch (error) {
47
- console.error("Error initializing models:", error);
48
+ log.error("Error initializing models:", error);
48
49
  process.exit(1);
49
50
  }
50
51
  };
@@ -57,28 +58,28 @@ export class AssistantController {
57
58
  }
58
59
  const regex = /<markdownReport>([\s\S]*?)<\/markdownReport>/i;
59
60
  const match = lastStatusMessage ? lastStatusMessage.match(regex) : null;
60
- console.debug(`match: ${JSON.stringify(match, null, 2)}`);
61
+ log.debug(`match: ${JSON.stringify(match, null, 2)}`);
61
62
  if (!match || match.length < 2) {
62
- console.error("No <markdownReport>...</markdownReport> content found.");
63
+ log.error("No <markdownReport>...</markdownReport> content found.");
63
64
  res
64
65
  .status(400)
65
66
  .send("No <markdownReport>...</markdownReport> content found.");
66
67
  }
67
68
  const markdownContent = match ? match[1] : null;
68
69
  if (!markdownContent) {
69
- console.error("No markdown content found.");
70
+ log.error("No markdown content found.");
70
71
  res.status(400).send("No markdown content found.");
71
72
  return;
72
73
  }
73
74
  const htmlContent = await marked(markdownContent);
74
75
  const docxBuffer = (await HTMLtoDOCX(htmlContent));
75
- console.debug(`docxBuffer: ${docxBuffer.length}`);
76
+ log.debug(`docxBuffer: ${docxBuffer.length}`);
76
77
  res.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
77
78
  res.setHeader("Content-disposition", 'attachment; filename="converted.docx"');
78
79
  res.send(docxBuffer);
79
80
  }
80
81
  catch (error) {
81
- console.error("Error converting Markdown to DOCX:", error);
82
+ log.error("Error converting Markdown to DOCX:", error);
82
83
  res.status(500).send("Server error");
83
84
  }
84
85
  };
@@ -91,7 +92,7 @@ export class AssistantController {
91
92
  res.sendStatus(200);
92
93
  }
93
94
  catch (error) {
94
- console.error("Error advancing or stopping workflow:", error);
95
+ log.error("Error advancing or stopping workflow:", error);
95
96
  res.sendStatus(500);
96
97
  }
97
98
  };
@@ -102,7 +103,7 @@ export class AssistantController {
102
103
  res.sendStatus(200);
103
104
  }
104
105
  catch (error) {
105
- console.error("Error starting next workflow step:", error);
106
+ log.error("Error starting next workflow step:", error);
106
107
  res.sendStatus(500);
107
108
  }
108
109
  };
@@ -113,7 +114,7 @@ export class AssistantController {
113
114
  res.sendStatus(200);
114
115
  }
115
116
  catch (error) {
116
- console.error("Error stopping current workflow step:", error);
117
+ log.error("Error stopping current workflow step:", error);
117
118
  res.sendStatus(500);
118
119
  }
119
120
  };
@@ -142,7 +143,7 @@ export class AssistantController {
142
143
  });
143
144
  }
144
145
  catch (error) {
145
- console.error("Error retrieving subscription agent configuration:", error);
146
+ log.error("Error retrieving subscription agent configuration:", error);
146
147
  res.status(500).json({ error: error.message });
147
148
  }
148
149
  };
@@ -174,7 +175,7 @@ export class AssistantController {
174
175
  res.send({ workflow: agentRun?.workflow, status: agentRun?.status });
175
176
  }
176
177
  catch (error) {
177
- console.error("Error getting updated workflow:", error);
178
+ log.error("Error getting updated workflow:", error);
178
179
  res.sendStatus(500);
179
180
  }
180
181
  };
@@ -186,12 +187,12 @@ export class AssistantController {
186
187
  res.sendStatus(200);
187
188
  }
188
189
  catch (error) {
189
- console.error("Error starting agent:", error);
190
+ log.error("Error starting agent:", error);
190
191
  res.sendStatus(500);
191
192
  }
192
193
  };
193
194
  this.submitAgentConfiguration = async (req, res) => {
194
- console.log(`submitAgentConfiguration: ${JSON.stringify(req.body, null, 2)}`);
195
+ log.info(`submitAgentConfiguration: ${JSON.stringify(req.body, null, 2)}`);
195
196
  const { requiredQuestionsAnswers } = req.body;
196
197
  const subscriptionId = parseInt(req.params.subscriptionId);
197
198
  try {
@@ -213,7 +214,7 @@ export class AssistantController {
213
214
  await subscription.save();
214
215
  }
215
216
  catch (error) {
216
- console.error("Error saving subscription:", error);
217
+ log.error("Error saving subscription:", error);
217
218
  res.sendStatus(500);
218
219
  }
219
220
  res.sendStatus(200);
@@ -233,7 +234,7 @@ export class AssistantController {
233
234
  res.sendStatus(200);
234
235
  }
235
236
  catch (error) {
236
- console.error("Error updating login status:", error);
237
+ log.error("Error updating login status:", error);
237
238
  res.sendStatus(500);
238
239
  }
239
240
  };
@@ -268,12 +269,12 @@ export class AssistantController {
268
269
  });
269
270
  }
270
271
  else {
271
- console.warn("No user found to clear runs for");
272
+ log.warn("No user found to clear runs for");
272
273
  }
273
274
  res.sendStatus(200);
274
275
  }
275
276
  catch (error) {
276
- console.error("Error clearing chat log:", error);
277
+ log.error("Error clearing chat log:", error);
277
278
  res.sendStatus(500);
278
279
  }
279
280
  };
@@ -281,7 +282,7 @@ export class AssistantController {
281
282
  const memory = await this.loadMemoryWithOwnership(req, res);
282
283
  if (!memory)
283
284
  return;
284
- console.log(`Getting memory at key: ${memory.redisKey}`);
285
+ log.info(`Getting memory at key: ${memory.redisKey}`);
285
286
  res.json(memory);
286
287
  };
287
288
  // New API endpoints for workflow management
@@ -299,7 +300,7 @@ export class AssistantController {
299
300
  });
300
301
  }
301
302
  catch (error) {
302
- console.error("Error retrieving running workflows:", error);
303
+ log.error("Error retrieving running workflows:", error);
303
304
  res.status(500).json({ error: error.message });
304
305
  }
305
306
  };
@@ -317,7 +318,7 @@ export class AssistantController {
317
318
  });
318
319
  }
319
320
  catch (error) {
320
- console.error("Error retrieving all workflows:", error);
321
+ log.error("Error retrieving all workflows:", error);
321
322
  res.status(500).json({ error: error.message });
322
323
  }
323
324
  };
@@ -336,7 +337,7 @@ export class AssistantController {
336
337
  });
337
338
  }
338
339
  catch (error) {
339
- console.error("Error connecting to workflow conversation:", error);
340
+ log.error("Error connecting to workflow conversation:", error);
340
341
  res.status(500).json({ error: error.message });
341
342
  }
342
343
  };
@@ -379,10 +380,10 @@ export class AssistantController {
379
380
  const callerLine = stackTrace?.split("\n")[2]; // First line is Error, second is current function, third is caller
380
381
  const callerMatch = callerLine?.match(/at\s+(.*)\s+\(/);
381
382
  const caller = callerMatch ? callerMatch[1] : "unknown";
382
- console.debug(`loadMemoryWithOwnership called by: ${caller}`);
383
- console.debug(`loadMemoryWithOwnership: ${JSON.stringify(req.body, null, 2)}`);
383
+ log.debug(`loadMemoryWithOwnership called by: ${caller}`);
384
+ log.debug(`loadMemoryWithOwnership: ${JSON.stringify(req.body, null, 2)}`);
384
385
  const redisKey = this.getMemoryRedisKey(req);
385
- console.debug(`loadMemoryWithOwnership: redisKey: ${redisKey}`);
386
+ log.debug(`loadMemoryWithOwnership: redisKey: ${redisKey}`);
386
387
  try {
387
388
  const rawMemory = await req.redisClient.get(redisKey);
388
389
  let memory = rawMemory
@@ -390,7 +391,7 @@ export class AssistantController {
390
391
  : null;
391
392
  // If no memory, create new
392
393
  if (!memory) {
393
- console.debug(`loadMemoryWithOwnership: creating new memory`);
394
+ log.debug(`loadMemoryWithOwnership: creating new memory`);
394
395
  memory = {
395
396
  redisKey,
396
397
  chatLog: [],
@@ -401,40 +402,40 @@ export class AssistantController {
401
402
  ownerUserId: null,
402
403
  };
403
404
  if (req.user) {
404
- console.debug(`loadMemoryWithOwnership: setting ownerUserId to ${req.user.id}`);
405
+ log.debug(`loadMemoryWithOwnership: setting ownerUserId to ${req.user.id}`);
405
406
  memory.ownerUserId = req.user.id;
406
407
  }
407
408
  else {
408
- console.debug(`loadMemoryWithOwnership: no user in request`);
409
+ log.debug(`loadMemoryWithOwnership: no user in request`);
409
410
  }
410
411
  await req.redisClient.set(redisKey, JSON.stringify(memory));
411
412
  const rawAfterSet = await req.redisClient.get(redisKey);
412
- console.log("loadMemoryWithOwnership: After set, raw in Redis is:", rawAfterSet);
413
- console.debug(`loadMemoryWithOwnership: returning new memory`);
413
+ log.info("loadMemoryWithOwnership: After set, raw in Redis is:", rawAfterSet);
414
+ log.debug(`loadMemoryWithOwnership: returning new memory`);
414
415
  return memory;
415
416
  }
416
417
  else {
417
- console.debug(`loadMemoryWithOwnership: memory already exists`);
418
- console.debug(`loadMemoryWithOwnership: memory: ${JSON.stringify(memory, null, 2)}`);
418
+ log.debug(`loadMemoryWithOwnership: memory already exists`);
419
+ log.debug(`loadMemoryWithOwnership: memory: ${JSON.stringify(memory, null, 2)}`);
419
420
  }
420
421
  // If memory is owned by someone
421
422
  if (memory.ownerUserId !== null) {
422
- console.debug(`loadMemoryWithOwnership: memory is owned by ${memory.ownerUserId}`);
423
+ log.debug(`loadMemoryWithOwnership: memory is owned by ${memory.ownerUserId}`);
423
424
  if (!req.user) {
424
- console.debug(`loadMemoryWithOwnership: no user in request`);
425
+ log.debug(`loadMemoryWithOwnership: no user in request`);
425
426
  res.status(401).json({ error: "Unauthorized" });
426
427
  return;
427
428
  }
428
429
  else {
429
- console.debug(`loadMemoryWithOwnership: user in request`);
430
+ log.debug(`loadMemoryWithOwnership: user in request`);
430
431
  }
431
432
  if (memory.ownerUserId !== req.user.id) {
432
- console.debug(`loadMemoryWithOwnership: ownerUserId does not match ${memory.ownerUserId} !== ${req.user.id}`);
433
+ log.debug(`loadMemoryWithOwnership: ownerUserId does not match ${memory.ownerUserId} !== ${req.user.id}`);
433
434
  res.status(403).json({ error: "Forbidden" });
434
435
  return;
435
436
  }
436
437
  else {
437
- console.debug(`loadMemoryWithOwnership: ownerUserId matches ${memory.ownerUserId} === ${req.user.id}`);
438
+ log.debug(`loadMemoryWithOwnership: ownerUserId matches ${memory.ownerUserId} === ${req.user.id}`);
438
439
  }
439
440
  // Same user => fine
440
441
  return memory;
@@ -445,16 +446,16 @@ export class AssistantController {
445
446
  // optionally upgrade
446
447
  memory.ownerUserId = req.user.id;
447
448
  await req.redisClient.set(redisKey, JSON.stringify(memory));
448
- console.debug(`loadMemoryWithOwnership: returning memory with ownerUserId ${memory.ownerUserId}`);
449
+ log.debug(`loadMemoryWithOwnership: returning memory with ownerUserId ${memory.ownerUserId}`);
449
450
  }
450
451
  else {
451
- console.debug(`loadMemoryWithOwnership: returning memory with ownerUserId null`);
452
+ log.debug(`loadMemoryWithOwnership: returning memory with ownerUserId null`);
452
453
  }
453
454
  return memory;
454
455
  }
455
456
  }
456
457
  catch (error) {
457
- console.error("Error loading memory:", error);
458
+ log.error("Error loading memory:", error);
458
459
  res.status(500).json({ error: "Internal server error" });
459
460
  return;
460
461
  }
@@ -465,7 +466,7 @@ export class AssistantController {
465
466
  const memory = await this.loadMemoryWithOwnership(req, res);
466
467
  if (!memory)
467
468
  return;
468
- console.log(`Starting chat session for client: ${wsClientId}`);
469
+ log.info(`Starting chat session for client: ${wsClientId}`);
469
470
  let oldVoiceAssistant = this.voiceAssistantInstances.get("voiceAssistant");
470
471
  if (oldVoiceAssistant) {
471
472
  oldVoiceAssistant.destroy();
@@ -485,7 +486,7 @@ export class AssistantController {
485
486
  });
486
487
  }
487
488
  catch (error) {
488
- console.error("Error starting voice session:", error);
489
+ log.error("Error starting voice session:", error);
489
490
  res.status(500).json({ error: "Internal server error" });
490
491
  }
491
492
  }
@@ -514,7 +515,7 @@ export class AssistantController {
514
515
  });
515
516
  }
516
517
  catch (error) {
517
- console.error("Error starting chat session:", error);
518
+ log.error("Error starting chat session:", error);
518
519
  res.status(500).json({ error: "Internal server error" });
519
520
  }
520
521
  }
@@ -6,6 +6,7 @@ import { AgentConnectorManager } from "@policysynth/agents/operations/agentConne
6
6
  import { AgentRegistryManager } from "@policysynth/agents/operations/agentRegistryManager.js";
7
7
  import { PsAiModel } from "@policysynth/agents/dbModels/aiModel.js";
8
8
  import auth from "../../authorization.cjs";
9
+ import log from "../../utils/loggerTs.js";
9
10
  import { PsAgent } from "@policysynth/agents/dbModels/agent.js";
10
11
  import { NewAiModelSetup } from "../managers/newAiModelSetup.js";
11
12
  export class PolicySynthAgentsController {
@@ -16,9 +17,9 @@ export class PolicySynthAgentsController {
16
17
  try {
17
18
  const { groupId, agentId } = req.params;
18
19
  const memory = req.body;
19
- console.log(`Attempting to replace memory for agent ${agentId} in group ${groupId}`);
20
+ log.info(`Attempting to replace memory for agent ${agentId} in group ${groupId}`);
20
21
  if (!memory || Object.keys(memory).length === 0) {
21
- console.log(`Received empty memory for agent ${agentId}`);
22
+ log.info(`Received empty memory for agent ${agentId}`);
22
23
  res.status(400).json({ error: "Cannot save empty memory" });
23
24
  return;
24
25
  }
@@ -26,25 +27,25 @@ export class PolicySynthAgentsController {
26
27
  JSON.parse(JSON.stringify(memory));
27
28
  }
28
29
  catch (jsonError) {
29
- console.log(`Received invalid JSON for agent ${agentId}`);
30
+ log.info(`Received invalid JSON for agent ${agentId}`);
30
31
  res.status(400).json({ error: "Invalid JSON format for memory" });
31
32
  return;
32
33
  }
33
34
  const memoryKey = await this.agentManager.getSubAgentMemoryKey(groupId, parseInt(agentId));
34
35
  if (!memoryKey) {
35
- console.log(`Memory key not found for agent ${agentId}`);
36
+ log.info(`Memory key not found for agent ${agentId}`);
36
37
  res
37
38
  .status(404)
38
39
  .json({ error: "Memory key not found for the specified agent" });
39
40
  return;
40
41
  }
41
- console.log(`Memory key found: ${memoryKey}`);
42
+ log.info(`Memory key found: ${memoryKey}`);
42
43
  await req.redisClient.set(memoryKey, JSON.stringify(memory));
43
- console.log(`Memory contents replaced successfully`);
44
+ log.info(`Memory contents replaced successfully`);
44
45
  res.json({ message: "Memory replaced successfully" });
45
46
  }
46
47
  catch (error) {
47
- console.error("Error replacing agent memory:", error);
48
+ log.error("Error replacing agent memory:", error);
48
49
  if (error instanceof Error) {
49
50
  res.status(500).json({ error: error.message });
50
51
  }
@@ -82,7 +83,7 @@ export class PolicySynthAgentsController {
82
83
  });
83
84
  }
84
85
  catch (error) {
85
- console.error(`Error adding existing ${connectorId} connector:`, error);
86
+ log.error(`Error adding existing ${connectorId} connector:`, error);
86
87
  if (error instanceof Error) {
87
88
  res.status(500).json({ error: error.message });
88
89
  }
@@ -94,28 +95,28 @@ export class PolicySynthAgentsController {
94
95
  this.getAgentMemory = async (req, res) => {
95
96
  try {
96
97
  const { groupId, agentId } = req.params;
97
- console.log(`Attempting to get memory for agent ${agentId} in group ${groupId}`);
98
+ log.info(`Attempting to get memory for agent ${agentId} in group ${groupId}`);
98
99
  const memoryKey = await this.agentManager.getSubAgentMemoryKey(groupId, parseInt(agentId));
99
100
  if (!memoryKey) {
100
- console.log(`Memory key not found for agent ${agentId}`);
101
+ log.info(`Memory key not found for agent ${agentId}`);
101
102
  res
102
103
  .status(404)
103
104
  .json({ error: "Memory key not found for the specified agent" });
104
105
  return;
105
106
  }
106
- console.log(`Memory key found: ${memoryKey}`);
107
+ log.info(`Memory key found: ${memoryKey}`);
107
108
  const memoryContents = await req.redisClient.get(memoryKey);
108
109
  if (!memoryContents) {
109
- console.log(`Memory contents not found for key ${memoryKey}`);
110
+ log.info(`Memory contents not found for key ${memoryKey}`);
110
111
  res.status(404).json({ error: "Memory contents not found" });
111
112
  return;
112
113
  }
113
- console.log(`Memory contents retrieved successfully`);
114
+ log.info(`Memory contents retrieved successfully`);
114
115
  const parsedMemoryContents = JSON.parse(memoryContents);
115
116
  res.json(parsedMemoryContents);
116
117
  }
117
118
  catch (error) {
118
- console.error("Error retrieving agent memory:", error);
119
+ log.error("Error retrieving agent memory:", error);
119
120
  if (error instanceof Error) {
120
121
  res.status(500).json({ error: error.message });
121
122
  }
@@ -131,7 +132,7 @@ export class PolicySynthAgentsController {
131
132
  res.json(agent);
132
133
  }
133
134
  catch (error) {
134
- console.error("Error in getAgent:", error);
135
+ log.error("Error in getAgent:", error);
135
136
  res.status(500).send("Internal Server Error");
136
137
  return;
137
138
  }
@@ -142,7 +143,7 @@ export class PolicySynthAgentsController {
142
143
  res.json(aiModels);
143
144
  }
144
145
  catch (error) {
145
- console.error("Error fetching agent AI models:", error);
146
+ log.error("Error fetching agent AI models:", error);
146
147
  res.status(500).send("Internal Server Error");
147
148
  }
148
149
  };
@@ -152,7 +153,7 @@ export class PolicySynthAgentsController {
152
153
  res.json({ message: "AI model removed successfully" });
153
154
  }
154
155
  catch (error) {
155
- console.error("Error removing agent AI model:", error);
156
+ log.error("Error removing agent AI model:", error);
156
157
  res.status(500).send("Internal Server Error");
157
158
  }
158
159
  };
@@ -163,7 +164,7 @@ export class PolicySynthAgentsController {
163
164
  res.status(201).json({ message: "AI model added successfully" });
164
165
  }
165
166
  catch (error) {
166
- console.error("Error adding agent AI model:", error);
167
+ log.error("Error adding agent AI model:", error);
167
168
  res.status(500).send("Internal Server Error");
168
169
  }
169
170
  };
@@ -185,7 +186,7 @@ export class PolicySynthAgentsController {
185
186
  res.json({ message: `${nodeType} configuration updated successfully` });
186
187
  }
187
188
  catch (error) {
188
- console.error(`Error updating ${nodeType} configuration:`, error);
189
+ log.error(`Error updating ${nodeType} configuration:`, error);
189
190
  res.status(500).send("Internal Server Error");
190
191
  return;
191
192
  }
@@ -209,7 +210,7 @@ export class PolicySynthAgentsController {
209
210
  res.status(201).json(createdConnector);
210
211
  }
211
212
  catch (error) {
212
- console.error(`Error creating ${type} connector:`, error);
213
+ log.error(`Error creating ${type} connector:`, error);
213
214
  res.status(500).send("Internal Server Error");
214
215
  }
215
216
  };
@@ -221,7 +222,7 @@ export class PolicySynthAgentsController {
221
222
  res.json(activeAiModels);
222
223
  }
223
224
  catch (error) {
224
- console.error("Error fetching active AI models:", error);
225
+ log.error("Error fetching active AI models:", error);
225
226
  res.status(500).send("Internal Server Error");
226
227
  }
227
228
  };
@@ -231,7 +232,7 @@ export class PolicySynthAgentsController {
231
232
  res.json(activeAgentClasses);
232
233
  }
233
234
  catch (error) {
234
- console.error("Error fetching active agent classes:", error);
235
+ log.error("Error fetching active agent classes:", error);
235
236
  if (error instanceof Error) {
236
237
  res.status(500).send(`Internal Server Error: ${error.message}`);
237
238
  }
@@ -246,7 +247,7 @@ export class PolicySynthAgentsController {
246
247
  res.json(activeConnectorClasses);
247
248
  }
248
249
  catch (error) {
249
- console.error("Error fetching active connector classes:", error);
250
+ log.error("Error fetching active connector classes:", error);
250
251
  res.status(500).send("Internal Server Error");
251
252
  }
252
253
  };
@@ -257,7 +258,7 @@ export class PolicySynthAgentsController {
257
258
  res.status(201).json(createdAgent);
258
259
  }
259
260
  catch (error) {
260
- console.error("Error creating agent:", error);
261
+ log.error("Error creating agent:", error);
261
262
  if (error instanceof Error) {
262
263
  res.status(400).send(error.message);
263
264
  }
@@ -274,7 +275,7 @@ export class PolicySynthAgentsController {
274
275
  res.json({ message });
275
276
  }
276
277
  catch (error) {
277
- console.error(`Error ${action}ing agent:`, error);
278
+ log.error(`Error ${action}ing agent:`, error);
278
279
  if (error instanceof Error) {
279
280
  res.status(500).json({ error: error.message });
280
281
  }
@@ -295,7 +296,7 @@ export class PolicySynthAgentsController {
295
296
  }
296
297
  }
297
298
  catch (error) {
298
- console.error("Error getting agent status:", error);
299
+ log.error("Error getting agent status:", error);
299
300
  res.status(500).send("Internal Server Error");
300
301
  }
301
302
  };
@@ -312,7 +313,7 @@ export class PolicySynthAgentsController {
312
313
  }
313
314
  }
314
315
  catch (error) {
315
- console.error("Error updating agent status:", error);
316
+ log.error("Error updating agent status:", error);
316
317
  res.status(500).send("Internal Server Error");
317
318
  }
318
319
  };
@@ -323,7 +324,7 @@ export class PolicySynthAgentsController {
323
324
  res.json({ message: "Agent deleted" });
324
325
  }
325
326
  catch (error) {
326
- console.error("Error deleting agent:", error);
327
+ log.error("Error deleting agent:", error);
327
328
  if (error instanceof Error) {
328
329
  res.status(500).json({ error: error.message });
329
330
  }
@@ -344,7 +345,7 @@ export class PolicySynthAgentsController {
344
345
  }
345
346
  }
346
347
  catch (error) {
347
- console.error("Error starting agent processing:", error);
348
+ log.error("Error starting agent processing:", error);
348
349
  res.status(500).send("Internal Server Error");
349
350
  }
350
351
  };
@@ -360,7 +361,7 @@ export class PolicySynthAgentsController {
360
361
  }
361
362
  }
362
363
  catch (error) {
363
- console.error("Error pausing agent processing:", error);
364
+ log.error("Error pausing agent processing:", error);
364
365
  res.status(500).send("Internal Server Error");
365
366
  }
366
367
  };
@@ -371,7 +372,7 @@ export class PolicySynthAgentsController {
371
372
  res.json(totalCosts);
372
373
  }
373
374
  catch (error) {
374
- console.error("Error calculating agent costs:", error);
375
+ log.error("Error calculating agent costs:", error);
375
376
  res.status(500).send("Internal Server Error");
376
377
  }
377
378
  };
@@ -382,7 +383,7 @@ export class PolicySynthAgentsController {
382
383
  res.json(costRows);
383
384
  }
384
385
  catch (error) {
385
- console.error("Error calculating agent costs detail:", error);
386
+ log.error("Error calculating agent costs detail:", error);
386
387
  res.status(500).send("Internal Server Error");
387
388
  }
388
389
  };
@@ -8,6 +8,7 @@ const Group = dbModels.Group;
8
8
  const User = dbModels.User;
9
9
  const Community = dbModels.Community;
10
10
  const Domain = dbModels.Domain;
11
+ import log from "../../utils/loggerTs.js";
11
12
  export class AgentInviteManager {
12
13
  /**
13
14
  * Send a notification email to group admins about the current workflow step or completion.
@@ -16,7 +17,7 @@ export class AgentInviteManager {
16
17
  try {
17
18
  const agentRun = await NotificationAgentQueueManager.getAgentRun(agentRunId);
18
19
  if (!agentRun) {
19
- console.error("Agent run not found");
20
+ log.error("Agent run not found");
20
21
  return;
21
22
  }
22
23
  const subject = `${agentRun?.Subscription?.Plan?.AgentProduct?.name} - ${agentRun?.workflow?.steps[agentRun?.workflow?.currentStepIndex]?.shortName} invite`;
@@ -45,10 +46,10 @@ export class AgentInviteManager {
45
46
  link: link,
46
47
  skipHeaderAndFooter: true,
47
48
  }, { priority: "high" });
48
- console.log("AgentInviteManager: Email enqueued successfully");
49
+ log.info("AgentInviteManager: Email enqueued successfully");
49
50
  }
50
51
  catch (error) {
51
- console.error("AgentInviteManager: Error sending notification email", error);
52
+ log.error("AgentInviteManager: Error sending notification email", error);
52
53
  throw error;
53
54
  }
54
55
  }