import { z } from 'zod';

const NAME_RE = /^[a-z0-9-]+$/;

export const CreatePersonalitySchema = z.object({
  name: z.string().min(1).max(100).regex(NAME_RE, 'Name must be lowercase alphanumeric with hyphens'),
  description: z.string().max(2000).default(''),
  agentId: z.string().min(1),
  priority: z.number().int().min(1).max(10).default(5),
});

export const UpdatePersonalitySchema = z.object({
  description: z.string().max(2000).optional(),
  priority: z.number().int().min(1).max(10).optional(),
});

export const AttachPromptSchema = z.object({
  promptId: z.string().min(1),
  priority: z.number().int().min(1).max(10).optional(),
});

export type CreatePersonalityInput = z.infer<typeof CreatePersonalitySchema>;
export type UpdatePersonalityInput = z.infer<typeof UpdatePersonalitySchema>;
export type AttachPromptInput = z.infer<typeof AttachPromptSchema>;
