import { CHAT_TITLE_MAX_LENGTH, storedMessageSchema, } from "@openstatus/db/src/schema"; import { z } from "zod"; export const CreateChatSessionInput = z.object({ firstMessage: storedMessageSchema, }); export type CreateChatSessionInput = z.infer; export const SetChatSessionMessagesInput = z.object({ sessionId: z.number().int(), // No `.min(1)` — replacing a session with an empty list is valid // (e.g. user wipes the conversation). messages: z.array(storedMessageSchema), }); export type SetChatSessionMessagesInput = z.infer< typeof SetChatSessionMessagesInput >; export const GetChatSessionInput = z.object({ sessionId: z.number().int(), }); export type GetChatSessionInput = z.infer; export const ListChatSessionsInput = z.object({}).strict(); export type ListChatSessionsInput = z.infer; export const DeleteChatSessionInput = z.object({ sessionId: z.number().int(), }); export type DeleteChatSessionInput = z.infer; export { CHAT_TITLE_MAX_LENGTH };