feat: add governed chat console

This commit is contained in:
thanhnv
2026-07-08 21:14:40 +09:00
parent 3be9970c15
commit 5561bcf864
28 changed files with 2023 additions and 43 deletions
@@ -0,0 +1,24 @@
import { Body, Controller, Get, Headers, Inject, Post } from '@nestjs/common';
import { ok } from '../common/api-response.js';
import { actorFromHeaders } from '../common/auth-context.js';
import { ChatAskInput, ChatService } from './chat.service.js';
@Controller('api/v1/chat')
export class ChatController {
constructor(@Inject(ChatService) private readonly svc: ChatService) {}
@Post('ask')
ask(@Headers() headers: Record<string, string | string[] | undefined>, @Body() body: ChatAskInput) {
return ok(this.svc.ask(body, actorFromHeaders(headers)));
}
@Get('audit/verify')
verifyAudit() {
return ok(this.svc.verifyAudit());
}
@Get('actions')
actions(@Headers() headers: Record<string, string | string[] | undefined>) {
return ok(this.svc.listActions(actorFromHeaders(headers)));
}
}