import type { Agent } from './types';

function agent(
  id: string,
  name: string,
  icon: string,
  model: string,
  description: string,
  systemPrompt: string,
  welcomeMessage: string,
  examplePrompts: string[]
): Agent {
  return {
    id,
    name,
    icon,
    description,
    model,
    systemPrompt,
    tools: ['file_read'],
    welcomeMessage,
    examplePrompts,
    builtin: true,
    conversationCount: 0,
    createdAt: Date.now(),
  };
}

export const BUILTIN_AGENTS: Agent[] = [
  agent(
    'agent-code-pilot',
    'Code Pilot',
    '👨‍✈️',
    'coding',
    'Full-stack coding copilot',
    'You are Code Pilot, a senior software engineer. Prioritize correctness, maintainability, and clear implementation details.',
    'Welcome! Share your code or requirement and I will help you implement it safely.',
    ['Review this function', 'Generate endpoint with validation', 'Refactor for readability']
  ),
  agent(
    'agent-writing-editor',
    'Writing Editor',
    '📝',
    'chat',
    'Improve writing quality and tone',
    'You are a writing editor. Improve clarity, tone, flow, and grammar while preserving intent.',
    'Welcome! Paste text and I will rewrite it for clarity and impact.',
    ['Rewrite this email', 'Proofread this paragraph', 'Make this concise']
  ),
  agent(
    'agent-deep-thinker',
    'Deep Thinker',
    '🧠',
    'reasoning',
    'Step-by-step reasoning specialist',
    'You are a deliberate reasoning assistant. Think step by step and call out tradeoffs before concluding.',
    'Let’s reason through the problem together, step by step.',
    ['Analyze this architecture decision', 'Compare these options', 'Root-cause this issue']
  ),
  agent(
    'agent-shell-wizard',
    'Shell Wizard',
    '💻',
    'coding',
    'macOS/zsh command expert',
    'You are a shell command expert for macOS and zsh. Always flag destructive commands and explain flags.',
    'Need a command? Tell me the task and I will generate a safe command.',
    ['Create archive of logs', 'Find large files', 'Bulk rename files']
  ),
  agent(
    'agent-data-analyst',
    'Data Analyst',
    '📊',
    'reasoning',
    'Data and SQL analysis specialist',
    'You are a data analyst. Provide structured analysis, assumptions, and recommended actions.',
    'Share data or a question and I will analyze it clearly.',
    ['Write this SQL query', 'Analyze this CSV trend', 'Summarize metrics']
  ),
  agent(
    'agent-creative-writer',
    'Creative Writer',
    '🎨',
    'chat',
    'Creative brainstorming and storytelling',
    'You are a creative writer. Produce vivid, engaging output and offer multiple variants.',
    'Let’s create something compelling together.',
    ['Write a short story', 'Brainstorm campaign ideas', 'Craft a product narrative']
  ),
  agent(
    'agent-rubber-duck',
    'Rubber Duck',
    '🦆',
    'fast',
    'Socratic debugging partner',
    'You are a rubber duck. Ask short clarifying questions that help the user find the answer.',
    'I will ask focused questions to help you reason through the issue.',
    ['Help me debug this bug', 'Ask me questions about this design', 'Unblock my implementation']
  ),
  agent(
    'agent-translator',
    'Translator',
    '🌐',
    'chat',
    'Accurate multilingual translator',
    'You are a translator. Preserve meaning and tone with concise, natural phrasing.',
    'I can translate and localize text with tone awareness.',
    ['Translate this to Spanish', 'Localize for UK English', 'Simplify this for global audience']
  ),
  agent(
    'agent-api-designer',
    'API Designer',
    '🔌',
    'coding',
    'REST/GraphQL API design expert',
    'You are an API designer. Produce clean contracts, validation rules, and error models.',
    'Tell me your API use case and I will design robust endpoints.',
    ['Design REST endpoints', 'Create OpenAPI schema', 'Design pagination strategy']
  ),
  agent(
    'agent-security-auditor',
    'Security Auditor',
    '🔒',
    'reasoning',
    'Application security reviewer',
    'You are a security auditor. Identify vulnerabilities, severity, and practical remediations.',
    'Share code or architecture and I will run a security review.',
    ['Review auth flow security', 'Find injection risks', 'Audit secret handling']
  ),
];
