// Final test of Hanzo extension const path = require('path'); const Module = require('module'); // Hook require to provide vscode mock const originalRequire = Module.prototype.require; Module.prototype.require = function(id) { if (id === 'vscode') { return require('./scripts/vscode-mock'); } return originalRequire.apply(this, arguments); }; // Load tools const { MCPTools } = require('./out/mcp/tools'); async function test() { console.log('๐Ÿš€ Testing Hanzo Extension - Final Build\n'); const context = { globalState: { _store: new Map(), get(key, defaultValue) { return this._store.get(key) ?? defaultValue; }, update(key, value) { this._store.set(key, value); return Promise.resolve(); } }, workspaceState: { get: () => undefined, update: () => Promise.resolve() }, extensionPath: __dirname, subscriptions: [], asAbsolutePath: (p) => path.join(__dirname, p) }; try { const tools = new MCPTools(context); await tools.initialize(); const allTools = tools.getAllTools(); console.log(`โœ… Successfully loaded ${allTools.length} tools!\n`); // Group tools by category const categories = { 'File Operations': ['read', 'write', 'edit', 'multi_edit', 'directory_tree', 'find_files'], 'Search': ['unified_search', 'grep', 'search', 'symbols'], 'Shell': ['run_command', 'open', 'process'], 'Development': ['todo', 'todo_read', 'todo_write', 'think', 'critic'], 'Configuration': ['palette', 'config', 'rules'], 'Web': ['web_fetch'], 'System': ['batch'] }; console.log('๐Ÿ“ฆ Available Tools by Category:\n'); for (const [category, toolNames] of Object.entries(categories)) { console.log(`${category}:`); const available = toolNames.filter(name => allTools.some(t => t.name === name)); const missing = toolNames.filter(name => !allTools.some(t => t.name === name)); if (available.length > 0) { console.log(` โœ… Available: ${available.join(', ')}`); } if (missing.length > 0) { console.log(` โŒ Missing: ${missing.join(', ')}`); } console.log(); } // Test key tools console.log('๐Ÿงช Testing Key Tools:\n'); // Test unified search const unifiedSearch = tools.getTool('unified_search'); if (unifiedSearch) { console.log('โœ… Unified Search tool ready'); } // Test web fetch const webFetch = tools.getTool('web_fetch'); if (webFetch) { console.log('โœ… Web Fetch tool ready'); } // Test process management const processTool = tools.getTool('process'); if (processTool) { console.log('โœ… Process Management tool ready'); } // Test palette system const paletteTool = tools.getTool('palette'); if (paletteTool) { console.log('โœ… Palette System ready'); } console.log('\n๐Ÿ“Š Summary:'); console.log(`- Total tools: ${allTools.length}`); console.log(`- Core features: File operations, Search, Shell, Development tools`); console.log(`- Advanced features: Unified search, Web fetch, Process management`); console.log(`- Configuration: Palette system, Project rules, Git-style config`); console.log('\nโœ… Extension is ready for deployment!'); console.log('\n๐Ÿ“š Next steps:'); console.log('1. Run: npm run package'); console.log('2. Install .vsix in VS Code/Cursor/Windsurf'); console.log('3. For Claude Desktop: npm run build:mcp'); console.log('4. Configure Claude Desktop with MCP server path'); } catch (error) { console.error('โŒ Test failed:', error); process.exit(1); } } test();