feat: add target type picker to gateway target wizard#496
Merged
aidandaly24 merged 7 commits intoaws:feat/add-new-gateway-targetsfrom Mar 5, 2026
Merged
Conversation
- Add targetType field to AddGatewayTargetConfig and 'target-type' wizard step - Convert wizard from static to dynamic steps (useMemo with config.targetType dep) - Fix goBack() to use memoized steps instead of stale getSteps() call - Add TARGET_TYPE_OPTIONS with mcpServer as initial option - Add WizardSelect UI for target type selection in AddGatewayTargetScreen - Route flow on config.targetType instead of config.source - Remove source field, SOURCE_OPTIONS, and 'source' step (dead code)
- Make --type required with kebab-case input (mcp-server -> mcpServer) - Remove --source option entirely (was dead code, only existing-endpoint worked) - Wire options.type through buildGatewayTargetConfig to config.targetType - Route handleAddGatewayTarget on config.targetType instead of config.source - Use config.targetType in createExternalGatewayTarget instead of hardcoding
- Replace source: 'existing-endpoint' with type: 'mcp-server' in all fixtures - Add type: 'mcpServer' to ValidatedAddGatewayTargetOptions test objects - Add tests for --type required validation and invalid type rejection - Replace SOURCE_OPTIONS test with TARGET_TYPE_OPTIONS test - Fix shared fixture mutation bug (spread before passing to validation) - Add --type mcp-server to CLI integration test args
- Replace --source existing-endpoint with --type mcp-server in all examples - Update flags table: --source -> --type (required) - Update commands.md, gateway.md, and local-development.md
These files were incorrectly carried from our pre-rebase branch during conflict resolution (--theirs/--ours reversed in rebase context). The modular primitive PR moved their contents to GatewayTargetPrimitive.ts.
Contributor
Author
|
For some reason CodeQL won't run |
f85b666
into
aws:feat/add-new-gateway-targets
15 checks passed
aidandaly24
added a commit
that referenced
this pull request
Mar 6, 2026
* feat: add target type picker to gateway target wizard - Add targetType field to AddGatewayTargetConfig and 'target-type' wizard step - Convert wizard from static to dynamic steps (useMemo with config.targetType dep) - Fix goBack() to use memoized steps instead of stale getSteps() call - Add TARGET_TYPE_OPTIONS with mcpServer as initial option - Add WizardSelect UI for target type selection in AddGatewayTargetScreen - Route flow on config.targetType instead of config.source - Remove source field, SOURCE_OPTIONS, and 'source' step (dead code) * feat: make --type required and remove --source for gateway-target CLI - Make --type required with kebab-case input (mcp-server -> mcpServer) - Remove --source option entirely (was dead code, only existing-endpoint worked) - Wire options.type through buildGatewayTargetConfig to config.targetType - Route handleAddGatewayTarget on config.targetType instead of config.source - Use config.targetType in createExternalGatewayTarget instead of hardcoding * test: update gateway-target tests for target type picker - Replace source: 'existing-endpoint' with type: 'mcp-server' in all fixtures - Add type: 'mcpServer' to ValidatedAddGatewayTargetOptions test objects - Add tests for --type required validation and invalid type rejection - Replace SOURCE_OPTIONS test with TARGET_TYPE_OPTIONS test - Fix shared fixture mutation bug (spread before passing to validation) - Add --type mcp-server to CLI integration test args * docs: update gateway-target examples to use --type mcp-server - Replace --source existing-endpoint with --type mcp-server in all examples - Update flags table: --source -> --type (required) - Update commands.md, gateway.md, and local-development.md * fix: reset command.tsx and create-mcp.test.ts to main versions These files were incorrectly carried from our pre-rebase branch during conflict resolution (--theirs/--ours reversed in rebase context). The modular primitive PR moved their contents to GatewayTargetPrimitive.ts. * ci: retrigger checks * test: add missing --type flag to remove gateway-target tests
aidandaly24
added a commit
that referenced
this pull request
Mar 6, 2026
* feat: add target type picker to gateway target wizard - Add targetType field to AddGatewayTargetConfig and 'target-type' wizard step - Convert wizard from static to dynamic steps (useMemo with config.targetType dep) - Fix goBack() to use memoized steps instead of stale getSteps() call - Add TARGET_TYPE_OPTIONS with mcpServer as initial option - Add WizardSelect UI for target type selection in AddGatewayTargetScreen - Route flow on config.targetType instead of config.source - Remove source field, SOURCE_OPTIONS, and 'source' step (dead code) * feat: make --type required and remove --source for gateway-target CLI - Make --type required with kebab-case input (mcp-server -> mcpServer) - Remove --source option entirely (was dead code, only existing-endpoint worked) - Wire options.type through buildGatewayTargetConfig to config.targetType - Route handleAddGatewayTarget on config.targetType instead of config.source - Use config.targetType in createExternalGatewayTarget instead of hardcoding * test: update gateway-target tests for target type picker - Replace source: 'existing-endpoint' with type: 'mcp-server' in all fixtures - Add type: 'mcpServer' to ValidatedAddGatewayTargetOptions test objects - Add tests for --type required validation and invalid type rejection - Replace SOURCE_OPTIONS test with TARGET_TYPE_OPTIONS test - Fix shared fixture mutation bug (spread before passing to validation) - Add --type mcp-server to CLI integration test args * docs: update gateway-target examples to use --type mcp-server - Replace --source existing-endpoint with --type mcp-server in all examples - Update flags table: --source -> --type (required) - Update commands.md, gateway.md, and local-development.md * fix: reset command.tsx and create-mcp.test.ts to main versions These files were incorrectly carried from our pre-rebase branch during conflict resolution (--theirs/--ours reversed in rebase context). The modular primitive PR moved their contents to GatewayTargetPrimitive.ts. * ci: retrigger checks * test: add missing --type flag to remove gateway-target tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a target type selection step to the
agentcore add gateway-targetTUI wizard and make--typea required flag in the CLI path. This is a prerequisite for adding new gateway target types (API Gateway, OpenAPI, etc.) — the picker infrastructure needs to exist before new options can be added to it.What changed:
useMemowithconfig.targetTypedependency) so future target types can have different step sequences. Also fixes a pre-existing bug wheregoBack()calledgetSteps()directly instead of using the memoized steps array.--type mcp-serveris now required (kebab-case, mapped tomcpServerinternally).--sourceflag removed entirely (was dead code — onlyexisting-endpointwas supported and hardcoded everywhere).config.source === 'existing-endpoint'toconfig.targetType === 'mcpServer'across both TUI (AddGatewayTargetFlow.tsx) and CLI (GatewayTargetPrimitive.ts).SOURCE_OPTIONSconstant,sourcefield onAddGatewayTargetConfig, and'source'wizard step type all removed.Currently ships with one target type option: MCP Server endpoint. Adding a new type (e.g., API Gateway) requires adding an entry to
TARGET_TYPE_OPTIONS, acasein the wizard's dynamic stepsswitch, and a creation function — the plumbing is in place.Related Issue
Closes #
Documentation PR
N/A — docs updated in this PR (commands.md, gateway.md, local-development.md)
Type of Change
Breaking change:
--type mcp-serveris now required foragentcore add gateway-targetCLI invocations.--sourceis removed. Users/scripts must update from:to:
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsTest changes:
type: 'mcp-server'/targetType: 'mcpServer'--typerequired validation, invalid type rejectionSOURCE_OPTIONStest withTARGET_TYPE_OPTIONStestChecklist