feat: Add presence heartbeat for Matrix online status

- matrix-gateway: POST /internal/matrix/presence/online endpoint
- usePresenceHeartbeat hook with activity tracking
- Auto away after 5 min inactivity
- Offline on page close/visibility change
- Integrated in MatrixChatRoom component
This commit is contained in:
Apple
2025-11-27 00:19:40 -08:00
parent 5bed515852
commit 3de3c8cb36
6371 changed files with 1317450 additions and 932 deletions

View File

@@ -0,0 +1,34 @@
"""
Space Service Client Adapter
Phase 9: Living Map
"""
from typing import Dict, Any
from .base_client import BaseServiceClient
import os
class SpaceClient(BaseServiceClient):
"""Client for space-service"""
def __init__(self):
base_url = os.getenv("SPACE_SERVICE_URL", "http://localhost:7002")
super().__init__(base_url)
async def get_space_scene(self) -> Dict[str, Any]:
"""Get space scene data"""
result = await self.get_with_fallback("/api/space/scene", fallback={})
return result
async def get_layer_data(self) -> Dict[str, Any]:
"""Get space layer data for Living Map"""
scene = await self.get_space_scene()
# Extract planets and nodes from scene
# Format depends on space-service implementation
planets = scene.get("planets", [])
nodes = scene.get("nodes", [])
return {
"planets": planets,
"nodes": nodes
}