Skip to content

Build and run agents you can see, understand and trust.

feat(web_ui): unify sidebar, panel and form-control styling (#2234)

DavdGao9edf84602c3a
diff --git a/examples/web_ui/frontend/package.json b/examples/web_ui/frontend/package.json
index 057ca66a7..86cc6e4dd 100644
--- a/examples/web_ui/frontend/package.json
+++ b/examples/web_ui/frontend/package.json
@@ -13,6 +13,7 @@
"dependencies": {
"@agentscope-ai/agentscope": "^0.0.15",
"@fontsource-variable/geist": "^5.2.8",
+ "@fontsource-variable/geist-mono": "^5.3.0",
"@shadcn/react": "^0.2.1",
"@streamdown/cjk": "^1.0.3",
"@streamdown/code": "^1.1.1",
diff --git a/examples/web_ui/frontend/src/api/index.ts b/examples/web_ui/frontend/src/api/index.ts
index c10993a01..5b03ea5ab 100644
--- a/examples/web_ui/frontend/src/api/index.ts
+++ b/examples/web_ui/frontend/src/api/index.ts
@@ -8,5 +8,5 @@ export { hubApi } from './hub';
export { mcpApi } from './mcp';
export { skillApi } from './skill';
export { scheduleApi } from './schedule';
-export { modelApi, ttsModelApi } from './model';
+export { embeddingModelApi, modelApi, ttsModelApi } from './model';
export { knowledgeBaseApi } from './knowledgeBase';
diff --git a/examples/web_ui/frontend/src/api/model.ts b/examples/web_ui/frontend/src/api/model.ts
index 3ebe9484a..d23d68d47 100644
--- a/examples/web_ui/frontend/src/api/model.ts
+++ b/examples/web_ui/frontend/src/api/model.ts
@@ -1,5 +1,5 @@
import { client } from './client';
-import type { ListModelResponse, ListTTSModelResponse } from './types';
+import type { ListEmbeddingModelResponse, ListModelResponse, ListTTSModelResponse } from './types';
export const modelApi = {
list: (provider: string) => client.get<ListModelResponse>('/model/', { provider }),
@@ -8,3 +8,8 @@ export const modelApi = {
export const ttsModelApi = {
list: (provider: string) => client.get<ListTTSModelResponse>('/tts-model/', { provider }),
};
+
+export const embeddingModelApi = {
+ list: (provider: string) =>
+ client.get<ListEmbeddingModelResponse>('/embedding-model/', { provider }),
+};
diff --git a/examples/web_ui/frontend/src/api/types.ts b/examples/web_ui/frontend/src/api/types.ts
index 95917ee63..aa556ed0d 100644
--- a/examples/web_ui/frontend/src/api/types.ts
+++ b/examples/web_ui/frontend/src/api/types.ts
@@ -738,6 +738,12 @@ export interface EmbeddingModelCard {
parameter_overrides: Record<string, Record<string, unknown>>;
}
+/** Response of `GET /embedding-model/` — the provider's full catalogue. */
+export interface ListEmbeddingModelResponse {
+ models: EmbeddingModelCard[];
+ total: number;
+}
+
// ─── Knowledge Base ───────────────────────────────────────────────────────────
/**
diff --git a/examples/web_ui/frontend/src/assets/images/agentscope_white.svg b/examples/web_ui/frontend/src/assets/images/agentscope_white.svg
new file mode 100644
index 000000000..82e3214bb
--- /dev/null
+++ b/examples/web_ui/frontend/src/assets/images/agentscope_white.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="458.9998779296875" height="369" viewBox="0 0 458.9998779296875 369"><defs><filter id="master_svg0_19_0" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.046620063201997915" y="-0.0471976401179941" width="1.093240126403996" height="1.1179941002949854"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="4" dx="0"/><feGaussianBlur stdDeviation="5"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.30000001192092896 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter></defs><g filter="url(#master_svg0_19_0)"><path d="M229.4998779296875,117.25Q229.4998779296875,185.49998,327.49999992968753,216.5Q292.4998929296875,193.5,297.9998929296875,138Q298.4970249296875,133.19413,299.90046692968747,128.49811Q306.9657749296875,104.85701,336.9998579296875,84L369.9998579296875,99.5L423.7738779296875,99.5C431.09608792968754,99.5,435.92158792968746,91.915558,432.3153079296875,85.543015Q395.5066879296875,20.5,326.9998929296875,20.5C297.9998929296875,20.5,229.4998779296875,49.000015000000005,229.4998779296875,117.25Z" fill="#FFFFFF" fill-opacity="1"/><path d="M297.9999160790625,138.00000001015624Q291.9999160890625,193.49999991015625,327.5000132890625,216.49999991015625L387.4998782890625,238.99999791015625Q403.4998762890625,220.24999991015625,403.4998762890625,201.49999991015625Q403.4998762890625,182.74999991015625,387.4998782890625,163.99999991015625L299.9004897890625,128.49810791015625Q298.4970473890625,133.19412991015625,297.9999160790625,138.00000001015624Z" fill="#FFFFFF" fill-opacity="1"/><path d="M76.9998779296875,257.5C78.3900447296875,256.656715,79.7727174296875,255.832466,81.1479740296875,255.026932Q79.0392768296875,256.20977,76.9998779296875,257.5ZM81.1479740296875,255.026932Q104.3716909296875,242,135.9998779296875,242C140.2692869296875,241.798294,144.4211729296875,241.980835,148.4638669296875,242.502029C204.54925792968749,249.732681,239.6220279296875,322.14301,275.9998779296875,338Q304.1248779296875,350,331.9998779296875,350Q359.8748479296875,350,387.4998479296875,338Q443.9998479296875,306,443.9998479296875,250.5Q443.9998479296875,189,387.4998479296875,164Q403.4998479296875,182.75,403.4998479296875,201.5Q403.4998479296875,220.25,387.4998479296875,239C348.3173179296875,280.25696,314.6596479296875,265.94653,273.4499379296875,248.42514799999998C240.9518579296875,234.607742,203.7572079296875,218.793476,155.4527439296875,226.65936299999998C133.2413369296875,230.27625999999998,108.6809179296875,238.899994,81.1479740296875,255.026932Z" fill="#FFFFFF" fill-opacity="1"/><path d="M15,343.99999876953126L87.830505,343.99999876953126C95.566086,343.99999876953126,102.60804,339.53909276953124,105.913116,332.54510476953124L148.46387,242.50202941953125C144.42117,241.98083496053124,140.26929,241.79829406953124,135.99988000000002,241.99999999953124Q101.499878,241.99999999953124,76.999878,257.49999976953126C47.5,279.49999976953126,41,292.99999976953126,15,343.99999876953126Z" fill="#FFFFFF" fill-opacity="1"/><path d="M15,343.9999930184936C41,292.9999930184936,47.5,279.4999930184936,76.999878,257.50000301849366C106.221497,239.77399301849366,132.13189,230.45693301849366,155.45274,226.65937301849365L210.59709,113.04144201849365C213.08066,107.92437601849365,213.26796,101.99190401849366,211.11215,96.72836201849366L181.94841,25.52337361849365C179.6528,19.91851421849365,171.80496,19.676670118493654,169.16859,25.12953951849365L15,343.9999930184936Z" fill="#FFFFFF" fill-opacity="1"/></g></svg>
\ No newline at end of file
diff --git a/examples/web_ui/frontend/src/assets/images/mcp.svg b/examples/web_ui/frontend/src/assets/images/mcp.svg
index 4c9a39e69..9481576f3 100644
--- a/examples/web_ui/frontend/src/assets/images/mcp.svg
+++ b/examples/web_ui/frontend/src/assets/images/mcp.svg
@@ -1,6 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M2 11.5L11.18 2.32C12.5 1 14.62 1 15.94 2.32C17.26 3.64 17.26 5.76 15.94 7.08L8.88 14.14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M8.97 14.04L15.94 7.08C17.26 5.76 19.38 5.76 20.7 7.08L20.74 7.12C22.06 8.44 22.06 10.56 20.7 11.88L13.03 19.55C12.6 19.98 12.6 20.67 13.03 21.1L14.78 22.85" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M13.56 4.7L6.62 11.64C5.3 12.96 5.3 15.08 6.62 16.4C7.94 17.72 10.06 17.72 11.38 16.4L18.34 9.44" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M2 11.5L11.18 2.32C12.5 1 14.62 1 15.94 2.32C17.26 3.64 17.26 5.76 15.94 7.08L8.88 14.14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M8.97 14.04L15.94 7.08C17.26 5.76 19.38 5.76 20.7 7.08L20.74 7.12C22.06 8.44 22.06 10.56 20.7 11.88L13.03 19.55C12.6 19.98 12.6 20.67 13.03 21.1L14.78 22.85" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M13.56 4.7L6.62 11.64C5.3 12.96 5.3 15.08 6.62 16.4C7.94 17.72 10.06 17.72 11.38 16.4L18.34 9.44" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
diff --git a/examples/web_ui/frontend/src/components/chat/ASMessageBubble.tsx b/examples/web_ui/frontend/src/components/chat/ASMessageBubble.tsx
index b281c77e6..3d08b86a4 100644
--- a/examples/web_ui/frontend/src/components/chat/ASMessageBubble.tsx
+++ b/examples/web_ui/frontend/src/components/chat/ASMessageBubble.tsx
@@ -458,7 +458,7 @@ export function ASMessageBubble({ message }: MessageBubbleProps) {
))}
</AttachmentGroup>
{message.role !== 'user' && (
- <MessageFooter>
+ <MessageFooter className="font-mono">
<Badge
variant="secondary"
aria-label={isRunning ? t('messageBubble.running') : undefined}
diff --git a/examples/web_ui/frontend/src/components/chat/ChatContent.tsx b/examples/web_ui/frontend/src/components/chat/ChatContent.tsx
index 240faee0d..2466652b6 100644
--- a/examples/web_ui/frontend/src/components/chat/ChatContent.tsx
+++ b/examples/web_ui/frontend/src/components/chat/ChatContent.tsx
@@ -92,7 +92,9 @@ const ChatContentComponent: React.FC<ChatContentProps> = ({
)}
>
{isEmpty ? (
- <p className="text-center text-lg mb-2">{t('chat.greeting')}</p>
+ <span className="text-center text-4xl font-light tracking-[-0.035em] text-foreground mb-2">
+ {t('chat.greeting')}
+ </span>
) : (
<MessageScrollerProvider autoScroll={true} defaultScrollPosition={'end'}>
<MessageScroller>
diff --git a/examples/web_ui/frontend/src/components/chat/TextInput.tsx b/examples/web_ui/frontend/src/components/chat/TextInput.tsx
index 95e0bd1c9..d6c85fa64 100644
--- a/examples/web_ui/frontend/src/components/chat/TextInput.tsx
+++ b/examples/web_ui/frontend/src/components/chat/TextInput.tsx
@@ -1,5 +1,13 @@
import type { ContentBlock, TextBlock } from '@agentscope-ai/agentscope/message';
-import { Paperclip, Send, Loader2, Square, type LucideIcon, XIcon, FileText } from 'lucide-react';
+import {
+ Paperclip,
+ Loader2,
+ Square,
+ type LucideIcon,
+ XIcon,
+ FileText,
+ ArrowUp,
+} from 'lucide-react';
import mime from 'mime';
import React, {
useState,
@@ -252,7 +260,7 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(
};
}
return {
- icon: Send,
+ icon: ArrowUp,
tooltip: t('textInput.send'),
disabled: disabled || !value.trim() || hasProcessing,
onClick: handleSend,
diff --git a/examples/web_ui/frontend/src/components/dialog/AddSkillDialog.tsx b/examples/web_ui/frontend/src/components/dialog/AddSkillDialog.tsx
index c358dd3b8..9a5ce8419 100644
--- a/examples/web_ui/frontend/src/components/dialog/AddSkillDialog.tsx
+++ b/examples/web_ui/frontend/src/components/dialog/AddSkillDialog.tsx
@@ -236,10 +236,7 @@ export function AddSkillDialog({ children, present, onUpload, onAddFromLibrary }
{t('panel.skill.pickFolderDescription')}
</EmptyDescription>
</EmptyHeader>
- <Button
- variant="outline"
- onClick={() => input.current?.click()}
- >
+ <Button onClick={() => input.current?.click()}>
<FolderUp />
{t('panel.skill.pickFolder')}
</Button>
diff --git a/examples/web_ui/frontend/src/components/dialog/AgentDialog.tsx b/examples/web_ui/frontend/src/components/dialog/AgentDialog.tsx
index e217af608..df611bced 100644
--- a/examples/web_ui/frontend/src/components/dialog/AgentDialog.tsx
+++ b/examples/web_ui/frontend/src/components/dialog/AgentDialog.tsx
@@ -1,5 +1,5 @@
import { CircleAlert, Loader2, PlusCircle } from 'lucide-react';
-import { useEffect, useState } from 'react';
+import { useEffect, useState, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import type { ContextConfig, InviteConfig, ReActConfig } from '@/api';
@@ -27,10 +27,10 @@ import { formatApiErrorForAlert } from '@/lib/api-error';
interface Props {
onCreated?: () => void;
- triggerId?: string;
+ children: ReactNode;
}
-export function AgentDialog({ onCreated, triggerId }: Props) {
+export function AgentDialog({ onCreated, children }: Props) {
const { create } = useAgents();
const { t } = useTranslation();
const { schema } = useAgentSchema();
@@ -86,12 +86,7 @@ export function AgentDialog({ onCreated, triggerId }: Props) {
return (
<Dialog open={open} onOpenChange={setOpen}>
- <DialogTrigger asChild>
- <Button id={triggerId}>
- <PlusCircle />
- <span>{t('dialog-agent-create.trigger')}</span>
- </Button>
- </DialogTrigger>
+ <DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent className="!w-[500px] !max-w-[500px]">
<DialogHeader>
<DialogTitle>{t('dialog-agent-create.title')}</DialogTitle>
diff --git a/examples/web_ui/frontend/src/components/hub/ResourcePanel.tsx b/examples/web_ui/frontend/src/components/hub/ResourcePanel.tsx
index 7099ee879..009ee7215 100644
--- a/examples/web_ui/frontend/src/components/hub/ResourcePanel.tsx
+++ b/examples/web_ui/frontend/src/components/hub/ResourcePanel.tsx
@@ -19,12 +19,14 @@ interface Props {
* box, and a body.
*
* Only the body scrolls — the header and search box stay put, so the search
- * box you are typing into cannot slide away under a long result list.
+ * box you are typing into cannot slide away under a long result list. The
+ * separator sits outside the padded header so it spans the full panel
+ * width, matching the credential detail panel.
*/
export function ResourcePanel({ title, description, icon, search, children }: Props) {
return (
<div className="flex h-full flex-col">
- <div className="flex shrink-0 flex-col gap-y-4 px-6 pt-6">
+ <div className="flex shrink-0 flex-col gap-y-4 p-[18px_18px_16px]">
{/* Borderless Item, so the header lines up with the rows
below it rather than being a second layout. */}
<Item className="p-0">
@@ -34,12 +36,11 @@ export function ResourcePanel({ title, description, icon, search, children }: Pr
{description ? <ItemDescription>{description}</ItemDescription> : null}
</ItemContent>
</Item>
- <Separator />
{search && (
<div className="relative">
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground" />
<Input
- className="pl-9"
+ className="border-0 bg-secondary pl-8 shadow-none"
placeholder={search.placeholder}
value={search.value}
onChange={(e) => search.onChange(e.target.value)}
@@ -48,14 +49,15 @@ export function ResourcePanel({ title, description, icon, search, children }: Pr
)}
</div>
+ <Separator className="shrink-0" />
+
{/* min-h-0 so the flex child may shrink below its content height —
without it the body grows and the whole page scrolls instead.
scroll-fade dissolves both edges as you scroll, so cards do
not butt up hard against the search box or the panel bottom;
- with no overflow it shows nothing. */}
- <div className="flex-1 min-h-0 overflow-y-auto scroll-fade px-6 pb-6 pt-4">
- {children}
- </div>
+ with no overflow it shows nothing. No horizontal padding: the
+ rows own it, so their active border-left reaches the edge. */}
+ <div className="flex-1 min-h-0 overflow-y-auto scroll-fade">{children}</div>
</div>
);
}
diff --git a/examples/web_ui/frontend/src/components/knowledge/KnowledgeDocumentsPanel.tsx b/examples/web_ui/frontend/src/components/knowledge/KnowledgeDocumentsPanel.tsx
index d173a2b4c..c8fedce5e 100644
--- a/examples/web_ui/frontend/src/components/knowledge/KnowledgeDocumentsPanel.tsx
+++ b/examples/web_ui/frontend/src/components/knowledge/KnowledgeDocumentsPanel.tsx
@@ -387,8 +387,9 @@ export function KnowledgeDocumentsPanel({ knowledgeBaseId }: KnowledgeDocumentsP
return (
<div className="flex flex-col gap-y-4">
<div className="flex items-center justify-between">
- <h3 className="text-sm font-semibold">
- {t('knowledge.document.countLabel', { count: totalCount })}
+ <h3 className="flex items-center gap-x-2 text-[13.5px] font-medium text-foreground">
+ {t('knowledge.document.title')}
+ <span className="font-mono text-[11px] text-text-data">{totalCount}</span>
</h3>
<div className="flex items-center gap-x-2">
{hasFinishedLocalTasks && (
@@ -437,7 +438,7 @@ export function KnowledgeDocumentsPanel({ knowledgeBaseId }: KnowledgeDocumentsP
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
- <Button variant="outline" size="sm" onClick={onUploadClick}>
+ <Button size="sm" onClick={onUploadClick}>
<Plus className="size-3.5" />
{t('knowledge.document.uploadButton')}
</Button>
diff --git a/examples/web_ui/frontend/src/components/layout/AppLayout.tsx b/examples/web_ui/frontend/src/components/layout/AppLayout.tsx
index a8f43713a..8541e953d 100644
--- a/examples/web_ui/frontend/src/components/layout/AppLayout.tsx
+++ b/examples/web_ui/frontend/src/components/layout/AppLayout.tsx
@@ -8,7 +8,7 @@ export function AppLayout() {
<div className="h-screen flex">
<SidebarProvider>
<AppSidebar />
- <SidebarInset className="flex-1 overflow-hidden">
+ <SidebarInset className="flex-1 overflow-hidden bg-canvas">
<Outlet />
</SidebarInset>
</SidebarProvider>
diff --git a/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx b/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
index e7b1018fe..464d404b7 100644
--- a/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
+++ b/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
@@ -6,12 +6,14 @@ import {
KeyRound,
Languages,
LibraryBig,
- Settings,
+ UserRound,
} from 'lucide-react';
import { useOnborda } from 'onborda';
+import { useState } from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
-import AgentScope from '@/assets/images/agentscope.svg?react';
+import { getUserId } from '@/api/client';
+import AgentScope from '@/assets/images/agentscope_white.svg?react';
import MCPSvg from '@/assets/images/mcp.svg?react';
import { CHAT_TOUR_NAME } from '@/components/tour/chatTourSteps';
import {
@@ -33,6 +35,8 @@ export function AppSidebar() {
const location = useLocation();
const { t } = useTranslation();
const { startOnborda } = useOnborda();
+ // Read once: the username only changes via /setup, which remounts this.
+ const [initial] = useState(() => getUserId().trim().slice(0, 1).toUpperCase());
const handleStartTour = () => {
if (!location.pathname.startsWith('/chat')) {
@@ -51,10 +55,13 @@ export function AppSidebar() {
};
return (
- <Sidebar collapsible="none" className="w-[calc(var(--sidebar-width-icon)+1px)]! border-r">
+ <Sidebar
+ collapsible="none"
+ className="w-[calc(var(--sidebar-width-icon)+1px)]! bg-transparent"
+ >
<SidebarHeader>
- <div className="flex items-center justify-center h-12 mt-2">
- <AgentScope className="size-8 items-center justify-center rounded-lg" />
+ <div className="flex items-center justify-center size-8 mt-2 rounded-full bg-primary">
+ <AgentScope className="size-5 items-center justify-center rounded-lg" />
</div>
</SidebarHeader>
<SidebarContent>
@@ -69,7 +76,7 @@ export function AppSidebar() {
location.pathname.startsWith('/chat/')
}
onClick={() => navigate('/chat')}
- className="px-2.5 md:px-2"
+ className="justify-center"
>
<BotMessageSquare />
</SidebarMenuButton>
@@ -79,7 +86,7 @@ export function AppSidebar() {
tooltip={{ children: t('common.schedule'), hidden: false }}
isActive={location.pathname === '/schedule'}
onClick={() => navigate('/schedule')}
- className="px-2"
+ className="justify-center"
>
<Calendars />
</SidebarMenuButton>
@@ -95,7 +102,7 @@ export function AppSidebar() {
tooltip={{ children: t('common.credential'), hidden: false }}
isActive={location.pathname === '/credential'}
onClick={() => navigate('/credential')}
- className="px-2"
+ className="justify-center"
>
<KeyRound />
</SidebarMenuButton>
@@ -106,7 +113,7 @@ export function AppSidebar() {
// Stays lit while browsing a hub under /mcp/:hubId.
isActive={location.pathname.startsWith('/mcp')}
onClick={() => navigate('/mcp')}
- className="px-2"
+ className="justify-center"
>
<MCPSvg />
</SidebarMenuButton>
@@ -116,7 +123,7 @@ export function AppSidebar() {
tooltip={{ children: t('common.skill-hub'), hidden: false }}
isActive={location.pathname.startsWith('/skill')}
onClick={() => navigate('/skill')}
- className="px-2"
+ className="justify-center"
>
<BookText />
</SidebarMenuButton>
@@ -126,7 +133,7 @@ export function AppSidebar() {
tooltip={{ children: t('common.knowledge'), hidden: false }}
isActive={location.pathname === '/knowledge'}
onClick={() => navigate('/knowledge')}
- className="px-2"
+ className="justify-center"
>
<LibraryBig />
</SidebarMenuButton>
@@ -146,7 +153,7 @@ export function AppSidebar() {
hidden: false,
}}
onClick={handleToggleLanguage}
- className="px-2"
+ className="justify-center"
>
<Languages />
</SidebarMenuButton>
@@ -155,7 +162,7 @@ export function AppSidebar() {
<SidebarMenuButton
tooltip={{ children: t('tour.trigger'), hidden: false }}
onClick={handleStartTour}
- className="px-2"
+ className="justify-center"
>
<Compass />
</SidebarMenuButton>
@@ -165,9 +172,9 @@ export function AppSidebar() {
tooltip={{ children: t('common.settings'), hidden: false }}
isActive={location.pathname === '/setup'}
onClick={() => navigate('/setup')}
- className="px-2"
+ className="justify-center"
>
- <Settings />
+ {initial || <UserRound />}
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
diff --git a/examples/web_ui/frontend/src/components/panel/McpPanel.tsx b/examples/web_ui/frontend/src/components/panel/McpPanel.tsx
index 8b267d659..4be71775c 100644
--- a/examples/web_ui/frontend/src/components/panel/McpPanel.tsx
+++ b/examples/web_ui/frontend/src/components/panel/McpPanel.tsx
@@ -126,7 +126,7 @@ function McpRow({ mcp, installed, onDelete }: McpRowProps) {
</Button>
</ItemActions>
- <ItemFooter>
+ <ItemFooter className="min-w-0">
{mcp.is_healthy ? (
<Collapsible open={open} onOpenChange={setOpen} className="min-w-0 basis-full">
<CollapsibleTrigger asChild>
diff --git a/examples/web_ui/frontend/src/components/panel/PanelDock.tsx b/examples/web_ui/frontend/src/components/panel/PanelDock.tsx
index de2cd7227..8930b46a6 100644
--- a/examples/web_ui/frontend/src/components/panel/PanelDock.tsx
+++ b/examples/web_ui/frontend/src/components/panel/PanelDock.tsx
@@ -98,7 +98,7 @@ interface PanelProps {
*/
export const Panel = ({ title, icon, actions, onClose, children }: PanelProps) => {
return (
- <div className="flex flex-1 flex-col border rounded-sm h-full py-1 min-h-0">
+ <div className="flex flex-1 flex-col h-full p-2 min-h-0">
<div className="flex items-center justify-between px-2">
<span className="flex items-center gap-x-1.5 text-sm">
{icon}
@@ -147,8 +147,10 @@ export const PanelDock = ({ layout, panels, onClosePanel }: PanelDockProps) => {
<>
{layout.map((column, colIndex) => (
<Fragment key={`col-${column.join('-')}`}>
- {colIndex > 0 && <ResizableHandle withHandle className="bg-transparent" />}
- <ResizablePanel className="p-1" minSize={COLUMN_MIN_WIDTH} defaultSize="22rem">
+ {colIndex > 0 && (
+ <ResizableHandle withHandle className="bg-transparent w-1.5" />
+ )}
+ <ResizablePanel minSize={COLUMN_MIN_WIDTH} defaultSize="22rem">
<ResizablePanelGroup orientation="vertical">
{column.map((key, rowIndex) => {
const descriptor = panels[key];
@@ -158,10 +160,14 @@ export const PanelDock = ({ layout, panels, onClosePanel }: PanelDockProps) => {
{rowIndex > 0 && (
<ResizableHandle
withHandle
- className="bg-transparent"
+ className="bg-transparent !h-1"
/>
)}
- <ResizablePanel className="py-1" minSize={PANEL_MIN_HEIGHT}>
+
+ <ResizablePanel
+ className="rounded-[22px] bg-card shadow-panel"
+ minSize={PANEL_MIN_HEIGHT}
+ >
<Panel
title={descriptor.title}
icon={descriptor.icon}
diff --git a/examples/web_ui/frontend/src/components/select/AgentSelect.tsx b/examples/web_ui/frontend/src/components/select/AgentSelect.tsx
index 2b7321f0a..bb4037a20 100644
--- a/examples/web_ui/frontend/src/components/select/AgentSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/AgentSelect.tsx
@@ -13,14 +13,16 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { useTranslation } from '@/i18n/useI18n.ts';
+import { cn } from '@/lib/utils';
-interface Props {
+interface Props extends Omit<React.ComponentPropsWithoutRef<typeof Button>, 'onChange' | 'value'> {
agents: AgentView[];
/** Currently selected agent id, or `null` when none is selected. */
value?: string | null;
onChange?: (agentId: string) => void;
/** Override the trigger label shown when no agent is selected. */
placeholder?: string;
+ className?: string;
}
/**
@@ -34,7 +36,7 @@ interface Props {
* into "Yours" and "Shared with you" groups so the read-only
* origin of the shared entries is unambiguous at a glance.
*/
-export function AgentSelect({ agents, value, onChange, placeholder }: Props) {
+export function AgentSelect({ agents, value, onChange, placeholder, className, ...props }: Props) {
const { t } = useTranslation();
const selected = agents.find((a) => a.id === value) ?? null;
const displayLabel = selected
@@ -72,10 +74,11 @@ export function AgentSelect({ agents, value, onChange, placeholder }: Props) {
<Button
variant="outline"
size="sm"
- className="flex-1 min-w-0 justify-between gap-1"
+ className={cn('justify-between gap-1 font-normal', className)}
+ {...props}
>
<span className="truncate">{displayLabel}</span>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="min-w-56 max-h-72 overflow-y-auto">
diff --git a/examples/web_ui/frontend/src/components/select/DimensionSelect.tsx b/examples/web_ui/frontend/src/components/select/DimensionSelect.tsx
index 787ce3a5b..b33553296 100644
--- a/examples/web_ui/frontend/src/components/select/DimensionSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/DimensionSelect.tsx
@@ -55,11 +55,11 @@ export function DimensionSelect({ value, options, onChange, disabled }: Props) {
<Button
variant="outline"
size="sm"
- className="justify-between gap-1"
+ className="justify-between gap-1 font-normal"
disabled={disabled}
>
<span className="truncate font-mono">{display}</span>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="min-w-32">
diff --git a/examples/web_ui/frontend/src/components/select/EmbeddingSelect.tsx b/examples/web_ui/frontend/src/components/select/EmbeddingSelect.tsx
index cf6528262..93c4331f1 100644
--- a/examples/web_ui/frontend/src/components/select/EmbeddingSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/EmbeddingSelect.tsx
@@ -72,9 +72,9 @@ export function EmbeddingSelect({
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button variant="outline" size="sm" className="justify-between gap-1">
+ <Button variant="outline" size="sm" className="justify-between gap-1 font-normal">
<span className="truncate">{displayLabel}</span>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="min-w-48 max-h-72 overflow-y-auto">
diff --git a/examples/web_ui/frontend/src/components/select/LlmSelect.tsx b/examples/web_ui/frontend/src/components/select/LlmSelect.tsx
index 05a221290..837a39bf2 100644
--- a/examples/web_ui/frontend/src/components/select/LlmSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/LlmSelect.tsx
@@ -17,8 +17,9 @@ import {
} from '@/components/ui/dropdown-menu';
import { useAvailableModels } from '@/hooks/useAvailableModels';
import { useTranslation } from '@/i18n/useI18n.ts';
+import { cn } from '@/lib/utils';
-interface Props {
+interface Props extends Omit<React.ComponentPropsWithoutRef<typeof Button>, 'onChange' | 'value'> {
value?: ChatModelConfig | null;
/**
* Called when the user selects a model, or — when `allowClear` is true —
@@ -46,6 +47,8 @@ export function LlmSelect({
placeholder,
allowClear = false,
clearLabel,
+ className,
+ ...props
}: Props) {
const { groups, loading, refetch } = useAvailableModels();
const { t } = useTranslation();
@@ -68,9 +71,14 @@ export function LlmSelect({
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button variant="outline" size="sm" className="justify-between gap-1">
+ <Button
+ variant="outline"
+ size="sm"
+ className={cn('justify-between gap-1 font-normal', className)}
+ {...props}
+ >
<span className="truncate">{displayLabel}</span>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="min-w-48 max-h-72 overflow-y-auto">
@@ -100,7 +108,7 @@ export function LlmSelect({
)
}
>
- {m.label}
+ {m.name}
</DropdownMenuItem>
))
: items.map(({ credential, models }) => {
diff --git a/examples/web_ui/frontend/src/components/select/PermissionModeSelect.tsx b/examples/web_ui/frontend/src/components/select/PermissionModeSelect.tsx
index f2f9fb02a..b428ea82b 100644
--- a/examples/web_ui/frontend/src/components/select/PermissionModeSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/PermissionModeSelect.tsx
@@ -22,14 +22,14 @@ const PERMISSION_MODES: { value: PermissionMode; label: string }[] = [
{ value: 'dont_ask', label: "Don't Ask" },
];
-interface Props {
+interface Props extends Omit<React.ComponentPropsWithoutRef<typeof Button>, 'onChange' | 'value'> {
className?: string;
value?: PermissionMode;
disabled?: boolean;
onChange?: (value: PermissionMode) => void;
}
-export function PermissionModeSelect({ className, value, disabled, onChange }: Props) {
+export function PermissionModeSelect({ className, value, disabled, onChange, ...props }: Props) {
const { t } = useTranslation();
const displayLabel = value
@@ -42,15 +42,16 @@ export function PermissionModeSelect({ className, value, disabled, onChange }: P
<Button
variant="outline"
size="sm"
- className={cn('justify-between gap-1', className)}
+ className={cn('justify-between gap-1 font-normal', className)}
disabled={disabled}
tooltip={t('permission-mode.trigger-tooltip')}
+ {...props}
>
<div className="flex flex-row items-center gap-x-2">
<UserRoundKey />
<span className="truncate">{displayLabel}</span>
</div>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="min-w-48">
diff --git a/examples/web_ui/frontend/src/components/select/TimezoneSelect.tsx b/examples/web_ui/frontend/src/components/select/TimezoneSelect.tsx
index 4e532f227..b8e04e459 100644
--- a/examples/web_ui/frontend/src/components/select/TimezoneSelect.tsx
+++ b/examples/web_ui/frontend/src/components/select/TimezoneSelect.tsx
@@ -15,14 +15,14 @@ const LOCAL_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
const ALL_TIMEZONES: string[] = Intl.supportedValuesOf('timeZone');
-interface Props {
+interface Props extends Omit<React.ComponentPropsWithoutRef<typeof Button>, 'onChange' | 'value'> {
className?: string;
value?: string;
onChange?: (value: string) => void;
disabled?: boolean;
}
-export function TimezoneSelect({ className, value, onChange, disabled }: Props) {
+export function TimezoneSelect({ className, value, onChange, disabled, ...props }: Props) {
const [search, setSearch] = React.useState('');
const inputRef = React.useRef<HTMLInputElement>(null);
@@ -44,14 +44,15 @@ export function TimezoneSelect({ className, value, onChange, disabled }: Props)
<Button
variant="outline"
size="sm"
- className={cn('justify-between gap-1', className)}
+ className={cn('justify-between gap-1 font-normal', className)}
disabled={disabled}
+ {...props}
>
<div className="flex flex-row items-center gap-x-2">
<Globe className="size-3.5" />
- <span className="truncate text-xs">{displayLabel}</span>
+ <span className="truncate">{displayLabel}</span>
</div>
- <ChevronDown className="size-3.5 opacity-50" />
+ <ChevronDown className="size-3.5 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="w-64">
diff --git a/examples/web_ui/frontend/src/components/tour/chatTourSteps.ts b/examples/web_ui/frontend/src/components/tour/chatTourSteps.ts
index dcb772bac..5be304584 100644
--- a/examples/web_ui/frontend/src/components/tour/chatTourSteps.ts
+++ b/examples/web_ui/frontend/src/components/tour/chatTourSteps.ts
@@ -14,7 +14,7 @@ export const buildChatTour = (t: TFunction): Tour => ({
side: 'bottom',
showControls: false,
pointerPadding: 8,
- pointerRadius: 8,
+ pointerRadius: 16,
},
{
icon: null,
@@ -24,7 +24,7 @@ export const buildChatTour = (t: TFunction): Tour => ({
side: 'right',
showControls: false,
pointerPadding: 6,
- pointerRadius: 6,
+ pointerRadius: 22,
},
{
icon: null,
@@ -34,7 +34,7 @@ export const buildChatTour = (t: TFunction): Tour => ({
side: 'bottom',
showControls: false,
pointerPadding: 6,
- pointerRadius: 8,
+ pointerRadius: 20,
},
{
icon: null,
@@ -44,7 +44,7 @@ export const buildChatTour = (t: TFunction): Tour => ({
side: 'bottom-right',
showControls: false,
pointerPadding: 6,
- pointerRadius: 8,
+ pointerRadius: 22,
},
{
icon: null,
@@ -54,7 +54,7 @@ export const buildChatTour = (t: TFunction): Tour => ({
side: 'top',
showControls: false,
pointerPadding: 6,
- pointerRadius: 16,
+ pointerRadius: 34,
},
],
});
diff --git a/examples/web_ui/frontend/src/components/ui/dropdown-menu.tsx b/examples/web_ui/frontend/src/components/ui/dropdown-menu.tsx
index be727355e..2a9299e32 100644
--- a/examples/web_ui/frontend/src/components/ui/dropdown-menu.tsx
+++ b/examples/web_ui/frontend/src/components/ui/dropdown-menu.tsx
@@ -34,6 +34,7 @@ function DropdownMenuContent({
align={align}
className={cn(
'z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
+ 'font-mono',
className,
)}
{...props}
@@ -61,7 +62,7 @@ function DropdownMenuItem({
data-inset={inset}
data-variant={variant}
className={cn(
- "group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
+ "group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-menu-item py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
className,
)}
{...props}
@@ -83,7 +84,7 @@ function DropdownMenuCheckboxItem({
data-slot="dropdown-menu-checkbox-item"
data-inset={inset}
className={cn(
- "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-menu-item text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
checked={checked}
@@ -121,7 +122,7 @@ function DropdownMenuRadioItem({
data-slot="dropdown-menu-radio-item"
data-inset={inset}
className={cn(
- "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-menu-item text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
@@ -202,7 +203,7 @@ function DropdownMenuSubTrigger({
data-slot="dropdown-menu-sub-trigger"
data-inset={inset}
className={cn(
- "flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "flex cursor-default items-center gap-1.5 rounded-md px-menu-item py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
diff --git a/examples/web_ui/frontend/src/components/ui/select.tsx b/examples/web_ui/frontend/src/components/ui/select.tsx
index 4d8d80c0f..ae2755d5b 100644
--- a/examples/web_ui/frontend/src/components/ui/select.tsx
+++ b/examples/web_ui/frontend/src/components/ui/select.tsx
@@ -42,7 +42,7 @@ function SelectTrigger({
>
{children}
<SelectPrimitive.Icon asChild>
- <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
+ <ChevronDownIcon className="pointer-events-none size-3.5 text-muted-foreground" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
);
@@ -90,7 +90,7 @@ function SelectLabel({ className, ...props }: React.ComponentProps<typeof Select
return (
<SelectPrimitive.Label
data-slot="select-label"
- className={cn('px-1.5 py-1 text-xs text-muted-foreground', className)}
+ className={cn('px-menu-item py-1 text-xs text-muted-foreground', className)}
{...props}
/>
);
@@ -105,7 +105,7 @@ function SelectItem({
<SelectPrimitive.Item
data-slot="select-item"
className={cn(
- "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
+ "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-menu-item text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className,
)}
{...props}
diff --git a/examples/web_ui/frontend/src/components/ui/sidebar.tsx b/examples/web_ui/frontend/src/components/ui/sidebar.tsx
index 13415de1f..3482cc9cb 100644
--- a/examples/web_ui/frontend/src/components/ui/sidebar.tsx
+++ b/examples/web_ui/frontend/src/components/ui/sidebar.tsx
@@ -384,7 +384,8 @@ function SidebarGroupLabel({
data-slot="sidebar-group-label"
data-sidebar="group-label"
className={cn(
- 'flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
+ 'font-mono flex h-8 shrink-0 items-center rounded-md px-2 text-[11px] font-medium text-text-tertiary ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
+ 'uppercase',
className,
)}
{...props}
diff --git a/examples/web_ui/frontend/src/components/ui/table.tsx b/examples/web_ui/frontend/src/components/ui/table.tsx
new file mode 100644
index 000000000..b7328cdef
--- /dev/null
+++ b/examples/web_ui/frontend/src/components/ui/table.tsx
@@ -0,0 +1,92 @@
+import * as React from 'react';
+
+import { cn } from '@/lib/utils';
+
+function Table({ className, ...props }: React.ComponentProps<'table'>) {
+ return (
+ <div data-slot="table-container" className="relative w-full overflow-x-auto">
+ <table
+ data-slot="table"
+ className={cn('w-full caption-bottom text-sm', className)}
+ {...props}
+ />
+ </div>
+ );
+}
+
+function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
+ return (
+ <thead data-slot="table-header" className={cn('[&_tr]:border-b', className)} {...props} />
+ );
+}
+
+function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
+ return (
+ <tbody
+ data-slot="table-body"
+ className={cn('[&_tr:last-child]:border-0', className)}
+ {...props}
+ />
+ );
+}
+
+function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
+ return (
+ <tfoot
+ data-slot="table-footer"
+ className={cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
+ {...props}
+ />
+ );
+}
+
+function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
+ return (
+ <tr
+ data-slot="table-row"
+ className={cn(
+ 'border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted',
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
+ return (
+ <th
+ data-slot="table-head"
+ className={cn(
+ 'h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0',
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
+ return (
+ <td
+ data-slot="table-cell"
+ className={cn(
+ 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0',
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
+ return (
+ <caption
+ data-slot="table-caption"
+ className={cn('mt-4 text-sm text-muted-foreground', className)}
+ {...props}
+ />
+ );
+}
+
+export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
diff --git a/examples/web_ui/frontend/src/i18n/locales/en.json b/examples/web_ui/frontend/src/i18n/locales/en.json
index 206e5c792..ffc3763eb 100644
--- a/examples/web_ui/frontend/src/i18n/locales/en.json
+++ b/examples/web_ui/frontend/src/i18n/locales/en.json
@@ -11,12 +11,10 @@
"credential": "Credentials",
"date": "Date",
"delete": "Delete",
- "deleting": "Deleting…",
"disabled": "Disabled",
"edit": "Edit",
"error": "Something went wrong",
"information": "Information",
- "interrupted": "Interrupted",
"knowledge": "Knowledge Bases",
"loading": "Loading...",
"shownCount": "{{count}} shown",
@@ -37,11 +35,9 @@
"settings": "Settings",
"switchToZh": "切换为中文",
"switchToEn": "Switch to English",
- "success": "Success",
"team": "Team",
"uploading": "Uploading",
"leader": "Leader",
- "worker": "Worker",
"time": "Time",
"yes": "Yes",
"deleteTitle": "Delete {{entity}} \"{{name}}\"?",
@@ -50,7 +46,11 @@
"mine": "Mine",
"my-mcp": "Installed MCPs",
"skill-hub": "Skill Hub",
- "my-skill": "Installed skills"
+ "my-skill": "Installed skills",
+ "message": "Message",
+ "llm": "LLM",
+ "tts": "TTS",
+ "embedding": "Embedding"
},
"error": {
"description": "The page hit an unexpected error. You can retry or go back home.",
@@ -134,12 +134,9 @@
},
"chat": {
"inputPlaceholder": "Type a message...",
- "placeholder": "Type a message...",
- "send": "Send",
"confirmToolCall": "Allow this action?",
"subagentConfirmTitle": "{{name}} requests confirmation",
"newSession": "New Session",
- "noSessions": "No sessions yet",
"greeting": "Where should we start?",
"agent": {
"selectPlaceholder": "Select an agent",
@@ -152,13 +149,14 @@
"label": "Session",
"emptyTitle": "No sessions",
"emptyNoAgent": "Select an agent first.",
- "emptyHasAgent": "Create a session to start chatting."
+ "emptyHasAgent": "Create a session to start chatting.",
+ "today": "Today",
+ "earlier": "Earlier"
}
},
"dialog-agent-create": {
"title": "Create agent",
- "description": "Define a new agent's identity and behaviour.",
- "trigger": "Create agent"
+ "description": "Define a new agent's identity and behaviour."
},
"agent-form": {
"identity": {
@@ -299,7 +297,6 @@
},
"credential": {
"noProviders": "No providers available",
- "noConfigs": "No configurations",
"selectHint": "No credential selected",
"selectHintDescription": "Select a credential from the sidebar to view its details.",
"availableModels": "Available Models",
@@ -310,17 +307,21 @@
"configured": "Configured",
"addProvider": "Add credential",
"reasoning": "Reasoning",
- "maxContext": "Max. Context",
- "maxOutput": "Max. Output",
- "inputTypes": "Input",
- "outputTypes": "Output",
- "availableTTSModels": "TTS Models"
+ "realtime": "Realtime",
+ "table": {
+ "model": "Model",
+ "context": "Context",
+ "maxOutput": "Max output",
+ "accepts": "Accepts",
+ "outputs": "Outputs",
+ "legend": "Context and max output are token counts. REASONING marks models that support extended thinking.",
+ "dimensions": "Dimensions"
+ }
},
"knowledge": {
"subtitle": "Manage knowledge bases used by your agents",
"selectHint": "No knowledge base selected",
"selectHintDescription": "Select a knowledge base from the sidebar to view its details.",
- "deleteEntity": "knowledge base",
"list": {
"label": "Knowledge bases",
"emptyTitle": "No knowledge bases",
@@ -328,24 +329,16 @@
"createButton": "Create knowledge base"
},
"document": {
- "label": "Documents",
"emptyTitle": "No documents",
"emptyDescription": "Upload a document to index it into this knowledge base.",
"uploadButton": "Upload document",
"uploadButtonShort": "Upload",
- "countLabel": "Documents ({{count}})",
- "size": "Size",
- "chunks": "Chunks",
"chunkCount_one": "{{count}} chunk",
"chunkCount_other": "{{count}} chunks",
- "uploadedAt": "Uploaded {{when}}",
- "deleteEntity": "document",
"deleteConfirmTitle": "Delete document",
"deleteConfirmDescription": "Delete \"{{name}}\"? This removes the document and every indexed chunk. This action cannot be undone.",
"deleteError": "Could not delete document.",
- "dropHint": "Drop files here to upload",
"dropHintIdle": "or drop files here",
- "invalidFile": "\"{{name}}\" could not be added.",
"unsupportedExtension": "\"{{name}}\" was skipped — file type not supported.",
"status": {
"queued": "Queued",
@@ -360,11 +353,11 @@
},
"actions": {
"cancel": "Cancel",
- "retry": "Retry",
"dismiss": "Dismiss",
"remove": "Remove",
"clearFinished": "Clear finished"
- }
+ },
+ "title": "Documents"
},
"test": {
"button": "Test",
@@ -382,12 +375,10 @@
},
"llm-select": {
"placeholder": "Select a model",
- "fallbackPlaceholder": "Fallback model",
"loading": "Loading…",
"empty": {
"title": "No models available",
- "description": "Add a credential to get started.",
- "addButton": "Add credential"
+ "description": "Add a credential to get started."
},
"addCredential": "Add Credential",
"clear": "Clear selection",
@@ -400,8 +391,7 @@
"title": "No embedding models available",
"description": "Add a credential that supports embedding to get started."
},
- "addCredential": "Add Credential",
- "clear": "Clear selection"
+ "addCredential": "Add Credential"
},
"dimension-select": {
"placeholder": "Select a dimension",
@@ -440,8 +430,7 @@
"title": "Create Schedule"
},
"deleteSchedule": {
- "entity": "schedule",
- "successToast": "Schedule deleted successfully."
+ "entity": "schedule"
},
"endAt": "End Date",
"end_at": "End At",
@@ -457,8 +446,6 @@
"more": "more",
"nextMonth": "Next Month",
"nextYear": "Next Year",
- "noExecutions": "No executions yet",
- "noExecutionsDescription": "This schedule has not been executed yet.",
"noSchedules": "No schedules",
"noSchedulesDescription": "Create a schedule to automate agent tasks.",
"pickDate": "Pick a date",
@@ -472,7 +459,6 @@
"previousMonth": "Previous Month",
"previousYear": "Previous Year",
"saturday": "Sat",
- "startAt": "Start At",
"sunday": "Sun",
"thursday": "Thu",
"today": "Today",
@@ -531,11 +517,6 @@
}
},
"task-panel": {
- "heading": "Tasks",
- "noTasks": "No tasks yet.",
- "pending": "Pending",
- "inProgress": "In Progress",
- "completed": "Completed",
"blockedBy": "blocked by"
},
"panel": {
@@ -547,7 +528,6 @@
"emptyDescription": "Tasks the agent plans will show up here."
},
"mcp": {
- "title": "MCP",
"description": "The MCP servers equipped in the workspace.",
"searchPlaceholder": "Search MCP in the workspace",
"add": "Add MCP",
@@ -587,8 +567,7 @@
"emptyTitle": "No knowledge bases",
"emptyDescription": "Create one on the Knowledge Bases page first.",
"parametersTitle": "Retrieval settings",
- "parametersDescription": "Knowledge base retrieval settings.",
- "selectedCount": "{{count}} attached"
+ "parametersDescription": "Knowledge base retrieval settings."
},
"permission": {
"title": "Permissions",
@@ -611,10 +590,7 @@
},
"team-sidebar": {
"membersHeading": "Members",
- "noMembers": "No members yet — ask the leader to spawn one with AgentCreate.",
- "running": "Running",
- "idle": "Idle",
- "missingSession": "(no session)"
+ "noMembers": "No members yet — ask the leader to spawn one with AgentCreate."
},
"mcp": {
"subtitle": "Browse and install MCP servers",
@@ -669,5 +645,9 @@
"loadFailedTitle": "Couldn't reach the server",
"loadFailedDescription": "Check the server URL and that the service is running.",
"retry": "Retry"
+ },
+ "agent-menu": {
+ "settings": "Settings",
+ "delete": "Delete agent"
}
}
diff --git a/examples/web_ui/frontend/src/i18n/locales/zh.json b/examples/web_ui/frontend/src/i18n/locales/zh.json
index 5fa72102f..b3202166d 100644
--- a/examples/web_ui/frontend/src/i18n/locales/zh.json
+++ b/examples/web_ui/frontend/src/i18n/locales/zh.json
@@ -11,12 +11,10 @@
"credential": "凭证",
"date": "日期",
"delete": "删除",
- "deleting": "删除中…",
"disabled": "已禁用",
"edit": "编辑",
"error": "出错了",
"information": "信息",
- "interrupted": "已中断",
"knowledge": "知识库",
"loading": "加载中...",
"shownCount": "已显示 {{count}} 个",
@@ -37,11 +35,9 @@
"settings": "设置",
"switchToZh": "切换为中文",
"switchToEn": "Switch to English",
- "success": "成功",
"team": "团队",
"uploading": "上传中",
"leader": "队长",
- "worker": "成员",
"time": "时间",
"yes": "是",
"deleteTitle": "删除{{entity}} \"{{name}}\"?",
@@ -50,7 +46,11 @@
"mine": "我的",
"my-mcp": "已安装的 MCP",
"skill-hub": "技能中心",
- "my-skill": "已安装的技能"
+ "my-skill": "已安装的技能",
+ "message": "消息",
+ "llm": "LLM",
+ "tts": "TTS",
+ "embedding": "向量"
},
"error": {
"description": "页面遇到意外错误。你可以重试或返回首页。",
@@ -134,12 +134,9 @@
},
"chat": {
"inputPlaceholder": "输入消息...",
- "placeholder": "输入消息...",
- "send": "发送",
"confirmToolCall": "允许此操作?",
"subagentConfirmTitle": "{{name}} 请求确认",
"newSession": "新会话",
- "noSessions": "暂无会话",
"greeting": "我们从哪儿开始?",
"agent": {
"selectPlaceholder": "选择 Agent",
@@ -152,13 +149,14 @@
"label": "会话",
"emptyTitle": "暂无会话",
"emptyNoAgent": "请先选择一个 Agent。",
- "emptyHasAgent": "创建会话开始对话。"
+ "emptyHasAgent": "创建会话开始对话。",
+ "today": "今天",
+ "earlier": "更早"
}
},
"dialog-agent-create": {
"title": "创建 Agent",
- "description": "定义新 Agent 的身份与行为。",
- "trigger": "创建 Agent"
+ "description": "定义新 Agent 的身份与行为。"
},
"agent-form": {
"identity": {
@@ -299,7 +297,6 @@
},
"credential": {
"noProviders": "暂无可用提供商",
- "noConfigs": "暂无配置",
"selectHint": "未选择凭证",
"selectHintDescription": "从左侧选择一个凭证以查看详情。",
"availableModels": "可用模型",
@@ -310,17 +307,21 @@
"configured": "已配置",
"addProvider": "添加凭证",
"reasoning": "推理模型",
- "maxContext": "最大上下文",
- "maxOutput": "最大输出",
- "inputTypes": "输入模态",
- "outputTypes": "输出模态",
- "availableTTSModels": "语音合成模型"
+ "realtime": "实时",
+ "table": {
+ "model": "模型",
+ "context": "上下文",
+ "maxOutput": "最大输出",
+ "accepts": "输入",
+ "outputs": "输出",
+ "legend": "上下文与最大输出均以 token 计。REASONING 表示模型支持深度思考。",
+ "dimensions": "维度"
+ }
},
"knowledge": {
"subtitle": "管理 Agent 使用的知识库",
"selectHint": "未选择知识库",
"selectHintDescription": "从左侧选择一个知识库以查看详情。",
- "deleteEntity": "知识库",
"list": {
"label": "知识库",
"emptyTitle": "暂无知识库",
@@ -328,24 +329,16 @@
"createButton": "创建知识库"
},
"document": {
- "label": "文档",
"emptyTitle": "暂无文档",
"emptyDescription": "上传文档以索引到该知识库中。",
"uploadButton": "上传文档",
"uploadButtonShort": "上传",
- "countLabel": "文档({{count}})",
- "size": "大小",
- "chunks": "分块",
"chunkCount_one": "{{count}} 个分块",
"chunkCount_other": "{{count}} 个分块",
- "uploadedAt": "{{when}} 上传",
- "deleteEntity": "文档",
"deleteConfirmTitle": "删除文档",
"deleteConfirmDescription": "确认删除 \"{{name}}\"?该操作将一并移除文档及其全部已索引分块,且不可撤销。",
"deleteError": "删除文档失败。",
- "dropHint": "拖拽文件到此处上传",
"dropHintIdle": "或拖拽文件到此处",
- "invalidFile": "\"{{name}}\" 添加失败。",
"unsupportedExtension": "\"{{name}}\" 已跳过——不支持该文件类型。",
"status": {
"queued": "排队中",
@@ -360,11 +353,11 @@
},
"actions": {
"cancel": "取消",
- "retry": "重试",
"dismiss": "关闭",
"remove": "删除",
"clearFinished": "清除已完成"
- }
+ },
+ "title": "文档"
},
"test": {
"button": "测试",
@@ -382,12 +375,10 @@
},
"llm-select": {
"placeholder": "选择模型",
- "fallbackPlaceholder": "兜底模型",
"loading": "加载中…",
"empty": {
"title": "暂无可用模型",
- "description": "请先添加凭证。",
- "addButton": "添加凭证"
+ "description": "请先添加凭证。"
},
"addCredential": "添加凭证",
"clear": "清除选择",
@@ -400,8 +391,7 @@
"title": "暂无可用的 Embedding 模型",
"description": "请先添加支持 Embedding 的凭证。"
},
- "addCredential": "添加凭证",
- "clear": "清除选择"
+ "addCredential": "添加凭证"
},
"dimension-select": {
"placeholder": "选择维度",
@@ -440,8 +430,7 @@
"title": "创建日程"
},
"deleteSchedule": {
- "entity": "日程",
- "successToast": "日程已删除。"
+ "entity": "日程"
},
"endAt": "结束日期",
"end_at": "结束时间",
@@ -457,8 +446,6 @@
"more": "更多",
"nextMonth": "下个月",
"nextYear": "下一年",
- "noExecutions": "暂无执行记录",
- "noExecutionsDescription": "该日程尚未执行过。",
"noSchedules": "暂无日程",
"noSchedulesDescription": "创建日程以自动化 Agent 任务。",
"pickDate": "选择日期",
@@ -472,7 +459,6 @@
"previousMonth": "上个月",
"previousYear": "上一年",
"saturday": "周六",
- "startAt": "开始时间",
"sunday": "周日",
"thursday": "周四",
"today": "今天",
@@ -531,11 +517,6 @@
}
},
"task-panel": {
- "heading": "任务",
- "noTasks": "暂无任务。",
- "pending": "待处理",
- "inProgress": "进行中",
- "completed": "已完成",
"blockedBy": "依赖"
},
"panel": {
@@ -547,7 +528,6 @@
"emptyDescription": "智能体规划的任务会显示在这里。"
},
"mcp": {
- "title": "MCP",
"description": "工作区中配置的 MCP 服务器。",
"searchPlaceholder": "在工作区中搜索 MCP",
"add": "添加 MCP",
@@ -587,8 +567,7 @@
"emptyTitle": "暂无知识库",
"emptyDescription": "请先在「知识库」页面创建一个。",
"parametersTitle": "检索配置",
- "parametersDescription": "知识库检索参数设置",
- "selectedCount": "已挂载 {{count}} 个"
+ "parametersDescription": "知识库检索参数设置"
},
"permission": {
"title": "权限",
@@ -611,10 +590,7 @@
},
"team-sidebar": {
"membersHeading": "成员",
- "noMembers": "还没有成员——让队长用 AgentCreate 添加一个。",
- "running": "运行中",
- "idle": "空闲",
- "missingSession": "(无会话)"
+ "noMembers": "还没有成员——让队长用 AgentCreate 添加一个。"
},
"mcp": {
"subtitle": "浏览并安装 MCP 服务",
@@ -669,5 +645,9 @@
"loadFailedTitle": "无法连接服务",
"loadFailedDescription": "请检查服务地址,以及服务是否已启动。",
"retry": "重试"
+ },
+ "agent-menu": {
+ "settings": "设置",
+ "delete": "删除 Agent"
}
}
diff --git a/examples/web_ui/frontend/src/index.css b/examples/web_ui/frontend/src/index.css
index 32cf15e63..95f97395b 100644
--- a/examples/web_ui/frontend/src/index.css
+++ b/examples/web_ui/frontend/src/index.css
@@ -2,6 +2,7 @@
@import 'tw-animate-css';
@import 'shadcn/tailwind.css';
@import '@fontsource-variable/geist';
+@import '@fontsource-variable/geist-mono';
@source '../node_modules/streamdown/dist/*.js';
@source '../node_modules/@streamdown/*/dist/*.js';
@@ -14,26 +15,31 @@ body,
width: 100%;
}
+svg.lucide {
+ stroke-width: 1.7;
+}
+
@custom-variant dark (&:is(.dark *));
:root {
- --text: #6b6375;
- --text-h: #08060d;
- --bg: #fff;
+ /* --text: #6b6375; */
+ /* --text-h: #08060d; */
+ /* --bg: #fff; */
+ --text: #6b6f76;
+ --text-h: #18191c;
+ --bg: #f4f5f6;
--border: oklch(0.922 0 0);
+ /* --border: rgba(24, 25, 28, 0.06); */
--code-bg: #f4f3ec;
- --accent: oklch(0.97 0 0);
+ /* --accent: oklch(0.97 0 0); */
+ --accent: rgba(24, 25, 28, 0.05);
--accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5);
--shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
- --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
- --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
- --mono: ui-monospace, Consolas, monospace;
-
/*font: 18px/145% var(--sans);*/
- letter-spacing: 0.18px;
+ /* letter-spacing: 0.18px; */
color-scheme: light dark;
color: var(--text);
background: var(--bg);
@@ -46,9 +52,10 @@ body,
font-size: 16px;
}
- --background: oklch(1 0 0);
+ /* --foreground: oklch(0.145 0 0); */
- --foreground: oklch(0.145 0 0);
+ --background: oklch(1 0 0);
+ --foreground: #18191c;
--card: oklch(1 0 0);
@@ -58,25 +65,31 @@ body,
--popover-foreground: oklch(0.145 0 0);
- --primary: oklch(0.205 0 0);
+ /* --primary: oklch(0.205 0 0); */
+ --primary: #18191c;
--primary-foreground: oklch(0.985 0 0);
- --secondary: oklch(0.97 0 0);
+ /* --secondary: oklch(0.97 0 0); */
+ --secondary: #f7f8f9;
--secondary-foreground: oklch(0.205 0 0);
- --muted: oklch(0.97 0 0);
+ /* --muted: oklch(0.97 0 0); */
+ --muted: #f7f8f9;
- --muted-foreground: oklch(0.556 0 0);
+ /* --muted-foreground: oklch(0.556 0 0); */
+ --muted-foreground: #6b6f76;
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--input: oklch(0.922 0 0);
+ /* --input: rgba(24, 25, 28, 0.06); */
- --ring: oklch(0.708 0 0);
+ /* --ring: oklch(0.708 0 0); */
+ --ring: rgba(24, 25, 28, 0.22);
--chart-1: oklch(0.87 0 0);
@@ -88,9 +101,11 @@ body,
--chart-5: oklch(0.269 0 0);
- --radius: 0.625rem;
+ /* --radius: 0.625rem; */
+ --radius: 1rem;
- --sidebar: oklch(0.985 0 0);
+ /* --sidebar: oklch(0.985 0 0); */
+ --sidebar: rgba(255, 255, 255, 0.62);
--sidebar-foreground: oklch(0.145 0 0);
@@ -98,11 +113,13 @@ body,
--sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.97 0 0);
+ /* --sidebar-accent: oklch(0.97 0 0); */
+ --sidebar-accent: rgba(24, 25, 28, 0.055);
--sidebar-accent-foreground: oklch(0.205 0 0);
- --sidebar-border: oklch(0.922 0 0);
+ /* --sidebar-border: oklch(0.922 0 0); */
+ --sidebar-border: transparent;
--sidebar-ring: oklch(0.708 0 0);
}
@@ -129,6 +146,16 @@ body,
@theme inline {
--font-heading: var(--font-sans);
--font-sans: 'Geist Variable', sans-serif;
+ --font-mono: 'Geist Mono Variable', ui-monospace, monospace;
+ --color-canvas: var(--bg); /* → bg-canvas (app base; panels float on it) */
+ /* Menu-item inset, tied to the corner radius: a rounder item eats more
+ horizontal room at the text's edge, so the padding has to grow with it. */
+ --spacing-menu-item: calc(var(--radius) * 0.625);
+ --color-text-secondary: #41454b; /* → text-text-secondary */
+ --color-text-tertiary: #a7abb2; /* → text-text-tertiary */
+ --color-text-data: #8e939a; /* → text-text-data */
+ --color-surface-muted: #f1f2f4; /* → bg-surface-muted (inline badges) */
+ --color-row-hover: rgba(24, 25, 28, 0.02); /* → hover:bg-row-hover */
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -167,6 +194,8 @@ body,
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
+ --shadow-panel: 0 1px 2px rgba(24, 25, 28, 0.05), 0 18px 40px -30px rgba(24, 25, 28, 0.28);
+ --shadow-tab: 0 1px 2px rgba(24, 25, 28, 0.07); /* → shadow-tab (active tab) */
}
.dark {
@@ -208,7 +237,7 @@ body,
@apply border-border outline-ring/50;
}
body {
- @apply bg-background text-foreground;
+ @apply bg-canvas text-foreground;
}
html {
@apply font-sans;
diff --git a/examples/web_ui/frontend/src/pages/chat/ChatViewport.tsx b/examples/web_ui/frontend/src/pages/chat/ChatViewport.tsx
index f8f071628..175348230 100644
--- a/examples/web_ui/frontend/src/pages/chat/ChatViewport.tsx
+++ b/examples/web_ui/frontend/src/pages/chat/ChatViewport.tsx
@@ -65,6 +65,41 @@ interface ChatViewportProps {
/** Maximum number of panels stacked in a single dock column. */
const MAX_PANELS_PER_COLUMN = 2;
+/** localStorage key holding the dock layout across page navigations. */
+const PANEL_LAYOUT_KEY = 'chat_panel_layout';
+
+// Typed as a full Record so adding a PanelKey without listing it here
+// is a compile error rather than a silently unrestorable panel.
+const KNOWN_PANELS: Record<PanelKey, true> = {
+ plan: true,
+ mcp: true,
+ skill: true,
+ permission: true,
+ knowledge: true,
+};
+
+/**
+ * Restore the persisted dock layout, dropping anything that is no
+ * longer a known panel (keys get renamed/removed across releases).
+ *
+ * @returns The stored layout, or an empty one when absent or corrupt.
+ */
+function loadPanelLayout(): PanelKey[][] {
+ try {
+ const parsed: unknown = JSON.parse(localStorage.getItem(PANEL_LAYOUT_KEY) ?? '[]');
+ if (!Array.isArray(parsed)) return [];
+ return parsed
+ .map((column: unknown) =>
+ Array.isArray(column)
+ ? column.filter((key): key is PanelKey => key in KNOWN_PANELS)
+ : [],
+ )
+ .filter((column) => column.length > 0);
+ } catch {
+ return [];
+ }
+}
+
/**
* Insert a panel into the dock layout. Scans columns left to right and
* appends to the first one with spare room; if every column is full a
@@ -145,7 +180,12 @@ export function ChatViewport({ agentId, sessionId, onTeamUpdated }: ChatViewport
const [permissionContext, setPermissionContext] = useState<PermissionContext | null>(null);
// Dock layout: columns laid out left→right, each holding up to 2
// panels stacked top→bottom. Open order determines placement.
- const [panelLayout, setPanelLayout] = useState<PanelKey[][]>([]);
+ // Persisted so leaving and returning to /chat keeps the same panels.
+ const [panelLayout, setPanelLayout] = useState<PanelKey[][]>(loadPanelLayout);
+
+ useEffect(() => {
+ localStorage.setItem(PANEL_LAYOUT_KEY, JSON.stringify(panelLayout));
+ }, [panelLayout]);
const handleStateUpdated = useCallback((value: Record<string, unknown>) => {
if (value.tasks_context) {
@@ -531,15 +571,20 @@ export function ChatViewport({ agentId, sessionId, onTeamUpdated }: ChatViewport
<>
<main className="flex size-full">
<ResizablePanelGroup orientation="horizontal">
- <ResizablePanel className="flex flex-1" minSize="24rem">
+ <ResizablePanel
+ className="flex flex-1 rounded-[22px] bg-card shadow-panel"
+ minSize="24rem"
+ >
<div className="flex flex-col flex-1 min-h-0 min-w-0 overflow-x-hidden p-2">
<div className="flex flex-row gap-x-2 justify-between">
- <div
- id="tour-llm-select"
- className="flex flex-row items-center gap-x-1"
- >
+ <div className="flex flex-row items-center gap-x-1">
<SidebarTrigger className="md:hidden" />
+ </div>
+ <div className="flex flex-row gap-x-1">
<LlmSelect
+ id="tour-llm-select"
+ variant="ghost"
+ className="font-mono text-muted-foreground hover:text-foreground"
value={selectedModel}
onChange={handleLlmChange}
onAddCredential={() => setCredentialOpen(true)}
@@ -554,9 +599,10 @@ export function ChatViewport({ agentId, sessionId, onTeamUpdated }: ChatViewport
selectedTTSModel={selectedTTSModel}
onTTSChange={handleTTSChange}
/>
- </div>
- <div id="tour-permission-mode" className="flex flex-row gap-x-1">
<PermissionModeSelect
+ id="tour-permission-mode"
+ variant={'ghost'}
+ className="font-mono text-muted-foreground hover:text-foreground"
value={selectedPermissionMode}
disabled={!sessionId}
onChange={handlePermissionModeChange}
@@ -701,7 +747,7 @@ export function ChatViewport({ agentId, sessionId, onTeamUpdated }: ChatViewport
</div>
</ResizablePanel>
{panelLayout.length > 0 && (
- <ResizableHandle withHandle className="bg-transparent" />
+ <ResizableHandle withHandle className="bg-transparent w-1.5" />
)}
<PanelDock layout={panelLayout} panels={panels} onClosePanel={closePanel} />
</ResizablePanelGroup>
diff --git a/examples/web_ui/frontend/src/pages/chat/index.tsx b/examples/web_ui/frontend/src/pages/chat/index.tsx
index c1c856635..d269d6149 100644
--- a/examples/web_ui/frontend/src/pages/chat/index.tsx
+++ b/examples/web_ui/frontend/src/pages/chat/index.tsx
@@ -1,3 +1,4 @@
+import { format, isToday } from 'date-fns';
import {
BotMessageSquare,
CalendarClock,
@@ -32,20 +33,17 @@ import {
EmptyHeader,
EmptyTitle,
EmptyDescription,
- EmptyContent,
EmptyMedia,
} from '@/components/ui/empty';
import {
Sidebar,
SidebarContent,
- SidebarFooter,
SidebarGroup,
- SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
- SidebarHeader,
SidebarMenu,
SidebarMenuAction,
+ SidebarMenuBadge,
SidebarMenuButton,
SidebarMenuItem,
SidebarProvider,
@@ -193,8 +191,11 @@ const ChatPageInner = () => {
await updateSession(renameSession.id, { name });
};
+ const todaySessions = sessions.filter((sess) => isToday(new Date(sess.session.created_at)));
+ const earlierSessions = sessions.filter((sess) => !isToday(new Date(sess.session.created_at)));
+
return (
- <div className="flex h-full w-full">
+ <div className="flex h-full w-full p-2 gap-2">
{/*
* Desktop stays `collapsible="none"` so the session list sits in
* normal flow beside the app rail (AppSidebar). Mobile switches to
@@ -202,65 +203,76 @@ const ChatPageInner = () => {
* (the drawer we want) — instead of the desktop `fixed left-0`
* container, which would otherwise cover the app rail.
*/}
- <Sidebar collapsible={isMobile ? 'offcanvas' : 'none'} className="border-r">
- <SidebarHeader>
- <div className="flex flex-col gap-y-2">
- <span className="text-muted-foreground text-xs">
- {localStorage.getItem('server_url')}
- </span>
- <div className="flex flex-row gap-x-2 items-center">
+ <Sidebar collapsible={isMobile ? 'offcanvas' : 'none'} className="rounded-[22px]">
+ <SidebarContent className="my-2">
+ <SidebarGroup className="px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('common.agent')}
+ <AgentDialog onCreated={refetchAgents}>
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ title={t('dialog-agent-create.title')}
+ >
+ <Plus id="tour-create-agent" className="size-3.5" />
+ </Button>
+ </AgentDialog>
+ </SidebarGroupLabel>
+ <SidebarGroupContent className="flex items-center">
<AgentSelect
+ className="flex-1 min-w-0"
agents={agents}
value={urlAgentId ?? null}
onChange={(id) => navigate(`/chat/${id}`)}
- />
- <Button
- size="icon"
- variant="ghost"
- disabled={!urlAgentId || !selectedAgent?.editable}
- tooltip={
- selectedAgent && !selectedAgent.editable
- ? t('common.readOnlyTooltip')
- : undefined
- }
- onClick={() => setEditOpen(true)}
- >
- <Settings2 />
- </Button>
- <Button
- size="icon"
variant="ghost"
- disabled={!urlAgentId || !selectedAgent?.editable}
- tooltip={
- selectedAgent && !selectedAgent.editable
- ? t('common.readOnlyTooltip')
- : undefined
- }
- onClick={() => setDeleteOpen(true)}
- >
- <Trash2 className="text-destructive" />
- </Button>
- </div>
- <AgentDialog onCreated={refetchAgents} triggerId="tour-create-agent" />
- </div>
- </SidebarHeader>
- <SidebarContent className="my-5">
- <SidebarGroup>
- <SidebarGroupLabel>{t('chat.session.label')}</SidebarGroupLabel>
- <SidebarGroupAction asChild>
- <div>
- <Button
- id="tour-create-session"
- size="icon-xs"
- variant="default"
- disabled={!urlAgentId}
- onClick={handleCreateSession}
- >
- <Plus />
- </Button>
- </div>
- </SidebarGroupAction>
+ size="default"
+ />
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ className="shrink-0 text-muted-foreground"
+ variant="ghost"
+ size="icon"
+ disabled={!urlAgentId || !selectedAgent?.editable}
+ >
+ <Ellipsis />
+ </Button>
+ </DropdownMenuTrigger>
+ {/* w-auto: the default pins the menu to the
+ trigger's width, which is a 32px icon button. */}
+ <DropdownMenuContent className="w-auto">
+ <DropdownMenuItem onClick={() => setEditOpen(true)}>
+ <Settings2 />
+ {t('agent-menu.settings')}
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ onClick={() => setDeleteOpen(true)}
+ variant="destructive"
+ >
+ <Trash2 />
+ {t('agent-menu.delete')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ <SidebarGroup className="mt-5 px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('chat.session.label')}
+ <span className="text-[10px] text-text-data font-mono">
+ {sessions.length}
+ </span>
+ </SidebarGroupLabel>
<SidebarGroupContent>
+ <SidebarGroup>
+ <SidebarMenu className="mb-2">
+ <Button id="tour-create-session" onClick={handleCreateSession}>
+ <Plus />
+ {t('chat.newSession')}
+ </Button>
+ </SidebarMenu>
+ </SidebarGroup>
+
{sessions.length === 0 ? (
<Empty className="border-none py-4 min-h-50">
<EmptyHeader>
@@ -274,81 +286,186 @@ const ChatPageInner = () => {
: t('chat.session.emptyNoAgent')}
</EmptyDescription>
</EmptyHeader>
- <EmptyContent>
- <Button
- variant="outline"
- size="sm"
- disabled={!urlAgentId}
- onClick={handleCreateSession}
- >
- Create Session
- </Button>
- </EmptyContent>
</Empty>
) : (
- <SidebarMenu>
- {sessions.map((view) => {
- const session = view.session;
- return (
- <SidebarMenuItem key={session.id}>
- <SidebarMenuButton
- isActive={urlSessionId === session.id}
- onClick={() => {
- navigate(
- `/chat/${urlAgentId}/${session.id}`,
- );
- setOpenMobile(false);
- }}
- >
- {hasScheduleSessions &&
- (session.source === 'schedule' ? (
- <CalendarClock />
- ) : (
- <BotMessageSquare />
- ))}
- <span className="truncate">
- {session.config.name || session.id}
- </span>
- </SidebarMenuButton>
- <SidebarMenuAction showOnHover>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Ellipsis />
- </DropdownMenuTrigger>
- <DropdownMenuContent
- side="right"
- align="start"
- >
- <DropdownMenuItem
+ <>
+ <SidebarGroup>
+ <SidebarGroupLabel>
+ {t('chat.session.today')}
+ </SidebarGroupLabel>
+ <SidebarGroupContent>
+ <SidebarMenu>
+ {todaySessions.map((view) => {
+ const session = view.session;
+ return (
+ <SidebarMenuItem key={session.id}>
+ {/* Wider right gutter than the stock
+ pr-8: the badge holds a mono timestamp. */}
+ <SidebarMenuButton
+ className="text-muted-foreground hover:text-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-16"
+ isActive={
+ urlSessionId === session.id
+ }
onClick={() => {
- setRenameSession(session);
- setRenameOpen(true);
+ navigate(
+ `/chat/${urlAgentId}/${session.id}`,
+ );
+ setOpenMobile(false);
}}
>
- <Pencil />
- {t('session-menu.rename')}
- </DropdownMenuItem>
- <DropdownMenuItem
- variant="destructive"
- onClick={() =>
- requestDeleteSession(session)
+ {hasScheduleSessions &&
+ (session.source ===
+ 'schedule' ? (
+ <CalendarClock />
+ ) : (
+ <BotMessageSquare />
+ ))}
+ <span className="truncate">
+ {session.config.name ||
+ session.id}
+ </span>
+ </SidebarMenuButton>
+ {/* Badge and action are mutually exclusive.
+ Keyboard focus reveals the action, plain
+ focus-within does not — otherwise clicking
+ the row would pin it open. */}
+ <SidebarMenuBadge className="max-md:hidden group-hover/menu-item:hidden group-has-focus-visible/menu-item:hidden group-has-data-[state=open]/menu-item:hidden text-text-tertiary! font-mono">
+ {format(
+ new Date(
+ view.session.created_at,
+ ),
+ 'HH:mm',
+ )}
+ </SidebarMenuBadge>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <SidebarMenuAction className="md:opacity-0 group-hover/menu-item:opacity-100 group-has-focus-visible/menu-item:opacity-100 aria-expanded:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground">
+ <Ellipsis />
+ </SidebarMenuAction>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent
+ className="w-auto"
+ side="right"
+ align="start"
+ >
+ <DropdownMenuItem
+ onClick={() => {
+ setRenameSession(
+ session,
+ );
+ setRenameOpen(true);
+ }}
+ >
+ <Pencil />
+ {t('session-menu.rename')}
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={() =>
+ requestDeleteSession(
+ session,
+ )
+ }
+ >
+ <Trash2 />
+ {t('session-menu.delete')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ <SidebarGroup>
+ <SidebarGroupLabel>
+ {t('chat.session.earlier')}
+ </SidebarGroupLabel>
+ <SidebarGroupContent>
+ <SidebarMenu>
+ {earlierSessions.map((view) => {
+ const session = view.session;
+ return (
+ <SidebarMenuItem key={session.id}>
+ <SidebarMenuButton
+ className="group-has-data-[sidebar=menu-action]/menu-item:pr-16"
+ isActive={
+ urlSessionId === session.id
}
+ onClick={() => {
+ navigate(
+ `/chat/${urlAgentId}/${session.id}`,
+ );
+ setOpenMobile(false);
+ }}
>
- <Trash2 />
- {t('session-menu.delete')}
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </SidebarMenuAction>
- </SidebarMenuItem>
- );
- })}
- </SidebarMenu>
+ {hasScheduleSessions &&
+ (session.source ===
+ 'schedule' ? (
+ <CalendarClock />
+ ) : (
+ <BotMessageSquare />
+ ))}
+ <span className="truncate">
+ {session.config.name ||
+ session.id}
+ </span>
+ </SidebarMenuButton>
+ <SidebarMenuBadge className="max-md:hidden group-hover/menu-item:hidden group-has-focus-visible/menu-item:hidden group-has-data-[state=open]/menu-item:hidden text-text-tertiary! font-mono">
+ {format(
+ new Date(
+ view.session.created_at,
+ ),
+ 'MMM dd',
+ )}
+ </SidebarMenuBadge>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <SidebarMenuAction className="md:opacity-0 group-hover/menu-item:opacity-100 group-has-focus-visible/menu-item:opacity-100 aria-expanded:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground">
+ <Ellipsis />
+ </SidebarMenuAction>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent
+ className="w-auto"
+ side="right"
+ align="start"
+ >
+ <DropdownMenuItem
+ onClick={() => {
+ setRenameSession(
+ session,
+ );
+ setRenameOpen(true);
+ }}
+ >
+ <Pencil />
+ {t('session-menu.rename')}
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={() =>
+ requestDeleteSession(
+ session,
+ )
+ }
+ >
+ <Trash2 />
+ {t('session-menu.delete')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ </>
)}
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
- <SidebarFooter />
</Sidebar>
{/*
* Team sidebar lives at the outer page level (not inside
diff --git a/examples/web_ui/frontend/src/pages/credential/index.tsx b/examples/web_ui/frontend/src/pages/credential/index.tsx
index 96c66e77c..0dcfe8038 100644
--- a/examples/web_ui/frontend/src/pages/credential/index.tsx
+++ b/examples/web_ui/frontend/src/pages/credential/index.tsx
@@ -1,15 +1,19 @@
-import { Eye, EyeOff, Plus, Pencil, Trash2 } from 'lucide-react';
+import { Eye, EyeOff, Plus, Trash2, Pen } from 'lucide-react';
import { useState, useEffect, useCallback } from 'react';
-import { credentialApi, modelApi, ttsModelApi } from '@/api';
-import type { CredentialView, CredentialSchema, ModelCard, TTSModelCard } from '@/api';
-import { InputTypeBadges } from '@/components/badge/InputTypeBadges';
+import { credentialApi, embeddingModelApi, modelApi, ttsModelApi } from '@/api';
+import type {
+ CredentialView,
+ CredentialSchema,
+ EmbeddingModelCard,
+ ModelCard,
+ TTSModelCard,
+} from '@/api';
import { CreateCredentialDialog } from '@/components/dialog/CreateCredentialDialog';
import { DeleteDialog } from '@/components/dialog/DeleteDialog';
import { EditCredentialDialog } from '@/components/dialog/EditCredentialDialog';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
-import { Card, CardAction, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from '@/components/ui/empty';
import { Separator } from '@/components/ui/separator';
import {
@@ -24,10 +28,26 @@ import {
SidebarMenuItem,
} from '@/components/ui/sidebar';
import { Skeleton } from '@/components/ui/skeleton';
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/ui/table';
+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { useCredentials } from '@/hooks/useCredentials';
import { useTranslation } from '@/i18n/useI18n';
+import { cn } from '@/lib/utils';
import { formatNumber } from '@/utils/common.ts';
+/** Which model list the detail panel is showing. */
+type ModelTab = 'llm' | 'tts' | 'embedding';
+
+/** A row in the model table — one of the three card shapes. */
+type ModelRow = ModelCard | TTSModelCard | EmbeddingModelCard;
+
// ─── Masked value ─────────────────────────────────────────────────────────────
function MaskedValue({ value }: { value: string }) {
@@ -36,116 +56,179 @@ function MaskedValue({ value }: { value: string }) {
return (
<span className="flex items-center gap-x-1.5 font-mono text-sm">
{visible ? value : masked}
- <Button size={'icon-sm'} variant={'ghost'} onClick={() => setVisible((v) => !v)}>
+ <Button
+ size={'icon-sm'}
+ className="text-text-tertiary hover:text-foreground"
+ variant={'ghost'}
+ onClick={() => setVisible((v) => !v)}
+ >
{visible ? <EyeOff /> : <Eye />}
</Button>
</span>
);
}
-// ─── Model Card ───────────────────────────────────────────────────────────────
-
-function ModelCardItem({ model }: { model: ModelCard }) {
- const { t } = useTranslation();
- const ctx = model.context_size ? formatNumber(model.context_size) : null;
-
- const output = model.output_size ? formatNumber(model.output_size) : null;
-
- const statusVariant =
- model.status === 'active'
- ? 'default'
- : model.status === 'deprecated'
- ? 'secondary'
- : 'outline';
+// ─── Model table ──────────────────────────────────────────────────────────────
+
+/** MIME main-types that stand on their own in the ACCEPTS / OUTPUTS cells. */
+const MODALITIES = new Set(['text', 'image', 'video', 'audio']);
+
+/** Marks a model as reasoning-capable; not a real input modality. */
+const THINKING_TYPE = 'application/x-thinking';
+
+/** Dense-vector output of an embedding model. */
+const EMBEDDING_TYPE = 'application/x-embedding';
+
+/**
+ * Collapse a model's MIME list into short modality labels. Anything
+ * outside the four media types (PDFs, office documents, …) folds into a
+ * single `file` entry so the cell stays one line.
+ *
+ * @param types - MIME types straight off the model card.
+ * @returns De-duplicated labels in encounter order.
+ */
+function modalities(types: string[]): string[] {
+ const out = new Set<string>();
+ for (const type of types) {
+ if (type === THINKING_TYPE) continue;
+ if (type === EMBEDDING_TYPE) {
+ out.add('vector');
+ continue;
+ }
+ const main = type.split('/')[0];
+ out.add(MODALITIES.has(main) ? main : 'file');
+ }
+ return [...out];
+}
- const reasoning = model.input_types.includes('application/x-thinking');
+/** Inline pill sitting next to a model name (reasoning, realtime, status). */
+function ModelTag({ children }: { children: React.ReactNode }) {
+ return (
+ <span className="rounded bg-surface-muted px-1.75 py-0.5 font-mono text-[9px] tracking-[0.06em] uppercase text-text-secondary">
+ {children}
+ </span>
+ );
+}
+function HeadCell({ children }: { children: React.ReactNode }) {
return (
- <Card className="shadow">
- <CardHeader>
- <CardTitle
- className="text-sm font-semibold leading-tight truncate"
- title={model.name}
- >
- {model.label || model.name}
- </CardTitle>
- {reasoning ? (
- <CardAction>
- <Badge variant={'outline'}>{t('credential.reasoning')}</Badge>
- </CardAction>
- ) : null}
- </CardHeader>
- <CardContent className="flex flex-col">
- {model.status !== 'active' && (
- <Badge variant={statusVariant} className="text-xs">
- {model.status}
- </Badge>
- )}
+ <TableHead className="h-auto bg-muted px-4 py-2.25 font-mono text-[9.5px] font-normal tracking-widest uppercase text-text-tertiary">
+ {children}
+ </TableHead>
+ );
+}
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.maxContext')}</span>
- <span>{ctx}</span>
- </div>
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.maxOutput')}</span>
- <span>{output}</span>
- </div>
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.inputTypes')}</span>
- <InputTypeBadges inputTypes={model.input_types} />
- </div>
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.outputTypes')}</span>
- <InputTypeBadges inputTypes={model.output_types} />
- </div>
- </CardContent>
- </Card>
+/** Numeric / modality cell — mono, one step darker than the head row. */
+function DataCell({ children, size }: { children: React.ReactNode; size: '11' | '11.5' }) {
+ return (
+ <TableCell
+ className={cn(
+ 'px-4 py-2.5 font-mono text-text-secondary',
+ size === '11' ? 'text-[11px]' : 'text-[11.5px]',
+ )}
+ >
+ {children}
+ </TableCell>
);
}
-// ─── TTS Model Card ──────────────────────────────────────────────────────────
+interface ModelTableProps {
+ /** Rows to render; the shape must match `variant`. */
+ models: ModelRow[];
+ /** Drives which numeric columns sit between MODEL and ACCEPTS. */
+ variant: ModelTab;
+}
-function TTSModelCardItem({ model }: { model: TTSModelCard }) {
+/**
+ * The model list as a table: one row per model, sizes and modalities in
+ * their own columns rather than repeated label/value pairs per card.
+ *
+ * @param models - Rows to render.
+ * @param variant - Which column set applies.
+ * @returns The bordered table plus its legend.
+ */
+function ModelTable({ models, variant }: ModelTableProps) {
const { t } = useTranslation();
-
- const statusVariant =
- model.status === 'active'
- ? 'default'
- : model.status === 'deprecated'
- ? 'secondary'
- : 'outline';
+ const isChat = variant === 'llm';
+ const isEmbedding = variant === 'embedding';
return (
- <Card className="shadow">
- <CardHeader>
- <CardTitle
- className="text-sm font-semibold leading-tight truncate"
- title={model.name}
- >
- {model.label || model.name}
- </CardTitle>
- {model.realtime && (
- <CardAction>
- <Badge variant="outline">Realtime</Badge>
- </CardAction>
- )}
- </CardHeader>
- <CardContent className="flex flex-col">
- {model.status !== 'active' && (
- <Badge variant={statusVariant} className="text-xs">
- {model.status}
- </Badge>
- )}
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.inputTypes')}</span>
- <InputTypeBadges inputTypes={model.input_types} />
- </div>
- <div className="flex justify-between items-center text-[14px]">
- <span className="text-muted-foreground">{t('credential.outputTypes')}</span>
- <InputTypeBadges inputTypes={model.output_types} />
- </div>
- </CardContent>
- </Card>
+ <div>
+ <div className="overflow-x-auto rounded-[16px] border border-border">
+ <Table className="min-w-[500px]">
+ <TableHeader>
+ <TableRow className="border-border hover:bg-transparent">
+ <HeadCell>{t('credential.table.model')}</HeadCell>
+ {(isChat || isEmbedding) && (
+ <HeadCell>{t('credential.table.context')}</HeadCell>
+ )}
+ {isChat && <HeadCell>{t('credential.table.maxOutput')}</HeadCell>}
+ {isEmbedding && <HeadCell>{t('credential.table.dimensions')}</HeadCell>}
+ <HeadCell>{t('credential.table.accepts')}</HeadCell>
+ <HeadCell>{t('credential.table.outputs')}</HeadCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {models.map((model) => {
+ const chat = isChat ? (model as ModelCard) : null;
+ const embed = isEmbedding ? (model as EmbeddingModelCard) : null;
+ const tts = variant === 'tts' ? (model as TTSModelCard) : null;
+ const context = chat?.context_size ?? embed?.context_size;
+ return (
+ <TableRow
+ key={model.name}
+ className="border-border hover:bg-row-hover"
+ >
+ <TableCell className="px-4 py-2.5 text-[12.5px] text-foreground">
+ <span className="flex items-center gap-x-2">
+ <span
+ className="min-w-0 flex-1 truncate"
+ title={model.name}
+ >
+ {model.label || model.name}
+ </span>
+ {model.input_types.includes(THINKING_TYPE) && (
+ <ModelTag>{t('credential.reasoning')}</ModelTag>
+ )}
+ {tts?.realtime && (
+ <ModelTag>{t('credential.realtime')}</ModelTag>
+ )}
+ {model.status !== 'active' && (
+ <ModelTag>{model.status}</ModelTag>
+ )}
+ </span>
+ </TableCell>
+ {(isChat || isEmbedding) && (
+ <DataCell size="11.5">
+ {context ? formatNumber(context) : '—'}
+ </DataCell>
+ )}
+ {isChat && (
+ <DataCell size="11.5">
+ {chat?.output_size
+ ? formatNumber(chat.output_size)
+ : '—'}
+ </DataCell>
+ )}
+ {isEmbedding && (
+ <DataCell size="11.5">{embed?.dimensions ?? '—'}</DataCell>
+ )}
+ <DataCell size="11">
+ {modalities(model.input_types).join(' · ') || '—'}
+ </DataCell>
+ <DataCell size="11">
+ {modalities(model.output_types).join(' · ') || '—'}
+ </DataCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ </div>
+ <p className="mt-2.5 text-[11px] text-muted-foreground">
+ {t('credential.table.legend')}
+ </p>
+ </div>
);
}
@@ -162,9 +245,17 @@ function DetailPanel({ credential, schema, onEdit, onDelete }: DetailPanelProps)
const { t } = useTranslation();
const [models, setModels] = useState<ModelCard[]>([]);
const [ttsModels, setTtsModels] = useState<TTSModelCard[]>([]);
+ const [embeddingModels, setEmbeddingModels] = useState<EmbeddingModelCard[]>([]);
const [modelsLoading, setModelsLoading] = useState(false);
+ const [tab, setTab] = useState<ModelTab>('llm');
const type = credential.data.type as string | undefined;
+ const shown = tab === 'llm' ? models : tab === 'tts' ? ttsModels : embeddingModels;
+ const total = models.length + ttsModels.length + embeddingModels.length;
+
+ // A credential switch can land on a provider with no TTS models at
+ // all, which would leave the tab pointing at an empty list.
+ useEffect(() => setTab('llm'), [credential.id]);
useEffect(() => {
if (!type) return;
@@ -178,10 +269,15 @@ function DetailPanel({ credential, schema, onEdit, onDelete }: DetailPanelProps)
.list(type)
.then((res) => res.models)
.catch(() => [] as TTSModelCard[]),
+ embeddingModelApi
+ .list(type)
+ .then((res) => res.models)
+ .catch(() => [] as EmbeddingModelCard[]),
])
- .then(([chatModels, tts]) => {
+ .then(([chatModels, tts, embeddings]) => {
setModels(chatModels);
setTtsModels(tts);
+ setEmbeddingModels(embeddings);
})
.finally(() => setModelsLoading(false));
}, [credential.id, type]);
@@ -204,12 +300,14 @@ function DetailPanel({ credential, schema, onEdit, onDelete }: DetailPanelProps)
const name = (credential.data.name as string | undefined) ?? credential.id;
return (
- <div className="flex flex-col gap-y-6 p-6 overflow-y-auto h-full">
+ <div className="flex h-full flex-col">
{/* Header */}
- <div className="flex items-start justify-between gap-x-4">
+ <div className="shrink-0 flex items-start justify-between gap-x-4 p-[18px_18px_16px]">
<div className="flex flex-col gap-y-1">
- <h2 className="text-lg font-semibold">{name}</h2>
- <p className="text-muted-foreground text-sm">{type}</p>
+ <span className="text-foreground text-lg font-medium tracking-[-0.015em]">
+ {name}
+ </span>
+ <span className="font-mono text-text-data text-sm">{type}</span>
{!credential.editable && (
<Badge variant="secondary" title={t('common.readOnlyTooltip')}>
{t('common.readOnly')}
@@ -219,16 +317,18 @@ function DetailPanel({ credential, schema, onEdit, onDelete }: DetailPanelProps)
<div className="flex items-center gap-x-2 shrink-0">
<Button
size="icon-sm"
- variant="outline"
+ variant="ghost"
+ className="text-text-tertiary hover:text-foreground"
onClick={onEdit}
disabled={!credential.editable}
tooltip={credential.editable ? undefined : t('common.readOnlyTooltip')}
>
- <Pencil />
+ <Pen />
</Button>
<Button
size="icon-sm"
- variant="destructive"
+ variant="ghost"
+ className="text-text-tertiary hover:bg-destructive/8 hover:text-destructive"
onClick={onDelete}
disabled={!credential.editable}
tooltip={credential.editable ? undefined : t('common.readOnlyTooltip')}
@@ -238,81 +338,119 @@ function DetailPanel({ credential, schema, onEdit, onDelete }: DetailPanelProps)
</div>
</div>
- {/* Fields */}
- <div className="flex flex-col gap-y-3">
- {displayFields.map(([key, prop]) => {
- const schemaProp = prop as {
- title?: string;
- writeOnly?: boolean;
- format?: string;
- };
- const label = schemaProp.title ?? key.replace(/_/g, ' ');
- const isSecret = schemaProp.writeOnly || schemaProp.format === 'password';
- const val = credential.data[key];
- if (val === undefined || val === null) return null;
- const strVal = String(val);
- return (
- <div key={key} className="flex flex-col gap-y-0.5">
- <span className="text-muted-foreground text-xs uppercase tracking-wide">
- {label}
- </span>
- {isSecret ? (
- <MaskedValue value={strVal} />
- ) : (
- <span className="text-sm font-mono break-all">{strVal}</span>
- )}
- </div>
- );
- })}
- </div>
+ <Separator className="shrink-0" />
+
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ {/* Fields */}
+ <div className="flex flex-col gap-y-3 p-[20px_18px_0]">
+ {displayFields.map(([key, prop]) => {
+ const schemaProp = prop as {
+ title?: string;
+ writeOnly?: boolean;
+ format?: string;
+ };
+ const label = schemaProp.title ?? key.replace(/_/g, ' ');
+ const isSecret = schemaProp.writeOnly || schemaProp.format === 'password';
+ const val = credential.data[key];
+ if (val === undefined || val === null) return null;
+ const strVal = String(val);
+ return (
+ <div
+ key={key}
+ className="grid grid-cols-[104px_1fr] gap-x-4.5 gap-y-3 items-baseline font-mono"
+ >
+ <span className="text-[10px] text-text-tertiary tracking-[0.12em] uppercase">
+ {label}
+ </span>
+ {isSecret ? (
+ <MaskedValue value={strVal} />
+ ) : (
+ <span className="text-sm text-foreground break-all">
+ {strVal}
+ </span>
+ )}
+ </div>
+ );
+ })}
+ </div>
- <Separator />
-
- {/* Available Models */}
- <div className="flex flex-col gap-y-4">
- <h3 className="text-sm font-semibold">
- {t('credential.availableModels')}({models.length})
- </h3>
- {modelsLoading ? (
- <div className="grid grid-cols-2 xl:grid-cols-3 gap-3">
- {Array.from({ length: 4 }).map((_, i) => (
- <Skeleton key={i} className="h-20 rounded-lg" />
- ))}
- </div>
- ) : models.length === 0 ? (
- <Empty className="border-none py-6">
- <EmptyHeader>
- <EmptyTitle>{t('credential.noModels')}</EmptyTitle>
- <EmptyDescription>
- {t('credential.noModelsDescription')}
- </EmptyDescription>
- </EmptyHeader>
- </Empty>
- ) : (
- <div className="grid grid-cols-2 xl:grid-cols-3 gap-3">
- {models.map((m) => (
- <ModelCardItem key={m.name} model={m} />
- ))}
+ {/* Available Models */}
+ <Tabs
+ value={tab}
+ onValueChange={(v) => setTab(v as ModelTab)}
+ className="gap-0 px-[18px] pb-6"
+ >
+ <div className="mt-[30px] mb-3 flex items-center justify-between">
+ <span className="flex items-center gap-x-2 text-[13.5px] font-medium text-foreground">
+ {t('credential.availableModels')}
+ <span className="font-mono text-[11px] text-text-data">{total}</span>
+ </span>
+ {/* Only worth a switch when there is a second list to switch to. */}
+ {(ttsModels.length > 0 || embeddingModels.length > 0) && (
+ <TabsList className="bg-surface-muted">
+ {/* Only the shadow is overridden here; the stock one
+ is shadow-sm. */}
+ <TabsTrigger
+ value="llm"
+ className="px-2.5 text-[11.5px] text-muted-foreground group-data-[variant=default]/tabs-list:data-active:shadow-tab!"
+ >
+ {t('common.llm')}
+ <span className="font-mono text-[10px] text-text-data">
+ {models.length}
+ </span>
+ </TabsTrigger>
+ {ttsModels.length > 0 && (
+ <TabsTrigger
+ value="tts"
+ className="px-2.5 text-[11.5px] text-muted-foreground group-data-[variant=default]/tabs-list:data-active:shadow-tab!"
+ >
+ {t('common.tts')}
+ <span className="font-mono text-[10px] text-text-data">
+ {ttsModels.length}
+ </span>
+ </TabsTrigger>
+ )}
+ {embeddingModels.length > 0 && (
+ <TabsTrigger
+ value="embedding"
+ className="px-2.5 text-[11.5px] text-muted-foreground group-data-[variant=default]/tabs-list:data-active:shadow-tab!"
+ >
+ {t('common.embedding')}
+ <span className="font-mono text-[10px] text-text-data">
+ {embeddingModels.length}
+ </span>
+ </TabsTrigger>
+ )}
+ </TabsList>
+ )}
</div>
- )}
- </div>
- {/* Available TTS Models */}
- {ttsModels.length > 0 && (
- <>
- <Separator />
- <div className="flex flex-col gap-y-4">
- <h3 className="text-sm font-semibold">
- {t('credential.availableTTSModels')}({ttsModels.length})
- </h3>
- <div className="grid grid-cols-2 xl:grid-cols-3 gap-3">
- {ttsModels.map((m) => (
- <TTSModelCardItem key={m.name} model={m} />
- ))}
- </div>
- </div>
- </>
- )}
+ {modelsLoading ? (
+ <Skeleton className="h-40 rounded-[16px]" />
+ ) : shown.length === 0 ? (
+ <Empty className="border-none py-6">
+ <EmptyHeader>
+ <EmptyTitle>{t('credential.noModels')}</EmptyTitle>
+ <EmptyDescription>
+ {t('credential.noModelsDescription')}
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ ) : (
+ <>
+ <TabsContent value="llm">
+ <ModelTable models={models} variant="llm" />
+ </TabsContent>
+ <TabsContent value="tts">
+ <ModelTable models={ttsModels} variant="tts" />
+ </TabsContent>
+ <TabsContent value="embedding">
+ <ModelTable models={embeddingModels} variant="embedding" />
+ </TabsContent>
+ </>
+ )}
+ </Tabs>
+ </div>
</div>
);
}
@@ -377,12 +515,14 @@ export const CredentialPage = () => {
}, [selectedCredential, remove]);
return (
- <div className="flex h-full w-full">
+ <div className="flex h-full w-full p-2 gap-2">
{/* Left sidebar */}
- <Sidebar collapsible="none" className="border-r">
- <SidebarHeader className={'flex flex-col mt-5 gap-y-1'}>
- <div className="text-lg font-semibold">{t('common.credential')}</div>
- <div className="text-muted-foreground text-xs">{t('credential.subtitle')}</div>
+ <Sidebar collapsible="none" className="rounded-[22px]">
+ <SidebarHeader className={'flex flex-col p-[20px_18px_14px] gap-y-1'}>
+ <div className="text-xl font-medium tracking-[-0.02em] text-foreground">
+ {t('common.credential')}
+ </div>
+ <div className="text-text-tertiary text-xs">{t('credential.subtitle')}</div>
</SidebarHeader>
{/*<Separator />*/}
<SidebarContent>
@@ -402,49 +542,57 @@ export const CredentialPage = () => {
<>
{/* Configured credentials lead — this is what the user actually set up. */}
{configuredGroups.length > 0 && (
- <SidebarGroup>
- <SidebarGroupLabel>
- {t('credential.configured')} ({totalConfigured})
+ <SidebarGroup className="mt-6 px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('credential.configured')}
+ <span className="text-[10px] text-text-data font-mono">
+ {totalConfigured}
+ </span>
</SidebarGroupLabel>
- <SidebarGroupContent className="flex flex-col gap-y-4">
+ <SidebarGroupContent>
{configuredGroups.map(({ type, title, records }) => (
- <div key={type}>
- <div className="px-2 pb-1.5 text-xs font-semibold text-foreground/70">
- {title}
- </div>
- <SidebarMenu className="pl-4">
- {records.map((rec) => {
- const name =
- (rec.data.name as string | undefined) ??
- rec.id;
- return (
- <SidebarMenuItem key={rec.id}>
- <SidebarMenuButton
- isActive={selectedId === rec.id}
- onClick={() =>
- setSelectedId(rec.id)
- }
- >
- <span className="min-w-0 flex-1 truncate">
- {name}
- </span>
- {!rec.editable && (
- <Badge
- variant="secondary"
- className="text-[10px] px-1 py-0"
- title={t(
- 'common.readOnlyTooltip',
- )}
- >
- {t('common.readOnly')}
- </Badge>
- )}
- </SidebarMenuButton>
- </SidebarMenuItem>
- );
- })}
- </SidebarMenu>
- </div>
+ <SidebarGroup key={type} className="mt-3 px-0 py-0">
+ <SidebarGroupLabel>{title}</SidebarGroupLabel>
+ <SidebarGroupContent>
+ <SidebarMenu>
+ {records.map((rec) => {
+ const name =
+ (rec.data.name as
+ | string
+ | undefined) ?? rec.id;
+ return (
+ <SidebarMenuItem key={rec.id}>
+ <SidebarMenuButton
+ isActive={
+ selectedId === rec.id
+ }
+ onClick={() =>
+ setSelectedId(rec.id)
+ }
+ >
+ <span className="min-w-0 flex-1 truncate">
+ {name}
+ </span>
+ {!rec.editable && (
+ <Badge
+ variant="secondary"
+ className="text-[10px] px-1 py-0"
+ title={t(
+ 'common.readOnlyTooltip',
+ )}
+ >
+ {t(
+ 'common.readOnly',
+ )}
+ </Badge>
+ )}
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
))}
</SidebarGroupContent>
</SidebarGroup>
@@ -452,7 +600,7 @@ export const CredentialPage = () => {
{/* Add credential — every provider is an entry point (including
configured ones, to add more under the same provider). */}
- <SidebarGroup>
+ <SidebarGroup className="mt-5 px-2 py-0">
<SidebarGroupLabel>{t('credential.addProvider')}</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
@@ -477,7 +625,7 @@ export const CredentialPage = () => {
</Sidebar>
{/* Right detail */}
- <main className="flex-1 min-h-0 overflow-hidden">
+ <main className="flex-1 min-h-0 overflow-hidden rounded-[22px] bg-card shadow-panel">
{selectedCredential ? (
<DetailPanel
credential={selectedCredential}
diff --git a/examples/web_ui/frontend/src/pages/knowledge/index.tsx b/examples/web_ui/frontend/src/pages/knowledge/index.tsx
index 4e6734fa1..7acace7f6 100644
--- a/examples/web_ui/frontend/src/pages/knowledge/index.tsx
+++ b/examples/web_ui/frontend/src/pages/knowledge/index.tsx
@@ -32,7 +32,6 @@ import {
SidebarContent,
SidebarFooter,
SidebarGroup,
- SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
SidebarHeader,
@@ -65,12 +64,14 @@ function DetailPanel({ knowledgeBase, onTest }: DetailPanelProps) {
}
return (
- <div className="flex flex-col gap-y-6 p-6 overflow-y-auto h-full">
+ <div className="flex h-full flex-col">
{/* Header */}
- <div className="flex items-start justify-between gap-x-4">
+ <div className="shrink-0 flex items-start justify-between gap-x-4 p-[18px_18px_16px]">
<div className="flex flex-col gap-y-1 min-w-0">
<div className="flex items-center gap-x-2">
- <h2 className="text-lg font-semibold truncate">{knowledgeBase.name}</h2>
+ <span className="truncate text-lg font-medium tracking-[-0.015em] text-foreground">
+ {knowledgeBase.name}
+ </span>
{!knowledgeBase.editable && (
<Badge variant="secondary" title={t('common.readOnlyTooltip')}>
{t('common.readOnly')}
@@ -78,7 +79,7 @@ function DetailPanel({ knowledgeBase, onTest }: DetailPanelProps) {
)}
</div>
{knowledgeBase.description ? (
- <p className="text-sm text-muted-foreground">{knowledgeBase.description}</p>
+ <p className="text-sm text-text-data">{knowledgeBase.description}</p>
) : null}
</div>
<div className="flex items-center gap-x-2 shrink-0">
@@ -89,10 +90,12 @@ function DetailPanel({ knowledgeBase, onTest }: DetailPanelProps) {
</div>
</div>
- <Separator />
+ <Separator className="shrink-0" />
{/* Documents */}
- <KnowledgeDocumentsPanel knowledgeBaseId={knowledgeBase.id} />
+ <div className="min-h-0 flex-1 overflow-y-auto p-[20px_18px_24px]">
+ <KnowledgeDocumentsPanel knowledgeBaseId={knowledgeBase.id} />
+ </div>
</div>
);
}
@@ -132,24 +135,27 @@ export const KnowledgePage = () => {
};
return (
- <div className="flex size-full">
- <Sidebar collapsible="none" className="border-r">
- <SidebarHeader className={'flex flex-col mt-5 gap-y-1'}>
- <div className="text-lg font-semibold">{t('common.knowledge')}</div>
- <div className="text-muted-foreground text-xs">{t('knowledge.subtitle')}</div>
+ <div className="flex size-full p-2 gap-2">
+ <Sidebar collapsible="none" className="rounded-[22px]">
+ <SidebarHeader className={'flex flex-col p-[20px_18px_14px] gap-y-1'}>
+ <div className="text-xl font-medium tracking-[-0.02em] text-foreground">
+ {t('common.knowledge')}
+ </div>
+ <div className="text-text-tertiary text-xs">{t('knowledge.subtitle')}</div>
</SidebarHeader>
- <SidebarContent className="my-5">
- <SidebarGroup>
- <SidebarGroupLabel>{t('knowledge.list.label')}</SidebarGroupLabel>
- <SidebarGroupAction>
+ <SidebarContent>
+ <SidebarGroup className="mt-6 px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('knowledge.list.label')}
<Button
+ variant="ghost"
size="icon-xs"
- variant="default"
onClick={() => setCreateDialogOpen(true)}
+ title={t('knowledge.list.createButton')}
>
- <Plus />
+ <Plus className="size-3.5" />
</Button>
- </SidebarGroupAction>
+ </SidebarGroupLabel>
<SidebarGroupContent>
{knowledgeBases.length === 0 ? (
<Empty className="border-none py-4 min-h-50">
@@ -185,7 +191,9 @@ export const KnowledgePage = () => {
navigate(`/knowledge/${kb.id}`);
}}
>
- <span className="truncate">{kb.name}</span>
+ <span className="min-w-0 flex-1 truncate">
+ {kb.name}
+ </span>
{!kb.editable && (
<Badge
variant="secondary"
@@ -237,7 +245,7 @@ export const KnowledgePage = () => {
</SidebarContent>
<SidebarFooter />
</Sidebar>
- <main className="flex-1 min-h-0 overflow-hidden">
+ <main className="flex-1 min-h-0 overflow-hidden rounded-[22px] bg-card shadow-panel">
<DetailPanel knowledgeBase={selectedKb} onTest={() => setTestOpen(true)} />
</main>
<CreateKnowledgeBaseDialog
diff --git a/examples/web_ui/frontend/src/pages/mcp/index.tsx b/examples/web_ui/frontend/src/pages/mcp/index.tsx
index ad1d09f95..770db1609 100644
--- a/examples/web_ui/frontend/src/pages/mcp/index.tsx
+++ b/examples/web_ui/frontend/src/pages/mcp/index.tsx
@@ -1,5 +1,5 @@
-import { Blocks, Check, Download, Pencil, Store, Trash2, TriangleAlert } from 'lucide-react';
-import { Fragment, useCallback, useEffect, useState } from 'react';
+import { Blocks, Check, Download, Pencil, Plug, Trash2, TriangleAlert } from 'lucide-react';
+import { useCallback, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { hubApi } from '@/api';
@@ -27,7 +27,6 @@ import {
ItemDescription,
ItemGroup,
ItemMedia,
- ItemSeparator,
ItemTitle,
} from '@/components/ui/item.tsx';
import {
@@ -47,7 +46,8 @@ import { useMCPHubs } from '@/hooks/useMCPHubs.ts';
import { useMCPs } from '@/hooks/useMCPs.ts';
import { useResourceDrawer } from '@/hooks/useResourceDrawer.ts';
import { useTranslation } from '@/i18n/useI18n';
-import { formatTime } from '@/utils/common';
+import { cn } from '@/lib/utils';
+import { avatarTint, formatTime } from '@/utils/common';
/**
* The drawer body: the server's README where a skill shows its `SKILL.md`,
@@ -89,15 +89,24 @@ function CardItem({ card, installed, now, onInstall, onOpen }: CardItemProps) {
const { t } = useTranslation();
return (
- <Item className="cursor-pointer hover:bg-accent/50" onClick={onOpen}>
- <ItemMedia>
+ <Item
+ className={cn(
+ 'cursor-pointer items-start rounded-none border-l-2 py-[13px] pr-[18px] pl-4 hover:bg-row-hover',
+ // The left rule is the "installed" marker. Only the icon
+ // dims with it — fading the whole row would drop the
+ // description to a 2.4:1 contrast ratio.
+ installed ? 'border-l-foreground' : 'border-l-transparent',
+ )}
+ onClick={onOpen}
+ >
+ <ItemMedia className={cn('translate-y-0', installed && 'opacity-55')}>
<Avatar className="rounded-md">
<AvatarImage
src={card.icon_url ?? undefined}
alt={card.display_name || card.name}
loading="lazy"
/>
- <AvatarFallback className="rounded-md">
+ <AvatarFallback className="rounded-md" style={avatarTint(card.name)}>
{(card.display_name || card.name).slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
@@ -112,24 +121,27 @@ function CardItem({ card, installed, now, onInstall, onOpen }: CardItemProps) {
<span className="text-xs text-muted-foreground">@{card.author}</span>
)}
{card.auth === 'inputs' && (
- <Badge variant="outline" className="text-[10px] px-1 py-0">
+ // Sans, not mono: this one is a warning meant for a
+ // person, while the tags below are machine metadata.
+ <Badge className="rounded-full border-0 bg-amber-600/10 px-2 py-0.5 text-[10.5px] font-normal text-amber-700">
{t('mcp.needsConfig')}
</Badge>
)}
{card.tags.slice(0, 4).map((tag) => (
- <span key={tag} className="text-xs text-muted-foreground/60">
- #{tag}
- </span>
+ <Badge
+ key={tag}
+ variant="secondary"
+ className="rounded-full bg-secondary px-1.75 py-0.5 font-mono text-[10px] font-normal text-text-tertiary"
+ >
+ {tag}
+ </Badge>
))}
</ItemTitle>
<ItemDescription className="line-clamp-1">{card.description}</ItemDescription>
</ItemContent>
- <ItemActions className="flex-col items-end">
- {/* Rendered even when empty: a missing timestamp would
- otherwise drop this row and slide the counter up, so
- rows would not line up with each other. */}
- <span className="h-4 text-xs text-muted-foreground whitespace-nowrap">
+ <ItemActions className="items-center gap-3 self-center">
+ <span className="font-mono text-[10px] text-text-data whitespace-nowrap">
{card.updated_at
? now - card.updated_at < 3600
? t('skill.updatedRecently')
@@ -144,25 +156,31 @@ function CardItem({ card, installed, now, onInstall, onOpen }: CardItemProps) {
{/* Explicit null check: a hub reporting 0 installs is
saying something, one that does not count them is not. */}
{card.installs != null && (
- <span className="inline-flex items-center gap-1 text-xs text-muted-foreground">
+ <span className="inline-flex items-center gap-1 font-mono text-[10px] text-text-data">
<Download className="size-3" />
{card.installs.toLocaleString()}
</span>
)}
- <Button
- size="icon-sm"
- variant="ghost"
- disabled={installed}
- // Installing straight from the row must not also
- // open the drawer behind it.
- onClick={(e) => {
- e.stopPropagation();
- onInstall();
- }}
- title={t(installed ? 'mcp.installed' : 'mcp.install')}
- >
- {installed ? <Check /> : <Download />}
- </Button>
+ {installed ? (
+ // A state, not an action — a disabled button would
+ // still read as something you could have clicked.
+ <span className="flex h-7 items-center gap-x-[5px] rounded-full bg-surface-muted px-3 text-[11.5px] text-muted-foreground">
+ <Check className="size-3" />
+ {t('mcp.installed')}
+ </span>
+ ) : (
+ <Button
+ className="h-7 rounded-full px-3.5 text-xs font-normal hover:opacity-86"
+ // Installing straight from the row must not also
+ // open the drawer behind it.
+ onClick={(e) => {
+ e.stopPropagation();
+ onInstall();
+ }}
+ >
+ {t('mcp.install')}
+ </Button>
+ )}
</div>
</ItemActions>
</Item>
@@ -204,7 +222,7 @@ function HubPanel({ hubId, hub, installedNames, onInstalled }: HubPanelProps) {
src={hub?.icon_url ?? undefined}
alt={hub?.display_name ?? hubId}
/>
- <AvatarFallback className="rounded-md">
+ <AvatarFallback className="rounded-md" style={avatarTint(hubId)}>
{(hub?.display_name ?? hubId).slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
@@ -247,19 +265,15 @@ function HubPanel({ hubId, hub, installedNames, onInstalled }: HubPanelProps) {
</Empty>
) : (
<ItemGroup className="gap-0">
- {/* gap-0: the separators carry the spacing, so rows do
- not drift apart from the line between them. */}
- {cards.map((card, index) => (
- <Fragment key={`${card.hub_id}:${card.id}`}>
- {index > 0 && <ItemSeparator />}
- <CardItem
- card={card}
- installed={installedNames.has(card.name)}
- now={now}
- onInstall={() => setInstalling(card)}
- onOpen={() => drawer.open(card)}
- />
- </Fragment>
+ {cards.map((card) => (
+ <CardItem
+ key={`${card.hub_id}:${card.id}`}
+ card={card}
+ installed={installedNames.has(card.name)}
+ now={now}
+ onInstall={() => setInstalling(card)}
+ onOpen={() => drawer.open(card)}
+ />
))}
</ItemGroup>
)}
@@ -338,7 +352,7 @@ function MinePanel({ mcps, loading, onEdit, onRemove }: MinePanelProps) {
<ResourcePanel
title={t('common.my-mcp')}
description={t('mcp.mineDescription')}
- icon={<Store className="size-5 text-muted-foreground" />}
+ icon={<Plug className="size-5 text-muted-foreground" />}
search={
// Hidden while there is nothing to search through.
mcps.length > 0
@@ -358,7 +372,7 @@ function MinePanel({ mcps, loading, onEdit, onRemove }: MinePanelProps) {
<Empty className="border-none py-10">
<EmptyHeader>
<EmptyMedia variant="icon">
- <Store />
+ <Plug />
</EmptyMedia>
<EmptyTitle>{t('mcp.mineEmptyTitle')}</EmptyTitle>
<EmptyDescription>{t('mcp.mineEmptyDescription')}</EmptyDescription>
@@ -376,86 +390,84 @@ function MinePanel({ mcps, loading, onEdit, onRemove }: MinePanelProps) {
</Empty>
) : (
<ItemGroup className="gap-0">
- {shown.map((mcp, index) => (
- <>
- {index > 0 && <ItemSeparator />}
- <Item key={mcp.id}>
- <ItemMedia>
- <Avatar className="rounded-md">
- <AvatarImage
- src={mcp.icon_url ?? undefined}
- alt={mcp.display_name || mcp.name}
- loading="lazy"
- />
- <AvatarFallback className="rounded-md">
- {(mcp.display_name || mcp.name)
- .slice(0, 1)
- .toUpperCase()}
- </AvatarFallback>
- </Avatar>
- </ItemMedia>
-
- <ItemContent>
- <ItemTitle>
- <span className="font-medium">
- {mcp.display_name || mcp.name}
- </span>
- {mcp.author && (
- <span className="text-xs text-muted-foreground">
- @{mcp.author}
- </span>
- )}
- {mcp.is_stateful && (
- <span
- key={'state'}
- className="text-xs text-muted-foreground/60"
- >
- #{t('mcp.stateful')}
- </span>
- )}
- {mcp.tags.slice(0, 4).map((tag) => (
- <span
- key={tag}
- className="text-xs text-muted-foreground/60"
- >
- #{tag}
- </span>
- ))}
- </ItemTitle>
- <ItemDescription className="line-clamp-1">
- {mcp.description}
- </ItemDescription>
- </ItemContent>
+ {shown.map((mcp) => (
+ <Item key={mcp.id}>
+ <ItemMedia>
+ <Avatar className="rounded-md">
+ <AvatarImage
+ src={mcp.icon_url ?? undefined}
+ alt={mcp.display_name || mcp.name}
+ loading="lazy"
+ />
+ <AvatarFallback
+ className="rounded-md"
+ style={avatarTint(mcp.name)}
+ >
+ {(mcp.display_name || mcp.name).slice(0, 1).toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ </ItemMedia>
- <ItemActions className="gap-1">
- {mcp.version && (
- <span className="text-xs text-muted-foreground whitespace-nowrap">
- {mcp.version}
+ <ItemContent>
+ <ItemTitle>
+ <span className="font-medium">
+ {mcp.display_name || mcp.name}
+ </span>
+ {mcp.author && (
+ <span className="text-xs text-muted-foreground">
+ @{mcp.author}
</span>
)}
- {mcp.hub_id && mcp.card_id && (
- <Button
- size="icon-sm"
- variant="ghost"
- className="text-muted-foreground"
- onClick={() => onEdit(mcp)}
- title={t('common.edit')}
+ {mcp.is_stateful && (
+ <span
+ key={'state'}
+ className="text-xs text-muted-foreground/60"
>
- <Pencil />
- </Button>
+ #{t('mcp.stateful')}
+ </span>
)}
+ {mcp.tags.slice(0, 4).map((tag) => (
+ <span
+ key={tag}
+ className="text-xs text-muted-foreground/60"
+ >
+ #{tag}
+ </span>
+ ))}
+ </ItemTitle>
+ <ItemDescription className="line-clamp-1">
+ {mcp.description}
+ </ItemDescription>
+ </ItemContent>
+
+ <ItemActions className="gap-1">
+ {mcp.version && (
+ <span className="text-xs text-muted-foreground whitespace-nowrap">
+ {mcp.version}
+ </span>
+ )}
+ {mcp.hub_id && mcp.card_id && (
<Button
size="icon-sm"
variant="ghost"
className="text-muted-foreground"
- onClick={() => onRemove(mcp.id)}
- title={t('common.delete')}
+ onClick={() => onEdit(mcp)}
+ title={t('common.edit')}
>
- <Trash2 />
+ <Pencil />
</Button>
- </ItemActions>
- </Item>
- </>
+ )}
+ <Button
+ size="icon-sm"
+ variant="ghost"
+ className="text-muted-foreground"
+ onClick={() => onRemove(mcp.id)}
+ title={t('common.delete')}
+ >
+ <Trash2 />
+ </Button>
+ </ItemActions>
+ </Item>
))}
</ItemGroup>
)}
@@ -497,14 +509,16 @@ export function MCPHubPage() {
}, [editing]);
return (
- <div className="flex size-full">
- <Sidebar collapsible="none" className="border-r">
- <SidebarHeader className="flex flex-col mt-5 gap-y-1">
- <div className="text-lg font-semibold">{t('common.mcp-hub')}</div>
- <div className="text-muted-foreground text-xs">{t('mcp.subtitle')}</div>
+ <div className="flex size-full p-2 gap-2">
+ <Sidebar collapsible="none" className="rounded-[22px]">
+ <SidebarHeader className="flex flex-col p-[20px_18px_14px] gap-y-1">
+ <div className="text-xl font-medium tracking-[-0.02em] text-foreground">
+ {t('common.mcp-hub')}
+ </div>
+ <div className="text-text-tertiary text-xs">{t('mcp.subtitle')}</div>
</SidebarHeader>
- <SidebarContent className="my-5">
- <SidebarGroup>
+ <SidebarContent>
+ <SidebarGroup className="mt-6 px-2 py-0">
<SidebarGroupLabel>{t('common.mine')}</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
@@ -513,16 +527,28 @@ export function MCPHubPage() {
isActive={!hubId}
onClick={() => navigate('/mcp')}
>
- <Store />
- <span className="truncate">{t('common.my-mcp')}</span>
+ <Plug />
+ <span className="min-w-0 flex-1 truncate">
+ {t('common.my-mcp')}
+ </span>
+ <span className="font-mono text-[10px] text-text-data">
+ {mcps.length}
+ </span>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
- <SidebarGroup>
- <SidebarGroupLabel>{t('mcp.hubsLabel')}</SidebarGroupLabel>
+ <SidebarGroup className="mt-5 px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('mcp.hubsLabel')}
+ {hubs.length > 0 && (
+ <span className="text-[10px] text-text-data font-mono">
+ {hubs.length}
+ </span>
+ )}
+ </SidebarGroupLabel>
<SidebarGroupContent>
{hubsLoading ? (
<div className="flex justify-center py-4">
@@ -574,11 +600,16 @@ export function MCPHubPage() {
src={hub.icon_url ?? undefined}
alt={hub.display_name}
/>
- <AvatarFallback className="rounded-sm text-[10px]">
+ <AvatarFallback
+ className="rounded-sm text-[10px]"
+ style={avatarTint(hub.hub_id)}
+ >
{hub.display_name.slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
- <span className="truncate">{hub.display_name}</span>
+ <span className="min-w-0 flex-1 truncate">
+ {hub.display_name}
+ </span>
</SidebarMenuButton>
</SidebarMenuItem>
))}
@@ -589,7 +620,7 @@ export function MCPHubPage() {
</SidebarContent>
</Sidebar>
- <main className="flex-1 min-w-0 min-h-0 overflow-hidden">
+ <main className="flex-1 min-w-0 min-h-0 overflow-hidden rounded-[22px] bg-card shadow-panel">
{hubId ? (
// Remount on hub change so the panel's query box resets.
<HubPanel
diff --git a/examples/web_ui/frontend/src/pages/schedule/create-schedule-dialog.tsx b/examples/web_ui/frontend/src/pages/schedule/create-schedule-dialog.tsx
index 679a224a7..3d4e4a450 100644
--- a/examples/web_ui/frontend/src/pages/schedule/create-schedule-dialog.tsx
+++ b/examples/web_ui/frontend/src/pages/schedule/create-schedule-dialog.tsx
@@ -3,6 +3,7 @@ import { ChevronDownIcon, CircleAlert, Loader2, PlusCircle } from 'lucide-react'
import * as React from 'react';
import type { ChatModelConfig, PermissionMode } from '@/api';
+import { AgentSelect } from '@/components/select/AgentSelect';
import { LlmSelect } from '@/components/select/LlmSelect';
import { PermissionModeSelect } from '@/components/select/PermissionModeSelect';
import { TimezoneSelect } from '@/components/select/TimezoneSelect';
@@ -94,11 +95,10 @@ function DatePickerButton({
<Button
variant="outline"
disabled={disabled}
- size="sm"
className="w-32 justify-between font-normal"
>
{date ? format(date, 'PPP') : placeholder}
- <ChevronDownIcon className="text-muted-foreground opacity-50" />
+ <ChevronDownIcon className="size-3.5 text-muted-foreground" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
@@ -184,7 +184,7 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
<DialogContent className="!w-[500px] !max-w-[500px]">
<DialogHeader>
<DialogTitle>{t('schedule.createSchedule.title')}</DialogTitle>
- <DialogDescription className="tracking-tight">
+ <DialogDescription>
{t('schedule.createSchedule.description')}
</DialogDescription>
</DialogHeader>
@@ -194,7 +194,6 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
<Field>
<FieldLabel>{t('common.name')}</FieldLabel>
<Input
- className="text-sm h-8"
value={form.name}
onChange={(e) => set('name', e.target.value)}
placeholder={t('schedule.createSchedule.namePlaceholder')}
@@ -226,7 +225,7 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
type="time"
value={form.time}
onChange={(e) => set('time', e.target.value)}
- className="max-h-7 h-7 text-sm appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
+ className="appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
/>
</Field>
</div>
@@ -234,7 +233,7 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
<Field orientation={'horizontal'}>
<FieldLabel>{t('schedule.timezone')}</FieldLabel>
<TimezoneSelect
- className={''}
+ size="default"
value={form.timezone}
onChange={(v) => set('timezone', v)}
/>
@@ -246,7 +245,7 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
value={form.freq}
onValueChange={(v) => set('freq', v as FreqType)}
>
- <SelectTrigger size="sm">
+ <SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -278,23 +277,19 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
<Field orientation={'horizontal'}>
<FieldLabel>{t('common.agent')}</FieldLabel>
- <Select value={form.agentId} onValueChange={(v) => set('agentId', v)}>
- <SelectTrigger className="w-full" size="sm">
- <SelectValue placeholder={t('common.selectAgent')} />
- </SelectTrigger>
- <SelectContent>
- {agents.map((agent) => (
- <SelectItem key={agent.id} value={agent.id}>
- {agent.data.name}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <AgentSelect
+ size="default"
+ agents={agents}
+ value={form.agentId || null}
+ onChange={(id) => set('agentId', id)}
+ placeholder={t('common.selectAgent')}
+ />
</Field>
<Field orientation={'horizontal'}>
<FieldLabel>{t('common.model')}</FieldLabel>
<LlmSelect
+ size="default"
value={form.chatModelConfig}
onChange={(v) => set('chatModelConfig', v)}
/>
@@ -303,7 +298,7 @@ export function CreateScheduleDialog({ open, onOpenChange, onCreated }: Props) {
<Field orientation={'horizontal'}>
<FieldLabel>{t('schedule.permissionMode')}</FieldLabel>
<PermissionModeSelect
- className="w-full"
+ size="default"
value={form.permissionMode}
onChange={(v) => set('permissionMode', v)}
/>
diff --git a/examples/web_ui/frontend/src/pages/skill/index.tsx b/examples/web_ui/frontend/src/pages/skill/index.tsx
index 624524ea6..17f9efd44 100644
--- a/examples/web_ui/frontend/src/pages/skill/index.tsx
+++ b/examples/web_ui/frontend/src/pages/skill/index.tsx
@@ -1,5 +1,5 @@
-import { Blocks, BookMarked, Check, Download, Trash2, TriangleAlert } from 'lucide-react';
-import { Fragment, useCallback, useState } from 'react';
+import { Blocks, Check, Download, Plug, Trash2, TriangleAlert } from 'lucide-react';
+import { useCallback, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import type { HubInfo, SkillCard, SkillView } from '@/api';
@@ -9,6 +9,7 @@ import { ResourceDetailDrawer } from '@/components/drawer/ResourceDetailDrawer.t
import { LoadMore } from '@/components/hub/LoadMore.tsx';
import { ResourcePanel } from '@/components/hub/ResourcePanel.tsx';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.tsx';
+import { Badge } from '@/components/ui/badge.tsx';
import { Button } from '@/components/ui/button.tsx';
import {
Empty,
@@ -25,7 +26,6 @@ import {
ItemDescription,
ItemGroup,
ItemMedia,
- ItemSeparator,
ItemTitle,
} from '@/components/ui/item.tsx';
import {
@@ -45,7 +45,8 @@ import { useSkillHubCards } from '@/hooks/useSkillHubCards.ts';
import { useSkillHubs } from '@/hooks/useSkillHubs.ts';
import { useSkills } from '@/hooks/useSkills.ts';
import { useTranslation } from '@/i18n/useI18n';
-import { formatTime } from '@/utils/common';
+import { cn } from '@/lib/utils';
+import { avatarTint, formatTime } from '@/utils/common';
interface CardItemProps {
card: SkillCard;
@@ -62,15 +63,24 @@ function CardItem({ card, installed, installing, now, onInstall, onOpen }: CardI
const { t } = useTranslation();
return (
- <Item className="cursor-pointer hover:bg-accent/50" onClick={onOpen}>
- <ItemMedia>
+ <Item
+ className={cn(
+ 'cursor-pointer items-start rounded-none border-l-2 py-[13px] pr-[18px] pl-4 hover:bg-row-hover',
+ // The left rule is the "installed" marker. Only the icon
+ // dims with it — fading the whole row would drop the
+ // description to a 2.4:1 contrast ratio.
+ installed ? 'border-l-foreground' : 'border-l-transparent',
+ )}
+ onClick={onOpen}
+ >
+ <ItemMedia className={cn('translate-y-0', installed && 'opacity-55')}>
<Avatar className="rounded-md">
<AvatarImage
src={card.icon_url ?? undefined}
alt={card.display_name || card.name}
loading="lazy"
/>
- <AvatarFallback className="rounded-md">
+ <AvatarFallback className="rounded-md" style={avatarTint(card.name)}>
{(card.display_name || card.name).slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
@@ -85,19 +95,31 @@ function CardItem({ card, installed, installing, now, onInstall, onOpen }: CardI
<span className="text-xs text-muted-foreground">@{card.author}</span>
)}
{card.tags.slice(0, 4).map((tag) => (
- <span key={tag} className="text-xs text-muted-foreground/60">
- #{tag}
- </span>
+ <Badge
+ key={tag}
+ variant="secondary"
+ className="rounded-full bg-secondary px-1.75 py-0.5 font-mono text-[10px] font-normal text-text-tertiary"
+ >
+ {tag}
+ </Badge>
))}
+ {/* Explicit null check: a hub reporting 0 downloads is
+ saying something, one that does not count them is not. */}
+ {card.downloads != null && (
+ <Badge
+ variant="secondary"
+ className="gap-x-1 rounded-full bg-secondary px-1.75 py-0.5 font-mono text-[10px] font-normal text-text-tertiary"
+ >
+ <Download className="size-2.5" />
+ {card.downloads.toLocaleString()}
+ </Badge>
+ )}
</ItemTitle>
<ItemDescription className="line-clamp-1">{card.description}</ItemDescription>
</ItemContent>
- <ItemActions className="flex-col items-end">
- {/* Rendered even when empty: a missing timestamp would
- otherwise drop this row and slide the counter up, so
- rows would not line up with each other. */}
- <span className="h-4 text-xs text-muted-foreground whitespace-nowrap">
+ <ItemActions className="items-center gap-3 self-center">
+ <span className="font-mono text-[10px] text-text-data whitespace-nowrap">
{/* updated_at is in seconds, as is formatTime. */}
{card.updated_at
? now - card.updated_at < 3600
@@ -110,28 +132,28 @@ function CardItem({ card, installed, installing, now, onInstall, onOpen }: CardI
: null}
</span>
<div className="flex h-8 items-center gap-2">
- {/* Explicit null check: a hub reporting 0 downloads is
- saying something, one that does not count them is not. */}
- {card.downloads != null && (
- <span className="inline-flex items-center gap-1 text-xs text-muted-foreground">
- <Download className="size-3" />
- {card.downloads.toLocaleString()}
+ {installed ? (
+ // A state, not an action — a disabled button would
+ // still read as something you could have clicked.
+ <span className="flex h-7 items-center gap-x-[5px] rounded-full bg-surface-muted px-3 text-[11.5px] text-muted-foreground">
+ <Check className="size-3" />
+ {t('skill.installed')}
</span>
+ ) : (
+ <Button
+ className="h-7 rounded-full px-3.5 text-xs font-normal hover:opacity-86"
+ disabled={installing}
+ // Installing straight from the row must not also
+ // open the drawer behind it.
+ onClick={(e) => {
+ e.stopPropagation();
+ onInstall();
+ }}
+ >
+ {installing && <Spinner />}
+ {t('skill.install')}
+ </Button>
)}
- <Button
- size="icon-sm"
- variant="ghost"
- disabled={installed || installing}
- // Installing straight from the row must not also
- // open the drawer behind it.
- onClick={(e) => {
- e.stopPropagation();
- onInstall();
- }}
- title={t(installed ? 'skill.installed' : 'skill.install')}
- >
- {installing ? <Spinner /> : installed ? <Check /> : <Download />}
- </Button>
</div>
</ItemActions>
</Item>
@@ -189,7 +211,7 @@ function HubPanel({ hubId, hub, installedNames, onInstalled }: HubPanelProps) {
src={hub?.icon_url ?? undefined}
alt={hub?.display_name ?? hubId}
/>
- <AvatarFallback className="rounded-md">
+ <AvatarFallback className="rounded-md" style={avatarTint(hubId)}>
{(hub?.display_name ?? hubId).slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
@@ -232,20 +254,16 @@ function HubPanel({ hubId, hub, installedNames, onInstalled }: HubPanelProps) {
</Empty>
) : (
<ItemGroup className="gap-0">
- {/* gap-0: the separators carry the spacing, so rows do
- not drift apart from the line between them. */}
- {cards.map((card, index) => (
- <Fragment key={`${card.hub_id}:${card.id}`}>
- {index > 0 && <ItemSeparator />}
- <CardItem
- card={card}
- installed={installedNames.has(card.name)}
- installing={installingId === card.id}
- now={now}
- onInstall={() => handleInstall(card)}
- onOpen={() => drawer.open(card)}
- />
- </Fragment>
+ {cards.map((card) => (
+ <CardItem
+ key={`${card.hub_id}:${card.id}`}
+ card={card}
+ installed={installedNames.has(card.name)}
+ installing={installingId === card.id}
+ now={now}
+ onInstall={() => handleInstall(card)}
+ onOpen={() => drawer.open(card)}
+ />
))}
</ItemGroup>
)}
@@ -317,7 +335,7 @@ function MinePanel({ skills, loading, onRemove }: MinePanelProps) {
<ResourcePanel
title={t('common.my-skill')}
description={t('skill.mineDescription')}
- icon={<BookMarked className="size-5 text-muted-foreground" />}
+ icon={<Plug className="size-5 text-muted-foreground" />}
search={
// Hidden while there is nothing to search through.
skills.length > 0
@@ -337,7 +355,7 @@ function MinePanel({ skills, loading, onRemove }: MinePanelProps) {
<Empty className="border-none py-10">
<EmptyHeader>
<EmptyMedia variant="icon">
- <BookMarked />
+ <Plug />
</EmptyMedia>
<EmptyTitle>{t('skill.mineEmptyTitle')}</EmptyTitle>
<EmptyDescription>{t('skill.mineEmptyDescription')}</EmptyDescription>
@@ -355,75 +373,76 @@ function MinePanel({ skills, loading, onRemove }: MinePanelProps) {
</Empty>
) : (
<ItemGroup className="gap-0">
- {shown.map((skill, index) => (
- <Fragment key={skill.id}>
- {index > 0 && <ItemSeparator />}
- <Item
- className="cursor-pointer hover:bg-accent/50"
- onClick={() => drawer.open(skill)}
- >
- <ItemMedia>
- <Avatar className="rounded-md">
- <AvatarImage
- src={skill.icon_url ?? undefined}
- alt={skill.display_name || skill.name}
- loading="lazy"
- />
- <AvatarFallback className="rounded-md">
- {(skill.display_name || skill.name)
- .slice(0, 1)
- .toUpperCase()}
- </AvatarFallback>
- </Avatar>
- </ItemMedia>
-
- <ItemContent>
- <ItemTitle>
- <span className="font-medium">
- {skill.display_name || skill.name}
- </span>
- {/* A hand-added skill has no hub to name. */}
- {skill.hub_id && (
- <span className="text-xs text-muted-foreground">
- @{skill.hub_id}
- </span>
- )}
- {skill.tags.slice(0, 4).map((tag) => (
- <span
- key={tag}
- className="text-xs text-muted-foreground/60"
- >
- #{tag}
- </span>
- ))}
- </ItemTitle>
- <ItemDescription className="line-clamp-1">
- {skill.description}
- </ItemDescription>
- </ItemContent>
+ {shown.map((skill) => (
+ <Item
+ key={skill.id}
+ className="cursor-pointer hover:bg-accent/50"
+ onClick={() => drawer.open(skill)}
+ >
+ <ItemMedia>
+ <Avatar className="rounded-md">
+ <AvatarImage
+ src={skill.icon_url ?? undefined}
+ alt={skill.display_name || skill.name}
+ loading="lazy"
+ />
+ <AvatarFallback
+ className="rounded-md"
+ style={avatarTint(skill.name)}
+ >
+ {(skill.display_name || skill.name)
+ .slice(0, 1)
+ .toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ </ItemMedia>
- <ItemActions>
- {skill.version && (
- <span className="text-xs text-muted-foreground whitespace-nowrap">
- {skill.version}
+ <ItemContent>
+ <ItemTitle>
+ <span className="font-medium">
+ {skill.display_name || skill.name}
+ </span>
+ {/* A hand-added skill has no hub to name. */}
+ {skill.hub_id && (
+ <span className="text-xs text-muted-foreground">
+ @{skill.hub_id}
</span>
)}
- <Button
- size="icon-sm"
- variant="ghost"
- // Deleting from the row must not also
- // open the drawer behind it.
- onClick={(e) => {
- e.stopPropagation();
- onRemove(skill.id);
- }}
- title={t('common.delete')}
- >
- <Trash2 />
- </Button>
- </ItemActions>
- </Item>
- </Fragment>
+ {skill.tags.slice(0, 4).map((tag) => (
+ <span
+ key={tag}
+ className="text-xs text-muted-foreground/60"
+ >
+ #{tag}
+ </span>
+ ))}
+ </ItemTitle>
+ <ItemDescription className="line-clamp-1">
+ {skill.description}
+ </ItemDescription>
+ </ItemContent>
+
+ <ItemActions>
+ {skill.version && (
+ <span className="text-xs text-muted-foreground whitespace-nowrap">
+ {skill.version}
+ </span>
+ )}
+ <Button
+ size="icon-sm"
+ variant="ghost"
+ // Deleting from the row must not also
+ // open the drawer behind it.
+ onClick={(e) => {
+ e.stopPropagation();
+ onRemove(skill.id);
+ }}
+ title={t('common.delete')}
+ >
+ <Trash2 />
+ </Button>
+ </ItemActions>
+ </Item>
))}
</ItemGroup>
)}
@@ -463,14 +482,16 @@ export function SkillHubPage() {
const installedNames = new Set(skills.map((skill) => skill.name));
return (
- <div className="flex size-full">
- <Sidebar collapsible="none" className="border-r">
- <SidebarHeader className="flex flex-col mt-5 gap-y-1">
- <div className="text-lg font-semibold">{t('common.skill-hub')}</div>
- <div className="text-muted-foreground text-xs">{t('skill.subtitle')}</div>
+ <div className="flex size-full p-2 gap-2">
+ <Sidebar collapsible="none" className="rounded-[22px]">
+ <SidebarHeader className="flex flex-col p-[20px_18px_14px] gap-y-1">
+ <div className="text-xl font-medium tracking-[-0.02em] text-foreground">
+ {t('common.skill-hub')}
+ </div>
+ <div className="text-text-tertiary text-xs">{t('skill.subtitle')}</div>
</SidebarHeader>
- <SidebarContent className="my-5">
- <SidebarGroup>
+ <SidebarContent>
+ <SidebarGroup className="mt-6 px-2 py-0">
<SidebarGroupLabel>{t('common.mine')}</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
@@ -479,16 +500,28 @@ export function SkillHubPage() {
isActive={!hubId}
onClick={() => navigate('/skill')}
>
- <BookMarked />
- <span className="truncate">{t('common.my-skill')}</span>
+ <Plug />
+ <span className="min-w-0 flex-1 truncate">
+ {t('common.my-skill')}
+ </span>
+ <span className="font-mono text-[10px] text-text-data">
+ {skills.length}
+ </span>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
- <SidebarGroup>
- <SidebarGroupLabel>{t('skill.hubsLabel')}</SidebarGroupLabel>
+ <SidebarGroup className="mt-5 px-2 py-0">
+ <SidebarGroupLabel className="justify-between">
+ {t('skill.hubsLabel')}
+ {hubs.length > 0 && (
+ <span className="text-[10px] text-text-data font-mono">
+ {hubs.length}
+ </span>
+ )}
+ </SidebarGroupLabel>
<SidebarGroupContent>
{hubsLoading ? (
<div className="flex justify-center py-4">
@@ -540,11 +573,16 @@ export function SkillHubPage() {
src={hub.icon_url ?? undefined}
alt={hub.display_name}
/>
- <AvatarFallback className="rounded-sm text-[10px]">
+ <AvatarFallback
+ className="rounded-sm text-[10px]"
+ style={avatarTint(hub.hub_id)}
+ >
{hub.display_name.slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
- <span className="truncate">{hub.display_name}</span>
+ <span className="min-w-0 flex-1 truncate">
+ {hub.display_name}
+ </span>
</SidebarMenuButton>
</SidebarMenuItem>
))}
@@ -555,7 +593,7 @@ export function SkillHubPage() {
</SidebarContent>
</Sidebar>
- <main className="flex-1 min-w-0 min-h-0 overflow-hidden">
+ <main className="flex-1 min-w-0 min-h-0 overflow-hidden rounded-[22px] bg-card shadow-panel">
{hubId ? (
// Remount on hub change so the panel's query box resets.
<HubPanel
diff --git a/examples/web_ui/frontend/src/utils/common.ts b/examples/web_ui/frontend/src/utils/common.ts
index 00671afcb..e0db38d8d 100644
--- a/examples/web_ui/frontend/src/utils/common.ts
+++ b/examples/web_ui/frontend/src/utils/common.ts
@@ -118,3 +118,33 @@ export const formatTime = (
}
return `${Math.floor(total / 31556952)}y`;
};
+
+/**
+ * A deterministic, readable colour pair for a fallback avatar.
+ *
+ * The hue is hashed from the name so a given hub or card always looks
+ * the same; lightness and chroma are fixed. Working in OKLCH is what
+ * makes the fixed lightness safe — its L is perceptual, so every hue
+ * lands on the same contrast ratio (~7:1 here). The same two numbers in
+ * HSL would leave yellow washed out where blue reads fine.
+ *
+ * @param seed - Stable identity, e.g. the card or hub name.
+ * @returns Inline styles pairing a tinted background with a much darker
+ * glyph of the same hue.
+ */
+export const avatarTint = (seed: string): { backgroundColor: string; color: string } => {
+ // FNV-1a: cheap, and spreads adjacent names across the wheel rather
+ // than clustering them the way a plain sum of char codes does.
+ let hash = 0x811c9dc5;
+ for (let i = 0; i < seed.length; i++) {
+ hash ^= seed.charCodeAt(i);
+ hash = Math.imul(hash, 0x01000193);
+ }
+ const hue = Math.abs(hash) % 360;
+ // Verified across all 360 hues: 7.16:1 worst case (WCAG AAA), and the
+ // chroma is low enough that nothing meaningfully leaves sRGB.
+ return {
+ backgroundColor: `oklch(0.94 0.03 ${hue})`,
+ color: `oklch(0.41 0.075 ${hue})`,
+ };
+};
diff --git a/examples/web_ui/pnpm-lock.yaml b/examples/web_ui/pnpm-lock.yaml
index 741d3919b..ac7fd5830 100644
--- a/examples/web_ui/pnpm-lock.yaml
+++ b/examples/web_ui/pnpm-lock.yaml
@@ -59,10 +59,13 @@ importers:
dependencies:
'@agentscope-ai/agentscope':
specifier: ^0.0.15
- version: 0.0.15
+ version: 0.0.15([email protected])
'@fontsource-variable/geist':
specifier: ^5.2.8
version: 5.2.8
+ '@fontsource-variable/geist-mono':
+ specifier: ^5.3.0
+ version: 5.3.0
'@shadcn/react':
specifier: ^0.2.1
version: 0.2.1(@types/[email protected])([email protected])
@@ -174,7 +177,7 @@ importers:
devDependencies:
'@eslint/js':
specifier: ^10.0.1
'@tailwindcss/typography':
specifier: ^0.5.19
version: 0.5.19([email protected])
@@ -195,16 +198,16 @@ importers:
eslint:
specifier: ^10.3.0
- version: 10.3.0([email protected])
eslint-plugin-import-x:
specifier: ^4.16.2
eslint-plugin-react-hooks:
specifier: ^7.1.1
eslint-plugin-react-refresh:
specifier: ^0.5.2
globals:
specifier: ^17.6.0
version: 17.6.0
@@ -213,7 +216,7 @@ importers:
version: 6.0.3
typescript-eslint:
specifier: ^8.59.2
vite:
specifier: ^8.0.12
@@ -451,6 +454,9 @@ packages:
'@floating-ui/[email protected]':
resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==}
+ '@fontsource-variable/[email protected]':
+ resolution: {integrity: sha512-vBbuwDEo9AkrqADMXOrlAR3DFcJi4/JxeuU43FoiQERnNwsfXNnvxvReZG02cQKmyk4DZkZdBZX3oTDvy2zBAw==}
+
'@fontsource-variable/[email protected]':
resolution: {integrity: sha512-cJ6m9e+8MQ5dCYJsLylfZrgBh6KkG4bOLckB35Tr9J/EqdkEM6QllH5PxqP1dhTvFup+HtMRPuz9xOjxXJggxw==}
@@ -5095,10 +5101,10 @@ packages:
snapshots:
- '@agentscope-ai/[email protected]':
dependencies:
'@cfworker/json-schema': 4.1.1
- '@modelcontextprotocol/sdk': 1.29.0(@cfworker/[email protected])([email protected])
+ '@modelcontextprotocol/sdk': 1.29.0(@cfworker/[email protected])([email protected])([email protected])
gray-matter: 4.0.3
jsonrepair: 3.14.0
mime-types: 3.0.2
@@ -5350,6 +5356,11 @@ snapshots:
tslib: 2.8.1
optional: true
+ dependencies:
+ eslint-visitor-keys: 3.4.3
+
dependencies:
eslint: 10.3.0([email protected])
@@ -5357,7 +5368,7 @@ snapshots:
'@eslint-community/[email protected]': {}
- '@eslint/[email protected]':
dependencies:
'@eslint/object-schema': 3.0.5
debug: 4.4.3([email protected])
@@ -5373,9 +5384,9 @@ snapshots:
dependencies:
'@types/json-schema': 7.0.15
optionalDependencies:
- eslint: 10.3.0([email protected])
'@eslint/[email protected]': {}
@@ -5401,6 +5412,8 @@ snapshots:
'@floating-ui/[email protected]': {}
+ '@fontsource-variable/[email protected]': {}
+
'@fontsource-variable/[email protected]': {}
@@ -5556,7 +5569,7 @@ snapshots:
dependencies:
'@chevrotain/types': 11.1.2
- '@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected])':
dependencies:
'@hono/node-server': 1.19.14([email protected])
ajv: 8.20.0
@@ -5566,21 +5579,21 @@ snapshots:
cross-spawn: 7.0.6
eventsource: 3.0.7
eventsource-parser: 3.0.8
- express: 5.2.1
- express-rate-limit: 8.5.2([email protected])
+ express: 5.2.1([email protected])
+ express-rate-limit: 8.5.2([email protected]([email protected]))
hono: 4.12.18
jose: 6.2.3
json-schema-typed: 8.0.2
pkce-challenge: 5.0.1
raw-body: 3.0.2
- zod: 3.25.76
- zod-to-json-schema: 3.25.2([email protected])
+ zod: 4.4.3
+ zod-to-json-schema: 3.25.2([email protected])
optionalDependencies:
'@cfworker/json-schema': 4.1.1
transitivePeerDependencies:
- supports-color
- '@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected])':
+ '@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected])':
dependencies:
'@hono/node-server': 1.19.14([email protected])
ajv: 8.20.0
@@ -5590,15 +5603,15 @@ snapshots:
cross-spawn: 7.0.6
eventsource: 3.0.7
eventsource-parser: 3.0.8
- express: 5.2.1
- express-rate-limit: 8.5.2([email protected])
+ express: 5.2.1([email protected])
+ express-rate-limit: 8.5.2([email protected]([email protected]))
hono: 4.12.18
jose: 6.2.3
json-schema-typed: 8.0.2
pkce-challenge: 5.0.1
raw-body: 3.0.2
- zod: 4.4.3
- zod-to-json-schema: 3.25.2([email protected])
+ zod: 3.25.76
+ zod-to-json-schema: 3.25.2([email protected])
optionalDependencies:
'@cfworker/json-schema': 4.1.1
transitivePeerDependencies:
@@ -6938,15 +6951,15 @@ snapshots:
'@types/[email protected]': {}
dependencies:
'@eslint-community/regexpp': 4.12.2
- '@typescript-eslint/parser': 8.59.3([email protected]([email protected]))([email protected])
'@typescript-eslint/scope-manager': 8.59.3
- '@typescript-eslint/type-utils': 8.59.3([email protected]([email protected]))([email protected])
- '@typescript-eslint/utils': 8.59.3([email protected]([email protected]))([email protected])
'@typescript-eslint/visitor-keys': 8.59.3
- eslint: 10.3.0([email protected])
ignore: 7.0.5
natural-compare: 1.4.0
ts-api-utils: 2.5.0([email protected])
@@ -6954,14 +6967,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@typescript-eslint/scope-manager': 8.59.3
'@typescript-eslint/types': 8.59.3
'@typescript-eslint/typescript-estree': 8.59.3([email protected])
'@typescript-eslint/visitor-keys': 8.59.3
debug: 4.4.3([email protected])
- eslint: 10.3.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- supports-color
@@ -6984,13 +6997,13 @@ snapshots:
dependencies:
typescript: 6.0.3
dependencies:
'@typescript-eslint/types': 8.59.3
'@typescript-eslint/typescript-estree': 8.59.3([email protected])
- '@typescript-eslint/utils': 8.59.3([email protected]([email protected]))([email protected])
debug: 4.4.3([email protected])
- eslint: 10.3.0([email protected])
ts-api-utils: 2.5.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
@@ -7013,13 +7026,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
- '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))
+ '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected])([email protected]))
'@typescript-eslint/scope-manager': 8.59.3
'@typescript-eslint/types': 8.59.3
'@typescript-eslint/typescript-estree': 8.59.3([email protected])
- eslint: 10.3.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- supports-color
@@ -7200,7 +7213,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
bytes: 3.1.2
content-type: 1.0.5
@@ -7734,13 +7747,13 @@ snapshots:
optionalDependencies:
unrs-resolver: 1.11.1
dependencies:
'@package-json/types': 0.0.12
'@typescript-eslint/types': 8.59.3
comment-parser: 1.4.6
debug: 4.4.3([email protected])
- eslint: 10.3.0([email protected])
eslint-import-context: 0.1.9([email protected])
is-glob: 4.0.3
minimatch: 10.2.5
@@ -7748,7 +7761,7 @@ snapshots:
stable-hash-x: 0.2.0
unrs-resolver: 1.11.1
optionalDependencies:
- '@typescript-eslint/utils': 8.59.3([email protected]([email protected]))([email protected])
transitivePeerDependencies:
- supports-color
@@ -7761,20 +7774,20 @@ snapshots:
optionalDependencies:
eslint-config-prettier: 10.1.8([email protected]([email protected]))
dependencies:
'@babel/core': 7.29.0
'@babel/parser': 7.29.3
- eslint: 10.3.0([email protected])
hermes-parser: 0.25.1
zod: 4.4.3
zod-validation-error: 4.0.2([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
- eslint: 10.3.0([email protected])
dependencies:
@@ -7791,7 +7804,44 @@ snapshots:
dependencies:
'@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))
'@eslint-community/regexpp': 4.12.2
- '@eslint/config-array': 0.23.5
+ '@eslint/config-array': 0.23.5([email protected])
+ '@eslint/config-helpers': 0.5.5
+ '@eslint/core': 1.2.1
+ '@eslint/plugin-kit': 0.7.1
+ '@humanfs/node': 0.16.8
+ '@humanwhocodes/module-importer': 1.0.1
+ '@humanwhocodes/retry': 0.4.3
+ '@types/estree': 1.0.9
+ ajv: 6.15.0
+ cross-spawn: 7.0.6
+ debug: 4.4.3([email protected])
+ escape-string-regexp: 4.0.0
+ eslint-scope: 9.1.2
+ eslint-visitor-keys: 5.0.1
+ espree: 11.2.0
+ esquery: 1.7.0
+ esutils: 2.0.3
+ fast-deep-equal: 3.1.3
+ file-entry-cache: 8.0.0
+ find-up: 5.0.0
+ glob-parent: 6.0.2
+ ignore: 5.3.2
+ imurmurhash: 0.1.4
+ is-glob: 4.0.3
+ json-stable-stringify-without-jsonify: 1.0.1
+ minimatch: 10.2.5
+ natural-compare: 1.4.0
+ optionator: 0.9.4
+ optionalDependencies:
+ jiti: 2.7.0
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected])([email protected]))
+ '@eslint-community/regexpp': 4.12.2
+ '@eslint/config-array': 0.23.5([email protected])
'@eslint/config-helpers': 0.5.5
'@eslint/core': 1.2.1
'@eslint/plugin-kit': 0.7.1
@@ -7885,9 +7935,9 @@ snapshots:
strip-final-newline: 4.0.0
yoctocolors: 2.1.2
dependencies:
- express: 5.2.1
+ express: 5.2.1([email protected])
ip-address: 10.2.0
@@ -7926,10 +7976,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
accepts: 2.0.0
- body-parser: 2.2.2
+ body-parser: 2.2.2([email protected])
content-disposition: 1.1.0
content-type: 1.0.5
cookie: 0.7.2
@@ -7939,7 +7989,7 @@ snapshots:
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
- finalhandler: 2.1.1
+ finalhandler: 2.1.1([email protected])
fresh: 2.0.0
http-errors: 2.0.1
merge-descriptors: 2.0.0
@@ -7950,8 +8000,8 @@ snapshots:
proxy-addr: 2.0.7
qs: 6.15.1
range-parser: 1.2.1
- router: 2.2.0
- send: 1.2.1
+ router: 2.2.0([email protected])
+ send: 1.2.1([email protected])
serve-static: 2.2.1
statuses: 2.0.2
type-is: 2.1.0
@@ -8015,7 +8065,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.4.3([email protected])
encodeurl: 2.0.0
@@ -9695,7 +9745,7 @@ snapshots:
points-on-curve: 0.2.0
points-on-path: 0.2.1
dependencies:
debug: 4.4.3([email protected])
depd: 2.0.0
@@ -9752,7 +9802,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.4.3([email protected])
encodeurl: 2.0.0
@@ -9782,7 +9832,7 @@ snapshots:
encodeurl: 2.0.0
escape-html: 1.0.3
parseurl: 1.3.3
- send: 1.2.1
+ send: 1.2.1([email protected])
transitivePeerDependencies:
- supports-color
@@ -10148,13 +10198,13 @@ snapshots:
media-typer: 1.1.0
mime-types: 3.0.2
dependencies:
- '@typescript-eslint/parser': 8.59.3([email protected]([email protected]))([email protected])
'@typescript-eslint/typescript-estree': 8.59.3([email protected])
- '@typescript-eslint/utils': 8.59.3([email protected]([email protected]))([email protected])
- eslint: 10.3.0([email protected])
typescript: 6.0.3
transitivePeerDependencies:
- supports-color
diff --git a/src/agentscope/app/_app.py b/src/agentscope/app/_app.py
index 933c54ecf..3e6c57fa4 100644
--- a/src/agentscope/app/_app.py
+++ b/src/agentscope/app/_app.py
@@ -14,6 +14,7 @@ from ._router import (
credential_router,
hub_router,
knowledge_base_router,
+ embedding_model_router,
mcp_router,
model_router,
tts_model_router,
@@ -309,6 +310,7 @@ def create_app(
workspace_router,
model_router,
tts_model_router,
+ embedding_model_router,
):
app.include_router(router)
diff --git a/src/agentscope/app/_router/__init__.py b/src/agentscope/app/_router/__init__.py
index 7df89a383..8f530d06a 100644
--- a/src/agentscope/app/_router/__init__.py
+++ b/src/agentscope/app/_router/__init__.py
@@ -3,6 +3,7 @@
from ._agent import agent_router
from ._chat import chat_router
from ._credential import credential_router
+from ._embedding_model import embedding_model_router
from ._hub import hub_router
from ._knowledge_base import knowledge_base_router
from ._mcp import mcp_router
@@ -16,6 +17,7 @@ from ._workspace import workspace_router
__all__ = [
"agent_router",
"model_router",
+ "embedding_model_router",
"tts_model_router",
"chat_router",
"credential_router",
diff --git a/src/agentscope/app/_router/_embedding_model.py b/src/agentscope/app/_router/_embedding_model.py
new file mode 100644
index 000000000..41a613ced
--- /dev/null
+++ b/src/agentscope/app/_router/_embedding_model.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+"""The embedding model router."""
+
+from fastapi import APIRouter, Depends, HTTPException, status
+
+from ._schema import ListEmbeddingModelsResponse, ListEmbeddingModelsRequest
+from ...credential import CredentialFactory
+
+embedding_model_router = APIRouter(
+ prefix="/embedding-model",
+ tags=["embedding-model"],
+ responses={404: {"description": "Not found"}},
+)
+
+
+@embedding_model_router.get(
+ "/",
+ response_model=ListEmbeddingModelsResponse,
+ summary=(
+ "List all candidate embedding models under the given credential type"
+ ),
+)
+async def list_embedding_models(
+ body: ListEmbeddingModelsRequest = Depends(),
+) -> ListEmbeddingModelsResponse:
+ """Return all candidate embedding models under the credential type.
+
+ Unlike ``/knowledge_bases/embedding_models``, which narrows the
+ list to what the knowledge base's dimension policy accepts, this
+ endpoint reports the provider's full catalogue — it answers "what
+ can this credential do", not "what can I build a KB with".
+
+ Args:
+ body (ListEmbeddingModelsRequest): The request body.
+
+ Returns:
+ `ListEmbeddingModelsResponse`: The response body.
+ """
+ credential_cls = CredentialFactory.get_credential_class(body.provider)
+ if credential_cls is None:
+ raise HTTPException(
+ status_code=status.HTTP_404_NOT_FOUND,
+ detail=f"Provider '{body.provider}' not found.",
+ )
+
+ embedding_cls = credential_cls.get_embedding_model_class()
+ # Providers without embedding support report an empty catalogue
+ # rather than 404 — "none available" is a valid answer here.
+ models = [] if embedding_cls is None else embedding_cls.list_models()
+ return ListEmbeddingModelsResponse(models=models, total=len(models))
diff --git a/src/agentscope/app/_router/_schema/__init__.py b/src/agentscope/app/_router/_schema/__init__.py
index dc11f6bda..b96f588a6 100644
--- a/src/agentscope/app/_router/_schema/__init__.py
+++ b/src/agentscope/app/_router/_schema/__init__.py
@@ -13,6 +13,10 @@ from ._workspace import (
MCPClientStatus,
ToolInfo,
)
+from ._embedding_model import (
+ ListEmbeddingModelsResponse,
+ ListEmbeddingModelsRequest,
+)
from ._model import ListModelsResponse, ListModelsRequest
from ._tts_model import ListTTSModelsResponse, ListTTSModelsRequest
from ._schedule import (
@@ -114,6 +118,8 @@ __all__ = [
"UpdateKnowledgeBaseRequest",
"UploadKnowledgeDocumentResponse",
# Model
+ "ListEmbeddingModelsRequest",
+ "ListEmbeddingModelsResponse",
"ListModelsRequest",
"ListModelsResponse",
# TTS Model
diff --git a/src/agentscope/app/_router/_schema/_embedding_model.py b/src/agentscope/app/_router/_schema/_embedding_model.py
new file mode 100644
index 000000000..bae867062
--- /dev/null
+++ b/src/agentscope/app/_router/_schema/_embedding_model.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+"""The embedding model configuration, used as DTO layer."""
+
+from pydantic import BaseModel, Field
+
+from ....embedding import EmbeddingModelCard
+
+
+class ListEmbeddingModelsResponse(BaseModel):
+ """List the candidate embedding models response."""
+
+ models: list[EmbeddingModelCard] = Field(
+ description="The candidate embedding models.",
+ )
+ total: int = Field(description="The total number of candidates.")
+
+
+class ListEmbeddingModelsRequest(BaseModel):
+ """List the candidate embedding models request."""
+
+ provider: str = Field(
+ description="The provider type, e.g. openai, dashscope, etc.",
+ )