@aakash58/chatbot 1.1.21 → 1.1.22
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/README.md +22 -298
- package/esm2022/aakash58-chatbot.mjs +5 -0
- package/esm2022/lib/app/chat/chat-ui-state.service.mjs +170 -0
- package/esm2022/lib/app/chat/chat.service.mjs +445 -0
- package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +50 -0
- package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +12 -0
- package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +66 -0
- package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +186 -0
- package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +312 -0
- package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +36 -0
- package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +115 -0
- package/esm2022/lib/app/chat/model/chat-history.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-request.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-response.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-session.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +2 -0
- package/esm2022/lib/app/chat/services/chat-api.service.mjs +61 -0
- package/esm2022/lib/app/chat/services/chat-audio.service.mjs +50 -0
- package/esm2022/lib/app/chat/services/chat-history.service.mjs +252 -0
- package/esm2022/lib/app/login/login-form.component.mjs +46 -0
- package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +194 -0
- package/esm2022/lib/app/personalization/personalization.service.mjs +149 -0
- package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +122 -0
- package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +86 -0
- package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +115 -0
- package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +29 -0
- package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +30 -0
- package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +12 -0
- package/esm2022/lib/constant/doohbot-constant.mjs +28 -0
- package/esm2022/lib/constant/html-entities.mjs +9 -0
- package/esm2022/lib/constant/utf8.mjs +10 -0
- package/esm2022/lib/core/app-const.mjs +61 -0
- package/esm2022/lib/core/auth/account-api.service.mjs +40 -0
- package/esm2022/lib/core/auth/auth.service.mjs +391 -0
- package/esm2022/lib/core/auth/models/auth-result.model.mjs +3 -0
- package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +6 -0
- package/esm2022/lib/core/auth/models/login-request.model.mjs +6 -0
- package/esm2022/lib/core/auth/storage.service.mjs +110 -0
- package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +112 -0
- package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +55 -0
- package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +179 -0
- package/esm2022/lib/core/environments/environment.mjs +15 -0
- package/esm2022/lib/core/environments/environment.prod.mjs +15 -0
- package/esm2022/lib/core/helpers/crypto-helper.service.mjs +52 -0
- package/esm2022/lib/core/http/http-stream.service.mjs +97 -0
- package/esm2022/lib/core/http/http.service.mjs +103 -0
- package/esm2022/lib/core/interceptors/auth.interceptor.mjs +96 -0
- package/esm2022/lib/core/interceptors/license.interceptor.mjs +44 -0
- package/esm2022/lib/core/models/api-config.model.mjs +18 -0
- package/esm2022/lib/core/models/api-request.model.mjs +2 -0
- package/esm2022/lib/core/models/api-response.model.mjs +8 -0
- package/esm2022/lib/core/models/doohbot-config.model.mjs +18 -0
- package/esm2022/lib/core/models/license.model.mjs +2 -0
- package/esm2022/lib/core/models/message.mjs +2 -0
- package/esm2022/lib/core/models/theme-config.model.mjs +2 -0
- package/esm2022/lib/core/services/core-config.service.mjs +52 -0
- package/esm2022/lib/core/services/license.service.mjs +145 -0
- package/esm2022/lib/core/services/markdown.service.mjs +64 -0
- package/esm2022/lib/core/services/theme.service.mjs +248 -0
- package/esm2022/lib/core/types/auth-mode.type.mjs +2 -0
- package/esm2022/lib/core/types/auth-status.type.mjs +5 -0
- package/esm2022/lib/core/types/chat-stream.type.mjs +2 -0
- package/esm2022/lib/core/types/message-role.type.mjs +2 -0
- package/esm2022/lib/core/types/prompt-mode.type.mjs +5 -0
- package/esm2022/lib/core/types/snackbar-error.type.mjs +5 -0
- package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +2 -0
- package/esm2022/lib/core/utils/logger.service.mjs +42 -0
- package/esm2022/lib/doohbot-input.mjs +20 -0
- package/esm2022/lib/doohbot.component.mjs +444 -0
- package/esm2022/lib/predefined_messages.mjs +15 -0
- package/esm2022/lib/shared/chips/chips.component.mjs +28 -0
- package/esm2022/lib/shared/dialog/dialog.component.mjs +36 -0
- package/esm2022/lib/shared/dialog/dialog.service.mjs +64 -0
- package/esm2022/lib/shared/dialog/dialog.utils.mjs +85 -0
- package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +29 -0
- package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +38 -0
- package/esm2022/lib/shared/menu-item/menu-item.component.mjs +24 -0
- package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +27 -0
- package/esm2022/lib/shared/snackbar/snackbar.component.mjs +43 -0
- package/esm2022/lib/shared/snackbar/snackbar.service.mjs +46 -0
- package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +43 -0
- package/esm2022/public-api.mjs +37 -0
- package/fesm2022/aakash58-chatbot.mjs +5193 -0
- package/fesm2022/aakash58-chatbot.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/app/chat/chat-ui-state.service.d.ts +96 -0
- package/lib/app/chat/chat.service.d.ts +88 -0
- package/lib/app/chat/components/chat-button/chat-button.component.d.ts +16 -0
- package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +5 -0
- package/lib/app/chat/components/chat-header/chat-header.component.d.ts +24 -0
- package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +49 -0
- package/lib/app/chat/components/chat-window/chat-window.component.d.ts +107 -0
- package/lib/app/chat/components/message-input/message-input.component.d.ts +12 -0
- package/lib/app/chat/components/message-list/message-list.component.d.ts +40 -0
- package/lib/app/chat/model/chat-history.model.d.ts +51 -0
- package/lib/app/chat/model/chat-request.model.d.ts +10 -0
- package/lib/app/chat/model/chat-response.model.d.ts +9 -0
- package/lib/app/chat/model/chat-session.model.d.ts +12 -0
- package/{projects/doohbot/src/lib/app/chat/model/chat-stream-message.model.ts → lib/app/chat/model/chat-stream-message.model.d.ts} +5 -6
- package/lib/app/chat/model/chat-stream-response.model.d.ts +10 -0
- package/lib/app/chat/services/chat-api.service.d.ts +30 -0
- package/lib/app/chat/services/chat-audio.service.d.ts +19 -0
- package/lib/app/chat/services/chat-history.service.d.ts +53 -0
- package/lib/app/login/login-form.component.d.ts +20 -0
- package/lib/app/personalization/personalization-dialog.component.d.ts +53 -0
- package/lib/app/personalization/personalization.service.d.ts +66 -0
- package/lib/app/personalization/sections/account/account-section.component.d.ts +30 -0
- package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +17 -0
- package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +27 -0
- package/lib/app/personalization/sections/profile/profile-section.component.d.ts +17 -0
- package/lib/app/personalization/sections/settings/setting-section.component.d.ts +10 -0
- package/lib/app/personalization/sections/terms/terms-section.component.d.ts +5 -0
- package/lib/constant/doohbot-constant.d.ts +12 -0
- package/lib/constant/html-entities.d.ts +8 -0
- package/lib/constant/utf8.d.ts +9 -0
- package/lib/core/app-const.d.ts +11 -0
- package/lib/core/auth/account-api.service.d.ts +20 -0
- package/lib/core/auth/auth.service.d.ts +90 -0
- package/lib/core/auth/models/auth-result.model.d.ts +4 -0
- package/lib/core/auth/models/federated-login-request.model.d.ts +5 -0
- package/lib/core/auth/models/login-request.model.d.ts +6 -0
- package/lib/core/auth/storage.service.d.ts +21 -0
- package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +23 -0
- package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +14 -0
- package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +30 -0
- package/lib/core/environments/environment.d.ts +7 -0
- package/lib/core/environments/environment.prod.d.ts +7 -0
- package/lib/core/helpers/crypto-helper.service.d.ts +12 -0
- package/lib/core/http/http-stream.service.d.ts +18 -0
- package/lib/core/http/http.service.d.ts +20 -0
- package/lib/core/interceptors/auth.interceptor.d.ts +18 -0
- package/lib/core/interceptors/license.interceptor.d.ts +11 -0
- package/lib/core/models/api-config.model.d.ts +58 -0
- package/lib/core/models/api-request.model.d.ts +77 -0
- package/lib/core/models/api-response.model.d.ts +6 -0
- package/lib/core/models/doohbot-config.model.d.ts +81 -0
- package/{projects/doohbot/src/lib/core/models/license.model.ts → lib/core/models/license.model.d.ts} +23 -27
- package/lib/core/models/message.d.ts +16 -0
- package/lib/core/models/theme-config.model.d.ts +28 -0
- package/lib/core/services/core-config.service.d.ts +23 -0
- package/lib/core/services/license.service.d.ts +33 -0
- package/lib/core/services/markdown.service.d.ts +8 -0
- package/lib/core/services/theme.service.d.ts +40 -0
- package/{projects/doohbot/src/lib/core/types/auth-mode.type.ts → lib/core/types/auth-mode.type.d.ts} +4 -4
- package/{projects/doohbot/src/lib/core/types/auth-status.type.ts → lib/core/types/auth-status.type.d.ts} +4 -5
- package/{projects/doohbot/src/lib/core/types/chat-stream.type.ts → lib/core/types/chat-stream.type.d.ts} +4 -4
- package/{projects/doohbot/src/lib/core/types/message-role.type.ts → lib/core/types/message-role.type.d.ts} +4 -4
- package/{projects/doohbot/src/lib/core/types/prompt-mode.type.ts → lib/core/types/prompt-mode.type.d.ts} +4 -5
- package/{projects/doohbot/src/lib/core/types/snackbar-error.type.ts → lib/core/types/snackbar-error.type.d.ts} +4 -5
- package/{projects/doohbot/src/lib/core/types/tenant-resolution-strategy.type.ts → lib/core/types/tenant-resolution-strategy.type.d.ts} +4 -4
- package/lib/core/utils/logger.service.d.ts +11 -0
- package/lib/doohbot-input.d.ts +19 -0
- package/lib/doohbot.component.d.ts +108 -0
- package/lib/predefined_messages.d.ts +2 -0
- package/lib/shared/chips/chips.component.d.ts +10 -0
- package/lib/shared/dialog/dialog.component.d.ts +19 -0
- package/lib/shared/dialog/dialog.service.d.ts +29 -0
- package/lib/shared/dialog/dialog.utils.d.ts +41 -0
- package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +11 -0
- package/lib/shared/input-dialog/input-dialog.component.d.ts +20 -0
- package/lib/shared/menu-item/menu-item.component.d.ts +9 -0
- package/lib/shared/pipes/simple-markdown.pipe.d.ts +10 -0
- package/lib/shared/snackbar/snackbar.component.d.ts +14 -0
- package/lib/shared/snackbar/snackbar.service.d.ts +19 -0
- package/{projects/doohbot/src/lib/shared/snackbar/snackbar.utils.ts → lib/shared/snackbar/snackbar.utils.d.ts} +33 -49
- package/package.json +29 -75
- package/public-api.d.ts +11 -0
- package/.editorconfig +0 -17
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -41
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -60
- package/angular.json +0 -132
- package/docs/PUBLISHING_GUIDE.md +0 -104
- package/projects/app-doohbot/public/assets/const/app-const.json +0 -15
- package/projects/app-doohbot/public/assets/const/doohclick_license.json +0 -6
- package/projects/app-doohbot/public/favicon.ico +0 -0
- package/projects/app-doohbot/src/app/app.config.ts +0 -13
- package/projects/app-doohbot/src/app/app.html +0 -31
- package/projects/app-doohbot/src/app/app.routes.ts +0 -3
- package/projects/app-doohbot/src/app/app.scss +0 -279
- package/projects/app-doohbot/src/app/app.spec.ts +0 -23
- package/projects/app-doohbot/src/app/app.ts +0 -72
- package/projects/app-doohbot/src/index.html +0 -15
- package/projects/app-doohbot/src/main.ts +0 -6
- package/projects/app-doohbot/src/styles.scss +0 -15
- package/projects/app-doohbot/tsconfig.app.json +0 -15
- package/projects/app-doohbot/tsconfig.spec.json +0 -14
- package/projects/doohbot/README.md +0 -64
- package/projects/doohbot/docs/README.md +0 -140
- package/projects/doohbot/ng-package.json +0 -10
- package/projects/doohbot/package.json +0 -16
- package/projects/doohbot/src/lib/app/chat/chat-ui-state.service.ts +0 -194
- package/projects/doohbot/src/lib/app/chat/chat.service.ts +0 -547
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.html +0 -27
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.scss +0 -115
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.ts +0 -35
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.html +0 -3
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.scss +0 -20
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.ts +0 -12
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.html +0 -34
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.scss +0 -78
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.ts +0 -52
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.html +0 -77
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.scss +0 -346
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.ts +0 -188
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.html +0 -146
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.scss +0 -187
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.ts +0 -256
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.html +0 -17
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.scss +0 -59
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.ts +0 -28
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.html +0 -138
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.scss +0 -436
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.ts +0 -106
- package/projects/doohbot/src/lib/app/chat/model/chat-history.model.ts +0 -57
- package/projects/doohbot/src/lib/app/chat/model/chat-request.model.ts +0 -17
- package/projects/doohbot/src/lib/app/chat/model/chat-response.model.ts +0 -9
- package/projects/doohbot/src/lib/app/chat/model/chat-session.model.ts +0 -14
- package/projects/doohbot/src/lib/app/chat/model/chat-stream-response.model.ts +0 -12
- package/projects/doohbot/src/lib/app/chat/services/chat-api.service.ts +0 -82
- package/projects/doohbot/src/lib/app/chat/services/chat-audio.service.ts +0 -44
- package/projects/doohbot/src/lib/app/chat/services/chat-history.service.ts +0 -303
- package/projects/doohbot/src/lib/app/login/login-form.component.html +0 -80
- package/projects/doohbot/src/lib/app/login/login-form.component.scss +0 -189
- package/projects/doohbot/src/lib/app/login/login-form.component.ts +0 -45
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.html +0 -81
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.scss +0 -179
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.ts +0 -217
- package/projects/doohbot/src/lib/app/personalization/personalization.service.ts +0 -197
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.html +0 -111
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.scss +0 -218
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.ts +0 -121
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.html +0 -46
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.scss +0 -138
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.ts +0 -28
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/color-picker-dialog.component.ts +0 -92
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.html +0 -198
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.scss +0 -107
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.ts +0 -103
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.html +0 -46
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.scss +0 -131
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.ts +0 -23
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.html +0 -33
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.scss +0 -61
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.ts +0 -20
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.html +0 -30
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.scss +0 -59
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.ts +0 -12
- package/projects/doohbot/src/lib/constant/doohbot-constant.ts +0 -40
- package/projects/doohbot/src/lib/constant/html-entities.ts +0 -8
- package/projects/doohbot/src/lib/constant/utf8.ts +0 -9
- package/projects/doohbot/src/lib/core/app-const.ts +0 -63
- package/projects/doohbot/src/lib/core/auth/account-api.service.ts +0 -53
- package/projects/doohbot/src/lib/core/auth/auth.service.ts +0 -478
- package/projects/doohbot/src/lib/core/auth/models/auth-result.model.ts +0 -4
- package/projects/doohbot/src/lib/core/auth/models/federated-login-request.model.ts +0 -5
- package/projects/doohbot/src/lib/core/auth/models/login-request.model.ts +0 -6
- package/projects/doohbot/src/lib/core/auth/storage.service.ts +0 -113
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.directive.ts +0 -123
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.module.ts +0 -9
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.directive.ts +0 -58
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.module.ts +0 -9
- package/projects/doohbot/src/lib/core/directives/popout/popout.directive.ts +0 -169
- package/projects/doohbot/src/lib/core/directives/popout/popout.module.ts +0 -9
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.directive.ts +0 -197
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.module.ts +0 -9
- package/projects/doohbot/src/lib/core/enums/api-request-state.enum.ts +0 -9
- package/projects/doohbot/src/lib/core/environments/environment.prod.ts +0 -14
- package/projects/doohbot/src/lib/core/environments/environment.ts +0 -14
- package/projects/doohbot/src/lib/core/helpers/crypto-helper.service.ts +0 -72
- package/projects/doohbot/src/lib/core/http/http-stream.service.ts +0 -105
- package/projects/doohbot/src/lib/core/http/http.service.ts +0 -148
- package/projects/doohbot/src/lib/core/interceptors/auth.interceptor.ts +0 -118
- package/projects/doohbot/src/lib/core/interceptors/license.interceptor.ts +0 -50
- package/projects/doohbot/src/lib/core/models/api-config.model.ts +0 -82
- package/projects/doohbot/src/lib/core/models/api-request.model.ts +0 -92
- package/projects/doohbot/src/lib/core/models/api-response.model.ts +0 -13
- package/projects/doohbot/src/lib/core/models/doohbot-config.model.ts +0 -109
- package/projects/doohbot/src/lib/core/models/message.ts +0 -18
- package/projects/doohbot/src/lib/core/models/theme-config.model.ts +0 -48
- package/projects/doohbot/src/lib/core/services/core-config.service.ts +0 -53
- package/projects/doohbot/src/lib/core/services/doohbot-api.service.ts +0 -207
- package/projects/doohbot/src/lib/core/services/license.service.ts +0 -171
- package/projects/doohbot/src/lib/core/services/markdown.service.ts +0 -73
- package/projects/doohbot/src/lib/core/services/theme.service.ts +0 -305
- package/projects/doohbot/src/lib/core/utils/error-handler.util.ts +0 -31
- package/projects/doohbot/src/lib/core/utils/logger.service.ts +0 -45
- package/projects/doohbot/src/lib/doohbot-input.ts +0 -19
- package/projects/doohbot/src/lib/doohbot.component.html +0 -34
- package/projects/doohbot/src/lib/doohbot.component.scss +0 -17
- package/projects/doohbot/src/lib/doohbot.component.spec.ts +0 -31
- package/projects/doohbot/src/lib/doohbot.component.ts +0 -545
- package/projects/doohbot/src/lib/elements.ts +0 -25
- package/projects/doohbot/src/lib/predefined_messages.ts +0 -14
- package/projects/doohbot/src/lib/shared/chips/chips.component.html +0 -9
- package/projects/doohbot/src/lib/shared/chips/chips.component.scss +0 -29
- package/projects/doohbot/src/lib/shared/chips/chips.component.spec.ts +0 -22
- package/projects/doohbot/src/lib/shared/chips/chips.component.ts +0 -20
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.html +0 -29
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.scss +0 -100
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.ts +0 -42
- package/projects/doohbot/src/lib/shared/dialog/dialog.service.ts +0 -62
- package/projects/doohbot/src/lib/shared/dialog/dialog.utils.ts +0 -102
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.html +0 -30
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.scss +0 -53
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.spec.ts +0 -22
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.ts +0 -35
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.html +0 -16
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.scss +0 -45
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.ts +0 -46
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.html +0 -5
- 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 +0 -22
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.ts +0 -20
- package/projects/doohbot/src/lib/shared/pipes/simple-markdown.pipe.ts +0 -19
- package/projects/doohbot/src/lib/shared/popout/popout.html +0 -1
- package/projects/doohbot/src/lib/shared/popout/popout.scss +0 -0
- package/projects/doohbot/src/lib/shared/popout/popout.spec.ts +0 -23
- package/projects/doohbot/src/lib/shared/popout/popout.ts +0 -11
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.html +0 -7
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.scss +0 -125
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.spec.ts +0 -21
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.ts +0 -44
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.service.ts +0 -54
- package/projects/doohbot/src/lib/styles/_theme.scss +0 -132
- package/projects/doohbot/src/lib/styles/material-override.scss +0 -302
- package/projects/doohbot/src/lib/styles/utility.scss +0 -588
- package/projects/doohbot/src/public-api.ts +0 -42
- package/projects/doohbot/tsconfig.lib.json +0 -15
- package/projects/doohbot/tsconfig.lib.prod.json +0 -11
- package/projects/doohbot/tsconfig.spec.json +0 -10
- package/proxy.conf.json +0 -8
- package/publish.config.js +0 -25
- package/scripts/publishing/index.ts +0 -67
- package/scripts/publishing/pipeline/01-clean.ts +0 -11
- package/scripts/publishing/pipeline/02-validate-pre.ts +0 -8
- package/scripts/publishing/pipeline/03-build.ts +0 -7
- package/scripts/publishing/pipeline/04-validate-post.ts +0 -8
- package/scripts/publishing/pipeline/05-prepare-package.ts +0 -29
- package/scripts/publishing/pipeline/06-version.ts +0 -23
- package/scripts/publishing/pipeline/07-publish.ts +0 -14
- package/scripts/publishing/pipeline/08-cleanup.ts +0 -5
- package/scripts/publishing/types.ts +0 -36
- package/scripts/publishing/utils/command.ts +0 -15
- package/scripts/publishing/utils/config.ts +0 -17
- package/scripts/validate.ts +0 -166
- package/tsconfig.json +0 -45
- package/tsconfig.scripts.json +0 -15
- /package/{projects/doohbot/src → src}/assets/bot.mp3 +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ChatHistoryData, ChatHistoryRequest, ChatMessage } from '../model/chat-history.model';
|
|
4
|
-
import { HttpStreamService } from '../../../core/http/http-stream.service';
|
|
5
|
-
import { HttpService } from '../../../core/http/http.service';
|
|
6
|
-
import { ApiResponse } from '../../../core/models/api-response.model';
|
|
7
|
-
import logger from '../../../core/utils/logger.service';
|
|
8
|
-
import { ChatRequest } from '../model/chat-request.model';
|
|
9
|
-
import { ChatResponse } from '../model/chat-response.model';
|
|
10
|
-
import { ChatStreamResponse } from '../model/chat-stream-response.model';
|
|
11
|
-
|
|
12
|
-
@Injectable({
|
|
13
|
-
providedIn: 'root',
|
|
14
|
-
})
|
|
15
|
-
export class ChatApiService {
|
|
16
|
-
get apiUrl(): string {
|
|
17
|
-
return this.http.apiUrl;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
constructor(
|
|
21
|
-
private http: HttpService,
|
|
22
|
-
private httpStreamService: HttpStreamService,
|
|
23
|
-
) {
|
|
24
|
-
logger.log('ChatApiService: Initialized');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Send chat message and get full response
|
|
29
|
-
*/
|
|
30
|
-
sendMessage(request?: ChatRequest, showLoader = false): Observable<ApiResponse<ChatResponse>> {
|
|
31
|
-
return this.http.post('chats/ask', request, showLoader);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Send chat message and get streaming response
|
|
36
|
-
*/
|
|
37
|
-
sendMessageStream(request: ChatRequest): Observable<ChatStreamResponse> {
|
|
38
|
-
return this.httpStreamService.createHttpStream(`${this.apiUrl}chats/stream`, request);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
getChatHistory(
|
|
42
|
-
request: ChatHistoryRequest,
|
|
43
|
-
showLoader = false,
|
|
44
|
-
): Observable<ApiResponse<ChatHistoryData>> {
|
|
45
|
-
return this.http.post('chats/sessions', request, showLoader);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
getChatSession(
|
|
49
|
-
chatSessionId: string,
|
|
50
|
-
showLoader = false,
|
|
51
|
-
): Observable<ApiResponse<ChatMessage[]>> {
|
|
52
|
-
return this.http.get(`chats/sessions/${chatSessionId}`, undefined, showLoader);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// deleteChatSession(chatSessionId: string, showLoader = false): Observable<ApiResponse<void>> {
|
|
56
|
-
// return this.http.delete(`chats/sessions/${chatSessionId}`, undefined, showLoader);
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
// deleteChatSession(chatSessionId: string, showLoader = false): Observable<ApiResponse<void>> {
|
|
60
|
-
// return this.clearChatHistory(
|
|
61
|
-
// { chat_session_ids: [chatSessionId], delete_all: false },
|
|
62
|
-
// showLoader,
|
|
63
|
-
// );
|
|
64
|
-
// }
|
|
65
|
-
|
|
66
|
-
deleteChatSession(chatSessionId: string, showLoader = false): Observable<ApiResponse<void>> {
|
|
67
|
-
const body = { chat_session_ids: [chatSessionId], delete_all: false };
|
|
68
|
-
return this.http.delete('chats/sessions', body, showLoader);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
updateChatTitle(
|
|
72
|
-
chatSessionId: string,
|
|
73
|
-
title: string,
|
|
74
|
-
showLoader = false,
|
|
75
|
-
): Observable<ApiResponse<void>> {
|
|
76
|
-
return this.http.patch(`chats/sessions/${chatSessionId}/title`, { title }, showLoader);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
clearChatHistory(request?: object, showLoader = false): Observable<ApiResponse<void>> {
|
|
80
|
-
return this.http.delete('chats/sessions', request, showLoader);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import logger from '../../../core/utils/logger.service';
|
|
3
|
-
|
|
4
|
-
@Injectable({
|
|
5
|
-
providedIn: 'root',
|
|
6
|
-
})
|
|
7
|
-
export class ChatAudioService {
|
|
8
|
-
private audioUnlocked = false;
|
|
9
|
-
|
|
10
|
-
constructor() { }
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Unlock audio playback (required for autoplay in browsers)
|
|
14
|
-
*/
|
|
15
|
-
public unlockAudio(): void {
|
|
16
|
-
if (this.audioUnlocked) return;
|
|
17
|
-
const audio = new Audio();
|
|
18
|
-
audio.volume = 1.0;
|
|
19
|
-
audio
|
|
20
|
-
.play()
|
|
21
|
-
.then(() => (this.audioUnlocked = true))
|
|
22
|
-
.catch(() => { });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Play bot message sound
|
|
27
|
-
*/
|
|
28
|
-
public playBotSound(): void {
|
|
29
|
-
if (!this.audioUnlocked) return;
|
|
30
|
-
try {
|
|
31
|
-
const audio = new Audio('assets/bot.mp3');
|
|
32
|
-
audio.play();
|
|
33
|
-
} catch (error) {
|
|
34
|
-
logger.error('Error playing bot sound:', error);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Check if audio is unlocked
|
|
40
|
-
*/
|
|
41
|
-
public isAudioUnlocked(): boolean {
|
|
42
|
-
return this.audioUnlocked;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { Injectable, inject, signal } from '@angular/core';
|
|
2
|
-
import { Observable, of, catchError, map } from 'rxjs';
|
|
3
|
-
import { ChatApiService } from './chat-api.service';
|
|
4
|
-
import { ChatSession } from '../model/chat-session.model';
|
|
5
|
-
import { Message } from '../../../core/models/message';
|
|
6
|
-
import { SnackbarUtils } from '../../../shared/snackbar/snackbar.utils';
|
|
7
|
-
import logger from '../../../core/utils/logger.service';
|
|
8
|
-
import { ChatSessionResponse, ChatMessage } from '../model/chat-history.model';
|
|
9
|
-
|
|
10
|
-
@Injectable({
|
|
11
|
-
providedIn: 'root',
|
|
12
|
-
})
|
|
13
|
-
export class ChatHistoryService {
|
|
14
|
-
private chatApiService = inject(ChatApiService);
|
|
15
|
-
|
|
16
|
-
// History State Signals
|
|
17
|
-
public sessions = signal<ChatSession[]>([]);
|
|
18
|
-
public isLoading = signal<boolean>(false);
|
|
19
|
-
public isLoadingMore = signal<boolean>(false);
|
|
20
|
-
public hasMore = signal<boolean>(true);
|
|
21
|
-
public historyOffset = signal<number>(0);
|
|
22
|
-
public isCacheValid = signal<boolean>(false);
|
|
23
|
-
public processingSessionId = signal<string | null>(null);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Map API session response to ChatSession model
|
|
27
|
-
*/
|
|
28
|
-
public mapSessionResponseToSession(
|
|
29
|
-
sessionResponse: ChatSessionResponse,
|
|
30
|
-
userId: string,
|
|
31
|
-
): ChatSession {
|
|
32
|
-
// Use last_message_at or created_at or current time
|
|
33
|
-
const timestamp = sessionResponse.last_message_at
|
|
34
|
-
? new Date(sessionResponse.last_message_at)
|
|
35
|
-
: sessionResponse.created_at
|
|
36
|
-
? new Date(sessionResponse.created_at)
|
|
37
|
-
: new Date();
|
|
38
|
-
|
|
39
|
-
logger.log('Mapping session response:', sessionResponse);
|
|
40
|
-
|
|
41
|
-
// Map messages from the session if they exist
|
|
42
|
-
let messages: Message[] = [];
|
|
43
|
-
if (sessionResponse.messages && Array.isArray(sessionResponse.messages)) {
|
|
44
|
-
messages = sessionResponse.messages.map((msg: ChatMessage) => ({
|
|
45
|
-
id: msg.message_id || '',
|
|
46
|
-
sender: msg.role,
|
|
47
|
-
text: msg.content,
|
|
48
|
-
completed: true,
|
|
49
|
-
isHistory: true,
|
|
50
|
-
timestamp: new Date(msg.created_at),
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Use response_id as primary ID, fallback to chat_session_id
|
|
55
|
-
const sessionId = sessionResponse.response_id || sessionResponse.chat_session_id || '';
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
id: sessionId,
|
|
59
|
-
timestamp: timestamp,
|
|
60
|
-
title: sessionResponse.title || 'Previous Conversation',
|
|
61
|
-
userId: userId,
|
|
62
|
-
messages: messages,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Load all chat sessions for a specific user
|
|
68
|
-
*/
|
|
69
|
-
loadSessions(userId: string, forceRefresh: boolean = false): void {
|
|
70
|
-
logger.log('loadSessions called', { userId, forceRefresh });
|
|
71
|
-
|
|
72
|
-
if (this.isCacheValid() && !forceRefresh && this.sessions().length > 0) {
|
|
73
|
-
logger.log('Cache is valid and sessions already loaded. Skipping API call.');
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
this.isLoading.set(true);
|
|
78
|
-
this.historyOffset.set(0);
|
|
79
|
-
logger.log('Fetching chat history from API...');
|
|
80
|
-
|
|
81
|
-
this.chatApiService
|
|
82
|
-
.getChatHistory({ limit: 50, offset: 0 })
|
|
83
|
-
.pipe(
|
|
84
|
-
map((response) => {
|
|
85
|
-
logger.log('Chat history response received', response);
|
|
86
|
-
|
|
87
|
-
if (response && response.success && response.data && response.data.sessions) {
|
|
88
|
-
const remoteSessions = response.data.sessions.map((session: ChatSessionResponse) =>
|
|
89
|
-
this.mapSessionResponseToSession(session, userId),
|
|
90
|
-
);
|
|
91
|
-
const hasMore =
|
|
92
|
-
response.data.offset + response.data.sessions.length < response.data.total;
|
|
93
|
-
|
|
94
|
-
logger.log(`Mapped ${remoteSessions.length} sessions. Has more: ${hasMore}`);
|
|
95
|
-
return { sessions: remoteSessions, hasMore };
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
logger.warn('No sessions found in response');
|
|
99
|
-
return { sessions: [], hasMore: false };
|
|
100
|
-
}),
|
|
101
|
-
catchError((err) => {
|
|
102
|
-
SnackbarUtils.error('Failed to load history');
|
|
103
|
-
logger.error('ChatHistoryService: Failed to load history:', err);
|
|
104
|
-
return of({ sessions: [], hasMore: false });
|
|
105
|
-
}),
|
|
106
|
-
)
|
|
107
|
-
.subscribe({
|
|
108
|
-
next: (result) => {
|
|
109
|
-
this.sessions.set(result.sessions);
|
|
110
|
-
this.hasMore.set(result.hasMore);
|
|
111
|
-
this.historyOffset.set(result.sessions.length);
|
|
112
|
-
this.isCacheValid.set(true);
|
|
113
|
-
this.isLoading.set(false);
|
|
114
|
-
|
|
115
|
-
logger.log(`Loaded ${result.sessions.length} sessions. Cache valid: true`);
|
|
116
|
-
},
|
|
117
|
-
error: () => {
|
|
118
|
-
this.isLoading.set(false);
|
|
119
|
-
logger.error('loadSessions: Unexpected error in subscription');
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Load more sessions for infinite scroll
|
|
126
|
-
*/
|
|
127
|
-
loadMoreSessions(userId: string): void {
|
|
128
|
-
if (!this.hasMore() || this.isLoadingMore()) return;
|
|
129
|
-
|
|
130
|
-
const currentOffset = this.historyOffset();
|
|
131
|
-
this.isLoadingMore.set(true);
|
|
132
|
-
|
|
133
|
-
this.chatApiService
|
|
134
|
-
.getChatHistory({ limit: 50, offset: currentOffset })
|
|
135
|
-
.pipe(
|
|
136
|
-
map((response) => {
|
|
137
|
-
if (response && response.success && response.data && response.data.sessions) {
|
|
138
|
-
const remoteSessions = response.data.sessions.map((session: ChatSessionResponse) =>
|
|
139
|
-
this.mapSessionResponseToSession(session, userId),
|
|
140
|
-
);
|
|
141
|
-
const hasMore =
|
|
142
|
-
response.data.offset + response.data.sessions.length < response.data.total;
|
|
143
|
-
return { sessions: remoteSessions, hasMore };
|
|
144
|
-
}
|
|
145
|
-
return { sessions: [], hasMore: false };
|
|
146
|
-
}),
|
|
147
|
-
catchError((err) => {
|
|
148
|
-
SnackbarUtils.error('Failed to load more history');
|
|
149
|
-
logger.error('ChatHistoryService: Failed to load more history:', err);
|
|
150
|
-
return of({ sessions: [], hasMore: false });
|
|
151
|
-
}),
|
|
152
|
-
)
|
|
153
|
-
.subscribe({
|
|
154
|
-
next: (result) => {
|
|
155
|
-
const updatedSessions = [...this.sessions(), ...result.sessions];
|
|
156
|
-
this.sessions.set(updatedSessions);
|
|
157
|
-
this.hasMore.set(result.hasMore);
|
|
158
|
-
this.historyOffset.set(currentOffset + result.sessions.length);
|
|
159
|
-
this.isLoadingMore.set(false);
|
|
160
|
-
},
|
|
161
|
-
error: () => this.isLoadingMore.set(false),
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Load messages for a specific session
|
|
167
|
-
*/
|
|
168
|
-
loadSessionMessages(sessionId: string): Observable<Message[]> {
|
|
169
|
-
return this.chatApiService.getChatSession(sessionId).pipe(
|
|
170
|
-
map((response) => {
|
|
171
|
-
if (response.success && response.data) {
|
|
172
|
-
// Sort messages by created_at timestamp to ensure chronological order (user, assistant, user, assistant...)
|
|
173
|
-
function sortMessages(messages: any[]) {
|
|
174
|
-
const users = messages.filter((m) => m.role === 'user');
|
|
175
|
-
const assistants = messages.filter((m) => m.role === 'assistant');
|
|
176
|
-
|
|
177
|
-
const result = [];
|
|
178
|
-
const maxLength = Math.max(users.length, assistants.length);
|
|
179
|
-
|
|
180
|
-
for (let i = 0; i < maxLength; i++) {
|
|
181
|
-
if (users[i]) result.push(users[i]);
|
|
182
|
-
if (assistants[i]) result.push(assistants[i]);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const sortedData = sortMessages(response.data);
|
|
189
|
-
|
|
190
|
-
return sortedData.map((msg: ChatMessage) => ({
|
|
191
|
-
id: msg.message_id || '',
|
|
192
|
-
sender: msg.role,
|
|
193
|
-
text: msg.content,
|
|
194
|
-
completed: true,
|
|
195
|
-
isHistory: true,
|
|
196
|
-
timestamp: new Date(msg.created_at),
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
return [];
|
|
200
|
-
}),
|
|
201
|
-
catchError((err) => {
|
|
202
|
-
logger.error('ChatHistoryService: Failed to load messages:', err);
|
|
203
|
-
SnackbarUtils.error('Failed to load messages');
|
|
204
|
-
return of([]);
|
|
205
|
-
}),
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Delete a specific session
|
|
211
|
-
*/
|
|
212
|
-
deleteSession(sessionId: string, userId: string): Observable<void> {
|
|
213
|
-
this.processingSessionId.set(sessionId);
|
|
214
|
-
return this.chatApiService.deleteChatSession(sessionId).pipe(
|
|
215
|
-
map((response) => {
|
|
216
|
-
if (response && response.success) {
|
|
217
|
-
this.sessions.update((prev) => prev.filter((s) => s.id !== sessionId));
|
|
218
|
-
SnackbarUtils.success('Conversation deleted successfully');
|
|
219
|
-
}
|
|
220
|
-
}),
|
|
221
|
-
catchError((err) => {
|
|
222
|
-
SnackbarUtils.error('Failed to delete conversation');
|
|
223
|
-
logger.error('ChatHistoryService: Failed to delete session', err);
|
|
224
|
-
throw err;
|
|
225
|
-
}),
|
|
226
|
-
map(() => {
|
|
227
|
-
this.processingSessionId.set(null);
|
|
228
|
-
}),
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Delete all history
|
|
234
|
-
*/
|
|
235
|
-
deleteAllHistory(userId: string): Observable<void> {
|
|
236
|
-
this.isLoading.set(true);
|
|
237
|
-
return this.chatApiService.clearChatHistory({ delete_all: true }).pipe(
|
|
238
|
-
map((response) => {
|
|
239
|
-
if (response && response.success) {
|
|
240
|
-
this.sessions.set([]);
|
|
241
|
-
this.isCacheValid.set(false);
|
|
242
|
-
SnackbarUtils.success('Chat history cleared');
|
|
243
|
-
}
|
|
244
|
-
}),
|
|
245
|
-
catchError((err) => {
|
|
246
|
-
SnackbarUtils.error('Failed to clear history');
|
|
247
|
-
logger.error('ChatHistoryService: Failed to clear history', err);
|
|
248
|
-
throw err;
|
|
249
|
-
}),
|
|
250
|
-
map(() => {
|
|
251
|
-
this.isLoading.set(false);
|
|
252
|
-
}),
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Update session title
|
|
258
|
-
*/
|
|
259
|
-
updateSessionTitle(sessionId: string, newTitle: string, userId: string): Observable<boolean> {
|
|
260
|
-
this.processingSessionId.set(sessionId);
|
|
261
|
-
return this.chatApiService.updateChatTitle(sessionId, newTitle).pipe(
|
|
262
|
-
map((response) => {
|
|
263
|
-
const success = !!(response && response.success);
|
|
264
|
-
if (success) {
|
|
265
|
-
this.sessions.update((prev) =>
|
|
266
|
-
prev.map((s) => (s.id === sessionId ? { ...s, title: newTitle } : s)),
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
this.processingSessionId.set(null);
|
|
270
|
-
SnackbarUtils.success('Title updated successfully');
|
|
271
|
-
return success;
|
|
272
|
-
}),
|
|
273
|
-
catchError((err) => {
|
|
274
|
-
SnackbarUtils.error('Failed to update title');
|
|
275
|
-
logger.error('ChatHistoryService: Failed to update title', err);
|
|
276
|
-
this.processingSessionId.set(null);
|
|
277
|
-
return of(false);
|
|
278
|
-
}),
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Invalidate cache
|
|
284
|
-
*/
|
|
285
|
-
invalidateCache(): void {
|
|
286
|
-
this.isCacheValid.set(false);
|
|
287
|
-
this.historyOffset.set(0);
|
|
288
|
-
this.hasMore.set(true);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Clear all history state
|
|
293
|
-
*/
|
|
294
|
-
clearState(): void {
|
|
295
|
-
this.sessions.set([]);
|
|
296
|
-
this.isLoading.set(false);
|
|
297
|
-
this.isLoadingMore.set(false);
|
|
298
|
-
this.hasMore.set(true);
|
|
299
|
-
this.historyOffset.set(0);
|
|
300
|
-
this.isCacheValid.set(false);
|
|
301
|
-
this.processingSessionId.set(null);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<form
|
|
2
|
-
class="login-form-container"
|
|
3
|
-
(ngSubmit)="onLoginSubmit()"
|
|
4
|
-
autocomplete="on"
|
|
5
|
-
#loginForm="ngForm"
|
|
6
|
-
>
|
|
7
|
-
<h3 class="login-title">Login to Doohbot</h3>
|
|
8
|
-
|
|
9
|
-
<div class="login-fields">
|
|
10
|
-
<!-- Username Field -->
|
|
11
|
-
<div class="input-group">
|
|
12
|
-
<label class="input-label">Username</label>
|
|
13
|
-
<input
|
|
14
|
-
type="text"
|
|
15
|
-
name="username"
|
|
16
|
-
[(ngModel)]="loginUsername"
|
|
17
|
-
#username="ngModel"
|
|
18
|
-
placeholder="Enter your username"
|
|
19
|
-
class="login-input"
|
|
20
|
-
required
|
|
21
|
-
autocomplete="username"
|
|
22
|
-
/>
|
|
23
|
-
@if (username.invalid && (username.dirty || username.touched)) {
|
|
24
|
-
<span class="error-text"> Username is required </span>
|
|
25
|
-
}
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<!-- Password Field -->
|
|
29
|
-
<div class="input-group">
|
|
30
|
-
<label class="input-label">Password</label>
|
|
31
|
-
<div class="password-wrapper">
|
|
32
|
-
<input
|
|
33
|
-
[type]="showPassword ? 'text' : 'password'"
|
|
34
|
-
name="password"
|
|
35
|
-
[(ngModel)]="loginPassword"
|
|
36
|
-
#password="ngModel"
|
|
37
|
-
placeholder="Enter your password"
|
|
38
|
-
class="login-input password-input"
|
|
39
|
-
required
|
|
40
|
-
autocomplete="current-password"
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
<button
|
|
44
|
-
type="button"
|
|
45
|
-
class="password-toggle-btn"
|
|
46
|
-
(click)="togglePasswordVisibility()"
|
|
47
|
-
tabindex="-1"
|
|
48
|
-
>
|
|
49
|
-
<mat-icon>
|
|
50
|
-
{{ showPassword ? 'visibility' : 'visibility_off' }}
|
|
51
|
-
</mat-icon>
|
|
52
|
-
</button>
|
|
53
|
-
</div>
|
|
54
|
-
@if (password.invalid && (password.dirty || password.touched)) {
|
|
55
|
-
<span class="error-text"> Password is required </span>
|
|
56
|
-
}
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<!-- Remember Me -->
|
|
60
|
-
<div class="remember-me-container">
|
|
61
|
-
<label class="remember-me-label">
|
|
62
|
-
<input
|
|
63
|
-
type="checkbox"
|
|
64
|
-
name="rememberMe"
|
|
65
|
-
[(ngModel)]="rememberMe"
|
|
66
|
-
class="remember-me-checkbox"
|
|
67
|
-
/>
|
|
68
|
-
<span class="remember-me-text">Remember me</span>
|
|
69
|
-
</label>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div class="login-actions">
|
|
74
|
-
<button type="button" (click)="onCancel()" class="auth-btn secondary">Cancel</button>
|
|
75
|
-
|
|
76
|
-
<button type="submit" class="auth-btn primary" [disabled]="loginForm.invalid || isLoggingIn">
|
|
77
|
-
{{ isLoggingIn ? 'Logging in...' : 'Login' }}
|
|
78
|
-
</button>
|
|
79
|
-
</div>
|
|
80
|
-
</form>
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
.login-form-container {
|
|
2
|
-
padding: 30px;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
gap: 20px;
|
|
6
|
-
height: 100%;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
margin: 0 auto; // Center horizontally
|
|
10
|
-
box-sizing: border-box; // Include padding/border in width/height
|
|
11
|
-
max-width: 400px; // Set a maximum width
|
|
12
|
-
width: 100%; // Full width up to max-width
|
|
13
|
-
animation: fadeIn 0.3s ease-in-out;
|
|
14
|
-
|
|
15
|
-
.login-title {
|
|
16
|
-
text-align: center;
|
|
17
|
-
margin: 0 0 10px 0;
|
|
18
|
-
font-size: 1.5em;
|
|
19
|
-
color: var(--text-color);
|
|
20
|
-
font-family: var(--font-family);
|
|
21
|
-
font-weight: 600;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.login-fields {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: 15px;
|
|
28
|
-
width: 100%;
|
|
29
|
-
|
|
30
|
-
.login-input {
|
|
31
|
-
padding: 10px 12px;
|
|
32
|
-
border-radius: 8px;
|
|
33
|
-
border: 1px solid var(--border-color);
|
|
34
|
-
font-size: 0.9em;
|
|
35
|
-
background: var(--background-color);
|
|
36
|
-
color: var(--text-color);
|
|
37
|
-
width: 100%; // Full width
|
|
38
|
-
box-sizing: border-box; // Ensure padding doesn’t increase total width
|
|
39
|
-
|
|
40
|
-
&:focus {
|
|
41
|
-
outline: none;
|
|
42
|
-
background-color: var(--background-color);
|
|
43
|
-
border-color: var(--primary-color);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.password-wrapper {
|
|
48
|
-
position: relative;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
|
|
52
|
-
.login-input {
|
|
53
|
-
width: 100%;
|
|
54
|
-
padding-right: 40px; // Space for toggle icon
|
|
55
|
-
box-sizing: border-box; // Ensure padding doesn’t increase total width
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.password-toggle-btn {
|
|
59
|
-
position: absolute;
|
|
60
|
-
right: 8px;
|
|
61
|
-
background: transparent;
|
|
62
|
-
border: none;
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
padding: 4px;
|
|
68
|
-
color: var(--text-color);
|
|
69
|
-
opacity: 0.6;
|
|
70
|
-
transition: opacity 0.2s;
|
|
71
|
-
|
|
72
|
-
&:hover {
|
|
73
|
-
opacity: 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
mat-icon {
|
|
77
|
-
font-size: 20px;
|
|
78
|
-
width: 20px;
|
|
79
|
-
height: 20px;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.remember-me-container {
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
margin-top: -5px;
|
|
88
|
-
user-select: none;
|
|
89
|
-
|
|
90
|
-
.remember-me-label {
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
gap: 8px;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
padding: 4px 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.remember-me-checkbox {
|
|
99
|
-
width: 14px;
|
|
100
|
-
height: 14px;
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
accent-color: var(--primary-color);
|
|
103
|
-
margin: 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.remember-me-text {
|
|
107
|
-
font-size: 0.8em;
|
|
108
|
-
color: var(--text-color);
|
|
109
|
-
font-family: var(--font-family);
|
|
110
|
-
font-weight: 300;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.login-actions {
|
|
116
|
-
display: flex;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
gap: 10px;
|
|
119
|
-
margin-top: 10px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.input-group {
|
|
123
|
-
display: flex;
|
|
124
|
-
flex-direction: column;
|
|
125
|
-
gap: 6px; // space between label and input
|
|
126
|
-
text-align: left;
|
|
127
|
-
width: 100%;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.input-label {
|
|
131
|
-
font-size: 0.85em;
|
|
132
|
-
color: var(--text-color);
|
|
133
|
-
font-family: var(--font-family);
|
|
134
|
-
font-weight: 500;
|
|
135
|
-
margin-left: 2px;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.error-text {
|
|
139
|
-
font-size: 0.6em;
|
|
140
|
-
color: var(--red);
|
|
141
|
-
margin-top: 2px;
|
|
142
|
-
margin-left: 2px;
|
|
143
|
-
font-family: var(--font-family);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.auth-btn {
|
|
148
|
-
padding: 8px 18px;
|
|
149
|
-
border-radius: 20px;
|
|
150
|
-
cursor: pointer;
|
|
151
|
-
font-size: 0.9em;
|
|
152
|
-
font-weight: 500;
|
|
153
|
-
transition: all 0.2s ease;
|
|
154
|
-
|
|
155
|
-
&.primary {
|
|
156
|
-
background: var(--primary-color);
|
|
157
|
-
color: var(--white);
|
|
158
|
-
border: 1px solid var(--primary-color);
|
|
159
|
-
|
|
160
|
-
&:hover {
|
|
161
|
-
opacity: 0.9;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&:disabled {
|
|
165
|
-
opacity: 0.5;
|
|
166
|
-
cursor: not-allowed;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&.secondary {
|
|
171
|
-
background: transparent;
|
|
172
|
-
color: var(--text-alt-color);
|
|
173
|
-
border: 1px solid var(--primary-color);
|
|
174
|
-
|
|
175
|
-
&:hover {
|
|
176
|
-
opacity: 0.9;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@keyframes fadeIn {
|
|
182
|
-
from {
|
|
183
|
-
opacity: 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
to {
|
|
187
|
-
opacity: 1;
|
|
188
|
-
}
|
|
189
|
-
}
|