@frontera-sdk/chat-ui 1.53.23 → 1.53.25

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
@@ -1,20 +1,20 @@
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-JJ3GBIGA.js';
5
- import { NewSessionPrompt, keepCaretOnTap } from './chunk-UQDTJM5H.js';
4
+ import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-PU75S6NF.js';
5
+ import { NewSessionPrompt, keepCaretOnTap } from './chunk-FBDBLAX5.js';
6
6
  import { PendingCards } from './chunk-A4GIIAMQ.js';
7
7
  import { themeToStyle } from './chunk-6HYPVNVA.js';
8
8
  import { useChatAgents } from './chunk-NDU6ERVT.js';
9
9
  import { subjectOfChatToken, capabilitiesOfChatToken } from './chunk-CCVPZVFK.js';
10
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-ZBWIRN76.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-SPSLMHUU.js';
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-4OL5C4O4.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-JIOJ6VJ4.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-GGIFLPU5.js';
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-MPFDU3UN.js';
15
15
  import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
16
16
  import { Popover, PopoverTrigger, PopoverContent, Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './chunk-RQSMCGBR.js';
17
- import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-VMZCASGI.js';
17
+ import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-GP43ZTG6.js';
18
18
  import './chunk-R3ONYPUB.js';
19
19
  import { AppIcon, frontera_icon_default, PhotoIcon, Folder1Icon, FileTextIcon, describeToolRow, SquareArrowTopRightIcon, ClipboardIcon, getToolMeta, useStreamdownPlugins, AppIconFrame, MessageResponse } from './chunk-K7AIK7TA.js';
20
20
  import { Skeleton, Button, ScrollArea, ChevronDownMediumIcon, buttonVariants } from './chunk-UWKO24VT.js';
@@ -27,7 +27,7 @@ import { cn, PortalContainerContext, Checkmark1Icon } from './chunk-LGVMMBL3.js'
27
27
  import { ChatClientContext } from './chunk-6JLWE7M3.js';
28
28
  import { __commonJS, __export, __toESM } from './chunk-PR4QN5HX.js';
29
29
  import * as React from 'react';
30
- 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';
30
+ import React__default, { createContext, forwardRef, useState, useRef, useImperativeHandle, useCallback, useEffect, useMemo, useContext, useDebugValue, createRef, memo, createElement, useLayoutEffect, version, Activity, Component, useSyncExternalStore as useSyncExternalStore$1, Fragment as Fragment$1 } from 'react';
31
31
  import { useChat } from '@ai-sdk/react';
32
32
  import { createChatTransport, OPENING_MESSAGE_ID } from '@frontera-sdk/chat/transport';
33
33
  import { runAppConnection, completeRedirectedConnection } from '@frontera-sdk/chat/connect-popup';
@@ -42397,7 +42397,7 @@ function SheetEditor({ content, onSave, readOnly = false }) {
42397
42397
  );
42398
42398
  }
42399
42399
  var PdfDocumentViewInner = dynamic(
42400
- () => import('./pdf-document-view-inner-6FLLMWPJ.js'),
42400
+ () => import('./pdf-document-view-inner-SW5LCGJW.js'),
42401
42401
  {
42402
42402
  ssr: false,
42403
42403
  loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "pdf" })
@@ -42408,7 +42408,8 @@ function PdfDocumentView({
42408
42408
  title,
42409
42409
  label,
42410
42410
  versionSlot,
42411
- page
42411
+ page,
42412
+ pageKey
42412
42413
  }) {
42413
42414
  const [failedFileUrl, setFailedFileUrl] = useState(null);
42414
42415
  const failed = failedFileUrl === fileUrl;
@@ -42439,7 +42440,8 @@ function PdfDocumentView({
42439
42440
  label,
42440
42441
  onError: () => setFailedFileUrl(fileUrl),
42441
42442
  versionSlot,
42442
- page
42443
+ page,
42444
+ pageKey
42443
42445
  }
42444
42446
  );
42445
42447
  }
