From 671e12d2c38b0e49a894b652dc3f0271e8c75420 Mon Sep 17 00:00:00 2001 From: Morax Date: Mon, 28 Jul 2025 23:00:28 +0800 Subject: [PATCH] feat: Add new tarot spreads and enhance reading interpretations --- src/tarot-server.ts | 2 +- src/tarot/reading-manager.ts | 243 +++++++++++++++++++++++++++++++++++ src/tarot/spreads.ts | 212 ++++++++++++++++++++++++++++++ src/tarot/types.ts | 2 +- 4 files changed, 457 insertions(+), 2 deletions(-) diff --git a/src/tarot-server.ts b/src/tarot-server.ts index fadc7c0..21cd403 100644 --- a/src/tarot-server.ts +++ b/src/tarot-server.ts @@ -83,7 +83,7 @@ export class TarotServer { properties: { spreadType: { type: "string", - enum: ["single_card", "three_card", "celtic_cross"], + enum: ["single_card", "three_card", "celtic_cross", "horseshoe", "relationship_cross", "career_path", "decision_making", "spiritual_guidance", "year_ahead", "chakra_alignment", "shadow_work", "venus_love", "tree_of_life", "astrological_houses", "mandala", "pentagram"], description: "The type of tarot spread to perform", }, question: { diff --git a/src/tarot/reading-manager.ts b/src/tarot/reading-manager.ts index 5bf5a30..33aef3f 100644 --- a/src/tarot/reading-manager.ts +++ b/src/tarot/reading-manager.ts @@ -149,6 +149,16 @@ export class TarotReadingManager { interpretation += this.generateChakraAnalysis(drawnCards); } else if (spreadName.toLowerCase().includes("year ahead")) { interpretation += this.generateYearAheadAnalysis(drawnCards); + } else if (spreadName.toLowerCase().includes("venus") || spreadName.toLowerCase().includes("love")) { + interpretation += this.generateVenusLoveAnalysis(drawnCards); + } else if (spreadName.toLowerCase().includes("tree of life")) { + interpretation += this.generateTreeOfLifeAnalysis(drawnCards); + } else if (spreadName.toLowerCase().includes("astrological")) { + interpretation += this.generateAstrologicalAnalysis(drawnCards); + } else if (spreadName.toLowerCase().includes("mandala")) { + interpretation += this.generateMandalaAnalysis(drawnCards); + } else if (spreadName.toLowerCase().includes("pentagram")) { + interpretation += this.generatePentagramAnalysis(drawnCards); } // Overall interpretation @@ -431,6 +441,239 @@ export class TarotReadingManager { return analysis; } + /** + * Generate Venus Love spread analysis + */ + private generateVenusLoveAnalysis(drawnCards: DrawnCard[]): string { + if (drawnCards.length !== 7) return ""; + + let analysis = "**Venus Love Energy Analysis:**\n\n"; + + const [currentEnergy, selfLove, attraction, blocks, enhancement, desires, future] = drawnCards; + + // Analyze love energy flow + analysis += `**Love Energy Flow:** Your current relationship energy (${currentEnergy.card.name}) `; + if (currentEnergy.orientation === "upright") { + analysis += "shows positive romantic vibrations and openness to love. "; + } else { + analysis += "suggests some healing or inner work is needed before fully opening to love. "; + } + + // Self-love foundation + analysis += `Your self-love foundation (${selfLove.card.name}) `; + if (selfLove.orientation === "upright") { + analysis += "indicates healthy self-worth that attracts genuine love. "; + } else { + analysis += "reveals areas where self-compassion and self-acceptance need attention. "; + } + + // Attraction and blocks + analysis += `What attracts love to you (${attraction.card.name}) works in harmony with `; + analysis += `overcoming blocks (${blocks.card.name}) to create a path forward. `; + + // Future potential + analysis += `The future potential (${future.card.name}) `; + if (future.orientation === "upright") { + analysis += "promises beautiful developments in your love life. "; + } else { + analysis += "suggests patience and continued inner work will lead to love. "; + } + + analysis += "\n"; + return analysis; + } + + /** + * Generate Tree of Life spread analysis + */ + private generateTreeOfLifeAnalysis(drawnCards: DrawnCard[]): string { + if (drawnCards.length !== 10) return ""; + + let analysis = "**Tree of Life Spiritual Analysis:**\n\n"; + + const [kether, chokmah, binah, chesed, geburah, tiphareth, netzach, hod, yesod, malkuth] = drawnCards; + + // Analyze the three pillars + const leftPillar = [binah, geburah, hod]; // Severity + const rightPillar = [chokmah, chesed, netzach]; // Mercy + const middlePillar = [kether, tiphareth, yesod, malkuth]; // Balance + + // Pillar analysis + const leftUprightCount = leftPillar.filter(c => c.orientation === "upright").length; + const rightUprightCount = rightPillar.filter(c => c.orientation === "upright").length; + const middleUprightCount = middlePillar.filter(c => c.orientation === "upright").length; + + analysis += `**Pillar Balance:** `; + if (rightUprightCount > leftUprightCount) { + analysis += "The Pillar of Mercy dominates, indicating expansion, growth, and positive energy. "; + } else if (leftUprightCount > rightUprightCount) { + analysis += "The Pillar of Severity is prominent, suggesting discipline, boundaries, and necessary restrictions. "; + } else { + analysis += "The pillars are balanced, showing harmony between expansion and contraction. "; + } + + // Crown to Kingdom flow + analysis += `**Divine Flow:** From Kether (${kether.card.name}) to Malkuth (${malkuth.card.name}), `; + if (kether.orientation === malkuth.orientation) { + analysis += "there's alignment between your highest purpose and material manifestation. "; + } else { + analysis += "there's a need to bridge the gap between spiritual ideals and earthly reality. "; + } + + analysis += "\n"; + return analysis; + } + + /** + * Generate Astrological Houses spread analysis + */ + private generateAstrologicalAnalysis(drawnCards: DrawnCard[]): string { + if (drawnCards.length !== 12) return ""; + + let analysis = "**Astrological Houses Analysis:**\n\n"; + + // Group houses by element + const fireHouses = [drawnCards[0], drawnCards[4], drawnCards[8]]; // 1st, 5th, 9th + const earthHouses = [drawnCards[1], drawnCards[5], drawnCards[9]]; // 2nd, 6th, 10th + const airHouses = [drawnCards[2], drawnCards[6], drawnCards[10]]; // 3rd, 7th, 11th + const waterHouses = [drawnCards[3], drawnCards[7], drawnCards[11]]; // 4th, 8th, 12th + + // Analyze elemental balance + const fireUpright = fireHouses.filter(c => c.orientation === "upright").length; + const earthUpright = earthHouses.filter(c => c.orientation === "upright").length; + const airUpright = airHouses.filter(c => c.orientation === "upright").length; + const waterUpright = waterHouses.filter(c => c.orientation === "upright").length; + + analysis += `**Elemental Balance:** `; + const elements = [ + { name: "Fire (Identity/Creativity/Philosophy)", count: fireUpright }, + { name: "Earth (Resources/Work/Career)", count: earthUpright }, + { name: "Air (Communication/Partnerships/Community)", count: airUpright }, + { name: "Water (Home/Transformation/Spirituality)", count: waterUpright } + ]; + + const strongestElement = elements.reduce((max, current) => + current.count > max.count ? current : max + ); + + analysis += `${strongestElement.name} energy is strongest in your chart, `; + analysis += `indicating focus in these life areas. `; + + // Angular houses analysis (1st, 4th, 7th, 10th) + const angularHouses = [drawnCards[0], drawnCards[3], drawnCards[6], drawnCards[9]]; + const angularUpright = angularHouses.filter(c => c.orientation === "upright").length; + + analysis += `**Life Direction:** With ${angularUpright} out of 4 angular houses upright, `; + if (angularUpright >= 3) { + analysis += "you have strong momentum and clear direction in major life areas. "; + } else if (angularUpright >= 2) { + analysis += "you have moderate stability with some areas needing attention. "; + } else { + analysis += "focus on building stronger foundations in key life areas. "; + } + + analysis += "\n"; + return analysis; + } + + /** + * Generate Mandala spread analysis + */ + private generateMandalaAnalysis(drawnCards: DrawnCard[]): string { + if (drawnCards.length !== 9) return ""; + + let analysis = "**Mandala Wholeness Analysis:**\n\n"; + + const [center, north, northeast, east, southeast, south, southwest, west, northwest] = drawnCards; + + // Analyze center in relation to outer cards + analysis += `**Core Integration:** Your center (${center.card.name}) `; + if (center.orientation === "upright") { + analysis += "shows a strong, balanced core that can integrate the surrounding energies. "; + } else { + analysis += "suggests the need for inner healing before achieving wholeness. "; + } + + // Analyze directional balance + const directions = [north, northeast, east, southeast, south, southwest, west, northwest]; + const uprightDirections = directions.filter(c => c.orientation === "upright").length; + + analysis += `**Directional Balance:** With ${uprightDirections} out of 8 directions upright, `; + if (uprightDirections >= 6) { + analysis += "your life energies are well-balanced and flowing harmoniously. "; + } else if (uprightDirections >= 4) { + analysis += "you have good balance with some areas needing attention. "; + } else { + analysis += "focus on healing and balancing multiple life areas. "; + } + + // Opposite directions analysis + const opposites = [ + [north, south], [east, west], [northeast, southwest], [southeast, northwest] + ]; + + let balancedPairs = 0; + opposites.forEach(([dir1, dir2]) => { + if (dir1.orientation === dir2.orientation) { + balancedPairs++; + } + }); + + analysis += `**Polarity Integration:** ${balancedPairs} out of 4 opposite pairs are balanced, `; + if (balancedPairs >= 3) { + analysis += "showing excellent integration of opposing forces. "; + } else { + analysis += "indicating opportunities to harmonize conflicting energies. "; + } + + analysis += "\n"; + return analysis; + } + + /** + * Generate Pentagram spread analysis + */ + private generatePentagramAnalysis(drawnCards: DrawnCard[]): string { + if (drawnCards.length !== 5) return ""; + + let analysis = "**Pentagram Elemental Analysis:**\n\n"; + + const [spirit, air, fire, earth, water] = drawnCards; + + // Analyze elemental balance + const elements = [air, fire, earth, water]; + const uprightElements = elements.filter(c => c.orientation === "upright").length; + + analysis += `**Elemental Harmony:** With ${uprightElements} out of 4 elements upright, `; + if (uprightElements === 4) { + analysis += "all elements are in perfect harmony, creating powerful manifestation energy. "; + } else if (uprightElements >= 3) { + analysis += "strong elemental balance with minor adjustments needed. "; + } else if (uprightElements >= 2) { + analysis += "moderate balance requiring attention to weaker elements. "; + } else { + analysis += "significant elemental imbalance requiring healing and rebalancing. "; + } + + // Spirit connection analysis + analysis += `**Divine Connection:** Spirit (${spirit.card.name}) `; + if (spirit.orientation === "upright") { + analysis += "shows strong divine connection guiding your elemental balance. "; + } else { + analysis += "suggests the need to strengthen your spiritual foundation. "; + } + + // Element-specific insights + analysis += `**Elemental Flow:** `; + if (air.orientation === "upright") analysis += "Clear thinking and communication support your goals. "; + if (fire.orientation === "upright") analysis += "Passionate energy drives your actions. "; + if (earth.orientation === "upright") analysis += "Practical foundations support manifestation. "; + if (water.orientation === "upright") analysis += "Emotional wisdom guides your intuition. "; + + analysis += "\n"; + return analysis; + } + /** * Check if two cards have similar energy */ diff --git a/src/tarot/spreads.ts b/src/tarot/spreads.ts index 04596f1..b2e468d 100644 --- a/src/tarot/spreads.ts +++ b/src/tarot/spreads.ts @@ -370,6 +370,218 @@ export const TAROT_SPREADS: Record = { meaning: "The growth and healing that comes from shadow work" } ] + }, + + venus_love: { + name: "Venus Love Spread", + description: "A 7-card spread exploring love, relationships, self-worth, and romantic potential through the energy of Venus", + cardCount: 7, + positions: [ + { + name: "Your Current Relationship Energy", + meaning: "Your present state in love and relationships" + }, + { + name: "Self-Love and Self-Worth", + meaning: "How you value and care for yourself" + }, + { + name: "What Attracts Love to You", + meaning: "Your magnetic qualities and what draws love into your life" + }, + { + name: "Blocks to Receiving Love", + meaning: "What prevents you from fully receiving and accepting love" + }, + { + name: "How to Enhance Relationships", + meaning: "Actions to improve your current or future relationships" + }, + { + name: "Hidden Desires of the Heart", + meaning: "Your deepest romantic and emotional needs" + }, + { + name: "Future Potential in Love", + meaning: "What the future holds for your romantic life" + } + ] + }, + + tree_of_life: { + name: "Tree of Life Spread", + description: "A 10-card spread based on the Kabbalistic Tree of Life, providing deep spiritual insights and life guidance", + cardCount: 10, + positions: [ + { + name: "Kether (Crown)", + meaning: "Divine will, highest purpose, and spiritual connection" + }, + { + name: "Chokmah (Wisdom)", + meaning: "Creative force, inspiration, and dynamic energy" + }, + { + name: "Binah (Understanding)", + meaning: "Form, structure, and receptive wisdom" + }, + { + name: "Chesed (Mercy)", + meaning: "Love, compassion, and expansion" + }, + { + name: "Geburah (Severity)", + meaning: "Strength, discipline, and necessary boundaries" + }, + { + name: "Tiphareth (Beauty)", + meaning: "Balance, harmony, and integration of opposites" + }, + { + name: "Netzach (Victory)", + meaning: "Emotions, desires, and artistic expression" + }, + { + name: "Hod (Splendor)", + meaning: "Intellect, communication, and analytical thinking" + }, + { + name: "Yesod (Foundation)", + meaning: "Subconscious, dreams, and psychic impressions" + }, + { + name: "Malkuth (Kingdom)", + meaning: "Physical manifestation and material world results" + } + ] + }, + + astrological_houses: { + name: "Astrological Houses Spread", + description: "A 12-card spread representing the twelve astrological houses, providing comprehensive life insights", + cardCount: 12, + positions: [ + { + name: "1st House - Self and Identity", + meaning: "Your personality, appearance, and how others see you" + }, + { + name: "2nd House - Values and Resources", + meaning: "Money, possessions, self-worth, and personal values" + }, + { + name: "3rd House - Communication", + meaning: "Communication, learning, siblings, and short journeys" + }, + { + name: "4th House - Home and Family", + meaning: "Home, family, roots, and emotional foundation" + }, + { + name: "5th House - Creativity and Romance", + meaning: "Creativity, children, romance, and self-expression" + }, + { + name: "6th House - Work and Health", + meaning: "Daily work, health, service, and routine" + }, + { + name: "7th House - Partnerships", + meaning: "Marriage, business partnerships, and open enemies" + }, + { + name: "8th House - Transformation", + meaning: "Shared resources, transformation, and hidden matters" + }, + { + name: "9th House - Philosophy", + meaning: "Higher learning, philosophy, travel, and spirituality" + }, + { + name: "10th House - Career and Reputation", + meaning: "Career, reputation, public image, and life direction" + }, + { + name: "11th House - Friends and Aspirations", + meaning: "Friends, groups, hopes, and future aspirations" + }, + { + name: "12th House - Spirituality and Hidden", + meaning: "Spirituality, hidden enemies, and subconscious patterns" + } + ] + }, + + mandala: { + name: "Mandala Spread", + description: "A 9-card circular spread representing wholeness and the journey to self-discovery", + cardCount: 9, + positions: [ + { + name: "Center - Core Self", + meaning: "Your essential nature and current spiritual center" + }, + { + name: "North - Spiritual Guidance", + meaning: "Divine guidance and higher wisdom available to you" + }, + { + name: "Northeast - Mental Clarity", + meaning: "Thoughts, ideas, and mental processes that need attention" + }, + { + name: "East - New Beginnings", + meaning: "Fresh starts and opportunities on the horizon" + }, + { + name: "Southeast - Relationships", + meaning: "Your connections with others and social dynamics" + }, + { + name: "South - Passion and Creativity", + meaning: "Your creative fire and what energizes you" + }, + { + name: "Southwest - Healing and Release", + meaning: "What needs to be healed or released from your life" + }, + { + name: "West - Intuition and Emotions", + meaning: "Your emotional landscape and intuitive insights" + }, + { + name: "Northwest - Wisdom and Knowledge", + meaning: "Lessons learned and wisdom gained from experience" + } + ] + }, + + pentagram: { + name: "Pentagram Spread", + description: "A 5-card spread based on the five elements, exploring balance and spiritual harmony", + cardCount: 5, + positions: [ + { + name: "Spirit (Top)", + meaning: "Divine guidance and your highest spiritual purpose" + }, + { + name: "Air (Upper Right)", + meaning: "Thoughts, communication, and intellectual matters" + }, + { + name: "Fire (Lower Right)", + meaning: "Passion, action, and creative energy" + }, + { + name: "Earth (Lower Left)", + meaning: "Material world, stability, and practical concerns" + }, + { + name: "Water (Upper Left)", + meaning: "Emotions, intuition, and subconscious influences" + } + ] } }; diff --git a/src/tarot/types.ts b/src/tarot/types.ts index 5b4f587..2cdd2b2 100644 --- a/src/tarot/types.ts +++ b/src/tarot/types.ts @@ -70,5 +70,5 @@ export interface TarotSession { } export type CardOrientation = "upright" | "reversed"; -export type SpreadType = "single_card" | "three_card" | "celtic_cross" | "horseshoe" | "relationship_cross" | "career_path" | "decision_making" | "spiritual_guidance" | "year_ahead" | "chakra_alignment" | "shadow_work"; +export type SpreadType = "single_card" | "three_card" | "celtic_cross" | "horseshoe" | "relationship_cross" | "career_path" | "decision_making" | "spiritual_guidance" | "year_ahead" | "chakra_alignment" | "shadow_work" | "venus_love" | "tree_of_life" | "astrological_houses" | "mandala" | "pentagram"; export type CardCategory = "all" | "major_arcana" | "minor_arcana" | "wands" | "cups" | "swords" | "pentacles";