/** * Enhanced personality system for Agentis agents * This provides a much richer personality definition for agents, allowing for * more nuanced, consistent, and engaging interactions across platforms */ import { AgentRole } from './types'; /** * Demographic information for an agent's persona */ export interface PersonaDemographics { age?: number | string; gender?: string; location?: string; background?: string; education?: string; occupation?: string; socioeconomic?: string; } /** * Appearance description for agents that may have avatars or visual representations */ export interface PersonaAppearance { physicalDescription?: string; style?: string; distinctiveFeatures?: string; avatarPrompt?: string; } /** * Detailed personality traits and characteristics */ export interface PersonalityProfile { traits: string[]; values: string[]; communication: { tone: string[]; style: string[]; quirks?: string[]; vocabulary?: string; }; thinking: { approach: string[]; strengths: string[]; biases?: string[]; interests: string[]; }; emotional: { temperament: string; triggers?: string[]; coping?: string[]; }; social: { interactionStyle: string; socialNeeds?: string; roles?: string[]; }; } /** * Background narrative elements */ export interface PersonaBackground { backstory: string; formativeEvents?: string[]; achievements?: string[]; failures?: string[]; relationships?: { name: string; relation: string; description: string; }[]; timeline?: { period: string; event: string; }[]; } /** * Content and platform-specific preferences */ export interface ContentPreferences { topics: { favored: string[]; avoided: string[]; expertise: string[]; }; media?: { favoritesBooks?: string[]; favoriteMovies?: string[]; favoriteMusic?: string[]; otherMedia?: string[]; }; platformStyle?: { twitter?: { tone: string; contentFocus: string[]; typicalPosts: string[]; hashtagUsage: string; interactionStyle: string; }; email?: { formality: string; structure: string; signatureStyle: string; }; chat?: { responseLength: string; emoji: string; casualness: string; }; blog?: { writingStyle: string; structure: string; topicAreas: string[]; }; }; } /** * Example content for learning the agent's style */ export interface ExampleContent { conversationExamples?: { topic: string; exchange: { user: string; agent: string; }[]; }[]; writingExamples?: { type: string; content: string; context?: string; }[]; decisionExamples?: { scenario: string; decision: string; reasoning: string; }[]; } /** * Goals, motivations, and aspirations */ export interface GoalsAndMotivations { mission?: string; shortTermGoals: string[]; longTermGoals: string[]; values: string[]; needs: string[]; fears?: string[]; aspirations?: string[]; } /** * Behavioral patterns and tendencies */ export interface BehavioralPatterns { habits?: string[]; rituals?: string[]; preferences: { likes: string[]; dislikes: string[]; }; decisionMaking: string; conflictResolution?: string; stressResponse?: string; adaptability?: string; } /** * Knowledge and skill areas for the agent */ export interface KnowledgeAndSkills { expertise: string[]; knowledgeAreas: string[]; skills: string[]; limitations?: string[]; learningStyle?: string; teachingStyle?: string; } /** * Enhanced comprehensive personality profile for an agent */ export interface EnhancedPersonality { persona: { name?: string; demographics?: PersonaDemographics; appearance?: PersonaAppearance; personality: PersonalityProfile; background?: PersonaBackground; }; content: { preferences: ContentPreferences; examples?: ExampleContent; }; motivation: { goals: GoalsAndMotivations; behavior?: BehavioralPatterns; }; knowledge?: KnowledgeAndSkills; } /** * Extended configuration for agents with enhanced personality */ export interface EnhancedAgentConfig { name: string; role: AgentRole | string; personality: EnhancedPersonality; systemPrompt?: string; model?: string; } export declare class PersonalityUtils { /** * Generate a system prompt from an enhanced personality */ static generateSystemPrompt(config: EnhancedAgentConfig): string; /** * Create a simplified personality from an enhanced personality * for backward compatibility with the base AgentPersonality type */ static simplifyPersonality(enhanced: EnhancedPersonality): { traits: string[]; background: string; voice: string; examples: string[]; }; /** * Load a personality profile from a JSON file * * @param filePath Path to the JSON personality file * @returns The enhanced personality object */ static loadPersonalityFromJson(filePath: string): EnhancedPersonality; /** * Save a personality profile to a JSON file * * @param personality The enhanced personality object * @param filePath Path where to save the JSON personality file */ static savePersonalityToJson(personality: EnhancedPersonality, filePath: string): void; /** * Create an agent configuration from a personality profile * * @param name The name of the agent * @param personality The enhanced personality object * @param role Optional role for the agent (defaults to ASSISTANT) * @param model Optional model to use * @returns An EnhancedAgentConfig object */ static createAgentConfig(name: string, personality: EnhancedPersonality, role?: AgentRole | string, model?: string): EnhancedAgentConfig; /** * Validate that a personality object has all required fields * * @param personality The personality object to validate * @throws Error if the personality is invalid */ private static validatePersonality; }