From 11d7519242c98bd6648c7ed7e5377da386e15ac6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 05:04:59 +0000 Subject: [PATCH 1/3] Initial plan From e126df83327e228cf40a5df6268f18cc461b613e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 05:13:41 +0000 Subject: [PATCH 2/3] Add group titles and descriptions to interactive form Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- pkg/cli/interactive.go | 177 +++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 112 deletions(-) diff --git a/pkg/cli/interactive.go b/pkg/cli/interactive.go index 5e81d93e9fe..f5852eea130 100644 --- a/pkg/cli/interactive.go +++ b/pkg/cli/interactive.go @@ -72,29 +72,9 @@ func CreateWorkflowInteractively(workflowName string, verbose bool, force bool) } } - // Run through the interactive prompts - if err := builder.promptForTrigger(); err != nil { - return fmt.Errorf("failed to get trigger selection: %w", err) - } - - if err := builder.promptForEngine(); err != nil { - return fmt.Errorf("failed to get engine selection: %w", err) - } - - if err := builder.promptForTools(); err != nil { - return fmt.Errorf("failed to get tools selection: %w", err) - } - - if err := builder.promptForSafeOutputs(); err != nil { - return fmt.Errorf("failed to get safe outputs selection: %w", err) - } - - if err := builder.promptForNetworkAccess(); err != nil { - return fmt.Errorf("failed to get network access selection: %w", err) - } - - if err := builder.promptForIntent(); err != nil { - return fmt.Errorf("failed to get workflow intent: %w", err) + // Run through the interactive prompts organized by groups + if err := builder.promptForConfiguration(); err != nil { + return fmt.Errorf("failed to get workflow configuration: %w", err) } // Generate the workflow @@ -126,8 +106,9 @@ func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error { return form.Run() } -// promptForTrigger asks the user to select when the workflow should run -func (b *InteractiveWorkflowBuilder) promptForTrigger() error { +// promptForConfiguration organizes all prompts into logical groups with titles and descriptions +func (b *InteractiveWorkflowBuilder) promptForConfiguration() error { + // Prepare trigger options triggerOptions := []huh.Option[string]{ huh.NewOption("Manual trigger (workflow_dispatch)", "workflow_dispatch"), huh.NewOption("Issue opened or reopened", "issues"), @@ -139,22 +120,7 @@ func (b *InteractiveWorkflowBuilder) promptForTrigger() error { huh.NewOption("Command trigger (/bot-name)", "command"), } - form := huh.NewForm( - huh.NewGroup( - huh.NewSelect[string](). - Title("When should this workflow run?"). - Description("Select the event that should trigger your agentic workflow"). - Options(triggerOptions...). - Height(8). - Value(&b.Trigger), - ), - ).WithAccessible(isAccessibleMode()) - - return form.Run() -} - -// promptForEngine asks the user to select the AI engine -func (b *InteractiveWorkflowBuilder) promptForEngine() error { + // Prepare engine options engineOptions := []huh.Option[string]{ huh.NewOption("copilot - GitHub Copilot CLI", "copilot"), huh.NewOption("claude - Anthropic Claude Code coding agent", "claude"), @@ -162,21 +128,7 @@ func (b *InteractiveWorkflowBuilder) promptForEngine() error { huh.NewOption("custom - Custom engine configuration", "custom"), } - form := huh.NewForm( - huh.NewGroup( - huh.NewSelect[string](). - Title("Which AI engine should process this workflow?"). - Description("Copilot is recommended for most use cases"). - Options(engineOptions...). - Value(&b.Engine), - ), - ).WithAccessible(isAccessibleMode()) - - return form.Run() -} - -// promptForTools asks the user to select which tools the AI can use -func (b *InteractiveWorkflowBuilder) promptForTools() error { + // Prepare tool options toolOptions := []huh.Option[string]{ huh.NewOption("github - GitHub API tools (issues, PRs, comments)", "github"), huh.NewOption("edit - File editing tools", "edit"), @@ -186,28 +138,7 @@ func (b *InteractiveWorkflowBuilder) promptForTools() error { huh.NewOption("playwright - Browser automation tools", "playwright"), } - var selected []string - form := huh.NewForm( - huh.NewGroup( - huh.NewMultiSelect[string](). - Title("Which tools should the AI have access to?"). - Description("Select all tools that your workflow might need. You can always modify these later."). - Options(toolOptions...). - Height(8). - Value(&selected), - ), - ).WithAccessible(isAccessibleMode()) - - if err := form.Run(); err != nil { - return err - } - - b.Tools = selected - return nil -} - -// promptForSafeOutputs asks the user to select safe output options -func (b *InteractiveWorkflowBuilder) promptForSafeOutputs() error { + // Prepare safe output options outputOptions := []huh.Option[string]{ huh.NewOption("create-issue - Create GitHub issues", "create-issue"), huh.NewOption("create-agent-task - Create GitHub Copilot agent tasks", "create-agent-task"), @@ -221,59 +152,81 @@ func (b *InteractiveWorkflowBuilder) promptForSafeOutputs() error { huh.NewOption("push-to-pull-request-branch - Push changes to PR branches", "push-to-pull-request-branch"), } - var selected []string + // Prepare network options + networkOptions := []huh.Option[string]{ + huh.NewOption("defaults - Basic infrastructure only", "defaults"), + huh.NewOption("ecosystem - Common development ecosystems (Python, Node.js, Go, etc.)", "ecosystem"), + } + + // Set default network access + b.NetworkAccess = "defaults" + + // Variables to hold multi-select results + var selectedTools []string + var selectedOutputs []string + + // Create form with organized groups form := huh.NewForm( + // Group 1: Basic Configuration + huh.NewGroup( + huh.NewSelect[string](). + Title("When should this workflow run?"). + Options(triggerOptions...). + Height(8). + Value(&b.Trigger), + huh.NewSelect[string](). + Title("Which AI engine should process this workflow?"). + Options(engineOptions...). + Value(&b.Engine), + ). + Title("Basic Configuration"). + Description("Let's start with the fundamentals of your workflow"), + + // Group 2: Capabilities huh.NewGroup( + huh.NewMultiSelect[string](). + Title("Which tools should the AI have access to?"). + Options(toolOptions...). + Height(8). + Value(&selectedTools), huh.NewMultiSelect[string](). Title("What outputs should the AI be able to create?"). - Description("Safe outputs provide secure ways for AI to interact with GitHub. Select what your workflow needs to do."). Options(outputOptions...). Height(8). - Value(&selected), - ), - ).WithAccessible(isAccessibleMode()) + Value(&selectedOutputs), + ). + Title("Capabilities"). + Description("Select the tools and outputs your workflow needs"), - if err := form.Run(); err != nil { - return err - } - - b.SafeOutputs = selected - return nil -} - -// promptForNetworkAccess asks about network access requirements -func (b *InteractiveWorkflowBuilder) promptForNetworkAccess() error { - networkOptions := []huh.Option[string]{ - huh.NewOption("defaults - Basic infrastructure only", "defaults"), - huh.NewOption("ecosystem - Common development ecosystems (Python, Node.js, Go, etc.)", "ecosystem"), - } - - b.NetworkAccess = "defaults" // Set default value - form := huh.NewForm( + // Group 3: Network & Security huh.NewGroup( huh.NewSelect[string](). Title("What network access does the workflow need?"). - Description("Network permissions control what external sites the AI can access"). Options(networkOptions...). Value(&b.NetworkAccess), - ), - ).WithAccessible(isAccessibleMode()) + ). + Title("Network & Security"). + Description("Configure network access and security settings"), - return form.Run() -} - -// promptForIntent asks the user to describe what the workflow should do -func (b *InteractiveWorkflowBuilder) promptForIntent() error { - form := huh.NewForm( + // Group 4: Instructions huh.NewGroup( huh.NewText(). Title("Describe what this workflow should do:"). - Description("Provide a clear description of the workflow's purpose and what the AI should accomplish. This will be the main prompt for the AI."). Value(&b.Intent), - ), + ). + Title("Instructions"). + Description("Describe what you want this workflow to accomplish"), ).WithAccessible(isAccessibleMode()) - return form.Run() + if err := form.Run(); err != nil { + return err + } + + // Store the multi-select results + b.Tools = selectedTools + b.SafeOutputs = selectedOutputs + + return nil } // generateWorkflow creates the markdown workflow file based on user selections From b47c90973f7fdab9f7b28960b7a5b66f9d555cb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 05:43:28 +0000 Subject: [PATCH 3/3] Add serena tool to interactive form options Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/interactive.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/interactive.go b/pkg/cli/interactive.go index f5852eea130..eca083463ec 100644 --- a/pkg/cli/interactive.go +++ b/pkg/cli/interactive.go @@ -136,6 +136,7 @@ func (b *InteractiveWorkflowBuilder) promptForConfiguration() error { huh.NewOption("web-fetch - Web content fetching tools", "web-fetch"), huh.NewOption("web-search - Web search tools", "web-search"), huh.NewOption("playwright - Browser automation tools", "playwright"), + huh.NewOption("serena - Serena code analysis tool", "serena"), } // Prepare safe output options