@@ -4,14 +4,8 @@ import type { SelectableItem } from '../../components';
44import { HELP_TEXT } from '../../constants' ;
55import { useListNavigation } from '../../hooks' ;
66import { generateUniqueName } from '../../utils' ;
7- import type { AddGatewayTargetConfig , ComputeHost , TargetLanguage } from './types' ;
8- import {
9- COMPUTE_HOST_OPTIONS ,
10- MCP_TOOL_STEP_LABELS ,
11- SKIP_FOR_NOW ,
12- SOURCE_OPTIONS ,
13- TARGET_LANGUAGE_OPTIONS ,
14- } from './types' ;
7+ import type { AddGatewayTargetConfig } from './types' ;
8+ import { MCP_TOOL_STEP_LABELS , SKIP_FOR_NOW } from './types' ;
159import { useAddGatewayTargetWizard } from './useAddGatewayTargetWizard' ;
1610import { Box , Text } from 'ink' ;
1711import React , { useMemo } from 'react' ;
@@ -31,16 +25,6 @@ export function AddGatewayTargetScreen({
3125} : AddGatewayTargetScreenProps ) {
3226 const wizard = useAddGatewayTargetWizard ( existingGateways ) ;
3327
34- const sourceItems : SelectableItem [ ] = useMemo (
35- ( ) => SOURCE_OPTIONS . map ( o => ( { id : o . id , title : o . title , description : o . description } ) ) ,
36- [ ]
37- ) ;
38-
39- const languageItems : SelectableItem [ ] = useMemo (
40- ( ) => TARGET_LANGUAGE_OPTIONS . map ( o => ( { id : o . id , title : o . title , description : o . description } ) ) ,
41- [ ]
42- ) ;
43-
4428 const gatewayItems : SelectableItem [ ] = useMemo (
4529 ( ) => [
4630 ...existingGateways . map ( g => ( { id : g , title : g } ) ) ,
@@ -49,47 +33,18 @@ export function AddGatewayTargetScreen({
4933 [ existingGateways ]
5034 ) ;
5135
52- const hostItems : SelectableItem [ ] = useMemo (
53- ( ) => COMPUTE_HOST_OPTIONS . map ( o => ( { id : o . id , title : o . title , description : o . description } ) ) ,
54- [ ]
55- ) ;
56-
57- const isSourceStep = wizard . step === 'source' ;
58- const isLanguageStep = wizard . step === 'language' ;
5936 const isGatewayStep = wizard . step === 'gateway' ;
60- const isHostStep = wizard . step === 'host' ;
6137 const isTextStep = wizard . step === 'name' || wizard . step === 'endpoint' ;
6238 const isConfirmStep = wizard . step === 'confirm' ;
6339 const noGatewaysAvailable = isGatewayStep && existingGateways . length === 0 ;
6440
65- const sourceNav = useListNavigation ( {
66- items : sourceItems ,
67- onSelect : item => wizard . setSource ( item . id as 'existing-endpoint' | 'create-new' ) ,
68- onExit : ( ) => wizard . goBack ( ) ,
69- isActive : isSourceStep ,
70- } ) ;
71-
72- const languageNav = useListNavigation ( {
73- items : languageItems ,
74- onSelect : item => wizard . setLanguage ( item . id as TargetLanguage ) ,
75- onExit : ( ) => onExit ( ) ,
76- isActive : isLanguageStep ,
77- } ) ;
78-
7941 const gatewayNav = useListNavigation ( {
8042 items : gatewayItems ,
8143 onSelect : item => wizard . setGateway ( item . id ) ,
8244 onExit : ( ) => wizard . goBack ( ) ,
8345 isActive : isGatewayStep && ! noGatewaysAvailable ,
8446 } ) ;
8547
86- const hostNav = useListNavigation ( {
87- items : hostItems ,
88- onSelect : item => wizard . setHost ( item . id as ComputeHost ) ,
89- onExit : ( ) => wizard . goBack ( ) ,
90- isActive : isHostStep ,
91- } ) ;
92-
9348 useListNavigation ( {
9449 items : [ { id : 'confirm' , title : 'Confirm' } ] ,
9550 onSelect : ( ) => onComplete ( wizard . config ) ,
@@ -108,19 +63,6 @@ export function AddGatewayTargetScreen({
10863 return (
10964 < Screen title = "Add MCP Tool" onExit = { onExit } helpText = { helpText } headerContent = { headerContent } >
11065 < Panel >
111- { isSourceStep && (
112- < WizardSelect
113- title = "Select source"
114- description = "How would you like to create this MCP tool?"
115- items = { sourceItems }
116- selectedIndex = { sourceNav . selectedIndex }
117- />
118- ) }
119-
120- { isLanguageStep && (
121- < WizardSelect title = "Select language" items = { languageItems } selectedIndex = { languageNav . selectedIndex } />
122- ) }
123-
12466 { isGatewayStep && ! noGatewaysAvailable && (
12567 < WizardSelect
12668 title = "Select gateway"
@@ -132,15 +74,6 @@ export function AddGatewayTargetScreen({
13274
13375 { noGatewaysAvailable && < NoGatewaysMessage /> }
13476
135- { isHostStep && (
136- < WizardSelect
137- title = "Select compute host"
138- description = "Where will this tool run?"
139- items = { hostItems }
140- selectedIndex = { hostNav . selectedIndex }
141- />
142- ) }
143-
14477 { isTextStep && (
14578 < TextInput
14679 key = { wizard . step }
0 commit comments