@@ -43216,11 +43218,11 @@ function HtmlDeckView({ content, inChat = false, versionSlot }) {
43216
43218
  !present && inChat && /* @__PURE__ */ jsx(DeckEditPanel, { currentIndex: sel, currentHtml: slides[sel]?.html ?? "" })
43217
43219
  ] });
43218
43220
  }
43219
- var Inner = dynamic(() => import('./pdf-deck-view-inner-7LFNDF6P.js'), {
43221
+ var Inner = dynamic(() => import('./pdf-deck-view-inner-2R6AFHKA.js'), {
43220
43222
  ssr: false,
43221
43223
  loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "htmldeck" })
43222
43224
  });
43223
- function PdfDeckView({ fileUrl, title, label, notes, page }) {
43225
+ function PdfDeckView({ fileUrl, title, label, notes, page, pageKey, textLayer }) {
43224
43226
  const [failedFileUrl, setFailedFileUrl] = useState(null);
43225
43227
  if (failedFileUrl === fileUrl) {
43226
43228
  return /* @__PURE__ */ jsx("div", { className: "h-full min-h-0 overflow-y-auto scrollbar bg-muted/30", children: /* @__PURE__ */ jsx(
@@ -43238,6 +43240,8 @@ function PdfDeckView({ fileUrl, title, label, notes, page }) {
43238
43240
  label,
43239
43241
  notes,
43240
43242
  page,
43243
+ pageKey,
43244
+ textLayer,
43241
43245
  onError: () => setFailedFileUrl(fileUrl)
43242
43246
  },
43243
43247
  fileUrl
@@ -43666,6 +43670,7 @@ function TextFileArtifactView({
43666
43670
  {
43667
43671
  value: "preview",
43668
43672
  className: "mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto scrollbar",
43673
+ "data-text-root": "",
43669
43674
  children: /* @__PURE__ */ jsx(MarkdownFilePreview, { content: preview.content })
43670
43675
  }
43671
43676
  ),
@@ -43674,6 +43679,7 @@ function TextFileArtifactView({
43674
43679
  {
43675
43680
  value: "code",
43676
43681
  className: "mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto scrollbar",
43682
+ "data-text-root": "",
43677
43683
  children: /* @__PURE__ */ jsx(
43678
43684
  SyntaxHighlightedFile,
43679
43685
  {
@@ -43683,7 +43689,7 @@ function TextFileArtifactView({
43683
43689
  )
43684
43690
  }
43685
43691
  )
43686
- ] }) : /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-x-hidden overflow-y-auto scrollbar", children: isPlainTextLanguage(meta.language) ? /* @__PURE__ */ jsx("pre", { className: "min-h-full w-full max-w-full whitespace-pre-wrap px-4 py-2 font-mono text-[0.8125rem] leading-6 text-foreground [overflow-wrap:anywhere]", children: /* @__PURE__ */ jsx("code", { className: "block w-full min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]", children: preview.content }) }) : /* @__PURE__ */ jsx(
43692
+ ] }) : /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-x-hidden overflow-y-auto scrollbar", "data-text-root": "", children: isPlainTextLanguage(meta.language) ? /* @__PURE__ */ jsx("pre", { className: "min-h-full w-full max-w-full whitespace-pre-wrap px-4 py-2 font-mono text-[0.8125rem] leading-6 text-foreground [overflow-wrap:anywhere]", children: /* @__PURE__ */ jsx("code", { className: "block w-full min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]", children: preview.content }) }) : /* @__PURE__ */ jsx(
43687
43693
  SyntaxHighlightedFile,
43688
43694
  {
43689
43695
  content: preview.content,
@@ -63625,6 +63631,92 @@ function MentionNodeView({ node, extension: extension2 }) {
63625
63631
  }
63626
63632
  ) });
63627
63633
  }
