You can do this using embedded framework notification API by subscribing to "v2.users.{userId}.conversations" topic.
Once agent is connected, you can start timer (setTimer API in JS) and can reset it on customer message.
Once timer (say 30 minute) expires, you can disconnect conversation using following API
PATCH /api/v2/conversations/messages/{conversationId}/participants/{participantId}
------------------------------
Parvez Alam
------------------------------