fix(toolset): 启动时自动补种系统工具集,工具集页面移至智能体侧边栏

- init_state_machine 启动时检查 DB 并补种 system_basic/system_chat/system_workflow
- 修复 postgres facade 缺少 is_system/category 参数的问题
- 前端工具集从"插件"独立为侧边栏"工具集"tab,位于智能体和插件之间

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 18:25:43 +00:00
parent 0e57c5cf16
commit ac363bc6bc
7 changed files with 65 additions and 28 deletions
+7
View File
@@ -6,6 +6,7 @@ import { SetupGuideModal } from './components/Layout/SetupGuideModal';
import { SettingsLayout } from './components/Settings/SettingsLayout';
import { AgentLayout } from './components/Agent/AgentLayout';
import { PluginLayout } from './components/Plugin/PluginLayout';
import { ToolSettings } from './components/Plugin/ToolSettings';
import { WorkflowConfigSettings } from './components/Agent/WorkflowConfigSettings';
import { SystemLogsView } from './components/Agent/SystemLogsView';
import { LeftPanel } from './components/Chat/LeftPanel';
@@ -97,6 +98,12 @@ function App() {
{mode === 'agent' && agentTab === 'agents' && <AgentLayout />}
{mode === 'agent' && agentTab === 'toolsets' && (
<div className="flex-1 overflow-y-auto p-8">
<ToolSettings />
</div>
)}
{mode === 'agent' && agentTab === 'plugin' && <PluginLayout />}
{mode === 'agent' && agentTab === 'config' && (
@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next';
import { MessageSquare, Workflow, Box, Bot, ChevronLeft, ChevronRight, Settings, ScrollText } from 'lucide-react';
import { MessageSquare, Workflow, Box, Bot, ChevronLeft, ChevronRight, Settings, ScrollText, Wrench } from 'lucide-react';
import { useAppStore } from '../../store/useAppStore';
export function CollapsibleSidebar() {
@@ -20,8 +20,9 @@ export function CollapsibleSidebar() {
{ key: 'workflow', label: t('nav.workflow'), icon: Workflow },
]
: [
{ key: 'plugin', label: t('nav.plugin'), icon: Box },
{ key: 'agents', label: t('nav.agents'), icon: Bot },
{ key: 'toolsets', label: t('nav.toolsets'), icon: Wrench },
{ key: 'plugin', label: t('nav.plugin'), icon: Box },
{ key: 'config', label: t('nav.config'), icon: Settings },
{ key: 'logs', label: t('nav.logs'), icon: ScrollText },
];
@@ -1,37 +1,16 @@
import { useTranslation } from 'react-i18next';
import { useAppStore } from '../../store/useAppStore';
import { SkillSettings } from './SkillSettings';
import { ToolSettings } from './ToolSettings';
export function PluginLayout() {
const { t } = useTranslation();
const { resourceTab, setResourceTab } = useAppStore();
const tabs = [
{ key: 'skill', label: t('agent.skills') },
{ key: 'tool', label: t('agent.tools') },
];
return (
<div className="flex-1 flex flex-col bg-bg-secondary overflow-hidden">
<div className="h-12 border-b border-border-primary bg-bg-card/80 backdrop-blur flex items-center px-6 shrink-0 gap-1">
{tabs.map((tab) => (
<button
key={tab.key}
onClick={() => setResourceTab(tab.key)}
className={`px-4 py-2 text-xs font-semibold rounded-lg transition-all ${
resourceTab === tab.key
? 'bg-accent-light text-accent'
: 'text-text-muted hover:text-text-secondary hover:bg-bg-hover'
}`}
>
{tab.label}
</button>
))}
<div className="h-12 border-b border-border-primary bg-bg-card/80 backdrop-blur flex items-center px-6 shrink-0">
<span className="text-xs font-semibold text-text-primary">{t('plugin.skillManagement')}</span>
</div>
<div className="flex-1 overflow-y-auto p-8">
{resourceTab === 'skill' && <SkillSettings />}
{resourceTab === 'tool' && <ToolSettings />}
<SkillSettings />
</div>
</div>
);
+1
View File
@@ -10,6 +10,7 @@
"workflow": "Workflow",
"plugin": "Plugin",
"agents": "Agents",
"toolsets": "Toolsets",
"config": "Config",
"logs": "Logs",
"settings": "Settings"
+1
View File
@@ -10,6 +10,7 @@
"workflow": "工作流",
"plugin": "插件",
"agents": "智能体",
"toolsets": "工具集",
"config": "配置",
"logs": "日志",
"settings": "设置"