@frontera-sdk/chat-ui 1.53.30 → 1.53.32
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/chat.js +17 -14
- package/dist/{chunk-UTQYV6P4.js → chunk-2UXCKWKS.js} +3 -3
- package/dist/{chunk-HWZY3ZTZ.js → chunk-652HXKK6.js} +3 -3
- package/dist/{chunk-K7AIK7TA.js → chunk-6YDDHBQC.js} +2 -0
- package/dist/{chunk-XJ2UK4WV.js → chunk-7LCV3BV2.js} +636 -144
- package/dist/{chunk-RSMFWOHL.js → chunk-CEHOSQNR.js} +1 -1
- package/dist/{chunk-6BCUAPW3.js → chunk-LPQ4JQOB.js} +34 -5
- package/dist/{chunk-C5A27Q6W.js → chunk-MSRHFPQ5.js} +1 -1
- package/dist/{chunk-A4GIIAMQ.js → chunk-UHZ64AHN.js} +1 -1
- package/dist/{chunk-EJGKAA5I.js → chunk-X7TU7KKX.js} +3 -3
- package/dist/{chunk-R3ONYPUB.js → chunk-YZ4Z5J3J.js} +1 -1
- package/dist/client.js +2 -2
- package/dist/credential.js +1 -1
- package/dist/header.js +5 -5
- package/dist/message.js +5 -5
- package/dist/new-session.js +2 -2
- package/dist/parts.js +2 -2
- package/dist/{pdf-deck-view-inner-MG274ZQI.js → pdf-deck-view-inner-XMFIUKQ2.js} +2 -2
- package/dist/{pdf-document-view-inner-UJ6LMKXA.js → pdf-document-view-inner-DJ5WYYVF.js} +2 -2
- package/dist/pending-cards.js +2 -2
- package/dist/platform.css +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, Popover, PopoverTrigger, PopoverContent, MagnifyingGlassIcon } from './chunk-OONQIDAU.js';
|
|
3
|
-
import { useIsMobile, useTranslation } from './chunk-
|
|
3
|
+
import { useIsMobile, useTranslation } from './chunk-7LCV3BV2.js';
|
|
4
4
|
import { CrossMediumIcon } from './chunk-37WYG6VG.js';
|
|
5
5
|
import { AgentAvatar } from './chunk-RCWVJD7G.js';
|
|
6
6
|
import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
|
|
@@ -5,11 +5,20 @@ import { FronteraClient } from '@frontera-sdk/core/client';
|
|
|
5
5
|
import { createTokenSession } from '@frontera-sdk/chat/token-session';
|
|
6
6
|
import { mintPublicChatToken } from '@frontera-sdk/chat/public-token';
|
|
7
7
|
|
|
8
|
+
function usable(client) {
|
|
9
|
+
if (!client) return false;
|
|
10
|
+
try {
|
|
11
|
+
void client.config;
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
8
17
|
function useChatCredential(props) {
|
|
9
18
|
const suppliedClient = props.client;
|
|
10
19
|
const [ready, setReady] = useState(() => {
|
|
11
20
|
if (!suppliedClient) return false;
|
|
12
|
-
return typeof suppliedClient === "function" ?
|
|
21
|
+
return usable(typeof suppliedClient === "function" ? suppliedClient() : suppliedClient);
|
|
13
22
|
});
|
|
14
23
|
const [error, setError] = useState(null);
|
|
15
24
|
const [openingMessage, setOpeningMessage] = useState(null);
|
|
@@ -24,10 +33,27 @@ function useChatCredential(props) {
|
|
|
24
33
|
if (!suppliedClient) return null;
|
|
25
34
|
return typeof suppliedClient === "function" ? suppliedClient : () => suppliedClient;
|
|
26
35
|
}, [suppliedClient]);
|
|
27
|
-
const
|
|
36
|
+
const pending = !!staticClient && !ready;
|
|
28
37
|
useEffect(() => {
|
|
29
|
-
if (!
|
|
30
|
-
|
|
38
|
+
if (!pending) return;
|
|
39
|
+
const client = staticClient();
|
|
40
|
+
if (!client) return;
|
|
41
|
+
if (usable(client)) {
|
|
42
|
+
setReady(true);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let current = true;
|
|
46
|
+
void client.whenConnected().then(
|
|
47
|
+
() => {
|
|
48
|
+
if (current) setReady(true);
|
|
49
|
+
},
|
|
50
|
+
(failure) => {
|
|
51
|
+
if (current) setError(failure instanceof Error ? failure : new Error(String(failure)));
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
return () => {
|
|
55
|
+
current = false;
|
|
56
|
+
};
|
|
31
57
|
});
|
|
32
58
|
useEffect(() => {
|
|
33
59
|
if (staticClient) {
|
|
@@ -95,7 +121,10 @@ function useChatCredential(props) {
|
|
|
95
121
|
};
|
|
96
122
|
}, [staticClient, staticToken, apiBaseUrl, tokenEndpoint, getToken, publishableKey]);
|
|
97
123
|
const getClient = useMemo(
|
|
98
|
-
() => staticClient ? () =>
|
|
124
|
+
() => staticClient ? () => {
|
|
125
|
+
const client = staticClient();
|
|
126
|
+
return usable(client) ? client : null;
|
|
127
|
+
} : () => sessionRef.current?.getClient() ?? clientRef.current,
|
|
99
128
|
[staticClient]
|
|
100
129
|
);
|
|
101
130
|
const refresh = useCallback(async () => sessionRef.current?.refresh(), []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useTranslation } from './chunk-
|
|
2
|
+
import { useTranslation } from './chunk-7LCV3BV2.js';
|
|
3
3
|
import { Skeleton } from './chunk-UWKO24VT.js';
|
|
4
4
|
import { useRef, useState, useEffect } from 'react';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getToolMeta } from './chunk-
|
|
2
|
+
import { getToolMeta } from './chunk-6YDDHBQC.js';
|
|
3
3
|
import { Button } from './chunk-UWKO24VT.js';
|
|
4
4
|
import { ChevronDownMediumIcon, CrossMediumIcon } from './chunk-EZX3E3BB.js';
|
|
5
5
|
import { useChatClientOptional } from './chunk-6JLWE7M3.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { usePlugins, useChatCapabilityEnabled, resolvePluginLanguage, renderPluginBlock, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, ActionMenu, useArtifactStore, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, useArtifact, resolveArtifactIconFormat, artifactFormatIcon, useArtifactFileObjectUrl, artifactFormatSubtitle, ChatImageLightbox, ArrowsShowIcon, FileDownloadIcon, useClient, processMessageParts, getMessageDisplayTimestampValue, getMessageCreatedAtMs, isApprovalRequested, extractCitationsFromSteps, useSourcesEnrichment, extractImagesFromSteps, dedupeImageResults, getDocumentStreamArtifacts, getToolOutput, useCanvasStore, ImageResultsGallery, MessageDecisionCards, useChatCapabilities, useOptionalWorkspaceContext, useCitationViewer, useCitedDocument, useChatOverviewStore, dedup, extractDomain, sourceKind, SourceFavicon, Input, exportDocumentPdf, FilePdfIcon, StudioDisplayIcon, WorldIcon, MessageStepsGroup, getToolState, getToolInput, getToolErrorText, useChatOptInEnabled, ArrowRightIcon, formatFileSize, FileThumbnail, attachmentFileOf, MobileScreenSheet, useAgentHistorySource, treatyErrorMessage, useRouter, useBasePath, useAgentPanelStore, AgentRoutineForm, getFileCategory, unwrap, unwrapData, unwrapDataDeep, formatDecisionTime, DecisionCard, LoaderIcon, formatRelativeTime, CircleCheckIcon, agentRoutineKeys, useOptionalAgentsContext, avatarMotionForStream, AGENT_AVATAR_SIZE } from './chunk-
|
|
2
|
+
import { usePlugins, useChatCapabilityEnabled, resolvePluginLanguage, renderPluginBlock, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, ActionMenu, useArtifactStore, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, useArtifact, resolveArtifactIconFormat, artifactFormatIcon, useArtifactFileObjectUrl, artifactFormatSubtitle, ChatImageLightbox, ArrowsShowIcon, FileDownloadIcon, useClient, processMessageParts, getMessageDisplayTimestampValue, getMessageCreatedAtMs, isApprovalRequested, extractCitationsFromSteps, useSourcesEnrichment, extractImagesFromSteps, dedupeImageResults, getDocumentStreamArtifacts, getToolOutput, useCanvasStore, ImageResultsGallery, MessageDecisionCards, useChatCapabilities, useOptionalWorkspaceContext, useCitationViewer, useCitedDocument, useChatOverviewStore, dedup, extractDomain, sourceKind, SourceFavicon, Input, exportDocumentPdf, FilePdfIcon, StudioDisplayIcon, WorldIcon, MessageStepsGroup, getToolState, getToolInput, getToolErrorText, useChatOptInEnabled, ArrowRightIcon, formatFileSize, FileThumbnail, attachmentFileOf, MobileScreenSheet, useAgentHistorySource, treatyErrorMessage, useRouter, useBasePath, useAgentPanelStore, AgentRoutineForm, getFileCategory, unwrap, unwrapData, unwrapDataDeep, formatDecisionTime, DecisionCard, LoaderIcon, formatRelativeTime, CircleCheckIcon, agentRoutineKeys, useOptionalAgentsContext, avatarMotionForStream, AGENT_AVATAR_SIZE } from './chunk-652HXKK6.js';
|
|
3
3
|
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-OONQIDAU.js';
|
|
4
|
-
import { useIsMobile, useTranslation } from './chunk-
|
|
5
|
-
import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-
|
|
4
|
+
import { useIsMobile, useTranslation } from './chunk-7LCV3BV2.js';
|
|
5
|
+
import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-6YDDHBQC.js';
|
|
6
6
|
import { ChevronDownMediumIcon, Button, ScrollArea, Skeleton } from './chunk-UWKO24VT.js';
|
|
7
7
|
import { CrossMediumIcon } from './chunk-37WYG6VG.js';
|
|
8
8
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from './chunk-C3HW5S2Z.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { describeToolRow, Code2Icon, getToolMeta, Shimmer, Collapse } from './chunk-
|
|
2
|
+
import { describeToolRow, Code2Icon, getToolMeta, Shimmer, Collapse } from './chunk-6YDDHBQC.js';
|
|
3
3
|
import { ChevronDownMediumIcon } from './chunk-UWKO24VT.js';
|
|
4
4
|
import { cn } from './chunk-LGVMMBL3.js';
|
|
5
5
|
import { memo, useState, useMemo } from 'react';
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
export { capabilitiesOfChatToken, subjectOfChatToken } from './chunk-CCVPZVFK.js';
|
|
3
|
-
import { useChatCredential } from './chunk-
|
|
4
|
-
export { useChatCredential } from './chunk-
|
|
3
|
+
import { useChatCredential } from './chunk-LPQ4JQOB.js';
|
|
4
|
+
export { useChatCredential } from './chunk-LPQ4JQOB.js';
|
|
5
5
|
import './chunk-WDYCLC4F.js';
|
|
6
6
|
export { ChatClientContext, useChatClientOptional } from './chunk-6JLWE7M3.js';
|
|
7
7
|
import './chunk-PR4QN5HX.js';
|
package/dist/credential.js
CHANGED
package/dist/header.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { ChatHeader, ChatHeaderActions } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { ChatHeader, ChatHeaderActions } from './chunk-2UXCKWKS.js';
|
|
3
|
+
import './chunk-652HXKK6.js';
|
|
4
4
|
import './chunk-CWAOLMFS.js';
|
|
5
5
|
import './chunk-OONQIDAU.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
6
|
+
import './chunk-7LCV3BV2.js';
|
|
7
|
+
import './chunk-YZ4Z5J3J.js';
|
|
8
|
+
import './chunk-6YDDHBQC.js';
|
|
9
9
|
import './chunk-UWKO24VT.js';
|
|
10
10
|
import './chunk-37WYG6VG.js';
|
|
11
11
|
import './chunk-CDTES65T.js';
|
package/dist/message.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { Message, Thinking } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { Message, Thinking } from './chunk-X7TU7KKX.js';
|
|
3
|
+
import './chunk-652HXKK6.js';
|
|
4
4
|
import './chunk-CWAOLMFS.js';
|
|
5
5
|
import './chunk-OONQIDAU.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
6
|
+
import './chunk-7LCV3BV2.js';
|
|
7
|
+
import './chunk-YZ4Z5J3J.js';
|
|
8
|
+
import './chunk-6YDDHBQC.js';
|
|
9
9
|
import './chunk-UWKO24VT.js';
|
|
10
10
|
import './chunk-37WYG6VG.js';
|
|
11
11
|
import './chunk-CDTES65T.js';
|
package/dist/new-session.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-
|
|
2
|
+
export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-CEHOSQNR.js';
|
|
3
3
|
import './chunk-OONQIDAU.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-7LCV3BV2.js';
|
|
5
5
|
import './chunk-37WYG6VG.js';
|
|
6
6
|
import './chunk-RCWVJD7G.js';
|
|
7
7
|
import './chunk-LGVMMBL3.js';
|
package/dist/parts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { ToolCallItem } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
import { ToolCallItem } from './chunk-YZ4Z5J3J.js';
|
|
3
|
+
import './chunk-6YDDHBQC.js';
|
|
4
4
|
import './chunk-UWKO24VT.js';
|
|
5
5
|
import './chunk-37WYG6VG.js';
|
|
6
6
|
import './chunk-EZX3E3BB.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DeckNotesCard, deckOwnsArrowKeys } from './chunk-4FRTPVJT.js';
|
|
3
|
-
import { resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb, ArtifactSkeleton } from './chunk-
|
|
3
|
+
import { resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb, ArtifactSkeleton } from './chunk-MSRHFPQ5.js';
|
|
4
4
|
import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
|
|
5
|
-
import { useTranslation, useIsMobile } from './chunk-
|
|
5
|
+
import { useTranslation, useIsMobile } from './chunk-7LCV3BV2.js';
|
|
6
6
|
import { Button, ChevronDownMediumIcon, ScrollArea } from './chunk-UWKO24VT.js';
|
|
7
7
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, ChevronRightIcon } from './chunk-C3HW5S2Z.js';
|
|
8
8
|
import { cn } from './chunk-LGVMMBL3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { zoomPercent, DECK_ZOOM_LEVELS, ArtifactSkeleton, LazyThumb } from './chunk-
|
|
2
|
+
import { zoomPercent, DECK_ZOOM_LEVELS, ArtifactSkeleton, LazyThumb } from './chunk-MSRHFPQ5.js';
|
|
3
3
|
import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
|
|
4
|
-
import { useTranslation, useIsMobile } from './chunk-
|
|
4
|
+
import { useTranslation, useIsMobile } from './chunk-7LCV3BV2.js';
|
|
5
5
|
import { Button, ChevronDownMediumIcon, ScrollArea } from './chunk-UWKO24VT.js';
|
|
6
6
|
import { ChevronRightIcon, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem } from './chunk-C3HW5S2Z.js';
|
|
7
7
|
import { cn } from './chunk-LGVMMBL3.js';
|
package/dist/pending-cards.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { PendingCards } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { PendingCards } from './chunk-UHZ64AHN.js';
|
|
3
|
+
import './chunk-6YDDHBQC.js';
|
|
4
4
|
import './chunk-UWKO24VT.js';
|
|
5
5
|
import './chunk-37WYG6VG.js';
|
|
6
6
|
import './chunk-EZX3E3BB.js';
|