import { BaseCrudRepository } from '@aioia/core'; import { z } from 'zod'; import { Chatroom, Message } from '../schemas'; export interface MyChatroomLastMessage { content: string; createdAt: string; } export interface MyChatroomItem { id: string; companionId: string; lastMessage: MyChatroomLastMessage | null; } export interface GenerateResponse { messageId: string; content: string; } /** * Repository for Chatroom entities * Handles chatroom CRUD and message operations */ export declare class ChatroomRepository extends BaseCrudRepository { readonly resource = "chatrooms"; protected getDataSchema(): z.ZodObject<{ id: z.ZodString; companionId: z.ZodString; name: z.ZodString; language: z.ZodString; createdAt: z.ZodString; updatedAt: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; name: string; createdAt: string; updatedAt: string; companionId: string; language: string; }, { id: string; name: string; createdAt: string; updatedAt: string; companionId: string; language: string; }>; /** * Get messages from a chatroom * GET /chatrooms/{id}/messages */ getMessages(chatroomId: string, options?: { limit?: number; offset?: number; }, fetchOptions?: RequestInit): Promise; /** * Send a message to a chatroom * POST /chatrooms/{id}/messages * * Anonymous ID is automatically sent via httpOnly cookie. * * @param chatroomId - The chatroom ID * @param content - The message content * @param fetchOptions - Optional fetch options */ sendMessage(chatroomId: string, content: string, fetchOptions?: RequestInit): Promise; /** * Generate AI response for a chatroom with a specific companion * POST /chatrooms/{id}/companions/{companionId}/response */ generateResponse(chatroomId: string, companionId: string, fetchOptions?: RequestInit): Promise; /** * Generate initial AI response for an empty chatroom * POST /chatrooms/{id}/companions/{companionId}/initial-response * * Only works for chatrooms with no messages. * Returns 409 Conflict if the chatroom already has messages. */ generateInitialResponse(chatroomId: string, companionId: string, fetchOptions?: RequestInit): Promise; /** * Get the current user's chatroom list * GET /me/chatrooms */ getMyChatrooms(fetchOptions?: RequestInit): Promise; } //# sourceMappingURL=ChatroomRepository.d.ts.map