Add server-side client activity tracking for smart notifications
- Add client_heartbeat message type for clients to report activity - Add shouldNotify field to attention_required events - Track client activity (focusedAgentId, lastActivityAt) per session - WebSocketServer checks all sessions to determine shouldNotify - If any client is active on the agent (within 60s), shouldNotify=false - Add onAgentAttention callback to AgentManager for clean separation
This commit is contained in:
@@ -447,6 +447,17 @@ export class DaemonClientV2 {
|
||||
this.sendSessionMessage({ type: "clear_agent_attention", agentId });
|
||||
}
|
||||
|
||||
sendHeartbeat(params: {
|
||||
focusedAgentId: string | null;
|
||||
lastActivityAt: string;
|
||||
}): void {
|
||||
this.sendSessionMessage({
|
||||
type: "client_heartbeat",
|
||||
focusedAgentId: params.focusedAgentId,
|
||||
lastActivityAt: params.lastActivityAt,
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Conversation / Session RPC
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user