@frontera-sdk/chat-ui 1.50.83 → 1.51.0

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,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-ZA7CTXPL.js';
5
- import { NewSessionPrompt, keepCaretOnTap } from './chunk-KJ33HNY4.js';
4
+ import { ArtifactSkeleton, resolveStageWidth, zoomPercent, DECK_ZOOM_LEVELS, LazyThumb } from './chunk-DTMMKNUM.js';
5
+ import { NewSessionPrompt, keepCaretOnTap } from './chunk-DBF7MVXX.js';
6
6
  import { PendingCards } from './chunk-UZ6RDWCT.js';
7
7
  import { themeToStyle } from './chunk-6HYPVNVA.js';
8
8
  import { useChatAgents } from './chunk-FLOAEPRU.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-FUAY64JS.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-TY6XSNUD.js';
13
13
  import './chunk-X3QVICX7.js';
14
- import { dynamic, useChatStreamStore, useComposerStore, Message, Thinking, setPendingFiles, 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-SZYQPW6R.js';
15
- import { Textarea, artifactFormatIcon, BookIcon, useAgentRoster, ShieldCheckIcon, useArtifactStore, useCanvasStore, useChatOverviewStore, setSdkConversationPath, setSdkDarkMode, AgentsProvider, PluginProvider, WorkspaceProvider, TooltipProvider, 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, useChatOptInEnabled, useSessionPendingApprovals, tableToCsv, tableToXlsx, tableToMarkdown, DropdownMenu, DropdownMenuTrigger, StyledDropdownMenuContent, StyledDropdownMenuItem, useArtifactVersions, useClient, unwrapData, authFetch, getBearerHeadersForApi, EyeOpenIcon, EyeSlashIcon, useRestoreArtifactVersion, ZoomableImage, ChatImageLightbox, useDownloadArtifact, useArtifactFileBytes, useArtifactPreviewFileObjectUrl, useArtifactVersionPreviewFileObjectUrl, SpreadsheetIcon, FilePdfIcon, useOptionalWorkspaceContext, useAgentConnectionStatus, useArtifacts, useConversationDesktopStatus, isRequestHumanTool, appsKeys, useSession, useWorkspaceContext, errorText, 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-BGRFXLUY.js';
14
+ import { dynamic, useChatStreamStore, useComposerStore, Message, Thinking, setPendingFiles, 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-R4S5G3UV.js';
15
+ import { Textarea, artifactFormatIcon, BookIcon, useAgentRoster, ShieldCheckIcon, useArtifactStore, useCanvasStore, useChatOverviewStore, setSdkConversationPath, setSdkDarkMode, AgentsProvider, PluginProvider, WorkspaceProvider, TooltipProvider, 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, useChatOptInEnabled, useSessionPendingApprovals, tableToCsv, tableToXlsx, tableToMarkdown, DropdownMenu, DropdownMenuTrigger, StyledDropdownMenuContent, StyledDropdownMenuItem, useArtifactVersions, useClient, unwrapData, authFetch, getBearerHeadersForApi, EyeOpenIcon, EyeSlashIcon, useRestoreArtifactVersion, ZoomableImage, ChatImageLightbox, useDownloadArtifact, useArtifactFileBytes, useArtifactPreviewFileObjectUrl, useArtifactVersionPreviewFileObjectUrl, SpreadsheetIcon, FilePdfIcon, useOptionalWorkspaceContext, useAgentConnectionStatus, useArtifacts, useConversationDesktopStatus, isRequestHumanTool, appsKeys, useSession, useWorkspaceContext, errorText, 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-LBMYYA6P.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-T4RG6NMW.js';
18
+ import { MOBILE_BREAKPOINT, useIsMobile, I18nProvider, useTranslation } from './chunk-3GRFS7S5.js';
19
19
  import './chunk-QBV7MAFV.js';
20
20
  import { AppIcon, frontera_icon_default, PhotoIcon, Folder1Icon, FileTextIcon, describeToolRow, SquareArrowTopRightIcon, ClipboardIcon, getToolMeta, useStreamdownPlugins, AppIconFrame, MessageResponse } from './chunk-PKNEC4LJ.js';
21
21
  import { Skeleton, Button, ScrollArea, ChevronDownMediumIcon, buttonVariants } from './chunk-UWKO24VT.js';
@@ -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-T3OS2MHL.js'),
42452
+ () => import('./pdf-document-view-inner-HGUV2NLJ.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-QBQHKZKH.js'), {
43269
+ var Inner = dynamic(() => import('./pdf-deck-view-inner-XEJ5S7KB.js'), {
43270
43270
  ssr: false,
43271
43271
  loading: () => /* @__PURE__ */ jsx(ArtifactSkeleton, { format: "htmldeck" })
43272
43272
  });
@@ -45393,15 +45393,27 @@ function SourcesTabView({
45393
45393
  `${citation.url}-${index}`
45394
45394
  )) }) });
45395
45395
  }
