feat: 持久化 Agent 调用记录

- src/agent: 新增 AgentInvocationRepository,统一封装 Prisma 落库和本地降级存储
- src/agent/agent.service.ts: 创建 Agent 调用后写入数据库,并按项目权限过滤历史列表
- src/agent/agent.module.ts: 注册 Agent 调用记录仓储依赖
This commit is contained in:
湛兮
2026-06-12 05:55:12 +08:00
parent 9343e74b2c
commit 1d15c1c676
5 changed files with 300 additions and 27 deletions
+4 -2
View File
@@ -26,8 +26,10 @@ export class AgentController {
@Get()
@ApiOkResponse({ description: '查询 Agent 调用记录。' })
listInvocations(): AgentInvocation[] {
return this.agentService.listInvocations();
async listInvocations(
@CurrentUser() user: AuthenticatedUser,
): Promise<AgentInvocation[]> {
return this.agentService.listInvocations(user);
}
@Post()