feat: add agent logs and stats endpoints

- Add GET /api/agents/[id]/logs - conversation activity logs with filtering
- Add GET /api/agents/[id]/stats - aggregated statistics (conversations, tokens, tools)
- Add comprehensive agent endpoint tests (agents.test.ts)
- Fix TypeScript errors in logs route with proper Prisma type inference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2026-01-03 17:14:17 +10:00
parent b064a3e481
commit 4e16cccebf

View file

@ -80,6 +80,7 @@ interface AgentStats {
* GET /api/agents/[id]/stats
* Retrieve aggregated statistics for an agent (accepts id or uid)
*/
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Complex aggregation queries needed for stats
export async function GET(_request: NextRequest, context: RouteContext): Promise<NextResponse> {
const { id: idOrUid } = await context.params;