newAgentRouter builds an agentRouter with team t and an initial current agent name. Callers are responsible for pre-validating that the initial name exists in t (NewLocalRuntime does this).
(t *team.Team, initial string)
| 29 | // agent name. Callers are responsible for pre-validating that the initial |
| 30 | // name exists in t (NewLocalRuntime does this). |
| 31 | func newAgentRouter(t *team.Team, initial string) *agentRouter { |
| 32 | r := &agentRouter{team: t} |
| 33 | r.current.Store(&initial) |
| 34 | return r |
| 35 | } |
| 36 | |
| 37 | // Name returns the name of the currently active agent. |
| 38 | func (r *agentRouter) Name() string { |