All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 37s
CI / test-python-backend-compliance (push) Successful in 38s
CI / test-python-document-crawler (push) Successful in 24s
CI / test-python-dsms-gateway (push) Successful in 19s
- SOUL-Dateien: System-Prompts aus Chat-Routen extrahiert nach agent-core/soul/*.soul.md - soul-reader.ts: Lese-/Schreib-API mit 30s TTL-Cache und Backup-Versionierung - agent-registry.ts: Statische Konfiguration der 2 Compliance-Agenten - 5 API-Routen: /api/sdk/agents (Liste, Detail, SOUL GET/PUT, Sessions, Statistiken) - 5 Frontend-Seiten: Dashboard, Detail mit SOUL-Editor, Architektur, Sessions, Statistiken - Sidebar: "Agenten" Link nach Architektur eingefügt - Wire-Up: compliance-advisor + drafting-engine lesen SOUL-Datei mit Fallback - Dockerfile: agent-core wird in Production-Image kopiert Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/**
|
|
* GET /api/sdk/agents — Liste aller Compliance-Agenten
|
|
*/
|
|
|
|
import { NextResponse } from 'next/server'
|
|
import { COMPLIANCE_AGENTS } from '@/lib/sdk/agents/agent-registry'
|
|
import { soulFileExists } from '@/lib/sdk/agents/soul-reader'
|
|
|
|
export async function GET() {
|
|
try {
|
|
// Check SOUL file existence for each agent and set status
|
|
const agents = await Promise.all(
|
|
COMPLIANCE_AGENTS.map(async (agent) => {
|
|
const exists = await soulFileExists(agent.id)
|
|
return {
|
|
...agent,
|
|
status: exists ? agent.status : 'error' as const,
|
|
}
|
|
})
|
|
)
|
|
|
|
const activeCount = agents.filter(a => a.status === 'active').length
|
|
const errorCount = agents.filter(a => a.status === 'error').length
|
|
|
|
return NextResponse.json({
|
|
agents,
|
|
stats: {
|
|
total: agents.length,
|
|
active: activeCount,
|
|
inactive: agents.length - activeCount - errorCount,
|
|
error: errorCount,
|
|
totalSessions: 0,
|
|
avgResponseTime: '—',
|
|
},
|
|
timestamp: new Date().toISOString(),
|
|
})
|
|
} catch (error) {
|
|
console.error('Error fetching agents:', error)
|
|
return NextResponse.json({ error: 'Failed to fetch agents' }, { status: 500 })
|
|
}
|
|
}
|