63634
+ var MentionListFrame = forwardRef(function MentionListFrame2({ children }, ref) {
63635
+ const scrollRef = useRef(null);
63636
+ useImperativeHandle(ref, () => scrollRef.current, []);
63637
+ const [edges, setEdges] = useState({ top: false, bottom: false });
63638
+ const measureEdges = useCallback(() => {
63639
+ const el = scrollRef.current;
63640
+ if (!el) return;
63641
+ const max = el.scrollHeight - el.clientHeight;
63642
+ const next = max <= 1 ? { top: false, bottom: false } : { top: el.scrollTop > 1, bottom: el.scrollTop < max - 1 };
63643
+ setEdges(
63644
+ (prev) => prev.top === next.top && prev.bottom === next.bottom ? prev : next
63645
+ );
63646
+ }, []);
63647
+ useEffect(measureEdges);
63648
+ useEffect(() => {
63649
+ const el = scrollRef.current;
63650
+ if (!el) return;
63651
+ const ro = new ResizeObserver(measureEdges);
63652
+ ro.observe(el);
63653
+ return () => ro.disconnect();
63654
+ }, [measureEdges]);
63655
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-full overflow-hidden rounded-2xl border border-border bg-surface-overlay shadow-md", children: [
63656
+ /* @__PURE__ */ jsx(
63657
+ "div",
63658
+ {
63659
+ ref: scrollRef,
63660
+ onScroll: measureEdges,
63661
+ className: "overflow-y-auto scrollbar p-1.5",
63662
+ style: { maxHeight: "var(--mention-list-max, 20rem)" },
63663
+ children
63664
+ }
63665
+ ),
63666
+ edges.top && /* @__PURE__ */ jsx(
63667
+ "div",
63668
+ {
63669
+ "aria-hidden": true,
63670
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-12 bg-linear-to-b from-surface-overlay to-transparent"
63671
+ }
63672
+ ),
63673
+ edges.bottom && /* @__PURE__ */ jsx(
63674
+ "div",
63675
+ {
63676
+ "aria-hidden": true,
63677
+ className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 h-12 bg-linear-to-t from-surface-overlay to-transparent"
63678
+ }
63679
+ )
63680
+ ] });
63681
+ });
63682
+ function useMentionListKeys(ref, rows, pick) {
63683
+ const [active, setActive] = useState(0);
63684
+ const activeRef = useRef(null);
63685
+ useEffect(() => {
63686
+ setActive(0);
63687
+ }, [rows]);
63688
+ useEffect(() => {
63689
+ activeRef.current?.scrollIntoView({ block: "nearest" });
63690
+ }, [active]);
63691
+ useImperativeHandle(ref, () => ({
63692
+ onKeyDown({ event }) {
63693
+ const last = rows.length - 1;
63694
+ if (event.key === "ArrowDown") {
63695
+ setActive((i) => Math.min(last, i + 1));
63696
+ return true;
63697
+ }
63698
+ if (event.key === "ArrowUp") {
63699
+ setActive((i) => Math.max(0, i - 1));
63700
+ return true;
63701
+ }
63702
+ if (event.key === "Home") {
63703
+ setActive(0);
63704
+ return true;
63705
+ }
63706
+ if (event.key === "End") {
63707
+ setActive(Math.max(0, last));
63708
+ return true;
63709
+ }
63710
+ if (event.key === "Enter" || event.key === "Tab") {
63711
+ const row = rows[active];
63712
+ if (row) pick(row);
63713
+ return true;
63714
+ }
63715
+ return false;
63716
+ }
63717
+ }));
63718
+ return { active, setActive, activeRef };
63719
+ }
63628
63720
  var DOMAIN2 = "meta";
63629
63721
  var MANIFEST_FETCH_TIMEOUT_MS = 2e4;
