-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchats.module.ts
More file actions
25 lines (24 loc) · 1.21 KB
/
Copy pathchats.module.ts
File metadata and controls
25 lines (24 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Module } from '@nestjs/common';
import { AuthModule } from '../auth/auth.module';
import { ModelsModule } from '../models/models.module';
import { RunWorkerModule } from '../runs/run-worker.module';
import { RunsModule } from '../runs/runs.module';
import { ChatLoopService } from './chat-loop.service';
import { ChatsController } from './chats.controller';
import { ChatsService } from './chats.service';
import { MePromptsController } from './me-prompts.controller';
// HTTP endpoints are safe to expose only because SessionAuthGuard derives the tenant
// identity from a verified session. Controllers must never accept ownerUserId from
// client input; that would recreate the #61 tenant-impersonation IDOR.
//
// Boundary: chats owns the turn (validate, persist message + run, supersede);
// everything run-execution-shaped comes from RunWorkerModule (dispatch seam +
// stream bridge) and RunsModule (abort registry) — chats knows nothing about
// queues, workers, compaction, or titling.
@Module({
imports: [AuthModule, ModelsModule, RunsModule, RunWorkerModule],
controllers: [ChatsController, MePromptsController],
providers: [ChatsService, ChatLoopService],
exports: [ChatsService],
})
export class ChatsModule {}