refactor(ux): consolidate BMAD skills, update design system, and clean up Prisma generated client

This commit is contained in:
Sepehr Ramezani
2026-04-19 19:21:27 +02:00
parent 5296c4da2c
commit 25529a24b8
2476 changed files with 127934 additions and 101962 deletions

View File

@@ -1,6 +1,5 @@
generator client {
provider = "prisma-client-js"
output = "./client-generated"
binaryTargets = ["debian-openssl-1.1.x", "native"]
}
@@ -18,6 +17,7 @@ model User {
role String @default("USER")
image String?
theme String @default("light")
cardSizeMode String @default("variable")
resetToken String? @unique
resetTokenExpiry DateTime?
createdAt DateTime @default(now())
@@ -32,6 +32,10 @@ model User {
notebooks Notebook[]
sessions Session[]
aiSettings UserAISettings?
agents Agent[]
workflows Workflow[]
conversations Conversation[]
canvases Canvas[]
}
model Account {
@@ -81,6 +85,9 @@ model Notebook {
updatedAt DateTime @updatedAt
labels Label[]
notes Note[]
agents Agent[]
workflows Workflow[]
conversations Conversation[]
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId, order])
@@ -111,6 +118,7 @@ model Note {
color String @default("default")
isPinned Boolean @default(false)
isArchived Boolean @default(false)
trashedAt DateTime?
type String @default("text")
dismissedFromRecent Boolean @default(false)
checkItems String?
@@ -147,6 +155,7 @@ model Note {
@@index([isPinned])
@@index([isArchived])
@@index([trashedAt])
@@index([order])
@@index([reminder])
@@index([userId])
@@ -251,3 +260,122 @@ model NoteEmbedding {
@@index([noteId])
}
// ============================================================================
// NEW MODELS FOR AGENTIC SYSTEM & LAB
// ============================================================================
model Agent {
id String @id @default(cuid())
name String
description String?
type String? @default("scraper") // scraper, researcher, monitor, custom
role String // System prompt / Persona
sourceUrls String? // JSON list of URLs to scrape
frequency String @default("manual") // manual, hourly, daily, weekly, monthly
lastRun DateTime?
nextRun DateTime?
isEnabled Boolean @default(true)
targetNotebookId String?
sourceNotebookId String? // For monitor type: notebook to watch
tools String? @default("[]") // JSON array: ["web_search", "note_search", ...]
maxSteps Int @default(10) // Max tool-use iterations
notifyEmail Boolean @default(false) // Send email notification after execution
includeImages Boolean @default(false) // Extract images from scraped pages
userId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
notebook Notebook? @relation(fields: [targetNotebookId], references: [id])
actions AgentAction[]
@@index([userId])
@@index([isEnabled])
}
model AgentAction {
id String @id @default(cuid())
agentId String
status String @default("pending") // pending, running, success, failure
result String? // ID of the created note or summary message
log String? // Error message or execution log
input String? // JSON: prompt initial + config
toolLog String? // JSON: trace [{step, toolCalls, toolResults}]
tokensUsed Int? // Token consumption
createdAt DateTime @default(now())
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
@@index([agentId])
}
model Conversation {
id String @id @default(cuid())
title String?
userId String
notebookId String? // Optional context
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
notebook Notebook? @relation(fields: [notebookId], references: [id])
messages ChatMessage[]
@@index([userId])
@@index([notebookId])
}
model ChatMessage {
id String @id @default(cuid())
conversationId String
role String // user, assistant, system
content String
createdAt DateTime @default(now())
conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
@@index([conversationId])
}
model Canvas {
id String @id @default(cuid())
name String
data String // Large JSON blob for tldraw state
userId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
}
// ============================================================================
// VISUAL WORKFLOW BUILDER
// ============================================================================
model Workflow {
id String @id @default(cuid())
name String
description String?
graph String @default("{\"nodes\":[],\"edges\":[]}") // JSON: React Flow nodes[] + edges[]
isEnabled Boolean @default(true)
userId String
notebookId String? // default target notebook for Create Note nodes
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
notebook Notebook? @relation(fields: [notebookId], references: [id])
runs WorkflowRun[]
@@index([userId])
@@index([isEnabled])
}
model WorkflowRun {
id String @id @default(cuid())
workflowId String
status String @default("running") // running, success, failure
log String? // JSON: per-node status + timing
createdAt DateTime @default(now())
workflow Workflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
@@index([workflowId])
@@index([status])
}