import { z } from "zod";
const aiChatPageContextSchema = z.object({
  pageId: z.string().min(1).max(256).optional(),
  entityType: z.string().min(1).max(256).optional(),
  recordId: z.string().min(1).max(256).optional()
}).passthrough();
const aiAgentIdSchema = z.string().trim().min(1, "agentId must be a non-empty string").max(256, "agentId exceeds the maximum length of 256 characters");
const conversationIdSchema = z.string().trim().min(1, "conversationId must be a non-empty string").max(128, "conversationId exceeds the maximum length of 128 characters");
const titleSchema = z.string().trim().min(1).max(200);
const aiChatConversationCreateSchema = z.object({
  agentId: aiAgentIdSchema,
  conversationId: conversationIdSchema.optional(),
  title: titleSchema.optional(),
  pageContext: aiChatPageContextSchema.nullable().optional()
});
const aiChatConversationListQuerySchema = z.object({
  agent: aiAgentIdSchema.optional(),
  status: z.enum(["open", "closed"]).optional(),
  limit: z.coerce.number().int().min(1).max(100).optional(),
  cursor: z.string().trim().min(1).max(200).optional()
});
const aiChatConversationUpdateSchema = z.object({
  title: titleSchema.nullable().optional(),
  status: z.enum(["open", "closed"]).optional(),
  pageContext: aiChatPageContextSchema.nullable().optional()
}).refine(
  (value) => typeof value.title !== "undefined" || typeof value.status !== "undefined" || typeof value.pageContext !== "undefined",
  { message: "At least one of title, status, or pageContext is required." }
);
const messageRoleSchema = z.enum(["user", "assistant", "system"]);
const messageBaseSchema = z.object({
  clientMessageId: z.string().trim().min(1).max(128).optional(),
  role: messageRoleSchema,
  content: z.string().max(64e3),
  uiParts: z.array(z.unknown()).max(64).optional(),
  attachmentIds: z.array(z.string().trim().min(1).max(128)).max(32).optional(),
  files: z.array(
    z.object({
      id: z.string().trim().min(1).max(128).optional(),
      name: z.string().trim().min(1).max(256).optional(),
      mimeType: z.string().trim().min(1).max(128).optional(),
      size: z.number().int().nonnegative().optional()
    }).passthrough()
  ).max(32).optional(),
  model: z.string().trim().min(1).max(128).optional(),
  metadata: z.record(z.string(), z.unknown()).optional()
});
const aiChatConversationImportSchema = z.object({
  conversation: z.object({
    conversationId: conversationIdSchema,
    agentId: aiAgentIdSchema,
    title: titleSchema.optional(),
    status: z.enum(["open", "closed"]).optional(),
    pageContext: aiChatPageContextSchema.nullable().optional()
  }),
  messages: z.array(messageBaseSchema).max(100)
});
const aiChatConversationTranscriptQuerySchema = z.object({
  limit: z.coerce.number().int().min(1).max(200).optional(),
  before: z.string().trim().min(1).max(200).optional()
});
const aiChatMessageAppendSchema = messageBaseSchema;
export {
  aiChatConversationCreateSchema,
  aiChatConversationImportSchema,
  aiChatConversationListQuerySchema,
  aiChatConversationTranscriptQuerySchema,
  aiChatConversationUpdateSchema,
  aiChatMessageAppendSchema,
  aiChatPageContextSchema
};
//# sourceMappingURL=validators.js.map
