feat(aia): Implement Protocol Agent MVP with reusable Agent framework
Sprint 1-3 Completed (Backend + Frontend): Backend (Sprint 1-2): - Implement 5-layer Agent framework (Query->Planner->Executor->Tools->Reflection) - Create agent_schema with 6 tables (agent_definitions, stages, prompts, sessions, traces, reflexion_rules) - Create protocol_schema with 2 tables (protocol_contexts, protocol_generations) - Implement Protocol Agent core services (Orchestrator, ContextService, PromptBuilder) - Integrate LLM service adapter (DeepSeek/Qwen/GPT-5/Claude) - 6 API endpoints with full authentication - 10/10 API tests passed Frontend (Sprint 3): - Add Protocol Agent entry in AgentHub (indigo theme card) - Implement ProtocolAgentPage with 3-column layout - Collapsible sidebar (Gemini style, 48px <-> 280px) - StatePanel with 5 stage cards (scientific_question, pico, study_design, sample_size, endpoints) - ChatArea with sync button and action cards integration - 100% prototype design restoration (608 lines CSS) - Detailed endpoints structure: baseline, exposure, outcomes, confounders Features: - 5-stage dialogue flow for research protocol design - Conversation-driven interaction with sync-to-protocol button - Real-time context state management - One-click protocol generation button (UI ready, backend pending) Database: - agent_schema: 6 tables for reusable Agent framework - protocol_schema: 2 tables for Protocol Agent - Seed data: 1 agent + 5 stages + 9 prompts + 4 reflexion rules Code Stats: - Backend: 13 files, 4338 lines - Frontend: 14 files, 2071 lines - Total: 27 files, 6409 lines Status: MVP core functionality completed, pending frontend-backend integration testing Next: Sprint 4 - One-click protocol generation + Word export
This commit is contained in:
@@ -208,6 +208,62 @@
|
||||
transform: translate(2px, -2px);
|
||||
}
|
||||
|
||||
/* === Indigo主题(Protocol Agent 全流程) === */
|
||||
.agent-card.theme-indigo {
|
||||
background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
|
||||
border-color: #C7D2FE;
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo:hover {
|
||||
border-color: #6366F1;
|
||||
background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
|
||||
box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo .icon-box {
|
||||
background-color: #6366F1;
|
||||
border-color: #4F46E5;
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo .agent-icon {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo:hover .icon-box {
|
||||
background-color: #4F46E5;
|
||||
border-color: #4338CA;
|
||||
transform: scale(1.08);
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo .num-watermark {
|
||||
color: #C7D2FE;
|
||||
}
|
||||
|
||||
.agent-card.theme-indigo:hover .num-watermark {
|
||||
color: #A5B4FC;
|
||||
}
|
||||
|
||||
/* Protocol Agent 特殊标记 */
|
||||
.agent-card.protocol-agent-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.agent-card.protocol-agent-card::before {
|
||||
content: '测试';
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: #6366F1;
|
||||
background: #E0E7FF;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #C7D2FE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
--brand-teal: #0D9488;
|
||||
--brand-purple: #9333EA;
|
||||
--brand-yellow: #CA8A04;
|
||||
--brand-indigo: #6366F1;
|
||||
}
|
||||
|
||||
/* === 整体布局 === */
|
||||
@@ -182,6 +183,19 @@
|
||||
background-color: var(--brand-purple);
|
||||
}
|
||||
|
||||
.timeline-dot.theme-indigo {
|
||||
background-color: var(--brand-indigo);
|
||||
}
|
||||
|
||||
/* Protocol Agent 特殊样式 */
|
||||
.timeline-dot.protocol-dot {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
font-size: 14px;
|
||||
background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
|
||||
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
|
||||
}
|
||||
|
||||
.timeline-line {
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
@@ -220,6 +234,31 @@
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Beta徽章(Protocol Agent) */
|
||||
.beta-badge {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: var(--brand-indigo);
|
||||
background-color: #EEF2FF;
|
||||
border: 1px solid #C7D2FE;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Protocol Agent 阶段标题 */
|
||||
.protocol-title {
|
||||
color: var(--brand-indigo);
|
||||
}
|
||||
|
||||
/* Protocol Agent 网格(单列,宽度限制) */
|
||||
.protocol-grid {
|
||||
max-width: 340px;
|
||||
}
|
||||
|
||||
.agents-grid.grid-cols-1 {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
/* === 卡片网格 === */
|
||||
.agents-grid {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user