Skip to content

Commit 3f92a52

Browse files
authored
refactor: remove dead agent binding step from add gateway wizard (#456)
1 parent add47b2 commit 3f92a52

File tree

7 files changed

+10
-75
lines changed

7 files changed

+10
-75
lines changed

src/cli/commands/add/actions.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,9 @@ async function handleByoPath(
243243

244244
// Gateway handler
245245
function buildGatewayConfig(options: ValidatedAddGatewayOptions): AddGatewayConfig {
246-
const agents = options.agents
247-
? options.agents
248-
.split(',')
249-
.map(s => s.trim())
250-
.filter(Boolean)
251-
: [];
252-
253246
const config: AddGatewayConfig = {
254247
name: options.name,
255248
description: options.description ?? `Gateway for ${options.name}`,
256-
agents,
257249
authorizerType: options.authorizerType,
258250
jwtConfig: undefined,
259251
};

src/cli/commands/add/command.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ export function registerAdd(program: Command) {
272272
.option('--discovery-url <url>', 'OIDC discovery URL (required for CUSTOM_JWT)')
273273
.option('--allowed-audience <values>', 'Comma-separated allowed audience values (required for CUSTOM_JWT)')
274274
.option('--allowed-clients <values>', 'Comma-separated allowed client IDs (required for CUSTOM_JWT)')
275-
.option('--agents <names>', 'Comma-separated agent names to attach gateway to')
276275
.option('--json', 'Output as JSON')
277276
.action(async options => {
278277
requireProject();

src/cli/tui/screens/add/AddFlow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ export function AddFlow(props: AddFlowProps) {
325325
return (
326326
<AddGatewayFlow
327327
isInteractive={props.isInteractive}
328-
availableAgents={agents}
329328
onExit={props.onExit}
330329
onBack={() => setFlow({ name: 'select' })}
331330
onDev={props.onDev}

src/cli/tui/screens/mcp/AddGatewayFlow.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ type FlowState =
1313
interface AddGatewayFlowProps {
1414
/** Whether running in interactive TUI mode */
1515
isInteractive?: boolean;
16-
/** Available agents for the create wizard */
17-
availableAgents: string[];
1816
onExit: () => void;
1917
onBack: () => void;
2018
/** Called when user selects dev from success screen to run agent locally */
@@ -25,7 +23,6 @@ interface AddGatewayFlowProps {
2523

2624
export function AddGatewayFlow({
2725
isInteractive = true,
28-
availableAgents,
2926
onExit,
3027
onBack,
3128
onDev,
@@ -69,7 +66,6 @@ export function AddGatewayFlow({
6966
return (
7067
<AddGatewayScreen
7168
existingGateways={existingGateways}
72-
availableAgents={availableAgents}
7369
unassignedTargets={unassignedTargets}
7470
onComplete={handleCreateComplete}
7571
onExit={onBack}

src/cli/tui/screens/mcp/AddGatewayScreen.tsx

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ interface AddGatewayScreenProps {
2323
onComplete: (config: AddGatewayConfig) => void;
2424
onExit: () => void;
2525
existingGateways: string[];
26-
availableAgents: string[];
2726
unassignedTargets: string[];
2827
}
2928

3029
export function AddGatewayScreen({
3130
onComplete,
3231
onExit,
3332
existingGateways,
34-
availableAgents,
3533
unassignedTargets,
3634
}: AddGatewayScreenProps) {
3735
const wizard = useAddGatewayWizard(unassignedTargets.length);
@@ -41,11 +39,6 @@ export function AddGatewayScreen({
4139
const [jwtDiscoveryUrl, setJwtDiscoveryUrl] = useState('');
4240
const [jwtAudience, setJwtAudience] = useState('');
4341

44-
const agentItems: SelectableItem[] = useMemo(
45-
() => availableAgents.map(name => ({ id: name, title: name })),
46-
[availableAgents]
47-
);
48-
4942
const unassignedTargetItems: SelectableItem[] = useMemo(
5043
() => unassignedTargets.map(name => ({ id: name, title: name })),
5144
[unassignedTargets]
@@ -59,7 +52,6 @@ export function AddGatewayScreen({
5952
const isNameStep = wizard.step === 'name';
6053
const isAuthorizerStep = wizard.step === 'authorizer';
6154
const isJwtConfigStep = wizard.step === 'jwt-config';
62-
const isAgentsStep = wizard.step === 'agents';
6355
const isIncludeTargetsStep = wizard.step === 'include-targets';
6456
const isConfirmStep = wizard.step === 'confirm';
6557

@@ -70,15 +62,6 @@ export function AddGatewayScreen({
7062
isActive: isAuthorizerStep,
7163
});
7264

73-
const agentsNav = useMultiSelectNavigation({
74-
items: agentItems,
75-
getId: item => item.id,
76-
onConfirm: ids => wizard.setAgents(ids),
77-
onExit: () => wizard.goBack(),
78-
isActive: isAgentsStep,
79-
requireSelection: false,
80-
});
81-
8265
const targetsNav = useMultiSelectNavigation({
8366
items: unassignedTargetItems,
8467
getId: item => item.id,
@@ -135,14 +118,13 @@ export function AddGatewayScreen({
135118
}
136119
};
137120

138-
const helpText =
139-
isAgentsStep || isIncludeTargetsStep
140-
? 'Space toggle · Enter confirm · Esc back'
141-
: isConfirmStep
142-
? HELP_TEXT.CONFIRM_CANCEL
143-
: isAuthorizerStep
144-
? HELP_TEXT.NAVIGATE_SELECT
145-
: HELP_TEXT.TEXT_INPUT;
121+
const helpText = isIncludeTargetsStep
122+
? 'Space toggle · Enter confirm · Esc back'
123+
: isConfirmStep
124+
? HELP_TEXT.CONFIRM_CANCEL
125+
: isAuthorizerStep
126+
? HELP_TEXT.NAVIGATE_SELECT
127+
: HELP_TEXT.TEXT_INPUT;
146128

147129
const headerContent = <StepIndicator steps={wizard.steps} currentStep={wizard.step} labels={GATEWAY_STEP_LABELS} />;
148130

@@ -187,20 +169,6 @@ export function AddGatewayScreen({
187169
/>
188170
)}
189171

190-
{isAgentsStep &&
191-
(agentItems.length > 0 ? (
192-
<WizardMultiSelect
193-
title="Select agents to use this gateway"
194-
items={agentItems}
195-
cursorIndex={agentsNav.cursorIndex}
196-
selectedIds={agentsNav.selectedIds}
197-
/>
198-
) : (
199-
<Text dimColor>
200-
No agents defined. Add agents first via `agentcore add agent`. Press Enter to continue.
201-
</Text>
202-
))}
203-
204172
{isIncludeTargetsStep &&
205173
(unassignedTargetItems.length > 0 ? (
206174
<WizardMultiSelect
@@ -226,7 +194,6 @@ export function AddGatewayScreen({
226194
{ label: 'Allowed Clients', value: wizard.config.jwtConfig.allowedClients.join(', ') },
227195
]
228196
: []),
229-
{ label: 'Agents', value: wizard.config.agents.length > 0 ? wizard.config.agents.join(', ') : '(none)' },
230197
{
231198
label: 'Targets',
232199
value:

src/cli/tui/screens/mcp/types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import type { GatewayAuthorizerType, NodeRuntime, PythonRuntime, ToolDefinition
44
// Gateway Flow Types
55
// ─────────────────────────────────────────────────────────────────────────────
66

7-
export type AddGatewayStep = 'name' | 'authorizer' | 'jwt-config' | 'agents' | 'include-targets' | 'confirm';
7+
export type AddGatewayStep = 'name' | 'authorizer' | 'jwt-config' | 'include-targets' | 'confirm';
88

99
export interface AddGatewayConfig {
1010
name: string;
1111
description: string;
12-
/** Agent names that will use this gateway */
13-
agents: string[];
1412
/** Authorization type for the gateway */
1513
authorizerType: GatewayAuthorizerType;
1614
/** JWT authorizer configuration (when authorizerType is 'CUSTOM_JWT') */
@@ -27,7 +25,6 @@ export const GATEWAY_STEP_LABELS: Record<AddGatewayStep, string> = {
2725
name: 'Name',
2826
authorizer: 'Authorizer',
2927
'jwt-config': 'JWT Config',
30-
agents: 'Agents',
3128
'include-targets': 'Include Targets',
3229
confirm: 'Confirm',
3330
};

src/cli/tui/screens/mcp/useAddGatewayWizard.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ import { useCallback, useMemo, useState } from 'react';
44

55
/** Maps authorizer type to the next step after authorizer selection */
66
const AUTHORIZER_NEXT_STEP: Record<GatewayAuthorizerType, AddGatewayStep> = {
7-
NONE: 'agents',
8-
AWS_IAM: 'agents',
7+
NONE: 'confirm',
8+
AWS_IAM: 'confirm',
99
CUSTOM_JWT: 'jwt-config',
1010
};
1111

1212
function getDefaultConfig(): AddGatewayConfig {
1313
return {
1414
name: '',
1515
description: '',
16-
agents: [],
1716
authorizerType: 'NONE',
1817
jwtConfig: undefined,
1918
selectedTargets: [],
@@ -32,8 +31,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) {
3231
baseSteps.push('jwt-config');
3332
}
3433

35-
baseSteps.push('agents');
36-
3734
if (unassignedTargetsCount > 0) {
3835
baseSteps.push('include-targets');
3936
}
@@ -76,17 +73,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) {
7673
...c,
7774
jwtConfig,
7875
}));
79-
setStep('agents');
80-
},
81-
[]
82-
);
83-
84-
const setAgents = useCallback(
85-
(agents: string[]) => {
86-
setConfig(c => ({
87-
...c,
88-
agents,
89-
}));
9076
setStep(unassignedTargetsCount > 0 ? 'include-targets' : 'confirm');
9177
},
9278
[unassignedTargetsCount]
@@ -114,7 +100,6 @@ export function useAddGatewayWizard(unassignedTargetsCount = 0) {
114100
setName,
115101
setAuthorizerType,
116102
setJwtConfig,
117-
setAgents,
118103
setSelectedTargets,
119104
reset,
120105
};

0 commit comments

Comments
 (0)