@aakash58/chatbot 1.1.16 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/esm2022/aakash58-chatbot.mjs +5 -0
  2. package/esm2022/lib/app/chat/chat-ui-state.service.mjs +170 -0
  3. package/esm2022/lib/app/chat/chat.service.mjs +445 -0
  4. package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +50 -0
  5. package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +12 -0
  6. package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +66 -0
  7. package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +186 -0
  8. package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +312 -0
  9. package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +36 -0
  10. package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +115 -0
  11. package/esm2022/lib/app/chat/model/chat-history.model.mjs +2 -0
  12. package/esm2022/lib/app/chat/model/chat-request.model.mjs +2 -0
  13. package/esm2022/lib/app/chat/model/chat-response.model.mjs +2 -0
  14. package/esm2022/lib/app/chat/model/chat-session.model.mjs +2 -0
  15. package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +2 -0
  16. package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +2 -0
  17. package/esm2022/lib/app/chat/services/chat-api.service.mjs +61 -0
  18. package/esm2022/lib/app/chat/services/chat-audio.service.mjs +50 -0
  19. package/esm2022/lib/app/chat/services/chat-history.service.mjs +252 -0
  20. package/esm2022/lib/app/login/login-form.component.mjs +46 -0
  21. package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +194 -0
  22. package/esm2022/lib/app/personalization/personalization.service.mjs +149 -0
  23. package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +122 -0
  24. package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +86 -0
  25. package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +115 -0
  26. package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +29 -0
  27. package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +30 -0
  28. package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +12 -0
  29. package/esm2022/lib/constant/doohbot-constant.mjs +28 -0
  30. package/esm2022/lib/constant/html-entities.mjs +9 -0
  31. package/esm2022/lib/constant/utf8.mjs +10 -0
  32. package/esm2022/lib/core/app-const.mjs +61 -0
  33. package/esm2022/lib/core/auth/account-api.service.mjs +40 -0
  34. package/esm2022/lib/core/auth/auth.service.mjs +391 -0
  35. package/esm2022/lib/core/auth/models/auth-result.model.mjs +3 -0
  36. package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +6 -0
  37. package/esm2022/lib/core/auth/models/login-request.model.mjs +6 -0
  38. package/esm2022/lib/core/auth/storage.service.mjs +110 -0
  39. package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +112 -0
  40. package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +55 -0
  41. package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +179 -0
  42. package/esm2022/lib/core/environments/environment.mjs +15 -0
  43. package/esm2022/lib/core/environments/environment.prod.mjs +15 -0
  44. package/esm2022/lib/core/helpers/crypto-helper.service.mjs +52 -0
  45. package/esm2022/lib/core/http/http-stream.service.mjs +97 -0
  46. package/esm2022/lib/core/http/http.service.mjs +103 -0
  47. package/esm2022/lib/core/interceptors/auth.interceptor.mjs +96 -0
  48. package/esm2022/lib/core/interceptors/license.interceptor.mjs +44 -0
  49. package/esm2022/lib/core/models/api-config.model.mjs +18 -0
  50. package/esm2022/lib/core/models/api-request.model.mjs +2 -0
  51. package/esm2022/lib/core/models/api-response.model.mjs +8 -0
  52. package/esm2022/lib/core/models/doohbot-config.model.mjs +18 -0
  53. package/esm2022/lib/core/models/license.model.mjs +2 -0
  54. package/esm2022/lib/core/models/message.mjs +2 -0
  55. package/esm2022/lib/core/models/theme-config.model.mjs +2 -0
  56. package/esm2022/lib/core/services/core-config.service.mjs +52 -0
  57. package/esm2022/lib/core/services/license.service.mjs +145 -0
  58. package/esm2022/lib/core/services/markdown.service.mjs +64 -0
  59. package/esm2022/lib/core/services/theme.service.mjs +248 -0
  60. package/esm2022/lib/core/types/auth-mode.type.mjs +2 -0
  61. package/esm2022/lib/core/types/auth-status.type.mjs +5 -0
  62. package/esm2022/lib/core/types/chat-stream.type.mjs +2 -0
  63. package/esm2022/lib/core/types/message-role.type.mjs +2 -0
  64. package/esm2022/lib/core/types/prompt-mode.type.mjs +5 -0
  65. package/esm2022/lib/core/types/snackbar-error.type.mjs +5 -0
  66. package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +2 -0
  67. package/esm2022/lib/core/utils/logger.service.mjs +42 -0
  68. package/esm2022/lib/doohbot-input.mjs +20 -0
  69. package/esm2022/lib/doohbot.component.mjs +444 -0
  70. package/esm2022/lib/predefined_messages.mjs +15 -0
  71. package/esm2022/lib/shared/chips/chips.component.mjs +28 -0
  72. package/esm2022/lib/shared/dialog/dialog.component.mjs +36 -0
  73. package/esm2022/lib/shared/dialog/dialog.service.mjs +64 -0
  74. package/esm2022/lib/shared/dialog/dialog.utils.mjs +85 -0
  75. package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +29 -0
  76. package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +38 -0
  77. package/esm2022/lib/shared/menu-item/menu-item.component.mjs +24 -0
  78. package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +27 -0
  79. package/esm2022/lib/shared/snackbar/snackbar.component.mjs +43 -0
  80. package/esm2022/lib/shared/snackbar/snackbar.service.mjs +46 -0
  81. package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +43 -0
  82. package/esm2022/public-api.mjs +37 -0
  83. package/fesm2022/aakash58-chatbot.mjs +1037 -827
  84. package/fesm2022/aakash58-chatbot.mjs.map +1 -1
  85. package/index.d.ts +3 -373
  86. package/lib/app/chat/chat-ui-state.service.d.ts +96 -0
  87. package/lib/app/chat/chat.service.d.ts +88 -0
  88. package/lib/app/chat/components/chat-button/chat-button.component.d.ts +16 -0
  89. package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +5 -0
  90. package/lib/app/chat/components/chat-header/chat-header.component.d.ts +24 -0
  91. package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +49 -0
  92. package/lib/app/chat/components/chat-window/chat-window.component.d.ts +107 -0
  93. package/lib/app/chat/components/message-input/message-input.component.d.ts +12 -0
  94. package/lib/app/chat/components/message-list/message-list.component.d.ts +40 -0
  95. package/lib/app/chat/model/chat-history.model.d.ts +51 -0
  96. package/lib/app/chat/model/chat-request.model.d.ts +10 -0
  97. package/lib/app/chat/model/chat-response.model.d.ts +9 -0
  98. package/lib/app/chat/model/chat-session.model.d.ts +12 -0
  99. package/lib/app/chat/model/chat-stream-message.model.d.ts +5 -0
  100. package/lib/app/chat/model/chat-stream-response.model.d.ts +10 -0
  101. package/lib/app/chat/services/chat-api.service.d.ts +30 -0
  102. package/lib/app/chat/services/chat-audio.service.d.ts +19 -0
  103. package/lib/app/chat/services/chat-history.service.d.ts +53 -0
  104. package/lib/app/login/login-form.component.d.ts +20 -0
  105. package/lib/app/personalization/personalization-dialog.component.d.ts +53 -0
  106. package/lib/app/personalization/personalization.service.d.ts +66 -0
  107. package/lib/app/personalization/sections/account/account-section.component.d.ts +30 -0
  108. package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +17 -0
  109. package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +27 -0
  110. package/lib/app/personalization/sections/profile/profile-section.component.d.ts +17 -0
  111. package/lib/app/personalization/sections/settings/setting-section.component.d.ts +10 -0
  112. package/lib/app/personalization/sections/terms/terms-section.component.d.ts +5 -0
  113. package/lib/constant/doohbot-constant.d.ts +12 -0
  114. package/lib/constant/html-entities.d.ts +8 -0
  115. package/lib/constant/utf8.d.ts +9 -0
  116. package/lib/core/app-const.d.ts +11 -0
  117. package/lib/core/auth/account-api.service.d.ts +20 -0
  118. package/lib/core/auth/auth.service.d.ts +90 -0
  119. package/lib/core/auth/models/auth-result.model.d.ts +4 -0
  120. package/lib/core/auth/models/federated-login-request.model.d.ts +5 -0
  121. package/lib/core/auth/models/login-request.model.d.ts +6 -0
  122. package/lib/core/auth/storage.service.d.ts +21 -0
  123. package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +23 -0
  124. package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +14 -0
  125. package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +30 -0
  126. package/lib/core/environments/environment.d.ts +7 -0
  127. package/lib/core/environments/environment.prod.d.ts +7 -0
  128. package/lib/core/helpers/crypto-helper.service.d.ts +12 -0
  129. package/lib/core/http/http-stream.service.d.ts +18 -0
  130. package/lib/core/http/http.service.d.ts +20 -0
  131. package/lib/core/interceptors/auth.interceptor.d.ts +18 -0
  132. package/lib/core/interceptors/license.interceptor.d.ts +11 -0
  133. package/lib/core/models/api-config.model.d.ts +58 -0
  134. package/lib/core/models/api-request.model.d.ts +77 -0
  135. package/lib/core/models/api-response.model.d.ts +6 -0
  136. package/lib/core/models/doohbot-config.model.d.ts +81 -0
  137. package/lib/core/models/license.model.d.ts +23 -0
  138. package/lib/core/models/message.d.ts +16 -0
  139. package/lib/core/models/theme-config.model.d.ts +28 -0
  140. package/lib/core/services/core-config.service.d.ts +23 -0
  141. package/lib/core/services/license.service.d.ts +33 -0
  142. package/lib/core/services/markdown.service.d.ts +8 -0
  143. package/lib/core/services/theme.service.d.ts +40 -0
  144. package/lib/core/types/auth-mode.type.d.ts +4 -0
  145. package/lib/core/types/auth-status.type.d.ts +4 -0
  146. package/lib/core/types/chat-stream.type.d.ts +4 -0
  147. package/lib/core/types/message-role.type.d.ts +4 -0
  148. package/lib/core/types/prompt-mode.type.d.ts +4 -0
  149. package/lib/core/types/snackbar-error.type.d.ts +4 -0
  150. package/lib/core/types/tenant-resolution-strategy.type.d.ts +4 -0
  151. package/lib/core/utils/logger.service.d.ts +11 -0
  152. package/lib/doohbot-input.d.ts +19 -0
  153. package/lib/doohbot.component.d.ts +108 -0
  154. package/lib/predefined_messages.d.ts +2 -0
  155. package/lib/shared/chips/chips.component.d.ts +10 -0
  156. package/lib/shared/dialog/dialog.component.d.ts +19 -0
  157. package/lib/shared/dialog/dialog.service.d.ts +29 -0
  158. package/lib/shared/dialog/dialog.utils.d.ts +41 -0
  159. package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +11 -0
  160. package/lib/shared/input-dialog/input-dialog.component.d.ts +20 -0
  161. package/lib/shared/menu-item/menu-item.component.d.ts +9 -0
  162. package/lib/shared/pipes/simple-markdown.pipe.d.ts +10 -0
  163. package/lib/shared/snackbar/snackbar.component.d.ts +14 -0
  164. package/lib/shared/snackbar/snackbar.service.d.ts +19 -0
  165. package/lib/shared/snackbar/snackbar.utils.d.ts +33 -0
  166. package/package.json +4 -2
  167. package/public-api.d.ts +11 -0
