@yrpri/api 9.0.108 → 9.0.110

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 (414) hide show
  1. package/active-citizen/controllers/activities.d.cts +2 -0
  2. package/active-citizen/controllers/activities.d.ts +5 -0
  3. package/active-citizen/controllers/news_feeds.d.cts +2 -0
  4. package/active-citizen/controllers/notifications.d.cts +2 -0
  5. package/active-citizen/controllers/notifications.d.ts +5 -0
  6. package/active-citizen/controllers/recommendations.d.cts +2 -0
  7. package/active-citizen/engine/allOurIdeas/aiHelper.d.ts +22 -0
  8. package/active-citizen/engine/allOurIdeas/explainAnswersAssistant.d.ts +13 -0
  9. package/active-citizen/engine/allOurIdeas/iconGenerator.d.ts +7 -0
  10. package/active-citizen/engine/analytics/export_anon_community_activities.d.ts +1 -0
  11. package/active-citizen/engine/analytics/importer.d.ts +1 -0
  12. package/active-citizen/engine/analytics/manager.d.cts +6 -0
  13. package/active-citizen/engine/analytics/plausible/manager.d.cts +5 -0
  14. package/active-citizen/engine/analytics/statsCalc.d.cts +94 -0
  15. package/active-citizen/engine/analytics/utils.d.cts +5 -0
  16. package/active-citizen/engine/marketing/campaign.d.cts +1 -0
  17. package/active-citizen/engine/moderation/fraud/CreateFraudAuditReport.d.cts +1 -0
  18. package/active-citizen/engine/moderation/fraud/FraudBase.d.cts +31 -0
  19. package/active-citizen/engine/moderation/fraud/FraudDeleteBase.d.cts +21 -0
  20. package/active-citizen/engine/moderation/fraud/FraudDeleteEndorsements.d.cts +8 -0
  21. package/active-citizen/engine/moderation/fraud/FraudDeletePointQualities.d.cts +6 -0
  22. package/active-citizen/engine/moderation/fraud/FraudDeletePoints.d.cts +6 -0
  23. package/active-citizen/engine/moderation/fraud/FraudDeletePosts.d.cts +4 -0
  24. package/active-citizen/engine/moderation/fraud/FraudDeleteRatings.d.cts +4 -0
  25. package/active-citizen/engine/moderation/fraud/FraudGetBase.d.cts +8 -0
  26. package/active-citizen/engine/moderation/fraud/FraudGetEndorsements.d.cts +7 -0
  27. package/active-citizen/engine/moderation/fraud/FraudGetPointQualities.d.cts +7 -0
  28. package/active-citizen/engine/moderation/fraud/FraudGetPoints.d.cts +6 -0
  29. package/active-citizen/engine/moderation/fraud/FraudGetPosts.d.cts +6 -0
  30. package/active-citizen/engine/moderation/fraud/FraudGetRatings.d.cts +5 -0
  31. package/active-citizen/engine/moderation/fraud/FraudScannerNotifier.d.cts +1 -0
  32. package/active-citizen/engine/moderation/get_moderation_items.d.cts +55 -0
  33. package/active-citizen/engine/moderation/image_labeling/CommunityLabeling.d.cts +6 -0
  34. package/active-citizen/engine/moderation/image_labeling/GroupLabeling.d.cts +6 -0
  35. package/active-citizen/engine/moderation/image_labeling/ImageLabelingBase.d.cts +30 -0
  36. package/active-citizen/engine/moderation/image_labeling/PointLabeling.d.cts +6 -0
  37. package/active-citizen/engine/moderation/image_labeling/PostLabeling.d.cts +6 -0
  38. package/active-citizen/engine/moderation/perspective_api_client.d.cts +33 -0
  39. package/active-citizen/engine/moderation/process_moderation_items.d.cts +2 -0
  40. package/active-citizen/engine/moderation/toxicity_analysis.d.cts +3 -0
  41. package/active-citizen/engine/news_feeds/activity_and_item_index_definitions.d.cts +7 -0
  42. package/active-citizen/engine/news_feeds/generate_dynamically.d.cts +2 -0
  43. package/active-citizen/engine/news_feeds/generate_from_notifications.d.cts +2 -0
  44. package/active-citizen/engine/news_feeds/news_feeds_utils.d.cts +99 -0
  45. package/active-citizen/engine/notifications/emails_utils.d.cts +2 -0
  46. package/active-citizen/engine/notifications/generate_point_notifications.d.cts +2 -0
  47. package/active-citizen/engine/notifications/generate_post_notifications.d.cts +2 -0
  48. package/active-citizen/engine/notifications/generate_post_status_change_notifications.d.cts +2 -0
  49. package/active-citizen/engine/notifications/notifications_utils.d.cts +3 -0
  50. package/active-citizen/engine/notifications/point_delivery.d.cts +2 -0
  51. package/active-citizen/engine/notifications/post_delivery.d.cts +2 -0
  52. package/active-citizen/engine/notifications/process_delayed_notifications.d.cts +1 -0
  53. package/active-citizen/engine/notifications/process_general_notifications.d.cts +2 -0
  54. package/active-citizen/engine/old/exporters/categories_dataset.d.ts +1 -0
  55. package/active-citizen/engine/old/exporters/dataset_tools.d.ts +3 -0
  56. package/active-citizen/engine/old/exporters/sentiment_dataset.d.ts +1 -0
  57. package/active-citizen/engine/recommendations/events_importer.d.cts +1 -0
  58. package/active-citizen/engine/recommendations/events_manager.d.cts +5 -0
  59. package/active-citizen/engine/reports/add_points_to_sheet.d.cts +1 -0
  60. package/active-citizen/engine/reports/commonUtils.d.ts +5 -0
  61. package/active-citizen/engine/reports/common_utils.d.cts +44 -0
  62. package/active-citizen/engine/reports/docx_group_report.d.cts +1 -0
  63. package/active-citizen/engine/reports/xlsAllOurIdeasExport.d.ts +1 -0
  64. package/active-citizen/engine/reports/xls_community_users_report.d.cts +2 -0
  65. package/active-citizen/engine/reports/xls_group_report.d.cts +1 -0
  66. package/active-citizen/llms/baseChatBot.d.ts +33 -0
  67. package/active-citizen/llms/imageGeneration/chatGptImageGenerator.d.ts +13 -0
  68. package/active-citizen/llms/imageGeneration/collectionImageGenerator.d.ts +23 -0
  69. package/active-citizen/llms/imageGeneration/dalleImageGenerator.d.ts +10 -0
  70. package/active-citizen/llms/imageGeneration/fluxImageGenerator.d.ts +9 -0
  71. package/active-citizen/llms/imageGeneration/iImageGenerator.d.ts +7 -0
  72. package/active-citizen/llms/imageGeneration/imageProcessorService.d.ts +12 -0
  73. package/active-citizen/llms/imageGeneration/imagenImageGenerator.d.ts +16 -0
  74. package/active-citizen/llms/imageGeneration/s3Service.d.ts +12 -0
  75. package/active-citizen/llms/llmTranslation.d.ts +26 -0
  76. package/active-citizen/models/ac_activity.d.cts +2 -0
  77. package/active-citizen/models/ac_background_job.d.cts +2 -0
  78. package/active-citizen/models/ac_campaign.d.cts +2 -0
  79. package/active-citizen/models/ac_client_activity.d.cts +2 -0
  80. package/active-citizen/models/ac_delayed_notification.d.cts +2 -0
  81. package/active-citizen/models/ac_following.d.cts +2 -0
  82. package/active-citizen/models/ac_list.d.cts +2 -0
  83. package/active-citizen/models/ac_list_users.d.cts +2 -0
  84. package/active-citizen/models/ac_mute.d.cts +2 -0
  85. package/active-citizen/models/ac_news_feed_item.d.cts +2 -0
  86. package/active-citizen/models/ac_news_feed_processed_range.d.cts +2 -0
  87. package/active-citizen/models/ac_notification.d.cts +2 -0
  88. package/active-citizen/models/ac_translation_cache.d.cts +2 -0
  89. package/active-citizen/models/ac_watching.d.cts +2 -0
  90. package/active-citizen/scripts/analytics/setup_all_plausible_goals.d.cts +1 -0
  91. package/active-citizen/scripts/fix_old_delayed_notifications.d.ts +1 -0
  92. package/active-citizen/scripts/kue_status.d.ts +2 -0
  93. package/active-citizen/scripts/kue_watch_stuck_jobs.d.ts +2 -0
  94. package/active-citizen/scripts/translation_clear_language.d.ts +1 -0
  95. package/active-citizen/scripts/translation_delete.d.ts +1 -0
  96. package/active-citizen/scripts/translation_replace_text_from_url.d.ts +1 -0
  97. package/active-citizen/scripts/translation_update.d.ts +1 -0
  98. package/active-citizen/scripts/translations_list.d.ts +1 -0
  99. package/active-citizen/utils/airbrake.d.cts +2 -0
  100. package/active-citizen/utils/get_anonymous_system_user.d.cts +2 -0
  101. package/active-citizen/utils/i18n.d.cts +2 -0
  102. package/active-citizen/utils/logger.d.cts +2 -0
  103. package/active-citizen/utils/redisConnection.d.cts +2 -0
  104. package/active-citizen/utils/to_json.d.cts +2 -0
  105. package/active-citizen/utils/translation_cloning.d.cts +5 -0
  106. package/active-citizen/utils/translation_helpers.d.cts +8 -0
  107. package/active-citizen/utils/truncate_text.d.cts +2 -0
  108. package/active-citizen/utils/updateAllLocalesFromEn.d.ts +20 -0
  109. package/active-citizen/utils/updateLocaleFolders.d.ts +1 -0
  110. package/active-citizen/workers/activity.cjs +13 -2
  111. package/active-citizen/workers/activity.d.cts +16 -0
  112. package/active-citizen/workers/anonymizations.cjs +13 -2
  113. package/active-citizen/workers/anonymizations.d.cts +16 -0
  114. package/active-citizen/workers/bulk_status_update.cjs +12 -1
  115. package/active-citizen/workers/bulk_status_update.d.cts +16 -0
  116. package/active-citizen/workers/delayed_jobs.cjs +13 -2
  117. package/active-citizen/workers/delayed_jobs.d.cts +16 -0
  118. package/active-citizen/workers/deletions.cjs +14 -3
  119. package/active-citizen/workers/deletions.d.cts +16 -0
  120. package/active-citizen/workers/email.cjs +12 -1
  121. package/active-citizen/workers/email.d.cts +16 -0
  122. package/active-citizen/workers/fraud_management.cjs +13 -2
  123. package/active-citizen/workers/fraud_management.d.cts +16 -0
  124. package/active-citizen/workers/generativeAi.d.ts +3 -0
  125. package/active-citizen/workers/main.d.cts +1 -0
  126. package/active-citizen/workers/marketing.cjs +13 -2
  127. package/active-citizen/workers/marketing.d.cts +16 -0
  128. package/active-citizen/workers/moderation.cjs +13 -2
  129. package/active-citizen/workers/moderation.d.cts +16 -0
  130. package/active-citizen/workers/notification_delivery.cjs +12 -1
  131. package/active-citizen/workers/notification_delivery.d.cts +16 -0
  132. package/active-citizen/workers/notification_news_feed.cjs +12 -1
  133. package/active-citizen/workers/notification_news_feed.d.cts +16 -0
  134. package/active-citizen/workers/queue.d.cts +21 -0
  135. package/active-citizen/workers/recount.d.cts +1 -0
  136. package/active-citizen/workers/reports.d.cts +2 -0
  137. package/active-citizen/workers/similarities.cjs +13 -2
  138. package/active-citizen/workers/similarities.d.cts +16 -0
  139. package/active-citizen/workers/speech_to_text.cjs +13 -2
  140. package/active-citizen/workers/speech_to_text.d.cts +16 -0
  141. package/agents/assistants/agentAssistant.d.ts +27 -0
  142. package/agents/assistants/assistant.d.ts +156 -0
  143. package/agents/assistants/baseAssistant.d.ts +115 -0
  144. package/agents/assistants/baseAssistantWithVoice.d.ts +18 -0
  145. package/agents/assistants/modes/agentDirectConnection.d.ts +16 -0
  146. package/agents/assistants/modes/agentSelectionMode.d.ts +12 -0
  147. package/agents/assistants/modes/baseAssistantMode.d.ts +10 -0
  148. package/agents/assistants/modes/tools/agentTools.d.ts +100 -0
  149. package/agents/assistants/modes/tools/baseTools.d.ts +21 -0
  150. package/agents/assistants/modes/tools/loginTools.d.ts +51 -0
  151. package/agents/assistants/modes/tools/models/agents.d.ts +27 -0
  152. package/agents/assistants/modes/tools/models/subscriptions.d.ts +13 -0
  153. package/agents/assistants/modes/tools/models/users.d.ts +7 -0
  154. package/agents/assistants/modes/tools/navigationTools.d.ts +33 -0
  155. package/agents/assistants/modes/tools/subscriptionTools.d.ts +53 -0
  156. package/agents/assistants/modes/tools/workflowConverstationTools.d.ts +49 -0
  157. package/agents/assistants/voiceAssistant.d.ts +78 -0
  158. package/agents/controllers/agentProductController.d.ts +23 -0
  159. package/agents/controllers/agentSubscriptionController.d.ts +30 -0
  160. package/agents/controllers/assistantsController.d.ts +47 -0
  161. package/agents/controllers/policySynthAgents.d.ts +49 -0
  162. package/agents/managers/agentProductManager.d.ts +12 -0
  163. package/agents/managers/emailInvitesManager.d.ts +6 -0
  164. package/agents/managers/emailTemplateRenderer.d.ts +25 -0
  165. package/agents/managers/newAiModelSetup.d.ts +37 -0
  166. package/agents/managers/notificationAgentQueueManager.d.ts +23 -0
  167. package/agents/managers/subscriptionManager.d.ts +29 -0
  168. package/agents/managers/workflowConversationManager.d.ts +14 -0
  169. package/agents/models/agentProduct.d.ts +31 -0
  170. package/agents/models/agentProductBoosterPurchase.d.ts +27 -0
  171. package/agents/models/agentProductBundle.d.ts +12 -0
  172. package/agents/models/agentProductRun.d.ts +23 -0
  173. package/agents/models/discount.d.ts +21 -0
  174. package/agents/models/subscription.d.ts +26 -0
  175. package/agents/models/subscriptionPlan.d.ts +17 -0
  176. package/agents/models/subscriptionUser.d.ts +11 -0
  177. package/agents/models/testData/createEvolyAgentProduct.d.ts +1 -0
  178. package/agents/models/testData/old/updateAgentWorkflowConfiguration.d.ts +1 -0
  179. package/agents/models/testData/setupEvolyAgentProductConfig.d.ts +1 -0
  180. package/agents/models/testData/updateAgentWorkflowConfiguration.d.ts +1 -0
  181. package/agents/models/workflowConversation.d.ts +11 -0
  182. package/agents/tools/setTemplateWorkflowCommunityId.d.ts +1 -0
  183. package/app.d.ts +53 -0
  184. package/authorization.d.cts +1 -0
  185. package/bot_control.d.ts +4 -0
  186. package/controllers/allOurIdeas.d.ts +40 -0
  187. package/controllers/audios.d.cts +2 -0
  188. package/controllers/bulkStatusUpdates.d.cts +2 -0
  189. package/controllers/categories.d.cts +2 -0
  190. package/controllers/communities.d.cts +2 -0
  191. package/controllers/domains.d.cts +2 -0
  192. package/controllers/externalIds.d.cts +2 -0
  193. package/controllers/groups.d.cts +2 -0
  194. package/controllers/images.d.cts +2 -0
  195. package/controllers/index.d.cts +2 -0
  196. package/controllers/legacyPages.d.cts +2 -0
  197. package/controllers/legacyPosts.d.cts +2 -0
  198. package/controllers/legacyUsers.d.cts +2 -0
  199. package/controllers/nonSpa.d.cts +2 -0
  200. package/controllers/organizations.d.cts +2 -0
  201. package/controllers/points.d.cts +2 -0
  202. package/controllers/posts.d.cts +2 -0
  203. package/controllers/ratings.d.cts +2 -0
  204. package/controllers/users.d.cts +2 -0
  205. package/controllers/videos.d.cts +2 -0
  206. package/deleteUnwantedDeclerations.d.cts +1 -0
  207. package/migrations/agentAuditLogs.d.cts +1 -0
  208. package/migrations/agentClasses.d.cts +1 -0
  209. package/migrations/agentConnectorClasses.d.cts +1 -0
  210. package/migrations/agentConnectors.d.cts +1 -0
  211. package/migrations/agentEvals.d.cts +1 -0
  212. package/migrations/agentRegistries.d.cts +1 -0
  213. package/migrations/agents.d.cts +1 -0
  214. package/migrations/aiModels.d.cts +1 -0
  215. package/migrations/apiUsage.d.cts +1 -0
  216. package/migrations/apis.d.cts +1 -0
  217. package/migrations/groupPrivateData.d.cts +2 -0
  218. package/migrations/modelUsage.d.cts +2 -0
  219. package/migrations/privateAccessStore.d.cts +1 -0
  220. package/migrations/zzz_associations.d.cts +1 -0
  221. package/migrations/zzzz_createUsersAndAdminsForClasses.d.cts +1 -0
  222. package/migrations/zzzzz_create_agent_runs.d.cts +2 -0
  223. package/migrations/zzzzzz_create_agent_runs_fix.d.cts +2 -0
  224. package/migrations/zzzzzzz_create_trees.d.cts +2 -0
  225. package/models/audio.d.cts +2 -0
  226. package/models/bulk_status_update.d.cts +2 -0
  227. package/models/campaign.d.cts +2 -0
  228. package/models/category.d.cts +2 -0
  229. package/models/community.d.cts +2 -0
  230. package/models/domain.d.cts +2 -0
  231. package/models/endorsement.d.cts +2 -0
  232. package/models/general_data_store.d.cts +2 -0
  233. package/models/group.d.cts +2 -0
  234. package/models/image.d.cts +2 -0
  235. package/models/index.cjs +2 -2
  236. package/models/index.d.cts +3 -0
  237. package/models/invite.d.cts +2 -0
  238. package/models/iso_country.d.cts +2 -0
  239. package/models/organization.d.cts +2 -0
  240. package/models/page.d.cts +2 -0
  241. package/models/point.d.cts +2 -0
  242. package/models/point_quality.d.cts +2 -0
  243. package/models/point_revision.d.cts +2 -0
  244. package/models/post.d.cts +2 -0
  245. package/models/post_revision.d.cts +2 -0
  246. package/models/post_status_change.d.cts +2 -0
  247. package/models/promotion.d.cts +2 -0
  248. package/models/rating.d.cts +2 -0
  249. package/models/relationship.d.cts +2 -0
  250. package/models/request_to_join.d.cts +2 -0
  251. package/models/user.d.cts +2 -0
  252. package/models/user_legacy_password.d.cts +2 -0
  253. package/models/video.d.cts +2 -0
  254. package/package.json +3 -2
  255. package/publish.d.ts +1 -0
  256. package/repack.d.ts +1 -0
  257. package/scripts/addRatingUsersToGroup.d.ts +1 -0
  258. package/scripts/addUserToOrganization.d.ts +1 -0
  259. package/scripts/analyseRatingsForCommunity.d.ts +1 -0
  260. package/scripts/analyzeAndFixBrokenPointUsers.d.ts +1 -0
  261. package/scripts/analyzeEndorsementsByCountry.d.ts +1 -0
  262. package/scripts/analyzePostsForCommunity.d.ts +1 -0
  263. package/scripts/bulkStatusUpdates/listUpdates.d.ts +1 -0
  264. package/scripts/bulkStatusUpdates/mergeLatestPostsToUpdate.d.ts +1 -0
  265. package/scripts/bulkStatusUpdates/performUpdate.d.ts +1 -0
  266. package/scripts/bulkStatusUpdates/performUpdateForGroup.d.cts +1 -0
  267. package/scripts/bulkStatusUpdates/performUpdateForStatus.d.ts +1 -0
  268. package/scripts/change/changeVideoAspectTo.d.ts +1 -0
  269. package/scripts/change/setUseNewVersion.d.cts +1 -0
  270. package/scripts/changeCommunityGroupcount.d.ts +1 -0
  271. package/scripts/changeCommunityPostCount.d.ts +1 -0
  272. package/scripts/changeGroupPostCount.d.ts +1 -0
  273. package/scripts/changeLanguage.d.ts +1 -0
  274. package/scripts/changeOfficalStatus.d.ts +1 -0
  275. package/scripts/cleanups/deleteAnonNotifications.d.cts +1 -0
  276. package/scripts/cleanups/deleteLinkGroupsWithDeletedCommunities.d.ts +1 -0
  277. package/scripts/cleanups/deleteYearOldNotifications.d.cts +1 -0
  278. package/scripts/cleanups/removeAllUsersFromHiddenPublicGroup.d.ts +1 -0
  279. package/scripts/clearAllEndorsementInGroup.d.ts +1 -0
  280. package/scripts/cloning/clearUsersForCommunitiesFromUrl.d.ts +1 -0
  281. package/scripts/cloning/cloneFromUrlScript.d.ts +1 -0
  282. package/scripts/cloning/cloneWBFromUrlScriptAndCreateLinks.d.ts +1 -0
  283. package/scripts/cloning/cloneWBFromUrlScriptNoUsersOrPoints.d.ts +1 -0
  284. package/scripts/cloning/cloneWBSerbianFromUrlScriptAndCreateLinks.d.ts +1 -0
  285. package/scripts/cloning/copyCommunityConfigAndTranslationsFromURL.d.ts +1 -0
  286. package/scripts/cloning/copyCommunityOneGroupToDomainNoUsersNoEndorsements.d.ts +1 -0
  287. package/scripts/cloning/copyCommunityToDomainNoUsersNoEndorsements.d.ts +1 -0
  288. package/scripts/cloning/copyCommunityToDomainWithEverything.d.ts +1 -0
  289. package/scripts/cloning/copyCommunityToDomainWithOnlyGroups.d.ts +1 -0
  290. package/scripts/cloning/copyGroupConfigAndTranslationsFromURL.d.ts +1 -0
  291. package/scripts/cloning/copyPostToGroupOld.d.ts +1 -0
  292. package/scripts/cloning/copyPostVideosFromURL.d.ts +1 -0
  293. package/scripts/cloning/copyPostWithOutAnyVotingOrActivities.d.ts +1 -0
  294. package/scripts/cloning/deepCloneSerbianWBFromUrlScriptAndCreateLinks.d.ts +1 -0
  295. package/scripts/cloning/deepCloneWBFromUrlScriptAndCreateLinks.d.ts +1 -0
  296. package/scripts/cloning/setAdminsFromURL.d.ts +1 -0
  297. package/scripts/cloning/setExternalIdsFromURL.d.ts +1 -0
  298. package/scripts/countCommunity.d.ts +1 -0
  299. package/scripts/countCommunityUsers.d.ts +1 -0
  300. package/scripts/countDelayedNotifications.d.ts +1 -0
  301. package/scripts/countGroup.d.ts +1 -0
  302. package/scripts/countStuff.d.ts +1 -0
  303. package/scripts/countUniqueVotersInAGroup.d.ts +1 -0
  304. package/scripts/createInvitesAndShow.d.ts +1 -0
  305. package/scripts/database/sync_database.d.ts +1 -0
  306. package/scripts/database/sync_dev_database.d.ts +1 -0
  307. package/scripts/debugNotifications.d.ts +1 -0
  308. package/scripts/deleteAllNewsFeeds.d.ts +1 -0
  309. package/scripts/deleteCategory.d.ts +1 -0
  310. package/scripts/deleteOldAppActivities.d.ts +1 -0
  311. package/scripts/deletePostContactDataForCommunity.d.ts +1 -0
  312. package/scripts/destroy/destroy_all_but_one_domain.d.ts +1 -0
  313. package/scripts/displayAuthorForPost.d.ts +1 -0
  314. package/scripts/endorsementFraudDetection/analyseEndorsementsForCommunity.d.ts +1 -0
  315. package/scripts/endorsementFraudDetection/bulkDeleteDuplicateEndorsmentsFromUrl.d.ts +1 -0
  316. package/scripts/exportAllStatusChanges.d.ts +1 -0
  317. package/scripts/exportClientAcitivity.d.ts +1 -0
  318. package/scripts/exportEndorsementsForCommunity.d.ts +1 -0
  319. package/scripts/exportPointQualitiesForCommunity.d.ts +1 -0
  320. package/scripts/exportPostsAndPointsForCommunity.d.ts +1 -0
  321. package/scripts/exportPostsDataSetForDomain.d.ts +1 -0
  322. package/scripts/exportPostsForGroup.d.ts +1 -0
  323. package/scripts/exportRatingsForPost.d.ts +1 -0
  324. package/scripts/exportUserEndorsementsWithUserAnalysis.d.ts +1 -0
  325. package/scripts/exportUsersForCommunity.d.ts +1 -0
  326. package/scripts/exportUsersForDomain.d.ts +1 -0
  327. package/scripts/exportUsersForGroup.d.ts +1 -0
  328. package/scripts/exports/ratingDistribution.d.ts +1 -0
  329. package/scripts/exports/whoEndorsedWhatByCommunity.d.ts +1 -0
  330. package/scripts/findUnusedClientImports.d.ts +1 -0
  331. package/scripts/fixAllPostPointCounts.d.ts +1 -0
  332. package/scripts/fixAnonNotificationsSettings.d.ts +1 -0
  333. package/scripts/fixCountKopavogur.d.ts +1 -0
  334. package/scripts/fixEndorsementsAfterCopyPostToGroup.d.ts +1 -0
  335. package/scripts/fixExternalUserId.d.ts +1 -0
  336. package/scripts/fixGroupAccess.d.ts +1 -0
  337. package/scripts/fixGroupIdeasAndPointsCount.d.ts +1 -0
  338. package/scripts/fixNotificationSettings.d.ts +1 -0
  339. package/scripts/fixSurveyRadioBakedInSubCodes.d.ts +1 -0
  340. package/scripts/fixWrongUserIdForStatusUpdates.d.ts +1 -0
  341. package/scripts/gallery/exportGalleryData.d.ts +1 -0
  342. package/scripts/gallery/importGalleryForCommunity.d.ts +1 -0
  343. package/scripts/gallery/readJsonAndDownloadImagesVersion2.d.ts +1 -0
  344. package/scripts/gallery/refreshAcApiPostIdsForCommunity.d.ts +1 -0
  345. package/scripts/genderAnalysis.d.ts +1 -0
  346. package/scripts/genderAnalysisByStatus.d.ts +1 -0
  347. package/scripts/importAllLocalesFromLocalFolders.d.ts +1 -0
  348. package/scripts/importDomain.d.ts +1 -0
  349. package/scripts/keys/addOidcToDomain.d.cts +1 -0
  350. package/scripts/landUseGame/export3Ddata.d.ts +1 -0
  351. package/scripts/listLanguagesForGroup.d.ts +1 -0
  352. package/scripts/loadTestCreateDummyContentForGroup.d.ts +1 -0
  353. package/scripts/makeRecursiveMapData.d.ts +1 -0
  354. package/scripts/mapping/community_map_csv.d.ts +1 -0
  355. package/scripts/moveCommunityToDomain.d.ts +1 -0
  356. package/scripts/moveGroupToCommunity.d.ts +1 -0
  357. package/scripts/movePostToGroup.d.ts +1 -0
  358. package/scripts/movePostsToGroupsRecountGroupFromUrl.d.ts +1 -0
  359. package/scripts/oldMovePostToGroup.d.ts +1 -0
  360. package/scripts/processCsvForPdfUrls.d.ts +1 -0
  361. package/scripts/processCsvForTranslationAndToxicity.d.ts +1 -0
  362. package/scripts/recount/recount_recursive_communities.d.ts +1 -0
  363. package/scripts/recountALLCommunityGroupCounts.d.ts +1 -0
  364. package/scripts/recountAll.d.ts +1 -0
  365. package/scripts/recountCommunitesFromUrl.d.ts +1 -0
  366. package/scripts/recountCommunity.d.ts +1 -0
  367. package/scripts/recountGroup.d.ts +1 -0
  368. package/scripts/recountGroupNoUserChange.d.ts +1 -0
  369. package/scripts/resetAllEndorsementsForGroup.d.ts +1 -0
  370. package/scripts/resetEnTranslationForGroup.d.ts +1 -0
  371. package/scripts/setAdminOnAll.d.cts +1 -0
  372. package/scripts/setDomainAdmin.d.cts +1 -0
  373. package/scripts/setDomainLocales.d.ts +1 -0
  374. package/scripts/setEarlQuestionIdOnGroup.d.cts +1 -0
  375. package/scripts/setLanguageOnGroupCommunitesFromUrl.d.ts +1 -0
  376. package/scripts/setMemberOfAll.d.ts +1 -0
  377. package/scripts/setNewUserForContentOfCommunity.d.ts +1 -0
  378. package/scripts/setOfficialStatusOnAllPostsForCommunity.d.ts +1 -0
  379. package/scripts/setUserOnAll.d.ts +1 -0
  380. package/scripts/showCategoryForGroup.d.ts +1 -0
  381. package/scripts/showOldActivityTypes.d.ts +1 -0
  382. package/scripts/showPostsMissingCategoryForGroup.d.ts +1 -0
  383. package/scripts/showStatuses.d.ts +1 -0
  384. package/scripts/showUniqueVotersInCommunity.d.ts +1 -0
  385. package/scripts/showUserAgentsAndIpsForEmails.d.ts +1 -0
  386. package/scripts/simpleExportForGroupsForCommunity.d.ts +1 -0
  387. package/scripts/simpleExportForPointsForCommunity.d.ts +1 -0
  388. package/scripts/simpleExportForPostsForCommunity.d.ts +1 -0
  389. package/scripts/testForEndorsments.d.ts +1 -0
  390. package/scripts/undeleteGroupAndAllContent.d.ts +1 -0
  391. package/scripts/undeletePost.d.ts +1 -0
  392. package/scripts/unlinkSsn.d.ts +1 -0
  393. package/scripts/updateFromAlthingi.d.ts +1 -0
  394. package/server.d.ts +1 -104
  395. package/utils/airbrake.d.cts +2 -0
  396. package/utils/cjsCodeReview.d.ts +13 -0
  397. package/utils/community_mapping_tools.d.cts +1 -0
  398. package/utils/copy_utils.d.cts +11 -0
  399. package/utils/copy_utils.d.ts +4 -0
  400. package/utils/docx_utils.d.cts +1 -0
  401. package/utils/export_utils.d.cts +21 -0
  402. package/utils/i18n.d.cts +2 -0
  403. package/utils/is_valid_db_id.d.cts +1 -0
  404. package/utils/logger.d.cts +2 -0
  405. package/utils/loggerTs.d.ts +3 -0
  406. package/utils/manifest_generator.d.cts +2 -0
  407. package/utils/manifest_generator.d.ts +18 -0
  408. package/utils/parse_domain.d.cts +6 -0
  409. package/utils/recount_utils.d.cts +7 -0
  410. package/utils/sharing_parameters.d.cts +8 -0
  411. package/utils/sitemap_generator.d.cts +2 -0
  412. package/utils/to_json.d.cts +2 -0
  413. package/utils/ypLanguages.d.ts +16 -0
  414. package/webSockets.d.ts +26 -0
