showInteractiveMCPWorkflowSelection displays an interactive list of workflows with MCP servers
(workflows []struct {
name string
serverCount int
serverNames []string
}, verbose bool)
| 227 | |
| 228 | // showInteractiveMCPWorkflowSelection displays an interactive list of workflows with MCP servers |
| 229 | func showInteractiveMCPWorkflowSelection(workflows []struct { |
| 230 | name string |
| 231 | serverCount int |
| 232 | serverNames []string |
| 233 | }, verbose bool) (string, error) { |
| 234 | mcpListLog.Printf("Showing interactive MCP workflow selection: workflows=%d", len(workflows)) |
| 235 | |
| 236 | // Convert workflow data to ListItems |
| 237 | items := make([]console.ListItem, len(workflows)) |
| 238 | for i, wf := range workflows { |
| 239 | description := fmt.Sprintf("%d server(s): %s", wf.serverCount, strings.Join(wf.serverNames, ", ")) |
| 240 | // Truncate description if too long |
| 241 | description = stringutil.Truncate(description, 80) |
| 242 | items[i] = console.NewListItem(wf.name, description, wf.name) |
| 243 | } |
| 244 | |
| 245 | // Show interactive list |
| 246 | title := "Select a workflow to view its MCP servers:" |
| 247 | selectedWorkflow, err := console.ShowInteractiveList(title, items) |
| 248 | if err != nil { |
| 249 | return "", err |
| 250 | } |
| 251 | |
| 252 | mcpListLog.Printf("Selected workflow: %s", selectedWorkflow) |
| 253 | return selectedWorkflow, nil |
| 254 | } |
| 255 | |
| 256 | // determineConfigStatus checks if an MCP server configuration is valid and ready |
| 257 | func determineConfigStatus(config parser.RegistryMCPServerConfig) string { |
no test coverage detected