@frontera-sdk/chat-ui 1.52.39 → 1.52.40

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.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- export { AgentPicker, useChatAgents } from './chunk-FLOAEPRU.js';
2
+ export { AgentPicker, useChatAgents } from './chunk-O6CVTMZJ.js';
3
3
  import './chunk-C3HW5S2Z.js';
4
- import './chunk-PUMRNN3R.js';
4
+ import './chunk-RVJEI4ZY.js';
5
5
  import './chunk-TUDJ35AB.js';
6
6
  import './chunk-LGVMMBL3.js';
7
7
  import './chunk-6JLWE7M3.js';
package/dist/chat.js CHANGED
@@ -2,17 +2,17 @@
2
2
  import { offset, flip, autoUpdate, computePosition } from './chunk-I7SXWUAN.js';
3
3
  import { isFullscreenHotkey, DeckNotesCard, deckOwnsArrowKeys } from './chunk-4FRTPVJT.js';
4
4
  import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-L53QV2NP.js';
5
- import { NewSessionPrompt, keepCaretOnTap } from './chunk-FZHOLMMX.js';
5
+ import { NewSessionPrompt, keepCaretOnTap } from './chunk-PBCI2XZ5.js';
6
6
  import { PendingCards } from './chunk-UZ6RDWCT.js';
7
7
  import { themeToStyle } from './chunk-6HYPVNVA.js';
8
- import { useChatAgents } from './chunk-FLOAEPRU.js';
8
+ import { useChatAgents } from './chunk-O6CVTMZJ.js';
9
9
  import { subjectOfChatToken, capabilitiesOfChatToken } from './chunk-CCVPZVFK.js';
10
10
  import { useChatCredential } from './chunk-37G6MHWS.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-3QTPT4SP.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-L2SBA2T6.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-Z7CMGAC3.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-X3BXBZ2O.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-ZPFZYY6T.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-HX5M56P5.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
18
  import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-77OYEA4D.js';
@@ -22,7 +22,7 @@ import { Skeleton, Button, ScrollArea, ChevronDownMediumIcon, buttonVariants } f
22
22
  import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, CrossMediumIcon, DialogFooter } from './chunk-2P4IEVOQ.js';
23
23
  import './chunk-CDTES65T.js';
24
24
  import { DropdownMenu as DropdownMenu$1, DropdownMenuTrigger as DropdownMenuTrigger$1, DropdownMenuContent, DropdownMenuItem, ChevronRightIcon, DropdownMenuSeparator, DropdownMenuLabel } from './chunk-C3HW5S2Z.js';
25
- import { AgentAvatar } from './chunk-PUMRNN3R.js';
25
+ import { AgentAvatar } from './chunk-RVJEI4ZY.js';
26
26
  import { ArrowDownIcon, FileTextIcon as FileTextIcon$1, Checkmark1Icon as Checkmark1Icon$1 } from './chunk-TUDJ35AB.js';
27
27
  import { cn, PortalContainerContext, Checkmark1Icon } from './chunk-LGVMMBL3.js';
28
28
  import { ChatClientContext } from './chunk-6JLWE7M3.js';
@@ -64233,6 +64233,10 @@ function NotesIcon(props) {
64233
64233
  }
64234
64234
 
64235
64235
  // ../chat/src/ui/chat/chat-input-bar/composer-output-modes.tsx
64236
+ function agentInApp(agent2, appFeatures) {
64237
+ if (appFeatures?.fileUpload !== false) return agent2;
64238
+ return { ...agent2, features: { ...agent2.features ?? {}, fileUpload: false } };
64239
+ }
64236
64240
  var hasArtifacts = (a) => a.plugins?.includes("artifacts") ?? false;
64237
64241
  var COMPOSER_OUTPUT_MODES = [
64238
64242
  {
@@ -64286,6 +64290,7 @@ var COMPOSER_OUTPUT_MODES = [
64286
64290
  // ../chat/src/ui/chat/chat-input-bar/hooks/use-composer-output-modes.ts
64287
64291
  function useComposerOutputModes(agentId) {
64288
64292
  const appAgents = useChatAppAgents();
64293
+ const appFeatures = useOptionalChatApp()?.runtime.features;
64289
64294
  const manifestQuery = useManifest(useContext(ComposerManifestSurface));
64290
64295
  const raw = appAgents ?? manifestQuery.data?.data?.agents;
64291
64296
  const agents = Array.isArray(raw) ? raw : [];
@@ -64295,8 +64300,9 @@ function useComposerOutputModes(agentId) {
64295
64300
  (a) => a.id === agentId || a.slug === agentId || a.name === agentId
64296
64301
  );
64297
64302
  if (!entry) return [];
64298
- return COMPOSER_OUTPUT_MODES.filter((m) => m.gate(entry));
64299
- }, [agents, agentId]);
64303
+ const asRun = agentInApp(entry, appFeatures);
64304
+ return COMPOSER_OUTPUT_MODES.filter((m) => m.gate(asRun));
64305
+ }, [agents, agentId, appFeatures]);
64300
64306
  }
