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

Three tree views in the Mayros activity bar:

ViewContents
SessionsActive sessions with status
AgentsAvailable agents with roles
SkillsInstalled skills with status

Webview panels

Four interactive panels accessible via commands:

PanelCommandDescription
ChatMayros: Open ChatSend messages, view streaming responses
PlanMayros: Open PlanPlan mode with Cortex assertions
TraceMayros: Open TraceTrace event viewer with filtering
Knowledge GraphMayros: Open KGBrowse and query the knowledge graph

All panels use nonce-based Content Security Policy for script loading.

Editor integration

CommandTriggerDescription
Explain CodeRight-click context menuSend selection to Mayros for explanation
Send SelectionRight-click context menuSend selected text to active chat
Analyze MarkerGutter clickAnalyze 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.json for authentication
  • Nonce challenge: supports v2 challenge-response authentication

Gateway protocol

The client uses JSON messages with three types:

TypeDirectionPurpose
reqClient → ServerRPC requests with correlation ID
resServer → ClientRPC responses
eventServer → ClientPush notifications

Available RPC methods

MethodDescription
sessions.listList active sessions
chat.sendSend a chat message
chat.historyGet conversation history
chat.abortAbort in-flight chat
agents.listList available agents
skills.statusGet skill status
healthHealth check
plan.getGet plan state
trace.eventsGet trace events
kg.queryQuery 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": ""
}
  • Gateway — gateway architecture
  • TUI — terminal user interface