From 06318eef4f07d8de9ce35b50c94804991d24d4bd Mon Sep 17 00:00:00 2001 From: Pedram Amini Date: Thu, 27 Nov 2025 02:33:44 -0600 Subject: [PATCH] MAESTRO: Add /web/* route namespace for web interface Created dedicated web interface route namespace in WebServer class: - /web - Root endpoint returning available interfaces info - /web/desktop - Desktop web interface entry point (placeholder) - /web/desktop/* - Wildcard for client-side routing - /web/mobile - Mobile web interface entry point (placeholder) - /web/mobile/* - Wildcard for client-side routing - /web/api - Web API namespace root with endpoint discovery This establishes the foundation for the new web interface that will provide both desktop (collaborative) and mobile (remote control) access to Maestro sessions. --- src/main/web-server.ts | 78 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/src/main/web-server.ts b/src/main/web-server.ts index 47af9c4c..838475f8 100644 --- a/src/main/web-server.ts +++ b/src/main/web-server.ts @@ -102,6 +102,84 @@ export class WebServer { status: 'idle', }; }); + + // Setup web interface routes under /web/* namespace + this.setupWebInterfaceRoutes(); + } + + /** + * Setup routes for the web interface under /web/* namespace + * + * This namespace is dedicated to the new web interface that provides: + * - Desktop Web: Full-featured collaborative interface for hackathons/team coding + * - Mobile Web: Lightweight remote control for sending commands from phone + * + * Future routes planned: + * - /web/desktop - Desktop web interface entry point + * - /web/mobile - Mobile web interface entry point + * - /web/api/* - REST API endpoints for web clients + * - /ws/web - WebSocket endpoint for real-time updates to web clients + */ + private setupWebInterfaceRoutes() { + // Web interface root - returns info about available interfaces + this.server.get('/web', async () => { + return { + name: 'Maestro Web Interface', + version: '1.0.0', + interfaces: { + desktop: '/web/desktop', + mobile: '/web/mobile', + }, + api: '/web/api', + websocket: '/ws/web', + timestamp: Date.now(), + }; + }); + + // Desktop web interface entry point (placeholder) + this.server.get('/web/desktop', async () => { + return { + message: 'Desktop web interface - Coming soon', + description: 'Full-featured collaborative interface for hackathons/team coding', + }; + }); + + // Desktop web interface with wildcard for client-side routing + this.server.get('/web/desktop/*', async () => { + return { + message: 'Desktop web interface - Coming soon', + description: 'Full-featured collaborative interface for hackathons/team coding', + }; + }); + + // Mobile web interface entry point (placeholder) + this.server.get('/web/mobile', async () => { + return { + message: 'Mobile web interface - Coming soon', + description: 'Lightweight remote control for sending commands from your phone', + }; + }); + + // Mobile web interface with wildcard for client-side routing + this.server.get('/web/mobile/*', async () => { + return { + message: 'Mobile web interface - Coming soon', + description: 'Lightweight remote control for sending commands from your phone', + }; + }); + + // Web API namespace root + this.server.get('/web/api', async () => { + return { + name: 'Maestro Web API', + version: '1.0.0', + endpoints: { + sessions: '/web/api/sessions', + theme: '/web/api/theme', + }, + timestamp: Date.now(), + }; + }); } async start() {