VSCode Extension
The Mayros VSCode extension connects to a running Mayros gateway via WebSocket, providing sidebar views, interactive panels, and editor integration.
Installation
bash# From the tools directory cd tools/vscode-extension pnpm install && pnpm build # Install the .vsix file in VSCode
Features
Sidebar views
Three tree views in the Mayros activity bar:
| View | Contents |
|---|---|
| Sessions | Active sessions with status |
| Agents | Available agents with roles |
| Skills | Installed skills with status |
Webview panels
Four interactive panels accessible via commands:
| Panel | Command | Description |
|---|---|---|
| Chat | Mayros: Open Chat | Send messages, view streaming responses |
| Plan | Mayros: Open Plan | Plan mode with Cortex assertions |
| Trace | Mayros: Open Trace | Trace event viewer with filtering |
| Knowledge Graph | Mayros: Open KG | Browse and query the knowledge graph |
All panels use nonce-based Content Security Policy for script loading.
Editor integration
| Command | Trigger | Description |
|---|---|---|
Explain Code | Right-click context menu | Send selection to Mayros for explanation |
Send Selection | Right-click context menu | Send selected text to active chat |
Analyze Marker | Gutter click | Analyze a diagnostic marker |
Connection
The extension connects to the Mayros gateway via WebSocket:
ws://127.0.0.1:18789 (default)
- Auto-connect: connects on startup when enabled (default: true)
- Reconnection: exponential backoff on disconnect (configurable attempts and delay)
- Device identity: Ed25519 keypair from
~/.mayros/identity/device.jsonfor authentication - Nonce challenge: supports v2 challenge-response authentication
Gateway protocol
The client uses JSON messages with three types:
| Type | Direction | Purpose |
|---|---|---|
req | Client → Server | RPC requests with correlation ID |
res | Server → Client | RPC responses |
event | Server → Client | Push notifications |
Available RPC methods
| Method | Description |
|---|---|
sessions.list | List active sessions |
chat.send | Send a chat message |
chat.history | Get conversation history |
chat.abort | Abort in-flight chat |
agents.list | List available agents |
skills.status | Get skill status |
health | Health check |
plan.get | Get plan state |
trace.events | Get trace events |
kg.query | Query knowledge graph |
Configuration
VSCode settings (settings.json):
json{ "mayros.gatewayUrl": "ws://127.0.0.1:18789", "mayros.autoConnect": true, "mayros.reconnectDelayMs": 3000, "mayros.maxReconnectAttempts": 5, "mayros.gatewayToken": "" }