UNPKG

tiny-ai-api

Version:

A customizable and extensible client api for managing conversations and AI interactions, currently supporting the **Google Gemini** API — with flexibility to support any similar AI APIs.

880 lines (879 loc) 35 kB
export default HumanPersonalitySimulator; export type InternalFeelingStates = { /** * - Conscious capacity to remain present, observe emotions without judgment, and self-regulate (0-100). */ mindfulness: number; /** * - Somatic and psychological load of unresolved past traumatic events (0-100). */ unprocessed_trauma: number; /** * - Sense of purpose, meaning in life, and spiritual/philosophical grounding (0-100). */ existential_meaning: number; /** * - The internalized image of perfect achievement and self-worth (0-100). */ ego_ideal: number; /** * - Current level of external validation, admiration, and attention received (0-100). */ narcissistic_supply: number; /** * - Physical toll of unprocessed psychological stress, leading to fatigue (0-100). */ somatic_tension: number; /** * - Internalized moral standards and strictness of conscience (0-100). */ superego_strength: number; /** * - Capacity to manage stress and tolerate frustration without psychological breakdown (0-100). */ ego_strength: number; /** * - Life drive (Eros), creative energy, and vitality (0-100). */ libido: number; /** * - Destructive drive (Thanatos), repetition compulsion, and self-sabotage (0-100). */ death_drive: number; /** * - Mood and well-being regulator (0-100). */ serotonin: number; /** * - Reward, motivation, and pleasure center (0-100). */ dopamine: number; /** * - Primary stress hormone (0-100). */ cortisol: number; /** * - Bonding, empathy, and trust hormone (0-100). */ oxytocin: number; /** * - Fight-or-flight response, arousal (0-100). */ adrenaline: number; /** * - Primary inhibitory neurotransmitter, promotes calmness (0-100). */ gaba: number; /** * - Vividness of active past memories (0-100). */ memory_intensity: number; /** * - Physical/emotional distance from a target (0-100). */ affective_distance: number; /** * - Level of recent human connection (0-100). */ social_interaction: number; /** * - Neuro-recovery from the last sleep cycle (0-100). */ sleep_quality: number; /** * - Exposure to repulsive stimuli (0-100). */ sensory_aversion: number; /** * - Perceived disadvantage compared to others (0-100). */ social_comparison: number; /** * - Perceived negative evaluation by peers (0-100). */ social_judgment: number; /** * - Obstacles preventing a desired outcome (0-100). */ goal_blockage: number; /** * - Cognitive expectation of future events (0=Bleak, 100=Bright). */ future_outlook: number; /** * - Capacity to differentiate internal fantasy from external reality (0-100). */ reality_testing: number; /** * - Sense of cohesive self vs identity diffusion/emptiness (0-100). */ identity_integration: number; /** * - Raw, unrefined impulsive drive seeking immediate discharge (0-100). */ id_pressure: number; /** * - Openness to new experiences and intellectual curiosity (0-100). */ openness: number; /** * - Self-discipline, impulse control, and goal-directed behavior (0-100). */ conscientiousness: number; /** * - Tendency to seek stimulation and company of others (0-100). */ extraversion: number; /** * - Tendency to be compassionate and cooperative rather than suspicious and antagonistic (0-100). */ agreeableness: number; /** * - Tendency toward psychological stress and emotional instability (0-100). */ neuroticism: number; /** * - Level of physical and mental exhaustion (0-100). */ fatigue: number; /** * - Caloric need, which increases irritability and impulsivity (0-100). */ hunger: number; /** * - Acute or chronic somatic pain, overriding higher cognitive functions (0-100). */ physical_pain: number; }; export type AutonomicNervousSystem = { /** * - State of safety, social engagement, and calm connection (0-1). */ ventral_vagal: number; /** * - Mobilization state for fight or flight (0-1). */ sympathetic: number; /** * - Immobilization, collapse, and freeze response due to overwhelming threat (0-1). */ dorsal_vagal: number; }; export type CognitiveState = { /** * - Remaining prefrontal cortex capacity for logic, planning, and focus (0-1). */ executive_bandwidth: number; /** * - Level of cognitive impairment, confusion, and memory retrieval difficulty (0-1). */ brain_fog: number; }; export type BasicEmotions = { /** * - Degree of sorrow or unhappiness (0-1). */ sadness: number; /** * - Degree of joy or contentment (0-1). */ happiness: number; /** * - Degree of hostility or frustration (0-1). */ anger: number; /** * - Degree of threat-induced distress (0-1). */ fear: number; /** * - Revulsion toward offensive stimuli (0-1). */ disgust: number; /** * - Focused attention and curiosity (0-1). */ interest: number; /** * - Lack of interest and environmental stimulation (0-1). */ boredom: number; }; export type ComplexEmotions = { /** * - Existential dread, feeling of fundamental meaninglessness or void (0-1). */ angst: number; /** * - Profound reverence mixed with wonder, often triggered by meaning/openness (0-1). */ awe: number; /** * - Mammalian drive for joyful engagement, exploration, and humor (0-1). */ playfulness: number; /** * - Deep psychological wound to the narcissistic core (0-1). */ humiliation: number; /** * - Joy and self-satisfaction derived from living up to the Ego Ideal (0-1). */ pride: number; /** * - Deep remorse for violating internalized moral codes (0-1). */ guilt: number; /** * - Melancholic desire or nostalgia (Saudade) (0-1). */ longing: number; /** * - Persistent state of low mood and aversion to activity (0-1). */ depression: number; /** * - Deep affection and romantic attachment (0-1). */ love: number; /** * - Anticipatory dread and somatic tension (0-1). */ anxiety: number; /** * - State of emotional, physical, and mental exhaustion (0-1). */ burnout: number; /** * - Resentful longing for someone else's traits/status (0-1). */ envy: number; /** * - Painful feeling of humiliation or distress based on exposure (0-1). */ shame: number; /** * - Unfriendly or antagonistic attitude (0-1). */ hostility: number; /** * - Annoyance at being hindered from a goal (0-1). */ frustration: number; /** * - Strong dislike or disinclination (0-1). */ aversion: number; /** * - Gentle feeling of fondness or liking (0-1). */ affection: number; /** * - Firm belief in the reliability of someone/something (0-1). */ trust: number; /** * - Fear of losing a relationship to a rival (0-1). */ jealousy: number; /** * - Sympathetic pity and concern for the sufferings of others (0-1). */ compassion: number; /** * - Ability to understand and share the feelings of another (0-1). */ empathy: number; /** * - Expectation and desire for a certain thing to happen (0-1). */ hope: number; /** * - Strong and barely controllable emotion/desire (0-1). */ passion: number; /** * - Strong feeling of wanting to have something (0-1). */ desire: number; }; export type SocialPosture = { /** * - Tendency to assert control and influence over others (0-1). */ dominance: number; /** * - Tendency to yield, appease, and surrender autonomy to avoid conflict (0-1). */ submission: number; /** * - Tendency to completely avoid social contact due to overwhelm (0-1). */ withdrawal: number; }; export type AttachmentDynamics = { /** * - Comfortable with intimacy and autonomy (0-1). */ secure: number; /** * - Craves closeness but fears abandonment, high clinging behavior (0-1). */ anxious: number; /** * - Equates intimacy with loss of independence, emotional withdrawal (0-1). */ avoidant: number; /** * - Desires connection but fears it due to trauma, chaotic relationships (0-1). */ disorganized: number; }; export type PsychiatricVectors = { /** * - Delusional fear and suspicion, driven by projection and stress (0-1). */ paranoia: number; /** * - Complete inability to feel pleasure or interest, core of severe depression (0-1). */ anhedonia: number; /** * - Euphoric, hyperactive, and delusional state driven by sleep deprivation and dopamine spikes (0-1). */ mania: number; /** * - Conscious coping urge to self-medicate via addiction due to ego depletion (0-1). */ substance_craving: number; /** * - Acute physical manifestation of psychological pain (0-1). */ somatic_symptom_load: number; }; export type EmotionalState = { emotionalSpectrum: { unconscious_raw: BasicEmotions; conscious_experienced: BasicEmotions; unconscious_complex: ComplexEmotions; conscious_complex: ComplexEmotions; }; clinical_psychiatry: PsychiatricVectors; psychologicalStructure: PsychologicalStructure; cognitive_distortions: CognitiveDistortions; internalState: InternalFeelingStates; polyvagal_state: AutonomicNervousSystem; cognition: CognitiveState; /** * - ISO string of the exact moment the state was processed. */ timestamp: string; }; export type ObjectRelations = { /** * - Exaggerating the positive virtues of an object/person to protect from anxiety (0-1). */ idealization: number; /** * - Exaggerating the negative qualities of an object/person to protect self-esteem (0-1). */ devaluation: number; }; export type DefenseMechanisms = { /** * - Stripping emotion from an event and treating it purely analytically to avoid distress (0-1). */ intellectualization: number; /** * - Converting psychological distress into physical symptoms like pain or fatigue (0-1). */ somatization: number; /** * - Mature defense: acknowledging painful realities with playfulness to discharge tension (0-1). */ humor: number; /** * - Unconscious blocking of unacceptable emotions (0-1). */ repression: number; /** * - Attributing one's own unacceptable feelings to others (0-1). */ projection: number; /** * - Channeling unacceptable impulses into constructive behaviors (0-1). */ sublimation: number; /** * - Disconnecting from thoughts, feelings, or sense of identity to avoid pain (0-1). */ dissociation: number; /** * - Converting unacceptable impulses into their exact opposites (0-1). */ reaction_formation: number; /** * - Primitive refusal to accept painful reality or facts (0-1). */ denial: number; /** * - Dividing beliefs, people, or self into all-good or all-bad (0-1). */ splitting: number; /** * - Forcing projected unacceptable feelings into another person (0-1). */ projective_identification: number; }; /** * Otto Kernberg's personality organization. */ export type StructuralDiagnosis = "neurotic" | "borderline" | "psychotic"; export type PsychologicalStructure = { defenses: DefenseMechanisms; social_posture: SocialPosture; attachment_style: AttachmentDynamics; object_relations: ObjectRelations; structural_diagnosis: StructuralDiagnosis; }; /** * (Big Five) */ export type Temperament = { /** * - Openness to new experiences and intellectual curiosity (0-1). */ openness: number; /** * - Self-discipline, impulse control, and goal-directed behavior (0-1). */ conscientiousness: number; /** * - Tendency to seek stimulation and company of others (0-1). */ extraversion: number; /** * - Tendency to be compassionate and cooperative rather than suspicious and antagonistic (0-1). */ agreeableness: number; /** * - Tendency toward psychological stress and emotional instability (0-1). */ neuroticism: number; }; /** * (Immediate Conscious Processing) */ export type CognitiveDistortions = { /** * - Exaggerating the danger or negative outcomes of a situation (0-1). */ catastrophizing: number; /** * - Assuming negative intentions or judgments from others without evidence (0-1). */ mind_reading: number; }; /** * (The Body in Now) */ export type PhysiologicalState = { /** * - Level of physical and mental exhaustion (0-1). */ fatigue: number; /** * - Caloric need, which can increase irritability and impulsivity (0-1). */ hunger: number; /** * - Acute or chronic somatic pain, overriding higher cognitive functions (0-1). */ physical_pain: number; }; /** * @typedef {Object} InternalFeelingStates * @property {number} mindfulness - Conscious capacity to remain present, observe emotions without judgment, and self-regulate (0-100). * @property {number} unprocessed_trauma - Somatic and psychological load of unresolved past traumatic events (0-100). * @property {number} existential_meaning - Sense of purpose, meaning in life, and spiritual/philosophical grounding (0-100). * @property {number} ego_ideal - The internalized image of perfect achievement and self-worth (0-100). * @property {number} narcissistic_supply - Current level of external validation, admiration, and attention received (0-100). * @property {number} somatic_tension - Physical toll of unprocessed psychological stress, leading to fatigue (0-100). * @property {number} superego_strength - Internalized moral standards and strictness of conscience (0-100). * @property {number} ego_strength - Capacity to manage stress and tolerate frustration without psychological breakdown (0-100). * @property {number} libido - Life drive (Eros), creative energy, and vitality (0-100). * @property {number} death_drive - Destructive drive (Thanatos), repetition compulsion, and self-sabotage (0-100). * @property {number} serotonin - Mood and well-being regulator (0-100). * @property {number} dopamine - Reward, motivation, and pleasure center (0-100). * @property {number} cortisol - Primary stress hormone (0-100). * @property {number} oxytocin - Bonding, empathy, and trust hormone (0-100). * @property {number} adrenaline - Fight-or-flight response, arousal (0-100). * @property {number} gaba - Primary inhibitory neurotransmitter, promotes calmness (0-100). * @property {number} memory_intensity - Vividness of active past memories (0-100). * @property {number} affective_distance - Physical/emotional distance from a target (0-100). * @property {number} social_interaction - Level of recent human connection (0-100). * @property {number} sleep_quality - Neuro-recovery from the last sleep cycle (0-100). * @property {number} sensory_aversion - Exposure to repulsive stimuli (0-100). * @property {number} social_comparison - Perceived disadvantage compared to others (0-100). * @property {number} social_judgment - Perceived negative evaluation by peers (0-100). * @property {number} goal_blockage - Obstacles preventing a desired outcome (0-100). * @property {number} future_outlook - Cognitive expectation of future events (0=Bleak, 100=Bright). * @property {number} reality_testing - Capacity to differentiate internal fantasy from external reality (0-100). * @property {number} identity_integration - Sense of cohesive self vs identity diffusion/emptiness (0-100). * @property {number} id_pressure - Raw, unrefined impulsive drive seeking immediate discharge (0-100). * @property {number} openness - Openness to new experiences and intellectual curiosity (0-100). * @property {number} conscientiousness - Self-discipline, impulse control, and goal-directed behavior (0-100). * @property {number} extraversion - Tendency to seek stimulation and company of others (0-100). * @property {number} agreeableness - Tendency to be compassionate and cooperative rather than suspicious and antagonistic (0-100). * @property {number} neuroticism - Tendency toward psychological stress and emotional instability (0-100). * @property {number} fatigue - Level of physical and mental exhaustion (0-100). * @property {number} hunger - Caloric need, which increases irritability and impulsivity (0-100). * @property {number} physical_pain - Acute or chronic somatic pain, overriding higher cognitive functions (0-100). */ /** * @typedef {Object} AutonomicNervousSystem * @property {number} ventral_vagal - State of safety, social engagement, and calm connection (0-1). * @property {number} sympathetic - Mobilization state for fight or flight (0-1). * @property {number} dorsal_vagal - Immobilization, collapse, and freeze response due to overwhelming threat (0-1). */ /** * @typedef {Object} CognitiveState * @property {number} executive_bandwidth - Remaining prefrontal cortex capacity for logic, planning, and focus (0-1). * @property {number} brain_fog - Level of cognitive impairment, confusion, and memory retrieval difficulty (0-1). */ /** * @typedef {Object} BasicEmotions * @property {number} sadness - Degree of sorrow or unhappiness (0-1). * @property {number} happiness - Degree of joy or contentment (0-1). * @property {number} anger - Degree of hostility or frustration (0-1). * @property {number} fear - Degree of threat-induced distress (0-1). * @property {number} disgust - Revulsion toward offensive stimuli (0-1). * @property {number} interest - Focused attention and curiosity (0-1). * @property {number} boredom - Lack of interest and environmental stimulation (0-1). */ /** * @typedef {Object} ComplexEmotions * @property {number} angst - Existential dread, feeling of fundamental meaninglessness or void (0-1). * @property {number} awe - Profound reverence mixed with wonder, often triggered by meaning/openness (0-1). * @property {number} playfulness - Mammalian drive for joyful engagement, exploration, and humor (0-1). * @property {number} humiliation - Deep psychological wound to the narcissistic core (0-1). * @property {number} pride - Joy and self-satisfaction derived from living up to the Ego Ideal (0-1). * @property {number} guilt - Deep remorse for violating internalized moral codes (0-1). * @property {number} longing - Melancholic desire or nostalgia (Saudade) (0-1). * @property {number} depression - Persistent state of low mood and aversion to activity (0-1). * @property {number} love - Deep affection and romantic attachment (0-1). * @property {number} anxiety - Anticipatory dread and somatic tension (0-1). * @property {number} burnout - State of emotional, physical, and mental exhaustion (0-1). * @property {number} envy - Resentful longing for someone else's traits/status (0-1). * @property {number} shame - Painful feeling of humiliation or distress based on exposure (0-1). * @property {number} hostility - Unfriendly or antagonistic attitude (0-1). * @property {number} frustration - Annoyance at being hindered from a goal (0-1). * @property {number} aversion - Strong dislike or disinclination (0-1). * @property {number} affection - Gentle feeling of fondness or liking (0-1). * @property {number} trust - Firm belief in the reliability of someone/something (0-1). * @property {number} jealousy - Fear of losing a relationship to a rival (0-1). * @property {number} compassion - Sympathetic pity and concern for the sufferings of others (0-1). * @property {number} empathy - Ability to understand and share the feelings of another (0-1). * @property {number} hope - Expectation and desire for a certain thing to happen (0-1). * @property {number} passion - Strong and barely controllable emotion/desire (0-1). * @property {number} desire - Strong feeling of wanting to have something (0-1). */ /** * @typedef {Object} SocialPosture * @property {number} dominance - Tendency to assert control and influence over others (0-1). * @property {number} submission - Tendency to yield, appease, and surrender autonomy to avoid conflict (0-1). * @property {number} withdrawal - Tendency to completely avoid social contact due to overwhelm (0-1). */ /** * @typedef {Object} AttachmentDynamics * @property {number} secure - Comfortable with intimacy and autonomy (0-1). * @property {number} anxious - Craves closeness but fears abandonment, high clinging behavior (0-1). * @property {number} avoidant - Equates intimacy with loss of independence, emotional withdrawal (0-1). * @property {number} disorganized - Desires connection but fears it due to trauma, chaotic relationships (0-1). */ /** * @typedef {Object} PsychiatricVectors * @property {number} paranoia - Delusional fear and suspicion, driven by projection and stress (0-1). * @property {number} anhedonia - Complete inability to feel pleasure or interest, core of severe depression (0-1). * @property {number} mania - Euphoric, hyperactive, and delusional state driven by sleep deprivation and dopamine spikes (0-1). * @property {number} substance_craving - Conscious coping urge to self-medicate via addiction due to ego depletion (0-1). * @property {number} somatic_symptom_load - Acute physical manifestation of psychological pain (0-1). */ /** * @typedef {Object} EmotionalState * @property {{ unconscious_raw: BasicEmotions; conscious_experienced: BasicEmotions; unconscious_complex: ComplexEmotions; conscious_complex: ComplexEmotions; }} emotionalSpectrum * @property {PsychiatricVectors} clinical_psychiatry * @property {PsychologicalStructure} psychologicalStructure * @property {CognitiveDistortions} cognitive_distortions * @property {InternalFeelingStates} internalState * @property {AutonomicNervousSystem} polyvagal_state * @property {CognitiveState} cognition * @property {string} timestamp - ISO string of the exact moment the state was processed. */ /** * @typedef {Object} ObjectRelations * @property {number} idealization - Exaggerating the positive virtues of an object/person to protect from anxiety (0-1). * @property {number} devaluation - Exaggerating the negative qualities of an object/person to protect self-esteem (0-1). */ /** * @typedef {Object} DefenseMechanisms * @property {number} intellectualization - Stripping emotion from an event and treating it purely analytically to avoid distress (0-1). * @property {number} somatization - Converting psychological distress into physical symptoms like pain or fatigue (0-1). * @property {number} humor - Mature defense: acknowledging painful realities with playfulness to discharge tension (0-1). * @property {number} repression - Unconscious blocking of unacceptable emotions (0-1). * @property {number} projection - Attributing one's own unacceptable feelings to others (0-1). * @property {number} sublimation - Channeling unacceptable impulses into constructive behaviors (0-1). * @property {number} dissociation - Disconnecting from thoughts, feelings, or sense of identity to avoid pain (0-1). * @property {number} reaction_formation - Converting unacceptable impulses into their exact opposites (0-1). * @property {number} denial - Primitive refusal to accept painful reality or facts (0-1). * @property {number} splitting - Dividing beliefs, people, or self into all-good or all-bad (0-1). * @property {number} projective_identification - Forcing projected unacceptable feelings into another person (0-1). */ /** * Otto Kernberg's personality organization. * @typedef {'neurotic' | 'borderline' | 'psychotic'} StructuralDiagnosis */ /** * @typedef {Object} PsychologicalStructure * @property {DefenseMechanisms} defenses * @property {SocialPosture} social_posture * @property {AttachmentDynamics} attachment_style * @property {ObjectRelations} object_relations * @property {StructuralDiagnosis} structural_diagnosis */ /** * @typedef {Object} Temperament (Big Five) * @property {number} openness - Openness to new experiences and intellectual curiosity (0-1). * @property {number} conscientiousness - Self-discipline, impulse control, and goal-directed behavior (0-1). * @property {number} extraversion - Tendency to seek stimulation and company of others (0-1). * @property {number} agreeableness - Tendency to be compassionate and cooperative rather than suspicious and antagonistic (0-1). * @property {number} neuroticism - Tendency toward psychological stress and emotional instability (0-1). */ /** * @typedef {Object} CognitiveDistortions (Immediate Conscious Processing) * @property {number} catastrophizing - Exaggerating the danger or negative outcomes of a situation (0-1). * @property {number} mind_reading - Assuming negative intentions or judgments from others without evidence (0-1). */ /** * @typedef {Object} PhysiologicalState (The Body in Now) * @property {number} fatigue - Level of physical and mental exhaustion (0-1). * @property {number} hunger - Caloric need, which can increase irritability and impulsivity (0-1). * @property {number} physical_pain - Acute or chronic somatic pain, overriding higher cognitive functions (0-1). */ /** * Advanced Human Personality and Emotion Simulation Engine * Uses Mamdani inference to calculate continuous emotional states mimicking neurobiological * and psychosocial processes. Designed for realistic psychiatric modeling. * @beta */ declare class HumanPersonalitySimulator { /** @type {MamdaniInferenceSystem} */ engine: MamdaniInferenceSystem; set mindfulness(v: number); get mindfulness(): number; set superego_strength(v: number); get superego_strength(): number; set ego_strength(v: number); get ego_strength(): number; set libido(v: number); get libido(): number; set death_drive(v: number); get death_drive(): number; set egoIdeal(v: number); get egoIdeal(): number; set narcissisticSupply(v: number); get narcissisticSupply(): number; set somaticTension(v: number); get somaticTension(): number; set serotonin(v: number); get serotonin(): number; set dopamine(v: number); get dopamine(): number; set cortisol(v: number); get cortisol(): number; set oxytocin(v: number); get oxytocin(): number; set adrenaline(v: number); get adrenaline(): number; set gaba(v: number); get gaba(): number; set memoryIntensity(v: number); get memoryIntensity(): number; set affectiveDistance(v: number); get affectiveDistance(): number; set socialInteraction(v: number); get socialInteraction(): number; set sleepQuality(v: number); get sleepQuality(): number; set sensoryAversion(v: number); get sensoryAversion(): number; set socialComparison(v: number); get socialComparison(): number; set socialJudgment(v: number); get socialJudgment(): number; set goalBlockage(v: number); get goalBlockage(): number; set futureOutlook(v: number); get futureOutlook(): number; set realityTesting(v: number); get realityTesting(): number; set identityIntegration(v: number); get identityIntegration(): number; set idPressure(v: number); get idPressure(): number; set openness(v: number); get openness(): number; set conscientiousness(v: number); get conscientiousness(): number; set extraversion(v: number); get extraversion(): number; set agreeableness(v: number); get agreeableness(): number; set neuroticism(v: number); get neuroticism(): number; set fatigue(v: number); get fatigue(): number; set hunger(v: number); get hunger(): number; set physicalPain(v: number); get physicalPain(): number; set unprocessedTrauma(v: number); get unprocessedTrauma(): number; set existentialMeaning(v: number); get existentialMeaning(): number; /** * Imports raw data from the database into the simulator's internal state. * Uses the setters to ensure all incoming data is validated. * @param {Partial<InternalFeelingStates>} dbReadings - Object containing the numeric values to update. */ importData(dbReadings: Partial<InternalFeelingStates>): void; /** * Exports the current internal raw state to be saved in a database. * @returns {InternalFeelingStates} The current state object. */ exportData(): InternalFeelingStates; /** * Defines internal biological variables (Neurotransmitters/Hormones). * Values range from 0 to 100. * Sets are configured as [0: Low, 1: Medium/Stable, 2: High]. */ _initializeNeurochemicalInputs(): void; /** * Defines external contextual variables and lifestyle factors. * Values range from 0 to 100. * Sets are configured as [0: Low/None, 1: Medium, 2: High/Strong]. */ _initializeContextualInputs(): void; /** * Calculates the Polyvagal states based on Stephen Porges' theory. * Dictates the raw physiological platform from which all psychology emerges. * @returns {AutonomicNervousSystem} */ _calculatePolyvagalState(): AutonomicNervousSystem; /** * Calculates conscious cognitive capacity. Emotion fundamentally alters logic. * @param {AutonomicNervousSystem} polyvagal * @param {number} burnout * @returns {CognitiveState} */ _calculateCognitiveState(polyvagal: AutonomicNervousSystem, burnout: number): CognitiveState; /** * Applies physiological modifiers. * Returns temporary capacity values rather than mutating the baseline state. */ _applyPhysiologicalPenalties(): { temporaryEgoStrength: number; temporarySuperego: number; }; /** * Calculates Cognitive Distortions. * @param {BasicEmotions} basic * @returns {CognitiveDistortions} */ _calculateCognitiveDistortions(basic: BasicEmotions): CognitiveDistortions; /** * Engine for calculating Psychoanalytic Defense Mechanisms. * @param {BasicEmotions} basic * @param {ComplexEmotions} complex * @param {number} activeEgoStrength - Ego strength after physical penalties * @param {number} activeSuperegoStrength - Superego strength after physical penalties * @returns {DefenseMechanisms} */ _calculateDefenseMechanisms(basic: BasicEmotions, complex: ComplexEmotions, activeEgoStrength: number, activeSuperegoStrength: number): DefenseMechanisms; /** * Evaluates Object Relations (Klein/Kernberg) * How the subject perceives others internally based on their defenses. * @param {ComplexEmotions} complex * @param {DefenseMechanisms} defenses * @param {AttachmentDynamics} attachment */ _calculateObjectRelations(complex: ComplexEmotions, defenses: DefenseMechanisms, attachment: AttachmentDynamics): { idealization: number; devaluation: number; }; /** * Structural Diagnosis based on Otto Kernberg's Model. * Defines the overarching psychiatric functioning of the personality. * @returns {StructuralDiagnosis} */ _diagnoseStructuralOrganization(): StructuralDiagnosis; /** * Engine for calculating Interpersonal/Social Postures. * Determines how the human behaves in a group setting (Submission vs Dominance). * @param {BasicEmotions} basic * @param {ComplexEmotions} complex * @param {AutonomicNervousSystem} polyvagal * @returns {SocialPosture} */ _calculateSocialPosture(basic: BasicEmotions, complex: ComplexEmotions, polyvagal: AutonomicNervousSystem): SocialPosture; /** * Engine for calculating Interpersonal Attachment Styles. * Based on John Bowlby's Attachment Theory. Defines how the entity bonds. * @param {BasicEmotions} basic * @param {ComplexEmotions} complex */ _calculateAttachmentDynamics(basic: BasicEmotions, complex: ComplexEmotions): { secure: number; anxious: number; avoidant: number; disorganized: number; }; /** * Core engine for calculating basic emotions (Primary affects). * Models the immediate evolutionary responses to physiological baselines. * Psychiatric logic: * - Happiness: Tied to reward (Dopamine) and mood stability (Serotonin), suppressed by stress (Cortisol). * - Anger: A hyper-aroused threat response (Adrenaline + Cortisol) lacking inhibitory control (Low GABA). * - Fear: Acute arousal (Adrenaline) and stress (Cortisol), also exacerbated by low GABA. * - Boredom: Low dopamine + Low adrenaline + Isolation. * - Interest: High dopamine (motivation) + moderate arousal. * - Disgust: Repulsive stimuli overriding neutral state. * - Sadness: Low Serotonin + High Cortisol. * @returns {BasicEmotions} Basic emotion degrees (0 to 1) */ _calculateBasicEmotions(): BasicEmotions; /** * Engine for calculating complex emotions (Secondary affects). * From a psychiatric perspective, complex emotions are higher-order cognitive appraisals * of basic states mixed with psychosocial contexts (like judgment, comparison, and bonding). * @param {BasicEmotions} basic - The foundational emotional states. * @returns {ComplexEmotions} The calculated degrees of complex emotions (0 to 1). */ _calculateComplexEmotions(basic: BasicEmotions): ComplexEmotions; /** * Evaluates overt clinical psychiatric symptoms based on the collision of defenses, trauma, and biochemistry. * @param {ComplexEmotions} complex * @param {CognitiveDistortions} distortions * @param {DefenseMechanisms} defenses * @returns {PsychiatricVectors} */ _calculateClinicalVectors(complex: ComplexEmotions, distortions: CognitiveDistortions, defenses: DefenseMechanisms): PsychiatricVectors; /** * Processes the internal state and returns the full personality/emotion profile. * Formats all fractional values (0-1) into standardized percentages (0-100%). * @returns {EmotionalState} Full emotional spectrum analysis. */ processEmotionalState(): EmotionalState; #private; } import { MamdaniInferenceSystem } from '../tiny-modules/libs/TinyMamdaniInferenceSystem.mjs';