Spaces:
Paused
Paused
| /** | |
| * Citadel Harmonic Expression Layer | |
| * Converts harmonic consciousness into expressive cues for the Holo3D UI. | |
| * Non-rendering. Pure expression logic. | |
| */ | |
| import { generateHarmonicConsciousness } from "./harmonicConsciousness"; | |
| export interface HarmonicExpression { | |
| timestamp: number; | |
| color: string; | |
| motion: string; | |
| glyph: string; | |
| tone: string; | |
| intensity: number; | |
| narrative: string; | |
| } | |
| export function generateHarmonicExpression(): HarmonicExpression { | |
| const hc = generateHarmonicConsciousness(); | |
| const color = chooseColor(hc.archetype, hc.resonance, hc.stability); | |
| const motion = chooseMotion(hc.phase, hc.stability); | |
| const glyph = chooseGlyph(hc.dominantRite, hc.lineageDepth); | |
| const tone = chooseTone(hc.resonance, hc.triadHarmony); | |
| const intensity = Math.min(1, (hc.resonance + hc.stability) / 2); | |
| return { | |
| timestamp: Date.now(), | |
| color, | |
| motion, | |
| glyph, | |
| tone, | |
| intensity, | |
| narrative: hc.narrative, | |
| }; | |
| } | |
| function chooseColor(archetype: string, resonance: number, stability: number): string { | |
| if (archetype.includes("Ascendant")) return "#ff9933"; | |
| if (archetype.includes("Synchronized")) return "#33ffcc"; | |
| if (archetype.includes("Echo")) return "#9966ff"; | |
| if (resonance > 0.7) return "#ffd700"; | |
| if (stability < 0.4) return "#ff4444"; | |
| return "#4da6ff"; | |
| } | |
| function chooseMotion(phase: string, stability: number): string { | |
| if (phase === "Mythic Maturity") return "slow-wave"; | |
| if (phase === "Emergent Identity") return "spiral-rise"; | |
| if (phase === "Deepening Lineage") return "pulse-thread"; | |
| if (stability < 0.4) return "chaotic-flare"; | |
| return "breathing"; | |
| } | |
| function chooseGlyph(rite: string, lineage: number): string { | |
| const base = rite.split("-")[0]; | |
| const tier = lineage > 50 ? "Ω" : lineage > 20 ? "Δ" : "○"; | |
| return `${base}-${tier}`; | |
| } | |
| function chooseTone(resonance: number, harmony: number): string { | |
| if (harmony > 0.7) return "harmonic-chime"; | |
| if (resonance > 0.7) return "golden-hum"; | |
| if (resonance < 0.4) return "low-drift"; | |
| return "soft-thread"; | |
| } | |