formatExternalAgent formats the instructions for an external agent.
(workspaceName string, externalAgents []externalAgent)
| 251 | |
| 252 | // formatExternalAgent formats the instructions for an external agent. |
| 253 | func formatExternalAgent(workspaceName string, externalAgents []externalAgent) string { |
| 254 | var output strings.Builder |
| 255 | _, _ = output.WriteString(fmt.Sprintf("\nPlease run the following command to attach external agent to the workspace %s:\n\n", cliui.Keyword(workspaceName))) |
| 256 | |
| 257 | for i, agent := range externalAgents { |
| 258 | if len(externalAgents) > 1 { |
| 259 | _, _ = output.WriteString(fmt.Sprintf("For agent %s:\n", cliui.Keyword(agent.AgentName))) |
| 260 | } |
| 261 | |
| 262 | _, _ = output.WriteString(fmt.Sprintf("%s\n", pretty.Sprint(cliui.DefaultStyles.Code, agent.InitScript))) |
| 263 | |
| 264 | if i < len(externalAgents)-1 { |
| 265 | _, _ = output.WriteString("\n") |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | return output.String() |
| 270 | } |
no test coverage detected