Skip to main content
Glama
8b-is
by 8b-is
test.js1.99 kB
// Smart Tree JavaScript Test File // Testing various JS patterns and syntax const smartTree = { name: 'Smart Tree Test Suite', version: '4.8.8', features: ['quantum', 'ai', 'mcp', 'wave-memory'], // Quantum compression demo quantumCompress: (data) => { // Simulating MEM|8 wave patterns const waves = data.split('').map(c => c.charCodeAt(0)); return waves.reduce((acc, wave) => acc ^ wave, 0xDEADBEEF); }, // Tree formatter test formatTree: function(nodes) { return nodes.map((node, i) => { const prefix = i === nodes.length - 1 ? '└── ' : '├── '; return prefix + node.name; }).join('\n'); }, // Async test for MCP async fetchMCPTools() { return new Promise((resolve) => { setTimeout(() => { resolve(['read_file', 'write_file', 'tree_view', 'quantum_compress']); }, 100); }); } }; // ES6 class for testing class TreeNode { constructor(name, type = 'file') { this.name = name; this.type = type; this.children = []; this.metadata = new Map(); } addChild(node) { if (node instanceof TreeNode) { this.children.push(node); return true; } return false; } get size() { return this.children.reduce((sum, child) => sum + child.size, 1); } } // Testing arrow functions and modern syntax const testRunner = async () => { console.log('🚀 Smart Tree JS Test Suite'); const tools = await smartTree.fetchMCPTools(); console.log('MCP Tools:', tools); const root = new TreeNode('root', 'directory'); root.addChild(new TreeNode('test.js')); root.addChild(new TreeNode('quantum.mem8')); console.log('Tree size:', root.size); console.log('Quantum hash:', smartTree.quantumCompress('Aye loves Elvis! 🎸')); }; // Export for testing if (typeof module !== 'undefined') { module.exports = { smartTree, TreeNode, testRunner }; } // Run if main if (require.main === module) { testRunner().catch(console.error); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/8b-is/smart-tree'

If you have feedback or need assistance with the MCP directory API, please join our Discord server