Character schema v2: background, dialogue_style, appearance, skills, gaze_presets with automatic v1→v2 migration. LLM-assisted character creation via Character MCP server. Two-tier memory system (personal per-character + general shared) with budget-based injection into LLM system prompt. Per-character TTS voice routing via state file — Wyoming TTS server reads active config to route between Kokoro (local) and ElevenLabs (cloud PCM 24kHz). Dashboard: memories page, conversation history, character profile on cards, auto-TTS engine selection from character config. Also includes VTube Studio expression bridge and ComfyUI API guide. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
711 B
JavaScript
29 lines
711 B
JavaScript
import { useState, useEffect } from 'react'
|
|
|
|
const ACTIVE_KEY = 'homeai_active_character'
|
|
|
|
export function useActiveCharacter() {
|
|
const [character, setCharacter] = useState(null)
|
|
|
|
useEffect(() => {
|
|
const activeId = localStorage.getItem(ACTIVE_KEY)
|
|
if (!activeId) return
|
|
|
|
fetch(`/api/characters/${activeId}`)
|
|
.then(r => r.ok ? r.json() : null)
|
|
.then(profile => {
|
|
if (profile) {
|
|
setCharacter({
|
|
id: profile.id,
|
|
name: profile.data.display_name || profile.data.name || 'AI',
|
|
image: profile.image || null,
|
|
tts: profile.data.tts || null,
|
|
})
|
|
}
|
|
})
|
|
.catch(() => {})
|
|
}, [])
|
|
|
|
return character
|
|
}
|