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,68 @@
/**
* Wrapper для вибору між базовим та розширеним чатом
*/
import React from 'react';
import { MicroDaoOrchestratorChat } from './MicroDaoOrchestratorChat';
import { MicroDaoOrchestratorChatEnhanced } from './MicroDaoOrchestratorChatEnhanced';
interface Orchestrator {
id: string;
name: string;
description?: string;
avatar?: string;
}
interface MicroDaoOrchestratorChatWrapperProps {
orchestrator?: Orchestrator;
orchestratorAgentId?: string;
onClose?: () => void;
enhanced?: boolean; // Якщо true - використовувати розширену версію
}
/**
* Wrapper компонент для вибору між базовим та розширеним чатом
*
* @example
* // Базовий чат
* <MicroDaoOrchestratorChatWrapper
* orchestratorAgentId="helion"
* enhanced={false}
* />
*
* @example
* // Розширений чат з усіма функціями
* <MicroDaoOrchestratorChatWrapper
* orchestratorAgentId="helion"
* enhanced={true}
* />
*/
export const MicroDaoOrchestratorChatWrapper: React.FC<MicroDaoOrchestratorChatWrapperProps> = ({
orchestrator,
orchestratorAgentId,
onClose,
enhanced = false,
}) => {
// Вибираємо версію чату на основі параметра
if (enhanced) {
return (
<MicroDaoOrchestratorChatEnhanced
orchestrator={orchestrator}
orchestratorAgentId={orchestratorAgentId}
onClose={onClose}
/>
);
}
return (
<MicroDaoOrchestratorChat
orchestrator={orchestrator}
orchestratorAgentId={orchestratorAgentId}
onClose={onClose}
/>
);
};