package/index.d.ts CHANGED
@@ -1,375 +1,5 @@
1
- import * as _angular_core from '@angular/core';
2
- import { InjectionToken, ElementRef, Renderer2, OnInit, OnDestroy, SimpleChanges, EventEmitter, AfterContentInit, QueryList, EnvironmentProviders } from '@angular/core';
3
- import { MatDialogRef, MatDialog } from '@angular/material/dialog';
4
- import { Observable } from 'rxjs';
5
-
6
1
  /**
7
- * Message role types for chat messages
2
+ * Generated bundle index. Do not edit.
8
3
  */
9
- type MessageRole = 'user' | 'assistant';
10
-
11
- interface Message {
12
- id: string;
13
- sender: MessageRole;
14
- senderName?: string;
15
- text: string;
16
- chunks?: string[];
17
- timestamp?: Date;
18
- showSuggestions?: boolean;
19
- platformTenant?: string;
20
- subTenant?: string;
21
- agent?: string;
22
- completed: boolean | true;
23
- isHistory: boolean | true;
24
- copied?: boolean;
25
- }
26
-
27
- declare class LoginRequest {
28
- username: string;
29
- password: string;
30
- rememberMe?: boolean;
31
- license?: string;
32
- }
33
-
34
- declare class DoohbotInput {
35
- username: string;
36
- password: string;
37
- rememberMe?: boolean;
38
- authToken?: string;
39
- license?: string;
40
- licenseCode?: string;
41
- licenseKey?: string;
42
- licenseFilePath?: string;
43
- apiBaseUrl?: string;
44
- apiSegment?: string;
45
- tenancyName?: string;
46
- storageKey?: string;
47
- secretKey?: string;
48
- companyCode?: string;
49
- buttonStyle?: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
50
- }
51
-
52
- /**
53
- * Configuration for Doohbot API integration
54
- */
55
- interface DoohbotApiConfig {
56
- /**
57
- * Backend API endpoint URL
58
- * Example: 'https://api.example.com/chat'
59
- */
60
- apiUrl: string;
61
- /**
62
- * Optional API key for authentication
63
- */
64
- apiKey?: string;
65
- /**
66
- * Request timeout in milliseconds
67
- * @default 30000 (30 seconds)
68
- */
69
- timeout?: number;
70
- /**
71
- * Enable API mode (true) or use local intent matching (false)
72
- * @default false
73
- */
74
- enableApi?: boolean;
75
- /**
76
- * Include message history in API requests
77
- * @default false
78
- */
79
- includeHistory?: boolean;
80
- /**
81
- * Maximum number of history messages to include in requests
82
- * @default 10
83
- */
84
- maxHistoryMessages?: number;
85
- /**
86
- * Custom headers to include in API requests
87
- */
88
- customHeaders?: Record<string, string>;
89
- /**
90
- * Enable retry on failure
91
- * @default true
92
- */
93
- enableRetry?: boolean;
94
- /**
95
- * Number of retry attempts
96
- * @default 2
97
- */
98
- retryAttempts?: number;
99
- /**
100
- * Delay between retries in milliseconds
101
- * @default 1000
102
- */
103
- retryDelay?: number;
104
- }
105
- /**
106
- * Injection token for providing Doohbot API configuration
107
- */
108
- declare const DOOHBOT_API_CONFIG: InjectionToken<DoohbotApiConfig>;
109
-
110
- interface DoohbotThemeConfig {
111
- fontFamily?: string;
112
- primaryColor?: string;
113
- secondaryColor?: string;
114
- backgroundColor?: string;
115
- chatInputColor?: string;
116
- textAltColor?: string;
117
- textColor?: string;
118
- secondaryTextColor?: string;
119
- hintTextColor?: string;
120
- buttonColor?: string;
121
- userMessageColor?: string;
122
- botMessageColor?: string;
123
- userTextColor?: string;
124
- botTextColor?: string;
125
- borderColor?: string;
126
- borderShadowColor?: string;
127
- borderTopColor?: string;
128
- typingIndicatorColor?: string;
129
- white?: string;
130
- black?: string;
131
- grey?: string;
132
- red?: string;
133
- yellow?: string;
134
- orange?: string;
135
- green?: string;
136
- blue?: string;
137
- }
138
-
139
- declare class FullscreenDirective {
140
- private el;
141
- private renderer;
142
- private isFullScreen;
143
- private preFullscreenState;
144
- fullscreenTarget: string;
145
- constructor(el: ElementRef, renderer: Renderer2);
146
- toggle(): void;
147
- getFullscreenState(): boolean;
148
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<FullscreenDirective, never>;
149
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FullscreenDirective, "[appFullscreen]", never, { "fullscreenTarget": { "alias": "fullscreenTarget"; "required": false; }; }, {}, never, never, true, never>;
150
- }
151
-
152
- interface ChatSession {
153
- id: string;
154
- timestamp: Date;
155
- title: string;
156
- messages: Message[];
157
- userId: string;
158
- }
159
-
160
- /**
161
- * Authentication status
162
- */
163
- type AuthStatus = 'authenticated' | 'unauthenticated' | 'expired';
164
-
165
- declare class Doohbot extends DoohbotInput implements OnInit, OnDestroy {
166
- private elementRef;
167
- private renderer;
168
- config: DoohbotInput;
169
- buttonStyle?: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
170
- enableDrag: boolean;
171
- enableResize: boolean;
172
- apiConfig?: DoohbotApiConfig;
173
- themeConfig: DoohbotThemeConfig | undefined;
174
- private chatHistory;
175
- private uiState;
176
- private themeService;
177
- private authService;
178
- private chatService;
179
- private dialogService;
180
- private snackbarService;
181
- private personalization;
182
- private licenseService;
183
- isChatOpen: _angular_core.WritableSignal<boolean>;
184
- isHistorySidebarOpen: _angular_core.WritableSignal<boolean>;
185
- isFullScreen: _angular_core.WritableSignal<boolean>;
186
- unreadCount: _angular_core.Signal<number>;
187
- messages: _angular_core.WritableSignal<Message[]>;
188
- isBotTyping: _angular_core.WritableSignal<boolean>;
189
- isStreaming: _angular_core.WritableSignal<boolean>;
190
- messageError: _angular_core.Signal<string | null>;
191
- showSuggestionChips: _angular_core.Signal<boolean>;
192
- chatSessions: _angular_core.WritableSignal<ChatSession[]>;
193
- hasMoreHistory: _angular_core.WritableSignal<boolean>;
194
- isLoadingMore: _angular_core.WritableSignal<boolean>;
195
- isLoadingSessions: _angular_core.WritableSignal<boolean>;
196
- processingSessionId: _angular_core.WritableSignal<string | null>;
197
- isLoggingIn: _angular_core.WritableSignal<boolean>;
198
- authError: _angular_core.WritableSignal<string | null>;
199
- authSuccess: _angular_core.WritableSignal<string | null>;
200
- activeButtonStyle: _angular_core.Signal<"fab" | "sidebar" | "sidebar-top" | "sidebar-bottom">;
201
- userName: string;
202
- predefinedMessages: string[];
203
- suggestedMessages: string[];
204
- maxMessageLength: number;
205
- readonly DoohbotConst: {
206
- appTitle: string;
207
- appSubtitle: string;
208
- welcomeDescription: string;
209
- hintText: string;
210
- errorMessage: string;
211
- appLogo: string;
212
- appTextLogo: string;
213
- appHeaderLogo: string;
214
- userAvatar: string;
215
- botAvatar: string;
216
- };
217
- private contextCleanup?;
218
- authStatus: _angular_core.WritableSignal<AuthStatus>;
219
- isAuthenticated: _angular_core.WritableSignal<boolean>;
220
- chatWindowRef: ElementRef;
221
- fullscreenDirective: FullscreenDirective;
222
- constructor(elementRef: ElementRef, renderer: Renderer2);
223
- ngOnInit(): Promise<void>;
224
- private canAttemptFederatedLogin;
225
- private initializeUI;
226
- ngOnChanges(changes: SimpleChanges): void;
227
- onNormalLogin(credentials: LoginRequest): void;
228
- onFederatedLogin(token?: string): Promise<void>;
229
- performLogout(): void;
230
- toggleChat(): void;
231
- sendMessage(text: string): Promise<void>;
232
- onStopRequest(): void;
233
- clearChat(): void;
234
- clearMessageError(): void;
235
- toggleHistorySidebar(): void;
236
- loadChatSession(session: ChatSession): void;
237
- deleteSession(sessionId: string): void;
238
- deleteAllSessions(): void;
239
- renameSession(event: {
240
- sessionId: string;
241
- newTitle: string;
242
- }): void;
243
- private loadUserSessions;
244
- /**
245
- * Load more sessions for infinite scroll
246
- */
247
- loadMoreHistory(): void;
248
- /**
249
- * Manually refresh history
250
- */
251
- refreshHistory(): void;
252
- toggleFullScreen(): void;
253
- trackByMessageId(index: number, item: any): string;
254
- /**
255
- * Resolve and update the username from all available sources
256
- */
257
- private updateUserName;
258
- userAvatarUrl(): string;
259
- ngOnDestroy(): void;
260
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<Doohbot, never>;
261
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<Doohbot, "app-doohbot", never, { "config": { "alias": "config"; "required": false; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; "enableResize": { "alias": "enableResize"; "required": false; }; "apiConfig": { "alias": "apiConfig"; "required": false; }; "themeConfig": { "alias": "themeConfig"; "required": false; }; }, {}, never, never, true, never>;
262
- }
263
-
264
- declare const DoohbotConst: {
265
- appTitle: string;
266
- appSubtitle: string;
267
- welcomeDescription: string;
268
- hintText: string;
269
- errorMessage: string;
270
- appLogo: string;
271
- appTextLogo: string;
272
- appHeaderLogo: string;
273
- userAvatar: string;
274
- botAvatar: string;
275
- };
276
-
277
- interface DialogData {
278
- title: string;
279
- message: string;
280
- confirmText?: string;
281
- cancelText?: string;
282
- confirmButtonColor?: 'primary' | 'accent' | 'warn';
283
- icon?: string;
284
- }
285
- declare class DialogComponent {
286
- dialogRef: MatDialogRef<DialogComponent>;
287
- data: DialogData;
288
- constructor(dialogRef: MatDialogRef<DialogComponent>, data: DialogData);
289
- onCancel(): void;
290
- onConfirm(): void;
291
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogComponent, never>;
292
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DialogComponent, "app-dialog", never, {}, {}, never, never, true, never>;
293
- }
294
-
295
- interface InputDialogData {
296
- title: string;
297
- message: string;
298
- initialValue: string;
299
- placeholder?: string;
300
- confirmText?: string;
301
- cancelText?: string;
302
- }
303
-
304
- declare class DialogService {
305
- private dialog;
306
- constructor(dialog: MatDialog);
307
- /**
308
- * Opens a confirmation dialog with customizable options
309
- * @param data Configuration for the dialog
310
- * @returns Observable that emits true if confirmed, false if cancelled
311
- */
312
- open(data: DialogData): Observable<boolean>;
313
- /**
314
- * Convenience method for delete confirmation dialogs
315
- * @param itemName Name of the item being deleted
316
- * @returns Observable that emits true if confirmed, false if cancelled
317
- */
318
- confirmDelete(itemName?: string): Observable<boolean>;
319
- /**
320
- * Opens a dialog with an input field
321
- * @param data Configuration for the input dialog
322
- * @returns Observable that emits the input value if confirmed, null if cancelled
323
- */
324
- openInput(data: InputDialogData): Observable<string | null>;
325
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogService, never>;
326
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogService>;
327
- }
328
-
329
- declare class Chips {
330
- messages: string[];
331
- disabled: boolean;
332
- chipClick: EventEmitter<string>;
333
- onChipClick(msg: string): void;
334
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<Chips, never>;
335
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<Chips, "app-chips", never, { "messages": { "alias": "messages"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "chipClick": "chipClick"; }, never, never, true, never>;
336
- }
337
-
338
- /**
339
- * Error types for snackbar
340
- */
341
- type SnackBarError = 'warn' | 'error' | 'success' | 'info';
342
-
343
- declare class SnackBar implements OnInit {
344
- private snackBarRef;
345
- private data;
346
- message: string | null;
347
- type: SnackBarError;
348
- ngOnInit(): void;
349
- close(): void;
350
- get icon(): string;
351
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SnackBar, never>;
352
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnackBar, "app-snackbar", never, {}, {}, never, never, true, never>;
353
- }
354
-
355
- declare class MenuItem {
356
- href: string;
357
- selected: EventEmitter<void>;
358
- onClick(event: Event): void;
359
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItem, never>;
360
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuItem, "app-menu-item", never, { "href": { "alias": "href"; "required": false; }; }, { "selected": "selected"; }, never, ["*"], true, never>;
361
- }
362
-
363
- declare class DropdownMenu implements AfterContentInit {
364
- detailsRef: ElementRef<HTMLDetailsElement>;
365
- menuItems: QueryList<MenuItem>;
366
- ngAfterContentInit(): void;
367
- close(): void;
368
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownMenu, never>;
369
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownMenu, "app-dropdown-menu", never, {}, {}, ["menuItems"], ["[trigger]", "*"], true, never>;
370
- }
371
-
372
- declare function provideDoohbot(): EnvironmentProviders;
373
-
374
- export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotConst, DoohbotInput, DropdownMenu, MenuItem, SnackBar, provideDoohbot };
375
- export type { DialogData, DoohbotApiConfig, DoohbotThemeConfig };
4
+ /// <amd-module name="@aakash58/chatbot" />
5
+ export * from './public-api';
@@ -0,0 +1,96 @@
1
+ import { Signal } from '@angular/core';
2
+ import { Message } from '../../core/models/message';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * ChatUIStateService - Centralized UI state management
6
+ *
7
+ * Manages all UI-related state for the chat component including:
8
+ * - Chat window open/close state
9
+ * - History sidebar visibility
10
+ * - Unread message tracking
11
+ * - Fullscreen state
12
+ *
13
+ * This service uses Angular signals for reactive state management,
14
+ * allowing components to subscribe to state changes efficiently.
15
+ */
16
+ export declare class ChatUIStateService {
17
+ /**
18
+ * Whether the chat window is currently open
19
+ */
20
+ isChatOpen: import("@angular/core").WritableSignal<boolean>;
21
+ /**
22
+ * Whether the history sidebar is currently open
23
+ */
24
+ isHistorySidebarOpen: import("@angular/core").WritableSignal<boolean>;
25
+ /**
26
+ * Whether the chat is in fullscreen mode
27
+ */
28
+ isFullScreen: import("@angular/core").WritableSignal<boolean>;
29
+ /**
30
+ * ID of the last message that was read by the user
31
+ */
32
+ private lastReadMessageId;
33
+ /**
34
+ * Reference to current messages (injected from outside)
35
+ */
36
+ private messagesSignal;
37
+ /**
38
+ * Computed number of unread bot messages
39
+ */
40
+ unreadCount: Signal<number>;
41
+ /**
42
+ * Effect to automatically mark messages as read when chat is opened
43
+ */
44
+ markAsReadEffect: import("@angular/core").EffectRef;
45
+ /**
46
+ * Set the messages signal reference from an external source
47
+ * This allows the UI state service to track messages from MessageService
48
+ */
49
+ setMessagesSignal(messagesSignal: Signal<Message[]>): void;
50
+ /**
51
+ * Toggle the chat window open/close state
52
+ */
53
+ toggleChat(): void;
54
+ /**
55
+ * Toggle the history sidebar open/close state
56
+ */
57
+ toggleHistorySidebar(): void;
58
+ /**
59
+ * Close the chat window
60
+ */
61
+ closeChat(): void;
62
+ /**
63
+ * Open the chat window
64
+ */
65
+ openChat(): void;
66
+ /**
67
+ * Close the history sidebar
68
+ */
69
+ closeHistorySidebar(): void;
70
+ /**
71
+ * Open the history sidebar
72
+ */
73
+ openHistorySidebar(): void;
74
+ /**
75
+ * Toggle fullscreen mode
76
+ */
77
+ toggleFullscreen(): void;
78
+ /**
79
+ * Set fullscreen state
80
+ */
81
+ setFullscreen(isFullscreen: boolean): void;
82
+ /**
83
+ * Manually mark messages as read up to a specific message ID
84
+ */
85
+ markMessagesAsRead(messageId: string): void;
86
+ /**
87
+ * Reset last read message ID
88
+ */
89
+ resetLastRead(): void;
90
+ /**
91
+ * Get the last read message ID
92
+ */
93
+ getLastReadMessageId(): string | null;
94
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatUIStateService, never>;
95
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatUIStateService>;
96
+ }
@@ -0,0 +1,88 @@
1
+ import { ChatSession } from './model/chat-session.model';
2
+ import { ChatApiError } from '../../core/models/api-request.model';
3
+ import { Message } from '../../core/models/message';
4
+ import { PromptMode } from '../../core/types/prompt-mode.type';
5
+ import { ChatStreamMessage } from './model/chat-stream-message.model';
6
+ import * as i0 from "@angular/core";
7
+ export declare class ChatService {
8
+ private apiService;
9
+ private authService;
10
+ private audioService;
11
+ private config;
12
+ private chatHistoryService;
13
+ private chatUIStateService;
14
+ private personalization;
15
+ private chatSessions;
16
+ messages: import("@angular/core").WritableSignal<Message[]>;
17
+ /**
18
+ * Determine if suggestion chips should be shown
19
+ */
20
+ showSuggestionChips: import("@angular/core").Signal<boolean>;
21
+ private activeSession;
22
+ isLoadingApi: import("@angular/core").WritableSignal<boolean>;
23
+ apiError: import("@angular/core").WritableSignal<ChatApiError | null>;
24
+ isBotTyping: import("@angular/core").WritableSignal<boolean>;
25
+ promptMode: import("@angular/core").WritableSignal<PromptMode>;
26
+ isStreaming: import("@angular/core").WritableSignal<boolean>;
27
+ messagesStream: Array<ChatStreamMessage>;
28
+ currentResponse: string;
29
+ private streamSubscription?;
30
+ private cancelSubject;
31
+ getFallbackReply(): string;
32
+ getFallbackError(): string;
33
+ constructor();
34
+ /**
35
+ * Generate a unique session ID
36
+ */
37
+ private generateSessionId;
38
+ /**
39
+ * Create a new chat session
40
+ */
41
+ createSession(userId: string): ChatSession;
42
+ /**
43
+ * Start a new chat session
44
+ */
45
+ startNewSession(): void;
46
+ /**
47
+ * Load an existing session
48
+ */
49
+ loadSession(session: ChatSession): void;
50
+ /**
51
+ * Get active session
52
+ */
53
+ getActiveSession(): ChatSession | null;
54
+ /**
55
+ * Clear messages for current session and start new one
56
+ */
57
+ clearMessages(): void;
58
+ /**
59
+ * Add message to current session
60
+ */
61
+ addMessage(message: Message): void;
62
+ /**
63
+ * Continue a chat session
64
+ */
65
+ continueSession(sessionId: string): void;
66
+ /**
67
+ * Process a user message: add it, get bot reply, and add bot reply
68
+ */
69
+ sendMessage(text: string, maxLength?: number): Promise<void>;
70
+ getBotReply(userText: string): Promise<string>;
71
+ /**
72
+ * Builds a chat request payload with the given user text and optional active session
73
+ * @param {string} userInput - The text provided by the user
74
+ * @returns {ChatRequest} - A chat request payload with the user text and optional active session
75
+ * @memberof ChatService
76
+ */
77
+ private buildChatRequest;
78
+ private ask;
79
+ private stream;
80
+ cancelRequest(): void;
81
+ unlockAudio(): void;
82
+ /**
83
+ * Map local placeholder session ID to backend-generated ID
84
+ */
85
+ private mapSessionId;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
87
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
88
+ }
@@ -0,0 +1,16 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ChatButtonComponent {
4
+ buttonStyle: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
5
+ isChatOpen: boolean;
6
+ unreadCount: number;
7
+ appTitle: string;
8
+ appLogoUrl: string;
9
+ appTextLogoUrl: string;
10
+ toggle: EventEmitter<void>;
11
+ get isSidebar(): boolean;
12
+ get sidebarPosition(): 'top' | 'center' | 'bottom';
13
+ onToggle(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatButtonComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatButtonComponent, "app-chat-button", never, { "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "isChatOpen": { "alias": "isChatOpen"; "required": false; }; "unreadCount": { "alias": "unreadCount"; "required": false; }; "appTitle": { "alias": "appTitle"; "required": false; }; "appLogoUrl": { "alias": "appLogoUrl"; "required": false; }; "appTextLogoUrl": { "alias": "appTextLogoUrl"; "required": false; }; }, { "toggle": "toggle"; }, never, never, true, never>;
16
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ChatFooterComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatFooterComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatFooterComponent, "app-chat-footer", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,24 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { ThemeService } from '../../../../core/services/theme.service';
3
+ import { ChatService } from '../../chat.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChatHeaderComponent {
6
+ appHeaderLogoUrl: string;
7
+ isAuthenticated: boolean;
8
+ isFullScreen: boolean;
9
+ settingsMenu: any;
10
+ isNewChatDisabled: boolean;
11
+ toggleChat: EventEmitter<void>;
12
+ toggleFullScreen: EventEmitter<void>;
13
+ toggleHistorySidebar: EventEmitter<void>;
14
+ clearChat: EventEmitter<void>;
15
+ themeService: ThemeService;
16
+ chatService: ChatService;
17
+ private uiState;
18
+ onToggleChat(): void;
19
+ onToggleHistorySidebar(): void;
20
+ onToggleFullScreen(): void;
21
+ onStartNewConversation(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatHeaderComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatHeaderComponent, "app-chat-header", never, { "appHeaderLogoUrl": { "alias": "appHeaderLogoUrl"; "required": false; }; "isAuthenticated": { "alias": "isAuthenticated"; "required": false; }; "isFullScreen": { "alias": "isFullScreen"; "required": false; }; "settingsMenu": { "alias": "settingsMenu"; "required": false; }; "isNewChatDisabled": { "alias": "isNewChatDisabled"; "required": false; }; }, { "toggleChat": "toggleChat"; "toggleFullScreen": "toggleFullScreen"; "toggleHistorySidebar": "toggleHistorySidebar"; "clearChat": "clearChat"; }, never, never, true, never>;
24
+ }
@@ -0,0 +1,49 @@
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { DialogService } from '../../../../shared/dialog/dialog.service';
3
+ import { ChatSession, ChatSessionGroup } from '../../model/chat-session.model';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChatHistorySidebarComponent implements OnInit, OnChanges {
6
+ private dialogService;
7
+ sessions: ChatSession[];
8
+ isOpen: boolean;
9
+ userName: string;
10
+ isLoading: boolean;
11
+ hasMoreSessions: boolean;
12
+ isLoadingMore: boolean;
13
+ processingSessionId: string | null;
14
+ sessionSelected: EventEmitter<ChatSession>;
15
+ sessionDeleted: EventEmitter<string>;
16
+ closed: EventEmitter<void>;
17
+ loadMore: EventEmitter<void>;
18
+ refresh: EventEmitter<void>;
19
+ sessionRenamed: EventEmitter<{
20
+ sessionId: string;
21
+ newTitle: string;
22
+ }>;
23
+ deleteAll: EventEmitter<void>;
24
+ chatHistory: ChatSessionGroup[];
25
+ constructor(dialogService: DialogService);
26
+ ngOnInit(): void;
27
+ ngOnChanges(changes: SimpleChanges): void;
28
+ groupedSessions(): ChatSessionGroup[];
29
+ onSessionClick(session: ChatSession): void;
30
+ onEditClick(event: Event, session: ChatSession): void;
31
+ onDeleteClick(event: Event, sessionId: string): void;
32
+ onClose(): void;
33
+ formatTime(date: Date): string;
34
+ formatDate(date: Date): string;
35
+ /**
36
+ * Handle scroll event for infinite scroll
37
+ */
38
+ onScroll(event: Event): void;
39
+ /**
40
+ * Handle manual refresh
41
+ */
42
+ onRefresh(): void;
43
+ /**
44
+ * Handle clear all history
45
+ */
46
+ onClearAllClick(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatHistorySidebarComponent, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatHistorySidebarComponent, "app-chat-history-sidebar", never, { "sessions": { "alias": "sessions"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "hasMoreSessions": { "alias": "hasMoreSessions"; "required": false; }; "isLoadingMore": { "alias": "isLoadingMore"; "required": false; }; "processingSessionId": { "alias": "processingSessionId"; "required": false; }; }, { "sessionSelected": "sessionSelected"; "sessionDeleted": "sessionDeleted"; "closed": "closed"; "loadMore": "loadMore"; "refresh": "refresh"; "sessionRenamed": "sessionRenamed"; "deleteAll": "deleteAll"; }, never, never, true, never>;
49
+ }