Major features implemented: - SQLite storage service with FTS5 for fast node search - Database rebuild mechanism for bulk node extraction - MCP tools: search_nodes, extract_all_nodes, get_node_statistics - Production Docker deployment with persistent storage - Management scripts for database operations - Comprehensive test suite for all functionality Database capabilities: - Stores node source code and metadata - Full-text search by node name or content - No versioning (stores latest only as per requirements) - Supports complete database rebuilds - ~4.5MB database with 500+ nodes indexed Production features: - Automated deployment script - Docker Compose production configuration - Database initialization on first run - Volume persistence for data - Management utilities for operations Documentation: - Updated README with complete instructions - Production deployment guide - Clear troubleshooting section - API reference for all new tools 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.5 KiB
JavaScript
Executable File
50 lines
1.5 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
// Simple test to verify node extraction works
|
|
const { NodeSourceExtractor } = require('./dist/utils/node-source-extractor');
|
|
|
|
async function testExtraction() {
|
|
const extractor = new NodeSourceExtractor();
|
|
|
|
console.log('🧪 Testing n8n Node Extraction\n');
|
|
|
|
// Test cases
|
|
const testNodes = [
|
|
'n8n-nodes-base.Function',
|
|
'n8n-nodes-base.Webhook',
|
|
'@n8n/n8n-nodes-langchain.Agent'
|
|
];
|
|
|
|
for (const nodeType of testNodes) {
|
|
console.log(`\n📦 Testing: ${nodeType}`);
|
|
console.log('-'.repeat(40));
|
|
|
|
try {
|
|
const result = await extractor.extractNodeSource(nodeType);
|
|
|
|
console.log('✅ Success!');
|
|
console.log(` Size: ${result.sourceCode.length} bytes`);
|
|
console.log(` Location: ${result.location}`);
|
|
console.log(` Has package info: ${result.packageInfo ? 'Yes' : 'No'}`);
|
|
|
|
if (result.packageInfo) {
|
|
console.log(` Package: ${result.packageInfo.name} v${result.packageInfo.version}`);
|
|
}
|
|
|
|
} catch (error) {
|
|
console.log('❌ Failed:', error.message);
|
|
}
|
|
}
|
|
|
|
console.log('\n\n📋 Listing available nodes...');
|
|
const allNodes = await extractor.listAvailableNodes();
|
|
console.log(`Found ${allNodes.length} total nodes`);
|
|
|
|
// Show first 5
|
|
console.log('\nFirst 5 nodes:');
|
|
allNodes.slice(0, 5).forEach(node => {
|
|
console.log(` - ${node.name} (${node.displayName || 'no display name'})`);
|
|
});
|
|
}
|
|
|
|
testExtraction().catch(console.error); |