ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
91 lines • 3.15 kB
JavaScript
/**
* Basic Handler Registry for V2 Architecture
*
* This provides a foundation for tool execution while we work on
* full compatibility with the original 287 tools.
*/
export class BasicHandlerRegistry {
handlers = [];
async registerHandler(handler) {
this.handlers.push(handler);
console.error(`✅ Registered handler: ${handler.name} with ${handler.tools.length} tools`);
}
async getAllAvailableTools() {
const allTools = [];
for (const handler of this.handlers) {
allTools.push(...handler.tools);
}
return allTools;
}
async executeHandler(toolName, params, context) {
for (const handler of this.handlers) {
if (handler.canHandle(toolName)) {
return await handler.execute(toolName, params, context);
}
}
throw new Error(`No handler found for tool: ${toolName}`);
}
getHandlerCount() {
return this.handlers.length;
}
getToolCount() {
return this.handlers.reduce((total, handler) => total + handler.tools.length, 0);
}
}
// Core debugging handler with the essential 3 tools for now
export class CoreDebugHandler {
name = 'CoreDebugHandler';
tools = [
{
name: 'inject_debugging',
description: 'Launch debugging session with browser automation',
inputSchema: {
type: 'object',
properties: {
url: { type: 'string', description: 'URL to debug' },
framework: { type: 'string', description: 'Framework hint (auto-detected)' }
},
required: ['url']
}
},
{
name: 'take_screenshot',
description: 'Capture visual state of webpage',
inputSchema: {
type: 'object',
properties: {
sessionId: { type: 'string', description: 'Debug session ID' },
fullPage: { type: 'boolean', description: 'Capture full page' }
},
required: ['sessionId']
}
},
{
name: 'run_audit',
description: 'Run comprehensive quality audit',
inputSchema: {
type: 'object',
properties: {
sessionId: { type: 'string', description: 'Debug session ID' },
categories: { type: 'array', description: 'Audit categories' }
},
required: ['sessionId']
}
}
];
canHandle(toolName) {
return this.tools.some(tool => tool.name === toolName);
}
async execute(toolName, params, context) {
// For now, return a basic success response
// This will be replaced with actual implementation
return {
success: true,
tool: toolName,
message: `${toolName} executed successfully (v2 architecture)`,
params: params,
sessionId: context.sessionId
};
}
}
//# sourceMappingURL=basic-handler-registry.js.map