@frontera-sdk/chat-ui 1.53.7 → 1.53.8
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
CHANGED
|
@@ -10,7 +10,7 @@ import { subjectOfChatToken, capabilitiesOfChatToken } from './chunk-CCVPZVFK.js
|
|
|
10
10
|
import { useChatCredential } from './chunk-6BCUAPW3.js';
|
|
11
11
|
import './chunk-WDYCLC4F.js';
|
|
12
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-VB2YKQGZ.js';
|
|
13
|
-
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-
|
|
13
|
+
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-PF67GCUZ.js';
|
|
14
14
|
import { Textarea, resolveChatHost, artifactFormatIcon, BookIcon, useAgentRoster, ShieldCheckIcon, useArtifactStore, useCanvasStore, useChatOverviewStore, setSdkConversationPath, setSdkDarkMode, AgentsProvider, PluginProvider, WorkspaceProvider, TooltipProvider, ChatHostProvider, getPersonConfirmation, isToolPart, getToolState, getToolName, getToolInput, sourceKind, extractDomain, CitationViewerContext, MarkdownRenderer, ConnectRunnerContext, usePathname, useChatSurfaceProvider, 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, useChatHost, 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-KKOK22CN.js';
|
|
15
15
|
import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
|
|
16
16
|
import { Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './chunk-FZ3VSITY.js';
|
|
@@ -65911,6 +65911,20 @@ function isChatGptModeKey(key2) {
|
|
|
65911
65911
|
function chatGptModelId(key2) {
|
|
65912
65912
|
return isChatGptModeKey(key2) ? key2.slice(CHATGPT_MODE_PREFIX.length) : "";
|
|
65913
65913
|
}
|
|
65914
|
+
function chatGptModeFromKey(key2) {
|
|
65915
|
+
const modelId = chatGptModelId(key2);
|
|
65916
|
+
if (!modelId) return void 0;
|
|
65917
|
+
const [family, version, ...rest] = modelId.split("-");
|
|
65918
|
+
const words = rest.map((word) => word.charAt(0).toUpperCase() + word.slice(1));
|
|
65919
|
+
const name = family === "gpt" && version ? [`GPT-${version}`, ...words].join(" ") : modelId;
|
|
65920
|
+
return { key: key2, name, provider: "openai-codex", modelId, model: modelId };
|
|
65921
|
+
}
|
|
65922
|
+
function areEffortOptionsSettled(chatGpt) {
|
|
65923
|
+
if (!chatGpt.offered) return true;
|
|
65924
|
+
if (chatGpt.statusPending || chatGpt.statusFailed) return false;
|
|
65925
|
+
if (!chatGpt.connected) return true;
|
|
65926
|
+
return !chatGpt.modelsPending && !chatGpt.modelsFailed;
|
|
65927
|
+
}
|
|
65914
65928
|
var EFFORT_LABELS = {
|
|
65915
65929
|
minimal: "Minimal",
|
|
65916
65930
|
low: "Light",
|
|
@@ -66586,6 +66600,7 @@ function ModelSelector({
|
|
|
66586
66600
|
defaultMode,
|
|
66587
66601
|
automatic = false,
|
|
66588
66602
|
pending = false,
|
|
66603
|
+
effortOptionsSettled = false,
|
|
66589
66604
|
variant = "default",
|
|
66590
66605
|
codexConnect,
|
|
66591
66606
|
chatGptSubscriptionConnected = false,
|
|
@@ -66624,12 +66639,17 @@ function ModelSelector({
|
|
|
66624
66639
|
const isMobile = useIsMobile();
|
|
66625
66640
|
const onAutomatic = automatic && currentMode === AUTOMATIC_MODE;
|
|
66626
66641
|
const waiting = pending && !automatic && currentMode === AUTOMATIC_MODE;
|
|
66627
|
-
const
|
|
66642
|
+
const pendingChatGpt = modeMap.has(currentMode) ? void 0 : chatGptModeFromKey(currentMode);
|
|
66643
|
+
const current = onAutomatic || waiting ? void 0 : modeMap.get(currentMode) ?? pendingChatGpt ?? visibleModes[0];
|
|
66628
66644
|
const effortOptions = getModeEffortOptions(current);
|
|
66629
66645
|
const defaultEffort = current?.reasoning?.defaultEffort ?? effortOptions[0];
|
|
66630
66646
|
const activeEffort = reasoningEffort ?? defaultEffort;
|
|
66631
66647
|
const showModelSelector = visibleModes.length > 1;
|
|
66632
66648
|
const showEffort = effortOptions.length > 0;
|
|
66649
|
+
const unofferedEffort = effortOptionsSettled && modeMap.has(currentMode) && showEffort && !!reasoningEffort && !effortOptions.includes(reasoningEffort);
|
|
66650
|
+
useEffect(() => {
|
|
66651
|
+
if (unofferedEffort) setReasoningEffort(sessionKey, null);
|
|
66652
|
+
}, [unofferedEffort, sessionKey, setReasoningEffort]);
|
|
66633
66653
|
const handleOpenChange = (next) => {
|
|
66634
66654
|
if (next) {
|
|
66635
66655
|
setOpenWidth(triggerRef.current?.offsetWidth);
|
|
@@ -66639,7 +66659,8 @@ function ModelSelector({
|
|
|
66639
66659
|
};
|
|
66640
66660
|
if (!showModelSelector && !showEffort) return null;
|
|
66641
66661
|
const isRail = variant === "rail";
|
|
66642
|
-
const
|
|
66662
|
+
const shownEffort = pendingChatGpt ? reasoningEffort : showEffort ? activeEffort : void 0;
|
|
66663
|
+
const effortLabel = shownEffort ? EFFORT_LABELS[shownEffort] ?? shownEffort : null;
|
|
66643
66664
|
const modelLabel = onAutomatic ? "Auto" : waiting ? "Model" : current ? getShortDisplayName(current) : currentMode;
|
|
66644
66665
|
const defaultModeEntry = (defaultMode ? modeMap.get(defaultMode) : void 0) ?? visibleModes[0];
|
|
66645
66666
|
const selectedModeKey = current?.key ?? currentMode;
|
|
@@ -70659,10 +70680,26 @@ function ChatInputBar({
|
|
|
70659
70680
|
const hasSubscriptionMode = Boolean(
|
|
70660
70681
|
manifestModeEntries?.some((m) => m.provider === "openai-codex")
|
|
70661
70682
|
);
|
|
70662
|
-
const {
|
|
70663
|
-
|
|
70683
|
+
const {
|
|
70684
|
+
data: subscriptionStatus,
|
|
70685
|
+
isPending: subscriptionStatusPending,
|
|
70686
|
+
isError: subscriptionStatusError
|
|
70687
|
+
} = useChatGptSubscriptionStatus(hasSubscriptionMode);
|
|
70688
|
+
const {
|
|
70689
|
+
data: subscriptionModels,
|
|
70690
|
+
isError: subscriptionModelsError,
|
|
70691
|
+
isPending: subscriptionModelsPending
|
|
70692
|
+
} = useChatGptSubscriptionModels(
|
|
70664
70693
|
hasSubscriptionMode && !!subscriptionStatus?.connected
|
|
70665
70694
|
);
|
|
70695
|
+
const effortOptionsSettled = areEffortOptionsSettled({
|
|
70696
|
+
offered: hasSubscriptionMode,
|
|
70697
|
+
statusPending: subscriptionStatusPending,
|
|
70698
|
+
statusFailed: subscriptionStatusError,
|
|
70699
|
+
connected: !!subscriptionStatus?.connected,
|
|
70700
|
+
modelsPending: subscriptionModelsPending,
|
|
70701
|
+
modelsFailed: subscriptionModelsError
|
|
70702
|
+
});
|
|
70666
70703
|
const modeEntries = useMemo(() => {
|
|
70667
70704
|
if (!manifestModeEntries || !subscriptionStatus?.connected || !subscriptionModels) {
|
|
70668
70705
|
return manifestModeEntries;
|
|
@@ -70773,6 +70810,7 @@ function ChatInputBar({
|
|
|
70773
70810
|
defaultMode,
|
|
70774
70811
|
automatic: automaticRouting,
|
|
70775
70812
|
pending: modelChoicePending,
|
|
70813
|
+
effortOptionsSettled,
|
|
70776
70814
|
variant: "rail",
|
|
70777
70815
|
codexConnect: hasCodexMode ? {
|
|
70778
70816
|
connected: codexConnected,
|
|
@@ -3782,6 +3782,8 @@ function stagePendingNewSessionPrompt(text, fileAttachments, modelMode, conversa
|
|
|
3782
3782
|
});
|
|
3783
3783
|
if (effort) store.setReasoningEffort(effortKey, null);
|
|
3784
3784
|
}
|
|
3785
|
+
|
|
3786
|
+
// ../chat/src/lib/services/session/session-hooks.ts
|
|
3785
3787
|
var DOMAIN2 = "sessions";
|
|
3786
3788
|
var sessionKeys = {
|
|
3787
3789
|
// The active workspace is part of both list keys. It scopes the response
|
package/dist/message.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontera-sdk/chat-ui",
|
|
3
|
-
"version": "1.53.
|
|
3
|
+
"version": "1.53.8",
|
|
4
4
|
"description": "Ready-made React components for embedding a Frontera agent conversation — message rendering, tool calls, artifacts and composer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontera",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@elysiajs/eden": "^1.4.9",
|
|
92
|
-
"@frontera-sdk/chat": "1.53.
|
|
93
|
-
"@frontera-sdk/core": "1.53.
|
|
92
|
+
"@frontera-sdk/chat": "1.53.8",
|
|
93
|
+
"@frontera-sdk/core": "1.53.8",
|
|
94
94
|
"@radix-ui/react-alert-dialog": "^1.1.23",
|
|
95
95
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
96
96
|
"@radix-ui/react-compose-refs": "^1.1.5",
|