@iblai/web-utils 1.11.0 → 1.11.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/features/chat-privacy/api-slice.d.ts +1398 -0
- package/dist/data-layer/src/features/chat-privacy/constants.d.ts +13 -0
- package/dist/data-layer/src/features/sessions/api-slice.d.ts +122 -252
- package/dist/data-layer/src/features/sessions/constants.d.ts +3 -0
- package/dist/data-layer/src/features/sessions/url.d.ts +9 -0
- package/dist/data-layer/src/features/utils.d.ts +7 -0
- package/dist/data-layer/src/index.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +308 -198
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +307 -197
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/hooks/chat/__tests__/chat-history.utils.test.d.ts +1 -0
- package/dist/web-utils/src/hooks/chat/chat-history.utils.d.ts +10 -0
- package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +3 -0
- package/dist/web-utils/src/hooks/chat/use-chat-history.d.ts +17 -0
- package/dist/web-utils/src/index.mobile.d.ts +8 -0
- package/dist/web-utils/src/index.web.d.ts +8 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Message } from "./use-chat-v2";
|
|
2
|
+
export declare const INITIAL_CHAT_PAGE = 1;
|
|
3
|
+
export declare function normalizeSessionResult(result: any): any;
|
|
4
|
+
export declare function normalizeSessionResults(results: any[] | undefined): any[];
|
|
5
|
+
/**
|
|
6
|
+
* A session re-fetch can omit `additional_kwargs`, dropping reasoning/tool-call
|
|
7
|
+
* data that is already in memory. Carry those fields forward from the matching
|
|
8
|
+
* existing message (by content) onto the freshly-fetched message in place.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mergeReasoningAndToolCalls(incoming: any[], existing: Message[]): void;
|
|
@@ -54,5 +54,8 @@ export declare function useAdvancedChat({ tenantKey, mentorId, username, token,
|
|
|
54
54
|
resetConnection: () => void;
|
|
55
55
|
isLoadingChats: boolean;
|
|
56
56
|
refetchChats: () => Promise<void>;
|
|
57
|
+
loadOlderMessages: () => Promise<void>;
|
|
58
|
+
hasMore: boolean;
|
|
59
|
+
isLoadingOlderMessages: boolean;
|
|
57
60
|
};
|
|
58
61
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type UseChatHistoryParams = {
|
|
3
|
+
tenantKey: string;
|
|
4
|
+
mentorId: string;
|
|
5
|
+
username: string;
|
|
6
|
+
cachedSessionId?: Record<string, string>;
|
|
7
|
+
isOffline?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function useChatHistory({ tenantKey, mentorId, username, cachedSessionId, isOffline, }: UseChatHistoryParams): {
|
|
10
|
+
getChats: () => Promise<void>;
|
|
11
|
+
loadOlderMessages: () => Promise<void>;
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
isLoadingOlderMessages: boolean;
|
|
14
|
+
isLoadingChats: boolean;
|
|
15
|
+
isLoadingChatsRef: React.RefObject<boolean>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { useAdvancedChat as _useAdvancedChat } from "./hooks/chat/use-advanced-c
|
|
|
3
3
|
import { useTimeTracker as _useTimeTracker } from "./features/tracking/use-time-tracker";
|
|
4
4
|
import { useMentorSettings as _useMentorSettings } from "./hooks/use-mentor-settings";
|
|
5
5
|
import { getTimeAgo as _getTimeAgo } from "./utils";
|
|
6
|
+
import { useCachedSessionId as _useCachedSessionId } from "./hooks/use-cached-session-id";
|
|
6
7
|
export declare const useGetChatDetails: typeof _useGetChatDetails;
|
|
7
8
|
export declare const useAdvancedChat: typeof _useAdvancedChat;
|
|
8
9
|
export declare const useTimeTracker: typeof _useTimeTracker;
|
|
@@ -74,5 +75,12 @@ export declare const chatActions: import("@reduxjs/toolkit").CaseReducerActions<
|
|
|
74
75
|
export declare const selectSessionId: (state: {
|
|
75
76
|
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
76
77
|
}) => string;
|
|
78
|
+
export declare const selectNumberOfActiveChatMessages: (state: {
|
|
79
|
+
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
80
|
+
}) => number;
|
|
81
|
+
export declare const selectActiveChatMessages: (state: {
|
|
82
|
+
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
83
|
+
}) => import("./hooks/chat/use-chat-v2").Message[];
|
|
84
|
+
export declare const useCachedSessionId: typeof _useCachedSessionId;
|
|
77
85
|
export type { ChatMode } from "./types";
|
|
78
86
|
export type { OAuthRequiredData, OAuthResolvedData, } from "./hooks/chat/use-chat-v2";
|
|
@@ -5,6 +5,7 @@ import { useMentorSettings as _useMentorSettings } from "./hooks/use-mentor-sett
|
|
|
5
5
|
import { getTimeAgo as _getTimeAgo } from "./utils";
|
|
6
6
|
import { isInIframe as _isInIframe, sendMessageToParentWebsite as _sendMessageToParentWebsite, deleteCookie as _deleteCookie, getDomainParts as _getDomainParts, deleteCookieOnAllDomains as _deleteCookieOnAllDomains, getParentDomain as _getParentDomain, setCookieForAuth as _setCookieForAuth, clearCookies as _clearCookies, isLoggedIn as _isLoggedIn, getPlatformKey as _getPlatformKey, redirectToAuthSpa as _redirectToAuthSpa, getAuthSpaJoinUrl as _getAuthSpaJoinUrl, redirectToAuthSpaJoinTenant as _redirectToAuthSpaJoinTenant, handleLogout as _handleLogout, handleTenantSwitch as _handleTenantSwitch, getTabId as _getTabId, readTenantSwitchLock as _readTenantSwitchLock, writeTenantSwitchLock as _writeTenantSwitchLock, refreshTenantSwitchLock as _refreshTenantSwitchLock, clearTenantSwitchLock as _clearTenantSwitchLock, isTenantSwitchInProgress as _isTenantSwitchInProgress } from "./utils/auth";
|
|
7
7
|
import { useTenantSwitchSync as _useTenantSwitchSync } from "./hooks/use-tenant-switch-sync";
|
|
8
|
+
import { useCachedSessionId as _useCachedSessionId } from "./hooks/use-cached-session-id";
|
|
8
9
|
import { AuthProvider as _AuthProvider, TenantProvider as _TenantProvider, MentorProvider as _MentorProvider } from "./providers";
|
|
9
10
|
import { useSearchParams as _useSearchParams, useParams as _useParams, useRouter as _useRouter, usePathname as _usePathname } from "next/navigation";
|
|
10
11
|
export declare const useGetChatDetails: typeof _useGetChatDetails;
|
|
@@ -100,6 +101,13 @@ export declare const chatActions: import("@reduxjs/toolkit").CaseReducerActions<
|
|
|
100
101
|
export declare const selectSessionId: (state: {
|
|
101
102
|
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
102
103
|
}) => string;
|
|
104
|
+
export declare const selectNumberOfActiveChatMessages: (state: {
|
|
105
|
+
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
106
|
+
}) => number;
|
|
107
|
+
export declare const selectActiveChatMessages: (state: {
|
|
108
|
+
chatSliceShared: import("./features/chat/slice").ChatSliceState;
|
|
109
|
+
}) => import("./hooks/chat/use-chat-v2").Message[];
|
|
110
|
+
export declare const useCachedSessionId: typeof _useCachedSessionId;
|
|
103
111
|
export declare const AuthProvider: typeof _AuthProvider;
|
|
104
112
|
export declare const TenantProvider: typeof _TenantProvider;
|
|
105
113
|
export declare const MentorProvider: typeof _MentorProvider;
|