feat: refactor HomePage to integrate agents store and update related components

feat: add runtime event handling for providers in ProvidersSection

feat: update routing to include Channels and Agents pages

feat: extend route types and navigation items for Channels and Agents

feat: implement agents store for managing agent data and interactions

fix: update chat store to utilize agents store for agent-related functionality

chore: export agents store from index

fix: enhance runtime types for better event handling

fix: update Vite config to handle dev server URL correctly
This commit is contained in:
duanshuwen
2026-04-18 14:56:32 +08:00
parent dfa4388087
commit ee72cf7261
52 changed files with 6626 additions and 189 deletions

View File

@@ -7,6 +7,8 @@ import { RedirectAuthenticated, RequireAuth, isAuthenticated } from './auth';
import { onAuthLogout } from './auth-session';
const HomePage = lazy(() => import('../pages/Home'));
const ChannelsPage = lazy(() => import('../pages/Channels'));
const AgentsPage = lazy(() => import('../pages/Agents'));
const ModelsPage = lazy(() => import('../pages/Models'));
const SkillsPage = lazy(() => import('../pages/Skills'));
const CronPage = lazy(() => import('../pages/Cron'));
@@ -62,8 +64,9 @@ export function AppRouter() {
<Route element={<RequireAuth />}>
<Route element={<MainLayout />}>
<Route path="/home" element={renderLazyPage(<HomePage />)} />
<Route path="/channels" element={renderLazyPage(<ChannelsPage />)} />
<Route path="/agents" element={renderLazyPage(<AgentsPage />)} />
<Route path="/models" element={renderLazyPage(<ModelsPage />)} />
<Route path="/agents" element={<Navigate to="/models" replace />} />
<Route path="/skills" element={renderLazyPage(<SkillsPage />)} />
<Route path="/cron" element={renderLazyPage(<CronPage />)} />
<Route path="/scripts" element={renderLazyPage(<ScriptsPage />)} />

View File

@@ -1,5 +1,7 @@
export type AppPath =
| '/home'
| '/channels'
| '/agents'
| '/models'
| '/skills'
| '/cron'
@@ -15,6 +17,8 @@ export type NavItem = {
labelKey:
| 'sidebar.home'
| 'sidebar.knowledge'
| 'sidebar.channels'
| 'sidebar.agents'
| 'sidebar.models'
| 'sidebar.skills'
| 'sidebar.cron'
@@ -27,6 +31,8 @@ export const DEFAULT_PATH: WorkspacePath = '/home';
export const NAV_ITEMS: NavItem[] = [
{ path: '/home', labelKey: 'sidebar.home' },
{ path: '/knowledge', labelKey: 'sidebar.knowledge' },
{ path: '/channels', labelKey: 'sidebar.channels' },
{ path: '/agents', labelKey: 'sidebar.agents' },
{ path: '/models', labelKey: 'sidebar.models' },
{ path: '/skills', labelKey: 'sidebar.skills' },
{ path: '/cron', labelKey: 'sidebar.cron' },
@@ -37,13 +43,14 @@ export const NAV_ITEMS: NavItem[] = [
export function normalizeWorkspacePath(pathname: string): WorkspacePath {
switch (pathname) {
case '/knowledge':
case '/models':
case '/channels':
case '/agents':
case '/models':
case '/skills':
case '/cron':
case '/scripts':
case '/setting':
return pathname === '/agents' ? '/models' : pathname;
return pathname;
case '/home':
default:
return DEFAULT_PATH;