@burtson-labs/bandit-engine 2.0.8

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 (184) hide show
  1. package/LICENSE +43 -0
  2. package/README.md +1235 -0
  3. package/dist/aiProviderStore-YWJHSWFA.mjs +9 -0
  4. package/dist/aiProviderStore-YWJHSWFA.mjs.map +1 -0
  5. package/dist/chat-QXB526NZ.mjs +11 -0
  6. package/dist/chat-QXB526NZ.mjs.map +1 -0
  7. package/dist/chunk-AVC6IZJQ.mjs +2157 -0
  8. package/dist/chunk-AVC6IZJQ.mjs.map +1 -0
  9. package/dist/chunk-BIPELT57.mjs +24183 -0
  10. package/dist/chunk-BIPELT57.mjs.map +1 -0
  11. package/dist/chunk-BJTO5JO5.mjs +11 -0
  12. package/dist/chunk-BJTO5JO5.mjs.map +1 -0
  13. package/dist/chunk-IXIM7BNO.mjs +39 -0
  14. package/dist/chunk-IXIM7BNO.mjs.map +1 -0
  15. package/dist/chunk-KCI46M23.mjs +106 -0
  16. package/dist/chunk-KCI46M23.mjs.map +1 -0
  17. package/dist/chunk-WYS5CZVG.mjs +843 -0
  18. package/dist/chunk-WYS5CZVG.mjs.map +1 -0
  19. package/dist/cli/cli.js +1808 -0
  20. package/dist/cli/cli.js.map +1 -0
  21. package/dist/index.d.mts +1636 -0
  22. package/dist/index.d.ts +1636 -0
  23. package/dist/index.js +40601 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/index.mjs +12477 -0
  26. package/dist/index.mjs.map +1 -0
  27. package/dist/memoryUtils-33TZKHSQ.mjs +223 -0
  28. package/dist/memoryUtils-33TZKHSQ.mjs.map +1 -0
  29. package/dist/modelStore-Y3LZWRQC.mjs +9 -0
  30. package/dist/modelStore-Y3LZWRQC.mjs.map +1 -0
  31. package/dist/shared/custom-element.js +73 -0
  32. package/dist/shared/custom-element.js.map +1 -0
  33. package/dist/shared/custom-element.mjs +8 -0
  34. package/dist/shared/custom-element.mjs.map +1 -0
  35. package/docs/00_intro.md +26 -0
  36. package/docs/01_quickstart.md +54 -0
  37. package/docs/02_gateway_api.md +64 -0
  38. package/docs/03_provider_integration.md +38 -0
  39. package/docs/04_local_dev.md +43 -0
  40. package/docs/05_cli_quickstart.md +89 -0
  41. package/docs/05_contributing.md +33 -0
  42. package/docs/06_busl_licensing.md +25 -0
  43. package/docs/README.md +9 -0
  44. package/docs/api_reference/.nojekyll +1 -0
  45. package/docs/api_reference/assets/highlight.css +141 -0
  46. package/docs/api_reference/assets/icons.js +18 -0
  47. package/docs/api_reference/assets/icons.svg +1 -0
  48. package/docs/api_reference/assets/main.js +60 -0
  49. package/docs/api_reference/assets/navigation.js +1 -0
  50. package/docs/api_reference/assets/search.js +1 -0
  51. package/docs/api_reference/assets/style.css +1493 -0
  52. package/docs/api_reference/classes/DebugLogger.html +29 -0
  53. package/docs/api_reference/classes/FeatureFlagService.html +28 -0
  54. package/docs/api_reference/classes/NotificationService.html +21 -0
  55. package/docs/api_reference/classes/StreamingTTSClient.html +19 -0
  56. package/docs/api_reference/classes/VectorDatabaseService.html +63 -0
  57. package/docs/api_reference/classes/VectorMigrationService.html +27 -0
  58. package/docs/api_reference/classes/VoiceService.html +4 -0
  59. package/docs/api_reference/enums/TTSState.html +6 -0
  60. package/docs/api_reference/functions/Chat.html +1 -0
  61. package/docs/api_reference/functions/ChatModal.html +29 -0
  62. package/docs/api_reference/functions/ChatProvider.html +29 -0
  63. package/docs/api_reference/functions/FeatureFlagProvider.html +30 -0
  64. package/docs/api_reference/functions/FeedbackButton.html +29 -0
  65. package/docs/api_reference/functions/FeedbackModal.html +29 -0
  66. package/docs/api_reference/functions/Management.html +1 -0
  67. package/docs/api_reference/functions/NotificationProvider.html +29 -0
  68. package/docs/api_reference/functions/SubscriptionExpiredGuard.html +31 -0
  69. package/docs/api_reference/functions/SubscriptionExpiredModal.html +31 -0
  70. package/docs/api_reference/functions/defineCustomElement.html +1 -0
  71. package/docs/api_reference/functions/getCriticalConfig.html +1 -0
  72. package/docs/api_reference/functions/getFeatureMatrix.html +1 -0
  73. package/docs/api_reference/functions/getStreamingTTSClient.html +1 -0
  74. package/docs/api_reference/functions/getSystemConstants.html +1 -0
  75. package/docs/api_reference/functions/getTTSState.html +1 -0
  76. package/docs/api_reference/functions/handleHttpError.html +2 -0
  77. package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -0
  78. package/docs/api_reference/functions/handleValidationError.html +2 -0
  79. package/docs/api_reference/functions/initializeCoreSystem.html +1 -0
  80. package/docs/api_reference/functions/pauseTTS.html +1 -0
  81. package/docs/api_reference/functions/previewTierUpgrade.html +1 -0
  82. package/docs/api_reference/functions/resumeTTS.html +1 -0
  83. package/docs/api_reference/functions/showInfoNotification.html +2 -0
  84. package/docs/api_reference/functions/showSuccessNotification.html +2 -0
  85. package/docs/api_reference/functions/speakWithStreaming.html +1 -0
  86. package/docs/api_reference/functions/stopTTS.html +1 -0
  87. package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -0
  88. package/docs/api_reference/functions/updateSubscriptionTier.html +2 -0
  89. package/docs/api_reference/functions/useFeatureFlag.html +2 -0
  90. package/docs/api_reference/functions/useFeatureVisibility.html +2 -0
  91. package/docs/api_reference/functions/useFeatures.html +2 -0
  92. package/docs/api_reference/functions/useGatewayHealth.html +1 -0
  93. package/docs/api_reference/functions/useGatewayMemory.html +1 -0
  94. package/docs/api_reference/functions/useGatewayModels.html +1 -0
  95. package/docs/api_reference/functions/useGlobalTTS.html +2 -0
  96. package/docs/api_reference/functions/useNotification.html +1 -0
  97. package/docs/api_reference/functions/useNotificationService.html +6 -0
  98. package/docs/api_reference/functions/useTTS.html +2 -0
  99. package/docs/api_reference/functions/useVectorStore.html +13 -0
  100. package/docs/api_reference/functions/useVoiceStore.html +8 -0
  101. package/docs/api_reference/functions/useVoices.html +3 -0
  102. package/docs/api_reference/functions/validateEnvironment.html +1 -0
  103. package/docs/api_reference/functions/validateSystemIntegrity.html +1 -0
  104. package/docs/api_reference/index.html +756 -0
  105. package/docs/api_reference/interfaces/AIChatRequest.html +8 -0
  106. package/docs/api_reference/interfaces/AIChatResponse.html +3 -0
  107. package/docs/api_reference/interfaces/AIGenerateRequest.html +5 -0
  108. package/docs/api_reference/interfaces/AIGenerateResponse.html +3 -0
  109. package/docs/api_reference/interfaces/AIMessage.html +4 -0
  110. package/docs/api_reference/interfaces/AIModel.html +6 -0
  111. package/docs/api_reference/interfaces/AIProviderConfig.html +9 -0
  112. package/docs/api_reference/interfaces/ChatConfig.html +5 -0
  113. package/docs/api_reference/interfaces/CreateMemoryOptions.html +7 -0
  114. package/docs/api_reference/interfaces/FeatureEvaluation.html +14 -0
  115. package/docs/api_reference/interfaces/FeatureFlagConfig.html +18 -0
  116. package/docs/api_reference/interfaces/FeatureFlagContextValue.html +16 -0
  117. package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +4 -0
  118. package/docs/api_reference/interfaces/FeedbackButtonProps.html +19 -0
  119. package/docs/api_reference/interfaces/FeedbackCategories.html +6 -0
  120. package/docs/api_reference/interfaces/FeedbackModalProps.html +4 -0
  121. package/docs/api_reference/interfaces/FeedbackPriorities.html +5 -0
  122. package/docs/api_reference/interfaces/FeedbackRequest.html +12 -0
  123. package/docs/api_reference/interfaces/FeedbackResponse.html +7 -0
  124. package/docs/api_reference/interfaces/FileUploadResult.html +4 -0
  125. package/docs/api_reference/interfaces/GatewayChatRequest.html +12 -0
  126. package/docs/api_reference/interfaces/GatewayChatResponse.html +7 -0
  127. package/docs/api_reference/interfaces/GatewayContract.html +4 -0
  128. package/docs/api_reference/interfaces/GatewayGenerateRequest.html +8 -0
  129. package/docs/api_reference/interfaces/GatewayGenerateResponse.html +12 -0
  130. package/docs/api_reference/interfaces/GatewayHealthResponse.html +5 -0
  131. package/docs/api_reference/interfaces/GatewayMemoryRecord.html +7 -0
  132. package/docs/api_reference/interfaces/GatewayMemoryResponse.html +4 -0
  133. package/docs/api_reference/interfaces/GatewayMessage.html +5 -0
  134. package/docs/api_reference/interfaces/GatewayMessageContent.html +4 -0
  135. package/docs/api_reference/interfaces/GatewayModel.html +9 -0
  136. package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -0
  137. package/docs/api_reference/interfaces/MemorySearchFilters.html +5 -0
  138. package/docs/api_reference/interfaces/MigrationProgress.html +6 -0
  139. package/docs/api_reference/interfaces/MigrationStatus.html +7 -0
  140. package/docs/api_reference/interfaces/NotificationConfig.html +5 -0
  141. package/docs/api_reference/interfaces/NotificationContextType.html +6 -0
  142. package/docs/api_reference/interfaces/NotificationProviderProps.html +4 -0
  143. package/docs/api_reference/interfaces/PackageSettings.html +11 -0
  144. package/docs/api_reference/interfaces/SearchOptions.html +6 -0
  145. package/docs/api_reference/interfaces/SearchResult.html +5 -0
  146. package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +7 -0
  147. package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +6 -0
  148. package/docs/api_reference/interfaces/TTSOptions.html +5 -0
  149. package/docs/api_reference/interfaces/TTSProgress.html +6 -0
  150. package/docs/api_reference/interfaces/TrialUsage.html +6 -0
  151. package/docs/api_reference/interfaces/UploadRequest.html +9 -0
  152. package/docs/api_reference/interfaces/UseTTSReturn.html +14 -0
  153. package/docs/api_reference/interfaces/VectorDocument.html +11 -0
  154. package/docs/api_reference/interfaces/VectorMemory.html +12 -0
  155. package/docs/api_reference/interfaces/VectorMemoryMetadata.html +7 -0
  156. package/docs/api_reference/interfaces/VectorStoreStatus.html +7 -0
  157. package/docs/api_reference/interfaces/VoiceModelsResponse.html +4 -0
  158. package/docs/api_reference/interfaces/VoiceState.html +12 -0
  159. package/docs/api_reference/media/02_gateway_api.md +64 -0
  160. package/docs/api_reference/media/05_cli_quickstart.md +89 -0
  161. package/docs/api_reference/media/LICENSE +43 -0
  162. package/docs/api_reference/media/PRE-PUSH-CHECKLIST.md +10 -0
  163. package/docs/api_reference/media/PROTECTION-NOTICE.md +60 -0
  164. package/docs/api_reference/media/PROTECTION-README.md +41 -0
  165. package/docs/api_reference/media/README-1.md +23 -0
  166. package/docs/api_reference/media/README.md +9 -0
  167. package/docs/api_reference/modules.html +123 -0
  168. package/docs/api_reference/types/FeatureKey.html +2 -0
  169. package/docs/api_reference/types/FeatureMatrix.html +2 -0
  170. package/docs/api_reference/types/GatewayQueryOptions.html +1 -0
  171. package/docs/api_reference/types/LogContext.html +14 -0
  172. package/docs/api_reference/types/SubscriptionTier.html +2 -0
  173. package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +2 -0
  174. package/docs/api_reference/variables/FeatureFlagContext.html +1 -0
  175. package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +2 -0
  176. package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -0
  177. package/docs/api_reference/variables/authenticationService.html +1 -0
  178. package/docs/api_reference/variables/debugLogger-1.html +1 -0
  179. package/docs/api_reference/variables/featureFlagService-1.html +2 -0
  180. package/docs/api_reference/variables/notificationService-1.html +1 -0
  181. package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -0
  182. package/docs/api_reference/variables/vectorMigrationService-1.html +1 -0
  183. package/docs/api_reference/variables/voiceService-1.html +1 -0
  184. package/package.json +103 -0
