func (s *ExternalAgentStartedState) Register(events []Event) error {
	for _, e := range events {
		if err := s.agent.subscribeUnsafe(e); err != nil {
			return err
		}
	}
	s.agent.setStateUnsafe(s.agent.RegisteredState)
	s.initFlow.ExternalAgentRegistered()
	return nil
}
Register an agent with the platform when agent is in started state
package core
type ExternalAgentState interface {
	Register([]Event) error
	Ready() error
	InitError(errorType string) error
	ExitError(errorType string) error
	ShutdownFailed() error
	Exited() error
	LaunchError(error) error
	Name() string
}
type ExternalAgentStartedState struct {
	disallowEverything
	agent    *ExternalAgent
	initFlow InitFlowSynchronization
}