@frontera-sdk/chat-ui 1.52.44 → 1.52.46
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 +34 -19
- package/dist/{chunk-2G3EHYNS.js → chunk-272ALGNG.js} +2 -2
- package/dist/{chunk-QGGYWRGV.js → chunk-6BCUAPW3.js} +3 -1
- package/dist/{chunk-TY6QQSAF.js → chunk-A36QN6XG.js} +1 -1
- package/dist/{chunk-4DDOGZVM.js → chunk-BH732SE7.js} +1 -1
- package/dist/{chunk-5SGSD4HS.js → chunk-HXTBM76Q.js} +2 -2
- package/dist/{chunk-3ED4DPTV.js → chunk-IOT4NXZV.js} +386 -24
- package/dist/{chunk-5FR2R2Q5.js → chunk-OJRKM2RR.js} +1 -1
- package/dist/client.js +2 -2
- package/dist/credential.d.ts +2 -0
- package/dist/credential.js +1 -1
- package/dist/header.js +3 -3
- package/dist/message.js +3 -3
- package/dist/new-session.js +2 -2
- package/dist/{pdf-deck-view-inner-ZE7DECMZ.js → pdf-deck-view-inner-ED2OE7S7.js} +2 -2
- package/dist/{pdf-document-view-inner-V7FGCXYR.js → pdf-document-view-inner-CO4ABKGI.js} +2 -2
- package/dist/platform.css +1 -1
- package/package.json +3 -3
package/dist/chat.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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-
|
|
4
|
+
import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-BH732SE7.js';
|
|
5
|
+
import { NewSessionPrompt, keepCaretOnTap } from './chunk-OJRKM2RR.js';
|
|
6
6
|
import { PendingCards } from './chunk-N3I3MZTY.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-HXTBM76Q.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-272ALGNG.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-A36QN6XG.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-
|
|
18
|
+
import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-IOT4NXZV.js';
|
|
19
19
|
import './chunk-BRCS2NHC.js';
|
|
20
20
|
import { AppIcon, frontera_icon_default, PhotoIcon, Folder1Icon, FileTextIcon, describeToolRow, SquareArrowTopRightIcon, ClipboardIcon, getToolMeta, useStreamdownPlugins, AppIconFrame, MessageResponse } from './chunk-X33KXNO3.js';
|
|
21
21
|
import { Skeleton, Button, ScrollArea, ChevronDownMediumIcon, buttonVariants } from './chunk-UWKO24VT.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-CO4ABKGI.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-ED2OE7S7.js'), {
|
|
43270
43270
|
ssr: false,
|
|
43271
43271
|
loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "htmldeck" })
|
|
43272
43272
|
});
|
|
@@ -64027,6 +64027,8 @@ var DOMAIN5 = "knowledge";
|
|
|
64027
64027
|
var knowledgeKeys = {
|
|
64028
64028
|
/** Root key for all knowledge queries. */
|
|
64029
64029
|
all: [DOMAIN5],
|
|
64030
|
+
/** Every stats query scoped to one agent id, regardless of date range. */
|
|
64031
|
+
statsPrefix: (agentId) => [DOMAIN5, "stats", agentId ?? null],
|
|
64030
64032
|
/** Stats for a given agent (id preferred, name kept for fallback). */
|
|
64031
64033
|
stats: (arg) => {
|
|
64032
64034
|
const params = typeof arg === "string" ? { agentName: arg } : arg ?? {};
|
|
@@ -65922,6 +65924,13 @@ var EFFORT_ORDER = [
|
|
|
65922
65924
|
"max"
|
|
65923
65925
|
];
|
|
65924
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
|
+
}
|
|
65925
65934
|
var EFFORT_LABELS = {
|
|
65926
65935
|
minimal: "Minimal",
|
|
65927
65936
|
low: "Light",
|
|
@@ -70733,7 +70742,8 @@ function ChatInputBar({
|
|
|
70733
70742
|
if (!orgFlags) return;
|
|
70734
70743
|
const selectedKey = modelMode ?? defaultMode;
|
|
70735
70744
|
const selected = Array.isArray(modes) ? modes.find((entry) => entry.key === selectedKey) : selectedKey ? modes?.[selectedKey] : void 0;
|
|
70736
|
-
const
|
|
70745
|
+
const liveChatGpt = !selected && hasSubscriptionMode && isChatGptModeKey(selectedKey);
|
|
70746
|
+
const chatgptDisconnected = (selected?.provider === "openai-codex" || liveChatGpt) && !(hasSubscriptionMode && subscriptionStatus?.connected !== false);
|
|
70737
70747
|
const xaiDisconnected = selected?.provider === "xai" && !(hasXaiMode && xaiSubscriptionStatus?.connected !== false);
|
|
70738
70748
|
if (!chatgptDisconnected && !xaiDisconnected) return;
|
|
70739
70749
|
const cloudMode = modeEntries?.find(
|
|
@@ -71319,19 +71329,18 @@ function ChatInputBar({
|
|
|
71319
71329
|
if (!(base3 || fileAttachments.length > 0 || composerModes.length > 0) || isDisabled || isUploading) {
|
|
71320
71330
|
return false;
|
|
71321
71331
|
}
|
|
71322
|
-
const
|
|
71323
|
-
|
|
71324
|
-
);
|
|
71325
|
-
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) {
|
|
71326
71336
|
if (!subscriptionStatus?.connected) {
|
|
71327
71337
|
toast.error(
|
|
71328
71338
|
"Connect your ChatGPT account in Settings \u2192 Connections to use this model."
|
|
71329
71339
|
);
|
|
71330
71340
|
return false;
|
|
71331
71341
|
}
|
|
71332
|
-
|
|
71333
|
-
|
|
71334
|
-
)) {
|
|
71342
|
+
const modelId = selectedMode ? selectedMode.modelId ?? selectedMode.model ?? "" : chatGptModelId(selectedKey);
|
|
71343
|
+
if (!eligibleSubscriptionModels?.has(modelId)) {
|
|
71335
71344
|
toast.error(
|
|
71336
71345
|
"This ChatGPT model is unavailable for your account. Choose another model."
|
|
71337
71346
|
);
|
|
@@ -72220,7 +72229,7 @@ function FronteraChat({
|
|
|
72220
72229
|
[chosenAgent]
|
|
72221
72230
|
);
|
|
72222
72231
|
const [loadError, setLoadError] = useState(null);
|
|
72223
|
-
const { getClient, ready, error: credentialError, refresh: refreshCredential } = useChatCredential(credentialProps);
|
|
72232
|
+
const { getClient, ready, error: credentialError, refresh: refreshCredential, openingMessage } = useChatCredential(credentialProps);
|
|
72224
72233
|
const chatClient = useMemo(() => {
|
|
72225
72234
|
const client = getClient();
|
|
72226
72235
|
return client ? new ChatClient(client) : null;
|
|
@@ -72361,6 +72370,12 @@ function FronteraChat({
|
|
|
72361
72370
|
experimental_throttle: 50
|
|
72362
72371
|
});
|
|
72363
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]);
|
|
72364
72379
|
const replaceComposerText = useComposerStore((state) => state.replaceComposerText);
|
|
72365
72380
|
const handleEditMessage = useCallback(
|
|
72366
72381
|
(messageId, newText) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
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-A36QN6XG.js';
|
|
3
3
|
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-T5SANYSX.js';
|
|
4
|
-
import { useIsMobile, useTranslation } from './chunk-
|
|
4
|
+
import { useIsMobile, useTranslation } from './chunk-IOT4NXZV.js';
|
|
5
5
|
import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-X33KXNO3.js';
|
|
6
6
|
import { ChevronDownMediumIcon, Button, ScrollArea, Skeleton } from './chunk-UWKO24VT.js';
|
|
7
7
|
import { CrossMediumIcon } from './chunk-2P4IEVOQ.js';
|
|
@@ -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,7 +1,7 @@
|
|
|
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-
|
|
4
|
+
import { useIsMobile, useTranslation } from './chunk-IOT4NXZV.js';
|
|
5
5
|
import { ToolCallItem, ProcessorIcon } from './chunk-BRCS2NHC.js';
|
|
6
6
|
import { toolKindVerb, getToolMeta, Shimmer, Collapse, ToolGroupReasoningItem, SkillToolItem, DeviceDesktopIcon, WorldSearchIcon, FileTextIcon, useStreamdownPlugins, CircleXIcon, STREAMDOWN_LINK_SAFETY, Folder1Icon, AppIconFrame, AppIcon, Collapsible, CollapsibleTrigger, CollapsibleContent, SquareArrowTopRightIcon, Icon } from './chunk-X33KXNO3.js';
|
|
7
7
|
import { ChevronDownMediumIcon, Button, Skeleton, buttonVariants } from './chunk-UWKO24VT.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useTranslation } from './chunk-
|
|
2
|
+
import { useTranslation } from './chunk-IOT4NXZV.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,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { MagnifyingGlassIcon } from './chunk-X3QVICX7.js';
|
|
3
|
-
import { requestPaneFocus, useArtifacts, usePlugins, useCanvasStore, useArtifactStore, useChatOverviewStore, useSourcesEnrichment, sourceKind, useCitationViewer, resolveSourceDisplay, extractDomain, 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-
|
|
3
|
+
import { requestPaneFocus, useArtifacts, usePlugins, useCanvasStore, useArtifactStore, useChatOverviewStore, useSourcesEnrichment, sourceKind, useCitationViewer, resolveSourceDisplay, extractDomain, 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-A36QN6XG.js';
|
|
4
4
|
import { Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle } from './chunk-T5SANYSX.js';
|
|
5
|
-
import { useTranslation, useIsMobile } from './chunk-
|
|
5
|
+
import { useTranslation, useIsMobile } from './chunk-IOT4NXZV.js';
|
|
6
6
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent, Shimmer, HoverCard, HoverCardTrigger, HoverCardContent } from './chunk-X33KXNO3.js';
|
|
7
7
|
import { ChevronDownMediumIcon, ScrollArea, Skeleton, Button } from './chunk-UWKO24VT.js';
|
|
8
8
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, CrossMediumIcon } from './chunk-2P4IEVOQ.js';
|