64301
64307
 
64302
64308
  // ../chat/src/ui/chat/chat-input-bar/components/composer-editor/mention-ranking.ts
@@ -69785,7 +69791,8 @@ function ApprovalGrantsList({
69785
69791
  return /* @__PURE__ */ jsxs("div", { "data-slot": "approval-grants-list", className: cn("border-t border-border px-1 pt-2", className), children: [
69786
69792
  /* @__PURE__ */ jsx("p", { className: "px-2 pb-1 text-xs text-muted-foreground", children: "Not asking in this chat" }),
69787
69793
  /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-0.5", children: grants.map((grant) => {
69788
- const label = getToolMeta(grant.toolName).label;
69794
+ const tool = getToolMeta(grant.toolName).label;
69795
+ const label = grant.target ? `${tool}: ${grant.target}` : tool;
69789
69796
  return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 rounded-lg px-2 py-1", children: [
69790
69797
  /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
69791
69798
  /* @__PURE__ */ jsx("span", { className: "block truncate text-xs font-medium text-foreground", children: label }),
@@ -70961,10 +70968,10 @@ function ChatInputBar({
70961
70968
  const fileItems = items.filter((item) => item.kind === "file").map((item) => item.getAsFile()).filter((f) => f !== null);
70962
70969
  if (fileItems.length > 0) {
70963
70970
  e.preventDefault();
70964
- handleFiles(fileItems);
70971
+ if (enableFileUpload) handleFiles(fileItems);
70965
70972
  }
70966
70973
  },
70967
- [handleFiles]
70974
+ [handleFiles, enableFileUpload]
70968
70975
  );
70969
70976
  const approvalOptions = modeOptions ?? capabilities.approvalModes?.options ?? DEFAULT_APPROVAL_MODE_OPTIONS;
70970
70977
  const approvalValue = capabilities.approvalModes?.value ?? approvalMode;
@@ -8,7 +8,7 @@ import { ChevronDownMediumIcon, Button, Skeleton, buttonVariants } from './chunk
8
8
  import { Dialog, DialogContent, DialogTitle, DialogDescription, DialogClose, CrossMediumIcon, DialogHeader, DialogFooter } from './chunk-2P4IEVOQ.js';
9
9
  import { zipSync } from './chunk-CDTES65T.js';
10
10
  import { ChevronRightIcon, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from './chunk-C3HW5S2Z.js';
11
- import { AgentAvatar, FORMAT_EXT } from './chunk-PUMRNN3R.js';
11
+ import { AgentAvatar, FORMAT_EXT } from './chunk-RVJEI4ZY.js';
12
12
  import { Images1Icon, SlidesWideIcon, FilePdfIcon, TableIcon, FileTextIcon as FileTextIcon$1, SquareArrowTopRightIcon as SquareArrowTopRightIcon$1, FileDownloadIcon } from './chunk-TUDJ35AB.js';
13
13
  import { cn, Checkmark1Icon, usePortalContainer } from './chunk-LGVMMBL3.js';
14
14
  import { useChatClientOptional } from './chunk-6JLWE7M3.js';
@@ -1,13 +1,13 @@
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-X3BXBZ2O.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-HX5M56P5.js';
4
4
  import { Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle } from './chunk-T5SANYSX.js';
5
5
  import { useTranslation, useIsMobile } from './chunk-77OYEA4D.js';
6
6
  import { Collapsible, CollapsibleTrigger, CollapsibleContent, Shimmer, HoverCard, HoverCardTrigger, HoverCardContent } from './chunk-PKNEC4LJ.js';
7
7
  import { ChevronDownMediumIcon, ScrollArea, Skeleton, Button } from './chunk-UWKO24VT.js';
8
8
  import { Dialog, DialogContent, DialogHeader, DialogTitle, CrossMediumIcon } from './chunk-2P4IEVOQ.js';
9
9
  import { ChevronRightIcon } from './chunk-C3HW5S2Z.js';
10
- import { AgentAvatar } from './chunk-PUMRNN3R.js';
10
+ import { AgentAvatar } from './chunk-RVJEI4ZY.js';
11
11
  import { BulletListIcon, FilesIcon } from './chunk-TUDJ35AB.js';
12
12
  import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
13
13
  import { __require } from './chunk-PR4QN5HX.js';
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-C3HW5S2Z.js';
3
- import { AgentAvatar } from './chunk-PUMRNN3R.js';
3
+ import { AgentAvatar } from './chunk-RVJEI4ZY.js';
4
4
  import { ChevronDownMediumIcon } from './chunk-TUDJ35AB.js';
5
5
  import { useChatClientOptional } from './chunk-6JLWE7M3.js';
6
6
  import { useState, useEffect } from 'react';
@@ -3,7 +3,7 @@ import { MagnifyingGlassIcon } from './chunk-X3QVICX7.js';
3
3
  import { Sheet, SheetContent, SheetHeader, SheetTitle, Popover, PopoverTrigger, PopoverContent } from './chunk-T5SANYSX.js';
4
4
  import { useIsMobile, useTranslation } from './chunk-77OYEA4D.js';
5
5
  import { CrossMediumIcon } from './chunk-2P4IEVOQ.js';
6
- import { AgentAvatar } from './chunk-PUMRNN3R.js';
6
+ import { AgentAvatar } from './chunk-RVJEI4ZY.js';
7
7
  import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
8
8
  import * as t from 'react';
9
9
  import { memo, useState } from 'react';
@@ -2131,6 +2131,33 @@ function historyCitationReference(href) {
2131
2131
  return reference.length <= 16e3 && /^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(reference) ? reference : null;
2132
2132
  }
2133
2133
 
2134
+ // src/adapters/service/knowledge-citation-contract.ts
2135
+ var KNOWLEDGE_CITATION_PREFIX = "/cite/knowledge/";
2136
+ function encodedSegment(value) {
2137
+ return encodeURIComponent(value).replace(/[()!'*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
2138
+ }
2139
+ function decodedSegment(value) {
2140
+ try {
2141
+ return decodeURIComponent(value);
2142
+ } catch {
2143
+ return value;
2144
+ }
2145
+ }
2146
+ function knowledgeCitationUrl(knowledgeName, sourceId) {
2147
+ return `${KNOWLEDGE_CITATION_PREFIX}${encodedSegment(knowledgeName)}/${encodedSegment(sourceId)}`;
2148
+ }
2149
+ var KNOWLEDGE_CITATION = /^\/cite\/knowledge\/(.+)\/([A-Za-z0-9_-]+)$/;
2150
+ function canonicalCitationUrl(url) {
2151
+ const match = KNOWLEDGE_CITATION.exec(url);
2152
+ if (!match) return url;
2153
+ return knowledgeCitationUrl(decodedSegment(match[1]), match[2]);
2154
+ }
2155
+ var KNOWLEDGE_CITATION_LINK = /\]\(\/cite\/knowledge\/([^\n]+?)\/([A-Za-z0-9_-]+)\)/g;
2156
+ function encodeKnowledgeCitationLinks(markdown) {
2157
+ if (!markdown.includes("](/cite/knowledge/")) return markdown;
2158
+ return markdown.replace(KNOWLEDGE_CITATION_LINK, (_m, name, id) => `](${knowledgeCitationUrl(decodedSegment(name), id)})`);
2159
+ }
2160
+
2134
2161
  // src/adapters/service-types.ts
2135
2162
  var FORMAT_EXT = {
2136
2163
  markdown: "md",
@@ -2214,4 +2241,4 @@ var AgentAvatarView = memo(function AgentAvatarView2({
2214
2241
  });
2215
2242
  var AgentAvatar = AgentAvatarView;
2216
2243
 
2217
- export { AgentAvatar, FORMAT_EXT, HISTORY_CITATION_PREFIX, historyCitationReference };
2244
+ export { AgentAvatar, FORMAT_EXT, HISTORY_CITATION_PREFIX, canonicalCitationUrl, encodeKnowledgeCitationLinks, historyCitationReference };
@@ -1,12 +1,12 @@
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-X3BXBZ2O.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, 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-HX5M56P5.js';
3
3
  import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-T5SANYSX.js';
4
4
  import { useIsMobile, useTranslation } from './chunk-77OYEA4D.js';
5
5
  import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-PKNEC4LJ.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';
9
- import { HISTORY_CITATION_PREFIX, historyCitationReference, AgentAvatar } from './chunk-PUMRNN3R.js';
9
+ import { HISTORY_CITATION_PREFIX, canonicalCitationUrl, encodeKnowledgeCitationLinks, historyCitationReference, AgentAvatar } from './chunk-RVJEI4ZY.js';
10
10
  import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
11
11
  import { useChatClientOptional } from './chunk-6JLWE7M3.js';
12
12
  import { createContext, memo, useMemo, isValidElement, cloneElement, useState, useCallback, useRef, useEffect, useId, useLayoutEffect, lazy, Suspense, useContext } from 'react';
@@ -2624,7 +2624,8 @@ var MessageTextBlock = memo(function MessageTextBlock2({
2624
2624
  }
2625
2625
  if (typeof href === "string" && href.startsWith("/cite/")) {
2626
2626
  const label = typeof children === "string" ? children : String(children ?? "");
2627
- const matchedCitation = citations?.find((c) => c.url === href);
2627
+ const cited = canonicalCitationUrl(href);
2628
+ const matchedCitation = citations?.find((c) => canonicalCitationUrl(c.url) === cited);
2628
2629
  const title = matchedCitation?.title || href;
2629
2630
  const snippet = matchedCitation?.snippet;
2630
2631
  return /* @__PURE__ */ jsx(
@@ -2759,6 +2760,7 @@ var MessageTextBlock = memo(function MessageTextBlock2({
2759
2760
  [components]
2760
2761
  );
2761
2762
  const activeComponents = richTextEnabled ? components : plainTextComponents;
2763
+ const linkedText = useMemo(() => encodeKnowledgeCitationLinks(text), [text]);
2762
2764
  const hasCitations = citations && citations.length > 0;
2763
2765
  const [showForkDialog, setShowForkDialog] = useState(false);
2764
2766
  const [actionsOpen, setActionsOpen] = useState(false);
@@ -3074,7 +3076,7 @@ var MessageTextBlock = memo(function MessageTextBlock2({
3074
3076
  {
3075
3077
  className: "chat-answer space-y-2 leading-relaxed prose prose-sm dark:prose-invert text-sm w-full max-w-none text-foreground streamdown-prose group-[.is-bubble]:w-fit",
3076
3078
  components: activeComponents,
3077
- children: text
3079
+ children: linkedText
3078
3080
  },
3079
3081
  `${messageId}-txt-${partIndex}-response`
3080
3082
  )
package/dist/header.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- export { ChatHeader, ChatHeaderActions } from './chunk-3QTPT4SP.js';
2
+ export { ChatHeader, ChatHeaderActions } from './chunk-L2SBA2T6.js';
3
3
  import './chunk-X3QVICX7.js';
4
- import './chunk-X3BXBZ2O.js';
4
+ import './chunk-HX5M56P5.js';
5
5
  import './chunk-CWAOLMFS.js';
6
6
  import './chunk-T5SANYSX.js';
7
7
  import './chunk-77OYEA4D.js';
@@ -11,7 +11,7 @@ import './chunk-UWKO24VT.js';
11
11
  import './chunk-2P4IEVOQ.js';
12
12
  import './chunk-CDTES65T.js';
13
13
  import './chunk-C3HW5S2Z.js';
14
- import './chunk-PUMRNN3R.js';
14
+ import './chunk-RVJEI4ZY.js';
15
15
  import './chunk-TUDJ35AB.js';
16
16
  import './chunk-LGVMMBL3.js';
17
17
  import './chunk-6JLWE7M3.js';
package/dist/message.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- export { Message, Thinking } from './chunk-Z7CMGAC3.js';
3
- import './chunk-X3BXBZ2O.js';
2
+ export { Message, Thinking } from './chunk-ZPFZYY6T.js';
3
+ import './chunk-HX5M56P5.js';
4
4
  import './chunk-CWAOLMFS.js';
5
5
  import './chunk-T5SANYSX.js';
6
6
  import './chunk-77OYEA4D.js';
@@ -10,7 +10,7 @@ import './chunk-UWKO24VT.js';
10
10
  import './chunk-2P4IEVOQ.js';
11
11
  import './chunk-CDTES65T.js';
12
12
  import './chunk-C3HW5S2Z.js';
13
- import './chunk-PUMRNN3R.js';
13
+ import './chunk-RVJEI4ZY.js';
14
14
  import './chunk-TUDJ35AB.js';
15
15
  import './chunk-LGVMMBL3.js';
16
16
  import './chunk-6JLWE7M3.js';
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-FZHOLMMX.js';
2
+ export { DEFAULT_SHORTCUTS, NewSessionPrompt, buildDefaultShortcuts } from './chunk-PBCI2XZ5.js';
3
3
  import './chunk-X3QVICX7.js';
4
4
  import './chunk-T5SANYSX.js';
5
5
  import './chunk-77OYEA4D.js';
6
6
  import './chunk-2P4IEVOQ.js';
7
- import './chunk-PUMRNN3R.js';
7
+ import './chunk-RVJEI4ZY.js';
8
8
  import './chunk-LGVMMBL3.js';
9
9
  import './chunk-PR4QN5HX.js';