Refactor code structure for improved readability and maintainability

This commit is contained in:
catlog22
2026-02-28 22:32:07 +08:00
parent 19fb4d86c7
commit 67b2129f3c
60 changed files with 3002 additions and 643 deletions

View File

@@ -1,46 +1,89 @@
<template>
<div class="agent-orchestration">
<div class="orchestration-title">🤖 Agent Orchestration</div>
<div class="orchestration-title">
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="title-icon">
<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/>
</svg>
Agent Orchestration
</div>
<div class="agent-flow">
<!-- CLI Layer -->
<div class="flow-layer cli-layer">
<div class="layer-label">CLI Tools</div>
<div class="agents-row">
<div class="agent-card cli" @mouseenter="showTooltip('cli-explore')" @mouseleave="hideTooltip">🔍 Explore</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-plan')" @mouseleave="hideTooltip">📋 Plan</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-exec')" @mouseleave="hideTooltip"> Execute</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-discuss')" @mouseleave="hideTooltip">💬 Discuss</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-explore')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
Explore
</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-plan')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="8" y1="8" x2="16" y2="8"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="8" y1="16" x2="12" y2="16"/></svg>
Plan
</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-exec')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
Execute
</div>
<div class="agent-card cli" @mouseenter="showTooltip('cli-discuss')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg>
Discuss
</div>
</div>
</div>
<!-- Flow Arrow -->
<div class="flow-arrow"></div>
<div class="flow-arrow">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/>
</svg>
</div>
<!-- Development Layer -->
<div class="flow-layer dev-layer">
<div class="layer-label">Development</div>
<div class="agents-row">
<div class="agent-card dev" @mouseenter="showTooltip('code-dev')" @mouseleave="hideTooltip">👨💻 Code</div>
<div class="agent-card dev" @mouseenter="showTooltip('tdd')" @mouseleave="hideTooltip">🧪 TDD</div>
<div class="agent-card dev" @mouseenter="showTooltip('test-fix')" @mouseleave="hideTooltip">🔧 Fix</div>
<div class="agent-card dev" @mouseenter="showTooltip('code-dev')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
Code
</div>
<div class="agent-card dev" @mouseenter="showTooltip('tdd')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 3h6M12 3v7l-4 8h8l-4-8"/><circle cx="8" cy="20" r="1"/><circle cx="16" cy="20" r="1"/></svg>
TDD
</div>
<div class="agent-card dev" @mouseenter="showTooltip('test-fix')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"/></svg>
Fix
</div>
</div>
</div>
<!-- Flow Arrow -->
<div class="flow-arrow"></div>
<div class="flow-arrow">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/>
</svg>
</div>
<!-- Output Layer -->
<div class="flow-layer output-layer">
<div class="layer-label">Output</div>
<div class="agents-row">
<div class="agent-card doc" @mouseenter="showTooltip('doc-gen')" @mouseleave="hideTooltip">📄 Docs</div>
<div class="agent-card ui" @mouseenter="showTooltip('ui-design')" @mouseleave="hideTooltip">🎨 UI</div>
<div class="agent-card universal" @mouseenter="showTooltip('universal')" @mouseleave="hideTooltip">🌐 Universal</div>
<div class="agent-card doc" @mouseenter="showTooltip('doc-gen')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="14" y2="17"/></svg>
Docs
</div>
<div class="agent-card ui" @mouseenter="showTooltip('ui-design')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
UI
</div>
<div class="agent-card universal" @mouseenter="showTooltip('universal')" @mouseleave="hideTooltip">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"/></svg>
Universal
</div>
</div>
</div>
</div>
<div class="tooltip" v-if="tooltip" :class="{ visible: tooltip }">
{{ tooltipText }}
</div>
@@ -54,16 +97,16 @@ const tooltip = ref(false)
const tooltipText = ref('')
const tooltips = {
'cli-explore': 'cli-explore-agent: 代码库探索和语义搜索',
'cli-plan': 'cli-planning-agent: 任务规划和分解',
'cli-exec': 'cli-execution-agent: 命令执行和结果处理',
'cli-discuss': 'cli-discuss-agent: 多视角讨论和共识达成',
'code-dev': 'code-developer: 代码实现和开发',
'tdd': 'tdd-developer: 测试驱动开发',
'test-fix': 'test-fix-agent: 测试修复循环',
'doc-gen': 'doc-generator: 文档自动生成',
'ui-design': 'ui-design-agent: UI设计和设计令牌',
'universal': 'universal-executor: 通用任务执行器'
'cli-explore': 'cli-explore-agent: Codebase exploration & semantic search',
'cli-plan': 'cli-planning-agent: Task planning & decomposition',
'cli-exec': 'cli-execution-agent: Command execution & result handling',
'cli-discuss': 'cli-discuss-agent: Multi-perspective discussion & consensus',
'code-dev': 'code-developer: Code implementation & development',
'tdd': 'tdd-developer: Test-driven development',
'test-fix': 'test-fix-agent: Test-fix iteration loop',
'doc-gen': 'doc-generator: Auto documentation generation',
'ui-design': 'ui-design-agent: UI design & design tokens',
'universal': 'universal-executor: General-purpose task executor'
}
function showTooltip(key) {
@@ -88,6 +131,10 @@ function hideTooltip() {
}
.orchestration-title {
display: flex;
align-items: center;
justify-content: center;
gap: 0.6rem;
text-align: center;
font-size: 1.75rem;
font-weight: 700;
@@ -95,6 +142,10 @@ function hideTooltip() {
margin-bottom: 2.5rem;
}
.title-icon {
color: var(--vp-c-brand-1);
}
.agent-flow {
display: flex;
flex-direction: column;
@@ -125,6 +176,9 @@ function hideTooltip() {
}
.agent-card {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.8rem 1.5rem;
border-radius: 12px;
font-size: 0.9rem;
@@ -171,14 +225,13 @@ function hideTooltip() {
}
.flow-arrow {
color: var(--vp-c-divider);
font-size: 1.25rem;
animation: bounce 2s infinite;
color: var(--vp-c-text-4);
animation: arrowBounce 2s ease-in-out infinite;
}
@keyframes bounce {
0%, 100% { transform: translateY(0); opacity: 0.5; }
50% { transform: translateY(8px); opacity: 1; }
@keyframes arrowBounce {
0%, 100% { transform: translateY(0); opacity: 0.4; }
50% { transform: translateY(6px); opacity: 0.8; }
}
.tooltip {
@@ -203,11 +256,19 @@ function hideTooltip() {
opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
@media (max-width: 640px) {
.agent-orchestration {
padding: 2rem 1rem;
}
.agent-card {
padding: 0.6rem 1rem;
font-size: 0.8rem;