import { z } from 'zod';

export const communicationStyleSchema = z.enum(['direct', 'friendly', 'formal']).default('direct');

export const soulSchema = z
  .object({
    agentName: z.string().min(1).max(50).default('Assistant'),
    roleDescription: z.string().default('execution partner and visibility engine'),
    communicationStyle: communicationStyleSchema,
    accessibility: z.string().default('none'),
    customGuardrails: z.string().default(''),
  })
  .partial();

export const gitProviderSchema = z.object({
  name: z.string().min(1),
  url: z.string().min(1),
  cli: z.string().min(1),
  purpose: z.string().min(1),
});

export const userSchema = z
  .object({
    userName: z.string().default(''),
    pronouns: z.string().default('They/Them'),
    timezone: z.string().default('UTC'),
    background: z.string().default('(not configured)'),
    accessibilitySection: z
      .string()
      .default('(No specific accommodations configured. Edit this section to add any.)'),
    communicationPrefs: z.string().default(''),
    personalBoundaries: z.string().default('(Edit this section to add any personal boundaries.)'),
    projectsTable: z.string().default(''),
  })
  .partial();

export const toolsSchema = z
  .object({
    gitProviders: z.array(gitProviderSchema).default([]),
    credentialsLocation: z.string().default('none'),
    customToolsSection: z.string().default(''),
  })
  .partial();
