code: func (a *Agent) LastUserEvent() *UserEvent {
  	a.eventLock.RLock()
  	defer a.eventLock.RUnlock()
  	n := len(a.eventBuf)
  	idx := (((a.eventIndex - 1) % n) + n) % n
  	return a.eventBuf[idx]
  }
docs: // LastUserEvent is used to return the last user event.
  // This will return nil if there is no recent event.