feat(asset): record and display agent provenance on assets and audit logs (#380)

* feat(asset): record and display agent provenance on assets and audit logs

* style(webui): apply 30% translucent frosted glass background to bot badges

* style(webui): match bot icon badge style to thumbnail media overlay (bg-black/60 text-white)

* style(webui): use "AI" text badge with pdf overlay style instead of bot icon
This commit is contained in:
Yiling-J
2026-09-04 11:27:52 +08:00
committed by GitHub
parent 52330869a2
commit dd0ea05a88
39 changed files with 1699 additions and 108 deletions
+10
View File
@@ -8,6 +8,7 @@ export interface LogActionParams {
action: AuditAction
teamId: string
userId?: string
agentId?: string
projectId?: string
itemId?: string
}
@@ -16,6 +17,7 @@ export interface ListAuditLogsParams {
teamId: string
actions?: AuditAction[]
userIds?: string[]
agentIds?: string[]
itemId?: string
first?: number
after?: string
@@ -29,6 +31,7 @@ export class AuditLogService {
action: params.action,
teamId: params.teamId,
userId: params.userId,
agentId: params.agentId,
projectId: params.projectId,
itemId: params.itemId,
},
@@ -52,6 +55,10 @@ export class AuditLogService {
where.userId = { in: params.userIds }
}
if (params.agentIds && params.agentIds.length > 0) {
where.agentId = { in: params.agentIds }
}
if (params.itemId && params.itemId.trim() !== '') {
where.itemId = { contains: params.itemId.trim(), mode: 'insensitive' }
}
@@ -60,6 +67,7 @@ export class AuditLogService {
(skip, take) =>
prisma.auditLog.findMany({
where,
include: { agent: { include: { user: true } } },
orderBy: { id: 'desc' },
skip,
take,
@@ -74,6 +82,8 @@ export class AuditLogService {
action: item.action,
teamId: item.teamId,
userId: item.userId,
agentId: item.agentId,
agent: item.agent ? { id: item.agent.id, name: item.agent.user.name } : null,
projectId: item.projectId,
itemId: item.itemId,
createdAt: item.createdAt.toISOString(),