@futdevpro/nts-dynamo 1.14.7 → 1.14.9
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.
- package/build/_collections/global-settings.const.d.ts.map +1 -1
- package/build/_collections/global-settings.const.js +1 -0
- package/build/_collections/global-settings.const.js.map +1 -1
- package/build/_models/interfaces/global-settings.interface.d.ts +18 -2
- package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.d.ts.map +1 -1
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.js +0 -1
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js +29 -25
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js +63 -23
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js +50 -33
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js.map +1 -1
- package/build/_modules/assistant/_collections/ass-global-settings.const.d.ts +3 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.d.ts.map +1 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.js +15 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.js.map +1 -0
- package/build/_modules/assistant/_collections/ass.util.d.ts +16 -0
- package/build/_modules/assistant/_collections/ass.util.d.ts.map +1 -0
- package/build/_modules/assistant/_collections/ass.util.js +43 -0
- package/build/_modules/assistant/_collections/ass.util.js.map +1 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.d.ts +14 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.js +3 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.js.map +1 -0
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +23 -0
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass-io.control-service.js +59 -0
- package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -0
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +15 -0
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass-main.control-service.js +12 -0
- package/build/_modules/assistant/_services/ass-main.control-service.js.map +1 -0
- package/build/_modules/assistant/_services/ass.service-base.d.ts +31 -0
- package/build/_modules/assistant/_services/ass.service-base.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass.service-base.js +56 -0
- package/build/_modules/assistant/_services/ass.service-base.js.map +1 -0
- package/build/_modules/assistant/index.d.ts +7 -0
- package/build/_modules/assistant/index.d.ts.map +1 -0
- package/build/_modules/assistant/index.js +19 -0
- package/build/_modules/assistant/index.js.map +1 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.d.ts +3 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.js +14 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.js.map +1 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.d.ts +3 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.js +32 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.js.map +1 -0
- package/build/_modules/bot/_collections/bot-operations.util.d.ts +21 -0
- package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-operations.util.js +74 -0
- package/build/_modules/bot/_collections/bot-operations.util.js.map +1 -0
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts +7 -0
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts.map +1 -0
- package/build/_modules/bot/_enums/bot-provider.enum.js +11 -0
- package/build/_modules/bot/_enums/bot-provider.enum.js.map +1 -0
- package/build/_modules/bot/_models/bot-channel.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-channel.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-channel.interface.js +3 -0
- package/build/_modules/bot/_models/bot-channel.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.js +3 -0
- package/build/_modules/bot/_models/bot-command.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +79 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.js +3 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.d.ts +7 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.js +3 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.d.ts +6 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.js +3 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-message.interface.d.ts +15 -0
- package/build/_modules/bot/_models/bot-message.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-message.interface.js +3 -0
- package/build/_modules/bot/_models/bot-message.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-provider.interface.d.ts +60 -0
- package/build/_modules/bot/_models/bot-provider.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-provider.interface.js +3 -0
- package/build/_modules/bot/_models/bot-provider.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-user.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-user.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-user.interface.js +3 -0
- package/build/_modules/bot/_models/bot-user.interface.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js +13 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +5 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js +19 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts +8 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js +3 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts +53 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js +369 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +5 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.js +16 -0
- package/build/_modules/bot/_modules/discord-bot/index.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js +13 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts +7 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.js +3 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts +40 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js +116 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +4 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.js +15 -0
- package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js +13 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts +7 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.js +3 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts +40 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js +116 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +4 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.js +15 -0
- package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -0
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +15 -0
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-commands.control-service.js +72 -0
- package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +24 -0
- package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-io.control-service.js +207 -0
- package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +42 -0
- package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-main.control-service.js +223 -0
- package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts +5 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.js +28 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.js.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +17 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.js +40 -0
- package/build/_modules/bot/_services/bot-routines.control-service.js.map +1 -0
- package/build/_modules/bot/index.d.ts +21 -0
- package/build/_modules/bot/index.d.ts.map +1 -0
- package/build/_modules/bot/index.js +35 -0
- package/build/_modules/bot/index.js.map +1 -0
- package/build/_modules/defaults/_models/default-user.data-model.d.ts +20 -0
- package/build/_modules/defaults/_models/default-user.data-model.d.ts.map +1 -0
- package/build/_modules/defaults/_models/default-user.data-model.js +73 -0
- package/build/_modules/defaults/_models/default-user.data-model.js.map +1 -0
- package/build/_modules/defaults/_services/default-auth.service.d.ts +51 -0
- package/build/_modules/defaults/_services/default-auth.service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-auth.service.js +159 -0
- package/build/_modules/defaults/_services/default-auth.service.js.map +1 -0
- package/build/_modules/defaults/_services/default-socket-events.service.d.ts +24 -0
- package/build/_modules/defaults/_services/default-socket-events.service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-socket-events.service.js +61 -0
- package/build/_modules/defaults/_services/default-socket-events.service.js.map +1 -0
- package/build/_modules/defaults/_services/default-user.data-service.d.ts +25 -0
- package/build/_modules/defaults/_services/default-user.data-service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-user.data-service.js +88 -0
- package/build/_modules/defaults/_services/default-user.data-service.js.map +1 -0
- package/build/_modules/defaults/index.d.ts +5 -0
- package/build/_modules/defaults/index.d.ts.map +1 -0
- package/build/_modules/defaults/index.js +16 -0
- package/build/_modules/defaults/index.js.map +1 -0
- package/build/_modules/discord-bot/_services/dibo-io.control-service.js +1 -1
- package/build/_modules/discord-bot/_services/dibo-io.control-service.js.map +1 -1
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts +6 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts.map +1 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.js +27 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.js.map +1 -0
- package/build/_modules/messaging/_collections/msg.util.d.ts +25 -0
- package/build/_modules/messaging/_collections/msg.util.d.ts.map +1 -0
- package/build/_modules/messaging/_collections/msg.util.js +63 -0
- package/build/_modules/messaging/_collections/msg.util.js.map +1 -0
- package/build/_modules/messaging/_enums/msg-event-key.enum.d.ts +23 -0
- package/build/_modules/messaging/_enums/msg-event-key.enum.d.ts.map +1 -0
- package/build/_modules/messaging/_enums/msg-event-key.enum.js +32 -0
- package/build/_modules/messaging/_enums/msg-event-key.enum.js.map +1 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts +38 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.js +3 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.js.map +1 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.d.ts +29 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.js +110 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-events.service.d.ts +62 -0
- package/build/_modules/messaging/_services/msg-events.service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-events.service.js +204 -0
- package/build/_modules/messaging/_services/msg-events.service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts +26 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.js +126 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-main.control-service.d.ts +62 -0
- package/build/_modules/messaging/_services/msg-main.control-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-main.control-service.js +408 -0
- package/build/_modules/messaging/_services/msg-main.control-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-message.data-service.d.ts +29 -0
- package/build/_modules/messaging/_services/msg-message.data-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-message.data-service.js +104 -0
- package/build/_modules/messaging/_services/msg-message.data-service.js.map +1 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.d.ts +8 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.d.ts.map +1 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.js +21 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.js.map +1 -0
- package/build/_modules/messaging/index.d.ts +13 -0
- package/build/_modules/messaging/index.d.ts.map +1 -0
- package/build/_modules/messaging/index.js +30 -0
- package/build/_modules/messaging/index.js.map +1 -0
- package/build/_modules/messaging/messaging.controller.d.ts +13 -0
- package/build/_modules/messaging/messaging.controller.d.ts.map +1 -0
- package/build/_modules/messaging/messaging.controller.js +257 -0
- package/build/_modules/messaging/messaging.controller.js.map +1 -0
- package/package.json +71 -3
- package/src/_collections/global-settings.const.ts +2 -0
- package/src/_models/interfaces/global-settings.interface.ts +20 -2
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.ts +0 -1
- package/src/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.ts +34 -27
- package/src/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.ts +77 -23
- package/src/_modules/ai/_modules/open-ai/_services/oai-document.data-service.ts +59 -33
- package/src/_modules/assistant/_collections/ass-global-settings.const.ts +13 -0
- package/src/_modules/assistant/_collections/ass.util.ts +50 -0
- package/src/_modules/assistant/_models/ass-global-settings.interface.ts +15 -0
- package/src/_modules/assistant/_services/ass-io.control-service.ts +100 -0
- package/src/_modules/assistant/_services/ass-main.control-service.ts +38 -0
- package/src/_modules/assistant/_services/ass.service-base.ts +92 -0
- package/src/_modules/assistant/index.ts +19 -0
- package/src/_modules/bot/_collections/bot-default-commands.const.ts +12 -0
- package/src/_modules/bot/_collections/bot-global-settings.const.ts +39 -0
- package/src/_modules/bot/_collections/bot-operations.util.ts +149 -0
- package/src/_modules/bot/_enums/bot-provider.enum.ts +6 -0
- package/src/_modules/bot/_models/bot-channel.interface.ts +7 -0
- package/src/_modules/bot/_models/bot-command.interface.ts +8 -0
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +87 -0
- package/src/_modules/bot/_models/bot-last-mention-date.interface.ts +6 -0
- package/src/_modules/bot/_models/bot-last-message-date.interface.ts +5 -0
- package/src/_modules/bot/_models/bot-message.interface.ts +14 -0
- package/src/_modules/bot/_models/bot-provider.interface.ts +80 -0
- package/src/_modules/bot/_models/bot-user.interface.ts +7 -0
- package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +20 -0
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/discord-bot/_services/dib-provider.service.ts +462 -0
- package/src/_modules/bot/_modules/discord-bot/index.ts +15 -0
- package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/slack-bot/_services/slb-provider.service.ts +152 -0
- package/src/_modules/bot/_modules/slack-bot/index.ts +14 -0
- package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/teams-bot/_services/teb-provider.service.ts +152 -0
- package/src/_modules/bot/_modules/teams-bot/index.ts +14 -0
- package/src/_modules/bot/_services/bot-commands.control-service.ts +126 -0
- package/src/_modules/bot/_services/bot-io.control-service.ts +325 -0
- package/src/_modules/bot/_services/bot-main.control-service.ts +344 -0
- package/src/_modules/bot/_services/bot-provider-factory.service.ts +30 -0
- package/src/_modules/bot/_services/bot-routines.control-service.ts +83 -0
- package/src/_modules/bot/index.ts +36 -0
- package/src/_modules/defaults/_models/default-user.data-model.ts +72 -0
- package/src/_modules/defaults/_services/default-auth.service.ts +177 -0
- package/src/_modules/defaults/_services/default-socket-events.service.ts +61 -0
- package/src/_modules/defaults/_services/default-user.data-service.ts +98 -0
- package/src/_modules/defaults/index.ts +14 -0
- package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +1 -1
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +27 -0
- package/src/_modules/messaging/_collections/msg.util.ts +83 -0
- package/src/_modules/messaging/_enums/msg-event-key.enum.ts +31 -0
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +49 -0
- package/src/_modules/messaging/_services/msg-conversation.data-service.ts +146 -0
- package/src/_modules/messaging/_services/msg-events.service.ts +267 -0
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +179 -0
- package/src/_modules/messaging/_services/msg-main.control-service.ts +548 -0
- package/src/_modules/messaging/_services/msg-message.data-service.ts +129 -0
- package/src/_modules/messaging/get-messaging-routing-module.util.ts +26 -0
- package/src/_modules/messaging/index.ts +33 -0
- package/src/_modules/messaging/messaging.controller.ts +370 -0
|
@@ -106,12 +106,6 @@ export class DyNTS_OAI_DocPageDataService<
|
|
|
106
106
|
|
|
107
107
|
async processPage(page: T_Page): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>> {
|
|
108
108
|
try {
|
|
109
|
-
// ugyan a logikus az lenne, ha először compare-elnénk, és csak az után mentenénk,
|
|
110
|
-
// de akkor nem lenne id, amit a sub-element-ekhez kellenek, ezért...
|
|
111
|
-
// - először kikérjük a régi adatot,
|
|
112
|
-
// - aztán mentünk, hogy legyen id,
|
|
113
|
-
// - és utána compare-eljük
|
|
114
|
-
|
|
115
109
|
let existingPage: T_Page;
|
|
116
110
|
if (page._id) {
|
|
117
111
|
existingPage = await this.findData({
|
|
@@ -131,30 +125,47 @@ export class DyNTS_OAI_DocPageDataService<
|
|
|
131
125
|
} as DyFM_DBFilterSimple<T_Page>);
|
|
132
126
|
}
|
|
133
127
|
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
let pageCompareResult: DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>;
|
|
129
|
+
|
|
136
130
|
if (existingPage) {
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
// Compare first to determine if we need to save
|
|
132
|
+
pageCompareResult = await this.comparePage(page, existingPage);
|
|
133
|
+
|
|
134
|
+
if (pageCompareResult.result === DyNTS_DAI_CompareResult_Type.equal) {
|
|
135
|
+
// No changes detected, reuse existing page without saving
|
|
136
|
+
pageCompareResult.newPage = existingPage;
|
|
137
|
+
pageCompareResult.oldPage = existingPage;
|
|
138
|
+
} else {
|
|
139
|
+
// Changes detected, save the updated page
|
|
140
|
+
let pageDataToSave: T_Page;
|
|
141
|
+
pageDataToSave = existingPage;
|
|
142
|
+
Object.assign(pageDataToSave, page);
|
|
143
|
+
delete pageDataToSave.chunks;
|
|
144
|
+
|
|
145
|
+
const savedPage: T_Page = await this.saveData(pageDataToSave, true);
|
|
146
|
+
|
|
147
|
+
page.chunks.forEach((chunk: T_Chunk) => {
|
|
148
|
+
chunk.documentId = savedPage.documentId;
|
|
149
|
+
chunk.pageId = savedPage._id;
|
|
150
|
+
});
|
|
151
|
+
page._id = savedPage._id;
|
|
152
|
+
pageCompareResult.newPage = page;
|
|
153
|
+
}
|
|
139
154
|
} else {
|
|
140
|
-
|
|
155
|
+
// New page, save it first to get ID
|
|
156
|
+
const pageDataToSave: T_Page = {
|
|
141
157
|
...page,
|
|
142
158
|
};
|
|
143
|
-
|
|
144
|
-
delete pageDataToSave.chunks;
|
|
159
|
+
delete pageDataToSave.chunks;
|
|
145
160
|
|
|
146
|
-
|
|
161
|
+
const savedPage: T_Page = await this.saveData(pageDataToSave, true);
|
|
147
162
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
163
|
+
page.chunks.forEach((chunk: T_Chunk) => {
|
|
164
|
+
chunk.documentId = savedPage.documentId;
|
|
165
|
+
chunk.pageId = savedPage._id;
|
|
166
|
+
});
|
|
167
|
+
page._id = savedPage._id;
|
|
153
168
|
|
|
154
|
-
let pageCompareResult: DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>;
|
|
155
|
-
if (existingPage) {
|
|
156
|
-
pageCompareResult = await this.comparePage(page, existingPage);
|
|
157
|
-
} else {
|
|
158
169
|
pageCompareResult = {
|
|
159
170
|
result: DyNTS_DAI_CompareResult_Type.new,
|
|
160
171
|
newPage: page,
|
|
@@ -263,6 +274,7 @@ export class DyNTS_OAI_DocPageDataService<
|
|
|
263
274
|
const messages: string[] = [];
|
|
264
275
|
const chunkCompareResults: DyNTS_DAI_DocChunkCompareResult<T_Chunk>[] = [];
|
|
265
276
|
|
|
277
|
+
// Compare all relevant fields for comprehensive change detection
|
|
266
278
|
if (newPage.name !== oldPage.name) {
|
|
267
279
|
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
268
280
|
messages.push(`Page name modified`);
|
|
@@ -271,7 +283,42 @@ export class DyNTS_OAI_DocPageDataService<
|
|
|
271
283
|
if (newPage.content !== oldPage.content) {
|
|
272
284
|
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
273
285
|
messages.push(`Page content modified`);
|
|
286
|
+
}
|
|
274
287
|
|
|
288
|
+
// Compare allFlaggedParents arrays
|
|
289
|
+
const allFlaggedParentsEqual = this.compareStringArrays(
|
|
290
|
+
newPage.allFlaggedParents || [],
|
|
291
|
+
oldPage.allFlaggedParents || []
|
|
292
|
+
);
|
|
293
|
+
if (!allFlaggedParentsEqual) {
|
|
294
|
+
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
295
|
+
messages.push(`Page allFlaggedParents modified`);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Compare allFlaggedParentsMerged
|
|
299
|
+
if (newPage.allFlaggedParentsMerged !== oldPage.allFlaggedParentsMerged) {
|
|
300
|
+
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
301
|
+
messages.push(`Page allFlaggedParentsMerged modified`);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Compare filePath
|
|
305
|
+
if (newPage.filePath !== oldPage.filePath) {
|
|
306
|
+
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
307
|
+
messages.push(`Page filePath modified`);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Compare parentedPath arrays
|
|
311
|
+
const parentedPathEqual = this.compareStringArrays(
|
|
312
|
+
newPage.parentedPath || [],
|
|
313
|
+
oldPage.parentedPath || []
|
|
314
|
+
);
|
|
315
|
+
if (!parentedPathEqual) {
|
|
316
|
+
pageCompareResult = DyNTS_DAI_CompareResult_Type.modified;
|
|
317
|
+
messages.push(`Page parentedPath modified`);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// Only process chunks if page content actually changed
|
|
321
|
+
if (pageCompareResult === DyNTS_DAI_CompareResult_Type.modified) {
|
|
275
322
|
const docChunk_DS: DyNTS_OAI_DocChunkDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document> =
|
|
276
323
|
this.getDocChunkDataService();
|
|
277
324
|
|
|
@@ -300,6 +347,13 @@ export class DyNTS_OAI_DocPageDataService<
|
|
|
300
347
|
}
|
|
301
348
|
}
|
|
302
349
|
|
|
350
|
+
private compareStringArrays(arr1: string[], arr2: string[]): boolean {
|
|
351
|
+
if (arr1.length !== arr2.length) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
return arr1.every((item, index) => item === arr2[index]);
|
|
355
|
+
}
|
|
356
|
+
|
|
303
357
|
/* async comparePage_deep(page: T_Page, oldPage: T_Page): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>> {
|
|
304
358
|
try {
|
|
305
359
|
if (this.debugLog) {
|
|
@@ -128,13 +128,6 @@ export class DyNTS_OAI_DocumentDataService<
|
|
|
128
128
|
DyNTS_DAI_DocumentCompareResult<T_Chunk, T_Page, T_ExternalDocumentId, T_ExternalMetadata, T_Document>
|
|
129
129
|
> {
|
|
130
130
|
try {
|
|
131
|
-
// ugyan a logikus az lenne, ha először compare-elnénk, és csak az után mentenénk,
|
|
132
|
-
// de akkor nem lenne id, amit a sub-element-ekhez kellenek, ezért...
|
|
133
|
-
// - először kikérjük a régi adatot,
|
|
134
|
-
// - aztán mentünk, hogy legyen id,
|
|
135
|
-
// - és utána compare-eljük
|
|
136
|
-
|
|
137
|
-
|
|
138
131
|
let existingDocument: T_Document;
|
|
139
132
|
|
|
140
133
|
if (document._id) {
|
|
@@ -154,30 +147,47 @@ export class DyNTS_OAI_DocumentDataService<
|
|
|
154
147
|
});
|
|
155
148
|
}
|
|
156
149
|
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
let documentCompareResult: DyNTS_DAI_DocumentCompareResult<T_Chunk, T_Page, T_ExternalDocumentId, T_ExternalMetadata, T_Document>;
|
|
151
|
+
|
|
159
152
|
if (existingDocument) {
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
// Compare first to determine if we need to save
|
|
154
|
+
documentCompareResult = await this.compareDocument_deep(document, existingDocument);
|
|
155
|
+
|
|
156
|
+
if (documentCompareResult.result === DyNTS_DAI_CompareResult_Type.equal) {
|
|
157
|
+
// No changes detected, reuse existing document without saving
|
|
158
|
+
documentCompareResult.newDocument = existingDocument;
|
|
159
|
+
documentCompareResult.oldDocument = existingDocument;
|
|
160
|
+
} else {
|
|
161
|
+
// Changes detected, save the updated document
|
|
162
|
+
let docDataToSave: T_Document;
|
|
163
|
+
docDataToSave = existingDocument;
|
|
164
|
+
Object.assign(docDataToSave, document);
|
|
165
|
+
delete docDataToSave.pages;
|
|
166
|
+
|
|
167
|
+
const savedDocument: T_Document = await this.saveData(docDataToSave, true);
|
|
168
|
+
|
|
169
|
+
// set the id to the pages and the document
|
|
170
|
+
document.pages.forEach((page: T_Page) => {
|
|
171
|
+
page.documentId = savedDocument._id;
|
|
172
|
+
});
|
|
173
|
+
document._id = savedDocument._id;
|
|
174
|
+
documentCompareResult.newDocument = document;
|
|
175
|
+
}
|
|
162
176
|
} else {
|
|
163
|
-
|
|
177
|
+
// New document, save it first to get ID
|
|
178
|
+
const docDataToSave: T_Document = {
|
|
164
179
|
...document,
|
|
165
180
|
};
|
|
166
|
-
|
|
167
|
-
delete docDataToSave.pages;
|
|
181
|
+
delete docDataToSave.pages;
|
|
168
182
|
|
|
169
|
-
|
|
183
|
+
const savedDocument: T_Document = await this.saveData(docDataToSave, true);
|
|
170
184
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
185
|
+
// set the id to the pages and the document
|
|
186
|
+
document.pages.forEach((page: T_Page) => {
|
|
187
|
+
page.documentId = savedDocument._id;
|
|
188
|
+
});
|
|
189
|
+
document._id = savedDocument._id;
|
|
176
190
|
|
|
177
|
-
let documentCompareResult: DyNTS_DAI_DocumentCompareResult<T_Chunk, T_Page, T_ExternalDocumentId, T_ExternalMetadata, T_Document>;
|
|
178
|
-
if (existingDocument) {
|
|
179
|
-
documentCompareResult = await this.compareDocument_deep(document, existingDocument);
|
|
180
|
-
} else {
|
|
181
191
|
const docPage_DS: DyNTS_OAI_DocPageDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document> =
|
|
182
192
|
this.getDocPageDataService();
|
|
183
193
|
|
|
@@ -316,18 +326,34 @@ export class DyNTS_OAI_DocumentDataService<
|
|
|
316
326
|
});
|
|
317
327
|
}
|
|
318
328
|
|
|
319
|
-
let result: DyNTS_DAI_CompareResult_Type;
|
|
329
|
+
let result: DyNTS_DAI_CompareResult_Type = DyNTS_DAI_CompareResult_Type.equal;
|
|
320
330
|
const messages: string[] = [];
|
|
321
331
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
messages.push(`New document: "${newDocument.name}"`);
|
|
325
|
-
} else if (newDocument.name !== oldDocument?.name) {
|
|
332
|
+
// Compare document name
|
|
333
|
+
if (newDocument.name !== oldDocument.name) {
|
|
326
334
|
result = DyNTS_DAI_CompareResult_Type.modified;
|
|
327
|
-
messages.push(`Document name changed from "${oldDocument
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
messages.push(`Document name changed from "${oldDocument.name}" to "${newDocument.name}"`);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Compare externalDocumentId
|
|
339
|
+
if (newDocument.externalDocumentId !== oldDocument.externalDocumentId) {
|
|
340
|
+
result = DyNTS_DAI_CompareResult_Type.modified;
|
|
341
|
+
messages.push(`Document externalDocumentId changed`);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Compare externalMetadata if present
|
|
345
|
+
if (newDocument.externalMetadata || oldDocument.externalMetadata) {
|
|
346
|
+
const newMetadataStr = newDocument.externalMetadata ? JSON.stringify(newDocument.externalMetadata) : '';
|
|
347
|
+
const oldMetadataStr = oldDocument.externalMetadata ? JSON.stringify(oldDocument.externalMetadata) : '';
|
|
348
|
+
|
|
349
|
+
if (newMetadataStr !== oldMetadataStr) {
|
|
350
|
+
result = DyNTS_DAI_CompareResult_Type.modified;
|
|
351
|
+
messages.push(`Document externalMetadata changed`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (result === DyNTS_DAI_CompareResult_Type.equal) {
|
|
356
|
+
messages.push(`Document name or not changed: "${newDocument.name}"`);
|
|
331
357
|
}
|
|
332
358
|
|
|
333
359
|
const result_flat: DyNTS_DAI_DocumentCompareResult<T_Chunk, T_Page, T_ExternalDocumentId, T_ExternalMetadata, T_Document> = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DyNTS_Ass_Global_Settings } from '../_models/ass-global-settings.interface';
|
|
2
|
+
|
|
3
|
+
export const DyNTS_Ass_global_settings: DyNTS_Ass_Global_Settings = {
|
|
4
|
+
defaultSystemPrompt: 'You are a helpful assistant.',
|
|
5
|
+
skipConversationMessagesFlags: [
|
|
6
|
+
'[NOISE]',
|
|
7
|
+
'[VOICE|USER|OUTOFCONTEXT]',
|
|
8
|
+
'[DEBUG|'
|
|
9
|
+
],
|
|
10
|
+
userTranslationFlags: [
|
|
11
|
+
'[VOICE|USER'
|
|
12
|
+
],
|
|
13
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
|
|
2
|
+
import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
|
|
3
|
+
import { DyNTS_Ass_global_settings } from './ass-global-settings.const';
|
|
4
|
+
|
|
5
|
+
export class DyNTS_Ass_Util {
|
|
6
|
+
/**
|
|
7
|
+
* Convert bot messages (from any comms platform) to AI conversation format
|
|
8
|
+
* Uses EXISTING DyFM_AI_Message type from fsm-dynamo
|
|
9
|
+
* Same logic as DiAs_Util.convertDiscordMessagesToOAIConversation but platform-agnostic
|
|
10
|
+
*/
|
|
11
|
+
static convertBotMessagesToAIConversation<T_BotMessage extends DyNTS_Bot_Message<any>>(
|
|
12
|
+
set: {
|
|
13
|
+
messages: T_BotMessage[],
|
|
14
|
+
botClientId: string,
|
|
15
|
+
botDisplayName: string,
|
|
16
|
+
issuer: string,
|
|
17
|
+
}
|
|
18
|
+
): DyFM_AI_Message[] {
|
|
19
|
+
return set.messages.map(message => {
|
|
20
|
+
const isBot = (
|
|
21
|
+
message.isBot ||
|
|
22
|
+
message.authorId === set.botClientId ||
|
|
23
|
+
message.authorName === set.botDisplayName ||
|
|
24
|
+
message.authorDisplayName === set.botDisplayName
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
if (isBot) {
|
|
28
|
+
// Check if bot message should be treated as user message
|
|
29
|
+
if (DyNTS_Ass_global_settings.userTranslationFlags.some(
|
|
30
|
+
flag => message.content.includes(flag)
|
|
31
|
+
)) {
|
|
32
|
+
return {
|
|
33
|
+
role: DyFM_AI_MessageRole.user,
|
|
34
|
+
content: message.content,
|
|
35
|
+
};
|
|
36
|
+
} else {
|
|
37
|
+
return {
|
|
38
|
+
role: DyFM_AI_MessageRole.assistant,
|
|
39
|
+
content: message.content,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
return {
|
|
44
|
+
role: DyFM_AI_MessageRole.user,
|
|
45
|
+
content: message.content,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DyNTS_Ass_Global_Settings {
|
|
2
|
+
defaultSystemPrompt: string;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* These flags are used to skip messages from the conversation
|
|
6
|
+
* Default: [ '[NOISE]', '[VOICE|USER|OUTOFCONTEXT]', '[DEBUG|' ]
|
|
7
|
+
*/
|
|
8
|
+
skipConversationMessagesFlags: string[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* These flags identify bot messages that should be treated as user messages
|
|
12
|
+
* Default: [ '[VOICE|USER' ]
|
|
13
|
+
*/
|
|
14
|
+
userTranslationFlags: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
3
|
+
import { DyNTS_Bot_IO_ControlService } from '../../bot/_services/bot-io.control-service';
|
|
4
|
+
import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
|
|
5
|
+
import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
|
|
6
|
+
import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
|
|
7
|
+
import { DyNTS_Bot_Provider } from '../../bot/_models/bot-provider.interface';
|
|
8
|
+
import { DyNTS_Ass_Main_ControlService } from './ass-main.control-service';
|
|
9
|
+
import { DyNTS_Ass_Util } from '../_collections/ass.util';
|
|
10
|
+
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
11
|
+
import { DyNTS_AI_LLMChat_ServiceBase } from '../../ai/_services/ai-llm-chat.service-base';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Assistant IO Control Service
|
|
15
|
+
* Handles message processing with AI provider
|
|
16
|
+
* EXACT SAME LOGIC as DiAs_IO_ControlService but platform and AI provider agnostic
|
|
17
|
+
*/
|
|
18
|
+
export abstract class DyNTS_Ass_IO_ControlService<
|
|
19
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
|
|
20
|
+
T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
|
|
21
|
+
T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
|
|
22
|
+
T_CommsProvider extends DyNTS_Bot_Provider<
|
|
23
|
+
T_PlatformChannel,
|
|
24
|
+
T_PlatformMessage,
|
|
25
|
+
T_PlatformUser
|
|
26
|
+
> = DyNTS_Bot_Provider<
|
|
27
|
+
T_PlatformChannel,
|
|
28
|
+
T_PlatformMessage,
|
|
29
|
+
T_PlatformUser
|
|
30
|
+
>
|
|
31
|
+
> extends DyNTS_Bot_IO_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_CommsProvider> {
|
|
32
|
+
|
|
33
|
+
protected abstract override getMainBotControlService(): DyNTS_Ass_Main_ControlService<
|
|
34
|
+
T_PlatformChannel,
|
|
35
|
+
T_PlatformMessage,
|
|
36
|
+
T_PlatformUser,
|
|
37
|
+
T_CommsProvider
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
protected abstract override mainBot_CS: DyNTS_Ass_Main_ControlService<
|
|
41
|
+
T_PlatformChannel,
|
|
42
|
+
T_PlatformMessage,
|
|
43
|
+
T_PlatformUser,
|
|
44
|
+
T_CommsProvider
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
get aiProvider(): DyNTS_AI_LLMChat_ServiceBase {
|
|
48
|
+
return this.mainBot_CS?.aiProvider;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Handle incoming message with AI
|
|
53
|
+
* EXACT SAME LOGIC as dias-io.control-service.ts handleMessage()
|
|
54
|
+
*/
|
|
55
|
+
override async handleMessage(message: T_PlatformMessage, issuer: string): Promise<T_PlatformMessage> {
|
|
56
|
+
try {
|
|
57
|
+
// Gather messages from comms platform
|
|
58
|
+
const messages: T_PlatformMessage[] = await this.mainBot_CS.gatherMessagesForMessage(message);
|
|
59
|
+
|
|
60
|
+
// Convert to AI conversation format (uses EXISTING DyFM_AI_Message)
|
|
61
|
+
const aiMessages: DyFM_AI_Message[] =
|
|
62
|
+
DyNTS_Ass_Util.convertBotMessagesToAIConversation({
|
|
63
|
+
messages: messages,
|
|
64
|
+
botClientId: this.mainBot_CS.botClientId,
|
|
65
|
+
botDisplayName: this.mainBot_CS.botDisplayName,
|
|
66
|
+
issuer: issuer,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Get AI response using EXISTING getAnswerInConversation method
|
|
70
|
+
const aiResult: string = await this.aiProvider.getAnswerInConversation({
|
|
71
|
+
conversation: aiMessages,
|
|
72
|
+
issuer: issuer,
|
|
73
|
+
settings: {
|
|
74
|
+
systemPrompt: this.mainBot_CS.defaultSystemPrompt,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Reply via comms platform
|
|
79
|
+
return await this.provider.replyToMessage(message.id, message.channelId, aiResult);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
DyFM_Error.logSimple('❌❌ Error handleMessage:', error);
|
|
82
|
+
|
|
83
|
+
if (!this.dontSendErrorReply && DyNTS_global_settings.bot_settings?.debugLevel >= 1) {
|
|
84
|
+
await this.provider.replyToMessage(
|
|
85
|
+
message.id,
|
|
86
|
+
message.channelId,
|
|
87
|
+
`[SYSTEM|ERROR|${DyNTS_global_settings.systemShortCodeName}|DyNTS-Ass-IOCS-H0] Error occurred while handling the message:\n` +
|
|
88
|
+
DyFM_Error.getAnyMessage(error)
|
|
89
|
+
).catch(error => {
|
|
90
|
+
DyFM_Error.logSimple('❌❌ Error sending error reply:', error);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
throw new DyFM_Error({
|
|
95
|
+
...this.getDefaultErrorSettings('handleMessage', error, issuer),
|
|
96
|
+
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-Ass-IOCS-H0`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DyNTS_Ass_ServiceBase } from './ass.service-base';
|
|
2
|
+
import { DyNTS_Ass_IO_ControlService } from './ass-io.control-service';
|
|
3
|
+
import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
|
|
4
|
+
import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
|
|
5
|
+
import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
|
|
6
|
+
import { DyNTS_Bot_Provider } from '../../bot/_models/bot-provider.interface';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Assistant Main Control Service
|
|
10
|
+
* Abstract base for concrete assistant implementations
|
|
11
|
+
*/
|
|
12
|
+
export abstract class DyNTS_Ass_Main_ControlService<
|
|
13
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
|
|
14
|
+
T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
|
|
15
|
+
T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
|
|
16
|
+
T_CommsProvider extends DyNTS_Bot_Provider<
|
|
17
|
+
T_PlatformChannel,
|
|
18
|
+
T_PlatformMessage,
|
|
19
|
+
T_PlatformUser
|
|
20
|
+
> = DyNTS_Bot_Provider<
|
|
21
|
+
T_PlatformChannel,
|
|
22
|
+
T_PlatformMessage,
|
|
23
|
+
T_PlatformUser
|
|
24
|
+
>
|
|
25
|
+
> extends DyNTS_Ass_ServiceBase<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_CommsProvider> {
|
|
26
|
+
protected abstract override getBotIOControlService(): DyNTS_Ass_IO_ControlService<
|
|
27
|
+
T_PlatformChannel,
|
|
28
|
+
T_PlatformMessage,
|
|
29
|
+
T_PlatformUser,
|
|
30
|
+
T_CommsProvider
|
|
31
|
+
>;
|
|
32
|
+
protected abstract override botIO_CS: DyNTS_Ass_IO_ControlService<
|
|
33
|
+
T_PlatformChannel,
|
|
34
|
+
T_PlatformMessage,
|
|
35
|
+
T_PlatformUser,
|
|
36
|
+
T_CommsProvider
|
|
37
|
+
>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DyNTS_Bot_Main_ControlService } from '../../bot/_services/bot-main.control-service';
|
|
2
|
+
import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
|
|
3
|
+
import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
|
|
4
|
+
import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
|
|
5
|
+
import { DyNTS_Bot_Provider } from '../../bot/_models/bot-provider.interface';
|
|
6
|
+
import { DyNTS_AI_LLMChat_ServiceBase } from '../../ai/_services/ai-llm-chat.service-base';
|
|
7
|
+
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
8
|
+
import { DyNTS_Ass_global_settings } from '../_collections/ass-global-settings.const';
|
|
9
|
+
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
10
|
+
import { DyNTS_Ass_Util } from '../_collections/ass.util';
|
|
11
|
+
import { DyNTS_Ass_IO_ControlService } from './ass-io.control-service';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Assistant Service Base
|
|
15
|
+
* Integrates commsProvider (bot) and aiProvider (LLMChat) to create AI-powered assistant
|
|
16
|
+
* USES EXISTING AI ABSTRACTIONS - no duplication
|
|
17
|
+
*/
|
|
18
|
+
export abstract class DyNTS_Ass_ServiceBase<
|
|
19
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
|
|
20
|
+
T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
|
|
21
|
+
T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
|
|
22
|
+
T_CommsProvider extends DyNTS_Bot_Provider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser> = DyNTS_Bot_Provider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser>
|
|
23
|
+
> extends DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_CommsProvider> {
|
|
24
|
+
|
|
25
|
+
// AI Provider - uses EXISTING abstraction
|
|
26
|
+
protected _aiProvider: DyNTS_AI_LLMChat_ServiceBase;
|
|
27
|
+
|
|
28
|
+
get aiProvider(): DyNTS_AI_LLMChat_ServiceBase {
|
|
29
|
+
return this._aiProvider;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected abstract getAIProvider(): DyNTS_AI_LLMChat_ServiceBase;
|
|
33
|
+
|
|
34
|
+
// Override botIO to use assistant IO
|
|
35
|
+
protected abstract override getBotIOControlService(): DyNTS_Ass_IO_ControlService<
|
|
36
|
+
T_PlatformChannel,
|
|
37
|
+
T_PlatformMessage,
|
|
38
|
+
T_PlatformUser,
|
|
39
|
+
T_CommsProvider
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
// Assistant-specific settings
|
|
43
|
+
defaultSystemPrompt: string = DyNTS_Ass_global_settings.defaultSystemPrompt;
|
|
44
|
+
|
|
45
|
+
protected constructor(setupAutomatically?: boolean) {
|
|
46
|
+
super(setupAutomatically);
|
|
47
|
+
|
|
48
|
+
// Initialize AI provider
|
|
49
|
+
this._aiProvider = this.getAIProvider();
|
|
50
|
+
|
|
51
|
+
// Apply system prompt
|
|
52
|
+
if (this._aiProvider.defaultSettings) {
|
|
53
|
+
this._aiProvider.defaultSettings.systemPrompt = this.defaultSystemPrompt;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Set global settings
|
|
57
|
+
DyNTS_global_settings.assistant_settings ??= DyNTS_Ass_global_settings;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Gather messages from comms platform (any platform)
|
|
62
|
+
* Same as dias.service-base but platform-agnostic
|
|
63
|
+
*/
|
|
64
|
+
async gatherMessagesForMessage(message: T_PlatformMessage, limit: number = 100): Promise<T_PlatformMessage[]> {
|
|
65
|
+
const channelId = message.channelId;
|
|
66
|
+
const messages = await this.provider.fetchMessages(channelId, limit);
|
|
67
|
+
|
|
68
|
+
// Filter out messages with skip flags
|
|
69
|
+
return messages.filter(
|
|
70
|
+
msg => !DyNTS_Ass_global_settings.skipConversationMessagesFlags.some(
|
|
71
|
+
flag => msg.content.includes(flag)
|
|
72
|
+
)
|
|
73
|
+
).sort((a, b) => a.timestamp - b.timestamp);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Convert gathered messages to AI conversation using EXISTING DyFM_AI_Message
|
|
78
|
+
*/
|
|
79
|
+
async gatherMessagesAsAIConversation(
|
|
80
|
+
message: T_PlatformMessage,
|
|
81
|
+
issuer: string,
|
|
82
|
+
): Promise<DyFM_AI_Message[]> {
|
|
83
|
+
const messages = await this.gatherMessagesForMessage(message);
|
|
84
|
+
|
|
85
|
+
return DyNTS_Ass_Util.convertBotMessagesToAIConversation({
|
|
86
|
+
messages: messages,
|
|
87
|
+
botClientId: this.botClientId,
|
|
88
|
+
botDisplayName: this.botDisplayName,
|
|
89
|
+
issuer: issuer,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Assistant module (platform and AI provider agnostic)
|
|
3
|
+
//
|
|
4
|
+
// Integrates commsProvider (bot) with aiProvider (AI LLMChat) to create intelligent assistants
|
|
5
|
+
// REUSES existing AI abstractions - no duplication
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MODELS
|
|
9
|
+
export * from './_models/ass-global-settings.interface';
|
|
10
|
+
|
|
11
|
+
// COLLECTIONS
|
|
12
|
+
export * from './_collections/ass.util';
|
|
13
|
+
export * from './_collections/ass-global-settings.const';
|
|
14
|
+
|
|
15
|
+
// SERVICES
|
|
16
|
+
export * from './_services/ass.service-base';
|
|
17
|
+
export * from './_services/ass-main.control-service';
|
|
18
|
+
export * from './_services/ass-io.control-service';
|
|
19
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DyNTS_Bot_Command } from '../_models/bot-command.interface';
|
|
2
|
+
|
|
3
|
+
export const DyNTS_Bot_defaultCommands: DyNTS_Bot_Command[] = [
|
|
4
|
+
{
|
|
5
|
+
command: '!ping',
|
|
6
|
+
description: 'Ping the bot',
|
|
7
|
+
commandHandler: async (message) => {
|
|
8
|
+
// This will be handled by the provider's replyToMessage method
|
|
9
|
+
// The actual implementation will be in the provider
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DyNTS_Bot_Global_Settings } from '../_models/bot-global-settings.interface';
|
|
2
|
+
import { minute, week } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
import { DyNTS_Bot_defaultCommands } from './bot-default-commands.const';
|
|
4
|
+
|
|
5
|
+
export const DyNTS_Bot_global_settings: DyNTS_Bot_Global_Settings = {
|
|
6
|
+
debugLevel: 3,
|
|
7
|
+
|
|
8
|
+
allowedUsers: 'all',
|
|
9
|
+
|
|
10
|
+
messageSettings: {
|
|
11
|
+
messageFetchTimeLimit: 3 * week,
|
|
12
|
+
messageFetchCountLimit: 1000,
|
|
13
|
+
messageSendDelay: minute / 3,
|
|
14
|
+
|
|
15
|
+
skipFlags: [
|
|
16
|
+
'[BOT-SKIP]',
|
|
17
|
+
'[SYSTEM|REFUSE|BOT]',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
channelSettings: {
|
|
22
|
+
reportChannelName: 'bot-reports',
|
|
23
|
+
|
|
24
|
+
defaultChannels: [
|
|
25
|
+
'bot-help',
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
allowedChannels: [],
|
|
29
|
+
dmIsAllowed: false,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
commandSettings: {
|
|
33
|
+
commandOperator: '',
|
|
34
|
+
|
|
35
|
+
commands: DyNTS_Bot_defaultCommands,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
allowBotsInteractEachOther: false,
|
|
39
|
+
};
|