code: func (a *Manager) RegisterAgent(ctx context.Context, name string, agent Agent, conn choria.AgentConnector) error {
  	a.mu.Lock()
  	defer a.mu.Unlock()
  
  	if a.agentDenied(name) {
  		a.log.Infof("Denying agent %s based on agent deny list", name)
  		return nil
  	}
  
  	a.log.Infof("Registering new agent %s of type %s", name, agent.Metadata().Name)
  
  	agent.SetServerInfo(a.serverInfo)
  
  	if _, found := a.agents[name]; found {
  		return fmt.Errorf("Agent %s is already registered", name)
  	}
  
  	err := a.subscribeAgent(ctx, name, agent, conn)
  	if err != nil {
  		return fmt.Errorf("Could not register agent %s: %s", name, err)
  	}
  
  	a.agents[name] = agent
  
  	return nil
  }
docs: // RegisterAgent connects a new agent to the server instance, subscribe to all its targets etc