diff --git a/src/App.tsx b/src/App.tsx index ee936e4..0e28c55 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import { auth } from './auth' import { api } from './api' import { LoginPage, ChangePasswordGate } from './components/LoginPage' import { AdminUsersModal, ChangePasswordModal } from './components/AdminUsersModal' -import { Icon } from './icons' +import { Icon } from '@ui' import { store, useStore } from './store' import { TaskSidebar } from './components/TaskSidebar' import { Conversation } from './components/Conversation' diff --git a/src/components/AdminUsersModal.tsx b/src/components/AdminUsersModal.tsx index 3064fa2..da8c592 100644 --- a/src/components/AdminUsersModal.tsx +++ b/src/components/AdminUsersModal.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react' import { api } from '../api' import { store, useStore } from '../store' -import { Icon } from '../icons' +import { Icon, Avatar } from '@ui' import { randomPassword } from '../passwords' interface AdminUserRow { owner: string; name: string; isAdmin: boolean; mustChangePassword: boolean; hasPassword: boolean; passwordSetAt?: string; createdAt: string } @@ -100,7 +100,7 @@ export function AdminUsersModal({ onClose }: { onClose: () => void }) { {(users ?? []).map(u => ( - {u.owner} + {u.owner} {u.name || '—'} {u.isAdmin ? ADMIN : USER} {u.mustChangePassword ? 待改密 : u.hasPassword ? '正常' : '未设密码'} diff --git a/src/components/Conversation.tsx b/src/components/Conversation.tsx index ec356dd..41c8103 100644 --- a/src/components/Conversation.tsx +++ b/src/components/Conversation.tsx @@ -1,5 +1,5 @@ // 中栏:消息流(Part 渲染器注册表)+ 流式渲染 + 过程折叠 + HITL 卡片 + 输入区(4.4)。 -import { Icon } from '../icons' +import { Icon, Avatar, BrandMark } from '@ui' import { useEffect, useMemo, useRef, useState } from 'react' import { marked } from 'marked' import { api } from '../api' @@ -97,6 +97,7 @@ function AssistantMessage({ msg, live }: { msg: Message; live?: LiveState | null return (
+ 助手 {live && {live.phase}}
@@ -216,6 +217,7 @@ export function Conversation() { const currentConvId = useStore(s => s.currentConvId) const conversation = useStore(s => s.tasks.find(c => c.id === s.currentConvId)) const messages = useStore(s => s.messages) + const myName = useStore(s => s.me?.name || s.me?.owner || '你') const activeHitl = useStore(s => s.activeHitl) const live = useStore(s => s.live) const runs = useStore(s => s.runs) @@ -290,7 +292,9 @@ export function Conversation() { const anchored = cards.filter(c => c.anchorMessageId === m.id && c.kind === 'confirm') return (
-
你
+
+ 你 +
{m.parts.filter(p => p.type === 'text').map(p => p.text).join('\n')}
{anchored.map(c => ( { if (e.target === e.currentTarget) store.openSettings(false) }}> -
-
- ⚙ 设置 -
- {(['settings', 'profiles', 'plugins'] as Section[]).map(s => ( - - ))} -
- - {saved && 已保存} - -
-
+ setSection(k as Section)} + onClose={() => store.openSettings(false)} + sections={[ + { key: 'settings', label: '常规', icon: 'settings' }, + { key: 'profiles', label: '智能体画像', icon: 'bot', badge: profiles.length || undefined }, + { key: 'plugins', label: '插件', icon: 'puzzle' }, + ]} + footer={saved ? ✓ 已保存 : 'Agent-System · 设置中心'} + > +
{section === 'settings' && ( <> {Object.entries(groups).map(([g, descs]) => ( @@ -77,14 +73,13 @@ export function SettingsModal() { ))}
))} - + 保存设置 )} {section === 'profiles' && } {section === 'plugins' && } -
-
+ ) } @@ -135,7 +130,7 @@ function ProfilesSection({ profiles }: { profiles: AgentProfile[] }) { return (
- + { setEditing(newProfile()); setText('') }}>新建画像