NewRemoteRuntime creates a new remote runtime that implements the Runtime interface. It accepts any client that implements the RemoteClient interface.
(client RemoteClient, opts ...RemoteRuntimeOption)
| 71 | // NewRemoteRuntime creates a new remote runtime that implements the Runtime interface. |
| 72 | // It accepts any client that implements the RemoteClient interface. |
| 73 | func NewRemoteRuntime(client RemoteClient, opts ...RemoteRuntimeOption) (*RemoteRuntime, error) { |
| 74 | if client == nil { |
| 75 | return nil, errors.New("client cannot be nil") |
| 76 | } |
| 77 | |
| 78 | r := &RemoteRuntime{ |
| 79 | client: client, |
| 80 | agentFilename: "agent.yaml", |
| 81 | team: team.New(), |
| 82 | } |
| 83 | |
| 84 | for _, opt := range opts { |
| 85 | opt(r) |
| 86 | } |
| 87 | |
| 88 | return r, nil |
| 89 | } |
| 90 | |
| 91 | // resolvedAgent returns the active agent's name and config from the remote |
| 92 | // team. When no specific agent has been selected, both come from the team's |