feat(dashboard): tableau de bord Second Brain configurable avec chargement progressif
Briefing granulaire, pistes rapides puis enrichissement async, layout persisté v5, suggestions agents, intégration Gmail et navigation sidebar alignée sur /home. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
30
memento-note/app/api/agents/suggestions/route.ts
Normal file
30
memento-note/app/api/agents/suggestions/route.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { auth } from '@/auth'
|
||||
import { agentSuggestionService } from '@/lib/ai/services/agent-suggestion.service'
|
||||
|
||||
export async function GET() {
|
||||
const session = await auth()
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
||||
}
|
||||
|
||||
const suggestions = await agentSuggestionService.getPending(session.user.id, 3)
|
||||
return NextResponse.json({
|
||||
suggestions: suggestions.map(s => ({
|
||||
id: s.id,
|
||||
topic: s.topic,
|
||||
reason: s.reason,
|
||||
suggestedType: s.suggestedType,
|
||||
suggestedFrequency: s.suggestedFrequency,
|
||||
relatedNoteCount: (() => {
|
||||
try {
|
||||
return JSON.parse(s.relatedNoteIds).length
|
||||
} catch {
|
||||
return 0
|
||||
}
|
||||
})(),
|
||||
clusterId: s.clusterId,
|
||||
createdAt: s.createdAt.toISOString(),
|
||||
})),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user