@@ -0,0 +1,49 @@
1
+ import { YpAgentAssistant } from "../../agentAssistant.js";
2
+ import { BaseAssistantTools } from "./baseTools.js";
3
+ export declare class WorkflowConversationTools extends BaseAssistantTools {
4
+ constructor(assistant: YpAgentAssistant);
5
+ get show_running_workflow_conversations(): {
6
+ name: string;
7
+ description: string;
8
+ type: string;
9
+ parameters: {
10
+ type: string;
11
+ properties: YpAgentEmptyProperties;
12
+ required: readonly [];
13
+ };
14
+ handler: (params: {}) => Promise<ToolExecutionResult>;
15
+ };
16
+ showRunningWorkflowsHandler(params: {}): Promise<ToolExecutionResult>;
17
+ get show_all_workflow_conversations(): {
18
+ name: string;
19
+ description: string;
20
+ type: string;
21
+ parameters: {
22
+ type: string;
23
+ properties: YpAgentEmptyProperties;
24
+ required: readonly [];
25
+ };
26
+ handler: (params: {}) => Promise<ToolExecutionResult>;
27
+ };
28
+ showAllWorkflowsHandler(params: {}): Promise<ToolExecutionResult>;
29
+ get connect_to_workflow_conversation(): {
30
+ name: string;
31
+ description: string;
32
+ type: string;
33
+ parameters: {
34
+ type: string;
35
+ properties: {
36
+ workflowId: {
37
+ type: string;
38
+ };
39
+ };
40
+ required: readonly ["workflowId"];
41
+ };
42
+ handler: (params: {
43
+ workflowId: number;
44
+ }) => Promise<ToolExecutionResult>;
45
+ };
46
+ connectToWorkflowHandler(params: {
47
+ workflowId: number;
48
+ }): Promise<ToolExecutionResult>;
49
+ }
@@ -0,0 +1,78 @@
1
+ import { YpBaseChatBot } from "../../active-citizen/llms/baseChatBot.js";
2
+ import { YpBaseAssistant } from "./baseAssistant.js";
3
+ import WebSocket from "ws";
4
+ import ioredis from "ioredis";
5
+ interface VoiceMessage {
6
+ delta: any;
7
+ type: string;
8
+ content?: string;
9
+ audio?: string;
10
+ metadata?: any;
11
+ }
12
+ interface VoiceState {
13
+ speaking: boolean;
14
+ listening: boolean;
15
+ processingAudio: boolean;
16
+ lastAudioTimestamp?: number;
17
+ }
18
+ interface VoiceConnectionConfig {
19
+ model: string;
20
+ voice: string;
21
+ instructions?: string;
22
+ tools?: AssistantChatbotTool[];
23
+ modalities: ("text" | "audio")[];
24
+ }
25
+ interface RealtimeVoiceConnection {
26
+ ws: WebSocket;
27
+ connected: boolean;
28
+ model: string;
29
+ voice: string;
30
+ }
31
+ export declare class YpBaseChatBotWithVoice extends YpBaseChatBot {
32
+ protected voiceEnabled: boolean;
33
+ assistantVoiceConnection?: RealtimeVoiceConnection;
34
+ directAgentVoiceConnection?: RealtimeVoiceConnection;
35
+ private voiceMainMessageHandler?;
36
+ private voiceDirectMessageHandler?;
37
+ protected voiceConfig: VoiceConnectionConfig;
38
+ protected voiceState: VoiceState;
39
+ protected readonly VAD_TIMEOUT = 1000;
40
+ protected vadTimeout?: NodeJS.Timeout;
41
+ protected parentAssistant: YpBaseAssistant;
42
+ sendTranscriptsToClient: boolean;
43
+ isWaitingOnCancelResponseCompleted: boolean;
44
+ lastNumberOfChatHistoryForInstructions: number;
45
+ exitMessageFromDirectAgentConversation: string | undefined;
46
+ DEBUG: boolean;
47
+ constructor(wsClientId: string, wsClients: Map<string, WebSocket>, redisKey: string, redisConnection: ioredis.Redis, voiceEnabled: boolean | undefined, parentAssistant: YpBaseAssistant);
48
+ updateAiModelSession(message: string): Promise<void>;
49
+ initializeMainAssistantVoiceConnection(): Promise<void>;
50
+ initializeDirectAgentVoiceConnection(): Promise<void>;
51
+ destroyDirectAgentVoiceConnection(): Promise<void>;
52
+ destroyAssistantVoiceConnection(): void;
53
+ protected setupVoiceMessageHandlers(ws: WebSocket, disableWhenAgentIsSpeaking: boolean): void;
54
+ destroy(): void;
55
+ handleResponseDone(event: any): Promise<void>;
56
+ handleAudioTranscriptDone(event: any): Promise<void>;
57
+ callFunctionHandler(event: any): Promise<void>;
58
+ getRandomStringAscii(length?: number): string;
59
+ proxyToClient(event: any): Promise<void>;
60
+ handleIncomingAudio(audioData: Uint8Array): Promise<void>;
61
+ private handleVADSilence;
62
+ private handleSpeechStarted;
63
+ private handleSpeechStopped;
64
+ handleAudioDelta(event: VoiceMessage): Promise<void>;
65
+ private handleTextOutput;
66
+ sendToVoiceConnection(message: any): void;
67
+ private handleAudioBufferCommitted;
68
+ waitForCancelResponseCompleted(): Promise<void>;
69
+ sendCancelResponse(): Promise<void>;
70
+ initializeVoiceSession(customResponseMessage?: string): Promise<void>;
71
+ triggerResponse(message: string, cancelResponse?: boolean): Promise<void>;
72
+ protected handleVoiceSessionCreated(event: any): Promise<void>;
73
+ protected handleVoiceSessionError(event: any): Promise<void>;
74
+ protected handleVoiceResponseStatus(event: any): Promise<void>;
75
+ streamWebSocketResponses(stream: any): Promise<void>;
76
+ updateVoiceConfig(config: Partial<VoiceConnectionConfig>): Promise<void>;
77
+ }
78
+ export {};
@@ -0,0 +1,23 @@
1
+ import express from 'express';
2
+ interface YpRequest extends express.Request {
3
+ ypDomain?: any;
4
+ ypCommunity?: any;
5
+ sso?: any;
6
+ redisClient?: any;
7
+ user?: any;
8
+ }
9
+ export declare class AgentProductController {
10
+ path: string;
11
+ router: import("express-serve-static-core").Router;
12
+ private agentProductManager;
13
+ constructor();
14
+ initializeRoutes(): void;
15
+ getAgentProducts: (req: YpRequest, res: express.Response) => Promise<void>;
16
+ getAgentProduct: (req: YpRequest, res: express.Response) => Promise<void>;
17
+ createAgentProduct: (req: YpRequest, res: express.Response) => Promise<void>;
18
+ updateAgentProduct: (req: YpRequest, res: express.Response) => Promise<void>;
19
+ deleteAgentProduct: (req: YpRequest, res: express.Response) => Promise<void>;
20
+ getAgentProductRuns: (req: YpRequest, res: express.Response) => Promise<void>;
21
+ getAgentProductStatus: (req: YpRequest, res: express.Response) => Promise<void>;
22
+ }
23
+ export {};
@@ -0,0 +1,30 @@
1
+ import express from "express";
2
+ import WebSocket from "ws";
3
+ interface YpRequest extends express.Request {
4
+ ypDomain?: any;
5
+ ypCommunity?: any;
6
+ sso?: any;
7
+ redisClient?: any;
8
+ user?: any;
9
+ }
10
+ export declare class AgentSubscriptionController {
11
+ path: string;
12
+ router: import("express-serve-static-core").Router;
13
+ private subscriptionManager;
14
+ private wsClients;
15
+ constructor(wsClients: Map<string, WebSocket>);
16
+ initializeRoutes(): void;
17
+ initializeRoutesSecure(): void;
18
+ getAgentConfigurationAnswers: (req: YpRequest, res: express.Response) => Promise<void>;
19
+ updateAgentConfiguration: (req: YpRequest, res: express.Response) => Promise<void>;
20
+ getPlans: (req: YpRequest, res: express.Response) => Promise<void>;
21
+ createSubscriptions: (req: YpRequest, res: express.Response) => Promise<void>;
22
+ startAgentRun: (req: YpRequest, res: express.Response) => Promise<void>;
23
+ stopAgentRun: (req: YpRequest, res: express.Response) => Promise<void>;
24
+ getSubscriptions: (req: YpRequest, res: express.Response) => Promise<void>;
25
+ cancelSubscription: (req: YpRequest, res: express.Response) => Promise<void>;
26
+ updateSubscription: (req: YpRequest, res: express.Response) => Promise<void>;
27
+ createPaymentIntent: (req: YpRequest, res: express.Response) => Promise<void>;
28
+ handleWebhook: (req: YpRequest, res: express.Response) => Promise<void>;
29
+ }
30
+ export {};
@@ -0,0 +1,47 @@
1
+ import express from "express";
2
+ import WebSocket from "ws";
3
+ import { YpAgentAssistant } from "../assistants/agentAssistant.js";
4
+ interface YpRequest extends express.Request {
5
+ ypDomain?: any;
6
+ ypCommunity?: any;
7
+ sso?: any;
8
+ redisClient?: any;
9
+ user?: any;
10
+ clientAppPath?: string;
11
+ adminAppPath?: string;
12
+ dirName?: string;
13
+ useNewVersion?: boolean;
14
+ }
15
+ export declare class AssistantController {
16
+ path: string;
17
+ router: import("express-serve-static-core").Router;
18
+ wsClients: Map<string, WebSocket>;
19
+ chatAssistantInstances: Map<string, YpAgentAssistant>;
20
+ voiceAssistantInstances: Map<string, YpAgentAssistant>;
21
+ private agentQueueManager;
22
+ private workflowConversationManager;
23
+ constructor(wsClients: Map<string, WebSocket>);
24
+ initializeModels: () => Promise<void>;
25
+ initializeRoutes(): void;
26
+ private getLastStatusMessageFromDB;
27
+ private getDocxReport;
28
+ private advanceOrStopCurrentWorkflowStep;
29
+ private startNextWorkflowStep;
30
+ private stopCurrentWorkflowStep;
31
+ getAgentConfigurationAnswers: (req: YpRequest, res: express.Response) => Promise<void>;
32
+ private getUpdatedWorkflow;
33
+ private startWorkflowAgent;
34
+ private submitAgentConfiguration;
35
+ private updateAssistantMemoryLoginStatus;
36
+ private defaultStartAgentMode;
37
+ private getMemoryRedisKey;
38
+ private loadMemoryWithOwnership;
39
+ private clearChatLog;
40
+ private getMemory;
41
+ private startVoiceSession;
42
+ private sendChatMessage;
43
+ private getRunningWorkflowConversations;
44
+ private getAllWorkflowConversations;
45
+ private connectToWorkflowConversation;
46
+ }
47
+ export {};
@@ -0,0 +1,49 @@
1
+ import express from "express";
2
+ import WebSocket from "ws";
3
+ interface YpRequest extends express.Request {
4
+ ypDomain?: any;
5
+ ypCommunity?: any;
6
+ sso?: any;
7
+ redisClient?: any;
8
+ user?: any;
9
+ }
10
+ export declare class PolicySynthAgentsController {
11
+ path: string;
12
+ router: import("express-serve-static-core").Router;
13
+ wsClients: Map<string, WebSocket>;
14
+ private agentQueueManager;
15
+ private agentCostManager;
16
+ private agentManager;
17
+ private agentConnectorManager;
18
+ private agentRegistryManager;
19
+ constructor(wsClients: Map<string, WebSocket>);
20
+ /**
21
+ * A proxy for setting up API keys for a group.
22
+ * @param group The group instance to configure
23
+ */
24
+ static setupApiKeysForGroup(group: any): Promise<void>;
25
+ initializeRoutes(): void;
26
+ replaceAgentMemory: (req: YpRequest, res: express.Response) => Promise<void>;
27
+ addExistingConnector: (req: YpRequest, res: express.Response) => Promise<void>;
28
+ getAgentMemory: (req: YpRequest, res: express.Response) => Promise<void>;
29
+ getAgent: (req: express.Request, res: express.Response) => Promise<void>;
30
+ getAgentAiModels: (req: express.Request, res: express.Response) => Promise<void>;
31
+ removeAgentAiModel: (req: express.Request, res: express.Response) => Promise<void>;
32
+ addAgentAiModel: (req: express.Request, res: express.Response) => Promise<void>;
33
+ updateNodeConfiguration: (req: express.Request, res: express.Response) => Promise<void>;
34
+ createInputConnector: (req: express.Request, res: express.Response) => Promise<void>;
35
+ createOutputConnector: (req: express.Request, res: express.Response) => Promise<void>;
36
+ createConnector: (req: YpRequest, res: express.Response, type: "input" | "output") => Promise<express.Response<any, Record<string, any>> | undefined>;
37
+ getActiveAiModels: (req: express.Request, res: express.Response) => Promise<void>;
38
+ getActiveAgentClasses: (req: YpRequest, res: express.Response) => Promise<void>;
39
+ getActiveConnectorClasses: (req: YpRequest, res: express.Response) => Promise<void>;
40
+ createAgent: (req: YpRequest, res: express.Response) => Promise<void>;
41
+ controlAgent: (req: express.Request, res: express.Response) => Promise<void>;
42
+ getAgentStatus: (req: express.Request, res: express.Response) => Promise<void>;
43
+ updateAgentStatus: (req: express.Request, res: express.Response) => Promise<void>;
44
+ startAgentProcessing: (req: express.Request, res: express.Response) => Promise<void>;
45
+ pauseAgentProcessing: (req: express.Request, res: express.Response) => Promise<void>;
46
+ getAgentCosts: (req: express.Request, res: express.Response) => Promise<void>;
47
+ getAgentCostsDetail: (req: express.Request, res: express.Response) => Promise<void>;
48
+ }
49
+ export {};
@@ -0,0 +1,12 @@
1
+ import { YpAgentProduct } from '../models/agentProduct.js';
2
+ import { YpAgentProductRun } from '../models/agentProductRun.js';
3
+ export declare class AgentProductManager {
4
+ constructor();
5
+ getAgentProducts(filters?: any): Promise<YpAgentProduct[]>;
6
+ getAgentProduct(agentProductId: number): Promise<YpAgentProduct | null>;
7
+ createAgentProduct(data: any): Promise<YpAgentProduct>;
8
+ updateAgentProduct(agentProductId: number, updates: any): Promise<YpAgentProduct>;
9
+ deleteAgentProduct(agentProductId: number): Promise<void>;
10
+ getAgentProductRuns(agentProductId: number): Promise<YpAgentProductRun[]>;
11
+ getAgentProductStatus(agentProductId: number): Promise<any>;
12
+ }
@@ -0,0 +1,6 @@
1
+ export declare class AgentInviteManager {
2
+ /**
3
+ * Send a notification email to group admins about the current workflow step or completion.
4
+ */
5
+ static sendInviteEmail(link: string, agentRunId: number, groupId: number, senderUser: UserClass, inviteeEmail: string): Promise<void>;
6
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A flexible renderer for "Competitor Agent" (or any) workflow emails.
3
+ *
4
+ * - The CTA block (button + instructions) is inserted *within* the loop,
5
+ * right after the step that is currently active (currentStepIndex).
6
+ * - Branding (logo, brand name, footer text, etc.) are all passed in,
7
+ * so they are not hardcoded in the template.
8
+ */
9
+ export declare class EmailTemplateRenderer {
10
+ /**
11
+ * Render the dynamic email with steps, highlighting the current step,
12
+ * and inserting the CTA block immediately after the current step only.
13
+ *
14
+ * @param recipientName - e.g. "Petur".
15
+ * @param invitedBy - e.g. "Robert Bjarnason".
16
+ * @param agentName - e.g. "Competitor Agent".
17
+ * @param workflow - The workflow with steps + currentStepIndex.
18
+ * @param ctaLink - Destination URL when clicking the CTA button.
19
+ * @param brandLogoUrl - URL to your brand’s logo.
20
+ * @param brandName - Display name of the brand (e.g., "amplifier powered by Evoly").
21
+ * @param footerText - Footer text, e.g. "© 2024 Evoly ehf, Vegmuli 8..."
22
+ * @param footerEmailSettingsLink - Link to "Change email settings".
23
+ */
24
+ static renderEmail(recipientName: string, invitedBy: string, agentName: string, workflow: YpAgentRunWorkflowConfiguration, ctaLink: string, brandLogoUrl: string, brandName: string, footerText: string, footerEmailSettingsLink: string): string;
25
+ }
@@ -0,0 +1,37 @@
1
+ export declare class NewAiModelSetup {
2
+ /**
3
+ * Initializes all models by calling their associate methods (if present).
4
+ */
5
+ static initializeModels(): Promise<void>;
6
+ /**
7
+ * Seeds the test AI models (and a top-level agent class) if they do not exist.
8
+ * @param userId the user id to associate with the new models
9
+ */
10
+ static seedAnthropicModels(userId: number): Promise<void>;
11
+ static seedAnthropic37Models(userId: number): Promise<void>;
12
+ /**
13
+ * Seeds OpenAI models.
14
+ * This currently creates several models including GPT-4o, GPT-4o Mini, o1 Mini,
15
+ * o1 Preview, o1 24, and o3 mini.
16
+ */
17
+ static seedOpenAiModels(userId: number): Promise<void>;
18
+ /**
19
+ * Seeds Google models.
20
+ * Currently, this creates Gemini 1.5 Pro 2 and Gemini 1.5 Flash 2.
21
+ */
22
+ static seedGoogleModels(userId: number): Promise<void>;
23
+ /**
24
+ * Master seeding function which calls the provider-specific functions
25
+ * and also seeds a top-level agent class.
26
+ */
27
+ static seedAiModels(userId: number): Promise<void>;
28
+ /**
29
+ * Helper to delay model seeding slightly.
30
+ */
31
+ static setupAiModels(userId: number): void;
32
+ /**
33
+ * Sets up the API keys for a given group based on the latest active AI models.
34
+ * @param group The group instance on which to set the API keys
35
+ */
36
+ static setupApiKeysForGroup(group: any): Promise<void>;
37
+ }
@@ -0,0 +1,23 @@
1
+ import { Queue } from "bullmq";
2
+ import { Redis } from "ioredis";
3
+ import { AgentQueueManager } from "@policysynth/agents/operations/agentQueueManager.js";
4
+ import { PsAgent } from "@policysynth/agents/dbModels/agent.js";
5
+ import WebSocket from "ws";
6
+ import { YpAgentProductRun } from "../models/agentProductRun.js";
7
+ export declare class NotificationAgentQueueManager extends AgentQueueManager {
8
+ redisClient: Redis;
9
+ queues: Map<string, Queue>;
10
+ wsClients: Map<string, WebSocket>;
11
+ constructor(wsClients: Map<string, WebSocket>);
12
+ sendNotification(agent: PsAgent, agentRun: YpAgentProductRun, action: string, wsClientId: string, status: string, result: any, agentRunId?: number, updatedWorkflow?: YpAgentRunWorkflowConfiguration): Promise<void>;
13
+ sendNotificationEmail(agent: PsAgent, agentRun: YpAgentProductRun, updatedWorkflow: YpAgentRunWorkflowConfiguration): Promise<void>;
14
+ goBackOneWorkflowStepIfNeeded(agentRunId: number, status: string, wsClientId: string, currentWorkflowStepIndex?: number | undefined): Promise<void>;
15
+ advanceWorkflowStepOrCompleteAgentRun(agentRunId: number, status: string, wsClientId: string, currentWorkflowStepIndex?: number | undefined): Promise<YpAgentRunWorkflowConfiguration | undefined>;
16
+ static getAgentRun(agentRunId: number): Promise<YpAgentProductRun | null>;
17
+ getQueue(queueName: string): Queue;
18
+ controlAgent(agentId: number, action: string): Promise<string>;
19
+ startAgentProcessingWithWsClient(agentId: number, agentRunId: number, wsClientId: string, structuredAnswersOverrides?: YpStructuredAnswer[]): Promise<string | undefined>;
20
+ stopAgentProcessing(agentId: number, wsClientId: string, agentRunId: number): Promise<boolean>;
21
+ getAgentStatus(agentId: number): Promise<PsAgentStatus | null>;
22
+ updateAgentStatus(agentId: number, state: PsAgentStatus["state"], progress?: number, message?: string, details?: Record<string, any>): Promise<boolean>;
23
+ }
@@ -0,0 +1,29 @@
1
+ import { YpSubscriptionPlan } from "../models/subscriptionPlan.js";
2
+ import { YpSubscription } from "../models/subscription.js";
3
+ import { YpAgentProduct } from "../models/agentProduct.js";
4
+ import { YpAgentProductRun } from "../models/agentProductRun.js";
5
+ import WebSocket from "ws";
6
+ export declare class SubscriptionManager {
7
+ constructor();
8
+ getPlans(): Promise<YpSubscriptionPlan[]>;
9
+ cloneCommunityTemplate(communityTemplateId: number, toDomainId: number): Promise<any>;
10
+ cloneCommunityWorkflowTemplate(agentProduct: YpAgentProduct, domainId: number, currentUser: UserClass): Promise<{
11
+ workflow: YpAgentRunWorkflowConfiguration;
12
+ requiredQuestions?: any[];
13
+ }>;
14
+ createSubscriptions(userId: number, planIds: number[], paymentMethodId: string | null): Promise<{
15
+ clientSecret?: string;
16
+ subscriptionId?: string;
17
+ freeSubscription?: boolean;
18
+ }>;
19
+ handleSuccessfulPayment(paymentIntentId: string): Promise<YpSubscription[]>;
20
+ startAgentRun(subscriptionId: number, wsClients: Map<string, WebSocket>, wsClientId: string, currentUser: UserClass): Promise<{
21
+ agentRun: YpAgentProductRun;
22
+ subscription: YpSubscription;
23
+ }>;
24
+ startFirstAgent(agentProductRun: YpAgentProductRun, wsClients: Map<string, WebSocket>, wsClientId: string): Promise<boolean>;
25
+ stopAgentRun(agentProductRunId: number): Promise<void>;
26
+ private calculateNextBillingDate;
27
+ private incrementRunsUsed;
28
+ private checkRunsLimit;
29
+ }
@@ -0,0 +1,14 @@
1
+ import { YpWorkflowConversation } from "../models/workflowConversation.js";
2
+ export declare class WorkflowConversationManager {
3
+ constructor();
4
+ createWorkflowConversation(data: {
5
+ agentProductId: number;
6
+ userId?: number;
7
+ configuration?: Record<string, any>;
8
+ }): Promise<YpWorkflowConversation>;
9
+ getWorkflowConversation(workflowConversationId: number): Promise<YpWorkflowConversation | null>;
10
+ updateWorkflowConversation(workflowConversationId: number, updates: Record<string, any>): Promise<YpWorkflowConversation>;
11
+ connectToWorkflowConversation(workflowConversationId: number, connectionData: Record<string, any>): Promise<YpWorkflowConversation>;
12
+ getWorkflowConversationsForUser(userId: number): Promise<YpWorkflowConversation[]>;
13
+ getRunningWorkflowConversationsForUser(userId: number): Promise<YpWorkflowConversation[]>;
14
+ }
@@ -0,0 +1,31 @@
1
+ import { Model } from "sequelize";
2
+ import { YpSubscriptionUser } from "./subscriptionUser.js";
3
+ import { YpAgentProductBoosterPurchase } from "./agentProductBoosterPurchase.js";
4
+ import { YpSubscription } from "./subscription.js";
5
+ import { YpAgentProductRun } from "./agentProductRun.js";
6
+ import { YpSubscriptionPlan } from "./subscriptionPlan.js";
7
+ import { YpAgentProductBundle } from "./agentProductBundle.js";
8
+ export declare class YpAgentProduct extends Model {
9
+ id: number;
10
+ uuid: string;
11
+ name: string;
12
+ description: string;
13
+ user_id: number;
14
+ group_id: number;
15
+ domain_id: number;
16
+ parent_agent_product_id: number;
17
+ configuration: YpAgentProductConfiguration;
18
+ status?: YpAgentProductStatus;
19
+ created_at: Date;
20
+ updated_at: Date;
21
+ User?: YpSubscriptionUser;
22
+ Group?: YpGroupData;
23
+ BoosterPurchases?: YpAgentProductBoosterPurchase[];
24
+ Subscriptions?: YpSubscription[];
25
+ SubscriptionPlans?: YpSubscriptionPlan[];
26
+ Runs?: YpAgentProductRun[];
27
+ AgentBundles?: YpAgentProductBundle[];
28
+ AgentBundle?: YpAgentProductBundle;
29
+ ParentAgentProduct?: YpAgentProduct;
30
+ ChildAgentProducts?: YpAgentProduct[];
31
+ }
@@ -0,0 +1,27 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpSubscriptionUser } from './subscriptionUser.js';
3
+ import { YpAgentProduct } from './agentProduct.js';
4
+ import { YpSubscriptionPlan } from './subscriptionPlan.js';
5
+ import { YpDiscount } from './discount.js';
6
+ export declare class YpAgentProductBoosterPurchase extends Model {
7
+ id: number;
8
+ uuid: string;
9
+ user_id: number;
10
+ agent_product_id: number;
11
+ subscription_plan_id: number;
12
+ runs_purchased: number;
13
+ amount: number;
14
+ currency: string;
15
+ purchase_date: Date;
16
+ payment_method?: string;
17
+ status: string;
18
+ transaction_id?: string;
19
+ metadata?: any;
20
+ discount_id?: number;
21
+ created_at: Date;
22
+ updated_at: Date;
23
+ User?: YpSubscriptionUser;
24
+ AgentProduct?: YpAgentProduct;
25
+ SubscriptionPlan?: YpSubscriptionPlan;
26
+ Discount?: YpDiscount;
27
+ }
@@ -0,0 +1,12 @@
1
+ import { Model } from "sequelize";
2
+ import { YpAgentProduct } from './agentProduct.js';
3
+ export declare class YpAgentProductBundle extends Model {
4
+ id: number;
5
+ uuid: string;
6
+ name: string;
7
+ description?: string;
8
+ configuration?: YpAgentProductBundleConfiguration;
9
+ created_at: Date;
10
+ updated_at: Date;
11
+ AgentProducts?: YpAgentProduct[];
12
+ }
@@ -0,0 +1,23 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpSubscription } from './subscription.js';
3
+ export declare class YpAgentProductRun extends Model {
4
+ id: number;
5
+ uuid: string;
6
+ subscription_id: number;
7
+ start_time: Date;
8
+ end_time?: Date;
9
+ duration?: number;
10
+ status: YpAgentProductRunStatus;
11
+ input_data?: any;
12
+ output_data?: any;
13
+ error_message?: string;
14
+ run_type?: string;
15
+ metadata?: any;
16
+ workflow: YpAgentRunWorkflowConfiguration;
17
+ parent_agent_product_run_id?: number;
18
+ created_at: Date;
19
+ updated_at: Date;
20
+ Subscription?: YpSubscription;
21
+ ParentAgentProductRun?: YpAgentProductRun;
22
+ ChildAgentProductRuns?: YpAgentProductRun[];
23
+ }
@@ -0,0 +1,21 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpSubscription } from './subscription.js';
3
+ import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
4
+ export declare class YpDiscount extends Model {
5
+ id: number;
6
+ uuid: string;
7
+ code: string;
8
+ description?: string;
9
+ discount_type: 'percentage' | 'fixed';
10
+ discount_value: number;
11
+ max_uses?: number;
12
+ uses: number;
13
+ start_date?: Date;
14
+ end_date?: Date;
15
+ applicable_to: 'agent_product' | 'booster' | 'subscription' | 'both';
16
+ created_at: Date;
17
+ updated_at: Date;
18
+ Subscriptions?: YpSubscription[];
19
+ BoosterPurchases?: YpAgentProductBoosterPurchase[];
20
+ static associate(models: any): void;
21
+ }
@@ -0,0 +1,26 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpSubscriptionUser } from './subscriptionUser.js';
3
+ import { YpAgentProduct } from './agentProduct.js';
4
+ import { YpSubscriptionPlan } from './subscriptionPlan.js';
5
+ export declare class YpSubscription extends Model {
6
+ id: number;
7
+ uuid: string;
8
+ user_id: number;
9
+ domain_id: number;
10
+ agent_product_id: number;
11
+ subscription_plan_id: number;
12
+ start_date: Date;
13
+ end_date?: Date;
14
+ next_billing_date: Date;
15
+ status: 'active' | 'paused' | 'cancelled' | 'expired';
16
+ payment_method?: string;
17
+ transaction_id?: string;
18
+ configuration?: YpSubscriptionConfiguration;
19
+ metadata?: any;
20
+ created_at: Date;
21
+ updated_at: Date;
22
+ User: YpSubscriptionUser;
23
+ AgentProduct: YpAgentProduct;
24
+ SubscriptionPlan: YpSubscriptionPlan;
25
+ Plan: YpSubscriptionPlan;
26
+ }
@@ -0,0 +1,17 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpSubscription } from './subscription.js';
3
+ import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
4
+ import { YpAgentProduct } from './agentProduct.js';
5
+ export declare class YpSubscriptionPlan extends Model {
6
+ id: number;
7
+ uuid: string;
8
+ agent_product_id: number;
9
+ name: string;
10
+ description?: string;
11
+ configuration: YpSubscriptionPlanConfiguration;
12
+ created_at: Date;
13
+ updated_at: Date;
14
+ AgentProduct?: YpAgentProduct;
15
+ Subscriptions?: YpSubscription[];
16
+ BoosterPurchases?: YpAgentProductBoosterPurchase[];
17
+ }
@@ -0,0 +1,11 @@
1
+ import { Model } from 'sequelize';
2
+ import { YpAgentProduct } from './agentProduct.js';
3
+ import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
4
+ import { YpSubscription } from './subscription.js';
5
+ export declare class YpSubscriptionUser extends Model {
6
+ id: number;
7
+ name: string;
8
+ AgentProducts?: YpAgentProduct[];
9
+ AgentProductBoosterPurchases?: YpAgentProductBoosterPurchase[];
10
+ Subscriptions?: YpSubscription[];
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Model } from "sequelize";
2
+ export declare class YpWorkflowConversation extends Model {
3
+ id: number;
4
+ agentProductId: number;
5
+ userId: number | null;
6
+ configuration: YpWorkflowConversationConfiguration;
7
+ created_at: Date;
8
+ updated_at: Date;
9
+ static initModel(sequelizeInstance?: import("sequelize").Sequelize): typeof YpWorkflowConversation;
10
+ static associate(models: Record<string, any>): void;
11
+ }
@@ -0,0 +1 @@
1
+ export {};