diff --git a/apps/api-gateway/cmd/main.go b/apps/api-gateway/cmd/main.go index ac72729..3649d6d 100644 --- a/apps/api-gateway/cmd/main.go +++ b/apps/api-gateway/cmd/main.go @@ -81,6 +81,13 @@ func main() { StripPrefix: false, Timeout: 60, }, + { + // 工具管理 API - 列表、创建、详情、更新、删除 + Path: "/api/tools", + ServiceName: "agent-service", + StripPrefix: false, + Timeout: 10, + }, } proxyManager.LoadRoutes(routes) diff --git a/apps/web/prisma/schema.prisma b/apps/web/prisma/schema.prisma deleted file mode 100644 index 82399cc..0000000 --- a/apps/web/prisma/schema.prisma +++ /dev/null @@ -1,74 +0,0 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" -} - -// Better-Auth user model -model user { - id String @id @default(cuid()) - email String? @unique - emailVerified Boolean? @default(false) - name String? - image String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - accounts account[] - sessions session[] -} - -// Better-Auth account model (for OAuth providers) -model account { - id String @id @default(cuid()) - userId String - providerId String - accountId String - accessToken String? @db.Text - refreshToken String? @db.Text - idToken String? @db.Text - accessTokenExpiresAt DateTime? - refreshTokenExpiresAt DateTime? - scope String? - password String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - user user @relation(fields: [userId], references: [id], onDelete: Cascade) - - @@unique([providerId, accountId]) - @@index([userId]) -} - -// Better-Auth session model -model session { - id String @id @default(cuid()) - userId String - token String @unique - expiresAt DateTime - ipAddress String? - userAgent String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - user user @relation(fields: [userId], references: [id], onDelete: Cascade) - - @@index([userId]) -} - -// Better-Auth verification model -model verification { - id String @id @default(cuid()) - identifier String - value String - expiresAt DateTime - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - @@unique([identifier, value]) -} diff --git a/apps/web/src/app/[locale]/(dashboard)/agents/components/AgentCard.tsx b/apps/web/src/app/[locale]/(dashboard)/agents/components/AgentCard.tsx index 88f506f..dfff6b1 100644 --- a/apps/web/src/app/[locale]/(dashboard)/agents/components/AgentCard.tsx +++ b/apps/web/src/app/[locale]/(dashboard)/agents/components/AgentCard.tsx @@ -20,10 +20,19 @@ import { Badge, } from '@/components/atoms' import { agentService, type Agent } from '@/service/agent' -import { Edit2, Trash2, Sparkles, Lock, Globe, Bot } from 'lucide-react' +import { + Edit2, + Trash2, + Sparkles, + Lock, + Globe, + Bot, + Settings, +} from 'lucide-react' import { toast } from 'sonner' import { cn } from '@/lib/utils' import { formatDistanceToNow } from 'date-fns' +import { ConfigureToolsModal } from './ConfigureToolsModal' interface AgentCardProps { agent: Agent @@ -33,6 +42,7 @@ interface AgentCardProps { export function AgentCard({ agent, onUpdate }: AgentCardProps) { const t = useTranslations('Agent') const [showDeleteDialog, setShowDeleteDialog] = useState(false) + const [showToolsModal, setShowToolsModal] = useState(false) const [isDeleting, setIsDeleting] = useState(false) const handleDelete = async () => { @@ -134,6 +144,15 @@ export function AgentCard({ agent, onUpdate }: AgentCardProps) { {/* Actions */}