diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 97312c1..33ed985 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -1703,3 +1703,39 @@ model UserAgentConfig { createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } + +model AgentTemplate { + id String @id @default(cuid()) + name String @unique // "jarvis", "builder", "medic" + displayName String // "Jarvis", "Builder", "Medic" + role String // "orchestrator" | "coding" | "monitoring" + personality String // SOUL.md content (markdown) + primaryModel String // "opus", "codex", "haiku" + fallbackModels Json @default("[]") // ["sonnet", "haiku"] + toolPermissions Json @default("[]") // ["exec", "read", "write", ...] + discordChannel String? // "jarvis", "builder", "medic-alerts" + isActive Boolean @default(true) + isDefault Boolean @default(false) // Include in new user provisioning + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model UserAgent { + id String @id @default(cuid()) + userId String + templateId String? // null = custom agent + name String // "jarvis", "builder", "medic" or custom + displayName String + role String + personality String // User can customize + primaryModel String? + fallbackModels Json @default("[]") + toolPermissions Json @default("[]") + discordChannel String? + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@unique([userId, name]) + @@index([userId]) +}