feat(agent): replace isAi with sessionId & implement admin logs UI

This commit is contained in:
yiling
2026-05-21 14:58:31 +08:00
parent 2a4594d986
commit 161ba3a466
24 changed files with 781 additions and 91 deletions
@@ -0,0 +1,12 @@
/*
Warnings:
- You are about to drop the column `is_ai` on the `asset_comments` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "asset_comments" DROP COLUMN "is_ai",
ADD COLUMN "session_id" TEXT;
-- AddForeignKey
ALTER TABLE "asset_comments" ADD CONSTRAINT "asset_comments_session_id_fkey" FOREIGN KEY ("session_id") REFERENCES "agent_sessions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+3 -1
View File
@@ -429,7 +429,8 @@ model AssetComment {
/// [AnnotationList]
annotation Json?
second Float?
isAi Boolean @default(false) @map("is_ai")
sessionId String? @map("session_id")
session AgentSession? @relation(fields: [sessionId], references: [id], onDelete: SetNull)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@ -652,6 +653,7 @@ model AgentSession {
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
entries AgentSessionEntry[]
comments AssetComment[]
@@map("agent_sessions")
}