@frontera-sdk/chat-ui 1.53.29 → 1.53.31

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.
@@ -2792,6 +2792,8 @@ var BRAND_ICONS = {
2792
2792
  discord: "logos:discord-icon",
2793
2793
  telegram: "logos:telegram",
2794
2794
  whatsapp: "logos:whatsapp-icon",
2795
+ messenger: "logos:messenger",
2796
+ instagram: "skill-icons:instagram",
2795
2797
  teams: "logos:microsoft-teams",
2796
2798
  email: "mingcute:mail-line",
2797
2799
  webhook: "material-symbols:webhook",
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { requestPaneFocus, useArtifacts, usePlugins, useCanvasStore, useArtifactStore, useChatOverviewStore, useSourcesEnrichment, sourceKind, useCitationViewer, resolveSourceDisplay, extractDomain, useCitedDocument, canvasId, StudioDisplayIcon, LayoutDashboardIcon, useAgentPanelStore, SourceFavicon, dedup, useArtifactFileObjectUrl, resolveArtifactIconFormat, artifactFormatIcon, avatarMotionForStream, AGENT_AVATAR_SIZE, getFileCategory, FileThumbnail, formatFileSize, usePathname, artifactFormatSubtitle, artifactCategory, Input, MobileScreenSheet, TooltipTrigger, Tooltip, useChatCapabilities, TooltipContent, processMessageParts, GridSpinner, PanelEdgeRing, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, extractCitationsFromSteps, resolvePluginLanguage, getMessageDisplayTimestampValue } from './chunk-IOSRUVWE.js';
2
+ import { requestPaneFocus, useArtifacts, usePlugins, useCanvasStore, useArtifactStore, useChatOverviewStore, useSourcesEnrichment, sourceKind, useCitationViewer, resolveSourceDisplay, extractDomain, useCitedDocument, canvasId, StudioDisplayIcon, LayoutDashboardIcon, useAgentPanelStore, SourceFavicon, dedup, useArtifactFileObjectUrl, resolveArtifactIconFormat, artifactFormatIcon, avatarMotionForStream, AGENT_AVATAR_SIZE, getFileCategory, FileThumbnail, formatFileSize, usePathname, artifactFormatSubtitle, artifactCategory, Input, MobileScreenSheet, TooltipTrigger, Tooltip, useChatCapabilities, TooltipContent, processMessageParts, GridSpinner, PanelEdgeRing, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, extractCitationsFromSteps, resolvePluginLanguage, getMessageDisplayTimestampValue } from './chunk-HQL3GCXS.js';
3
3
  import { MagnifyingGlassIcon, Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle } from './chunk-OONQIDAU.js';
4
- import { useTranslation, useIsMobile } from './chunk-4Q6CR67S.js';
5
- import { Collapsible, CollapsibleTrigger, CollapsibleContent, Shimmer, HoverCard, HoverCardTrigger, HoverCardContent } from './chunk-K7AIK7TA.js';
4
+ import { useTranslation, useIsMobile } from './chunk-5C7KTQDW.js';
5
+ import { Collapsible, CollapsibleTrigger, CollapsibleContent, Shimmer, HoverCard, HoverCardTrigger, HoverCardContent } from './chunk-6YDDHBQC.js';
6
6
  import { ChevronDownMediumIcon, ScrollArea, Skeleton, Button } from './chunk-UWKO24VT.js';
7
7
  import { Dialog, DialogContent, DialogHeader, DialogTitle, CrossMediumIcon } from './chunk-37WYG6VG.js';
8
8
  import { ChevronRightIcon } from './chunk-C3HW5S2Z.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-IOSRUVWE.js';
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-HQL3GCXS.js';
3
3
  import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-OONQIDAU.js';
4
- import { useIsMobile, useTranslation } from './chunk-4Q6CR67S.js';
5
- import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-K7AIK7TA.js';
4
+ import { useIsMobile, useTranslation } from './chunk-5C7KTQDW.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,9 +1,9 @@
1
1
  'use client';
2
2
  import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
3
3
  import { MagnifyingGlassIcon, Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from './chunk-OONQIDAU.js';
4
- import { useIsMobile, useTranslation } from './chunk-4Q6CR67S.js';
5
- import { ToolCallItem, ProcessorIcon } from './chunk-R3ONYPUB.js';
6
- import { describeToolRow, toolKindLabel, getToolMeta, Shimmer, Collapse, ToolGroupReasoningItem, SkillToolItem, DeviceDesktopIcon, WorldSearchIcon, FileTextIcon, useStreamdownPlugins, CircleXIcon, STREAMDOWN_LINK_SAFETY, Folder1Icon, AppIconFrame, AppIcon, Collapsible, CollapsibleTrigger, CollapsibleContent, SquareArrowTopRightIcon, Icon } from './chunk-K7AIK7TA.js';
4
+ import { useIsMobile, useTranslation } from './chunk-5C7KTQDW.js';
5
+ import { ToolCallItem, ProcessorIcon } from './chunk-YZ4Z5J3J.js';
6
+ import { describeToolRow, toolKindLabel, getToolMeta, Shimmer, Collapse, ToolGroupReasoningItem, SkillToolItem, DeviceDesktopIcon, WorldSearchIcon, FileTextIcon, useStreamdownPlugins, CircleXIcon, STREAMDOWN_LINK_SAFETY, Folder1Icon, AppIconFrame, AppIcon, Collapsible, CollapsibleTrigger, CollapsibleContent, SquareArrowTopRightIcon, Icon } from './chunk-6YDDHBQC.js';
7
7
  import { ChevronDownMediumIcon, Button, Skeleton, buttonVariants } from './chunk-UWKO24VT.js';
8
8
  import { Dialog, DialogContent, DialogTitle, DialogDescription, DialogClose, CrossMediumIcon, DialogHeader, DialogFooter, useReturnFocus } from './chunk-37WYG6VG.js';
9
9
  import { zipSync } from './chunk-CDTES65T.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" ? !!suppliedClient() : true;
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 pendingGetter = typeof suppliedClient === "function" && !ready;
36
+ const pending = !!staticClient && !ready;
28
37
  useEffect(() => {
29
- if (!pendingGetter) return;
30
- if (suppliedClient()) setReady(true);
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 ? () => staticClient() : () => sessionRef.current?.getClient() ?? clientRef.current,
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-4Q6CR67S.js';
2
+ import { useTranslation } from './chunk-5C7KTQDW.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,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-4Q6CR67S.js';
3
+ import { useIsMobile, useTranslation } from './chunk-5C7KTQDW.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';
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { getToolMeta } from './chunk-K7AIK7TA.js';
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,5 +1,5 @@
1
1
  'use client';
2
- import { describeToolRow, Code2Icon, getToolMeta, Shimmer, Collapse } from './chunk-K7AIK7TA.js';
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-6BCUAPW3.js';
4
- export { useChatCredential } from './chunk-6BCUAPW3.js';
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';
@@ -1,4 +1,4 @@
1
1
  'use client';
2
- export { useChatCredential } from './chunk-6BCUAPW3.js';
2
+ export { useChatCredential } from './chunk-LPQ4JQOB.js';
3
3
  import './chunk-WDYCLC4F.js';
4
4
  import './chunk-PR4QN5HX.js';
package/dist/header.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
- export { ChatHeader, ChatHeaderActions } from './chunk-6IMCJINQ.js';
3
- import './chunk-IOSRUVWE.js';
2
+ export { ChatHeader, ChatHeaderActions } from './chunk-AWBUED42.js';
3
+ import './chunk-HQL3GCXS.js';
4
4
  import './chunk-CWAOLMFS.js';
5
5
  import './chunk-OONQIDAU.js';
6
- import './chunk-4Q6CR67S.js';
7
- import './chunk-R3ONYPUB.js';
8
- import './chunk-K7AIK7TA.js';
6
+ import './chunk-5C7KTQDW.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-MLR6EJEV.js';
3
- import './chunk-IOSRUVWE.js';
2
+ export { Message, Thinking } from './chunk-G5Q6TZDM.js';
3
+ import './chunk-HQL3GCXS.js';
4
4
  import './chunk-CWAOLMFS.js';
5
5
  import './chunk-OONQIDAU.js';
6
- import './chunk-4Q6CR67S.js';
7
- import './chunk-R3ONYPUB.js';
8
- import './chunk-K7AIK7TA.js';
6
+ import './chunk-5C7KTQDW.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';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-QAXXD7LQ.js';
2
+ export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-RFTNSPPT.js';
3
3
  import './chunk-OONQIDAU.js';
4
- import './chunk-4Q6CR67S.js';
4
+ import './chunk-5C7KTQDW.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-R3ONYPUB.js';
3
- import './chunk-K7AIK7TA.js';
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-EK6EYBTA.js';
3
+ import { resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb, ArtifactSkeleton } from './chunk-RADXZ77Y.js';
4
4
  import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
5
- import { useTranslation, useIsMobile } from './chunk-4Q6CR67S.js';
5
+ import { useTranslation, useIsMobile } from './chunk-5C7KTQDW.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-EK6EYBTA.js';
2
+ import { zoomPercent, DECK_ZOOM_LEVELS, ArtifactSkeleton, LazyThumb } from './chunk-RADXZ77Y.js';
3
3
  import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
4
- import { useTranslation, useIsMobile } from './chunk-4Q6CR67S.js';
4
+ import { useTranslation, useIsMobile } from './chunk-5C7KTQDW.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';
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- export { PendingCards } from './chunk-A4GIIAMQ.js';
3
- import './chunk-K7AIK7TA.js';
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';