feat(sessions): add unified /sessions/messages entry point
Add SessionsService#routeIncomingMessage: if the user has an active non-completed session, route to its agent by status (only objective_discovery is implemented so far - any other status rejects with a clear 409 rather than failing silently); otherwise run the intent router first and only create a session + start Agent 1 when it detects a learning intent, replying as plain conversational Max (PERSONALITY_PROMPT only, no session) otherwise. Exposed as POST /sessions/messages (JWT-protected), the new single entry point the chat window should call instead of unconditionally creating a session on every message. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
dc368a32f0
commit
ce25d3f290
@@ -0,0 +1,26 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ObjectiveDraftDto } from './objective-message-response.dto';
|
||||
|
||||
export class RouteMessageResponseDto {
|
||||
@ApiProperty({
|
||||
enum: ['chat', 'learn'],
|
||||
description:
|
||||
'"chat" : reponse conversationnelle, aucune session creee. "learn" : une session de formation est active (nouvelle ou existante).',
|
||||
})
|
||||
type!: 'chat' | 'learn';
|
||||
|
||||
@ApiProperty({ description: 'Reponse de Max a afficher dans le chat.' })
|
||||
reply!: string;
|
||||
|
||||
@ApiProperty({
|
||||
required: false,
|
||||
description: 'Present uniquement si type="learn".',
|
||||
})
|
||||
sessionId?: number;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
ready?: boolean;
|
||||
|
||||
@ApiProperty({ type: ObjectiveDraftDto, required: false })
|
||||
draft?: ObjectiveDraftDto;
|
||||
}
|
||||
Reference in New Issue
Block a user