""" Housekeeper capability registration for the Household Registry. Defines The Housekeeper's capabilities and registers it as a household member for coordination by the Steward and Tatlock. """ from src.agents.housekeeper.agent import get_housekeeper_agent from src.agents.housekeeper.tools import HOUSEKEEPER_TOOLS from src.core.household_registry import ( HouseholdCapability, get_household_registry, ) from src.core.logging_config import get_logger logger = get_logger(__name__) # The Housekeeper's capability summary for Steward coordination HOUSEKEEPER_CAPABILITY = HouseholdCapability( name="housekeeper", role="The Housekeeper", category="automation", description=( "Home automation control: TURN ON/OFF devices, ACTIVATE scenes, " "RUN scripts, LIST devices, MANAGE automations. Controls lights, " "switches, climate, and other smart home devices via Home Assistant." ), domains=[ "lights", "switches", "automation", "home", "smart home", "scene", "script", "device", "turn on", "turn off", "temperature", "climate", "fan", "cover", "blinds", ], cost="low", # Fast local API calls to core-api requires_network=True, # Needs core-api access ) def get_housekeeper_capability() -> HouseholdCapability: """Get The Housekeeper's capability definition.""" return HOUSEKEEPER_CAPABILITY def register_housekeeper() -> None: """ Register The Housekeeper with the Household Registry. This makes The Housekeeper available for: - Steward recommendations (via capability summary) - Tatlock delegation (via agent reference) - Tool scoping (via tool list) """ registry = get_household_registry() # Check if already registered if "housekeeper" in registry: logger.debug("housekeeper_already_registered") return registry.register( name="housekeeper", capability=HOUSEKEEPER_CAPABILITY, tools=HOUSEKEEPER_TOOLS, agent=get_housekeeper_agent(), ) logger.info( "housekeeper_registered", role=HOUSEKEEPER_CAPABILITY.role, domains=HOUSEKEEPER_CAPABILITY.domains, tool_count=len(HOUSEKEEPER_TOOLS), ) def unregister_housekeeper() -> None: """Unregister The Housekeeper from the Household Registry.""" registry = get_household_registry() registry.unregister("housekeeper") logger.info("housekeeper_unregistered")