@iblai/web-utils 1.6.8 → 1.6.9
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/features/mentor/privacy.d.ts +61 -0
- package/dist/data-layer/src/index.d.ts +1 -0
- package/dist/index.d.ts +680 -132
- package/dist/index.esm.js +14559 -21739
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14649 -21744
- package/dist/index.js.map +1 -1
- package/dist/package.json +11 -2
- package/dist/web-utils/src/features/chat-input/__tests__/api-slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/chat-input/api-slice.d.ts +12 -0
- package/dist/web-utils/src/features/files/filesSlice.d.ts +3 -0
- package/dist/web-utils/src/features/host-chat/__tests__/slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/host-chat/slice.d.ts +17 -0
- package/dist/web-utils/src/features/index.d.ts +5 -0
- package/dist/web-utils/src/features/rbac/__tests__/rbac-slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/rbac/rbac-slice.d.ts +13 -0
- package/dist/web-utils/src/features/subscription/__tests__/slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/subscription/constants.d.ts +12 -0
- package/dist/web-utils/src/features/subscription/slice.d.ts +29 -0
- package/dist/web-utils/src/features/top-banner/__tests__/slice.test.d.ts +1 -0
- package/dist/web-utils/src/features/top-banner/slice.d.ts +24 -0
- package/dist/web-utils/src/hooks/__tests__/use-accessing-public-route.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-cached-session-id.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-chat-file-upload.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-embed-mode.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-event-callback.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-event-listener.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-file-drag-drop.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-local-storage.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-model-file-upload-capabilities.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-os.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-responsive.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-show-attachment.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-show-free-trial-dialog.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-show-voice-call.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-show-voice-recorder.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-timer.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-tokens.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-user-agreement.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-user.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-voice-chat.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/__tests__/use-welcome-message.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +1 -1
- package/dist/web-utils/src/hooks/chat/use-chat-v2.d.ts +1 -1
- package/dist/web-utils/src/hooks/index.d.ts +23 -0
- package/dist/web-utils/src/hooks/subscription-v2/__tests__/use-402-error-check.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/subscription-v2/use-402-error-check.d.ts +22 -0
- package/dist/web-utils/src/hooks/use-accessing-public-route.d.ts +1 -0
- package/dist/web-utils/src/hooks/use-cached-session-id.d.ts +8 -0
- package/dist/web-utils/src/hooks/use-chat-file-upload.d.ts +17 -0
- package/dist/web-utils/src/hooks/use-embed-mode.d.ts +1 -0
- package/dist/web-utils/src/hooks/use-event-callback.d.ts +2 -0
- package/dist/web-utils/src/hooks/use-event-listener.d.ts +6 -0
- package/dist/web-utils/src/hooks/use-file-drag-drop.d.ts +15 -0
- package/dist/web-utils/src/hooks/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/web-utils/src/hooks/use-local-storage.d.ts +13 -0
- package/dist/web-utils/src/hooks/use-mentor-settings.d.ts +39 -19
- package/dist/web-utils/src/hooks/use-model-file-upload-capabilities.d.ts +21 -0
- package/dist/web-utils/src/hooks/use-os.d.ts +8 -0
- package/dist/web-utils/src/hooks/use-responsive.d.ts +13 -0
- package/dist/web-utils/src/hooks/use-show-attachment.d.ts +7 -0
- package/dist/web-utils/src/hooks/use-show-free-trial-dialog.d.ts +31 -0
- package/dist/web-utils/src/hooks/use-show-voice-call.d.ts +7 -0
- package/dist/web-utils/src/hooks/use-show-voice-recorder.d.ts +7 -0
- package/dist/web-utils/src/hooks/use-timer.d.ts +7 -0
- package/dist/web-utils/src/hooks/use-tokens.d.ts +2 -0
- package/dist/web-utils/src/hooks/use-user-agreement.d.ts +21 -0
- package/dist/web-utils/src/hooks/use-user.d.ts +23 -0
- package/dist/web-utils/src/hooks/use-voice-chat.d.ts +11 -0
- package/dist/web-utils/src/hooks/use-welcome-message.d.ts +16 -0
- package/dist/web-utils/src/providers/__tests__/auth-provider.test.d.ts +1 -0
- package/dist/web-utils/src/providers/__tests__/service-worker-provider.test.d.ts +1 -0
- package/dist/web-utils/src/providers/auth-provider.d.ts +1 -1
- package/dist/web-utils/src/providers/index.d.ts +1 -0
- package/dist/web-utils/src/providers/service-worker-provider.d.ts +21 -0
- package/dist/web-utils/src/services/__tests__/event-bus.test.d.ts +1 -0
- package/dist/web-utils/src/services/__tests__/register-sw.test.d.ts +1 -0
- package/dist/web-utils/src/services/event-bus.d.ts +6 -0
- package/dist/web-utils/src/services/index.d.ts +2 -0
- package/dist/web-utils/src/services/register-sw.d.ts +71 -0
- package/dist/web-utils/src/utils/__tests__/tauri-api-cache.test.d.ts +1 -0
- package/dist/web-utils/src/utils/constants.d.ts +18 -0
- package/dist/web-utils/src/utils/helpers.d.ts +20 -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/src/utils/tauri-api-cache.d.ts +19 -0
- package/package.json +11 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import * as _iblai_iblai_api from '@iblai/iblai-api';
|
|
2
2
|
import { FreeUsageCount, StripeCustomerPortalRequest } from '@iblai/iblai-api';
|
|
3
|
+
import * as _iblai_data_layer from '@iblai/data-layer';
|
|
3
4
|
import { StripeContextResponse, AccessCheckResponse, UploadProfileImageResponse, RemoveProfileImageResponse, StorageService, TokenResponse, FileUploadURLResponse } from '@iblai/data-layer';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import React__default from 'react';
|
|
6
|
-
import { PricingModalData as PricingModalData$
|
|
5
|
+
import * as React$1 from 'react';
|
|
6
|
+
import React__default, { useEffect, RefObject, Dispatch, SetStateAction, ComponentType } from 'react';
|
|
7
|
+
import { PricingModalData as PricingModalData$2 } from '@web-utils/types/subscription';
|
|
7
8
|
import { OpUnitType } from 'dayjs';
|
|
8
9
|
import duration from 'dayjs/plugin/duration';
|
|
9
10
|
import { ChatStatus as ChatStatus$1 } from '@web-utils/features';
|
|
10
11
|
import { Error402MessageData as Error402MessageData$1, Tenant as Tenant$3 } from '@web-utils/types';
|
|
11
12
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
12
13
|
import { Reducer, Slice } from '@reduxjs/toolkit';
|
|
13
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
16
|
+
import { Slice as Slice$1, Reducer as Reducer$1 } from '@reduxjs/toolkit/react';
|
|
17
|
+
import * as redux from 'redux';
|
|
18
|
+
import * as mitt from 'mitt';
|
|
15
19
|
|
|
16
20
|
interface Tenant$2 {
|
|
17
21
|
key: string;
|
|
@@ -247,10 +251,10 @@ declare const useSubscriptionHandlerV2: (subscriptionFlow: SubscriptionFlowV2) =
|
|
|
247
251
|
};
|
|
248
252
|
|
|
249
253
|
declare const useExternalPricingPlan: ({ pricingModalData, userEmail, }: {
|
|
250
|
-
pricingModalData: PricingModalData$
|
|
254
|
+
pricingModalData: PricingModalData$2;
|
|
251
255
|
userEmail: string;
|
|
252
256
|
}) => {
|
|
253
|
-
pricingBoxIframeRef: React.RefObject<null>;
|
|
257
|
+
pricingBoxIframeRef: React$1.RefObject<null>;
|
|
254
258
|
};
|
|
255
259
|
|
|
256
260
|
declare const SUBSCRIPTION_V2_TRIGGERS: {
|
|
@@ -310,6 +314,28 @@ declare const SUBSCRIPTION_PACKAGES_V2: {
|
|
|
310
314
|
PRO_PACKAGE: string;
|
|
311
315
|
};
|
|
312
316
|
|
|
317
|
+
type PricingTablePayload = {
|
|
318
|
+
pricing_table_id?: string;
|
|
319
|
+
publishable_key?: string;
|
|
320
|
+
client_reference_id?: string;
|
|
321
|
+
};
|
|
322
|
+
type Local402Data = {
|
|
323
|
+
error?: string;
|
|
324
|
+
message?: string;
|
|
325
|
+
pricing_table?: PricingTablePayload;
|
|
326
|
+
};
|
|
327
|
+
interface Use402ErrorCheckProps {
|
|
328
|
+
/**
|
|
329
|
+
* Called when an admin hits a 402. Hosts wire this to whatever navigation
|
|
330
|
+
* primitive they use (Next router push, history.pushState, custom event, etc.)
|
|
331
|
+
* to surface the billing tab.
|
|
332
|
+
*/
|
|
333
|
+
navigateToAdminBilling: () => void;
|
|
334
|
+
}
|
|
335
|
+
declare const use402ErrorCheck: ({ navigateToAdminBilling, }: Use402ErrorCheckProps) => {
|
|
336
|
+
handle402Error: (messageData: Local402Data) => Promise<void>;
|
|
337
|
+
};
|
|
338
|
+
|
|
313
339
|
declare const useDayJs: () => {
|
|
314
340
|
getTimeDifferenceBetweenTwoDates: (futureDate: string, pastDate: string, format?: OpUnitType) => number;
|
|
315
341
|
getDayJSDurationObjFromSeconds: (seconds: number) => duration.Duration;
|
|
@@ -485,7 +511,7 @@ interface ArtifactVersion {
|
|
|
485
511
|
created_by?: string;
|
|
486
512
|
change_summary?: string;
|
|
487
513
|
}
|
|
488
|
-
interface Message {
|
|
514
|
+
interface Message$1 {
|
|
489
515
|
id: string;
|
|
490
516
|
role: "user" | "assistant" | "system";
|
|
491
517
|
content: string;
|
|
@@ -550,7 +576,7 @@ interface UseChatProps {
|
|
|
550
576
|
id: string | null;
|
|
551
577
|
content: string;
|
|
552
578
|
}) => void;
|
|
553
|
-
onAddUserMessage?: (activeTab: AdvancedTab, message: Message) => void;
|
|
579
|
+
onAddUserMessage?: (activeTab: AdvancedTab, message: Message$1) => void;
|
|
554
580
|
sendMessageToParentWebsite?: (payload: unknown) => void;
|
|
555
581
|
on402Error?: (message: Error402MessageData$1) => void;
|
|
556
582
|
onOAuthRequired?: (data: OAuthRequiredData) => void;
|
|
@@ -570,6 +596,7 @@ declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationW
|
|
|
570
596
|
|
|
571
597
|
declare const MENTOR_CHAT_DOCUMENTS_EXTENSIONS: string[];
|
|
572
598
|
declare const ANONYMOUS_USERNAME = "anonymous";
|
|
599
|
+
declare const DEFAULT_DISCLAIMER_CONTENT = "By accessing and using the [ibl.ai](http://ibl.ai/) MentorAI platform (\u201CPlatform\u201D), you agree to the following terms. The Platform provides AI-powered mentorship and educational support. You understand that AI responses may contain inaccuracies, and you are responsible for independently verifying any information before relying on it for academic, professional, or personal decisions. Do not input confidential, sensitive, or personally identifiable information of yourself or others.\nAll content, code, and data processed through the Platform remain the property of their respective owners. [ibl.ai](http://ibl.ai/) retains all rights to the Platform\u2019s underlying technology and intellectual property. You are granted a limited, non-exclusive, revocable license to use the Platform for personal or institutional learning purposes only.\nYour use must comply with applicable laws and institutional policies. Misuse\u2014including attempting to bypass security, copy source code, or use the service for unlawful activity\u2014may result in suspension or termination of access. Continued use constitutes acceptance of these terms.";
|
|
573
600
|
declare const MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS = 3;
|
|
574
601
|
declare const LOCAL_STORAGE_KEYS: {
|
|
575
602
|
CURRENT_TENANT: string;
|
|
@@ -579,6 +606,8 @@ declare const LOCAL_STORAGE_KEYS: {
|
|
|
579
606
|
TOKEN_EXPIRY: string;
|
|
580
607
|
USER_DATA: string;
|
|
581
608
|
USER_TENANTS: string;
|
|
609
|
+
VISITING_TENANT: string;
|
|
610
|
+
SESSION_ID: string;
|
|
582
611
|
EDX_TOKEN_KEY: string;
|
|
583
612
|
DM_TOKEN_KEY: string;
|
|
584
613
|
DM_TOKEN_EXPIRES: string;
|
|
@@ -613,7 +642,146 @@ declare const TOOLS: {
|
|
|
613
642
|
declare const REQUIRED_ACTIONS_FOR_GROUPS: {
|
|
614
643
|
readonly NOTIFICATIONS: "Ibl.Notifications/Notification/action";
|
|
615
644
|
};
|
|
645
|
+
declare const MENTOR_VISIBILITY_VALUES: {
|
|
646
|
+
ADMINISTRATORS: "viewable_by_tenant_admins";
|
|
647
|
+
STUDENTS: "viewable_by_tenant_students";
|
|
648
|
+
ANYONE: "viewable_by_anyone";
|
|
649
|
+
};
|
|
650
|
+
declare const MENTOR_VISIBILITY: ({
|
|
651
|
+
label: string;
|
|
652
|
+
value: "viewable_by_tenant_admins";
|
|
653
|
+
} | {
|
|
654
|
+
label: string;
|
|
655
|
+
value: "viewable_by_tenant_students";
|
|
656
|
+
} | {
|
|
657
|
+
label: string;
|
|
658
|
+
value: "viewable_by_anyone";
|
|
659
|
+
})[];
|
|
660
|
+
|
|
661
|
+
type ChatMode = "advanced" | "default";
|
|
662
|
+
|
|
663
|
+
interface UseExternalPricingProps {
|
|
664
|
+
referenceId: string;
|
|
665
|
+
customerEmail: string;
|
|
666
|
+
publishableKey: string;
|
|
667
|
+
pricingId?: string;
|
|
668
|
+
}
|
|
669
|
+
interface PricingModalData$1 {
|
|
670
|
+
referenceId: string;
|
|
671
|
+
customerEmail: string;
|
|
672
|
+
publishableKey: string;
|
|
673
|
+
pricingTableId: string;
|
|
674
|
+
}
|
|
675
|
+
interface CreateStripeCustomerPortalRequest {
|
|
676
|
+
org: string;
|
|
677
|
+
userId: string;
|
|
678
|
+
requestBody: StripeCustomerPortalRequest;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Shape of the 402 Payment Required error response body.
|
|
682
|
+
* Note: Only `error` is required. Other fields may not be present
|
|
683
|
+
* in all error scenarios (e.g., generic API 402 vs WebSocket 402).
|
|
684
|
+
*/
|
|
685
|
+
interface Error402MessageData extends Partial<AccessCheckResponse> {
|
|
686
|
+
error: string;
|
|
687
|
+
message?: string;
|
|
688
|
+
details?: {
|
|
689
|
+
platform_key: string;
|
|
690
|
+
current_balance_usd: string;
|
|
691
|
+
required_usd: string;
|
|
692
|
+
deficit_usd: string;
|
|
693
|
+
};
|
|
694
|
+
pricing_table?: {
|
|
695
|
+
pricing_table_id: string;
|
|
696
|
+
pricing_table_js: string;
|
|
697
|
+
publishable_key?: string;
|
|
698
|
+
client_reference_id?: string;
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
declare const userDataSchema: z.ZodObject<{
|
|
703
|
+
user_display_name: z.ZodString;
|
|
704
|
+
user_email: z.ZodString;
|
|
705
|
+
user_fullname: z.ZodString;
|
|
706
|
+
user_id: z.ZodNumber;
|
|
707
|
+
user_nicename: z.ZodString;
|
|
708
|
+
}, "strip", z.ZodTypeAny, {
|
|
709
|
+
user_display_name: string;
|
|
710
|
+
user_email: string;
|
|
711
|
+
user_fullname: string;
|
|
712
|
+
user_id: number;
|
|
713
|
+
user_nicename: string;
|
|
714
|
+
}, {
|
|
715
|
+
user_display_name: string;
|
|
716
|
+
user_email: string;
|
|
717
|
+
user_fullname: string;
|
|
718
|
+
user_id: number;
|
|
719
|
+
user_nicename: string;
|
|
720
|
+
}>;
|
|
721
|
+
declare const tenantSchema: z.ZodObject<{
|
|
722
|
+
key: z.ZodString;
|
|
723
|
+
is_admin: z.ZodBoolean;
|
|
724
|
+
org: z.ZodString;
|
|
725
|
+
}, "strip", z.ZodTypeAny, {
|
|
726
|
+
key: string;
|
|
727
|
+
is_admin: boolean;
|
|
728
|
+
org: string;
|
|
729
|
+
}, {
|
|
730
|
+
key: string;
|
|
731
|
+
is_admin: boolean;
|
|
732
|
+
org: string;
|
|
733
|
+
}>;
|
|
734
|
+
declare const tenantKeySchema: z.ZodString;
|
|
735
|
+
type TenantKeyMentorIdParams = {
|
|
736
|
+
tenantKey: string;
|
|
737
|
+
mentorId: string;
|
|
738
|
+
};
|
|
739
|
+
interface TopTrialBannerProps {
|
|
740
|
+
parentContainer: string;
|
|
741
|
+
bannerText?: string;
|
|
742
|
+
onUpgrade?: string;
|
|
743
|
+
loading?: boolean;
|
|
744
|
+
tooltipText?: string;
|
|
745
|
+
}
|
|
746
|
+
interface Prompt {
|
|
747
|
+
type: "static" | "human" | "ai";
|
|
748
|
+
icon?: string;
|
|
749
|
+
summary?: string;
|
|
750
|
+
content?: string;
|
|
751
|
+
proactive?: boolean;
|
|
752
|
+
hide?: boolean;
|
|
753
|
+
tag?: string;
|
|
754
|
+
}
|
|
755
|
+
interface Tenant {
|
|
756
|
+
key: string;
|
|
757
|
+
is_admin: boolean;
|
|
758
|
+
org: string;
|
|
759
|
+
name?: string;
|
|
760
|
+
platform_name: string;
|
|
761
|
+
is_advertising?: boolean;
|
|
762
|
+
is_enterprise?: boolean;
|
|
763
|
+
show_paywall?: boolean;
|
|
764
|
+
}
|
|
616
765
|
|
|
766
|
+
/**
|
|
767
|
+
* Reads the cached user_nicename from the LOCAL_STORAGE_KEYS.USER_DATA blob.
|
|
768
|
+
*/
|
|
769
|
+
declare const getUserName: () => string | null;
|
|
770
|
+
/**
|
|
771
|
+
* Reads the cached user_email from the LOCAL_STORAGE_KEYS.USER_DATA blob.
|
|
772
|
+
*/
|
|
773
|
+
declare const getUserEmail: () => string | null;
|
|
774
|
+
/**
|
|
775
|
+
* Whether Stripe-backed billing is active for the given tenant. The Stripe
|
|
776
|
+
* feature flag is a host-side config value; pass it in. Tenants opt in via
|
|
777
|
+
* `show_paywall` or by being the "main" platform tenant.
|
|
778
|
+
*/
|
|
779
|
+
declare function isStripeActivated(currentTenant: Tenant | null | undefined, stripeEnabled: boolean): boolean;
|
|
780
|
+
/**
|
|
781
|
+
* Checks whether a file matches any of the accepted type specifiers.
|
|
782
|
+
* Supports MIME types (image/png), wildcard MIME (image/*), and extensions (.pdf).
|
|
783
|
+
*/
|
|
784
|
+
declare function isFileAccepted(file: File, acceptedTypes: string[]): boolean;
|
|
617
785
|
declare const isJSON: (text: string) => boolean;
|
|
618
786
|
declare const getInitials: (fullName: string) => string;
|
|
619
787
|
declare const ALPHANUMERIC_32_REGEX: RegExp;
|
|
@@ -832,11 +1000,32 @@ declare const isWeb: () => boolean;
|
|
|
832
1000
|
declare const isNode: () => string | false;
|
|
833
1001
|
declare const isExpo: () => any;
|
|
834
1002
|
declare const isTauri: () => boolean;
|
|
835
|
-
declare
|
|
1003
|
+
declare function isSafariBrowser(): boolean;
|
|
1004
|
+
declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
|
|
836
1005
|
declare const safeRequire: (moduleName: string) => any;
|
|
837
1006
|
declare const getNextNavigation: () => any;
|
|
838
1007
|
|
|
839
|
-
|
|
1008
|
+
/**
|
|
1009
|
+
* Tauri API Cache
|
|
1010
|
+
*
|
|
1011
|
+
* localStorage-backed caching for API responses when running inside Tauri.
|
|
1012
|
+
* In offline mode, cached responses are returned instead of making network requests.
|
|
1013
|
+
*/
|
|
1014
|
+
declare function isTauriOfflineMode(): boolean;
|
|
1015
|
+
declare function getCachedApiResponse<T>(endpoint: string, params?: Record<string, unknown>): T | null;
|
|
1016
|
+
declare function setCachedApiResponse<T>(endpoint: string, data: T, params?: Record<string, unknown>, ttlMs?: number): void;
|
|
1017
|
+
declare function clearApiCache(): void;
|
|
1018
|
+
declare function fetchWithCache<T>(endpoint: string, fetchFn: () => Promise<T>, params?: Record<string, unknown>, ttlMs?: number): Promise<T>;
|
|
1019
|
+
declare const CacheKeys: {
|
|
1020
|
+
readonly mentorSettings: (org: string, mentor: string, userId: string) => string;
|
|
1021
|
+
readonly mentorPublicSettings: (org: string, mentor: string) => string;
|
|
1022
|
+
readonly tenantMetadata: (org: string) => string;
|
|
1023
|
+
readonly userTenants: (userId: string) => string;
|
|
1024
|
+
readonly sessionChats: (sessionId: string) => string;
|
|
1025
|
+
};
|
|
1026
|
+
declare function preCacheMentorData(org: string, mentorId: string, userId: string, fetchMentorSettings: () => Promise<unknown>, fetchTenantMetadata: () => Promise<unknown>): Promise<void>;
|
|
1027
|
+
|
|
1028
|
+
type ChatState = Record<AdvancedTab, Message$1[]>;
|
|
840
1029
|
type SessionIds = Record<AdvancedTab, string>;
|
|
841
1030
|
type StreamingMessage = {
|
|
842
1031
|
id: string;
|
|
@@ -958,7 +1147,7 @@ declare const selectTokenEnabled: (state: {
|
|
|
958
1147
|
}) => boolean;
|
|
959
1148
|
declare const selectActiveChatMessages: (state: {
|
|
960
1149
|
chatSliceShared: ChatSliceState;
|
|
961
|
-
}) => Message[];
|
|
1150
|
+
}) => Message$1[];
|
|
962
1151
|
declare const selectNumberOfActiveChatMessages: (state: {
|
|
963
1152
|
chatSliceShared: ChatSliceState;
|
|
964
1153
|
}) => number;
|
|
@@ -1071,6 +1260,9 @@ declare const updateFileMetadata: _reduxjs_toolkit.ActionCreatorWithoutPayload<`
|
|
|
1071
1260
|
declare const updateFileRetryCount: _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>;
|
|
1072
1261
|
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>;
|
|
1073
1262
|
declare const filesReducer: Reducer<FilesState>;
|
|
1263
|
+
declare const selectAttachedFiles: (state: {
|
|
1264
|
+
files: FilesState;
|
|
1265
|
+
}) => AttachedFile[];
|
|
1074
1266
|
|
|
1075
1267
|
/**
|
|
1076
1268
|
* Combines multiple CSV data objects by merging rows based on a common column.
|
|
@@ -1125,112 +1317,107 @@ declare const setAccessCheckResponse: _reduxjs_toolkit.ActionCreatorWithoutPaylo
|
|
|
1125
1317
|
declare const showMonetizationCheckoutModal: _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>;
|
|
1126
1318
|
declare const setAdvancedDisplayMonetizationCheckoutModal: _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>;
|
|
1127
1319
|
|
|
1128
|
-
type
|
|
1320
|
+
type RbacPermissions = {
|
|
1321
|
+
mentors: Record<string, unknown>;
|
|
1322
|
+
mentor: Record<string, unknown>;
|
|
1323
|
+
};
|
|
1324
|
+
interface RbacState {
|
|
1325
|
+
rbacPermissions: RbacPermissions | Record<string, never>;
|
|
1326
|
+
}
|
|
1327
|
+
declare const updateRbacPermissions: _reduxjs_toolkit.ActionCreatorWithPayload<RbacPermissions | Record<string, never>, "rbac/updateRbacPermissions">;
|
|
1328
|
+
declare const rbacReducer: Reducer<RbacState>;
|
|
1329
|
+
declare const selectRbacPermissions: (state: {
|
|
1330
|
+
rbac: RbacState;
|
|
1331
|
+
}) => RbacPermissions | Record<string, never>;
|
|
1129
1332
|
|
|
1130
|
-
interface
|
|
1131
|
-
|
|
1132
|
-
customerEmail: string;
|
|
1133
|
-
publishableKey: string;
|
|
1134
|
-
pricingId?: string;
|
|
1333
|
+
interface ChatInputState {
|
|
1334
|
+
textareaInput: string;
|
|
1135
1335
|
}
|
|
1336
|
+
declare const chatInputSlice: Slice$1<ChatInputState>;
|
|
1337
|
+
declare const chatInputSliceSelectors: {
|
|
1338
|
+
selectTextareaInput: (state: {
|
|
1339
|
+
chatInput: ChatInputState;
|
|
1340
|
+
}) => string;
|
|
1341
|
+
};
|
|
1342
|
+
declare const chatInputSliceActions: _reduxjs_toolkit.CaseReducerActions<_reduxjs_toolkit.SliceCaseReducers<ChatInputState>, string>;
|
|
1343
|
+
declare const chatInputSliceReducer: Reducer$1<ChatInputState>;
|
|
1344
|
+
|
|
1345
|
+
interface Message {
|
|
1346
|
+
role: "user" | "assistant";
|
|
1347
|
+
content: string;
|
|
1348
|
+
replyTo?: unknown;
|
|
1349
|
+
}
|
|
1350
|
+
interface HostChatState {
|
|
1351
|
+
messages: Message[];
|
|
1352
|
+
enableChatActionsPopup: boolean;
|
|
1353
|
+
}
|
|
1354
|
+
declare const hostChatSlice: Slice<HostChatState>;
|
|
1355
|
+
declare const addMessage: _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>;
|
|
1356
|
+
declare const clearMessages: _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>;
|
|
1357
|
+
declare const enableChatActionsPopup: _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>;
|
|
1358
|
+
declare const hostChatReducer: redux.Reducer<HostChatState>;
|
|
1359
|
+
declare const selectEnableChatActionsPopup: (state: {
|
|
1360
|
+
chat: HostChatState;
|
|
1361
|
+
}) => boolean;
|
|
1362
|
+
|
|
1136
1363
|
interface PricingModalData {
|
|
1137
1364
|
referenceId: string;
|
|
1138
1365
|
customerEmail: string;
|
|
1139
1366
|
publishableKey: string;
|
|
1140
1367
|
pricingTableId: string;
|
|
1141
1368
|
}
|
|
1142
|
-
interface
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1369
|
+
interface FreeTrialUsageOptions {
|
|
1370
|
+
count: number;
|
|
1371
|
+
limitReached: boolean;
|
|
1372
|
+
message: string;
|
|
1146
1373
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
interface
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
deficit_usd: string;
|
|
1160
|
-
};
|
|
1161
|
-
pricing_table?: {
|
|
1162
|
-
pricing_table_id: string;
|
|
1163
|
-
pricing_table_js: string;
|
|
1164
|
-
publishable_key?: string;
|
|
1165
|
-
client_reference_id?: string;
|
|
1166
|
-
};
|
|
1374
|
+
interface SubscriptionStatus {
|
|
1375
|
+
creditExhausted: boolean;
|
|
1376
|
+
userCapability?: string;
|
|
1377
|
+
callToAction?: string;
|
|
1378
|
+
}
|
|
1379
|
+
interface SubscriptionState {
|
|
1380
|
+
openPricingModal: boolean;
|
|
1381
|
+
openAppleRestrictionModal: boolean;
|
|
1382
|
+
freeTrialUsageOptions: FreeTrialUsageOptions;
|
|
1383
|
+
pricingModalData: PricingModalData;
|
|
1384
|
+
subscriptionStatus: SubscriptionStatus;
|
|
1385
|
+
error402Detected: string;
|
|
1167
1386
|
}
|
|
1387
|
+
declare const subscriptionSlice: Slice<SubscriptionState>;
|
|
1388
|
+
declare const setOpenPricingModal: _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>;
|
|
1389
|
+
declare const setOpenAppleRestrictionModal: _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>;
|
|
1390
|
+
declare const setFreeTrialUsageOptions: _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>;
|
|
1391
|
+
declare const setPricingModalData: _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>;
|
|
1392
|
+
declare const setSubscriptionStatus: _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>;
|
|
1393
|
+
declare const setError402Detected: _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>;
|
|
1394
|
+
declare const subscriptionReducer: redux.Reducer<SubscriptionState>;
|
|
1168
1395
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
user_display_name: string;
|
|
1177
|
-
user_email: string;
|
|
1178
|
-
user_fullname: string;
|
|
1179
|
-
user_id: number;
|
|
1180
|
-
user_nicename: string;
|
|
1181
|
-
}, {
|
|
1182
|
-
user_display_name: string;
|
|
1183
|
-
user_email: string;
|
|
1184
|
-
user_fullname: string;
|
|
1185
|
-
user_id: number;
|
|
1186
|
-
user_nicename: string;
|
|
1187
|
-
}>;
|
|
1188
|
-
declare const tenantSchema: z.ZodObject<{
|
|
1189
|
-
key: z.ZodString;
|
|
1190
|
-
is_admin: z.ZodBoolean;
|
|
1191
|
-
org: z.ZodString;
|
|
1192
|
-
}, "strip", z.ZodTypeAny, {
|
|
1193
|
-
key: string;
|
|
1194
|
-
is_admin: boolean;
|
|
1195
|
-
org: string;
|
|
1196
|
-
}, {
|
|
1197
|
-
key: string;
|
|
1198
|
-
is_admin: boolean;
|
|
1199
|
-
org: string;
|
|
1200
|
-
}>;
|
|
1201
|
-
declare const tenantKeySchema: z.ZodString;
|
|
1202
|
-
type TenantKeyMentorIdParams = {
|
|
1203
|
-
tenantKey: string;
|
|
1204
|
-
mentorId: string;
|
|
1205
|
-
};
|
|
1206
|
-
interface TopTrialBannerProps {
|
|
1207
|
-
parentContainer: string;
|
|
1396
|
+
/**
|
|
1397
|
+
* Structural shape of TopBannerProps. Mirrors `@iblai/web-containers`
|
|
1398
|
+
* `<TopBanner>` so this slice can be consumed without taking a circular
|
|
1399
|
+
* dependency on the web-containers package.
|
|
1400
|
+
*/
|
|
1401
|
+
interface TopBannerOptions {
|
|
1402
|
+
parentContainerSelector: string;
|
|
1208
1403
|
bannerText?: string;
|
|
1209
|
-
onUpgrade?: string;
|
|
1210
1404
|
loading?: boolean;
|
|
1211
1405
|
tooltipText?: string;
|
|
1406
|
+
buttonHandler?: () => void;
|
|
1407
|
+
buttonLabel?: string;
|
|
1408
|
+
onLoad?: (bannerRef: HTMLDivElement) => void;
|
|
1409
|
+
onClose?: () => void;
|
|
1410
|
+
enabled: boolean;
|
|
1411
|
+
onUpgrade?: string;
|
|
1212
1412
|
}
|
|
1213
|
-
interface
|
|
1214
|
-
|
|
1215
|
-
icon?: string;
|
|
1216
|
-
summary?: string;
|
|
1217
|
-
content?: string;
|
|
1218
|
-
proactive?: boolean;
|
|
1219
|
-
hide?: boolean;
|
|
1220
|
-
tag?: string;
|
|
1221
|
-
}
|
|
1222
|
-
interface Tenant {
|
|
1223
|
-
key: string;
|
|
1224
|
-
is_admin: boolean;
|
|
1225
|
-
org: string;
|
|
1226
|
-
name?: string;
|
|
1227
|
-
platform_name: string;
|
|
1228
|
-
is_advertising?: boolean;
|
|
1229
|
-
is_enterprise?: boolean;
|
|
1230
|
-
show_paywall?: boolean;
|
|
1413
|
+
interface TopBannerState {
|
|
1414
|
+
topBannerOptions: TopBannerOptions;
|
|
1231
1415
|
}
|
|
1416
|
+
declare const topBannerSlice: Slice<TopBannerState>;
|
|
1417
|
+
declare const setTopBannerOptions: _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>;
|
|
1418
|
+
declare const topBannerReducer: redux.Reducer<TopBannerState>;
|
|
1232
1419
|
|
|
1233
|
-
type Props$
|
|
1420
|
+
type Props$7 = {
|
|
1234
1421
|
mode?: ChatMode;
|
|
1235
1422
|
tenantKey: string;
|
|
1236
1423
|
mentorId: string;
|
|
@@ -1252,8 +1439,8 @@ type Props$5 = {
|
|
|
1252
1439
|
onOfflineWithoutLocalLLM?: () => void;
|
|
1253
1440
|
isPublicRoute?: boolean;
|
|
1254
1441
|
};
|
|
1255
|
-
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, isPublicRoute, }: Props$
|
|
1256
|
-
messages: Message[];
|
|
1442
|
+
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, isPublicRoute, }: Props$7): {
|
|
1443
|
+
messages: Message$1[];
|
|
1257
1444
|
isStreaming: boolean;
|
|
1258
1445
|
status: ChatStatus;
|
|
1259
1446
|
isPending: boolean;
|
|
@@ -1267,7 +1454,7 @@ declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl,
|
|
|
1267
1454
|
enabledGuidedPrompts: boolean;
|
|
1268
1455
|
sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
|
|
1269
1456
|
stopGenerating: () => void;
|
|
1270
|
-
setMessage: (message: Message) => void;
|
|
1457
|
+
setMessage: (message: Message$1) => void;
|
|
1271
1458
|
changeTab: (tab: AdvancedTab) => Promise<void>;
|
|
1272
1459
|
sessionId: string;
|
|
1273
1460
|
startNewChat: () => Promise<void>;
|
|
@@ -1276,20 +1463,20 @@ declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl,
|
|
|
1276
1463
|
isConnected: React__default.MutableRefObject<boolean>;
|
|
1277
1464
|
messageQueue: React__default.MutableRefObject<any[]>;
|
|
1278
1465
|
sessionIds: SessionIds;
|
|
1279
|
-
enableSafetyDisclaimer:
|
|
1466
|
+
enableSafetyDisclaimer: any;
|
|
1280
1467
|
resetConnection: () => void;
|
|
1281
1468
|
isLoadingChats: boolean;
|
|
1282
1469
|
refetchChats: () => Promise<void>;
|
|
1283
1470
|
};
|
|
1284
1471
|
|
|
1285
|
-
type Props$
|
|
1472
|
+
type Props$6 = {
|
|
1286
1473
|
tenantKey: string;
|
|
1287
1474
|
mentorId: string;
|
|
1288
1475
|
username: string;
|
|
1289
1476
|
errorHandler?: (message: string, error?: any) => void;
|
|
1290
1477
|
isPublicRoute?: boolean;
|
|
1291
1478
|
};
|
|
1292
|
-
declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, isPublicRoute, }: Props$
|
|
1479
|
+
declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, isPublicRoute, }: Props$6): {
|
|
1293
1480
|
tools: any;
|
|
1294
1481
|
activeTools: string[];
|
|
1295
1482
|
updateSessionTools: (tool: string) => Promise<void>;
|
|
@@ -1460,31 +1647,51 @@ interface TenantMetadata {
|
|
|
1460
1647
|
}
|
|
1461
1648
|
declare const METADATAS: TenantMetadata$1[];
|
|
1462
1649
|
|
|
1463
|
-
type Props$
|
|
1650
|
+
type Props$5 = {
|
|
1464
1651
|
mentorId: string;
|
|
1465
1652
|
tenantKey: string;
|
|
1466
|
-
|
|
1653
|
+
/**
|
|
1654
|
+
* Whether the caller is on a public route (e.g. a shareable token link).
|
|
1655
|
+
* Skips the private mentor-settings query when true.
|
|
1656
|
+
*/
|
|
1467
1657
|
isPublicRoute?: boolean;
|
|
1658
|
+
/**
|
|
1659
|
+
* Key of the platform's "main" tenant. When provided, isCommunityMentor
|
|
1660
|
+
* resolves to true only if the mentor lives under this tenant. Without it,
|
|
1661
|
+
* isCommunityMentor is always false.
|
|
1662
|
+
*/
|
|
1663
|
+
mainTenantKey?: string;
|
|
1468
1664
|
};
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1665
|
+
declare function useMentorSettings({ mentorId, tenantKey, isPublicRoute, mainTenantKey, }: Props$5): {
|
|
1666
|
+
isLoading: boolean;
|
|
1667
|
+
data: {
|
|
1668
|
+
profileImage: string | null | undefined;
|
|
1669
|
+
greetingMethod: string | undefined;
|
|
1670
|
+
proactiveResponse: string | undefined;
|
|
1671
|
+
llmProvider: string;
|
|
1672
|
+
llmName: string | undefined;
|
|
1673
|
+
mentorUniqueId: string | undefined;
|
|
1674
|
+
mentorName: string | undefined;
|
|
1675
|
+
enableGuidedPrompts: boolean | undefined;
|
|
1676
|
+
mentorSlug: string | undefined;
|
|
1677
|
+
safetyDisclaimer: any;
|
|
1678
|
+
isCommunityMentor: boolean;
|
|
1679
|
+
disclaimer: string | undefined;
|
|
1680
|
+
mentorVisibility: _iblai_iblai_api.NullEnum | null | undefined;
|
|
1681
|
+
allowAnonymous: boolean | undefined;
|
|
1682
|
+
showAttachment: boolean | undefined;
|
|
1683
|
+
showVoiceCall: boolean | undefined;
|
|
1684
|
+
showVoiceRecord: boolean | undefined;
|
|
1685
|
+
embedShowAttachment: boolean | undefined;
|
|
1686
|
+
embedShowVoiceCall: boolean | undefined;
|
|
1687
|
+
embedShowVoiceRecord: boolean | undefined;
|
|
1688
|
+
llmConfig: any;
|
|
1689
|
+
mentorDbId: number | undefined;
|
|
1690
|
+
starterPrompts: string | undefined;
|
|
1691
|
+
memoryEnabled: boolean;
|
|
1692
|
+
mentorTools: any;
|
|
1693
|
+
};
|
|
1486
1694
|
};
|
|
1487
|
-
declare function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }: Props$3): UseMentorSettingsReturn;
|
|
1488
1695
|
|
|
1489
1696
|
interface UseStripeUpgradeArgs {
|
|
1490
1697
|
redirectUrl: string;
|
|
@@ -1500,6 +1707,249 @@ declare const useStripeUpgrade: ({ redirectUrl, sourcePlatformKey, mainPlatformK
|
|
|
1500
1707
|
handleUpgrade: (redirectPlan?: StripeUpgradePlan) => Promise<void>;
|
|
1501
1708
|
};
|
|
1502
1709
|
|
|
1710
|
+
declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
1711
|
+
|
|
1712
|
+
declare function useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R;
|
|
1713
|
+
declare function useEventCallback<Args extends unknown[], R>(fn: ((...args: Args) => R) | undefined): ((...args: Args) => R) | undefined;
|
|
1714
|
+
|
|
1715
|
+
declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
|
|
1716
|
+
declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
|
|
1717
|
+
declare function useEventListener<K extends keyof HTMLElementEventMap & keyof SVGElementEventMap, T extends Element = K extends keyof HTMLElementEventMap ? HTMLDivElement : SVGElement>(eventName: K, handler: ((event: HTMLElementEventMap[K]) => void) | ((event: SVGElementEventMap[K]) => void), element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
|
|
1718
|
+
declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
|
|
1719
|
+
|
|
1720
|
+
declare global {
|
|
1721
|
+
interface WindowEventMap {
|
|
1722
|
+
"local-storage": CustomEvent;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
type UseLocalStorageOptions<T> = {
|
|
1726
|
+
serializer?: (value: T) => string;
|
|
1727
|
+
deserializer?: (value: string) => T;
|
|
1728
|
+
initializeWithValue?: boolean;
|
|
1729
|
+
};
|
|
1730
|
+
declare function useLocalStorage<T>(key: string, initialValue: T | (() => T), options?: UseLocalStorageOptions<T>): [T, Dispatch<SetStateAction<T>>, () => void];
|
|
1731
|
+
|
|
1732
|
+
declare function useUserData(): {
|
|
1733
|
+
user_display_name: string;
|
|
1734
|
+
user_email: string;
|
|
1735
|
+
user_fullname: string;
|
|
1736
|
+
user_id: number;
|
|
1737
|
+
user_nicename: string;
|
|
1738
|
+
} | null;
|
|
1739
|
+
declare function useUsername(): string | null;
|
|
1740
|
+
declare function useVisitingTenant(): {
|
|
1741
|
+
visitingTenant: Tenant | undefined;
|
|
1742
|
+
saveVisitingTenant: React$1.Dispatch<React$1.SetStateAction<Tenant | undefined>>;
|
|
1743
|
+
removeVisitingTenant: () => void;
|
|
1744
|
+
};
|
|
1745
|
+
declare function useUserTenants(): {
|
|
1746
|
+
userTenants: Tenant[];
|
|
1747
|
+
saveUserTenants: React$1.Dispatch<React$1.SetStateAction<Tenant[]>>;
|
|
1748
|
+
};
|
|
1749
|
+
declare function useCurrentTenant(): {
|
|
1750
|
+
currentTenant: Tenant | null;
|
|
1751
|
+
saveCurrentTenant: React$1.Dispatch<React$1.SetStateAction<Tenant | null>>;
|
|
1752
|
+
};
|
|
1753
|
+
declare function useIsAdmin(): boolean;
|
|
1754
|
+
|
|
1755
|
+
declare function useDmToken(): string;
|
|
1756
|
+
declare function useAxdToken(): string;
|
|
1757
|
+
|
|
1758
|
+
declare function useAccessingPublicRoute(): boolean;
|
|
1759
|
+
|
|
1760
|
+
declare function useEmbedMode(): boolean;
|
|
1761
|
+
|
|
1762
|
+
interface FileUploadCapabilities$1 {
|
|
1763
|
+
supportsFileUpload: boolean;
|
|
1764
|
+
allSupportedTypes: string[];
|
|
1765
|
+
maxFileSizeMB: number;
|
|
1766
|
+
maxFilesPerMessage: number;
|
|
1767
|
+
}
|
|
1768
|
+
interface UseChatFileUploadProps {
|
|
1769
|
+
org: string;
|
|
1770
|
+
userId: string;
|
|
1771
|
+
errorHandler?: (error: string) => void;
|
|
1772
|
+
capabilities?: FileUploadCapabilities$1;
|
|
1773
|
+
}
|
|
1774
|
+
declare function useChatFileUpload({ org, userId, errorHandler, capabilities, }: UseChatFileUploadProps): {
|
|
1775
|
+
uploadFiles: (files: File[]) => Promise<void>;
|
|
1776
|
+
retryUpload: (fileId: string) => Promise<void>;
|
|
1777
|
+
};
|
|
1778
|
+
|
|
1779
|
+
interface UseModelFileUploadCapabilitiesProps {
|
|
1780
|
+
mentorId: string;
|
|
1781
|
+
tenantKey: string;
|
|
1782
|
+
isPublicRoute?: boolean;
|
|
1783
|
+
}
|
|
1784
|
+
interface FileUploadCapabilities {
|
|
1785
|
+
supportsFileUpload: boolean;
|
|
1786
|
+
supportsImages: boolean;
|
|
1787
|
+
supportsDocuments: boolean;
|
|
1788
|
+
supportedImageTypes: string[];
|
|
1789
|
+
supportedDocumentTypes: string[];
|
|
1790
|
+
allSupportedTypes: string[];
|
|
1791
|
+
maxFileSizeMB: number;
|
|
1792
|
+
maxFilesPerMessage: number;
|
|
1793
|
+
supportsFileUrls: boolean;
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Hook to determine file upload capabilities based on the LLM config.
|
|
1797
|
+
*/
|
|
1798
|
+
declare function useModelFileUploadCapabilities({ mentorId, tenantKey, isPublicRoute, }: UseModelFileUploadCapabilitiesProps): FileUploadCapabilities;
|
|
1799
|
+
|
|
1800
|
+
interface UseFileDragDropOptions {
|
|
1801
|
+
org: string;
|
|
1802
|
+
userId: string;
|
|
1803
|
+
mentorId: string;
|
|
1804
|
+
tenantKey: string;
|
|
1805
|
+
isPublicRoute?: boolean;
|
|
1806
|
+
}
|
|
1807
|
+
declare function useFileDragDrop({ org, userId, mentorId, tenantKey, isPublicRoute, }: UseFileDragDropOptions): {
|
|
1808
|
+
isDraggingFile: boolean;
|
|
1809
|
+
handleDragOver: (e: React__default.DragEvent) => void;
|
|
1810
|
+
handleDragLeave: (e: React__default.DragEvent) => void;
|
|
1811
|
+
handleDrop: (e: React__default.DragEvent) => Promise<void>;
|
|
1812
|
+
};
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* Persists a map of mentorId -> sessionId in localStorage so a chat session
|
|
1816
|
+
* can be restored across reloads on a per-mentor basis.
|
|
1817
|
+
*
|
|
1818
|
+
* Returns a tuple shaped like useLocalStorage:
|
|
1819
|
+
* `[cachedSessionId, saveCachedSessionId]`.
|
|
1820
|
+
*/
|
|
1821
|
+
declare function useCachedSessionId(): [Record<string, string>, React$1.Dispatch<React$1.SetStateAction<Record<string, string>>>, () => void];
|
|
1822
|
+
|
|
1823
|
+
interface UseUserAgreementProps {
|
|
1824
|
+
mentorId: string;
|
|
1825
|
+
tenantKey: string;
|
|
1826
|
+
}
|
|
1827
|
+
declare function useUserAgreement({ mentorId, tenantKey, }: UseUserAgreementProps): {
|
|
1828
|
+
showDisclaimerModal: boolean;
|
|
1829
|
+
setShowDisclaimerModal: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
1830
|
+
isAgreeing: boolean;
|
|
1831
|
+
pendingSubmitContent: string;
|
|
1832
|
+
userAgreement: _iblai_data_layer.Disclaimer | {
|
|
1833
|
+
readonly content: "By accessing and using the [ibl.ai](http://ibl.ai/) MentorAI platform (“Platform”), you agree to the following terms. The Platform provides AI-powered mentorship and educational support. You understand that AI responses may contain inaccuracies, and you are responsible for independently verifying any information before relying on it for academic, professional, or personal decisions. Do not input confidential, sensitive, or personally identifiable information of yourself or others.\nAll content, code, and data processed through the Platform remain the property of their respective owners. [ibl.ai](http://ibl.ai/) retains all rights to the Platform’s underlying technology and intellectual property. You are granted a limited, non-exclusive, revocable license to use the Platform for personal or institutional learning purposes only.\nYour use must comply with applicable laws and institutional policies. Misuse—including attempting to bypass security, copy source code, or use the service for unlawful activity—may result in suspension or termination of access. Continued use constitutes acceptance of these terms.";
|
|
1834
|
+
readonly active: false;
|
|
1835
|
+
};
|
|
1836
|
+
hasUserAgreement: boolean;
|
|
1837
|
+
hasUserAgreedToDisclaimer: boolean;
|
|
1838
|
+
isDisclaimersLoading: boolean;
|
|
1839
|
+
handleDisclaimerAgree: () => Promise<void>;
|
|
1840
|
+
checkAgreementAndExecute: (content: string, executeCallback: (content: string) => void) => void;
|
|
1841
|
+
executePendingSubmit: (executeCallback: (content: string) => void) => void;
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
interface UseShowVoiceRecorderProps {
|
|
1845
|
+
mentorId: string;
|
|
1846
|
+
tenantKey: string;
|
|
1847
|
+
isPublicRoute?: boolean;
|
|
1848
|
+
}
|
|
1849
|
+
declare function useShowVoiceRecorder({ mentorId, tenantKey, isPublicRoute, }: UseShowVoiceRecorderProps): boolean;
|
|
1850
|
+
|
|
1851
|
+
interface UseShowVoiceCallProps {
|
|
1852
|
+
mentorId: string;
|
|
1853
|
+
tenantKey: string;
|
|
1854
|
+
isPublicRoute?: boolean;
|
|
1855
|
+
}
|
|
1856
|
+
declare function useShowVoiceCall({ mentorId, tenantKey, isPublicRoute, }: UseShowVoiceCallProps): boolean;
|
|
1857
|
+
|
|
1858
|
+
interface UseShowAttachmentProps {
|
|
1859
|
+
mentorId: string;
|
|
1860
|
+
tenantKey: string;
|
|
1861
|
+
isPublicRoute?: boolean;
|
|
1862
|
+
}
|
|
1863
|
+
declare function useShowAttachment({ mentorId, tenantKey, isPublicRoute, }: UseShowAttachmentProps): boolean;
|
|
1864
|
+
|
|
1865
|
+
type Props$4 = {
|
|
1866
|
+
sessionId: string;
|
|
1867
|
+
username: string;
|
|
1868
|
+
tenantKey: string;
|
|
1869
|
+
mentorId: string;
|
|
1870
|
+
mentorUniqueId: string;
|
|
1871
|
+
token: string;
|
|
1872
|
+
wsUrl: string;
|
|
1873
|
+
isPublicRoute?: boolean;
|
|
1874
|
+
isNewSession?: boolean;
|
|
1875
|
+
};
|
|
1876
|
+
declare function useWelcome({ sessionId, username, tenantKey, mentorId, mentorUniqueId, token, wsUrl, isPublicRoute, isNewSession, }: Props$4): {
|
|
1877
|
+
welcomeMessage: string;
|
|
1878
|
+
handleSendProactivePrompt: () => void;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Tracks container width / viewport and returns a small screen-size bag.
|
|
1883
|
+
* If a ref is passed, the hook observes that element via ResizeObserver
|
|
1884
|
+
* and reacts to its width changes; otherwise it tracks window width.
|
|
1885
|
+
*/
|
|
1886
|
+
declare const useResponsive: (containerRef?: React.RefObject<HTMLElement>) => {
|
|
1887
|
+
isMobile: boolean;
|
|
1888
|
+
isTablet: boolean;
|
|
1889
|
+
isLaptop: boolean;
|
|
1890
|
+
isDesktop: boolean;
|
|
1891
|
+
screenSize: "sm" | "md" | "lg" | "xl";
|
|
1892
|
+
containerWidth: number;
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1895
|
+
declare function useTimer(): {
|
|
1896
|
+
startTime: Date | null;
|
|
1897
|
+
time: number;
|
|
1898
|
+
isRunning: boolean;
|
|
1899
|
+
start: () => void;
|
|
1900
|
+
stop: () => void;
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
interface Props$3 {
|
|
1904
|
+
sendMessage: (message: string) => void;
|
|
1905
|
+
tenantKey: string;
|
|
1906
|
+
}
|
|
1907
|
+
declare function useVoiceChat({ sendMessage, tenantKey }: Props$3): {
|
|
1908
|
+
handleMicrophoneBtnClick: () => Promise<void>;
|
|
1909
|
+
recording: boolean;
|
|
1910
|
+
processing: boolean;
|
|
1911
|
+
time: number;
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1914
|
+
interface FreeTrialDialogProps {
|
|
1915
|
+
isOpen: boolean;
|
|
1916
|
+
onClose: () => void;
|
|
1917
|
+
}
|
|
1918
|
+
interface UseShowFreeTrialDialogReturn {
|
|
1919
|
+
FreeTrialDialog: ComponentType<FreeTrialDialogProps> | null;
|
|
1920
|
+
closeModal: () => void;
|
|
1921
|
+
isModalOpen: boolean;
|
|
1922
|
+
/**
|
|
1923
|
+
* Run a callback, optionally gated by the trial check. The second
|
|
1924
|
+
* `enforceTrialCheck` flag mirrors the mentor app's signature so call
|
|
1925
|
+
* sites that pass `false` (i.e. opt-out of gating) typecheck against
|
|
1926
|
+
* the stub. The stub ignores the flag and always runs the callback.
|
|
1927
|
+
*/
|
|
1928
|
+
executeWithTrialCheck: (callback: () => void, enforceTrialCheck?: boolean) => void;
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Stub implementation of the mentor app's free-trial gate.
|
|
1932
|
+
*
|
|
1933
|
+
* Always reports the gate as inactive (`isModalOpen: false`,
|
|
1934
|
+
* `FreeTrialDialog: null`) and executes any guarded callback immediately.
|
|
1935
|
+
* Mirrors the call-site shape of the mentor app's
|
|
1936
|
+
* `useShowFreeTrialDialog` so the reusable Chat can render without
|
|
1937
|
+
* pulling in the entire subscription / Apple-restriction flow.
|
|
1938
|
+
*
|
|
1939
|
+
* Host apps that want a real gate should replace this hook with their
|
|
1940
|
+
* own implementation that wires up the subscription flow they use.
|
|
1941
|
+
*/
|
|
1942
|
+
declare function useShowFreeTrialDialog(): UseShowFreeTrialDialogReturn;
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* Returns OS-derived flags. Currently only detects whether the host is an
|
|
1946
|
+
* Apple device (macOS or iOS) via Tauri's plugin-os. In plain browsers
|
|
1947
|
+
* (no Tauri runtime) `isAppleDevice` is always false.
|
|
1948
|
+
*/
|
|
1949
|
+
declare const useOS: () => {
|
|
1950
|
+
isAppleDevice: boolean;
|
|
1951
|
+
};
|
|
1952
|
+
|
|
1503
1953
|
/**
|
|
1504
1954
|
* Sync authentication state to cookies (web only)
|
|
1505
1955
|
* Should be called on login, logout, and tenant switch
|
|
@@ -1518,7 +1968,7 @@ declare function clearCurrentTenantCookie(): void;
|
|
|
1518
1968
|
* On React Native, this is a no-op
|
|
1519
1969
|
*/
|
|
1520
1970
|
declare function clearAuthCookies(): void;
|
|
1521
|
-
declare function
|
|
1971
|
+
declare function getStoredUserName(storageService: StorageService): Promise<any>;
|
|
1522
1972
|
declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, enableStorageSync, }: Props$2): {
|
|
1523
1973
|
isAuthenticating: boolean;
|
|
1524
1974
|
userIsAccessingPublicRoute: boolean;
|
|
@@ -1575,7 +2025,7 @@ type Props$2 = {
|
|
|
1575
2025
|
* 4. Handles redirects to auth SPA when needed
|
|
1576
2026
|
* 5. Manages public route access state
|
|
1577
2027
|
*/
|
|
1578
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: 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> |
|
|
2028
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, 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;
|
|
1579
2029
|
|
|
1580
2030
|
/**
|
|
1581
2031
|
* Props for the MentorProvider component
|
|
@@ -1608,7 +2058,7 @@ type Props$1 = {
|
|
|
1608
2058
|
* 3. Manages redirection based on mentor availability
|
|
1609
2059
|
* 4. Integrates with tenant context for access control
|
|
1610
2060
|
*/
|
|
1611
|
-
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 | 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> |
|
|
2061
|
+
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;
|
|
1612
2062
|
|
|
1613
2063
|
/**
|
|
1614
2064
|
* Type definition for the tenant context
|
|
@@ -1672,7 +2122,98 @@ type Props = {
|
|
|
1672
2122
|
* 4. Handles tenant-specific domain redirects
|
|
1673
2123
|
* 5. Maintains tenant access state
|
|
1674
2124
|
*/
|
|
1675
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: 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> |
|
|
2125
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: 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;
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* Service Worker Registration Helper
|
|
2129
|
+
*
|
|
2130
|
+
* Handles registration, updates, and communication with the service worker.
|
|
2131
|
+
*/
|
|
2132
|
+
interface ServiceWorkerStatus {
|
|
2133
|
+
isSupported: boolean;
|
|
2134
|
+
isRegistered: boolean;
|
|
2135
|
+
isOnline: boolean;
|
|
2136
|
+
registration: ServiceWorkerRegistration | null;
|
|
2137
|
+
updateAvailable: boolean;
|
|
2138
|
+
}
|
|
2139
|
+
type UpdateCallback = (registration: ServiceWorkerRegistration) => void;
|
|
2140
|
+
type StatusChangeCallback = (status: ServiceWorkerStatus) => void;
|
|
2141
|
+
/**
|
|
2142
|
+
* Check if service workers are supported
|
|
2143
|
+
*/
|
|
2144
|
+
declare function isServiceWorkerSupported(): boolean;
|
|
2145
|
+
/**
|
|
2146
|
+
* Get current service worker status
|
|
2147
|
+
*/
|
|
2148
|
+
declare function getServiceWorkerStatus(): ServiceWorkerStatus;
|
|
2149
|
+
/**
|
|
2150
|
+
* Register the service worker.
|
|
2151
|
+
* Defers registration until the page is fully loaded to avoid
|
|
2152
|
+
* interfering with chunk loading — especially in WebKit/Safari where
|
|
2153
|
+
* early SW registration can cause ChunkLoadError timeouts.
|
|
2154
|
+
*/
|
|
2155
|
+
declare function registerServiceWorker(basePath?: string): Promise<ServiceWorkerRegistration | null>;
|
|
2156
|
+
/**
|
|
2157
|
+
* Unregister the service worker
|
|
2158
|
+
*/
|
|
2159
|
+
declare function unregisterServiceWorker(): Promise<boolean>;
|
|
2160
|
+
/**
|
|
2161
|
+
* Skip waiting and activate new service worker immediately
|
|
2162
|
+
*/
|
|
2163
|
+
declare function skipWaiting(): void;
|
|
2164
|
+
/**
|
|
2165
|
+
* Clear all caches
|
|
2166
|
+
*/
|
|
2167
|
+
declare function clearAllCaches(): void;
|
|
2168
|
+
/**
|
|
2169
|
+
* Tell service worker we're running in Tauri
|
|
2170
|
+
*/
|
|
2171
|
+
declare function setTauriMode(isTauri: boolean): void;
|
|
2172
|
+
/**
|
|
2173
|
+
* Tell service worker about offline status (from Tauri)
|
|
2174
|
+
*/
|
|
2175
|
+
declare function setOfflineStatus(isOffline: boolean): void;
|
|
2176
|
+
/**
|
|
2177
|
+
* Request cache status from service worker
|
|
2178
|
+
*/
|
|
2179
|
+
declare function getCacheStatus(): Promise<Record<string, number> | null>;
|
|
2180
|
+
/**
|
|
2181
|
+
* Subscribe to service worker updates
|
|
2182
|
+
*/
|
|
2183
|
+
declare function onUpdate(callback: UpdateCallback): () => void;
|
|
2184
|
+
/**
|
|
2185
|
+
* Subscribe to status changes (online/offline, registration, updates)
|
|
2186
|
+
*/
|
|
2187
|
+
declare function onStatusChange(callback: StatusChangeCallback): () => void;
|
|
2188
|
+
/**
|
|
2189
|
+
* Setup online/offline listeners
|
|
2190
|
+
*/
|
|
2191
|
+
declare function setupNetworkListeners(): () => void;
|
|
2192
|
+
/**
|
|
2193
|
+
* Initialize service worker and network listeners
|
|
2194
|
+
* Call this once when app loads
|
|
2195
|
+
*/
|
|
2196
|
+
declare function initServiceWorker(basePath?: string): Promise<ServiceWorkerStatus>;
|
|
2197
|
+
|
|
2198
|
+
interface ServiceWorkerContextValue {
|
|
2199
|
+
status: ServiceWorkerStatus;
|
|
2200
|
+
applyUpdate: () => void;
|
|
2201
|
+
clearCache: () => void;
|
|
2202
|
+
refreshCacheStatus: () => Promise<Record<string, number> | null>;
|
|
2203
|
+
checkNetworkNow: () => Promise<boolean>;
|
|
2204
|
+
}
|
|
2205
|
+
declare function useServiceWorker(): ServiceWorkerContextValue;
|
|
2206
|
+
interface ServiceWorkerProviderProps {
|
|
2207
|
+
children: React.ReactNode;
|
|
2208
|
+
/**
|
|
2209
|
+
* Base path used when registering the service worker. The SW is fetched
|
|
2210
|
+
* from `${basePath}/sw.js` and scoped to `basePath || '/'`. Pass the
|
|
2211
|
+
* host app's bundler-resolved base path (e.g. Next.js's
|
|
2212
|
+
* `process.env.NEXT_PUBLIC_BASE_PATH`). Defaults to '' (root).
|
|
2213
|
+
*/
|
|
2214
|
+
basePath?: string;
|
|
2215
|
+
}
|
|
2216
|
+
declare function ServiceWorkerProvider({ children, basePath, }: ServiceWorkerProviderProps): react_jsx_runtime.JSX.Element;
|
|
1676
2217
|
|
|
1677
2218
|
/**
|
|
1678
2219
|
* Chat area size constants
|
|
@@ -1742,6 +2283,13 @@ declare function createMultipleFileReferences(files: File[], sessionId: string,
|
|
|
1742
2283
|
*/
|
|
1743
2284
|
declare function validateFile(file: File, maxSizeBytes?: number, allowedTypes?: string[]): string | null;
|
|
1744
2285
|
|
|
2286
|
+
declare const eventBus: mitt.Emitter<Record<mitt.EventType, unknown>>;
|
|
2287
|
+
declare enum RemoteEvents {
|
|
2288
|
+
newChat = "MENTOR:NEW_CHAT",
|
|
2289
|
+
stopChatGenerating = "MENTOR:STOP_CHAT_GENERATING",
|
|
2290
|
+
sendChatMessage = "MENTOR:SEND_CHAT_MESSAGE"
|
|
2291
|
+
}
|
|
2292
|
+
|
|
1745
2293
|
type WithFormPermissionsProps = {
|
|
1746
2294
|
name: string | string[];
|
|
1747
2295
|
permissions: Record<string, {
|
|
@@ -1786,5 +2334,5 @@ declare const WithPermissions: ({ rbacResource, rbacPermissions, children, }: Wi
|
|
|
1786
2334
|
*/
|
|
1787
2335
|
declare const checkRbacPermission: (rbacPermissions: object, rbacResource: string, enableRBAC?: boolean) => boolean;
|
|
1788
2336
|
|
|
1789
|
-
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, REQUIRED_ACTIONS_FOR_GROUPS, 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, getCookieValue, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getTimeAgo, getUserName, handleLogout, isAlphaNumeric32, isExpo, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isTauri, isWeb, loadMetadataConfig, markdownToPlainText, monetizationSlice, parseCSV, redirectToAuthSpa, redirectToAuthSpaJoinTenant, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectMetadata, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setAccessCheckResponse, setAdvancedDisplayMonetizationCheckoutModal, setCookieForAuth, setDisplayMonetizationCheckoutModal, showMonetizationCheckoutModal, streamOllamaChat, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, uploadToS3, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useStripeUpgrade, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema, validateFile };
|
|
1790
|
-
export type { AdvancedTab, ArtifactData, ArtifactPayload, ArtifactVersion, AttachedFile, AuthContextType, ChatMode, ChatSliceState, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Error402MessageData, FileAttachment, FileInfo, FileProcessingEvent, FileReference, FileUploadState, FilesState, HandleLogoutOptions, Message, MessageAction, MonetizationState, OAuthRequiredData, OAuthResolvedData, OllamaChatRequest, OllamaChatStreamResponse, OllamaMessage, OllamaStreamCallbacks, PricingModalData, Prompt, RedirectToAuthSpaOptions, SendMessageOptions, SessionIds, StreamingArtifact, StreamingMessage, StripeUpgradePlan, SubscriptionFlowConfig, SubscriptionFlowConfigV2, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopTrialBannerProps, UploadProgressCallback, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
|
|
2337
|
+
export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, CHAT_AREA_SIZE, CacheKeys, DEFAULT_DISCLAIMER_CONTENT, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, MENTOR_VISIBILITY, MENTOR_VISIBILITY_VALUES, METADATAS, MentorProvider, REQUIRED_ACTIONS_FOR_GROUPS, RemoteEvents, STREAMING_CONTENT_BUFFER_THRESHOLD, STREAMING_CONTENT_FLUSH_INTERVAL, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_PACKAGES_V2, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, ServiceWorkerProvider, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, WithFormPermissions, WithPermissions, addFiles, addMessage, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatInputSlice, chatInputSliceActions, chatInputSliceReducer, chatInputSliceSelectors, chatSliceReducerShared, checkModelAvailable, checkOllamaHealth, checkRbacPermission, clearAllCaches, clearApiCache, clearAuthCookies, clearCookies, clearCurrentTenantCookie, clearFiles, clearMessages, combineCSVData, convertToOllamaMessages, createFileReference, createMultipleFileReferences, csvDataToText, defaultSessionIds, deleteCookie, deleteCookieOnAllDomains, enableChatActionsPopup, eventBus, fetchWithCache, filesReducer, filesSlice, formatRelativeTime, getAuthSpaJoinUrl, getCacheStatus, getCachedApiResponse, getCookieValue, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getServiceWorkerStatus, getStoredUserName, getTimeAgo, getUserEmail, getUserName, handleLogout, hostChatReducer, hostChatSlice, initServiceWorker, isAlphaNumeric32, isExpo, isFileAccepted, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isSafariBrowser, isServiceWorkerSupported, isStripeActivated, isTauri, isTauriOfflineMode, isWeb, loadMetadataConfig, markdownToPlainText, monetizationSlice, onStatusChange, onUpdate, parseCSV, preCacheMentorData, rbacReducer, redirectToAuthSpa, redirectToAuthSpaJoinTenant, registerServiceWorker, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectAttachedFiles, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectEnableChatActionsPopup, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectMetadata, selectNumberOfActiveChatMessages, selectRbacPermissions, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setAccessCheckResponse, setAdvancedDisplayMonetizationCheckoutModal, setCachedApiResponse, setCookieForAuth, setDisplayMonetizationCheckoutModal, setError402Detected, setFreeTrialUsageOptions, setOfflineStatus, setOpenAppleRestrictionModal, setOpenPricingModal, setPricingModalData, setSubscriptionStatus, setTauriMode, setTopBannerOptions, setupNetworkListeners, showMonetizationCheckoutModal, skipWaiting, streamOllamaChat, subscriptionReducer, subscriptionSlice, syncAuthToCookies, tenantKeySchema, tenantSchema, topBannerReducer, topBannerSlice, translatePrompt, unregisterServiceWorker, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, updateRbacPermissions, uploadToS3, use402ErrorCheck, useAccessingPublicRoute, useAdvancedChat, useAuthContext, useAuthProvider, useAxdToken, useCachedSessionId, useChat, useChatFileUpload, useCurrentTenant, useDayJs, useDmToken, useEmbedMode, useEventCallback, useEventListener, useExternalPricingPlan, useFileDragDrop, useIsAdmin, useIsomorphicLayoutEffect, useLocalStorage, useMentorSettings, useMentorTools, useModelFileUploadCapabilities, useOS, useProfileImageUpload, useResponsive, useServiceWorker, useShowAttachment, useShowFreeTrialDialog, useShowVoiceCall, useShowVoiceRecorder, useStripeUpgrade, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useTimer, useUserAgreement, useUserData, useUserProfileUpdate, useUserTenants, useUsername, useVisitingTenant, useVoiceChat, useWelcome as useWelcomeMessage, userDataSchema, validateFile };
|
|
2338
|
+
export type { AdvancedTab, ArtifactData, ArtifactPayload, ArtifactVersion, AttachedFile, AuthContextType, ChatInputState, ChatMode, ChatSliceState, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Error402MessageData, FileAttachment, FileInfo, FileProcessingEvent, FileReference, FileUploadCapabilities, FileUploadState, FilesState, HandleLogoutOptions, HostChatState, Message$1 as Message, MessageAction, MonetizationState, OAuthRequiredData, OAuthResolvedData, OllamaChatRequest, OllamaChatStreamResponse, OllamaMessage, OllamaStreamCallbacks, PricingModalData$1 as PricingModalData, PricingTablePayload, Prompt, RbacPermissions, RbacState, RedirectToAuthSpaOptions, SendMessageOptions, ServiceWorkerStatus, SessionIds, StreamingArtifact, StreamingMessage, StripeUpgradePlan, SubscriptionFlowConfig, SubscriptionFlowConfigV2, SubscriptionState, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopBannerOptions, TopBannerState, TopTrialBannerProps, UploadProgressCallback, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
|