A lightweight client library to integrate browser games with the Vibe Eyes MCP debug server for real-time debugging, visualization, and analysis.
npm install vibe-eyes-client
Or include directly in your HTML:
<script src="https://unpkg.com/vibe-eyes-client/dist/vibe-eyes.min.js"></script>
// Initialize with default settings (auto-connects to http://localhost:8869)
// Available globally when using the script tag
// The client will automatically start capturing once connected
initializeVibeEyes();
// Or use the existing client instance directly
window.VibeEyesClient.initialize();
// Initialize with custom settings (when included via script tag)
initializeVibeEyes({
serverUrl: 'http://your-debug-server:8869',
captureDelay: 2000, // Screenshot every 2 seconds
maxLogs: 50, // Store more logs
canvasId: 'my-canvas' // Specific canvas to capture
});
// Or when using as a module
import { initializeVibeEyes } from 'vibe-eyes-client';
initializeVibeEyes({
serverUrl: 'http://your-debug-server:8869',
captureDelay: 2000,
canvasId: 'game-canvas'
});
// Get the client instance
const client = window.VibeEyesClient;
// Explicitly stop/restart capturing if needed
client.stopCaptureLoop();
client.startCaptureLoop();
Vibe Eyes MCP server sends back SVG visualizations that you can display in a dedicated debug window:
// Get the client from initialization
const client = initializeVibeEyes();
// Enable SVG display - opens a new debug window with SVG and stats
client.enableSvgDisplay();
// You can optionally provide a custom container
client.enableSvgDisplay({
container: '#my-custom-container' // Optional existing container element
});
// Configure the debug window position and size (all options are optional)
const client = initializeVibeEyes({
serverUrl: 'http://localhost:8869',
debugWindow: {
// All debugWindow properties are optional with sensible defaults
width: 500, // Optional: Width in pixels (default: 75% of game window width)
height: 600, // Optional: Height in pixels (default: 75% of game window height)
position: 'right' // Optional: Position relative to game window (default: 'right')
// Possible positions: 'right', 'left', 'top', 'bottom', 'detached'
}
});
// Toggle the display on/off
client.toggleSvgDisplay();
// Disable the display (closes the debug window)
client.disableSvgDisplay();
The debug window shows:
All configuration options are optional and have sensible defaults.
Option | Default | Description |
---|---|---|
serverUrl | 'http://localhost:8869' | URL of the Vibe Eyes MCP server |
captureDelay | 1000 | Milliseconds between captures |
maxLogs | 10 | Maximum stored console logs |
maxErrors | 10 | Maximum stored error logs |
autoConnect | true | Connect on initialization |
canvasId | null | ID of specific canvas to capture (null = auto-detect) |
debugWindow | Object | Configuration for the debug window (see below) |
Option | Default | Description |
---|---|---|
container | null | Element or selector for SVG container (creates popup window if null) |
Option | Default | Description |
---|---|---|
width | null | Width of the debug window in pixels (null = 75% of game window width) |
height | null | Height of the debug window in pixels (null = 75% of game window height) |
position | 'right' | Position relative to the game window: 'right', 'left', 'top', 'bottom', or 'detached' |
The following build formats are available in the dist/
directory:
vibe-eyes.min.js
- Minified UMD build for most use casesvibe-eyes.js
- Unminified UMD build for debuggingvibe-eyes.iife.js
- IIFE build with globals for direct browser usevibe-eyes.esm.js
- ES Module for modern bundlers and environmentsISC
Client library for integrating browser games with Vibe Eyes MCP debug server
No releases published
No packages published