63630
63722
  var metaKeys = {
@@ -64892,19 +64984,6 @@ function MentionEmpty({ query }) {
64892
64984
  }
64893
64985
  var MentionMenu = forwardRef(
64894
64986
  function MentionMenu2({ rawGroups, query, kinds, commands, asCommands, command: command5, showGroupTitles }, ref) {
64895
- const [selectedIdx, setSelectedIdx] = useState(0);
64896
- const activeRef = useRef(null);
64897
- const scrollRef = useRef(null);
64898
- const [edges, setEdges] = useState({ top: false, bottom: false });
64899
- const measureEdges = useCallback(() => {
64900
- const el = scrollRef.current;
64901
- if (!el) return;
64902
- const max = el.scrollHeight - el.clientHeight;
64903
- const next = max <= 1 ? { top: false, bottom: false } : { top: el.scrollTop > 1, bottom: el.scrollTop < max - 1 };
64904
- setEdges(
64905
- (prev) => prev.top === next.top && prev.bottom === next.bottom ? prev : next
64906
- );
64907
- }, []);
64908
64987
  const groups = useMemo(() => {
64909
64988
  const ranked = filterMentionGroups(rawGroups, query, { kinds, commands });
64910
64989
  return query.trim() ? flattenMentionGroups(ranked) : ranked;
@@ -64913,114 +64992,49 @@ var MentionMenu = forwardRef(
64913
64992
  () => groups.flatMap((g) => g.items.filter((i) => !i.unavailable)),
64914
64993
  [groups]
64915
64994
  );
64916
- useEffect(() => {
64917
- setSelectedIdx(0);
64918
- }, [groups]);
64919
- useEffect(() => {
64920
- activeRef.current?.scrollIntoView({ block: "nearest" });
64921
- }, [selectedIdx]);
64922
- useEffect(measureEdges, [measureEdges, groups, selectedIdx]);
64923
- useEffect(() => {
64924
- const el = scrollRef.current;
64925
- if (!el) return;
64926
- const ro = new ResizeObserver(measureEdges);
64927
- ro.observe(el);
64928
- return () => ro.disconnect();
64929
- }, [measureEdges]);
64930
- useImperativeHandle(ref, () => ({
64931
- onKeyDown({ event }) {
64932
- const last = flat.length - 1;
64933
- if (event.key === "ArrowDown") {
64934
- setSelectedIdx((i) => Math.min(last, i + 1));
64935
- return true;
64936
- }
64937
- if (event.key === "ArrowUp") {
64938
- setSelectedIdx((i) => Math.max(0, i - 1));
64939
- return true;
64940
- }
64941
- if (event.key === "Home") {
64942
- setSelectedIdx(0);
64943
- return true;
64944
- }
64945
- if (event.key === "End") {
64946
- setSelectedIdx(Math.max(0, last));
64947
- return true;
64948
- }
64949
- if (event.key === "Enter" || event.key === "Tab") {
64950
- const item = flat[selectedIdx];
64951
- if (item) command5(item);
64952
- return true;
64953
- }
64954
- return false;
64955
- }
64956
- }));
64995
+ const { active: selectedIdx, setActive: setSelectedIdx, activeRef } = useMentionListKeys(ref, flat, command5);
64957
64996
  const anyLoading = groups.some((g) => g.loading);
64958
64997
  const hasRows = groups.some((g) => g.items.length > 0);
64959
- return /* @__PURE__ */ jsxs("div", { className: "relative w-full overflow-hidden rounded-2xl border border-border bg-surface-overlay shadow-md", children: [
64960
- /* @__PURE__ */ jsx(
64961
- "div",
64962
- {
64963
- ref: scrollRef,
64964
- onScroll: measureEdges,
64965
- className: "overflow-y-auto scrollbar p-1.5",
64966
- style: { maxHeight: "var(--mention-list-max, 20rem)" },
64967
- children: !hasRows && !anyLoading ? /* @__PURE__ */ jsx(MentionEmpty, { query }) : groups.map((g, groupIndex) => /* @__PURE__ */ jsxs("div", { children: [
64968
- showGroupTitles && g.title && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-2.5 pb-0.5 pt-1.5", children: [
64969
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground", children: g.title }),
64970
- g.loading && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70", children: "searching\u2026" })
64971
- ] }),
64972
- g.items.map((item) => {
64973
- const idx = item.unavailable ? -1 : flat.indexOf(item);
64974
- return /* @__PURE__ */ jsx(
64975
- MentionRow,
64976
- {
64977
- item,
64978
- asCommand: asCommands && item.ref?.kind === "skill",
64979
- isActive: idx >= 0 && idx === selectedIdx,
64980
- activeRef: idx === selectedIdx ? activeRef : void 0,
64981
- onHover: () => idx >= 0 && setSelectedIdx(idx),
64982
- onSelect: () => command5(item)
64983
- },
64984
- item.id
64985
- );
64986
- }),
64987
- g.items.length === 0 && g.loading && [0, 1, 2].map((i) => /* @__PURE__ */ jsxs(
64988
- "div",
64989
- {
64990
- className: "flex items-center gap-2 px-2.5 py-1.5",
64991
- "aria-hidden": true,
64992
- children: [
64993
- /* @__PURE__ */ jsx(Skeleton, { className: "size-4 shrink-0 rounded-sm" }),
64994
- /* @__PURE__ */ jsx(
64995
- Skeleton,
64996
- {
64997
- className: "h-3 rounded-sm",
64998
- style: { width: `${[38, 52, 30][i]}%` }
64999
- }
65000
- )
65001
- ]
65002
- },
65003
- `skeleton-${i}`
65004
- )),
65005
- groupIndex < groups.length - 1 && /* @__PURE__ */ jsx("div", { className: "h-1" })
65006
- ] }, g.key))
65007
- }
65008
- ),
65009
- edges.top && /* @__PURE__ */ jsx(
65010
- "div",
65011
- {
65012
- "aria-hidden": true,
65013
- className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-12 bg-linear-to-b from-surface-overlay to-transparent"
65014
- }
65015
- ),
65016
- edges.bottom && /* @__PURE__ */ jsx(
64998
+ return /* @__PURE__ */ jsx(MentionListFrame, { children: !hasRows && !anyLoading ? /* @__PURE__ */ jsx(MentionEmpty, { query }) : groups.map((g, groupIndex) => /* @__PURE__ */ jsxs("div", { children: [
64999
+ showGroupTitles && g.title && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-2.5 pb-0.5 pt-1.5", children: [
65000
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground", children: g.title }),
65001
+ g.loading && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70", children: "searching\u2026" })
65002
+ ] }),
65003
+ g.items.map((item) => {
65004
+ const idx = item.unavailable ? -1 : flat.indexOf(item);
65005
+ return /* @__PURE__ */ jsx(
65006
+ MentionRow,
65007
+ {
65008
+ item,
65009
+ asCommand: asCommands && item.ref?.kind === "skill",
65010
+ isActive: idx >= 0 && idx === selectedIdx,
65011
+ activeRef: idx === selectedIdx ? activeRef : void 0,
65012
+ onHover: () => idx >= 0 && setSelectedIdx(idx),
65013
+ onSelect: () => command5(item)
65014
+ },
65015
+ item.id
65016
+ );
65017
+ }),
65018
+ g.items.length === 0 && g.loading && [0, 1, 2].map((i) => /* @__PURE__ */ jsxs(
65017
65019
  "div",
65018
65020
  {
65021
+ className: "flex items-center gap-2 px-2.5 py-1.5",
65019
65022
  "aria-hidden": true,
65020
- className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 h-12 bg-linear-to-t from-surface-overlay to-transparent"
65021
- }
65022
- )
65023
- ] });
65023
+ children: [
65024
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-4 shrink-0 rounded-sm" }),
65025
+ /* @__PURE__ */ jsx(
65026
+ Skeleton,
65027
+ {
65028
+ className: "h-3 rounded-sm",
65029
+ style: { width: `${[38, 52, 30][i]}%` }
65030
+ }
65031
+ )
65032
+ ]
65033
+ },
65034
+ `skeleton-${i}`
65035
+ )),
65036
+ groupIndex < groups.length - 1 && /* @__PURE__ */ jsx("div", { className: "h-1" })
65037
+ ] }, g.key)) });
65024
65038
  }
