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
@@ -31,6 +31,12 @@ export const assetUserInfoSchema = z.object({
})
export type AssetUserInfo = z.infer<typeof assetUserInfoSchema>
export const assetAgentInfoSchema = z.object({
id: z.string(),
name: z.string(),
})
export type AssetAgentInfo = z.infer<typeof assetAgentInfoSchema>
export const fieldValueInfoSchema = z.object({
fieldId: z.string(),
@@ -70,6 +76,8 @@ export const assetInfoSchema = z.object({
deletedAt: z.string().nullable().optional(),
projectId: z.string().optional().nullable(),
creator: assetUserInfoSchema.nullable().optional(),
agentId: z.string().optional().nullable(),
agent: assetAgentInfoSchema.optional().nullable(),
fieldValues: z.array(fieldValueInfoSchema).optional(),
sortIndex: z.string().optional().nullable(),
startTime: z.number().optional().nullable(),
@@ -129,6 +137,7 @@ export const assetInfoSchema = z.object({
})
.nullable()
.optional(),
agent: assetAgentInfoSchema.optional().nullable(),
}),
),
})
@@ -146,6 +155,7 @@ export const createAssetRequestSchema = z.object({
sizeByte: z.number().optional(),
contentType: z.string().optional(),
creatorId: z.string().optional(),
agentId: z.string().optional(),
})
export type CreateAssetRequest = z.infer<typeof createAssetRequestSchema>
+12
View File
@@ -70,6 +70,14 @@ export const auditLogSchema = z.object({
action: z.nativeEnum(AuditAction),
teamId: z.string(),
userId: z.string().nullable().optional(),
agentId: z.string().nullable().optional(),
agent: z
.object({
id: z.string(),
name: z.string(),
})
.nullable()
.optional(),
projectId: z.string().nullable().optional(),
itemId: z.string().nullable().optional(),
createdAt: z.string(),
@@ -88,6 +96,10 @@ export const listAuditLogsQuerySchema = z.object({
.union([z.string(), z.array(z.string())])
.transform((val) => (Array.isArray(val) ? val : [val]))
.optional(),
agentIds: z
.union([z.string(), z.array(z.string())])
.transform((val) => (Array.isArray(val) ? val : [val]))
.optional(),
itemId: z.string().optional(),
})
+7
View File
@@ -42,5 +42,12 @@ export const stackVersionInfoSchema = z.object({
})
.nullable()
.optional(),
agent: z
.object({
id: z.string(),
name: z.string(),
})
.nullable()
.optional(),
})
export type StackVersionInfo = z.infer<typeof stackVersionInfoSchema>