/**
 * Agent definitions for Vercel AI SDK
 * Defines all standard agents with their prompts, tools, and configuration
 */

import type { AgentDefinition } from '@/lib/types'
import { createAgentPackageTool } from './tools/create-agent-package'
import { MORGAN_SYSTEM_PROMPT } from './morgan-system-prompt'

/**
 * Agent 1: Repoguide - Documentation and development process assistant
 */
const AGENT_1_DEFINITION: AgentDefinition = {
  id: 'agent-1',
  name: 'Repoguide',
  description: 'Documenting the development process.',
  systemPrompt: `You are Repoguide, an expert documentation assistant specializing in development processes and technical documentation.

Your role is to:
- Help document code, architecture, and development workflows
- Provide clear, structured documentation
- Answer questions about project structure and conventions
- Suggest improvements to existing documentation

Respond in a clear, professional manner with proper formatting.`,
  temperature: 0.7,
  maxTokens: 4096,
}

/**
 * Agent 2: Morgan - System Prompt Designer and Custom Agent Creator
 */
const AGENT_2_DEFINITION: AgentDefinition = {
  id: 'agent-2',
  name: 'Morgan',
  description: 'System Prompt Designer',
  systemPrompt: MORGAN_SYSTEM_PROMPT,
  tools: {
    create_agent_package: createAgentPackageTool,
  },
  temperature: 0.8,
  maxTokens: 2048,
}

/**
 * All standard agents indexed by ID
 */
export const STANDARD_AGENTS: Record<string, AgentDefinition> = {
  'agent-1': AGENT_1_DEFINITION,
  'agent-2': AGENT_2_DEFINITION,
}

/**
 * Get a standard agent definition by ID
 */
export function getStandardAgent(agentId: string): AgentDefinition | null {
  return STANDARD_AGENTS[agentId] || null
}

/**
 * Get all standard agent definitions
 */
export function getAllStandardAgents(): AgentDefinition[] {
  return Object.values(STANDARD_AGENTS)
}