@@ -0,0 +1,1636 @@
1
+ import React, { ReactNode } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as zustand from 'zustand';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
5
+ import { UseQueryOptions } from '@tanstack/react-query';
6
+ import { Observable } from 'rxjs';
7
+ import { AlertColor } from '@mui/material';
8
+
9
+ /**
10
+ * Common types used across all AI providers
11
+ */
12
+ interface AIMessage {
13
+ role: 'system' | 'user' | 'assistant';
14
+ content: string;
15
+ }
16
+ interface AIChatRequest {
17
+ model: string;
18
+ messages: AIMessage[];
19
+ stream?: boolean;
20
+ temperature?: number;
21
+ maxTokens?: number;
22
+ images?: string[];
23
+ options?: Record<string, unknown>;
24
+ }
25
+ interface AIChatResponse {
26
+ message: {
27
+ content: string;
28
+ role: 'assistant';
29
+ };
30
+ done?: boolean;
31
+ }
32
+ interface AIGenerateRequest {
33
+ model: string;
34
+ prompt: string;
35
+ stream?: boolean;
36
+ options?: Record<string, unknown>;
37
+ }
38
+ interface AIGenerateResponse {
39
+ response: string;
40
+ done?: boolean;
41
+ }
42
+ interface AIModel {
43
+ name: string;
44
+ size?: number;
45
+ details?: {
46
+ format?: string;
47
+ family?: string;
48
+ families?: string[];
49
+ parameter_size?: string;
50
+ quantization_level?: string;
51
+ };
52
+ digest?: string;
53
+ modified_at?: string;
54
+ }
55
+ interface AIProviderConfig {
56
+ type: 'ollama' | 'openai' | 'azure-openai' | 'anthropic' | 'gateway';
57
+ baseUrl?: string;
58
+ apiKey?: string;
59
+ apiVersion?: string;
60
+ deploymentName?: string;
61
+ gatewayUrl?: string;
62
+ provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama';
63
+ tokenFactory?: () => string | null;
64
+ }
65
+
66
+ /**
67
+ * Subscription tiers available in the system
68
+ */
69
+ type SubscriptionTier = 'basic' | 'premium' | 'pro' | 'team' | 'trial' | 'expired';
70
+ /**
71
+ * Available feature keys that can be toggled
72
+ */
73
+ type FeatureKey = 'memory' | 'documentKnowledge' | 'moodAdaptation' | 'chatSuggestions' | 'tts' | 'stt' | 'adminDashboardEnabled' | 'limitedAdminDashboard' | 'semanticSearchSimple' | 'semanticSearchPremium' | 'advancedSearch' | 'advancedMemories';
74
+ /**
75
+ * Feature matrix defining which features are enabled/disabled
76
+ */
77
+ type FeatureMatrix = Partial<Record<FeatureKey, boolean>>;
78
+ /**
79
+ * Feature flag configuration interface
80
+ */
81
+ interface FeatureFlagConfig {
82
+ /** Current subscription tier - if not provided, assumes OSS mode */
83
+ subscriptionType?: SubscriptionTier;
84
+ /** JWT claim key to extract roles from (default: 'roles') */
85
+ rolesClaimKey?: string;
86
+ /** JWT claim key to extract subscription type from (default: 'subscriptionType') */
87
+ subscriptionTypeClaimKey?: string;
88
+ /** JWT claim key to check if subscription is active (default: 'isSubscribed') */
89
+ isSubscribedClaimKey?: string;
90
+ /** LocalStorage key where JWT is stored (default: 'bandit-jwt') */
91
+ jwtStorageKey?: string;
92
+ /** Manual feature overrides - takes precedence in OSS mode */
93
+ featureMatrix?: FeatureMatrix;
94
+ /** Admin role name that grants full access (default: 'admin') */
95
+ adminRole?: string;
96
+ /** Enable debug logging for feature evaluation */
97
+ debug?: boolean;
98
+ }
99
+ /**
100
+ * Default feature matrices for each subscription tier
101
+ */
102
+ declare const DEFAULT_TIER_FEATURES: Record<SubscriptionTier, FeatureMatrix>;
103
+ /**
104
+ * Open source mode - all features available by default
105
+ */
106
+ declare const OSS_DEFAULT_FEATURES: FeatureMatrix;
107
+ /**
108
+ * Trial usage information from JWT
109
+ */
110
+ interface TrialUsage {
111
+ chatRequestsUsed: number;
112
+ chatRequestsLimit: number;
113
+ generateRequestsUsed: number;
114
+ generateRequestsLimit: number;
115
+ }
116
+ /**
117
+ * Feature evaluation result
118
+ */
119
+ interface FeatureEvaluation {
120
+ /** Current subscription tier (or 'oss' for open source mode) */
121
+ tier: SubscriptionTier | 'oss';
122
+ /** Whether the user has admin role */
123
+ isAdmin: boolean;
124
+ /** Whether the user's subscription is active (false for trial users) */
125
+ isSubscribed: boolean;
126
+ /** Trial usage limits (only present for trial users) */
127
+ trialUsage?: TrialUsage;
128
+ /** Final computed feature matrix */
129
+ features: FeatureMatrix;
130
+ /** Evaluation metadata */
131
+ metadata: {
132
+ jwtFound: boolean;
133
+ jwtValid: boolean;
134
+ rolesExtracted: string[];
135
+ subscriptionTypeFromJWT?: SubscriptionTier;
136
+ isSubscribedFromJWT?: boolean;
137
+ trialUsageFromJWT?: TrialUsage;
138
+ evaluatedAt: number;
139
+ };
140
+ }
141
+
142
+ interface PackageSettings {
143
+ ollamaUrl?: string;
144
+ defaultModel: string;
145
+ fallbackModel?: string;
146
+ aiProvider?: AIProviderConfig;
147
+ gatewayApiUrl: string;
148
+ s3ApiUrl?: string;
149
+ brandingConfigUrl: string;
150
+ homeUrl?: string | null;
151
+ feedbackEmail?: string;
152
+ featureFlags?: FeatureFlagConfig;
153
+ }
154
+
155
+ interface ChatConfig {
156
+ packageSettings: PackageSettings;
157
+ /** Feature flag configuration - can override packageSettings.featureFlags */
158
+ featureFlags?: FeatureFlagConfig;
159
+ children?: React.ReactNode;
160
+ }
161
+ declare const ChatProvider: React.FC<ChatConfig>;
162
+
163
+ declare const Chat: () => react_jsx_runtime.JSX.Element | null;
164
+
165
+ declare const Management: () => react_jsx_runtime.JSX.Element | null;
166
+
167
+ declare const ChatModal: React.FC<{
168
+ open: boolean;
169
+ onClose: () => void;
170
+ }>;
171
+
172
+ declare function defineCustomElement<Props extends Record<string, unknown>>(name: string, Component: React.ComponentType<Props>): void;
173
+
174
+ /**
175
+ * 🔍 Bandit Debug Logger Service
176
+ *
177
+ * Centralized logging service that provides environment-aware debug logging.
178
+ *
179
+ * Features:
180
+ * - Production builds: Only errors and info logs are shown
181
+ * - Development mode: All logs are shown with clear debug prefixes
182
+ * - Consistent formatting for debugging purposes
183
+ * - Clear indication that logs are for debugging
184
+ *
185
+ * Usage:
186
+ * ```typescript
187
+ * import { debugLogger } from './services/logging/debugLogger';
188
+ *
189
+ * debugLogger.debug('LLM processing', { prompt, response });
190
+ * debugLogger.info('User action completed', { action });
191
+ * debugLogger.warn('Performance warning', { timing });
192
+ * debugLogger.error('Operation failed', { error });
193
+ * ```
194
+ */
195
+ type LogContext = unknown;
196
+ declare class DebugLogger {
197
+ private isDevelopment;
198
+ constructor();
199
+ private detectDevelopmentMode;
200
+ /**
201
+ * Set development mode manually (useful for testing or runtime configuration)
202
+ */
203
+ setDevelopmentMode(isDev: boolean): void;
204
+ /**
205
+ * Debug logs - only shown in development mode
206
+ * These are obfuscated/hidden in production builds
207
+ * DISABLED to prevent console flooding during chat processing
208
+ */
209
+ debug(message: string, context?: LogContext): void;
210
+ /**
211
+ * Info logs - shown in both development and production
212
+ * Used for important user-facing information
213
+ */
214
+ info(message: string, context?: LogContext): void;
215
+ /**
216
+ * Warning logs - shown in both development and production
217
+ * Used for non-critical issues that should be noted
218
+ */
219
+ warn(message: string, context?: LogContext): void;
220
+ /**
221
+ * Error logs - always shown in both development and production
222
+ * Used for critical errors that need attention
223
+ */
224
+ error(message: string, context?: LogContext): void;
225
+ /**
226
+ * LLM-specific debug logging for RAG and AI features
227
+ * DISABLED to prevent console flooding during chat processing
228
+ */
229
+ llmDebug(operation: string, data: LogContext): void;
230
+ /**
231
+ * RAG-specific debug logging for knowledge and document processing
232
+ * DISABLED to prevent console flooding during chat processing
233
+ */
234
+ ragDebug(operation: string, data: LogContext): void;
235
+ /**
236
+ * Memory-specific debug logging for AI memory features
237
+ * DISABLED to prevent console flooding during chat processing
238
+ */
239
+ memoryDebug(operation: string, data: LogContext): void;
240
+ /**
241
+ * Table logging for development debugging
242
+ * DISABLED to prevent console flooding during chat processing
243
+ */
244
+ table(data: unknown[], message?: string): void;
245
+ }
246
+ declare const debugLogger: DebugLogger;
247
+
248
+ interface JwtClaims {
249
+ /**
250
+ * The unique identifier for the user.
251
+ */
252
+ sub: string;
253
+ /**
254
+ * The email address of the user.
255
+ * This is typically used for authentication and user identification.
256
+ */
257
+ email: string;
258
+ /**
259
+ * Optional display name for the user if provided by the identity provider.
260
+ */
261
+ name?: string;
262
+ /**
263
+ * Optional preferred username provided by the identity provider.
264
+ */
265
+ preferred_username?: string;
266
+ /**
267
+ * Optional direct URL to a profile image for the user.
268
+ */
269
+ picture?: string;
270
+ /**
271
+ * Optional given name of the user when available.
272
+ */
273
+ given_name?: string;
274
+ /**
275
+ * Optional family name of the user when available.
276
+ */
277
+ family_name?: string;
278
+ /**
279
+ * The roles assigned to the user.
280
+ * 'user' | 'admin' | 'super-admin'
281
+ */
282
+ roles: string[];
283
+ /**
284
+ * The time at which the token was issued.
285
+ * This is represented as a Unix timestamp (seconds since the epoch).
286
+ */
287
+ iat: number;
288
+ /**
289
+ * The time at which the token will expire.
290
+ * This is represented as a Unix timestamp (seconds since the epoch).
291
+ */
292
+ exp: number;
293
+ /**
294
+ * The issuer of the token.
295
+ * This is typically the URL of the authentication server.
296
+ *
297
+ */
298
+ iss: string;
299
+ /**
300
+ * Optional team session identifier for team features.
301
+ * Present when user belongs to a team.
302
+ */
303
+ teamSid?: string;
304
+ /**
305
+ * Optional team identifier for team features.
306
+ * Present when user belongs to a team.
307
+ */
308
+ teamId?: string;
309
+ }
310
+ declare class AuthenticationService {
311
+ getToken(): string | null;
312
+ setToken(token: string): void;
313
+ clearToken(): void;
314
+ isAuthenticated(): boolean;
315
+ isTokenExpired(token: string): boolean;
316
+ parseJwtClaims(token: string): JwtClaims | null;
317
+ }
318
+ declare const authenticationService: AuthenticationService;
319
+
320
+ /**
321
+ * Context value interface
322
+ */
323
+ interface FeatureFlagContextValue {
324
+ /** Check if a specific feature is enabled */
325
+ hasFeature: (feature: FeatureKey) => boolean;
326
+ /** Get the current feature evaluation */
327
+ getEvaluation: () => FeatureEvaluation | null;
328
+ /** Refresh feature evaluation (useful after login/logout) */
329
+ refreshEvaluation: () => void;
330
+ /** Check if user is admin */
331
+ isAdmin: () => boolean;
332
+ /** Get current tier */
333
+ getCurrentTier: () => SubscriptionTier | 'oss';
334
+ /** Update subscription tier dynamically */
335
+ updateTier: (tier: SubscriptionTier) => void;
336
+ /** Check if we're in OSS mode */
337
+ isOSSMode: () => boolean;
338
+ }
339
+ declare const FeatureFlagContext: React.Context<FeatureFlagContextValue | undefined>;
340
+ /**
341
+ * Props for the FeatureFlagProvider
342
+ */
343
+ interface FeatureFlagProviderProps {
344
+ config: FeatureFlagConfig;
345
+ children: React.ReactNode;
346
+ }
347
+ /**
348
+ * Feature Flag Provider Component
349
+ */
350
+ declare const FeatureFlagProvider: React.FC<FeatureFlagProviderProps>;
351
+ /**
352
+ * Hook to use feature flags
353
+ */
354
+ declare const useFeatureFlag: () => FeatureFlagContextValue;
355
+
356
+ /**
357
+ * Convenience hook that provides an easier API for feature checking
358
+ */
359
+ declare const useFeatures: () => {
360
+ hasFeature: () => boolean;
361
+ hasMemory: () => boolean;
362
+ hasDocumentKnowledge: () => boolean;
363
+ hasMoodAdaptation: () => boolean;
364
+ hasChatSuggestions: () => boolean;
365
+ hasTTS: () => boolean;
366
+ hasSTT: () => boolean;
367
+ hasAdminDashboard: () => boolean;
368
+ hasLimitedAdminDashboard: () => boolean;
369
+ hasSimpleSearch: () => boolean;
370
+ hasPremiumSearch: () => boolean;
371
+ hasAdvancedSearch: () => boolean;
372
+ hasAdvancedMemories: () => boolean;
373
+ isAdmin: () => boolean;
374
+ getCurrentTier: () => "oss";
375
+ isOSSMode: () => boolean;
376
+ isSubscribed: () => boolean;
377
+ isPremiumTier: () => boolean;
378
+ isProTier: () => boolean;
379
+ isTrialTier: () => boolean;
380
+ isTeamTier: () => boolean;
381
+ isExpiredTier: () => boolean;
382
+ needsUpgrade: () => boolean;
383
+ getTrialUsage: () => undefined;
384
+ isTrialLimitReached: () => boolean;
385
+ getTrialRemainingRequests: () => null;
386
+ updateTier: () => undefined;
387
+ refreshFeatures: () => undefined;
388
+ getFullEvaluation: () => null;
389
+ } | {
390
+ hasFeature: (feature: FeatureKey) => boolean;
391
+ hasMemory: () => boolean;
392
+ hasDocumentKnowledge: () => boolean;
393
+ hasMoodAdaptation: () => boolean;
394
+ hasChatSuggestions: () => boolean;
395
+ hasTTS: () => boolean;
396
+ hasSTT: () => boolean;
397
+ hasAdminDashboard: () => boolean;
398
+ hasLimitedAdminDashboard: () => boolean;
399
+ hasSimpleSearch: () => boolean;
400
+ hasPremiumSearch: () => boolean;
401
+ hasAdvancedSearch: () => boolean;
402
+ hasAdvancedMemories: () => boolean;
403
+ isAdmin: () => boolean;
404
+ getCurrentTier: () => SubscriptionTier | "oss";
405
+ isOSSMode: () => boolean;
406
+ isSubscribed: () => boolean;
407
+ isPremiumTier: () => boolean;
408
+ isProTier: () => boolean;
409
+ isTrialTier: () => boolean;
410
+ isTeamTier: () => boolean;
411
+ isExpiredTier: () => boolean;
412
+ needsUpgrade: (feature: FeatureKey, requiredTier?: SubscriptionTier) => false | SubscriptionTier;
413
+ getTrialUsage: () => TrialUsage | undefined;
414
+ isTrialLimitReached: (type: "chat" | "generate") => boolean;
415
+ getTrialRemainingRequests: (type: "chat" | "generate") => number | null;
416
+ updateTier: (tier: SubscriptionTier) => void;
417
+ refreshFeatures: () => void;
418
+ getFullEvaluation: () => FeatureEvaluation | null;
419
+ };
420
+ /**
421
+ * Hook specifically for checking if features should be shown in UI
422
+ */
423
+ declare const useFeatureVisibility: () => {
424
+ showMemoryToggle: () => boolean;
425
+ showDocumentUpload: () => boolean;
426
+ showMoodSettings: () => boolean;
427
+ showSuggestions: () => boolean;
428
+ showVoiceControls: () => boolean;
429
+ showAdminPanel: () => boolean;
430
+ showLimitedAdminPanel: () => boolean;
431
+ showAdvancedSearch: () => boolean;
432
+ shouldShowUpgradePrompt: (feature: FeatureKey) => boolean;
433
+ getUpgradeMessage: (feature: FeatureKey) => string | null;
434
+ };
435
+
436
+ /**
437
+ * Service for managing subscription tiers and feature flags
438
+ */
439
+ declare class FeatureFlagService {
440
+ private static instance;
441
+ private subscribers;
442
+ static getInstance(): FeatureFlagService;
443
+ /**
444
+ * Subscribe to subscription tier changes
445
+ */
446
+ subscribe(callback: () => void): () => void;
447
+ /**
448
+ * Notify all subscribers of changes
449
+ */
450
+ private notifySubscribers;
451
+ /**
452
+ * Update subscription tier and notify components
453
+ */
454
+ updateSubscriptionTier(tier: SubscriptionTier): void;
455
+ /**
456
+ * Sync subscription with external service
457
+ */
458
+ syncWithExternalService(userId: string, apiUrl?: string): Promise<SubscriptionTier>;
459
+ /**
460
+ * Get features available for a specific tier
461
+ */
462
+ getFeaturesForTier(tier: SubscriptionTier): Partial<Record<FeatureKey, boolean>>;
463
+ /**
464
+ * Check if a tier includes a specific feature
465
+ */
466
+ tierHasFeature(tier: SubscriptionTier, feature: FeatureKey): boolean;
467
+ /**
468
+ * Get the minimum tier required for a feature
469
+ */
470
+ getMinimumTierForFeature(feature: FeatureKey): SubscriptionTier | null;
471
+ /**
472
+ * Compare tier levels
473
+ */
474
+ compareTiers(tier1: SubscriptionTier, tier2: SubscriptionTier): number;
475
+ /**
476
+ * Check if tier1 is higher than or equal to tier2
477
+ */
478
+ tierMeetsRequirement(userTier: SubscriptionTier, requiredTier: SubscriptionTier): boolean;
479
+ /**
480
+ * Get upgrade path from current tier to target tier
481
+ */
482
+ getUpgradePath(currentTier: SubscriptionTier, targetTier: SubscriptionTier): SubscriptionTier[];
483
+ /**
484
+ * Handle subscription upgrade/downgrade
485
+ */
486
+ handleSubscriptionChange(newTier: SubscriptionTier, options?: {
487
+ apiUrl?: string;
488
+ userId?: string;
489
+ notifyExternal?: boolean;
490
+ }): Promise<boolean>;
491
+ /**
492
+ * Preview features for a potential upgrade
493
+ */
494
+ previewUpgrade(targetTier: SubscriptionTier): {
495
+ tier: SubscriptionTier;
496
+ newFeatures: FeatureKey[];
497
+ allFeatures: Partial<Record<FeatureKey, boolean>>;
498
+ };
499
+ /**
500
+ * Generate feature comparison matrix
501
+ */
502
+ generateFeatureMatrix(): Record<SubscriptionTier, Partial<Record<FeatureKey, boolean>>>;
503
+ }
504
+ /**
505
+ * Singleton instance
506
+ */
507
+ declare const featureFlagService: FeatureFlagService;
508
+ /**
509
+ * Convenience functions for external use
510
+ */
511
+ declare const updateSubscriptionTier: (tier: SubscriptionTier) => void;
512
+ declare const syncSubscriptionWithAPI: (userId: string, apiUrl?: string) => Promise<SubscriptionTier>;
513
+ declare const handleSubscriptionUpgrade: (newTier: SubscriptionTier, options?: Parameters<typeof featureFlagService.handleSubscriptionChange>[1]) => Promise<boolean>;
514
+ declare const previewTierUpgrade: (tier: SubscriptionTier) => {
515
+ tier: SubscriptionTier;
516
+ newFeatures: FeatureKey[];
517
+ allFeatures: Partial<Record<FeatureKey, boolean>>;
518
+ };
519
+ declare const getFeatureMatrix: () => Record<SubscriptionTier, Partial<Record<FeatureKey, boolean>>>;
520
+
521
+ /**
522
+ * Hook to initialize and manage voice models from the gateway API
523
+ * Automatically loads voices when gateway API URL is available
524
+ */
525
+ declare const useVoices: () => {
526
+ availableVoices: string[];
527
+ selectedVoice: string;
528
+ defaultVoice: string;
529
+ fallbackVoice: string;
530
+ isLoading: boolean;
531
+ isServiceAvailable: boolean;
532
+ setSelectedVoice: (voice: string) => void;
533
+ refreshVoices: () => Promise<void>;
534
+ hasVoices: boolean;
535
+ isVoiceServiceConfigured: boolean;
536
+ };
537
+
538
+ interface VoiceState {
539
+ availableVoices: string[];
540
+ selectedVoice: string;
541
+ defaultVoice: string;
542
+ fallbackVoice: string;
543
+ isLoading: boolean;
544
+ isServiceAvailable: boolean;
545
+ initialized: boolean;
546
+ setSelectedVoice: (voice: string) => void;
547
+ loadVoicesFromAPI: () => Promise<void>;
548
+ refreshVoices: () => Promise<void>;
549
+ forceInitialize: () => Promise<void>;
550
+ }
551
+ declare const useVoiceStore: zustand.UseBoundStore<zustand.StoreApi<VoiceState>>;
552
+
553
+ interface VoiceModelsResponse {
554
+ models: string[];
555
+ defaultModel: string;
556
+ fallbackModel: string;
557
+ }
558
+ declare class VoiceService {
559
+ private static instance;
560
+ private cachedModels;
561
+ private cacheTimestamp;
562
+ private readonly CACHE_DURATION;
563
+ private constructor();
564
+ static getInstance(): VoiceService;
565
+ private getGatewayApiUrl;
566
+ private isValid;
567
+ private isCacheValid;
568
+ fetchAvailableVoices(): Promise<VoiceModelsResponse>;
569
+ clearCache(): void;
570
+ }
571
+ declare const voiceService: VoiceService;
572
+
573
+ interface GatewayMessageContent {
574
+ type: 'text' | 'image_url';
575
+ text?: string;
576
+ image_url?: {
577
+ url: string;
578
+ detail?: 'low' | 'high' | 'auto';
579
+ };
580
+ }
581
+ interface GatewayMessage {
582
+ role: 'system' | 'user' | 'assistant';
583
+ content: string | GatewayMessageContent[];
584
+ name?: string;
585
+ images?: string[];
586
+ }
587
+ interface GatewayChatRequest {
588
+ model: string;
589
+ messages: GatewayMessage[];
590
+ stream?: boolean;
591
+ temperature?: number;
592
+ max_tokens?: number;
593
+ top_p?: number;
594
+ frequency_penalty?: number;
595
+ presence_penalty?: number;
596
+ provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama';
597
+ stop?: string | string[];
598
+ images?: string[];
599
+ }
600
+ interface GatewayChatResponse {
601
+ id: string;
602
+ object: string;
603
+ created: number;
604
+ model: string;
605
+ choices: {
606
+ index: number;
607
+ delta?: {
608
+ role?: string;
609
+ content?: string;
610
+ };
611
+ message?: {
612
+ role: string;
613
+ content: string;
614
+ };
615
+ finish_reason?: string | null;
616
+ }[];
617
+ usage?: {
618
+ prompt_tokens: number;
619
+ completion_tokens: number;
620
+ total_tokens: number;
621
+ };
622
+ }
623
+ interface GatewayGenerateRequest {
624
+ model: string;
625
+ prompt: string;
626
+ stream?: boolean;
627
+ temperature?: number;
628
+ max_tokens?: number;
629
+ provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama';
630
+ stop?: string | string[];
631
+ }
632
+ interface GatewayGenerateResponse {
633
+ model: string;
634
+ created_at: string;
635
+ response: string;
636
+ done: boolean;
637
+ context?: number[];
638
+ total_duration?: number;
639
+ load_duration?: number;
640
+ prompt_eval_count?: number;
641
+ prompt_eval_duration?: number;
642
+ eval_count?: number;
643
+ eval_duration?: number;
644
+ }
645
+ interface GatewayModel {
646
+ id: string;
647
+ name: string;
648
+ provider: string;
649
+ created: number;
650
+ modified_at: string;
651
+ size: number;
652
+ digest: string;
653
+ details?: {
654
+ format: string;
655
+ family: string;
656
+ families: string[];
657
+ parameter_size: string;
658
+ quantization_level: string;
659
+ };
660
+ }
661
+ interface GatewayModelsResponse {
662
+ models: GatewayModel[];
663
+ }
664
+ interface GatewayHealthResponse {
665
+ status: 'healthy' | 'unhealthy';
666
+ version: string;
667
+ providers: {
668
+ name: string;
669
+ status: 'available' | 'unavailable';
670
+ models_count: number;
671
+ }[];
672
+ uptime: number;
673
+ }
674
+ interface GatewayMemoryRecord {
675
+ id: string;
676
+ type: string;
677
+ content: string;
678
+ createdAt: string;
679
+ updatedAt: string;
680
+ metadata?: Record<string, unknown>;
681
+ }
682
+ interface GatewayMemoryResponse {
683
+ records: GatewayMemoryRecord[];
684
+ total: number;
685
+ nextCursor?: string | null;
686
+ }
687
+
688
+ type GatewayQueryOptions<TData> = Omit<UseQueryOptions<TData, Error>, "queryKey" | "queryFn">;
689
+ declare const useGatewayHealth: (options?: GatewayQueryOptions<GatewayHealthResponse>) => _tanstack_react_query.UseQueryResult<GatewayHealthResponse, Error>;
690
+ declare const useGatewayModels: (options?: GatewayQueryOptions<GatewayModel[]>) => _tanstack_react_query.UseQueryResult<GatewayModel[], Error>;
691
+ declare const useGatewayMemory: (options?: GatewayQueryOptions<GatewayMemoryResponse>) => _tanstack_react_query.UseQueryResult<GatewayMemoryResponse, Error>;
692
+
693
+ declare enum TTSState {
694
+ IDLE = "IDLE",
695
+ LOADING = "LOADING",
696
+ PLAYING = "PLAYING",
697
+ PAUSED = "PAUSED",
698
+ ERROR = "ERROR"
699
+ }
700
+ interface TTSProgress {
701
+ currentTime: number;
702
+ duration: number;
703
+ percentage: number;
704
+ buffered: number;
705
+ state: TTSState;
706
+ }
707
+ interface TTSOptions {
708
+ useStreaming?: boolean;
709
+ useRealtime?: boolean;
710
+ onStateChange?: (state: TTSState) => void;
711
+ onProgress?: (progress: TTSProgress) => void;
712
+ }
713
+ /**
714
+ * Streaming TTS client with playback controls
715
+ */
716
+ declare class StreamingTTSClient {
717
+ private static instance;
718
+ private audio;
719
+ private objectUrl;
720
+ private controller;
721
+ private audioHandlers;
722
+ private stateSubject;
723
+ private progressSubject;
724
+ private constructor();
725
+ static getInstance(): StreamingTTSClient;
726
+ /**
727
+ * Get current state
728
+ */
729
+ getCurrentState(): TTSState;
730
+ /**
731
+ * Get state changes as observable
732
+ */
733
+ getStateChanges(): Observable<TTSState>;
734
+ /**
735
+ * Get progress updates as observable
736
+ */
737
+ getProgress(): Observable<TTSProgress>;
738
+ /**
739
+ * Speak text with simple streaming
740
+ */
741
+ speakStream(text: string, voice: string, options?: TTSOptions): Observable<void>;
742
+ /**
743
+ * Simple streaming implementation - no queues, just direct playback
744
+ */
745
+ private performSimpleStreaming;
746
+ /**
747
+ * Set up audio event listeners
748
+ */
749
+ private setupAudioListeners;
750
+ /**
751
+ * Stop playback
752
+ */
753
+ stop(): void;
754
+ /**
755
+ * Pause playback
756
+ */
757
+ pause(): void;
758
+ /**
759
+ * Resume playback
760
+ */
761
+ resume(): void;
762
+ /**
763
+ * Set state and notify observers
764
+ */
765
+ private setState;
766
+ /**
767
+ * Reset the TTS client completely - useful for model changes
768
+ */
769
+ reset(): void;
770
+ /**
771
+ * Clear only the audio event handlers
772
+ */
773
+ private clearAudioHandlers;
774
+ /**
775
+ * Clean up resources
776
+ */
777
+ private cleanup;
778
+ }
779
+ declare const getStreamingTTSClient: () => StreamingTTSClient;
780
+ declare const speakStream: (text: string, voice: string, options?: TTSOptions) => Observable<void>;
781
+ declare const stopTTS: () => void;
782
+ declare const pauseTTS: () => void;
783
+ declare const resumeTTS: () => void;
784
+ declare const getTTSState: () => TTSState;
785
+
786
+ interface UseTTSReturn {
787
+ isPlaying: boolean;
788
+ isPaused: boolean;
789
+ isLoading: boolean;
790
+ error: string | null;
791
+ progress: TTSProgress | null;
792
+ state: TTSState;
793
+ speak: (text: string, options?: TTSOptions) => Promise<void>;
794
+ stop: () => void;
795
+ pause: () => void;
796
+ resume: () => void;
797
+ forcePlay: () => Promise<void>;
798
+ isAvailable: boolean;
799
+ currentVoice: string;
800
+ }
801
+ /**
802
+ * React hook for TTS with streaming support and playback controls
803
+ */
804
+ declare const useTTS: () => UseTTSReturn;
805
+ /**
806
+ * Global TTS controls hook - useful for global stop functionality
807
+ */
808
+ declare const useGlobalTTS: () => {
809
+ stopAll: () => void;
810
+ };
811
+
812
+ interface SubscriptionExpiredModalProps {
813
+ open: boolean;
814
+ onNavigateHome?: () => void;
815
+ onManageSubscription?: () => void;
816
+ onClose?: () => void;
817
+ userEmail?: string;
818
+ }
819
+ /**
820
+ * Modal shown when user has an expired subscription
821
+ * Provides options to navigate home or manage subscription
822
+ */
823
+ declare const SubscriptionExpiredModal: React.FC<SubscriptionExpiredModalProps>;
824
+
825
+ interface SubscriptionExpiredGuardProps {
826
+ children: React.ReactNode;
827
+ onNavigateHome?: () => void;
828
+ onManageSubscription?: () => void;
829
+ userEmail?: string;
830
+ /** If true, allows closing the modal and continues with limited access */
831
+ allowContinue?: boolean;
832
+ }
833
+ /**
834
+ * Guard component that shows subscription expired modal for expired users
835
+ * Wraps children and shows modal when subscription is expired
836
+ */
837
+ declare const SubscriptionExpiredGuard: React.FC<SubscriptionExpiredGuardProps>;
838
+
839
+ interface FeedbackButtonProps {
840
+ /** Whether the parent component is in fullscreen mode */
841
+ fullScreen?: boolean;
842
+ /** Additional CSS classes */
843
+ className?: string;
844
+ /** Z-index override */
845
+ zIndex?: number;
846
+ /** Custom feedback email (overrides package settings) */
847
+ feedbackEmail?: string;
848
+ /** Show as inline button instead of floating */
849
+ inline?: boolean;
850
+ /** Custom button text for inline mode */
851
+ buttonText?: string;
852
+ /** Custom size */
853
+ size?: 'small' | 'medium' | 'large';
854
+ /** Custom positioning */
855
+ position?: {
856
+ bottom?: number | string;
857
+ right?: number | string;
858
+ top?: number | string;
859
+ left?: number | string;
860
+ };
861
+ /** Use absolute positioning instead of fixed (for modal contexts) */
862
+ absolute?: boolean;
863
+ }
864
+ declare const FeedbackButton: React.FC<FeedbackButtonProps>;
865
+
866
+ interface FeedbackModalProps {
867
+ open: boolean;
868
+ onClose: () => void;
869
+ feedbackEmail?: string;
870
+ }
871
+ declare const FeedbackModal: React.FC<FeedbackModalProps>;
872
+
873
+ interface FeedbackRequest {
874
+ title: string;
875
+ description: string;
876
+ category: 'bug' | 'feature' | 'improvement' | 'question' | 'other';
877
+ priority: 'low' | 'medium' | 'high' | 'critical';
878
+ annoyanceLevel?: number;
879
+ images?: string[];
880
+ userAgent?: string;
881
+ browserInfo?: {
882
+ name: string;
883
+ version: string;
884
+ platform: string;
885
+ };
886
+ sessionInfo?: {
887
+ currentModel?: string;
888
+ currentProvider?: string;
889
+ conversationId?: string;
890
+ timestamp: string;
891
+ };
892
+ contactEmail?: string;
893
+ attachments?: {
894
+ name: string;
895
+ content: string;
896
+ type: string;
897
+ size: number;
898
+ }[];
899
+ }
900
+ interface FeedbackResponse {
901
+ id: string;
902
+ status: 'submitted' | 'acknowledged' | 'in-progress' | 'resolved' | 'rejected';
903
+ message: string;
904
+ ticketNumber?: string;
905
+ estimatedResponse?: string;
906
+ mailtoUrl?: string;
907
+ }
908
+ interface FeedbackCategories {
909
+ bug: {
910
+ label: 'Bug Report';
911
+ description: 'Something isn\'t working as expected';
912
+ icon: 'BugReport';
913
+ color: '#f44336';
914
+ };
915
+ feature: {
916
+ label: 'Feature Request';
917
+ description: 'Suggest a new feature or enhancement';
918
+ icon: 'Lightbulb';
919
+ color: '#2196f3';
920
+ };
921
+ improvement: {
922
+ label: 'Improvement';
923
+ description: 'Suggest improvements to existing features';
924
+ icon: 'TrendingUp';
925
+ color: '#ff9800';
926
+ };
927
+ question: {
928
+ label: 'Question';
929
+ description: 'Ask a question about usage or functionality';
930
+ icon: 'Help';
931
+ color: '#9c27b0';
932
+ };
933
+ other: {
934
+ label: 'Other';
935
+ description: 'General feedback or other topics';
936
+ icon: 'Message';
937
+ color: '#607d8b';
938
+ };
939
+ }
940
+ interface FeedbackPriorities {
941
+ low: {
942
+ label: 'Low';
943
+ description: 'Minor issue, can wait';
944
+ color: '#4caf50';
945
+ };
946
+ medium: {
947
+ label: 'Medium';
948
+ description: 'Normal priority';
949
+ color: '#ff9800';
950
+ };
951
+ high: {
952
+ label: 'High';
953
+ description: 'Important, needs attention soon';
954
+ color: '#f44336';
955
+ };
956
+ critical: {
957
+ label: 'Critical';
958
+ description: 'Urgent, blocks usage';
959
+ color: '#d32f2f';
960
+ };
961
+ }
962
+
963
+ interface NotificationConfig {
964
+ message: string;
965
+ severity?: AlertColor;
966
+ duration?: number;
967
+ anchorOrigin?: {
968
+ vertical: 'top' | 'bottom';
969
+ horizontal: 'left' | 'center' | 'right';
970
+ };
971
+ }
972
+ interface NotificationContextType {
973
+ showNotification: (config: NotificationConfig | string) => void;
974
+ showError: (message: string) => void;
975
+ showSuccess: (message: string) => void;
976
+ showWarning: (message: string) => void;
977
+ showInfo: (message: string) => void;
978
+ }
979
+ declare const useNotification: () => NotificationContextType;
980
+ interface NotificationProviderProps {
981
+ children: ReactNode;
982
+ defaultDuration?: number;
983
+ defaultPosition?: {
984
+ vertical: 'top' | 'bottom';
985
+ horizontal: 'left' | 'center' | 'right';
986
+ };
987
+ }
988
+ declare const NotificationProvider: React.FC<NotificationProviderProps>;
989
+
990
+ /**
991
+ * Global notification handler that can be used throughout the application
992
+ */
993
+ declare class NotificationService {
994
+ private notificationContext;
995
+ /**
996
+ * Set the notification context (usually called from a component that has access to useNotification)
997
+ */
998
+ setContext(context: NotificationContextType): void;
999
+ /**
1000
+ * Show a generic notification
1001
+ */
1002
+ show(message: string, severity?: 'success' | 'error' | 'warning' | 'info'): void;
1003
+ /**
1004
+ * Show an error notification
1005
+ */
1006
+ showError(message: string): void;
1007
+ /**
1008
+ * Show a success notification
1009
+ */
1010
+ showSuccess(message: string): void;
1011
+ /**
1012
+ * Show a warning notification
1013
+ */
1014
+ showWarning(message: string): void;
1015
+ /**
1016
+ * Show an info notification
1017
+ */
1018
+ showInfo(message: string): void;
1019
+ /**
1020
+ * Handle HTTP errors and show appropriate notifications
1021
+ */
1022
+ handleHttpError(error: unknown, customMessage?: string): void;
1023
+ /**
1024
+ * Handle network/connection errors
1025
+ */
1026
+ handleNetworkError(error: unknown, customMessage?: string): void;
1027
+ /**
1028
+ * Handle validation errors
1029
+ */
1030
+ handleValidationError(errors: readonly string[] | string, customMessage?: string): void;
1031
+ }
1032
+ declare const notificationService: NotificationService;
1033
+
1034
+ /**
1035
+ * Hook to initialize and use the notification service
1036
+ * This should be called once near the root of your component tree
1037
+ */
1038
+ declare const useNotificationService: () => {
1039
+ handleHttpError: (error: unknown, customMessage?: string) => void;
1040
+ handleNetworkError: (error: unknown, customMessage?: string) => void;
1041
+ handleValidationError: (errors: readonly string[] | string, customMessage?: string) => void;
1042
+ showNotification: (config: NotificationConfig | string) => void;
1043
+ showError: (message: string) => void;
1044
+ showSuccess: (message: string) => void;
1045
+ showWarning: (message: string) => void;
1046
+ showInfo: (message: string) => void;
1047
+ };
1048
+
1049
+ /**
1050
+ * Enhanced HTTP error handler that provides user-friendly notifications
1051
+ */
1052
+ declare const handleHttpError: (error: unknown, context?: string) => {
1053
+ status: number;
1054
+ message: string;
1055
+ code: string | undefined;
1056
+ handled: boolean;
1057
+ } | {
1058
+ status: number;
1059
+ message: string;
1060
+ handled: boolean;
1061
+ code?: undefined;
1062
+ };
1063
+ /**
1064
+ * Handle validation errors from API responses
1065
+ */
1066
+ declare const handleValidationError: (errors: unknown, context?: string) => void;
1067
+ /**
1068
+ * Success notification helper
1069
+ */
1070
+ declare const showSuccessNotification: (message: string, context?: string) => void;
1071
+ /**
1072
+ * Info notification helper
1073
+ */
1074
+ declare const showInfoNotification: (message: string, context?: string) => void;
1075
+
1076
+ declare function validateSystemIntegrity(): boolean;
1077
+ declare function initializeCoreSystem(): string;
1078
+
1079
+ declare const SYSTEM_FLAGS: {
1080
+ readonly LICENSED_MODE: true;
1081
+ readonly VALIDATION_ENABLED: true;
1082
+ readonly BURTSON_VERIFIED: true;
1083
+ readonly LICENSE_CHECK: "© 2025 Burtson Labs";
1084
+ };
1085
+ declare function getSystemConstants(): {
1086
+ version: string;
1087
+ hash: string;
1088
+ validation: string;
1089
+ flags: {
1090
+ readonly LICENSED_MODE: true;
1091
+ readonly VALIDATION_ENABLED: true;
1092
+ readonly BURTSON_VERIFIED: true;
1093
+ readonly LICENSE_CHECK: "© 2025 Burtson Labs";
1094
+ };
1095
+ license: string;
1096
+ };
1097
+
1098
+ declare function validateEnvironment(): boolean;
1099
+ declare function getCriticalConfig(): {
1100
+ systemId: string;
1101
+ validation: string;
1102
+ required: boolean;
1103
+ timestamp: string;
1104
+ };
1105
+
1106
+ interface VectorMemory {
1107
+ id: string;
1108
+ content: string;
1109
+ title?: string;
1110
+ tags?: string[];
1111
+ score?: number;
1112
+ uploadedBy: string;
1113
+ uploadedAt: string;
1114
+ source?: 'auto' | 'user';
1115
+ pinned?: boolean;
1116
+ lastReferencedAt?: string;
1117
+ metadata?: VectorMemoryMetadata;
1118
+ }
1119
+ interface VectorMemoryMetadata {
1120
+ personalConfidence?: number;
1121
+ topic?: string;
1122
+ engagement?: number;
1123
+ extractedFrom?: string;
1124
+ tags?: string[];
1125
+ additionalProperties?: Record<string, unknown>;
1126
+ [key: string]: unknown;
1127
+ }
1128
+ interface VectorDocument {
1129
+ id: string;
1130
+ filename: string;
1131
+ content: string;
1132
+ mimeType: string;
1133
+ score?: number;
1134
+ uploadedBy: string;
1135
+ uploadedAt: string;
1136
+ isUserContent: boolean;
1137
+ isTeamContent: boolean;
1138
+ contentSource: 'user' | 'team';
1139
+ }
1140
+ interface SearchResult {
1141
+ memories: VectorMemory[];
1142
+ documents: VectorDocument[];
1143
+ success: boolean;
1144
+ message?: string;
1145
+ }
1146
+ type RawFileRecord = Record<string, unknown>;
1147
+ interface MemorySearchFilters {
1148
+ includePinned?: boolean;
1149
+ topics?: string[];
1150
+ source?: Array<'auto' | 'user'>;
1151
+ tags?: string[];
1152
+ }
1153
+ interface CreateMemoryOptions {
1154
+ title?: string;
1155
+ tags?: string[];
1156
+ source?: 'auto' | 'user';
1157
+ pinned?: boolean;
1158
+ metadata?: VectorMemoryMetadata;
1159
+ lastReferencedAt?: string;
1160
+ }
1161
+ interface FileUploadResult {
1162
+ success: boolean;
1163
+ fileId: string;
1164
+ message?: string;
1165
+ }
1166
+ /**
1167
+ * Upload request structure that matches the backend C# UploadRequest class
1168
+ */
1169
+ interface UploadRequest {
1170
+ /** The file to upload */
1171
+ file: File;
1172
+ /**
1173
+ * Indicates whether the file should be shared with the team.
1174
+ * If true and the user has team information, the file will be saved to the team bucket.
1175
+ * If false, the file will be saved to the user's personal bucket regardless of team membership.
1176
+ * Defaults to true for backward compatibility.
1177
+ */
1178
+ shareWithTeam: boolean;
1179
+ }
1180
+ /**
1181
+ * Vector Database Service for Advanced Semantic Search
1182
+ *
1183
+ * This service handles storage and retrieval of memories and documents
1184
+ * in the vector database when advanced semantic search is enabled.
1185
+ *
1186
+ * Feature Gating:
1187
+ * - Requires admin authorization, pro subscription, or team subscription
1188
+ * - Supports admin users and pro/team subscription tiers
1189
+ * - Only active when advancedMemories feature is enabled
1190
+ */
1191
+ declare class VectorDatabaseService {
1192
+ private baseUrl;
1193
+ private s3ApiUrl;
1194
+ private token;
1195
+ private lastAvailabilityState;
1196
+ private lastConfigState;
1197
+ constructor(gatewayApiUrl?: string, s3ApiUrl?: string);
1198
+ /**
1199
+ * Set authentication token for API calls
1200
+ */
1201
+ setAuthToken(token: string): void;
1202
+ /**
1203
+ * Get authorization headers
1204
+ */
1205
+ private getHeaders;
1206
+ /**
1207
+ * Check if vector database is available and configured
1208
+ */
1209
+ isAvailable(): boolean;
1210
+ /**
1211
+ * Create and embed a memory in the vector database
1212
+ */
1213
+ createMemory(content: string, options?: CreateMemoryOptions): Promise<{
1214
+ success: boolean;
1215
+ memoryId?: string;
1216
+ message?: string;
1217
+ }>;
1218
+ /**
1219
+ * Search memories in the vector database
1220
+ */
1221
+ private coerceStringArray;
1222
+ private coerceString;
1223
+ private coerceBoolean;
1224
+ private coerceNumber;
1225
+ private asRecord;
1226
+ private toRecordArray;
1227
+ private buildMetadata;
1228
+ private normalizeMemoryResult;
1229
+ /**
1230
+ * Search memories in the vector database
1231
+ */
1232
+ searchMemories(query: string, limit?: number, scoreThreshold?: number, filters?: MemorySearchFilters): Promise<VectorMemory[]>;
1233
+ /**
1234
+ * Get user's memories with pagination
1235
+ */
1236
+ getMyMemories(skip?: number, limit?: number): Promise<VectorMemory[]>;
1237
+ /**
1238
+ * Delete a memory from the vector database
1239
+ */
1240
+ deleteMemory(memoryId: string): Promise<boolean>;
1241
+ /**
1242
+ * Update a memory in the vector database (e.g., pin/unpin)
1243
+ */
1244
+ updateMemory(memoryId: string, updates: {
1245
+ pinned?: boolean;
1246
+ content?: string;
1247
+ title?: string;
1248
+ tags?: string[];
1249
+ }): Promise<boolean>;
1250
+ /**
1251
+ * Batch create memories in the vector database
1252
+ */
1253
+ batchCreateMemories(memories: Array<{
1254
+ content: string;
1255
+ title?: string;
1256
+ tags?: string[];
1257
+ }>, mode?: 'append' | 'replace' | 'smartDedupe', clearExisting?: boolean): Promise<{
1258
+ success: boolean;
1259
+ message: string;
1260
+ results: Array<{
1261
+ content: string;
1262
+ success: boolean;
1263
+ memoryId?: string;
1264
+ mongoId?: string;
1265
+ contentLength?: number;
1266
+ message: string;
1267
+ action: string;
1268
+ }>;
1269
+ summary: {
1270
+ mode: string;
1271
+ totalProcessed: number;
1272
+ successCount: number;
1273
+ failureCount: number;
1274
+ skippedCount: number;
1275
+ clearedExistingCount: number;
1276
+ clearedExisting: boolean;
1277
+ };
1278
+ }>;
1279
+ /**
1280
+ * Advanced batch create memories with chunking and progress reporting
1281
+ */
1282
+ batchCreateMemoriesAdvanced(memories: Array<{
1283
+ content: string;
1284
+ title?: string;
1285
+ tags?: string[];
1286
+ }>, options?: {
1287
+ mode?: 'append' | 'replace' | 'smartDedupe';
1288
+ clearExisting?: boolean;
1289
+ chunkSize?: number;
1290
+ onProgress?: (current: number, total: number, message: string) => void;
1291
+ validateContent?: boolean;
1292
+ }): Promise<{
1293
+ success: boolean;
1294
+ message: string;
1295
+ totalMemories: number;
1296
+ successCount: number;
1297
+ failureCount: number;
1298
+ skippedCount: number;
1299
+ errors: string[];
1300
+ warnings: string[];
1301
+ chunks: number;
1302
+ duration: number;
1303
+ }>;
1304
+ /**
1305
+ * Upload file to S3 API and get file ID
1306
+ *
1307
+ * @param file - The file to upload
1308
+ * @param shareWithTeam - Whether to share the file with team members.
1309
+ * If true and user has team info, file goes to team bucket.
1310
+ * If false, file goes to user's personal bucket.
1311
+ * Defaults to true for backward compatibility.
1312
+ * @returns Promise<FileUploadResult> with success status and file ID
1313
+ */
1314
+ uploadFile(file: File, shareWithTeam?: boolean): Promise<FileUploadResult>;
1315
+ /**
1316
+ * Embed a document in the vector database via Gateway API
1317
+ */
1318
+ embedDocument(fileId: string, shareWithTeam?: boolean): Promise<{
1319
+ success: boolean;
1320
+ message?: string;
1321
+ }>;
1322
+ /**
1323
+ * Search documents in the vector database
1324
+ */
1325
+ searchDocuments(query: string, limit?: number, scoreThreshold?: number): Promise<VectorDocument[]>;
1326
+ /**
1327
+ * Get available files that haven't been embedded
1328
+ */
1329
+ getAvailableFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1330
+ /**
1331
+ * Get user's files - tries both Gateway API and S3 API
1332
+ */
1333
+ getUserFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1334
+ /**
1335
+ * Get user's files from S3 API as fallback
1336
+ */
1337
+ private getUserFilesFromS3;
1338
+ /**
1339
+ * Download a file using MongoDB ObjectId (secure method)
1340
+ */
1341
+ downloadFile(fileId: string, filename: string): Promise<void>;
1342
+ /**
1343
+ * Get file blob using MongoDB ObjectId (for displaying content in modal)
1344
+ */
1345
+ getFileBlob(fileId: string): Promise<Blob>;
1346
+ /**
1347
+ * Get file content for preview using MongoDB ObjectId (from Gateway API metadata)
1348
+ */
1349
+ getFilePreview(fileId: string, maxSize?: number): Promise<{
1350
+ content: string;
1351
+ mimeType: string;
1352
+ } | null>;
1353
+ /**
1354
+ * Delete a document from vector database
1355
+ */
1356
+ deleteDocument(fileId: string): Promise<boolean>;
1357
+ /**
1358
+ * Search both memories and documents simultaneously
1359
+ */
1360
+ searchAll(query: string, memoryLimit?: number, documentLimit?: number, scoreThreshold?: number): Promise<SearchResult>;
1361
+ /**
1362
+ * Configure the service with API URLs
1363
+ * This should be called by the main application with environment variables
1364
+ */
1365
+ configure(gatewayApiUrl: string, s3ApiUrl: string): void;
1366
+ /**
1367
+ * Manual debug function to test Gateway API connection
1368
+ * Call this from browser console to debug API issues
1369
+ */
1370
+ debugTestConnection(): Promise<void>;
1371
+ /**
1372
+ * Test embedding a specific file ID that you know exists
1373
+ */
1374
+ debugTestEmbedding(fileId: string): Promise<void>;
1375
+ }
1376
+ declare const vectorDatabaseService: VectorDatabaseService;
1377
+
1378
+ interface MigrationStatus {
1379
+ success: boolean;
1380
+ migratedMemories: number;
1381
+ migratedDocuments: number;
1382
+ errors: string[];
1383
+ warnings: string[];
1384
+ totalTime: number;
1385
+ }
1386
+ interface MigrationProgress {
1387
+ phase: 'memories' | 'documents' | 'cleanup' | 'complete';
1388
+ current: number;
1389
+ total: number;
1390
+ currentItem?: string;
1391
+ errors: string[];
1392
+ }
1393
+ /**
1394
+ * Vector Database Migration Service
1395
+ *
1396
+ * Handles migration of memories and documents from IndexedDB to vector database
1397
+ * when advanced semantic search is enabled for the first time.
1398
+ *
1399
+ * Features:
1400
+ * - Batch migration to avoid overwhelming the API
1401
+ * - Progress tracking with user feedback
1402
+ * - Error handling and retry logic
1403
+ * - Cleanup of migrated IndexedDB data (optional)
1404
+ * - Rollback capability in case of issues
1405
+ */
1406
+ declare class VectorMigrationService {
1407
+ private static readonly BATCH_SIZE;
1408
+ private static readonly RETRY_DELAY;
1409
+ private static readonly MAX_RETRIES;
1410
+ private migrationKey;
1411
+ private progressCallbacks;
1412
+ /**
1413
+ * Check if migration has already been completed
1414
+ */
1415
+ isMigrationCompleted(): boolean;
1416
+ /**
1417
+ * Mark migration as completed
1418
+ */
1419
+ markMigrationCompleted(): void;
1420
+ /**
1421
+ * Reset migration status (for testing or re-migration)
1422
+ */
1423
+ resetMigrationStatus(): void;
1424
+ /**
1425
+ * Add progress callback for UI updates
1426
+ */
1427
+ onProgress(callback: (progress: MigrationProgress) => void): void;
1428
+ /**
1429
+ * Remove progress callback
1430
+ */
1431
+ removeProgressCallback(callback: (progress: MigrationProgress) => void): void;
1432
+ /**
1433
+ * Notify progress callbacks
1434
+ */
1435
+ private notifyProgress;
1436
+ /**
1437
+ * Sleep utility for rate limiting
1438
+ */
1439
+ private sleep;
1440
+ /**
1441
+ * Get all memories directly from IndexedDB
1442
+ */
1443
+ private getAllMemories;
1444
+ /**
1445
+ * Get all knowledge documents directly from IndexedDB
1446
+ */
1447
+ private getAllDocuments;
1448
+ /**
1449
+ * Clear all memories from IndexedDB
1450
+ */
1451
+ private clearAllMemories;
1452
+ /**
1453
+ * Clear all documents from IndexedDB
1454
+ */
1455
+ private clearAllDocuments;
1456
+ /**
1457
+ * Migrate memories from IndexedDB to vector database
1458
+ */
1459
+ private migrateMemories;
1460
+ /**
1461
+ * Migrate documents from IndexedDB to vector database
1462
+ */
1463
+ private migrateDocuments;
1464
+ /**
1465
+ * Perform full migration from IndexedDB to vector database
1466
+ */
1467
+ performMigration(options?: {
1468
+ cleanupAfterMigration?: boolean;
1469
+ skipIfCompleted?: boolean;
1470
+ }): Promise<MigrationStatus>;
1471
+ /**
1472
+ * Clean up local IndexedDB data after successful migration
1473
+ */
1474
+ private cleanupLocalData;
1475
+ /**
1476
+ * Estimate migration time and data size
1477
+ */
1478
+ estimateMigration(): Promise<{
1479
+ memoryCount: number;
1480
+ documentCount: number;
1481
+ estimatedTime: number;
1482
+ estimatedDataSize: number;
1483
+ }>;
1484
+ }
1485
+ declare const vectorMigrationService: VectorMigrationService;
1486
+
1487
+ interface VectorStoreStatus {
1488
+ isEnabled: boolean;
1489
+ isAvailable: boolean;
1490
+ isMigrating: boolean;
1491
+ migrationRequired: boolean;
1492
+ migrationProgress?: MigrationProgress;
1493
+ lastError?: string;
1494
+ }
1495
+ interface SearchOptions {
1496
+ memoryLimit?: number;
1497
+ documentLimit?: number;
1498
+ scoreThreshold?: number;
1499
+ useVector?: boolean;
1500
+ filters?: MemorySearchFilters;
1501
+ }
1502
+ /**
1503
+ * Advanced Vector Storage Hook
1504
+ *
1505
+ * Manages the transition between IndexedDB and Vector Database storage
1506
+ * when advanced semantic search is enabled. Handles feature gating,
1507
+ * migration, and unified API for both storage backends.
1508
+ *
1509
+ * Features:
1510
+ * - Automatic migration when advanced search is first enabled
1511
+ * - Unified API that works with both IndexedDB and Vector DB
1512
+ * - Feature gating based on subscription tier and admin claims
1513
+ * - Progress tracking for migration operations
1514
+ * - Fallback to IndexedDB if vector service unavailable
1515
+ */
1516
+ declare const useVectorStore: () => {
1517
+ status: VectorStoreStatus;
1518
+ isVectorEnabled: boolean;
1519
+ refreshCompatibilityCheck: () => void;
1520
+ performMigration: (options?: {
1521
+ cleanupAfterMigration?: boolean;
1522
+ }) => Promise<MigrationStatus>;
1523
+ getMigrationEstimate: () => Promise<{
1524
+ memoryCount: number;
1525
+ documentCount: number;
1526
+ estimatedTime: number;
1527
+ estimatedDataSize: number;
1528
+ }>;
1529
+ addMemory: (content: string, tags?: string[], source?: "auto" | "user", options?: {
1530
+ metadata?: VectorMemoryMetadata;
1531
+ pinned?: boolean;
1532
+ title?: string;
1533
+ lastReferencedAt?: string;
1534
+ }) => Promise<{
1535
+ success: boolean;
1536
+ id?: string;
1537
+ error?: string;
1538
+ }>;
1539
+ batchCreateMemories: (memories: Array<{
1540
+ content: string;
1541
+ title?: string;
1542
+ tags?: string[];
1543
+ }>, mode?: "append" | "replace" | "smartDedupe", clearExisting?: boolean) => Promise<{
1544
+ success: boolean;
1545
+ message: string;
1546
+ results: Array<{
1547
+ content: string;
1548
+ success: boolean;
1549
+ memoryId?: string;
1550
+ mongoId?: string;
1551
+ contentLength?: number;
1552
+ message: string;
1553
+ action: string;
1554
+ }>;
1555
+ summary: {
1556
+ mode: string;
1557
+ totalProcessed: number;
1558
+ successCount: number;
1559
+ failureCount: number;
1560
+ skippedCount: number;
1561
+ clearedExistingCount: number;
1562
+ clearedExisting: boolean;
1563
+ };
1564
+ }>;
1565
+ batchCreateMemoriesAdvanced: (memories: Array<{
1566
+ content: string;
1567
+ title?: string;
1568
+ tags?: string[];
1569
+ }>, options?: {
1570
+ mode?: "append" | "replace" | "smartDedupe";
1571
+ clearExisting?: boolean;
1572
+ chunkSize?: number;
1573
+ onProgress?: (current: number, total: number, message: string) => void;
1574
+ validateContent?: boolean;
1575
+ }) => Promise<{
1576
+ success: boolean;
1577
+ message: string;
1578
+ totalMemories: number;
1579
+ successCount: number;
1580
+ failureCount: number;
1581
+ skippedCount: number;
1582
+ errors: string[];
1583
+ warnings: string[];
1584
+ chunks: number;
1585
+ duration: number;
1586
+ }>;
1587
+ batchImportMemories: (fromIndexedDB?: boolean, mode?: "append" | "replace" | "smartDedupe") => Promise<{
1588
+ success: boolean;
1589
+ message: string;
1590
+ migratedCount: number;
1591
+ totalMemories: number;
1592
+ errors: string[];
1593
+ }>;
1594
+ searchMemories: (query: string, options?: SearchOptions) => Promise<VectorMemory[]>;
1595
+ getUserMemories: (skip?: number, limit?: number) => Promise<VectorMemory[]>;
1596
+ deleteMemory: (memoryId: string) => Promise<{
1597
+ success: boolean;
1598
+ error?: string;
1599
+ }>;
1600
+ updateMemory: (memoryId: string, updates: {
1601
+ pinned?: boolean;
1602
+ content?: string;
1603
+ title?: string;
1604
+ tags?: string[];
1605
+ }) => Promise<{
1606
+ success: boolean;
1607
+ error?: string;
1608
+ }>;
1609
+ uploadDocument: (file: File, shareWithTeam?: boolean) => Promise<{
1610
+ success: boolean;
1611
+ fileId?: string;
1612
+ error?: string;
1613
+ }>;
1614
+ searchDocuments: (query: string, options?: SearchOptions) => Promise<VectorDocument[]>;
1615
+ getUserDocuments: (skip?: number, limit?: number) => Promise<VectorDocument[]>;
1616
+ deleteDocument: (fileId: string) => Promise<{
1617
+ success: boolean;
1618
+ error?: string;
1619
+ }>;
1620
+ downloadVectorFile: (fileId: string, filename: string) => Promise<void>;
1621
+ getFilePreview: (fileId: string) => Promise<{
1622
+ content: string;
1623
+ mimeType: string;
1624
+ } | null>;
1625
+ getFileBlob: (fileId: string) => Promise<Blob>;
1626
+ searchAll: (query: string, options?: SearchOptions) => Promise<SearchResult>;
1627
+ initializeVectorService: () => Promise<void>;
1628
+ };
1629
+
1630
+ interface GatewayContract {
1631
+ chat(request: GatewayChatRequest): Promise<GatewayChatResponse>;
1632
+ generate(request: GatewayGenerateRequest): Promise<GatewayGenerateResponse>;
1633
+ health(): Promise<GatewayHealthResponse>;
1634
+ }
1635
+
1636
+ export { type AIChatRequest, type AIChatResponse, type AIGenerateRequest, type AIGenerateResponse, type AIMessage, type AIModel, type AIProviderConfig, Chat, type ChatConfig, ChatModal, ChatProvider, type CreateMemoryOptions, DEFAULT_TIER_FEATURES, DebugLogger, type FeatureEvaluation, type FeatureFlagConfig, FeatureFlagContext, type FeatureFlagContextValue, FeatureFlagProvider, type FeatureFlagProviderProps, FeatureFlagService, type FeatureKey, type FeatureMatrix, FeedbackButton, type FeedbackButtonProps, type FeedbackCategories, FeedbackModal, type FeedbackModalProps, type FeedbackPriorities, type FeedbackRequest, type FeedbackResponse, type FileUploadResult, type GatewayChatRequest, type GatewayChatResponse, type GatewayContract, type GatewayGenerateRequest, type GatewayGenerateResponse, type GatewayHealthResponse, type GatewayMemoryRecord, type GatewayMemoryResponse, type GatewayMessage, type GatewayMessageContent, type GatewayModel, type GatewayModelsResponse, type GatewayQueryOptions, type LogContext, Management, type MemorySearchFilters, type MigrationProgress, type MigrationStatus, type NotificationConfig, type NotificationContextType, NotificationProvider, type NotificationProviderProps, NotificationService, OSS_DEFAULT_FEATURES, type PackageSettings, SYSTEM_FLAGS, type SearchOptions, type SearchResult, StreamingTTSClient, SubscriptionExpiredGuard, type SubscriptionExpiredGuardProps, SubscriptionExpiredModal, type SubscriptionExpiredModalProps, type SubscriptionTier, type TTSOptions, type TTSProgress, TTSState, type TrialUsage, type UploadRequest, type UseTTSReturn, VectorDatabaseService, type VectorDocument, type VectorMemory, type VectorMemoryMetadata, VectorMigrationService, type VectorStoreStatus, type VoiceModelsResponse, VoiceService, type VoiceState, authenticationService, debugLogger, defineCustomElement, featureFlagService, getCriticalConfig, getFeatureMatrix, getStreamingTTSClient, getSystemConstants, getTTSState, handleHttpError, handleSubscriptionUpgrade, handleValidationError, initializeCoreSystem, notificationService, pauseTTS, previewTierUpgrade, resumeTTS, showInfoNotification, showSuccessNotification, speakStream as speakWithStreaming, stopTTS, syncSubscriptionWithAPI, updateSubscriptionTier, useFeatureFlag, useFeatureVisibility, useFeatures, useGatewayHealth, useGatewayMemory, useGatewayModels, useGlobalTTS, useNotification, useNotificationService, useTTS, useVectorStore, useVoiceStore, useVoices, validateEnvironment, validateSystemIntegrity, vectorDatabaseService, vectorMigrationService, voiceService };