Commit f14bb4b
committed
Implement /api/v1 REST API + SSE Event Stream (P4)
- Add chi router with comprehensive REST API endpoints
- Implement /api/v1/servers for server management
- Add /api/v1/servers/{id}/{action} for server control (enable/disable/restart/login)
- Create /api/v1/servers/{id}/tools for listing server tools
- Implement /api/v1/servers/{id}/logs for server log access (placeholder)
- Add /api/v1/index/search for tool search with BM25 scoring
- Create /events SSE endpoint for real-time status updates
- Maintain backward compatibility with existing /api endpoints
Features:
- CORS support for browser access
- Consistent JSON response format with success/error handling
- Real-time status streaming via Server-Sent Events
- Tool search with input schema parsing
- Server state management (enable/disable/quarantine)
- Comprehensive server statistics and connection status
This provides a modern REST API foundation for web UI and improved tray integration.1 parent 07cda89 commit f14bb4b
5 files changed
Lines changed: 714 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
0 commit comments