@aakash58/chatbot 1.1.19 → 1.1.21
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/.editorconfig +17 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +41 -0
- package/.vscode/settings.json +14 -0
- package/.vscode/tasks.json +60 -0
- package/README.md +298 -22
- package/angular.json +132 -0
- package/docs/PUBLISHING_GUIDE.md +104 -0
- package/package.json +75 -29
- package/projects/app-doohbot/public/assets/const/app-const.json +15 -0
- package/projects/app-doohbot/public/assets/const/doohclick_license.json +6 -0
- package/projects/app-doohbot/public/favicon.ico +0 -0
- package/projects/app-doohbot/src/app/app.config.ts +13 -0
- package/projects/app-doohbot/src/app/app.html +31 -0
- package/projects/app-doohbot/src/app/app.routes.ts +3 -0
- package/projects/app-doohbot/src/app/app.scss +279 -0
- package/projects/app-doohbot/src/app/app.spec.ts +23 -0
- package/projects/app-doohbot/src/app/app.ts +72 -0
- package/projects/app-doohbot/src/index.html +15 -0
- package/projects/app-doohbot/src/main.ts +6 -0
- package/projects/app-doohbot/src/styles.scss +15 -0
- package/projects/app-doohbot/tsconfig.app.json +15 -0
- package/projects/app-doohbot/tsconfig.spec.json +14 -0
- package/projects/doohbot/README.md +64 -0
- package/projects/doohbot/docs/README.md +140 -0
- package/projects/doohbot/ng-package.json +10 -0
- package/projects/doohbot/package.json +16 -0
- package/projects/doohbot/src/lib/app/chat/chat-ui-state.service.ts +194 -0
- package/projects/doohbot/src/lib/app/chat/chat.service.ts +547 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.html +27 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.scss +115 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.ts +35 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.html +3 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.scss +20 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.html +34 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.scss +78 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.ts +52 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.html +77 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.scss +346 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.ts +188 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.html +146 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.scss +187 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.ts +256 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.html +17 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.scss +59 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.ts +28 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.html +138 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.scss +436 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.ts +106 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-history.model.ts +57 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-request.model.ts +17 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-response.model.ts +9 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-session.model.ts +14 -0
- package/{lib/app/chat/model/chat-stream-message.model.d.ts → projects/doohbot/src/lib/app/chat/model/chat-stream-message.model.ts} +6 -5
- package/projects/doohbot/src/lib/app/chat/model/chat-stream-response.model.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-api.service.ts +82 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-audio.service.ts +44 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-history.service.ts +303 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.html +80 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.scss +189 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.ts +45 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.html +81 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.scss +179 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.ts +217 -0
- package/projects/doohbot/src/lib/app/personalization/personalization.service.ts +197 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.html +111 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.scss +218 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.ts +121 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.scss +138 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.ts +28 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/color-picker-dialog.component.ts +92 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.html +198 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.scss +107 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.ts +103 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.scss +131 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.ts +23 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.html +33 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.scss +61 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.ts +20 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.html +30 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.scss +59 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.ts +12 -0
- package/projects/doohbot/src/lib/constant/doohbot-constant.ts +40 -0
- package/projects/doohbot/src/lib/constant/html-entities.ts +8 -0
- package/projects/doohbot/src/lib/constant/utf8.ts +9 -0
- package/projects/doohbot/src/lib/core/app-const.ts +63 -0
- package/projects/doohbot/src/lib/core/auth/account-api.service.ts +53 -0
- package/projects/doohbot/src/lib/core/auth/auth.service.ts +478 -0
- package/projects/doohbot/src/lib/core/auth/models/auth-result.model.ts +4 -0
- package/projects/doohbot/src/lib/core/auth/models/federated-login-request.model.ts +5 -0
- package/projects/doohbot/src/lib/core/auth/models/login-request.model.ts +6 -0
- package/projects/doohbot/src/lib/core/auth/storage.service.ts +113 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.directive.ts +123 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.directive.ts +58 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.directive.ts +169 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.directive.ts +197 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/enums/api-request-state.enum.ts +9 -0
- package/projects/doohbot/src/lib/core/environments/environment.prod.ts +14 -0
- package/projects/doohbot/src/lib/core/environments/environment.ts +14 -0
- package/projects/doohbot/src/lib/core/helpers/crypto-helper.service.ts +72 -0
- package/projects/doohbot/src/lib/core/http/http-stream.service.ts +105 -0
- package/projects/doohbot/src/lib/core/http/http.service.ts +148 -0
- package/projects/doohbot/src/lib/core/interceptors/auth.interceptor.ts +118 -0
- package/projects/doohbot/src/lib/core/interceptors/license.interceptor.ts +50 -0
- package/projects/doohbot/src/lib/core/models/api-config.model.ts +82 -0
- package/projects/doohbot/src/lib/core/models/api-request.model.ts +92 -0
- package/projects/doohbot/src/lib/core/models/api-response.model.ts +13 -0
- package/projects/doohbot/src/lib/core/models/doohbot-config.model.ts +109 -0
- package/{lib/core/models/license.model.d.ts → projects/doohbot/src/lib/core/models/license.model.ts} +27 -23
- package/projects/doohbot/src/lib/core/models/message.ts +18 -0
- package/projects/doohbot/src/lib/core/models/theme-config.model.ts +48 -0
- package/projects/doohbot/src/lib/core/services/core-config.service.ts +53 -0
- package/projects/doohbot/src/lib/core/services/doohbot-api.service.ts +207 -0
- package/projects/doohbot/src/lib/core/services/license.service.ts +171 -0
- package/projects/doohbot/src/lib/core/services/markdown.service.ts +73 -0
- package/projects/doohbot/src/lib/core/services/theme.service.ts +305 -0
- package/{lib/core/types/auth-mode.type.d.ts → projects/doohbot/src/lib/core/types/auth-mode.type.ts} +4 -4
- package/{lib/core/types/auth-status.type.d.ts → projects/doohbot/src/lib/core/types/auth-status.type.ts} +5 -4
- package/{lib/core/types/chat-stream.type.d.ts → projects/doohbot/src/lib/core/types/chat-stream.type.ts} +4 -4
- package/{lib/core/types/message-role.type.d.ts → projects/doohbot/src/lib/core/types/message-role.type.ts} +4 -4
- package/{lib/core/types/prompt-mode.type.d.ts → projects/doohbot/src/lib/core/types/prompt-mode.type.ts} +5 -4
- package/{lib/core/types/snackbar-error.type.d.ts → projects/doohbot/src/lib/core/types/snackbar-error.type.ts} +5 -4
- package/{lib/core/types/tenant-resolution-strategy.type.d.ts → projects/doohbot/src/lib/core/types/tenant-resolution-strategy.type.ts} +4 -4
- package/projects/doohbot/src/lib/core/utils/error-handler.util.ts +31 -0
- package/projects/doohbot/src/lib/core/utils/logger.service.ts +45 -0
- package/projects/doohbot/src/lib/doohbot-input.ts +19 -0
- package/projects/doohbot/src/lib/doohbot.component.html +34 -0
- package/projects/doohbot/src/lib/doohbot.component.scss +17 -0
- package/projects/doohbot/src/lib/doohbot.component.spec.ts +31 -0
- package/projects/doohbot/src/lib/doohbot.component.ts +545 -0
- package/projects/doohbot/src/lib/elements.ts +25 -0
- package/projects/doohbot/src/lib/predefined_messages.ts +14 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.html +9 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.scss +29 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.html +29 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.scss +100 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.ts +42 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.service.ts +62 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.utils.ts +102 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.html +30 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.scss +53 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.ts +35 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.html +16 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.scss +45 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.ts +46 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.html +5 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.scss +0 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/pipes/simple-markdown.pipe.ts +19 -0
- package/projects/doohbot/src/lib/shared/popout/popout.html +1 -0
- package/projects/doohbot/src/lib/shared/popout/popout.scss +0 -0
- package/projects/doohbot/src/lib/shared/popout/popout.spec.ts +23 -0
- package/projects/doohbot/src/lib/shared/popout/popout.ts +11 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.html +7 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.scss +125 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.spec.ts +21 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.ts +44 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.service.ts +54 -0
- package/{lib/shared/snackbar/snackbar.utils.d.ts → projects/doohbot/src/lib/shared/snackbar/snackbar.utils.ts} +49 -33
- package/projects/doohbot/src/lib/styles/_theme.scss +132 -0
- package/projects/doohbot/src/lib/styles/material-override.scss +302 -0
- package/projects/doohbot/src/lib/styles/utility.scss +588 -0
- package/projects/doohbot/src/public-api.ts +42 -0
- package/projects/doohbot/tsconfig.lib.json +15 -0
- package/projects/doohbot/tsconfig.lib.prod.json +11 -0
- package/projects/doohbot/tsconfig.spec.json +10 -0
- package/proxy.conf.json +8 -0
- package/publish.config.js +25 -0
- package/scripts/publishing/index.ts +67 -0
- package/scripts/publishing/pipeline/01-clean.ts +11 -0
- package/scripts/publishing/pipeline/02-validate-pre.ts +8 -0
- package/scripts/publishing/pipeline/03-build.ts +7 -0
- package/scripts/publishing/pipeline/04-validate-post.ts +8 -0
- package/scripts/publishing/pipeline/05-prepare-package.ts +29 -0
- package/scripts/publishing/pipeline/06-version.ts +23 -0
- package/scripts/publishing/pipeline/07-publish.ts +14 -0
- package/scripts/publishing/pipeline/08-cleanup.ts +5 -0
- package/scripts/publishing/types.ts +36 -0
- package/scripts/publishing/utils/command.ts +15 -0
- package/scripts/publishing/utils/config.ts +17 -0
- package/scripts/validate.ts +166 -0
- package/tsconfig.json +45 -0
- package/tsconfig.scripts.json +15 -0
- package/esm2022/aakash58-chatbot.mjs +0 -5
- package/esm2022/lib/app/chat/chat-ui-state.service.mjs +0 -170
- package/esm2022/lib/app/chat/chat.service.mjs +0 -445
- package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +0 -50
- package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +0 -12
- package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +0 -66
- package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +0 -186
- package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +0 -312
- package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +0 -36
- package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +0 -115
- package/esm2022/lib/app/chat/model/chat-history.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-request.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-session.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/services/chat-api.service.mjs +0 -61
- package/esm2022/lib/app/chat/services/chat-audio.service.mjs +0 -50
- package/esm2022/lib/app/chat/services/chat-history.service.mjs +0 -252
- package/esm2022/lib/app/login/login-form.component.mjs +0 -46
- package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +0 -194
- package/esm2022/lib/app/personalization/personalization.service.mjs +0 -149
- package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +0 -122
- package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +0 -86
- package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +0 -115
- package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +0 -29
- package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +0 -30
- package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +0 -12
- package/esm2022/lib/constant/doohbot-constant.mjs +0 -28
- package/esm2022/lib/constant/html-entities.mjs +0 -9
- package/esm2022/lib/constant/utf8.mjs +0 -10
- package/esm2022/lib/core/app-const.mjs +0 -61
- package/esm2022/lib/core/auth/account-api.service.mjs +0 -40
- package/esm2022/lib/core/auth/auth.service.mjs +0 -391
- package/esm2022/lib/core/auth/models/auth-result.model.mjs +0 -3
- package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/models/login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/storage.service.mjs +0 -110
- package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +0 -112
- package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +0 -55
- package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +0 -179
- package/esm2022/lib/core/environments/environment.mjs +0 -15
- package/esm2022/lib/core/environments/environment.prod.mjs +0 -15
- package/esm2022/lib/core/helpers/crypto-helper.service.mjs +0 -52
- package/esm2022/lib/core/http/http-stream.service.mjs +0 -97
- package/esm2022/lib/core/http/http.service.mjs +0 -103
- package/esm2022/lib/core/interceptors/auth.interceptor.mjs +0 -96
- package/esm2022/lib/core/interceptors/license.interceptor.mjs +0 -44
- package/esm2022/lib/core/models/api-config.model.mjs +0 -18
- package/esm2022/lib/core/models/api-request.model.mjs +0 -2
- package/esm2022/lib/core/models/api-response.model.mjs +0 -8
- package/esm2022/lib/core/models/doohbot-config.model.mjs +0 -18
- package/esm2022/lib/core/models/license.model.mjs +0 -2
- package/esm2022/lib/core/models/message.mjs +0 -2
- package/esm2022/lib/core/models/theme-config.model.mjs +0 -2
- package/esm2022/lib/core/services/core-config.service.mjs +0 -52
- package/esm2022/lib/core/services/license.service.mjs +0 -145
- package/esm2022/lib/core/services/markdown.service.mjs +0 -64
- package/esm2022/lib/core/services/theme.service.mjs +0 -248
- package/esm2022/lib/core/types/auth-mode.type.mjs +0 -2
- package/esm2022/lib/core/types/auth-status.type.mjs +0 -5
- package/esm2022/lib/core/types/chat-stream.type.mjs +0 -2
- package/esm2022/lib/core/types/message-role.type.mjs +0 -2
- package/esm2022/lib/core/types/prompt-mode.type.mjs +0 -5
- package/esm2022/lib/core/types/snackbar-error.type.mjs +0 -5
- package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +0 -2
- package/esm2022/lib/core/utils/logger.service.mjs +0 -42
- package/esm2022/lib/doohbot-input.mjs +0 -20
- package/esm2022/lib/doohbot.component.mjs +0 -444
- package/esm2022/lib/predefined_messages.mjs +0 -15
- package/esm2022/lib/shared/chips/chips.component.mjs +0 -28
- package/esm2022/lib/shared/dialog/dialog.component.mjs +0 -36
- package/esm2022/lib/shared/dialog/dialog.service.mjs +0 -64
- package/esm2022/lib/shared/dialog/dialog.utils.mjs +0 -85
- package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +0 -29
- package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +0 -38
- package/esm2022/lib/shared/menu-item/menu-item.component.mjs +0 -24
- package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +0 -27
- package/esm2022/lib/shared/snackbar/snackbar.component.mjs +0 -43
- package/esm2022/lib/shared/snackbar/snackbar.service.mjs +0 -46
- package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +0 -43
- package/esm2022/public-api.mjs +0 -37
- package/fesm2022/aakash58-chatbot.mjs +0 -5193
- package/fesm2022/aakash58-chatbot.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/app/chat/chat-ui-state.service.d.ts +0 -96
- package/lib/app/chat/chat.service.d.ts +0 -88
- package/lib/app/chat/components/chat-button/chat-button.component.d.ts +0 -16
- package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +0 -5
- package/lib/app/chat/components/chat-header/chat-header.component.d.ts +0 -24
- package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +0 -49
- package/lib/app/chat/components/chat-window/chat-window.component.d.ts +0 -107
- package/lib/app/chat/components/message-input/message-input.component.d.ts +0 -12
- package/lib/app/chat/components/message-list/message-list.component.d.ts +0 -40
- package/lib/app/chat/model/chat-history.model.d.ts +0 -51
- package/lib/app/chat/model/chat-request.model.d.ts +0 -10
- package/lib/app/chat/model/chat-response.model.d.ts +0 -9
- package/lib/app/chat/model/chat-session.model.d.ts +0 -12
- package/lib/app/chat/model/chat-stream-response.model.d.ts +0 -10
- package/lib/app/chat/services/chat-api.service.d.ts +0 -30
- package/lib/app/chat/services/chat-audio.service.d.ts +0 -19
- package/lib/app/chat/services/chat-history.service.d.ts +0 -53
- package/lib/app/login/login-form.component.d.ts +0 -20
- package/lib/app/personalization/personalization-dialog.component.d.ts +0 -53
- package/lib/app/personalization/personalization.service.d.ts +0 -66
- package/lib/app/personalization/sections/account/account-section.component.d.ts +0 -30
- package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +0 -17
- package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +0 -27
- package/lib/app/personalization/sections/profile/profile-section.component.d.ts +0 -17
- package/lib/app/personalization/sections/settings/setting-section.component.d.ts +0 -10
- package/lib/app/personalization/sections/terms/terms-section.component.d.ts +0 -5
- package/lib/constant/doohbot-constant.d.ts +0 -12
- package/lib/constant/html-entities.d.ts +0 -8
- package/lib/constant/utf8.d.ts +0 -9
- package/lib/core/app-const.d.ts +0 -11
- package/lib/core/auth/account-api.service.d.ts +0 -20
- package/lib/core/auth/auth.service.d.ts +0 -90
- package/lib/core/auth/models/auth-result.model.d.ts +0 -4
- package/lib/core/auth/models/federated-login-request.model.d.ts +0 -5
- package/lib/core/auth/models/login-request.model.d.ts +0 -6
- package/lib/core/auth/storage.service.d.ts +0 -21
- package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +0 -23
- package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +0 -14
- package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +0 -30
- package/lib/core/environments/environment.d.ts +0 -7
- package/lib/core/environments/environment.prod.d.ts +0 -7
- package/lib/core/helpers/crypto-helper.service.d.ts +0 -12
- package/lib/core/http/http-stream.service.d.ts +0 -18
- package/lib/core/http/http.service.d.ts +0 -20
- package/lib/core/interceptors/auth.interceptor.d.ts +0 -18
- package/lib/core/interceptors/license.interceptor.d.ts +0 -11
- package/lib/core/models/api-config.model.d.ts +0 -58
- package/lib/core/models/api-request.model.d.ts +0 -77
- package/lib/core/models/api-response.model.d.ts +0 -6
- package/lib/core/models/doohbot-config.model.d.ts +0 -81
- package/lib/core/models/message.d.ts +0 -16
- package/lib/core/models/theme-config.model.d.ts +0 -28
- package/lib/core/services/core-config.service.d.ts +0 -23
- package/lib/core/services/license.service.d.ts +0 -33
- package/lib/core/services/markdown.service.d.ts +0 -8
- package/lib/core/services/theme.service.d.ts +0 -40
- package/lib/core/utils/logger.service.d.ts +0 -11
- package/lib/doohbot-input.d.ts +0 -19
- package/lib/doohbot.component.d.ts +0 -108
- package/lib/predefined_messages.d.ts +0 -2
- package/lib/shared/chips/chips.component.d.ts +0 -10
- package/lib/shared/dialog/dialog.component.d.ts +0 -19
- package/lib/shared/dialog/dialog.service.d.ts +0 -29
- package/lib/shared/dialog/dialog.utils.d.ts +0 -41
- package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +0 -11
- package/lib/shared/input-dialog/input-dialog.component.d.ts +0 -20
- package/lib/shared/menu-item/menu-item.component.d.ts +0 -9
- package/lib/shared/pipes/simple-markdown.pipe.d.ts +0 -10
- package/lib/shared/snackbar/snackbar.component.d.ts +0 -14
- package/lib/shared/snackbar/snackbar.service.d.ts +0 -19
- package/public-api.d.ts +0 -11
- /package/{src → projects/doohbot/src}/assets/bot.mp3 +0 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/* Chat messages */
|
|
2
|
+
:host {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
flex-grow: 1;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.login-btn {
|
|
10
|
+
padding: 10px 15px;
|
|
11
|
+
border: none;
|
|
12
|
+
border-radius: 20px;
|
|
13
|
+
background-color: var(--primary-color);
|
|
14
|
+
color: var(--user-text-color);
|
|
15
|
+
font-size: 1em;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: background-color 0.2s ease;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.chat-messages {
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
padding: 20px;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
scroll-behavior: smooth;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Webkit browsers (Chrome, Edge, Safari) */
|
|
31
|
+
.chat-messages::-webkit-scrollbar {
|
|
32
|
+
width: 6px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.chat-messages::-webkit-scrollbar-track {
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.chat-messages::-webkit-scrollbar-thumb {
|
|
40
|
+
background: rgba(var(--black-rgb), 0.1);
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.chat-messages::-webkit-scrollbar-thumb:hover {
|
|
45
|
+
background: rgba(var(--black-rgb), 0.1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Firefox */
|
|
49
|
+
.chat-messages {
|
|
50
|
+
// scrollbar-width: thin;
|
|
51
|
+
// scrollbar-color: var(--primary-color) var(--background-color);
|
|
52
|
+
|
|
53
|
+
/* Message */
|
|
54
|
+
.message {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: flex-end;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
margin-bottom: 6px;
|
|
59
|
+
|
|
60
|
+
&.user {
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.assistant {
|
|
65
|
+
justify-content: flex-start;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* User avatar container */
|
|
69
|
+
.avatar-container {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 4px;
|
|
74
|
+
|
|
75
|
+
.user-avatar {
|
|
76
|
+
width: 24px;
|
|
77
|
+
height: 24px;
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
object-fit: cover;
|
|
80
|
+
border: 1px solid var(--border-color);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Bot avatar */
|
|
84
|
+
.assistant-avatar {
|
|
85
|
+
width: 24px;
|
|
86
|
+
height: 24px;
|
|
87
|
+
border-radius: 50%;
|
|
88
|
+
object-fit: cover;
|
|
89
|
+
border: 1px solid var(--border-color);
|
|
90
|
+
filter: var(--avatar-filter);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Only placeholder gets filter */
|
|
94
|
+
.user-avatar.placeholder {
|
|
95
|
+
filter: var(--avatar-filter);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.user-name {
|
|
99
|
+
font-size: 10px;
|
|
100
|
+
color: var(--secondary-text-color);
|
|
101
|
+
font-family: var(--font-family);
|
|
102
|
+
text-align: center;
|
|
103
|
+
max-width: 60px;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Message bubbles */
|
|
111
|
+
.message-content {
|
|
112
|
+
max-width: 80%;
|
|
113
|
+
// overflow-y: auto;
|
|
114
|
+
word-wrap: break-word;
|
|
115
|
+
white-space: pre-wrap;
|
|
116
|
+
font-family: var(--font-family);
|
|
117
|
+
user-select: text;
|
|
118
|
+
cursor: text;
|
|
119
|
+
|
|
120
|
+
.user {
|
|
121
|
+
background-color: var(--primary-color);
|
|
122
|
+
color: var(--user-text-color);
|
|
123
|
+
align-self: flex-end;
|
|
124
|
+
border-radius: 20px;
|
|
125
|
+
padding: 10px 15px;
|
|
126
|
+
position: relative;
|
|
127
|
+
user-select: text;
|
|
128
|
+
cursor: text;
|
|
129
|
+
|
|
130
|
+
.copy-btn {
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: 8px;
|
|
133
|
+
right: 8px;
|
|
134
|
+
opacity: 0;
|
|
135
|
+
transition: opacity 0.2s ease;
|
|
136
|
+
background: var(--background-color);
|
|
137
|
+
border: none;
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
padding: 4px;
|
|
140
|
+
border-radius: 4px;
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
pointer-events: auto;
|
|
145
|
+
|
|
146
|
+
mat-icon {
|
|
147
|
+
font-size: 16px;
|
|
148
|
+
width: 16px;
|
|
149
|
+
height: 16px;
|
|
150
|
+
color: var(--bot-text-color);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&:hover {
|
|
154
|
+
background: var(--background-color);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:hover .copy-btn {
|
|
159
|
+
opacity: 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.assistant {
|
|
164
|
+
background-color: var(--bot-message-color);
|
|
165
|
+
color: var(--bot-text-color);
|
|
166
|
+
align-self: flex-start;
|
|
167
|
+
border-radius: 20px;
|
|
168
|
+
padding: 10px 15px;
|
|
169
|
+
position: relative;
|
|
170
|
+
user-select: text;
|
|
171
|
+
cursor: text;
|
|
172
|
+
|
|
173
|
+
// Apply animation only to bot messages
|
|
174
|
+
animation: fadeIn 0.4s ease-out forwards;
|
|
175
|
+
|
|
176
|
+
.copy-btn {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 8px;
|
|
179
|
+
right: 8px;
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transition: opacity 0.2s ease;
|
|
182
|
+
background: var(--background-color);
|
|
183
|
+
border: none;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
padding: 4px;
|
|
186
|
+
border-radius: 4px;
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
pointer-events: auto;
|
|
191
|
+
|
|
192
|
+
mat-icon {
|
|
193
|
+
font-size: 16px;
|
|
194
|
+
width: 16px;
|
|
195
|
+
height: 16px;
|
|
196
|
+
color: var(--bot-text-color);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:hover {
|
|
200
|
+
background: var(--background-color);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&:hover .copy-btn {
|
|
205
|
+
opacity: 1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Markdown Styles */
|
|
209
|
+
.markdown-content {
|
|
210
|
+
|
|
211
|
+
h1,
|
|
212
|
+
h2,
|
|
213
|
+
h3 {
|
|
214
|
+
margin-top: 10px;
|
|
215
|
+
margin-bottom: 5px;
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
line-height: 1.25;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
h1 {
|
|
221
|
+
font-size: 1.25em;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
h2 {
|
|
225
|
+
font-size: 1.1em;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
h3 {
|
|
229
|
+
font-size: 1em;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
p {
|
|
233
|
+
margin-bottom: 8px;
|
|
234
|
+
line-height: 1.5;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Lists
|
|
238
|
+
ul,
|
|
239
|
+
ol {
|
|
240
|
+
margin-top: 0;
|
|
241
|
+
margin-bottom: 8px;
|
|
242
|
+
padding-left: 20px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
li {
|
|
246
|
+
margin-bottom: 4px;
|
|
247
|
+
line-height: 1.5;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Emphasis
|
|
251
|
+
strong {
|
|
252
|
+
font-weight: 700;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
em {
|
|
256
|
+
font-style: italic;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.message-time {
|
|
262
|
+
font-size: 12px;
|
|
263
|
+
color: var(--secondary-text-color);
|
|
264
|
+
text-align: end;
|
|
265
|
+
margin-top: 6px;
|
|
266
|
+
line-height: 1;
|
|
267
|
+
user-select: none;
|
|
268
|
+
cursor: default;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.message-content ::selection {
|
|
273
|
+
background-color: color-mix(in srgb, var(--primary-color), white 60%);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.message-content ::-moz-selection {
|
|
277
|
+
background-color: color-mix(in srgb, var(--primary-color), white 60%);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* Welcome screen */
|
|
283
|
+
.welcome-screen {
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
align-items: center;
|
|
288
|
+
text-align: center;
|
|
289
|
+
height: 100%;
|
|
290
|
+
padding: 0 20px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.welcome-image {
|
|
294
|
+
width: 80px;
|
|
295
|
+
margin-bottom: 30px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.marquee-container {
|
|
299
|
+
margin-bottom: 12px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.welcome-greeting {
|
|
303
|
+
margin: 0;
|
|
304
|
+
color: var(--text-color);
|
|
305
|
+
font-family: var(--font-family);
|
|
306
|
+
font-size: 24px;
|
|
307
|
+
font-weight: 600;
|
|
308
|
+
background: var(--text-color);
|
|
309
|
+
-webkit-background-clip: text;
|
|
310
|
+
-webkit-text-fill-color: transparent;
|
|
311
|
+
background-clip: text;
|
|
312
|
+
display: inline-block;
|
|
313
|
+
/* Ensure it stays inline for marquee */
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* Prevent emoji from inheriting gradient text style */
|
|
317
|
+
.welcome-greeting .emoji {
|
|
318
|
+
background: none;
|
|
319
|
+
-webkit-background-clip: initial;
|
|
320
|
+
-webkit-text-fill-color: initial;
|
|
321
|
+
background-clip: initial;
|
|
322
|
+
// color: var(--text-color); /*apply color here */
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.welcome-screen h3 {
|
|
326
|
+
margin: 0 0 5px 0;
|
|
327
|
+
color: var(--text-color);
|
|
328
|
+
font-family: var(--font-family);
|
|
329
|
+
font-size: 18px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.welcome-screen p {
|
|
333
|
+
margin: 0;
|
|
334
|
+
color: var(--secondary-text-color);
|
|
335
|
+
font-size: 14px;
|
|
336
|
+
font-family: var(--font-family);
|
|
337
|
+
margin-bottom: 30px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@keyframes fadeIn {
|
|
341
|
+
from {
|
|
342
|
+
opacity: 0;
|
|
343
|
+
transform: translateY(10px);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
to {
|
|
347
|
+
opacity: 1;
|
|
348
|
+
transform: translateY(0);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Optional: Pulse effect for streaming messages (if supported by class)
|
|
353
|
+
.message-wrapper.streaming .assistant-avatar {
|
|
354
|
+
box-shadow: 0 0 8px rgba(var(--black-rgb), 0.1);
|
|
355
|
+
transition: all 0.3s ease;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Typing indicator */
|
|
359
|
+
.typing-indicator {
|
|
360
|
+
display: flex;
|
|
361
|
+
align-items: center;
|
|
362
|
+
justify-content: flex-start;
|
|
363
|
+
gap: 4px;
|
|
364
|
+
min-height: 20px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.typing-indicator span {
|
|
368
|
+
width: 8px;
|
|
369
|
+
height: 8px;
|
|
370
|
+
background-color: var(--typing-indicator-color);
|
|
371
|
+
border-radius: 50%;
|
|
372
|
+
animation: blink 1.4s infinite both;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.typing-indicator span:nth-child(2) {
|
|
376
|
+
animation-delay: 0.2s;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.typing-indicator span:nth-child(3) {
|
|
380
|
+
animation-delay: 0.4s;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@keyframes blink {
|
|
384
|
+
|
|
385
|
+
0%,
|
|
386
|
+
80%,
|
|
387
|
+
100% {
|
|
388
|
+
opacity: 0.2;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
40% {
|
|
392
|
+
opacity: 1;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Auth Buttons (Primary/Secondary) */
|
|
397
|
+
.auth-buttons-container {
|
|
398
|
+
display: flex;
|
|
399
|
+
flex-direction: row;
|
|
400
|
+
justify-content: center;
|
|
401
|
+
gap: 10px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.auth-btn {
|
|
405
|
+
padding: 8px 16px;
|
|
406
|
+
border-radius: 20px;
|
|
407
|
+
font-size: 0.9em;
|
|
408
|
+
font-weight: 500;
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
transition: all 0.2s ease;
|
|
411
|
+
|
|
412
|
+
&.primary {
|
|
413
|
+
background: var(--primary-color);
|
|
414
|
+
color: var(--white);
|
|
415
|
+
border: 1px solid var(--primary-color);
|
|
416
|
+
|
|
417
|
+
&:hover {
|
|
418
|
+
opacity: 0.9;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
&:disabled {
|
|
422
|
+
opacity: 0.5;
|
|
423
|
+
cursor: not-allowed;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
&.secondary {
|
|
428
|
+
background: transparent;
|
|
429
|
+
color: var(--primary-color);
|
|
430
|
+
border: 1px solid var(--primary-color);
|
|
431
|
+
|
|
432
|
+
&:hover {
|
|
433
|
+
opacity: 0.9;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterViewInit,
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
OnDestroy,
|
|
9
|
+
Output,
|
|
10
|
+
TrackByFunction,
|
|
11
|
+
ViewChild,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import { Message } from '../../../../core/models/message';
|
|
15
|
+
import { Chips } from '../../../../shared/chips/chips.component';
|
|
16
|
+
import { MarkdownPipe } from '../../../../shared/pipes/simple-markdown.pipe';
|
|
17
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
+
import { AppEmoji } from '../../../../constant/utf8';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-message-list',
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [CommonModule, Chips, MarkdownPipe, MatIconModule],
|
|
24
|
+
templateUrl: './message-list.component.html',
|
|
25
|
+
styleUrls: ['./message-list.component.scss'],
|
|
26
|
+
})
|
|
27
|
+
export class MessageListComponent implements AfterViewInit, OnDestroy {
|
|
28
|
+
@Input() messages: Message[] = [];
|
|
29
|
+
@Input() isBotTyping: boolean = false;
|
|
30
|
+
@Input() isStreaming: boolean = true;
|
|
31
|
+
@Input() appLogoUrl: string = '';
|
|
32
|
+
@Input() appSubtitle: string = '';
|
|
33
|
+
@Input() welcomeDesc: string = '';
|
|
34
|
+
@Input() predefinedMessages: string[] = [];
|
|
35
|
+
@Input() botAvatarUrl: string = '';
|
|
36
|
+
@Input() userAvatarUrl: string = '';
|
|
37
|
+
@Input() userName: string = '';
|
|
38
|
+
@Input() isAuthenticated: boolean = false;
|
|
39
|
+
@Input() isLoggingIn: boolean = false;
|
|
40
|
+
@Input() trackByMessageId: TrackByFunction<Message> = (index, item) => item.id ?? index;
|
|
41
|
+
|
|
42
|
+
@Output() suggestionClick = new EventEmitter<string>();
|
|
43
|
+
@Output() loginClick = new EventEmitter<void>();
|
|
44
|
+
|
|
45
|
+
@ViewChild('chatMessages') private chatMessagesContainer!: ElementRef;
|
|
46
|
+
private mutationObserver!: MutationObserver;
|
|
47
|
+
|
|
48
|
+
appEmoji = AppEmoji;
|
|
49
|
+
|
|
50
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
51
|
+
|
|
52
|
+
ngAfterViewInit(): void {
|
|
53
|
+
if (!this.chatMessagesContainer) return;
|
|
54
|
+
|
|
55
|
+
this.mutationObserver = new MutationObserver(() => this.scrollToBottom());
|
|
56
|
+
|
|
57
|
+
this.mutationObserver.observe(this.chatMessagesContainer.nativeElement, {
|
|
58
|
+
childList: true,
|
|
59
|
+
subtree: true,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.scrollToBottom();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private scrollToBottom(): void {
|
|
66
|
+
if (!this.chatMessagesContainer) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const container = this.chatMessagesContainer.nativeElement;
|
|
70
|
+
container.scrollTo({
|
|
71
|
+
top: container.scrollHeight,
|
|
72
|
+
behavior: 'smooth',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onPredefinedClick(text: string) {
|
|
77
|
+
this.suggestionClick.emit(text);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
copyMessage(message: Message): void {
|
|
81
|
+
if (!message.text) return;
|
|
82
|
+
|
|
83
|
+
navigator.clipboard.writeText(message.text).then(() => {
|
|
84
|
+
// Logger.info('Copied to clipboard');
|
|
85
|
+
// SnackbarUtils.info('Copied to clipboard');
|
|
86
|
+
|
|
87
|
+
message.copied = true;
|
|
88
|
+
this.cdr.markForCheck(); // force UI update
|
|
89
|
+
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
message.copied = false;
|
|
92
|
+
this.cdr.markForCheck(); // update again
|
|
93
|
+
}, 800);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// trackByChunkIndex(index: number) {
|
|
98
|
+
// return index;
|
|
99
|
+
// }
|
|
100
|
+
|
|
101
|
+
ngOnDestroy(): void {
|
|
102
|
+
if (this.mutationObserver) {
|
|
103
|
+
this.mutationObserver.disconnect();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MessageRole } from '../../../core/types/message-role.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Chat History Request Model
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatHistoryRequest {
|
|
7
|
+
limit: number;
|
|
8
|
+
offset: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Chat Message from API
|
|
13
|
+
*/
|
|
14
|
+
export interface ChatMessage {
|
|
15
|
+
message_id?: string; // Some endpoints return message_id
|
|
16
|
+
// chat_message_id?: string; // Others return chat_message_id
|
|
17
|
+
role: MessageRole;
|
|
18
|
+
content: string;
|
|
19
|
+
model_name: string | null;
|
|
20
|
+
prompt_tokens: number | null;
|
|
21
|
+
completion_tokens: number | null;
|
|
22
|
+
created_at: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Chat Session from API
|
|
27
|
+
*/
|
|
28
|
+
export interface ChatSessionResponse {
|
|
29
|
+
response_id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
last_message_at: string;
|
|
32
|
+
chat_session_id?: string;
|
|
33
|
+
is_active?: boolean;
|
|
34
|
+
created_at?: string;
|
|
35
|
+
updated_at?: string;
|
|
36
|
+
messages?: ChatMessage[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Chat History Data from API
|
|
41
|
+
*/
|
|
42
|
+
export interface ChatHistoryData {
|
|
43
|
+
sessions: ChatSessionResponse[];
|
|
44
|
+
total: number;
|
|
45
|
+
limit: number;
|
|
46
|
+
offset: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Chat History API Response
|
|
51
|
+
*/
|
|
52
|
+
export interface ChatHistoryResponse {
|
|
53
|
+
success: boolean;
|
|
54
|
+
message: string;
|
|
55
|
+
data: ChatHistoryData;
|
|
56
|
+
timestamp: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PromptMode } from '../../../core/types/prompt-mode.type';
|
|
2
|
+
|
|
3
|
+
export interface ChatRequest {
|
|
4
|
+
question: string;
|
|
5
|
+
|
|
6
|
+
temperature?: number;
|
|
7
|
+
|
|
8
|
+
max_tokens?: number;
|
|
9
|
+
|
|
10
|
+
prompt_mode?: PromptMode;
|
|
11
|
+
|
|
12
|
+
organization_id: string;
|
|
13
|
+
|
|
14
|
+
response_id?: string;
|
|
15
|
+
|
|
16
|
+
custom_instructions?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Message } from '../../../core/models/message';
|
|
2
|
+
|
|
3
|
+
export interface ChatSession {
|
|
4
|
+
id: string;
|
|
5
|
+
timestamp: Date;
|
|
6
|
+
title: string; // Auto-generated from first message
|
|
7
|
+
messages: Message[];
|
|
8
|
+
userId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ChatSessionGroup {
|
|
12
|
+
label: string;
|
|
13
|
+
sessions: ChatSession[];
|
|
14
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MessageRole } from '../../../core/types/message-role.type';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { MessageRole } from '../../../core/types/message-role.type';
|
|
2
|
+
|
|
3
|
+
export interface ChatStreamMessage {
|
|
4
|
+
role: MessageRole;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatStream } from '../../../core/types/chat-stream.type';
|
|
2
|
+
|
|
3
|
+
export interface ChatStreamResponse {
|
|
4
|
+
id: string;
|
|
5
|
+
type: ChatStream;
|
|
6
|
+
content: string;
|
|
7
|
+
error?: any;
|
|
8
|
+
created_at: string;
|
|
9
|
+
// isComplete: boolean;
|
|
10
|
+
sources: any[];
|
|
11
|
+
response_id?: string;
|
|
12
|
+
}
|