45396
- function RightPanelTab({
45396
+ function DocumentTab({
45397
45397
  active,
45398
45398
  title,
45399
45399
  icon,
45400
45400
  onSelect,
45401
45401
  onClose,
45402
- closeLabel
45402
+ closeLabel,
45403
+ tooltip,
45404
+ ref,
45405
+ className,
45406
+ ...rest
45403
45407
  }) {
45404
45408
  const tabRef = useRef(null);
45409
+ const setTabRef = useCallback(
45410
+ (node) => {
45411
+ tabRef.current = node;
45412
+ if (typeof ref === "function") ref(node);
45413
+ else if (ref) ref.current = node;
45414
+ },
45415
+ [ref]
45416
+ );
45405
45417
  useEffect(() => {
45406
45418
  if (active) {
45407
45419
  tabRef.current?.scrollIntoView({
@@ -45415,7 +45427,10 @@ function RightPanelTab({
45415
45427
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
45416
45428
  "div",
45417
45429
  {
45418
- ref: tabRef,
45430
+ ...rest,
45431
+ ref: setTabRef,
45432
+ "data-slot": "document-tab",
45433
+ "data-active": active || void 0,
45419
45434
  role: "button",
45420
45435
  tabIndex: 0,
45421
45436
  onClick: onSelect,
@@ -45426,14 +45441,15 @@ function RightPanelTab({
45426
45441
  }
45427
45442
  },
45428
45443
  className: cn(
45429
- // Sized to its label, capped so one long artifact title cannot
45430
- // push the rest of the strip off-screen. The trailing padding
45431
- // lives on the LABEL rather than here: `text-fade` masks the last
45432
- // 0.75rem of the element it is on, so on a shrink-to-fit tab it
45433
- // would eat the final glyphs of a short name — over the padding it
45434
- // fades nothing until the name actually overflows.
45444
+ // Sized to its label, capped so one long title cannot push the
45445
+ // rest of the strip off-screen. The trailing padding lives on the
45446
+ // LABEL rather than here: `text-fade` masks the last 0.75rem of
45447
+ // the element it is on, so on a shrink-to-fit tab it would eat the
45448
+ // final glyphs of a short name — over the padding it fades nothing
45449
+ // until the name actually overflows.
45435
45450
  "group/tab relative flex h-8 w-fit max-w-32 flex-none cursor-pointer select-none items-center gap-1.5 whitespace-nowrap rounded-lg pl-3 text-xs transition-colors",
45436
- active ? "bg-muted font-medium text-foreground hover:bg-surface-hover dark:bg-surface-raised dark:hover:bg-surface-hover" : "text-muted-foreground hover:bg-surface-hover hover:text-foreground focus-within:bg-surface-hover"
45451
+ active ? "bg-muted font-medium text-foreground hover:bg-surface-hover dark:bg-surface-raised dark:hover:bg-surface-hover" : "text-muted-foreground hover:bg-surface-hover hover:text-foreground focus-within:bg-surface-hover",
45452
+ className
45437
45453
  ),
45438
45454
  children: [
45439
45455
  icon,
@@ -45442,6 +45458,7 @@ function RightPanelTab({
45442
45458
  "button",
45443
45459
  {
45444
45460
  type: "button",
45461
+ "data-slot": "document-tab-close",
45445
45462
  onClick: (event) => {
45446
45463
  event.stopPropagation();
45447
45464
  onClose();
@@ -45458,9 +45475,46 @@ function RightPanelTab({
45458
45475
  ]
45459
45476
  }
45460
45477
  ) }),
45461
- /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", sideOffset: 6, children: title })
45478
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", sideOffset: 6, children: tooltip ?? title })
45462
45479
  ] });
45463
45480
  }
45481
+ function scrollStripWithWheel(event) {
45482
+ const el = event.currentTarget;
45483
+ if (el.scrollWidth <= el.clientWidth) return;
45484
+ const delta = Math.abs(event.deltaX) > Math.abs(event.deltaY) ? event.deltaX : event.deltaY;
45485
+ if (delta === 0) return;
45486
+ event.preventDefault();
45487
+ el.scrollLeft += delta;
45488
+ }
45489
+ function DocumentTabStrip({ ref, className, ...rest }) {
45490
+ const stripRef = useRef(null);
45491
+ const setStripRef = useCallback(
45492
+ (node) => {
45493
+ stripRef.current = node;
45494
+ if (typeof ref === "function") ref(node);
45495
+ else if (ref) ref.current = node;
45496
+ },
45497
+ [ref]
45498
+ );
45499
+ useEffect(() => {
45500
+ const el = stripRef.current;
45501
+ if (!el) return;
45502
+ el.addEventListener("wheel", scrollStripWithWheel, { passive: false });
45503
+ return () => el.removeEventListener("wheel", scrollStripWithWheel);
45504
+ }, []);
45505
+ return /* @__PURE__ */ jsx(
45506
+ "div",
45507
+ {
45508
+ ...rest,
45509
+ ref: setStripRef,
45510
+ "data-slot": "document-tab-strip",
45511
+ className: cn(
45512
+ "scroll-fade-x flex h-10 min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
45513
+ className
45514
+ )
45515
+ }
45516
+ );
45517
+ }
45464
45518
  function useHorizontalOverflow(contentKey) {
45465
45519
  const containerRef = useRef(null);
45466
45520
  const [hasOverflow, setHasOverflow] = useState(false);
@@ -45886,154 +45940,139 @@ function RightPanel({
45886
45940
  ),
45887
45941
  children: [
45888
45942
  /* @__PURE__ */ jsxs("div", { className: "flex items-stretch h-10 shrink-0 border-b", children: [
45889
- /* @__PURE__ */ jsxs(
45890
- "div",
45891
- {
45892
- ref: tabStripRef,
45893
- className: "scroll-fade-x flex h-10 min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
45894
- onWheel: (e) => {
45895
- const el = e.currentTarget;
45896
- if (el.scrollWidth <= el.clientWidth) return;
45897
- const delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
45898
- if (delta === 0) return;
45899
- e.preventDefault();
45900
- el.scrollLeft += delta;
45901
- },
45902
- children: [
45903
- hasAgentTabs && /* @__PURE__ */ jsxs(Fragment, { children: [
45904
- /* @__PURE__ */ jsx(
45905
- RightPanelTab,
45906
- {
45907
- active: effectiveActiveId === AGENT_WORK_TAB_ID,
45908
- title: t2("agentMode.work.title"),
45909
- icon: /* @__PURE__ */ jsx(ChecklistIcon, { className: "size-3.5 shrink-0" }),
45910
- onSelect: () => {
45911
- setActiveId(AGENT_WORK_TAB_ID);
45912
- setShowPicker(false);
45913
- }
45914
- }
45915
- ),
45916
- /* @__PURE__ */ jsx(
45917
- RightPanelTab,
45918
- {
45919
- active: effectiveActiveId === AGENT_ROUTINES_TAB_ID,
45920
- title: t2("agentMode.routines.title"),
45921
- icon: /* @__PURE__ */ jsx(CalendarRepeatIcon, { className: "size-3.5 shrink-0" }),
45922
- onSelect: () => {
45923
- setActiveId(AGENT_ROUTINES_TAB_ID);
45924
- setShowPicker(false);
45925
- }
45926
- }
45927
- )
45928
- ] }),
45929
- tabArtifacts.map((a) => /* @__PURE__ */ jsx(
45930
- RightPanelTab,
45931
- {
45932
- active: effectiveActiveId === a.id,
45933
- title: a.title,
45934
- icon: /* @__PURE__ */ jsx(
45935
- ArtifactTabIcon,
45936
- {
45937
- format: a.format,
45938
- artifactId: a.id,
45939
- mimeType: "mimeType" in a ? a.mimeType : void 0,
45940
- title: a.title
45941
- }
45942
- ),
45943
- onSelect: () => selectArtifact(a.id),
45944
- onClose: () => closeTab(a.id),
45945
- closeLabel: t2("library.close")
45946
- },
45947
- a.id
45948
- )),
45949
- canvasItems.map((it) => {
45950
- const tid = chartTabId(it.id);
45951
- return /* @__PURE__ */ jsx(
45952
- RightPanelTab,
45953
- {
45954
- active: effectiveActiveId === tid,
45955
- title: it.title || "Chart",
45956
- icon: /* @__PURE__ */ jsx(Chart1Icon, { className: "size-3.5 shrink-0" }),
45957
- onSelect: () => {
45958
- setActiveId(tid);
45959
- setShowPicker(false);
45960
- },
45961
- onClose: () => closeTab(tid),
45962
- closeLabel: t2("library.close")
45963
- },
45964
- tid
45965
- );
45966
- }),
45967
- pendingCanvasRefs.map((ref) => {
45968
- const tid = pendingCanvasTabId(ref);
45969
- return /* @__PURE__ */ jsx(
45970
- RightPanelTab,
45971
- {
45972
- active: effectiveActiveId === tid,
45973
- title: ref.t || "Chart",
45974
- icon: /* @__PURE__ */ jsx(Chart1Icon, { className: "size-3.5 shrink-0" }),
45975
- onSelect: () => {
45976
- setActiveId(tid);
45977
- setShowPicker(false);
45978
- },
45979
- onClose: () => closeTab(tid),
45980
- closeLabel: t2("library.close")
45981
- },
45982
- tid
45983
- );
45984
- }),
45985
- computerTabs.map((ct) => {
45986
- const tid = computerTabId(ct.id);
45987
- const icon = ct.kind === "app" ? /* @__PURE__ */ jsx(StudioDisplayIcon, { className: "size-3.5 shrink-0" }) : ct.kind === "files" ? /* @__PURE__ */ jsx(Folder1Icon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(WorldIcon, { className: "size-3.5 shrink-0" });
45988
- return /* @__PURE__ */ jsx(
45989
- RightPanelTab,
45990
- {
45991
- active: effectiveActiveId === tid,
45992
- title: ct.title,
45993
- icon,
45994
- onSelect: () => {
45995
- setActiveId(tid);
45996
- setActiveComputer(ct.id);
45997
- setShowPicker(false);
45998
- },
45999
- onClose: () => closeTab(tid),
46000
- closeLabel: t2("library.close")
46001
- },
46002
- tid
46003
- );
46004
- }),
46005
- templateTabId && /* @__PURE__ */ jsx(
46006
- RightPanelTab,
46007
- {
46008
- active: effectiveActiveId === templateTabId,
46009
- title: templateTabTitle,
46010
- icon: /* @__PURE__ */ jsx(SlidesWideIcon, { className: "size-3.5 shrink-0" }),
46011
- onSelect: () => {
46012
- setActiveId(templateTabId);
46013
- setShowPicker(false);
46014
- },
46015
- onClose: () => closeTab(templateTabId),
46016
- closeLabel: t2("library.close")
45943
+ /* @__PURE__ */ jsxs(DocumentTabStrip, { ref: tabStripRef, children: [
45944
+ hasAgentTabs && /* @__PURE__ */ jsxs(Fragment, { children: [
45945
+ /* @__PURE__ */ jsx(
45946
+ DocumentTab,
45947
+ {
45948
+ active: effectiveActiveId === AGENT_WORK_TAB_ID,
45949
+ title: t2("agentMode.work.title"),
45950
+ icon: /* @__PURE__ */ jsx(ChecklistIcon, { className: "size-3.5 shrink-0" }),
45951
+ onSelect: () => {
45952
+ setActiveId(AGENT_WORK_TAB_ID);
45953
+ setShowPicker(false);
46017
45954
  }
46018
- ),
46019
- hasSourcesTab && /* @__PURE__ */ jsx(
46020
- RightPanelTab,
45955
+ }
45956
+ ),
45957
+ /* @__PURE__ */ jsx(
45958
+ DocumentTab,
45959
+ {
45960
+ active: effectiveActiveId === AGENT_ROUTINES_TAB_ID,
45961
+ title: t2("agentMode.routines.title"),
45962
+ icon: /* @__PURE__ */ jsx(CalendarRepeatIcon, { className: "size-3.5 shrink-0" }),
45963
+ onSelect: () => {
45964
+ setActiveId(AGENT_ROUTINES_TAB_ID);
45965
+ setShowPicker(false);
45966
+ }
45967
+ }
45968
+ )
45969
+ ] }),
45970
+ tabArtifacts.map((a) => /* @__PURE__ */ jsx(
45971
+ DocumentTab,
45972
+ {
45973
+ active: effectiveActiveId === a.id,
45974
+ title: a.title,
45975
+ icon: /* @__PURE__ */ jsx(
45976
+ ArtifactTabIcon,
46021
45977
  {
46022
- active: effectiveActiveId === SOURCES_TAB_ID,
46023
- title: t2("chat.overview.sources"),
46024
- icon: /* @__PURE__ */ jsx(ChainLink1Icon, { className: "size-3.5 shrink-0" }),
46025
- onSelect: () => {
46026
- setActiveId(SOURCES_TAB_ID);
46027
- setShowPicker(false);
46028
- },
46029
- onClose: () => closeTab(SOURCES_TAB_ID),
46030
- closeLabel: t2("library.close")
45978
+ format: a.format,
45979
+ artifactId: a.id,
45980
+ mimeType: "mimeType" in a ? a.mimeType : void 0,
45981
+ title: a.title
46031
45982
  }
46032
45983
  ),
46033
- !tabStripOverflows && addTabButton
46034
- ]
46035
- }
46036
- ),
45984
+ onSelect: () => selectArtifact(a.id),
45985
+ onClose: () => closeTab(a.id),
45986
+ closeLabel: t2("library.close")
45987
+ },
45988
+ a.id
45989
+ )),
45990
+ canvasItems.map((it) => {
45991
+ const tid = chartTabId(it.id);
45992
+ return /* @__PURE__ */ jsx(
45993
+ DocumentTab,
45994
+ {
45995
+ active: effectiveActiveId === tid,
45996
+ title: it.title || "Chart",
45997
+ icon: /* @__PURE__ */ jsx(Chart1Icon, { className: "size-3.5 shrink-0" }),
45998
+ onSelect: () => {
45999
+ setActiveId(tid);
46000
+ setShowPicker(false);
46001
+ },
46002
+ onClose: () => closeTab(tid),
46003
+ closeLabel: t2("library.close")
46004
+ },
46005
+ tid
46006
+ );
46007
+ }),
46008
+ pendingCanvasRefs.map((ref) => {
46009
+ const tid = pendingCanvasTabId(ref);
46010
+ return /* @__PURE__ */ jsx(
46011
+ DocumentTab,
46012
+ {
46013
+ active: effectiveActiveId === tid,
46014
+ title: ref.t || "Chart",
46015
+ icon: /* @__PURE__ */ jsx(Chart1Icon, { className: "size-3.5 shrink-0" }),
46016
+ onSelect: () => {
46017
+ setActiveId(tid);
46018
+ setShowPicker(false);
46019
+ },
46020
+ onClose: () => closeTab(tid),
46021
+ closeLabel: t2("library.close")
46022
+ },
46023
+ tid
46024
+ );
46025
+ }),
46026
+ computerTabs.map((ct) => {
46027
+ const tid = computerTabId(ct.id);
46028
+ const icon = ct.kind === "app" ? /* @__PURE__ */ jsx(StudioDisplayIcon, { className: "size-3.5 shrink-0" }) : ct.kind === "files" ? /* @__PURE__ */ jsx(Folder1Icon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(WorldIcon, { className: "size-3.5 shrink-0" });
46029
+ return /* @__PURE__ */ jsx(
46030
+ DocumentTab,
46031
+ {
46032
+ active: effectiveActiveId === tid,
46033
+ title: ct.title,
46034
+ icon,
46035
+ onSelect: () => {
46036
+ setActiveId(tid);
46037
+ setActiveComputer(ct.id);
46038
+ setShowPicker(false);
46039
+ },
46040
+ onClose: () => closeTab(tid),
46041
+ closeLabel: t2("library.close")
46042
+ },
46043
+ tid
46044
+ );
46045
+ }),
46046
+ templateTabId && /* @__PURE__ */ jsx(
46047
+ DocumentTab,
46048
+ {
46049
+ active: effectiveActiveId === templateTabId,
46050
+ title: templateTabTitle,
46051
+ icon: /* @__PURE__ */ jsx(SlidesWideIcon, { className: "size-3.5 shrink-0" }),
46052
+ onSelect: () => {
46053
+ setActiveId(templateTabId);
46054
+ setShowPicker(false);
46055
+ },
46056
+ onClose: () => closeTab(templateTabId),
46057
+ closeLabel: t2("library.close")
46058
+ }
46059
+ ),
46060
+ hasSourcesTab && /* @__PURE__ */ jsx(
46061
+ DocumentTab,
46062
+ {
46063
+ active: effectiveActiveId === SOURCES_TAB_ID,
46064
+ title: t2("chat.overview.sources"),
46065
+ icon: /* @__PURE__ */ jsx(ChainLink1Icon, { className: "size-3.5 shrink-0" }),
46066
+ onSelect: () => {
46067
+ setActiveId(SOURCES_TAB_ID);
46068
+ setShowPicker(false);
46069
+ },
46070
+ onClose: () => closeTab(SOURCES_TAB_ID),
46071
+ closeLabel: t2("library.close")
46072
+ }
46073
+ ),
46074
+ !tabStripOverflows && addTabButton
46075
+ ] }),
46037
46076
  tabStripOverflows && /* @__PURE__ */ jsx("div", { className: "flex h-10 shrink-0 items-center pl-1", children: addTabButton }),
46038
46077
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 pl-2 pr-3 shrink-0", children: [
46039
46078
  sourcesActive ? null : computerActive ? /* @__PURE__ */ jsxs(Fragment, { children: [