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,37 @@
from pydantic import BaseModel
from typing import Literal, Optional, Dict, Any
from datetime import datetime
class AgentInvocation(BaseModel):
agent_id: str
entrypoint: Literal["channel_message", "direct", "cron"] = "channel_message"
payload: Dict[str, Any]
class AgentBlueprint(BaseModel):
id: str
name: str
model: str
instructions: str
capabilities: Dict[str, Any] = {}
tools: list[str] = []
class ChannelMessage(BaseModel):
sender_id: str
sender_type: Literal["human", "agent"]
content: str
created_at: datetime
class LLMRequest(BaseModel):
model: str
messages: list[Dict[str, str]]
max_tokens: int = 1000
temperature: float = 0.7
class LLMResponse(BaseModel):
content: str
model: str
usage: Optional[Dict[str, int]] = None