From ef84eefeb21923f44db1de01d09f93e6bfddd738 Mon Sep 17 00:00:00 2001 From: Aidan Daly Date: Wed, 25 Feb 2026 19:03:51 -0500 Subject: [PATCH] refactor: remove dead agent binding step from add gateway wizard --- src/cli/commands/add/actions.ts | 8 ---- src/cli/commands/add/command.tsx | 1 - src/cli/tui/screens/add/AddFlow.tsx | 1 - src/cli/tui/screens/mcp/AddGatewayFlow.tsx | 4 -- src/cli/tui/screens/mcp/AddGatewayScreen.tsx | 47 +++---------------- src/cli/tui/screens/mcp/types.ts | 5 +- .../tui/screens/mcp/useAddGatewayWizard.ts | 19 +------- 7 files changed, 10 insertions(+), 75 deletions(-) diff --git a/src/cli/commands/add/actions.ts b/src/cli/commands/add/actions.ts index 5394a685..6d28bfc7 100644 --- a/src/cli/commands/add/actions.ts +++ b/src/cli/commands/add/actions.ts @@ -243,17 +243,9 @@ async function handleByoPath( // Gateway handler function buildGatewayConfig(options: ValidatedAddGatewayOptions): AddGatewayConfig { - const agents = options.agents - ? options.agents - .split(',') - .map(s => s.trim()) - .filter(Boolean) - : []; - const config: AddGatewayConfig = { name: options.name, description: options.description ?? `Gateway for ${options.name}`, - agents, authorizerType: options.authorizerType, jwtConfig: undefined, }; diff --git a/src/cli/commands/add/command.tsx b/src/cli/commands/add/command.tsx index df1dd80e..2db2b40a 100644 --- a/src/cli/commands/add/command.tsx +++ b/src/cli/commands/add/command.tsx @@ -272,7 +272,6 @@ export function registerAdd(program: Command) { .option('--discovery-url ', 'OIDC discovery URL (required for CUSTOM_JWT)') .option('--allowed-audience ', 'Comma-separated allowed audience values (required for CUSTOM_JWT)') .option('--allowed-clients ', 'Comma-separated allowed client IDs (required for CUSTOM_JWT)') - .option('--agents ', 'Comma-separated agent names to attach gateway to') .option('--json', 'Output as JSON') .action(async options => { requireProject(); diff --git a/src/cli/tui/screens/add/AddFlow.tsx b/src/cli/tui/screens/add/AddFlow.tsx index 0f2b4fab..dab5eb13 100644 --- a/src/cli/tui/screens/add/AddFlow.tsx +++ b/src/cli/tui/screens/add/AddFlow.tsx @@ -325,7 +325,6 @@ export function AddFlow(props: AddFlowProps) { return ( setFlow({ name: 'select' })} onDev={props.onDev} diff --git a/src/cli/tui/screens/mcp/AddGatewayFlow.tsx b/src/cli/tui/screens/mcp/AddGatewayFlow.tsx index 8e0529c3..c863c421 100644 --- a/src/cli/tui/screens/mcp/AddGatewayFlow.tsx +++ b/src/cli/tui/screens/mcp/AddGatewayFlow.tsx @@ -13,8 +13,6 @@ type FlowState = interface AddGatewayFlowProps { /** Whether running in interactive TUI mode */ isInteractive?: boolean; - /** Available agents for the create wizard */ - availableAgents: string[]; onExit: () => void; onBack: () => void; /** Called when user selects dev from success screen to run agent locally */ @@ -25,7 +23,6 @@ interface AddGatewayFlowProps { export function AddGatewayFlow({ isInteractive = true, - availableAgents, onExit, onBack, onDev, @@ -69,7 +66,6 @@ export function AddGatewayFlow({ return ( void; onExit: () => void; existingGateways: string[]; - availableAgents: string[]; unassignedTargets: string[]; } @@ -31,7 +30,6 @@ export function AddGatewayScreen({ onComplete, onExit, existingGateways, - availableAgents, unassignedTargets, }: AddGatewayScreenProps) { const wizard = useAddGatewayWizard(unassignedTargets.length); @@ -41,11 +39,6 @@ export function AddGatewayScreen({ const [jwtDiscoveryUrl, setJwtDiscoveryUrl] = useState(''); const [jwtAudience, setJwtAudience] = useState(''); - const agentItems: SelectableItem[] = useMemo( - () => availableAgents.map(name => ({ id: name, title: name })), - [availableAgents] - ); - const unassignedTargetItems: SelectableItem[] = useMemo( () => unassignedTargets.map(name => ({ id: name, title: name })), [unassignedTargets] @@ -59,7 +52,6 @@ export function AddGatewayScreen({ const isNameStep = wizard.step === 'name'; const isAuthorizerStep = wizard.step === 'authorizer'; const isJwtConfigStep = wizard.step === 'jwt-config'; - const isAgentsStep = wizard.step === 'agents'; const isIncludeTargetsStep = wizard.step === 'include-targets'; const isConfirmStep = wizard.step === 'confirm'; @@ -70,15 +62,6 @@ export function AddGatewayScreen({ isActive: isAuthorizerStep, }); - const agentsNav = useMultiSelectNavigation({ - items: agentItems, - getId: item => item.id, - onConfirm: ids => wizard.setAgents(ids), - onExit: () => wizard.goBack(), - isActive: isAgentsStep, - requireSelection: false, - }); - const targetsNav = useMultiSelectNavigation({ items: unassignedTargetItems, getId: item => item.id, @@ -135,14 +118,13 @@ export function AddGatewayScreen({ } }; - const helpText = - isAgentsStep || isIncludeTargetsStep - ? 'Space toggle · Enter confirm · Esc back' - : isConfirmStep - ? HELP_TEXT.CONFIRM_CANCEL - : isAuthorizerStep - ? HELP_TEXT.NAVIGATE_SELECT - : HELP_TEXT.TEXT_INPUT; + const helpText = isIncludeTargetsStep + ? 'Space toggle · Enter confirm · Esc back' + : isConfirmStep + ? HELP_TEXT.CONFIRM_CANCEL + : isAuthorizerStep + ? HELP_TEXT.NAVIGATE_SELECT + : HELP_TEXT.TEXT_INPUT; const headerContent = ; @@ -187,20 +169,6 @@ export function AddGatewayScreen({ /> )} - {isAgentsStep && - (agentItems.length > 0 ? ( - - ) : ( - - No agents defined. Add agents first via `agentcore add agent`. Press Enter to continue. - - ))} - {isIncludeTargetsStep && (unassignedTargetItems.length > 0 ? ( 0 ? wizard.config.agents.join(', ') : '(none)' }, { label: 'Targets', value: diff --git a/src/cli/tui/screens/mcp/types.ts b/src/cli/tui/screens/mcp/types.ts index e6151154..8cee2c4d 100644 --- a/src/cli/tui/screens/mcp/types.ts +++ b/src/cli/tui/screens/mcp/types.ts @@ -4,13 +4,11 @@ import type { GatewayAuthorizerType, NodeRuntime, PythonRuntime, ToolDefinition // Gateway Flow Types // ───────────────────────────────────────────────────────────────────────────── -export type AddGatewayStep = 'name' | 'authorizer' | 'jwt-config' | 'agents' | 'include-targets' | 'confirm'; +export type AddGatewayStep = 'name' | 'authorizer' | 'jwt-config' | 'include-targets' | 'confirm'; export interface AddGatewayConfig { name: string; description: string; - /** Agent names that will use this gateway */ - agents: string[]; /** Authorization type for the gateway */ authorizerType: GatewayAuthorizerType; /** JWT authorizer configuration (when authorizerType is 'CUSTOM_JWT') */ @@ -27,7 +25,6 @@ export const GATEWAY_STEP_LABELS: Record = { name: 'Name', authorizer: 'Authorizer', 'jwt-config': 'JWT Config', - agents: 'Agents', 'include-targets': 'Include Targets', confirm: 'Confirm', }; diff --git a/src/cli/tui/screens/mcp/useAddGatewayWizard.ts b/src/cli/tui/screens/mcp/useAddGatewayWizard.ts index 7600b49c..2bd24b75 100644 --- a/src/cli/tui/screens/mcp/useAddGatewayWizard.ts +++ b/src/cli/tui/screens/mcp/useAddGatewayWizard.ts @@ -4,8 +4,8 @@ import { useCallback, useMemo, useState } from 'react'; /** Maps authorizer type to the next step after authorizer selection */ const AUTHORIZER_NEXT_STEP: Record = { - NONE: 'agents', - AWS_IAM: 'agents', + NONE: 'confirm', + AWS_IAM: 'confirm', CUSTOM_JWT: 'jwt-config', }; @@ -13,7 +13,6 @@ function getDefaultConfig(): AddGatewayConfig { return { name: '', description: '', - agents: [], authorizerType: 'NONE', jwtConfig: undefined, selectedTargets: [], @@ -32,8 +31,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) { baseSteps.push('jwt-config'); } - baseSteps.push('agents'); - if (unassignedTargetsCount > 0) { baseSteps.push('include-targets'); } @@ -76,17 +73,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) { ...c, jwtConfig, })); - setStep('agents'); - }, - [] - ); - - const setAgents = useCallback( - (agents: string[]) => { - setConfig(c => ({ - ...c, - agents, - })); setStep(unassignedTargetsCount > 0 ? 'include-targets' : 'confirm'); }, [unassignedTargetsCount] @@ -114,7 +100,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) { setName, setAuthorizerType, setJwtConfig, - setAgents, setSelectedTargets, reset, };