@frontera-sdk/chat-ui 1.52.45 → 1.52.47
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 +35 -22
- package/dist/{chunk-5FR2R2Q5.js → chunk-42PKM4PU.js} +1 -1
- package/dist/{chunk-X33KXNO3.js → chunk-4GXQI4E4.js} +4 -1
- package/dist/{chunk-QGGYWRGV.js → chunk-6BCUAPW3.js} +3 -1
- package/dist/{chunk-TY6QQSAF.js → chunk-6ROTTPLW.js} +31 -7
- package/dist/{chunk-2G3EHYNS.js → chunk-C5SCW5HO.js} +3 -3
- package/dist/{chunk-3ED4DPTV.js → chunk-IY27XSPQ.js} +786 -38
- package/dist/{chunk-N3I3MZTY.js → chunk-KVJ4JRMC.js} +1 -1
- package/dist/{chunk-BRCS2NHC.js → chunk-LAELBWN2.js} +1 -1
- package/dist/{chunk-4DDOGZVM.js → chunk-M7JCQQ3Z.js} +1 -1
- package/dist/{chunk-5SGSD4HS.js → chunk-YZ6MZLEZ.js} +3 -3
- package/dist/client.js +2 -2
- package/dist/credential.d.ts +2 -0
- 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-ZE7DECMZ.js → pdf-deck-view-inner-GSTIUZNL.js} +2 -2
- package/dist/{pdf-document-view-inner-V7FGCXYR.js → pdf-document-view-inner-UXGEBOW5.js} +2 -2
- package/dist/pending-cards.js +2 -2
- package/package.json +3 -3
package/dist/chat.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { offset, flip, autoUpdate, computePosition } from './chunk-I7SXWUAN.js';
|
|
3
3
|
import { isFullscreenHotkey, DeckNotesCard, deckOwnsArrowKeys } from './chunk-4FRTPVJT.js';
|
|
4
|
-
import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-
|
|
5
|
-
import { NewSessionPrompt, keepCaretOnTap } from './chunk-
|
|
6
|
-
import { PendingCards } from './chunk-
|
|
4
|
+
import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-M7JCQQ3Z.js';
|
|
5
|
+
import { NewSessionPrompt, keepCaretOnTap } from './chunk-42PKM4PU.js';
|
|
6
|
+
import { PendingCards } from './chunk-KVJ4JRMC.js';
|
|
7
7
|
import { themeToStyle } from './chunk-6HYPVNVA.js';
|
|
8
8
|
import { useChatAgents } from './chunk-O6CVTMZJ.js';
|
|
9
9
|
import { subjectOfChatToken, capabilitiesOfChatToken } from './chunk-CCVPZVFK.js';
|
|
10
|
-
import { useChatCredential } from './chunk-
|
|
10
|
+
import { useChatCredential } from './chunk-6BCUAPW3.js';
|
|
11
11
|
import './chunk-WDYCLC4F.js';
|
|
12
|
-
import { chatSidePanelSessionKey, Chart1Icon, useTemplatePreviewStore, useHasTemplatePreviewHost, useChatSidePanelStore, ChatHeader, ChatHeaderActions, useRightPane, getChatOverviewAgentStatus, useChatOverviewVisible, useConversationArtifacts, PENDING_CHART_TAB_PREFIX, CHART_TAB_PREFIX, AGENT_WORK_TAB_ID, AGENT_ROUTINES_TAB_ID, SOURCES_TAB_ID, TEMPLATE_TAB_ID, OutputsSection, ChainLink1Icon, ChatOverviewContent, COMPUTER_TAB_PREFIX, SourceRow, motion, MAX_CHAT_SIDE_PANEL_SESSIONS, DEFAULT_CHAT_SIDE_PANEL_SIZE, TableIcon } from './chunk-
|
|
12
|
+
import { chatSidePanelSessionKey, Chart1Icon, useTemplatePreviewStore, useHasTemplatePreviewHost, useChatSidePanelStore, ChatHeader, ChatHeaderActions, useRightPane, getChatOverviewAgentStatus, useChatOverviewVisible, useConversationArtifacts, PENDING_CHART_TAB_PREFIX, CHART_TAB_PREFIX, AGENT_WORK_TAB_ID, AGENT_ROUTINES_TAB_ID, SOURCES_TAB_ID, TEMPLATE_TAB_ID, OutputsSection, ChainLink1Icon, ChatOverviewContent, COMPUTER_TAB_PREFIX, SourceRow, motion, MAX_CHAT_SIDE_PANEL_SESSIONS, DEFAULT_CHAT_SIDE_PANEL_SIZE, TableIcon } from './chunk-YZ6MZLEZ.js';
|
|
13
13
|
import './chunk-X3QVICX7.js';
|
|
14
|
-
import { dynamic, useChatStreamStore, useComposerStore, Message, Thinking, setPendingFiles, usePersonConfirmations, unshownPendingConfirmations, ConversationConfirmationCard, useLivePreviewUrl, ArrowRotateClockwiseIcon, useComputerFiles, useUploadComputerFile, CanvasWidget, isPlainTextLanguage, useUploadFile, COMPOSER_ID_MAIN, useContextWindowInfo, useIsCompacting, useQueuedMessages, VolumeFullIcon, WarningSignIcon, useComputer, csvTextToWorkbookJson, CSV_PREVIEW_MAX_ROWS, CopyButton, COMPOSER_ID_COPILOT, ModelIcon, modeToBrandRow, useBackDismiss, PdfViewer, brandLabel, Spinner } from './chunk-
|
|
15
|
-
import { Textarea, artifactFormatIcon, BookIcon, useAgentRoster, ShieldCheckIcon, useArtifactStore, useCanvasStore, useChatOverviewStore, setSdkConversationPath, setSdkDarkMode, AgentsProvider, PluginProvider, WorkspaceProvider, TooltipProvider, getPersonConfirmation, isToolPart, getToolState, getToolName, getToolInput, sourceKind, extractDomain, CitationViewerContext, MarkdownRenderer, ConnectRunnerContext, usePathname, usePaneFocusStore, useAgentPanelStore, Tooltip, TooltipTrigger, TooltipContent, StudioDisplayIcon, WorldIcon, SlidesWideIcon, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, ArrowsShowIcon, useKeyboardInset, ExclamationCircleIcon, getToolOutput, useArtifact, useUpdateArtifact, useArtifactFileObjectUrl, resolveArtifactIconFormat, useSourcesEnrichment, LoaderIcon, FileDownloadIcon, Label, Input, renderPluginBlock, useArtifactVersion, useChatCapabilities, useChatCapabilityEnabled, useChatOptInEnabled, useSessionPendingApprovals, tableToCsv, tableToXlsx, tableToMarkdown, DropdownMenu, DropdownMenuTrigger, StyledDropdownMenuContent, StyledDropdownMenuItem, useArtifactVersions, useClient, unwrapData, authFetch, getBearerHeadersForApi, EyeOpenIcon, EyeSlashIcon, useRestoreArtifactVersion, ZoomableImage, ChatImageLightbox, useDownloadArtifact, useArtifactFileBytes, useArtifactPreviewFileObjectUrl, useArtifactVersionPreviewFileObjectUrl, errorText, SpreadsheetIcon, FilePdfIcon, useOptionalWorkspaceContext, useAgentConnectionStatus, useArtifacts, useSession, useWorkspaceContext, useConversationDesktopStatus, isRequestHumanTool, appsKeys, unwrapDataDeep, useRouter, Images1Icon, ArrowUpIcon, VideoIcon, AudioIcon, useBrand, resolveBearerHeaders, subscribeSdkDarkMode, getSdkDarkMode, unwrap, useConnectRunner, useStartUserConnect, useUpsertGrant, useRevokeGrant, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, LayoutGrid1Icon, useCatalog, useInstalls, useWorkspaceSlug, buildTenantUrlAbsolute } from './chunk-
|
|
14
|
+
import { dynamic, useChatStreamStore, useComposerStore, Message, Thinking, setPendingFiles, usePersonConfirmations, unshownPendingConfirmations, ConversationConfirmationCard, useLivePreviewUrl, ArrowRotateClockwiseIcon, useComputerFiles, useUploadComputerFile, CanvasWidget, isPlainTextLanguage, useUploadFile, COMPOSER_ID_MAIN, useContextWindowInfo, useIsCompacting, useQueuedMessages, VolumeFullIcon, WarningSignIcon, useComputer, csvTextToWorkbookJson, CSV_PREVIEW_MAX_ROWS, CopyButton, COMPOSER_ID_COPILOT, ModelIcon, modeToBrandRow, useBackDismiss, PdfViewer, brandLabel, Spinner } from './chunk-C5SCW5HO.js';
|
|
15
|
+
import { Textarea, artifactFormatIcon, BookIcon, useAgentRoster, ShieldCheckIcon, useArtifactStore, useCanvasStore, useChatOverviewStore, setSdkConversationPath, setSdkDarkMode, AgentsProvider, PluginProvider, WorkspaceProvider, TooltipProvider, getPersonConfirmation, isToolPart, getToolState, getToolName, getToolInput, sourceKind, extractDomain, CitationViewerContext, MarkdownRenderer, ConnectRunnerContext, usePathname, usePaneFocusStore, useAgentPanelStore, Tooltip, TooltipTrigger, TooltipContent, StudioDisplayIcon, WorldIcon, SlidesWideIcon, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, ArrowsShowIcon, useKeyboardInset, ExclamationCircleIcon, getToolOutput, useArtifact, useUpdateArtifact, useArtifactFileObjectUrl, resolveArtifactIconFormat, useSourcesEnrichment, LoaderIcon, FileDownloadIcon, Label, Input, renderPluginBlock, useArtifactVersion, useChatCapabilities, useChatCapabilityEnabled, useChatOptInEnabled, useSessionPendingApprovals, tableToCsv, tableToXlsx, tableToMarkdown, DropdownMenu, DropdownMenuTrigger, StyledDropdownMenuContent, StyledDropdownMenuItem, useArtifactVersions, useClient, unwrapData, authFetch, getBearerHeadersForApi, EyeOpenIcon, EyeSlashIcon, useRestoreArtifactVersion, ZoomableImage, ChatImageLightbox, useDownloadArtifact, useArtifactFileBytes, useArtifactPreviewFileObjectUrl, useArtifactVersionPreviewFileObjectUrl, errorText, SpreadsheetIcon, FilePdfIcon, useOptionalWorkspaceContext, useAgentConnectionStatus, useArtifacts, useSession, useWorkspaceContext, useConversationDesktopStatus, isRequestHumanTool, appsKeys, unwrapDataDeep, useRouter, Images1Icon, ArrowUpIcon, VideoIcon, AudioIcon, useBrand, resolveBearerHeaders, subscribeSdkDarkMode, getSdkDarkMode, unwrap, useConnectRunner, useStartUserConnect, useUpsertGrant, useRevokeGrant, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, LayoutGrid1Icon, useCatalog, useInstalls, useWorkspaceSlug, buildTenantUrlAbsolute } from './chunk-6ROTTPLW.js';
|
|
16
16
|
import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
|
|
17
17
|
import { Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './chunk-T5SANYSX.js';
|
|
18
|
-
import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-
|
|
19
|
-
import './chunk-
|
|
20
|
-
import { AppIcon, frontera_icon_default, PhotoIcon, Folder1Icon, FileTextIcon, describeToolRow, SquareArrowTopRightIcon, ClipboardIcon, getToolMeta, useStreamdownPlugins, AppIconFrame, MessageResponse } from './chunk-
|
|
18
|
+
import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-IY27XSPQ.js';
|
|
19
|
+
import './chunk-LAELBWN2.js';
|
|
20
|
+
import { AppIcon, frontera_icon_default, PhotoIcon, Folder1Icon, FileTextIcon, describeToolRow, SquareArrowTopRightIcon, ClipboardIcon, getToolMeta, useStreamdownPlugins, AppIconFrame, MessageResponse } from './chunk-4GXQI4E4.js';
|
|
21
21
|
import { Skeleton, Button, ScrollArea, ChevronDownMediumIcon, buttonVariants } from './chunk-UWKO24VT.js';
|
|
22
22
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, CrossMediumIcon, DialogFooter } from './chunk-2P4IEVOQ.js';
|
|
23
23
|
import './chunk-CDTES65T.js';
|
|
@@ -30,7 +30,7 @@ import { __commonJS, __export, __toESM } from './chunk-PR4QN5HX.js';
|
|
|
30
30
|
import * as React from 'react';
|
|
31
31
|
import React__default, { createContext, forwardRef, useState, useRef, useCallback, useMemo, useEffect, useImperativeHandle, useContext, useDebugValue, createRef, memo, createElement, useLayoutEffect, version, Activity, Component, useSyncExternalStore as useSyncExternalStore$1, Fragment as Fragment$1 } from 'react';
|
|
32
32
|
import { useChat } from '@ai-sdk/react';
|
|
33
|
-
import { createChatTransport } from '@frontera-sdk/chat/transport';
|
|
33
|
+
import { createChatTransport, OPENING_MESSAGE_ID } from '@frontera-sdk/chat/transport';
|
|
34
34
|
import { runAppConnection, completeRedirectedConnection } from '@frontera-sdk/chat/connect-popup';
|
|
35
35
|
import { ChatClient } from '@frontera-sdk/chat/chat-client';
|
|
36
36
|
import { QueryClient, useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
@@ -42449,7 +42449,7 @@ function SheetEditor({ content, onSave, readOnly = false }) {
|
|
|
42449
42449
|
);
|
|
42450
42450
|
}
|
|
42451
42451
|
var PdfDocumentViewInner = dynamic(
|
|
42452
|
-
() => import('./pdf-document-view-inner-
|
|
42452
|
+
() => import('./pdf-document-view-inner-UXGEBOW5.js'),
|
|
42453
42453
|
{
|
|
42454
42454
|
ssr: false,
|
|
42455
42455
|
loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "pdf" })
|
|
@@ -43266,7 +43266,7 @@ function HtmlDeckView({ content, inChat = false, versionSlot }) {
|
|
|
43266
43266
|
!present && inChat && /* @__PURE__ */ jsx(DeckEditPanel, { currentIndex: sel, currentHtml: slides[sel]?.html ?? "" })
|
|
43267
43267
|
] });
|
|
43268
43268
|
}
|
|
43269
|
-
var Inner = dynamic(() => import('./pdf-deck-view-inner-
|
|
43269
|
+
var Inner = dynamic(() => import('./pdf-deck-view-inner-GSTIUZNL.js'), {
|
|
43270
43270
|
ssr: false,
|
|
43271
43271
|
loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "htmldeck" })
|
|
43272
43272
|
});
|
|
@@ -65924,6 +65924,13 @@ var EFFORT_ORDER = [
|
|
|
65924
65924
|
"max"
|
|
65925
65925
|
];
|
|
65926
65926
|
var AUTOMATIC_MODE = "$automatic";
|
|
65927
|
+
var CHATGPT_MODE_PREFIX = "chatgpt-";
|
|
65928
|
+
function isChatGptModeKey(key2) {
|
|
65929
|
+
return !!key2 && key2.startsWith(CHATGPT_MODE_PREFIX);
|
|
65930
|
+
}
|
|
65931
|
+
function chatGptModelId(key2) {
|
|
65932
|
+
return isChatGptModeKey(key2) ? key2.slice(CHATGPT_MODE_PREFIX.length) : "";
|
|
65933
|
+
}
|
|
65927
65934
|
var EFFORT_LABELS = {
|
|
65928
65935
|
minimal: "Minimal",
|
|
65929
65936
|
low: "Light",
|
|
@@ -70735,7 +70742,8 @@ function ChatInputBar({
|
|
|
70735
70742
|
if (!orgFlags) return;
|
|
70736
70743
|
const selectedKey = modelMode ?? defaultMode;
|
|
70737
70744
|
const selected = Array.isArray(modes) ? modes.find((entry) => entry.key === selectedKey) : selectedKey ? modes?.[selectedKey] : void 0;
|
|
70738
|
-
const
|
|
70745
|
+
const liveChatGpt = !selected && hasSubscriptionMode && isChatGptModeKey(selectedKey);
|
|
70746
|
+
const chatgptDisconnected = (selected?.provider === "openai-codex" || liveChatGpt) && !(hasSubscriptionMode && subscriptionStatus?.connected !== false);
|
|
70739
70747
|
const xaiDisconnected = selected?.provider === "xai" && !(hasXaiMode && xaiSubscriptionStatus?.connected !== false);
|
|
70740
70748
|
if (!chatgptDisconnected && !xaiDisconnected) return;
|
|
70741
70749
|
const cloudMode = modeEntries?.find(
|
|
@@ -71321,19 +71329,18 @@ function ChatInputBar({
|
|
|
71321
71329
|
if (!(base3 || fileAttachments.length > 0 || composerModes.length > 0) || isDisabled || isUploading) {
|
|
71322
71330
|
return false;
|
|
71323
71331
|
}
|
|
71324
|
-
const
|
|
71325
|
-
|
|
71326
|
-
);
|
|
71327
|
-
if (selectedMode?.provider === "openai-codex") {
|
|
71332
|
+
const selectedKey = modelMode ?? defaultMode;
|
|
71333
|
+
const selectedMode = modeEntries?.find((mode) => mode.key === selectedKey);
|
|
71334
|
+
const unlistedChatGpt = !selectedMode && hasSubscriptionMode && isChatGptModeKey(selectedKey);
|
|
71335
|
+
if (selectedMode?.provider === "openai-codex" || unlistedChatGpt) {
|
|
71328
71336
|
if (!subscriptionStatus?.connected) {
|
|
71329
71337
|
toast.error(
|
|
71330
71338
|
"Connect your ChatGPT account in Settings \u2192 Connections to use this model."
|
|
71331
71339
|
);
|
|
71332
71340
|
return false;
|
|
71333
71341
|
}
|
|
71334
|
-
|
|
71335
|
-
|
|
71336
|
-
)) {
|
|
71342
|
+
const modelId = selectedMode ? selectedMode.modelId ?? selectedMode.model ?? "" : chatGptModelId(selectedKey);
|
|
71343
|
+
if (!eligibleSubscriptionModels?.has(modelId)) {
|
|
71337
71344
|
toast.error(
|
|
71338
71345
|
"This ChatGPT model is unavailable for your account. Choose another model."
|
|
71339
71346
|
);
|
|
@@ -72222,7 +72229,7 @@ function FronteraChat({
|
|
|
72222
72229
|
[chosenAgent]
|
|
72223
72230
|
);
|
|
72224
72231
|
const [loadError, setLoadError] = useState(null);
|
|
72225
|
-
const { getClient, ready, error: credentialError, refresh: refreshCredential } = useChatCredential(credentialProps);
|
|
72232
|
+
const { getClient, ready, error: credentialError, refresh: refreshCredential, openingMessage } = useChatCredential(credentialProps);
|
|
72226
72233
|
const chatClient = useMemo(() => {
|
|
72227
72234
|
const client = getClient();
|
|
72228
72235
|
return client ? new ChatClient(client) : null;
|
|
@@ -72363,6 +72370,12 @@ function FronteraChat({
|
|
|
72363
72370
|
experimental_throttle: 50
|
|
72364
72371
|
});
|
|
72365
72372
|
sendMessageRef.current = sendMessage;
|
|
72373
|
+
useEffect(() => {
|
|
72374
|
+
if (!openingMessage || initialConversationId) return;
|
|
72375
|
+
setMessages(
|
|
72376
|
+
(current) => current.length ? current : [{ id: OPENING_MESSAGE_ID, role: "assistant", parts: [{ type: "text", text: openingMessage }] }]
|
|
72377
|
+
);
|
|
72378
|
+
}, [openingMessage, initialConversationId, setMessages]);
|
|
72366
72379
|
const replaceComposerText = useComposerStore((state) => state.replaceComposerText);
|
|
72367
72380
|
const handleEditMessage = useCallback(
|
|
72368
72381
|
(messageId, newText) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { MagnifyingGlassIcon } from './chunk-X3QVICX7.js';
|
|
3
3
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, Popover, PopoverTrigger, PopoverContent } from './chunk-T5SANYSX.js';
|
|
4
|
-
import { useIsMobile, useTranslation } from './chunk-
|
|
4
|
+
import { useIsMobile, useTranslation } from './chunk-IY27XSPQ.js';
|
|
5
5
|
import { CrossMediumIcon } from './chunk-2P4IEVOQ.js';
|
|
6
6
|
import { AgentAvatar } from './chunk-RVJEI4ZY.js';
|
|
7
7
|
import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
|
|
@@ -1250,6 +1250,9 @@ function toolKindVerb(toolName) {
|
|
|
1250
1250
|
const cfg = TOOL_ROW_CONFIG[toolName] ?? TOOL_ROW_CONFIG[displayName];
|
|
1251
1251
|
return cfg?.done;
|
|
1252
1252
|
}
|
|
1253
|
+
function toolKindLabel(toolName) {
|
|
1254
|
+
return toolKindVerb(toolName) ?? describeToolRow(toolName, "output-available", void 0, void 0).verb;
|
|
1255
|
+
}
|
|
1253
1256
|
function describeToolRow(toolName, state, input, output, errorText) {
|
|
1254
1257
|
const authored = pickTarget(input, ["action"]);
|
|
1255
1258
|
if (authored) {
|
|
@@ -3201,4 +3204,4 @@ var ToolGroupReasoningItem = ({
|
|
|
3201
3204
|
] });
|
|
3202
3205
|
};
|
|
3203
3206
|
|
|
3204
|
-
export { AppIcon, AppIconFrame, CircleXIcon, ClipboardIcon, ClockIcon, Code2Icon, Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, DeviceDesktopIcon, FileTextIcon, Folder1Icon, HoverCard, HoverCardContent, HoverCardTrigger, Icon2 as Icon, Message, MessageContent, MessageResponse, MessageToolbar, PencilIcon, PhotoIcon, STREAMDOWN_LINK_SAFETY, Shimmer, SkillToolItem, SquareArrowTopRightIcon, ToolGroupReasoningItem, WorldSearchIcon, deferDuringLayoutMotion, describeToolRow, frontera_icon_default, getToolMeta,
|
|
3207
|
+
export { AppIcon, AppIconFrame, CircleXIcon, ClipboardIcon, ClockIcon, Code2Icon, Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, DeviceDesktopIcon, FileTextIcon, Folder1Icon, HoverCard, HoverCardContent, HoverCardTrigger, Icon2 as Icon, Message, MessageContent, MessageResponse, MessageToolbar, PencilIcon, PhotoIcon, STREAMDOWN_LINK_SAFETY, Shimmer, SkillToolItem, SquareArrowTopRightIcon, ToolGroupReasoningItem, WorldSearchIcon, deferDuringLayoutMotion, describeToolRow, frontera_icon_default, getToolMeta, toolKindLabel, useStreamdownPlugins };
|
|
@@ -12,6 +12,7 @@ function useChatCredential(props) {
|
|
|
12
12
|
return typeof suppliedClient === "function" ? !!suppliedClient() : true;
|
|
13
13
|
});
|
|
14
14
|
const [error, setError] = useState(null);
|
|
15
|
+
const [openingMessage, setOpeningMessage] = useState(null);
|
|
15
16
|
const clientRef = useRef(null);
|
|
16
17
|
const sessionRef = useRef(null);
|
|
17
18
|
const staticToken = props.token;
|
|
@@ -65,6 +66,7 @@ function useChatCredential(props) {
|
|
|
65
66
|
try {
|
|
66
67
|
const first = await loadFromHost();
|
|
67
68
|
if (disposed) return;
|
|
69
|
+
if (typeof first.openingMessage === "string" && first.openingMessage.trim()) setOpeningMessage(first.openingMessage);
|
|
68
70
|
const base = first.apiBaseUrl ?? apiBaseUrl;
|
|
69
71
|
if (!base) throw new Error("No apiBaseUrl: pass one, or return it from your token endpoint");
|
|
70
72
|
session = createTokenSession({
|
|
@@ -97,7 +99,7 @@ function useChatCredential(props) {
|
|
|
97
99
|
[staticClient]
|
|
98
100
|
);
|
|
99
101
|
const refresh = useCallback(async () => sessionRef.current?.refresh(), []);
|
|
100
|
-
return { getClient, ready, error, refresh };
|
|
102
|
+
return { getClient, ready, error, refresh, openingMessage };
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export { useChatCredential };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
|
|
3
3
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from './chunk-T5SANYSX.js';
|
|
4
|
-
import { useIsMobile, useTranslation } from './chunk-
|
|
5
|
-
import { ToolCallItem, ProcessorIcon } from './chunk-
|
|
6
|
-
import {
|
|
4
|
+
import { useIsMobile, useTranslation } from './chunk-IY27XSPQ.js';
|
|
5
|
+
import { ToolCallItem, ProcessorIcon } from './chunk-LAELBWN2.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-4GXQI4E4.js';
|
|
7
7
|
import { ChevronDownMediumIcon, Button, Skeleton, buttonVariants } from './chunk-UWKO24VT.js';
|
|
8
8
|
import { Dialog, DialogContent, DialogTitle, DialogDescription, DialogClose, CrossMediumIcon, DialogHeader, DialogFooter } from './chunk-2P4IEVOQ.js';
|
|
9
9
|
import { zipSync } from './chunk-CDTES65T.js';
|
|
@@ -18904,14 +18904,38 @@ var MessageStepsGroup = memo(function MessageStepsGroup2({
|
|
|
18904
18904
|
const input = getToolInput(imageGenStep.part);
|
|
18905
18905
|
return input?.aspectRatio ? input.aspectRatio.replace(":", " / ") : "1 / 1";
|
|
18906
18906
|
})();
|
|
18907
|
+
const namedTools = useMemo(
|
|
18908
|
+
() => toolItems.filter(
|
|
18909
|
+
(item) => !isRequestHumanTool(getToolName(item.part)) && getToolName(item.part) !== "think"
|
|
18910
|
+
),
|
|
18911
|
+
[toolItems]
|
|
18912
|
+
);
|
|
18913
|
+
const titledTool = useMemo(
|
|
18914
|
+
() => isGroupStreaming ? namedTools.findLast(
|
|
18915
|
+
(item) => ["input-streaming", "input-available"].includes(getToolState(item.part))
|
|
18916
|
+
) : void 0,
|
|
18917
|
+
[namedTools, isGroupStreaming]
|
|
18918
|
+
);
|
|
18919
|
+
const titledToolLabel = useMemo(() => {
|
|
18920
|
+
if (!titledTool) return "";
|
|
18921
|
+
const { verb, target } = describeToolRow(
|
|
18922
|
+
getToolName(titledTool.part),
|
|
18923
|
+
getToolState(titledTool.part),
|
|
18924
|
+
getToolInput(titledTool.part),
|
|
18925
|
+
getToolOutput(titledTool.part),
|
|
18926
|
+
getToolErrorText(titledTool.part)
|
|
18927
|
+
);
|
|
18928
|
+
return [verb, target].filter(Boolean).join(" ");
|
|
18929
|
+
}, [titledTool]);
|
|
18907
18930
|
const activitySummary = useMemo(() => {
|
|
18908
|
-
|
|
18931
|
+
if (titledToolLabel) return titledToolLabel;
|
|
18932
|
+
const verbs = namedTools.map((item) => toolKindLabel(getToolName(item.part)));
|
|
18909
18933
|
return summarizeActivity(verbs) || `${visibleCount} steps completed`;
|
|
18910
|
-
}, [
|
|
18934
|
+
}, [namedTools, visibleCount, titledToolLabel]);
|
|
18911
18935
|
const activityIcon = useMemo(() => {
|
|
18912
|
-
const lead =
|
|
18936
|
+
const lead = titledTool ?? namedTools[0] ?? toolItems[0];
|
|
18913
18937
|
return lead ? getToolMeta(getToolName(lead.part)).icon : null;
|
|
18914
|
-
}, [toolItems]);
|
|
18938
|
+
}, [titledTool, namedTools, toolItems]);
|
|
18915
18939
|
const AUTO_CLOSE_DELAY = 1e3;
|
|
18916
18940
|
const expandedByDefault = useChatOptInEnabled("expandedWorkDetails");
|
|
18917
18941
|
const foldEnabled = useChatCapabilityEnabled("stepGroupFold");
|
|
@@ -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, 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, 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-6ROTTPLW.js';
|
|
3
3
|
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-T5SANYSX.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-IY27XSPQ.js';
|
|
5
|
+
import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-4GXQI4E4.js';
|
|
6
6
|
import { ChevronDownMediumIcon, Button, ScrollArea, Skeleton } from './chunk-UWKO24VT.js';
|
|
7
7
|
import { CrossMediumIcon } from './chunk-2P4IEVOQ.js';
|
|
8
8
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from './chunk-C3HW5S2Z.js';
|