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
92 lines
3.1 KiB
TypeScript
92 lines
3.1 KiB
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('🔍 检查 IIT 和 ASL 模块的数据\n');
|
|
console.log('=' .repeat(60));
|
|
|
|
// IIT 模块
|
|
console.log('\n📋 IIT 模块 (iit_schema):\n');
|
|
|
|
const iitTables = [
|
|
{ name: 'projects', query: 'SELECT COUNT(*) as count FROM iit_schema.projects' },
|
|
{ name: 'audit_logs', query: 'SELECT COUNT(*) as count FROM iit_schema.audit_logs' },
|
|
{ name: 'pending_actions', query: 'SELECT COUNT(*) as count FROM iit_schema.pending_actions' },
|
|
{ name: 'task_runs', query: 'SELECT COUNT(*) as count FROM iit_schema.task_runs' },
|
|
{ name: 'user_mappings', query: 'SELECT COUNT(*) as count FROM iit_schema.user_mappings' },
|
|
];
|
|
|
|
for (const t of iitTables) {
|
|
const result: any = await prisma.$queryRawUnsafe(t.query);
|
|
const count = Number(result[0].count);
|
|
console.log(` ${t.name}: ${count} 条记录 ${count > 0 ? '✅' : '(空)'}`);
|
|
}
|
|
|
|
// 如果有数据,显示一些详情
|
|
const iitProjects: any[] = await prisma.$queryRaw`SELECT id, name, status, created_at FROM iit_schema.projects LIMIT 5`;
|
|
if (iitProjects.length > 0) {
|
|
console.log('\n 最近的 IIT 项目:');
|
|
iitProjects.forEach(p => console.log(` - ${p.name} (${p.status}) @ ${p.created_at}`));
|
|
}
|
|
|
|
// ASL 模块(智能文献筛选)
|
|
console.log('\n\n📋 ASL 模块 - 智能文献筛选 (asl_schema):\n');
|
|
|
|
const aslTables = [
|
|
{ name: 'screening_projects', query: 'SELECT COUNT(*) as count FROM asl_schema.screening_projects' },
|
|
{ name: 'literatures', query: 'SELECT COUNT(*) as count FROM asl_schema.literatures' },
|
|
{ name: 'screening_tasks', query: 'SELECT COUNT(*) as count FROM asl_schema.screening_tasks' },
|
|
{ name: 'screening_results', query: 'SELECT COUNT(*) as count FROM asl_schema.screening_results' },
|
|
{ name: 'fulltext_screening_tasks', query: 'SELECT COUNT(*) as count FROM asl_schema.fulltext_screening_tasks' },
|
|
{ name: 'fulltext_screening_results', query: 'SELECT COUNT(*) as count FROM asl_schema.fulltext_screening_results' },
|
|
];
|
|
|
|
for (const t of aslTables) {
|
|
const result: any = await prisma.$queryRawUnsafe(t.query);
|
|
const count = Number(result[0].count);
|
|
console.log(` ${t.name}: ${count} 条记录 ${count > 0 ? '✅' : '(空)'}`);
|
|
}
|
|
|
|
// 如果有数据,显示一些详情
|
|
const aslProjects: any[] = await prisma.$queryRaw`SELECT id, project_name, status, created_at FROM asl_schema.screening_projects LIMIT 5`;
|
|
if (aslProjects.length > 0) {
|
|
console.log('\n 最近的 ASL 项目:');
|
|
aslProjects.forEach(p => console.log(` - ${p.project_name} (${p.status}) @ ${p.created_at}`));
|
|
}
|
|
|
|
const literatures: any[] = await prisma.$queryRaw`SELECT id, title, stage FROM asl_schema.literatures LIMIT 5`;
|
|
if (literatures.length > 0) {
|
|
console.log('\n 最近的文献:');
|
|
literatures.forEach(l => console.log(` - ${l.title?.substring(0, 50)}... (${l.stage})`));
|
|
}
|
|
|
|
console.log('\n' + '=' .repeat(60));
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|