65025
65039
  );
65026
65040
 
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { Sheet, SheetContent, SheetHeader, SheetTitle, Popover, PopoverTrigger, PopoverContent, MagnifyingGlassIcon } from './chunk-RQSMCGBR.js';
3
- import { useIsMobile, useTranslation } from './chunk-VMZCASGI.js';
3
+ import { useIsMobile, useTranslation } from './chunk-GP43ZTG6.js';
4
4
  import { CrossMediumIcon } from './chunk-37WYG6VG.js';
5
5
  import { AgentAvatar } from './chunk-RCWVJD7G.js';
6
6
  import { cn, Checkmark1Icon } from './chunk-LGVMMBL3.js';
@@ -1,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, useCitedDocument, useChatOverviewStore, dedup, extractDomain, sourceKind, SourceFavicon, Input, exportDocumentPdf, FilePdfIcon, StudioDisplayIcon, WorldIcon, MessageStepsGroup, getToolState, getToolInput, getToolErrorText, useChatOptInEnabled, ArrowRightIcon, formatFileSize, FileThumbnail, attachmentFileOf, MobileScreenSheet, useAgentHistorySource, treatyErrorMessage, useRouter, useBasePath, useAgentPanelStore, AgentRoutineForm, getFileCategory, unwrap, unwrapData, unwrapDataDeep, formatDecisionTime, DecisionCard, LoaderIcon, formatRelativeTime, CircleCheckIcon, agentRoutineKeys, useOptionalAgentsContext, avatarMotionForStream, AGENT_AVATAR_SIZE } from './chunk-4OL5C4O4.js';
2
+ import { usePlugins, useChatCapabilityEnabled, resolvePluginLanguage, renderPluginBlock, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, ActionMenu, useArtifactStore, ArtifactActionsMenu, DotGrid1x3HorizontalTightIcon, useArtifact, resolveArtifactIconFormat, artifactFormatIcon, useArtifactFileObjectUrl, artifactFormatSubtitle, ChatImageLightbox, ArrowsShowIcon, FileDownloadIcon, useClient, processMessageParts, getMessageDisplayTimestampValue, getMessageCreatedAtMs, isApprovalRequested, extractCitationsFromSteps, useSourcesEnrichment, extractImagesFromSteps, dedupeImageResults, getDocumentStreamArtifacts, getToolOutput, useCanvasStore, ImageResultsGallery, MessageDecisionCards, useChatCapabilities, useOptionalWorkspaceContext, useCitationViewer, useCitedDocument, useChatOverviewStore, dedup, extractDomain, sourceKind, SourceFavicon, Input, exportDocumentPdf, FilePdfIcon, StudioDisplayIcon, WorldIcon, MessageStepsGroup, getToolState, getToolInput, getToolErrorText, useChatOptInEnabled, ArrowRightIcon, formatFileSize, FileThumbnail, attachmentFileOf, MobileScreenSheet, useAgentHistorySource, treatyErrorMessage, useRouter, useBasePath, useAgentPanelStore, AgentRoutineForm, getFileCategory, unwrap, unwrapData, unwrapDataDeep, formatDecisionTime, DecisionCard, LoaderIcon, formatRelativeTime, CircleCheckIcon, agentRoutineKeys, useOptionalAgentsContext, avatarMotionForStream, AGENT_AVATAR_SIZE } from './chunk-MPFDU3UN.js';
3
3
  import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Popover, PopoverTrigger, PopoverContent } from './chunk-RQSMCGBR.js';
4
- import { useIsMobile, useTranslation } from './chunk-VMZCASGI.js';
4
+ import { useIsMobile, useTranslation } from './chunk-GP43ZTG6.js';
5
5
  import { MessageToolbar, MessageResponse, SquareArrowTopRightIcon, FileTextIcon, Shimmer, ClipboardIcon, Message, MessageContent, PencilIcon, deferDuringLayoutMotion, HoverCard, HoverCardTrigger, HoverCardContent, Collapse, Icon, CircleXIcon, ClockIcon } from './chunk-K7AIK7TA.js';
6
6
  import { ChevronDownMediumIcon, Button, ScrollArea, Skeleton } from './chunk-UWKO24VT.js';
7
7
  import { CrossMediumIcon } from './chunk-37WYG6VG.js';