π GLMPilot Server
The server package is the core backend for the GLMPilot IDE. It handles real-time coordination, acts as a secure proxy to the GLM Mini AI, and manages containerized terminal sessions.
Key Responsibilities
- API Proxy: Securely routes requests to the GLM Mini API without exposing the
GLM_API_KEYto the client. - WebSocket Management: Uses
Socket.ioto provide real-time connection channels for the IDE. These channels include:- Terminal Events: Streams
stdoutandstderrto the client's xterm.js UI, while receivingstdin. - Code Sync: Relays editor state and file system changes between the client, the backend file system, and the AI context.
- Terminal Events: Streams
- Multi-Agent Reviewers: Houses the logic for specialized AI agents (Security, Performance, Style, Documentation) situated in
src/agents/. These agents can be triggered to analyze workspace code and summarize issues or generate auto-fixes.
Main Entry Point
src/index.ts: Straps Express, Socket.io, and the API routes together.
Development
Run npm run dev (or npm run dev:server from the root) to start the server with hot-reloading using ts-node-dev or nodemon.