Skip to content

Commit bb8f780

Browse files
authored
Merge pull request #194 from deploystackio/main
prod release
2 parents 88ef71b + f55c4fb commit bb8f780

File tree

2 files changed

+19
-58
lines changed

2 files changed

+19
-58
lines changed

docs/development/gateway/index.mdx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,6 @@ The Gateway is language-agnostic and supports MCP servers written in:
198198
- No external network exposure by default
199199
- Secure communication with cloud control plane
200200

201-
## Testing
202-
203-
```bash
204-
# Run unit tests
205-
npm test
206-
207-
# Run integration tests
208-
npm run test:integration
209-
210-
# Run with coverage
211-
npm run test:coverage
212-
```
213-
214201
## Contributing
215202

216203
The Gateway is actively under development. Key areas for contribution:

docs/development/gateway/structure.mdx

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,62 +16,30 @@ services/gateway/
1616
├── src/ # Source code
1717
│ ├── index.ts # CLI entry point and command registration
1818
│ ├── commands/ # Command implementations
19-
│ │ ├── index.ts # Command exports
2019
│ │ ├── login.ts # Authentication with cloud.deploystack.io
21-
│ │ ├── logout.ts # Clear local credentials
2220
│ │ ├── start.ts # Start the gateway server
23-
│ │ ├── stop.ts # Stop the gateway server
24-
│ │ ├── status.ts # Show gateway status
25-
│ │ ├── mcp.ts # MCP server management and tool discovery
26-
│ │ └── config.ts # Manage local configuration
21+
│ │ ├── refresh.ts # Root-level refresh command
22+
│ │ └── ... # Other CLI commands
2723
│ ├── core/ # Core business logic
2824
│ │ ├── auth/ # Authentication handling
29-
│ │ │ ├── client.ts # OAuth and API client
30-
│ │ │ └── storage.ts # Secure credential storage
31-
│ │ ├── server/ # HTTP proxy server
32-
│ │ │ ├── proxy.ts # Request routing and dual-endpoint logic
33-
│ │ │ ├── session-manager.ts # SSE session lifecycle management
34-
│ │ │ └── sse-handler.ts # Server-Sent Events implementation
25+
│ │ ├── server/ # HTTP proxy server with SSE support
3526
│ │ ├── process/ # MCP process management
36-
│ │ │ ├── manager.ts # Process lifecycle and stdio communication
37-
│ │ │ └── runtime-state.ts # In-memory process state tracking
3827
│ │ ├── mcp/ # MCP configuration management
39-
│ │ │ ├── config-service.ts # Team config sync and processing
40-
│ │ │ ├── config-processor.ts # Installation method processing
41-
│ │ │ ├── tool-discovery.ts # MCP server tool discovery
42-
│ │ │ ├── tool-cache.ts # Team-aware tool caching system
43-
│ │ │ └── team-context-manager.ts # Team switching with process lifecycle
4428
│ │ └── config/ # Configuration utilities
45-
│ │ └── defaults.ts # Default gateway settings
29+
│ ├── services/ # Shared business services
30+
│ │ ├── refresh-service.ts # Shared MCP configuration refresh logic
31+
│ │ ├── server-start-service.ts # Centralized server startup logic
32+
│ │ └── ... # Other shared services
4633
│ ├── utils/ # Shared utilities
47-
│ │ ├── tool-discovery-manager.ts # Centralized tool discovery and caching
48-
│ │ ├── state-comparator.ts # Compare expected vs actual running processes
49-
│ │ ├── logger.ts # Centralized logging with chalk
50-
│ │ ├── spinner.ts # Progress indicators with ora
51-
│ │ ├── config.ts # Configuration management
52-
│ │ ├── errors.ts # Custom error types
53-
│ │ └── crypto.ts # Encryption utilities
34+
│ │ ├── logger.ts # Centralized logging
35+
│ │ └── ... # Other utilities
5436
│ └── types/ # TypeScript type definitions
55-
│ ├── index.ts # Main type exports
56-
│ ├── mcp.ts # MCP protocol types
57-
│ └── config.ts # Configuration types
58-
├── bin/ # Executable entry
59-
│ └── gateway.js # Node.js shebang wrapper
37+
├── bin/gateway.js # Executable entry point
6038
├── dist/ # Compiled JavaScript (gitignored)
6139
├── tests/ # Test suite
62-
│ ├── unit/ # Unit tests
63-
│ ├── integration/ # Integration tests
64-
│ └── fixtures/ # Test data
65-
├── scripts/ # Development scripts
66-
│ ├── build.ts # Build script
67-
│ └── release.ts # Release automation
68-
├── .config/ # Default configurations
69-
│ └── defaults.json # Default gateway settings
70-
├── package.json # Dependencies and scripts
71-
├── tsconfig.json # TypeScript configuration
72-
├── tsup.config.ts # Build configuration
73-
├── .env.example # Environment variables template
74-
└── README.md # Gateway-specific documentation
40+
├── package.json # Dependencies and scripts
41+
├── tsconfig.json # TypeScript configuration
42+
└── README.md # Gateway-specific documentation
7543
```
7644

7745
## Key Design Decisions
@@ -80,6 +48,7 @@ services/gateway/
8048
The codebase is organized into distinct modules:
8149
- **Commands**: User-facing CLI commands
8250
- **Core**: Business logic separated by domain
51+
- **Services**: Shared business services for cross-command functionality
8352
- **Utils**: Reusable utilities and helpers
8453

8554
### Process Management
@@ -143,6 +112,11 @@ export function registerLoginCommand(program: Command) {
143112
- Team-aware tool caching system as detailed in [Caching System](/development/gateway/caching-system)
144113
- Installation method processing for correct server spawning
145114

115+
**services/**: Shared business services for cross-command functionality
116+
- **refresh-service.ts**: Centralized MCP configuration refresh logic used by both `deploystack refresh` and `deploystack mcp --refresh` commands
117+
- Eliminates code duplication while maintaining identical behavior across commands
118+
- Provides consistent error handling and user feedback
119+
146120
**utils/**: Shared utilities and centralized services
147121
- **tool-discovery-manager.ts**: Centralized tool discovery eliminating code duplication across commands
148122
- Logging, configuration, and encryption utilities

0 commit comments

Comments
 (0)