@iblai/web-utils 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-layer/src/core/index.d.ts +7 -1
- package/dist/data-layer/src/features/analytics/constants.d.ts +6 -6
- package/dist/data-layer/src/features/analytics/types.d.ts +9 -0
- package/dist/data-layer/src/features/api-keys/api-slice.d.ts +72 -24
- package/dist/data-layer/src/features/apps/api-slice.d.ts +72 -24
- package/dist/data-layer/src/features/artifacts/api-slice.d.ts +1798 -0
- package/dist/data-layer/src/features/artifacts/constants.d.ts +42 -0
- package/dist/data-layer/src/features/artifacts/types.d.ts +37 -0
- package/dist/data-layer/src/features/auth/types.d.ts +1 -1
- package/dist/data-layer/src/features/billing/api-slice.d.ts +15 -5
- package/dist/data-layer/src/features/billing/constants.d.ts +16 -0
- package/dist/data-layer/src/features/billing/custom-api-slice.d.ts +634 -0
- package/dist/data-layer/src/features/billing/types.d.ts +35 -0
- package/dist/data-layer/src/features/career/api-slice.d.ts +342 -114
- package/dist/data-layer/src/features/catalog/api-slice.d.ts +1050 -317
- package/dist/data-layer/src/features/chat/api-slice.d.ts +204 -68
- package/dist/data-layer/src/features/chat-history/api-slice.d.ts +202 -60
- package/dist/data-layer/src/features/core/api-slice.d.ts +1143 -134
- package/dist/data-layer/src/features/core/custom-public-image-asset-api-slice.d.ts +60 -20
- package/dist/data-layer/src/features/credentials/api-slice.d.ts +3706 -146
- package/dist/data-layer/src/features/credentials/constants.d.ts +9 -1
- package/dist/data-layer/src/features/credentials/custom-api-slice.d.ts +535 -2
- package/dist/data-layer/src/features/credentials/types.d.ts +14 -0
- package/dist/data-layer/src/features/datasets/api-slice.d.ts +60 -197
- package/dist/data-layer/src/features/llms/api-slice.d.ts +60 -20
- package/dist/data-layer/src/features/mcp/api-slice.d.ts +2613 -0
- package/dist/data-layer/src/features/mcp/constants.d.ts +57 -0
- package/dist/data-layer/src/features/mcp/types.d.ts +176 -0
- package/dist/data-layer/src/features/memory/types.d.ts +1 -0
- package/dist/data-layer/src/features/mentor/api-slice.d.ts +1789 -473
- package/dist/data-layer/src/features/mentor/constants.d.ts +7 -1
- package/dist/data-layer/src/features/mentor/custom-api-slice.d.ts +162 -1
- package/dist/data-layer/src/features/mentor/types.d.ts +7 -1
- package/dist/data-layer/src/features/mentor-categories/api-slice.d.ts +117 -39
- package/dist/data-layer/src/features/moderation-logs/api-slice.d.ts +705 -0
- package/dist/data-layer/src/features/notifications/api-slice.d.ts +214 -86
- package/dist/data-layer/src/features/per-learner/api-slice.d.ts +174 -58
- package/dist/data-layer/src/features/platform/api-slice.d.ts +1568 -293
- package/dist/data-layer/src/features/platform/types.d.ts +13 -0
- package/dist/data-layer/src/features/prompts/api-slice.d.ts +249 -83
- package/dist/data-layer/src/features/reports/api-slice.d.ts +145 -41
- package/dist/data-layer/src/features/search/ai-search-api-slice.d.ts +399 -1
- package/dist/data-layer/src/features/search/api-slice.d.ts +117 -39
- package/dist/data-layer/src/features/search/constants.d.ts +10 -0
- package/dist/data-layer/src/features/search/types.d.ts +72 -0
- package/dist/data-layer/src/features/sessions/api-slice.d.ts +440 -46
- package/dist/data-layer/src/features/skills/api-slice.d.ts +231 -77
- package/dist/data-layer/src/features/tenant/api-slice.d.ts +123 -41
- package/dist/data-layer/src/features/tools/api-slice.d.ts +60 -20
- package/dist/data-layer/src/features/training-documents/api-slice.d.ts +141 -47
- package/dist/data-layer/src/features/user-invitations/api-slice.d.ts +66 -22
- package/dist/data-layer/src/index.d.ts +6 -0
- package/dist/index.d.ts +367 -33
- package/dist/index.esm.js +7619 -3934
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7644 -3931
- package/dist/index.js.map +1 -1
- package/dist/package.json +22 -12
- package/dist/web-utils/src/__tests__/index.mobile.test.d.ts +7 -0
- package/dist/web-utils/src/__tests__/index.web.test.d.ts +8 -0
- package/dist/web-utils/src/constants/__tests__/chat.test.d.ts +1 -0
- package/dist/web-utils/src/constants/chat.d.ts +1 -1
- package/dist/web-utils/src/features/chat/__tests__/slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/chat/slice.d.ts +37 -2
- package/dist/web-utils/src/features/csv/combine-csv.d.ts +35 -0
- package/dist/web-utils/src/features/csv/index.d.ts +1 -0
- package/dist/web-utils/src/features/files/__tests__/filesSlice.test.d.ts +1 -0
- package/dist/web-utils/src/features/index.d.ts +1 -0
- package/dist/web-utils/src/hoc/index.d.ts +2 -0
- package/dist/web-utils/src/hoc/with-permissions.d.ts +44 -0
- package/dist/web-utils/src/hooks/__tests__/use-mentor-settings.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/ollama-client.d.ts +57 -0
- package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +10 -4
- package/dist/web-utils/src/hooks/chat/use-advanced-chat.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/use-chat-v2.d.ts +59 -2
- package/dist/web-utils/src/hooks/chat/use-chat-v2.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/use-chat.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/use-get-chat-details.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/use-mentor-tools.d.ts +2 -0
- package/dist/web-utils/src/hooks/chat/use-mentor-tools.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/index.d.ts +1 -0
- package/dist/web-utils/src/hooks/subscription-v2/constants.d.ts +5 -0
- package/dist/web-utils/src/hooks/subscription-v2/use-subscription-handler.d.ts +56 -1
- package/dist/web-utils/src/hooks/tenant-metadata/__tests__/config-loader.test.d.ts +10 -0
- package/dist/web-utils/src/hooks/tenant-metadata/__tests__/use-tenant-metadata.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/tenant-metadata/use-tenant-metadata.d.ts +2 -1
- package/dist/web-utils/src/index.d.ts +1 -0
- package/dist/web-utils/src/index.mobile.d.ts +130 -10
- package/dist/web-utils/src/index.web.d.ts +174 -12
- package/dist/web-utils/src/providers/__tests__/mentor-provider.test.d.ts +1 -0
- package/dist/web-utils/src/providers/__tests__/tenant-provider.test.d.ts +1 -0
- package/dist/web-utils/src/providers/auth-provider.d.ts +5 -2
- package/dist/web-utils/src/providers/mentor-provider.d.ts +2 -1
- package/dist/web-utils/src/providers/tenant-provider.d.ts +7 -2
- package/dist/web-utils/src/types/index.d.ts +1 -0
- package/dist/web-utils/src/types/subscription.d.ts +21 -0
- package/dist/web-utils/src/utils/__tests__/auth.test.d.ts +1 -0
- package/dist/web-utils/src/utils/__tests__/constants.test.d.ts +1 -0
- package/dist/web-utils/src/utils/__tests__/helpers.test.d.ts +1 -0
- package/dist/web-utils/src/utils/__tests__/platform.test.d.ts +1 -0
- package/dist/web-utils/src/utils/constants.d.ts +1 -0
- package/dist/web-utils/src/utils/data/__tests__/advanced-tab.test.d.ts +1 -0
- package/dist/web-utils/src/utils/helpers.d.ts +6 -0
- package/dist/web-utils/src/utils/index.d.ts +1 -0
- package/dist/web-utils/src/utils/platform.d.ts +1 -0
- package/dist/web-utils/tests/hooks/chat/use-mentor-tools.test.d.ts +1 -0
- package/dist/web-utils/tests/hooks/subscription-v2/use-subscription-handler.test.d.ts +1 -0
- package/dist/web-utils/tests/hooks/use-mentor-settings.test.d.ts +1 -0
- package/dist/web-utils/tests/providers/mentor-provider.test.d.ts +1 -0
- package/dist/web-utils/tests/providers/tenant-provider.test.d.ts +1 -0
- package/dist/web-utils/tests/utils/helpers.test.d.ts +1 -0
- package/dist/web-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import * as _iblai_iblai_api from '@iblai/iblai-api';
|
|
1
2
|
import { FreeUsageCount, StripeCustomerPortalRequest } from '@iblai/iblai-api';
|
|
2
3
|
import { StripeContextResponse, UploadProfileImageResponse, RemoveProfileImageResponse, StorageService, TokenResponse, FileUploadURLResponse } from '@iblai/data-layer';
|
|
3
|
-
import * as React
|
|
4
|
+
import * as React from 'react';
|
|
4
5
|
import React__default from 'react';
|
|
5
6
|
import { PricingModalData as PricingModalData$1 } from '@web-utils/types/subscription';
|
|
6
7
|
import { OpUnitType } from 'dayjs';
|
|
7
8
|
import duration from 'dayjs/plugin/duration';
|
|
8
9
|
import { ChatStatus as ChatStatus$1 } from '@web-utils/features';
|
|
10
|
+
import { Error402MessageData as Error402MessageData$1, Tenant as Tenant$3 } from '@web-utils/types';
|
|
9
11
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
10
12
|
import { Slice } from '@reduxjs/toolkit';
|
|
11
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
12
|
-
import { Tenant as Tenant$3 } from '@web-utils/types';
|
|
13
14
|
import { z } from 'zod';
|
|
14
15
|
|
|
15
16
|
interface Tenant$2 {
|
|
@@ -182,19 +183,74 @@ declare const useSubscriptionHandlerV2: (subscriptionFlow: SubscriptionFlowV2) =
|
|
|
182
183
|
handleSubscriptionCheck: () => Promise<void>;
|
|
183
184
|
bannerButtonTriggerCallback: (trigger: string) => ((returnURL?: string) => Promise<void>) | (() => void);
|
|
184
185
|
CREDIT_INTERVAL_CHECK_COUNTER: number;
|
|
185
|
-
getBillingURL: ({ returnURL, includeSubscriptionIdIfNeeded, }: {
|
|
186
|
+
getBillingURL: ({ returnURL, includeSubscriptionIdIfNeeded, additionalPayload, }: {
|
|
186
187
|
returnURL: string;
|
|
187
188
|
includeSubscriptionIdIfNeeded?: boolean;
|
|
189
|
+
additionalPayload?: Record<string, any>;
|
|
188
190
|
}) => Promise<string | null | undefined>;
|
|
189
191
|
getTopUpURL: (obtainBillingPageURLIfNeeded?: boolean) => Promise<string | null | undefined>;
|
|
190
192
|
getUserSubscriptionPackage: () => Promise<string | null>;
|
|
193
|
+
getUserActiveApp: (platformKey?: string, useCache?: boolean) => Promise<{
|
|
194
|
+
id: null;
|
|
195
|
+
app: {
|
|
196
|
+
name: string;
|
|
197
|
+
url: string;
|
|
198
|
+
type: string;
|
|
199
|
+
metadata: null;
|
|
200
|
+
onboarding_required: boolean;
|
|
201
|
+
};
|
|
202
|
+
platform: {
|
|
203
|
+
key: any;
|
|
204
|
+
name: any;
|
|
205
|
+
org: any;
|
|
206
|
+
lms_url: null;
|
|
207
|
+
cms_url: null;
|
|
208
|
+
portal_url: null;
|
|
209
|
+
is_advertising: boolean;
|
|
210
|
+
is_enterprise: boolean;
|
|
211
|
+
};
|
|
212
|
+
subscription: {
|
|
213
|
+
identifier: any;
|
|
214
|
+
product: null;
|
|
215
|
+
active: boolean;
|
|
216
|
+
subscription_ends: null;
|
|
217
|
+
subscription_starts: null;
|
|
218
|
+
created_on: null;
|
|
219
|
+
last_updated: null;
|
|
220
|
+
owner: {
|
|
221
|
+
email: null;
|
|
222
|
+
username: null;
|
|
223
|
+
};
|
|
224
|
+
trial_ends: null;
|
|
225
|
+
entitlements: {
|
|
226
|
+
has_credits: any;
|
|
227
|
+
account_id: any;
|
|
228
|
+
available_credits: any;
|
|
229
|
+
};
|
|
230
|
+
uuid: any;
|
|
231
|
+
stripe_mode: null;
|
|
232
|
+
status: string;
|
|
233
|
+
subscription_id: null;
|
|
234
|
+
product_sku: any;
|
|
235
|
+
};
|
|
236
|
+
provider: string;
|
|
237
|
+
is_admin: boolean;
|
|
238
|
+
is_active: boolean;
|
|
239
|
+
metadata: null;
|
|
240
|
+
onboarding_completed: boolean;
|
|
241
|
+
free_trial_started: any;
|
|
242
|
+
free_trial_expired: boolean;
|
|
243
|
+
has_active_subscription: boolean;
|
|
244
|
+
pricing_table: any;
|
|
245
|
+
} | null>;
|
|
246
|
+
getUserActiveAppLegacy: (platformKey?: string, useCache?: boolean) => Promise<_iblai_iblai_api.UserApp | undefined>;
|
|
191
247
|
};
|
|
192
248
|
|
|
193
249
|
declare const useExternalPricingPlan: ({ pricingModalData, userEmail, }: {
|
|
194
250
|
pricingModalData: PricingModalData$1;
|
|
195
251
|
userEmail: string;
|
|
196
252
|
}) => {
|
|
197
|
-
pricingBoxIframeRef: React
|
|
253
|
+
pricingBoxIframeRef: React.RefObject<null>;
|
|
198
254
|
};
|
|
199
255
|
|
|
200
256
|
declare const SUBSCRIPTION_V2_TRIGGERS: {
|
|
@@ -248,6 +304,11 @@ declare const SUBSCRIPTION_PACKAGES: {
|
|
|
248
304
|
STARTER_PACKAGE: (productName: string) => string;
|
|
249
305
|
PRO_PACKAGE: (productName: string) => string;
|
|
250
306
|
};
|
|
307
|
+
declare const SUBSCRIPTION_PACKAGES_V2: {
|
|
308
|
+
FREE_PACKAGE: string;
|
|
309
|
+
STARTER_PACKAGE: string;
|
|
310
|
+
PRO_PACKAGE: string;
|
|
311
|
+
};
|
|
251
312
|
|
|
252
313
|
declare const useDayJs: () => {
|
|
253
314
|
getTimeDifferenceBetweenTwoDates: (futureDate: string, pastDate: string, format?: OpUnitType) => number;
|
|
@@ -394,6 +455,36 @@ interface FileAttachment {
|
|
|
394
455
|
uploadUrl?: string;
|
|
395
456
|
fileId?: string;
|
|
396
457
|
}
|
|
458
|
+
interface ArtifactData {
|
|
459
|
+
id: number;
|
|
460
|
+
title: string;
|
|
461
|
+
content: string;
|
|
462
|
+
file_extension: string;
|
|
463
|
+
llm_name?: string;
|
|
464
|
+
llm_provider?: string;
|
|
465
|
+
date_created: string;
|
|
466
|
+
date_updated: string;
|
|
467
|
+
metadata?: Record<string, unknown>;
|
|
468
|
+
username?: string;
|
|
469
|
+
session_id?: string;
|
|
470
|
+
current_version_number?: number;
|
|
471
|
+
version_count?: number;
|
|
472
|
+
}
|
|
473
|
+
interface ArtifactVersion {
|
|
474
|
+
id: number;
|
|
475
|
+
artifact: ArtifactData;
|
|
476
|
+
title: string;
|
|
477
|
+
content: string;
|
|
478
|
+
session_id?: string;
|
|
479
|
+
content_length?: number;
|
|
480
|
+
is_current: boolean;
|
|
481
|
+
is_partial?: boolean;
|
|
482
|
+
chat_message?: number;
|
|
483
|
+
version_number: number;
|
|
484
|
+
date_created: string;
|
|
485
|
+
created_by?: string;
|
|
486
|
+
change_summary?: string;
|
|
487
|
+
}
|
|
397
488
|
interface Message {
|
|
398
489
|
id: string;
|
|
399
490
|
role: "user" | "assistant" | "system";
|
|
@@ -405,11 +496,32 @@ interface Message {
|
|
|
405
496
|
visible: boolean;
|
|
406
497
|
actions?: MessageAction[];
|
|
407
498
|
fileAttachments?: FileAttachment[];
|
|
499
|
+
artifactVersions?: ArtifactVersion[];
|
|
408
500
|
}
|
|
501
|
+
type ArtifactPayload = {
|
|
502
|
+
title: string;
|
|
503
|
+
file_extension: string;
|
|
504
|
+
id: string;
|
|
505
|
+
is_partial?: boolean;
|
|
506
|
+
snippet_start?: number;
|
|
507
|
+
snippet_end?: number;
|
|
508
|
+
};
|
|
409
509
|
type SendMessageOptions = {
|
|
410
510
|
visible?: boolean;
|
|
411
511
|
fileReferences?: FileReference[];
|
|
512
|
+
artifact?: ArtifactPayload;
|
|
412
513
|
} | undefined;
|
|
514
|
+
interface OAuthRequiredData {
|
|
515
|
+
serverName: string;
|
|
516
|
+
serverId: number;
|
|
517
|
+
authUrl: string;
|
|
518
|
+
message: string;
|
|
519
|
+
}
|
|
520
|
+
interface OAuthResolvedData {
|
|
521
|
+
serverName: string;
|
|
522
|
+
serverId: number;
|
|
523
|
+
message: string;
|
|
524
|
+
}
|
|
413
525
|
interface UseChatProps {
|
|
414
526
|
wsUrl: string;
|
|
415
527
|
wsToken: string;
|
|
@@ -440,17 +552,21 @@ interface UseChatProps {
|
|
|
440
552
|
}) => void;
|
|
441
553
|
onAddUserMessage?: (activeTab: AdvancedTab, message: Message) => void;
|
|
442
554
|
sendMessageToParentWebsite?: (payload: unknown) => void;
|
|
443
|
-
on402Error?: (message:
|
|
555
|
+
on402Error?: (message: Error402MessageData$1) => void;
|
|
556
|
+
onOAuthRequired?: (data: OAuthRequiredData) => void;
|
|
557
|
+
onOAuthResolved?: (data: OAuthResolvedData) => void;
|
|
558
|
+
onOfflineWithoutLocalLLM?: () => void;
|
|
559
|
+
isOffline?: boolean;
|
|
444
560
|
}
|
|
445
561
|
interface UseChatReturn {
|
|
446
562
|
sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
|
|
447
|
-
ws:
|
|
448
|
-
isConnected:
|
|
449
|
-
messageQueue:
|
|
563
|
+
ws: React__default.MutableRefObject<WebSocket | null>;
|
|
564
|
+
isConnected: React__default.MutableRefObject<boolean>;
|
|
565
|
+
messageQueue: React__default.MutableRefObject<any[]>;
|
|
450
566
|
stopGenerating: () => void;
|
|
451
567
|
resetConnection: () => void;
|
|
452
568
|
}
|
|
453
|
-
declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, enableHaptics, hapticFeedback, store, errorHandler, onStatusChange, onStreamingChange, onStreamingMessageUpdate, WebSocketImpl, redirectToAuthSpa, sendMessageToParentWebsite, on402Error, }: UseChatProps) => UseChatReturn;
|
|
569
|
+
declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, enableHaptics, hapticFeedback, store, errorHandler, onStatusChange, onStreamingChange, onStreamingMessageUpdate, WebSocketImpl, redirectToAuthSpa, sendMessageToParentWebsite, on402Error, onOAuthRequired, onOAuthResolved, onOfflineWithoutLocalLLM, isOffline, }: UseChatProps) => UseChatReturn;
|
|
454
570
|
|
|
455
571
|
declare const MENTOR_CHAT_DOCUMENTS_EXTENSIONS: string[];
|
|
456
572
|
declare const ANONYMOUS_USERNAME = "anonymous";
|
|
@@ -480,6 +596,7 @@ declare const TOOLS: {
|
|
|
480
596
|
readonly HUMAN_SUPPORT: "human-support";
|
|
481
597
|
readonly CODE_INTERPRETER: "code-interpreter";
|
|
482
598
|
readonly DEEP_RESEARCH: "deep-research";
|
|
599
|
+
readonly STUDY_MODE: "study-mode";
|
|
483
600
|
readonly MEMORY: "memory";
|
|
484
601
|
readonly SCREEN_SHARE: "screen-share";
|
|
485
602
|
readonly POWERPOINT: "powerpoint";
|
|
@@ -501,6 +618,12 @@ declare const isAlphaNumeric32: (text: string) => boolean;
|
|
|
501
618
|
declare const addProtocolToUrl: (url: string) => string;
|
|
502
619
|
declare function getTimeAgo(createdAt: string): string;
|
|
503
620
|
declare const formatRelativeTime: (timestamp: string) => string;
|
|
621
|
+
/**
|
|
622
|
+
* Convert markdown text to plain text by removing markdown formatting
|
|
623
|
+
* @param text - The markdown text to convert
|
|
624
|
+
* @returns Plain text without markdown formatting
|
|
625
|
+
*/
|
|
626
|
+
declare const markdownToPlainText: (text: string) => string;
|
|
504
627
|
|
|
505
628
|
/**
|
|
506
629
|
* Authentication and Authorization Utilities
|
|
@@ -683,13 +806,38 @@ interface HandleLogoutOptions {
|
|
|
683
806
|
*/
|
|
684
807
|
declare function handleLogout(options: HandleLogoutOptions): void;
|
|
685
808
|
|
|
809
|
+
declare const isReactNative: () => boolean;
|
|
810
|
+
declare const isWeb: () => boolean;
|
|
811
|
+
declare const isNode: () => any;
|
|
812
|
+
declare const isExpo: () => any;
|
|
813
|
+
declare const isTauri: () => boolean;
|
|
814
|
+
declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
|
|
815
|
+
declare const safeRequire: (moduleName: string) => any;
|
|
816
|
+
declare const getNextNavigation: () => any;
|
|
817
|
+
|
|
686
818
|
type ChatState = Record<AdvancedTab, Message[]>;
|
|
687
|
-
|
|
688
|
-
}
|
|
819
|
+
type SessionIds = Record<AdvancedTab, string>;
|
|
689
820
|
type StreamingMessage = {
|
|
690
821
|
id: string;
|
|
691
822
|
content: string;
|
|
692
823
|
};
|
|
824
|
+
type StreamingArtifact = {
|
|
825
|
+
id?: number;
|
|
826
|
+
title: string;
|
|
827
|
+
fileExtension: string;
|
|
828
|
+
content: string;
|
|
829
|
+
isUpdate: boolean;
|
|
830
|
+
isPartial: boolean;
|
|
831
|
+
startIndex?: number;
|
|
832
|
+
endIndex?: number;
|
|
833
|
+
org?: string;
|
|
834
|
+
userId?: string;
|
|
835
|
+
sessionId?: string;
|
|
836
|
+
versionNumber?: number;
|
|
837
|
+
metadata?: Record<string, unknown>;
|
|
838
|
+
};
|
|
839
|
+
declare const STREAMING_CONTENT_BUFFER_THRESHOLD = 300;
|
|
840
|
+
declare const STREAMING_CONTENT_FLUSH_INTERVAL = 300;
|
|
693
841
|
declare const defaultSessionIds: SessionIds;
|
|
694
842
|
type ChatStatus = "idle" | "pending" | "streaming" | "stopped" | "error";
|
|
695
843
|
type ChatSliceState = {
|
|
@@ -697,6 +845,7 @@ type ChatSliceState = {
|
|
|
697
845
|
isTyping: boolean;
|
|
698
846
|
streaming: boolean;
|
|
699
847
|
currentStreamingMessage: StreamingMessage;
|
|
848
|
+
currentStreamingArtifact: StreamingArtifact | null;
|
|
700
849
|
activeTab: AdvancedTab;
|
|
701
850
|
sessionId: string;
|
|
702
851
|
sessionIds: SessionIds;
|
|
@@ -714,6 +863,9 @@ type ChatSliceState = {
|
|
|
714
863
|
documentFilter: Record<string, unknown> | null;
|
|
715
864
|
shouldStartNewChat: boolean;
|
|
716
865
|
showingSharedChat: boolean;
|
|
866
|
+
artifactsEnabled: boolean;
|
|
867
|
+
streamingArtifactContentBuffer: string;
|
|
868
|
+
lastArtifactContentFlushTime: number;
|
|
717
869
|
};
|
|
718
870
|
declare const chatActions: _reduxjs_toolkit.CaseReducerActions<_reduxjs_toolkit.SliceCaseReducers<ChatSliceState>, string>;
|
|
719
871
|
declare const chatSliceReducerShared: Reducer<State>;
|
|
@@ -783,6 +935,21 @@ declare const selectShouldStartNewChat: (state: {
|
|
|
783
935
|
declare const selectShowingSharedChat: (state: {
|
|
784
936
|
chatSliceShared: ChatSliceState;
|
|
785
937
|
}) => boolean;
|
|
938
|
+
declare const selectArtifactsEnabled: (state: {
|
|
939
|
+
chatSliceShared: ChatSliceState;
|
|
940
|
+
}) => boolean;
|
|
941
|
+
declare const selectCurrentStreamingArtifact: (state: {
|
|
942
|
+
chatSliceShared: ChatSliceState;
|
|
943
|
+
}) => StreamingArtifact | null;
|
|
944
|
+
declare const selectStreamingArtifactContentBuffer: (state: {
|
|
945
|
+
chatSliceShared: ChatSliceState;
|
|
946
|
+
}) => string;
|
|
947
|
+
declare const selectLastArtifactContentFlushTime: (state: {
|
|
948
|
+
chatSliceShared: ChatSliceState;
|
|
949
|
+
}) => number;
|
|
950
|
+
declare const selectStreamingArtifactFullContent: (state: {
|
|
951
|
+
chatSliceShared: ChatSliceState;
|
|
952
|
+
}) => string | null;
|
|
786
953
|
|
|
787
954
|
interface TimeTrackerConfig {
|
|
788
955
|
intervalSeconds: number;
|
|
@@ -872,6 +1039,42 @@ declare const updateFileRetryCount: _reduxjs_toolkit.ActionCreatorWithoutPayload
|
|
|
872
1039
|
declare const updateFileUrlFromWebSocket: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
|
|
873
1040
|
declare const filesReducer: Reducer<State>;
|
|
874
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* Combines multiple CSV data objects by merging rows based on a common column.
|
|
1044
|
+
* Duplicate columns across CSVs are included only once.
|
|
1045
|
+
*
|
|
1046
|
+
* @param csvDataArray - Array of CSV data objects with headers and rows
|
|
1047
|
+
* @param joinColumn - Column name to use for joining (default: 'email')
|
|
1048
|
+
* @returns Combined CSV data with merged headers and rows
|
|
1049
|
+
*/
|
|
1050
|
+
declare function combineCSVData(csvDataArray: Array<{
|
|
1051
|
+
headers: string[];
|
|
1052
|
+
rows: string[][];
|
|
1053
|
+
}>, joinColumn?: string): {
|
|
1054
|
+
headers: string[];
|
|
1055
|
+
rows: string[][];
|
|
1056
|
+
};
|
|
1057
|
+
/**
|
|
1058
|
+
* Parses CSV text into headers and rows
|
|
1059
|
+
*
|
|
1060
|
+
* @param csvText - Raw CSV text content
|
|
1061
|
+
* @returns Object with headers and rows arrays
|
|
1062
|
+
*/
|
|
1063
|
+
declare function parseCSV(csvText: string): {
|
|
1064
|
+
headers: string[];
|
|
1065
|
+
rows: string[][];
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* Converts CSV data back to CSV text format
|
|
1069
|
+
*
|
|
1070
|
+
* @param data - Object with headers and rows
|
|
1071
|
+
* @returns CSV text content
|
|
1072
|
+
*/
|
|
1073
|
+
declare function csvDataToText(data: {
|
|
1074
|
+
headers: string[];
|
|
1075
|
+
rows: string[][];
|
|
1076
|
+
}): string;
|
|
1077
|
+
|
|
875
1078
|
type ChatMode = "advanced" | "default";
|
|
876
1079
|
|
|
877
1080
|
interface UseExternalPricingProps {
|
|
@@ -891,6 +1094,27 @@ interface CreateStripeCustomerPortalRequest {
|
|
|
891
1094
|
userId: string;
|
|
892
1095
|
requestBody: StripeCustomerPortalRequest;
|
|
893
1096
|
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Shape of the 402 Payment Required error response body.
|
|
1099
|
+
* Note: Only `error` is required. Other fields may not be present
|
|
1100
|
+
* in all error scenarios (e.g., generic API 402 vs WebSocket 402).
|
|
1101
|
+
*/
|
|
1102
|
+
interface Error402MessageData {
|
|
1103
|
+
error: string;
|
|
1104
|
+
message?: string;
|
|
1105
|
+
details?: {
|
|
1106
|
+
platform_key: string;
|
|
1107
|
+
current_balance_usd: string;
|
|
1108
|
+
required_usd: string;
|
|
1109
|
+
deficit_usd: string;
|
|
1110
|
+
};
|
|
1111
|
+
pricing_table?: {
|
|
1112
|
+
pricing_table_id: string;
|
|
1113
|
+
pricing_table_js: string;
|
|
1114
|
+
publishable_key?: string;
|
|
1115
|
+
client_reference_id?: string;
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
894
1118
|
|
|
895
1119
|
declare const userDataSchema: z.ZodObject<{
|
|
896
1120
|
user_display_name: z.ZodString;
|
|
@@ -952,6 +1176,7 @@ interface Tenant {
|
|
|
952
1176
|
name?: string;
|
|
953
1177
|
platform_name: string;
|
|
954
1178
|
is_advertising?: boolean;
|
|
1179
|
+
is_enterprise?: boolean;
|
|
955
1180
|
}
|
|
956
1181
|
|
|
957
1182
|
type Props$5 = {
|
|
@@ -967,11 +1192,15 @@ type Props$5 = {
|
|
|
967
1192
|
errorHandler?: (message: string, error?: any) => void;
|
|
968
1193
|
isPreviewMode?: boolean;
|
|
969
1194
|
mentorShareableToken?: string | null;
|
|
970
|
-
on402Error?: (message:
|
|
1195
|
+
on402Error?: (message: Error402MessageData) => void;
|
|
971
1196
|
cachedSessionId?: Record<string, string>;
|
|
972
1197
|
onStartNewChat?: (sessionId: string) => void;
|
|
1198
|
+
onOAuthRequired?: (data: OAuthRequiredData) => void;
|
|
1199
|
+
onOAuthResolved?: (data: OAuthResolvedData) => void;
|
|
1200
|
+
isOffline?: boolean;
|
|
1201
|
+
onOfflineWithoutLocalLLM?: () => void;
|
|
973
1202
|
};
|
|
974
|
-
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, }: Props$5): {
|
|
1203
|
+
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, }: Props$5): {
|
|
975
1204
|
messages: Message[];
|
|
976
1205
|
isStreaming: boolean;
|
|
977
1206
|
status: ChatStatus;
|
|
@@ -997,6 +1226,8 @@ declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl,
|
|
|
997
1226
|
sessionIds: SessionIds;
|
|
998
1227
|
enableSafetyDisclaimer: boolean;
|
|
999
1228
|
resetConnection: () => void;
|
|
1229
|
+
isLoadingChats: boolean;
|
|
1230
|
+
refetchChats: () => Promise<void>;
|
|
1000
1231
|
};
|
|
1001
1232
|
|
|
1002
1233
|
type Props$4 = {
|
|
@@ -1013,11 +1244,13 @@ declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, }
|
|
|
1013
1244
|
enableWebBrowsing: boolean;
|
|
1014
1245
|
screenSharing: boolean;
|
|
1015
1246
|
deepResearch: boolean;
|
|
1247
|
+
studyMode: boolean;
|
|
1016
1248
|
imageGeneration: boolean;
|
|
1017
1249
|
codeInterpreter: boolean;
|
|
1018
1250
|
promptsIsEnabled: boolean;
|
|
1019
1251
|
googleSlidesIsEnabled: boolean;
|
|
1020
1252
|
googleDocumentIsEnabled: boolean;
|
|
1253
|
+
artifactsEnabled: boolean;
|
|
1021
1254
|
};
|
|
1022
1255
|
|
|
1023
1256
|
interface UserProfileUpdateData {
|
|
@@ -1062,9 +1295,68 @@ interface UseProfileImageUploadReturn {
|
|
|
1062
1295
|
}
|
|
1063
1296
|
declare function useProfileImageUpload(options?: UseProfileImageUploadOptions): UseProfileImageUploadReturn;
|
|
1064
1297
|
|
|
1065
|
-
|
|
1298
|
+
interface OllamaMessage {
|
|
1299
|
+
role: "user" | "assistant" | "system";
|
|
1300
|
+
content: string;
|
|
1301
|
+
}
|
|
1302
|
+
interface OllamaChatRequest {
|
|
1303
|
+
model: string;
|
|
1304
|
+
messages: OllamaMessage[];
|
|
1305
|
+
stream?: boolean;
|
|
1306
|
+
}
|
|
1307
|
+
interface OllamaChatStreamResponse {
|
|
1308
|
+
model: string;
|
|
1309
|
+
created_at: string;
|
|
1310
|
+
message: {
|
|
1311
|
+
role: "assistant";
|
|
1312
|
+
content: string;
|
|
1313
|
+
};
|
|
1314
|
+
done: boolean;
|
|
1315
|
+
total_duration?: number;
|
|
1316
|
+
load_duration?: number;
|
|
1317
|
+
prompt_eval_count?: number;
|
|
1318
|
+
prompt_eval_duration?: number;
|
|
1319
|
+
eval_count?: number;
|
|
1320
|
+
eval_duration?: number;
|
|
1321
|
+
}
|
|
1322
|
+
interface OllamaStreamCallbacks {
|
|
1323
|
+
onStart: (generationId: string) => void;
|
|
1324
|
+
onToken: (token: string, fullContent: string) => void;
|
|
1325
|
+
onEnd: (fullContent: string) => void;
|
|
1326
|
+
onError: (error: string) => void;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Check if Ollama is running and accessible
|
|
1330
|
+
*/
|
|
1331
|
+
declare function checkOllamaHealth(): Promise<boolean>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Check if a specific model is available in Ollama
|
|
1334
|
+
*/
|
|
1335
|
+
declare function checkModelAvailable(model?: string): Promise<boolean>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Send a chat message to Ollama with streaming response
|
|
1338
|
+
* This mimics the WebSocket behavior of the main chat
|
|
1339
|
+
*
|
|
1340
|
+
* When running in Tauri, uses Tauri commands to proxy the request
|
|
1341
|
+
* to avoid mixed content (HTTPS -> HTTP) browser blocking.
|
|
1342
|
+
*/
|
|
1343
|
+
declare function streamOllamaChat(messages: OllamaMessage[], callbacks: OllamaStreamCallbacks, abortController?: AbortController): Promise<void>;
|
|
1344
|
+
/**
|
|
1345
|
+
* Convert chat history to Ollama format
|
|
1346
|
+
*/
|
|
1347
|
+
declare function convertToOllamaMessages(messages: Array<{
|
|
1348
|
+
role: "user" | "assistant" | "system";
|
|
1349
|
+
content: string;
|
|
1350
|
+
}>): OllamaMessage[];
|
|
1351
|
+
/**
|
|
1352
|
+
* Get system prompt for the local LLM
|
|
1353
|
+
*/
|
|
1354
|
+
declare function getLocalLLMSystemPrompt(): OllamaMessage;
|
|
1355
|
+
|
|
1356
|
+
declare const useTenantMetadata: ({ org, spa, skip, }: {
|
|
1066
1357
|
org: string;
|
|
1067
1358
|
spa?: string;
|
|
1359
|
+
skip?: boolean;
|
|
1068
1360
|
}) => {
|
|
1069
1361
|
metadata: any;
|
|
1070
1362
|
platformName: string | undefined;
|
|
@@ -1158,7 +1450,7 @@ declare function clearCurrentTenantCookie(): void;
|
|
|
1158
1450
|
*/
|
|
1159
1451
|
declare function clearAuthCookies(): void;
|
|
1160
1452
|
declare function getUserName(storageService: StorageService): Promise<any>;
|
|
1161
|
-
declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, }: Props$2): {
|
|
1453
|
+
declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, enableStorageSync, }: Props$2): {
|
|
1162
1454
|
isAuthenticating: boolean;
|
|
1163
1455
|
userIsAccessingPublicRoute: boolean;
|
|
1164
1456
|
setUserIsAccessingPublicRoute: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
@@ -1169,6 +1461,7 @@ declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, red
|
|
|
1169
1461
|
*/
|
|
1170
1462
|
type AuthContextType = {
|
|
1171
1463
|
userIsAccessingPublicRoute: boolean;
|
|
1464
|
+
isLoggedIn: boolean;
|
|
1172
1465
|
setUserIsAccessingPublicRoute: (iuserIsAccessingPublicRoute: boolean) => void;
|
|
1173
1466
|
};
|
|
1174
1467
|
declare const AuthContext: React__default.Context<AuthContextType | undefined>;
|
|
@@ -1200,6 +1493,8 @@ type Props$2 = {
|
|
|
1200
1493
|
skipAuthCheck?: boolean;
|
|
1201
1494
|
storageService?: StorageService;
|
|
1202
1495
|
token?: string;
|
|
1496
|
+
enableStorageSync?: boolean;
|
|
1497
|
+
skip?: boolean;
|
|
1203
1498
|
};
|
|
1204
1499
|
/**
|
|
1205
1500
|
* AuthProvider Component
|
|
@@ -1211,18 +1506,7 @@ type Props$2 = {
|
|
|
1211
1506
|
* 4. Handles redirects to auth SPA when needed
|
|
1212
1507
|
* 5. Manages public route access state
|
|
1213
1508
|
*/
|
|
1214
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1215
|
-
|
|
1216
|
-
/**
|
|
1217
|
-
* MentorProvider Component
|
|
1218
|
-
*
|
|
1219
|
-
* Provider that manages AI mentor selection and redirection logic.
|
|
1220
|
-
* It handles:
|
|
1221
|
-
* - Mentor selection based on user preferences and history
|
|
1222
|
-
* - Mentor seeding for new tenants
|
|
1223
|
-
* - Redirection to appropriate mentor or creation flow
|
|
1224
|
-
* - Integration with tenant context for access control
|
|
1225
|
-
*/
|
|
1509
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1226
1510
|
|
|
1227
1511
|
/**
|
|
1228
1512
|
* Props for the MentorProvider component
|
|
@@ -1244,6 +1528,7 @@ type Props$1 = {
|
|
|
1244
1528
|
handleMentorNotFound?: () => Promise<void>;
|
|
1245
1529
|
forceDetermineMentor?: boolean;
|
|
1246
1530
|
onComplete?: () => void;
|
|
1531
|
+
skip?: boolean;
|
|
1247
1532
|
};
|
|
1248
1533
|
/**
|
|
1249
1534
|
* MentorProvider Component
|
|
@@ -1254,7 +1539,7 @@ type Props$1 = {
|
|
|
1254
1539
|
* 3. Manages redirection based on mentor availability
|
|
1255
1540
|
* 4. Integrates with tenant context for access control
|
|
1256
1541
|
*/
|
|
1257
|
-
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, }: Props$1): React__default.ReactNode;
|
|
1542
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1258
1543
|
|
|
1259
1544
|
/**
|
|
1260
1545
|
* Type definition for the tenant context
|
|
@@ -1264,6 +1549,7 @@ type TenantContextType = {
|
|
|
1264
1549
|
determineUserPath: boolean;
|
|
1265
1550
|
setDetermineUserPath: (value: boolean) => void;
|
|
1266
1551
|
tenantKey: string;
|
|
1552
|
+
setTenantKey: (tenantKey: string) => void;
|
|
1267
1553
|
metadata: Record<string, any>;
|
|
1268
1554
|
setMetadata: (metadata: Record<string, any>) => void;
|
|
1269
1555
|
};
|
|
@@ -1290,7 +1576,7 @@ type Props = {
|
|
|
1290
1576
|
onAuthFailure?: (reason: string) => void;
|
|
1291
1577
|
currentTenant: string;
|
|
1292
1578
|
requestedTenant: string;
|
|
1293
|
-
handleTenantSwitch: (tenant: string, saveRedirect: boolean) => Promise<void>;
|
|
1579
|
+
handleTenantSwitch: (tenant: string, saveRedirect: boolean, useCustomDomain?: boolean) => Promise<void>;
|
|
1294
1580
|
saveCurrentTenant: (tenant: Tenant$3) => void;
|
|
1295
1581
|
saveUserTenants: (tenants: Tenant$3[]) => void;
|
|
1296
1582
|
saveVisitingTenant?: (tenant: Tenant$3) => void;
|
|
@@ -1300,6 +1586,10 @@ type Props = {
|
|
|
1300
1586
|
onAutoJoinUserToTenant?: (platformName: string) => void;
|
|
1301
1587
|
redirectToAuthSpa?: (redirectTo?: string, platformKey?: string, logout?: boolean, saveRedirect?: boolean) => void;
|
|
1302
1588
|
username?: string;
|
|
1589
|
+
isIframed?: boolean;
|
|
1590
|
+
setUseMentorProvider?: (useMentorProvider: boolean) => void;
|
|
1591
|
+
skip?: boolean;
|
|
1592
|
+
onLoadPlatformPermissions?: (rbacPermissions: Record<string, unknown> | undefined) => void;
|
|
1303
1593
|
};
|
|
1304
1594
|
/**
|
|
1305
1595
|
* TenantProvider Component
|
|
@@ -1311,13 +1601,13 @@ type Props = {
|
|
|
1311
1601
|
* 4. Handles tenant-specific domain redirects
|
|
1312
1602
|
* 5. Maintains tenant access state
|
|
1313
1603
|
*/
|
|
1314
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
1604
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, }: Props): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
|
|
1315
1605
|
|
|
1316
1606
|
/**
|
|
1317
1607
|
* Chat area size constants
|
|
1318
1608
|
*/
|
|
1319
1609
|
declare const CHAT_AREA_SIZE: {
|
|
1320
|
-
readonly DEFAULT:
|
|
1610
|
+
readonly DEFAULT: 848;
|
|
1321
1611
|
readonly MIN: 672;
|
|
1322
1612
|
readonly MAX: 1024;
|
|
1323
1613
|
};
|
|
@@ -1381,5 +1671,49 @@ declare function createMultipleFileReferences(files: File[], sessionId: string,
|
|
|
1381
1671
|
*/
|
|
1382
1672
|
declare function validateFile(file: File, maxSizeBytes?: number, allowedTypes?: string[]): string | null;
|
|
1383
1673
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1674
|
+
type WithFormPermissionsProps = {
|
|
1675
|
+
name: string | string[];
|
|
1676
|
+
permissions: Record<string, {
|
|
1677
|
+
read?: boolean;
|
|
1678
|
+
write: boolean;
|
|
1679
|
+
delete?: boolean;
|
|
1680
|
+
}>;
|
|
1681
|
+
children: (props: {
|
|
1682
|
+
disabled: boolean;
|
|
1683
|
+
canDelete?: boolean;
|
|
1684
|
+
}) => React__default.ReactNode;
|
|
1685
|
+
enableRBAC?: boolean;
|
|
1686
|
+
};
|
|
1687
|
+
declare const WithFormPermissions: React__default.FC<WithFormPermissionsProps>;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Check if the user has the permissions to access the component
|
|
1691
|
+
* @param rbacResource - The resource in the permission rbac slice to check for. Supports:
|
|
1692
|
+
* - Single resource: "mentors#read"
|
|
1693
|
+
* - OR operator (|): "apitokens#create|apitokens#list" - returns true if ANY permission exists
|
|
1694
|
+
* - AND operator (&): "apitokens#create&apitokens#list" - returns true if ALL permissions exist
|
|
1695
|
+
* @param rbacPermissions - The RBAC permissions object from the store.
|
|
1696
|
+
* @param children - The component to render if the user has the permissions.
|
|
1697
|
+
*/
|
|
1698
|
+
type WithPermissionsProps = {
|
|
1699
|
+
rbacResource: string;
|
|
1700
|
+
rbacPermissions: object;
|
|
1701
|
+
children: (props: {
|
|
1702
|
+
hasPermission: boolean;
|
|
1703
|
+
}) => React__default.ReactNode;
|
|
1704
|
+
};
|
|
1705
|
+
declare const WithPermissions: ({ rbacResource, rbacPermissions, children, }: WithPermissionsProps) => react_jsx_runtime.JSX.Element;
|
|
1706
|
+
/**
|
|
1707
|
+
* Check RBAC permissions for a resource string that may contain operators
|
|
1708
|
+
* @param rbacPermissions - The RBAC permissions object
|
|
1709
|
+
* @param rbacResource - The resource path to check. Supports:
|
|
1710
|
+
* - Single resource: "mentors#read"
|
|
1711
|
+
* - OR operator (|): "apitokens#create|apitokens#list" - returns true if ANY permission exists
|
|
1712
|
+
* - AND operator (&): "apitokens#create&apitokens#list" - returns true if ALL permissions exist
|
|
1713
|
+
* @param enableRBAC - Whether RBAC is enabled (if false, always returns true)
|
|
1714
|
+
* @returns boolean indicating if permission exists
|
|
1715
|
+
*/
|
|
1716
|
+
declare const checkRbacPermission: (rbacPermissions: object, rbacResource: string, enableRBAC?: boolean) => boolean;
|
|
1717
|
+
|
|
1718
|
+
export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, CHAT_AREA_SIZE, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, METADATAS, MentorProvider, STREAMING_CONTENT_BUFFER_THRESHOLD, STREAMING_CONTENT_FLUSH_INTERVAL, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_PACKAGES_V2, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, WithFormPermissions, WithPermissions, addFiles, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatSliceReducerShared, checkModelAvailable, checkOllamaHealth, checkRbacPermission, clearAuthCookies, clearCookies, clearCurrentTenantCookie, clearFiles, combineCSVData, convertToOllamaMessages, createFileReference, createMultipleFileReferences, csvDataToText, defaultSessionIds, deleteCookie, deleteCookieOnAllDomains, filesReducer, filesSlice, formatRelativeTime, getAuthSpaJoinUrl, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getTimeAgo, getUserName, handleLogout, isAlphaNumeric32, isExpo, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isTauri, isWeb, loadMetadataConfig, markdownToPlainText, parseCSV, redirectToAuthSpa, redirectToAuthSpaJoinTenant, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setCookieForAuth, streamOllamaChat, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, uploadToS3, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema, validateFile };
|
|
1719
|
+
export type { AdvancedTab, ArtifactData, ArtifactPayload, ArtifactVersion, AttachedFile, AuthContextType, ChatMode, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Error402MessageData, FileAttachment, FileInfo, FileProcessingEvent, FileReference, FileUploadState, FilesState, HandleLogoutOptions, Message, MessageAction, OAuthRequiredData, OAuthResolvedData, OllamaChatRequest, OllamaChatStreamResponse, OllamaMessage, OllamaStreamCallbacks, PricingModalData, Prompt, RedirectToAuthSpaOptions, SendMessageOptions, SessionIds, StreamingArtifact, StreamingMessage, SubscriptionFlowConfig, SubscriptionFlowConfigV2, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopTrialBannerProps, UploadProgressCallback, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
|