const fs = require('fs');
const path = require('path');
console.log('π§ͺ Testing Build Artifact (.smithery/index.cjs)...');
try {
const buildPath = path.join(__dirname, '.smithery/index.cjs');
if (!fs.existsSync(buildPath)) {
console.error('β Build artifact not found:', buildPath);
process.exit(1);
}
console.log('π¦ Loading module...');
const module = require(buildPath);
if (!module.default) {
console.error('β Default export not found in build artifact');
console.log('Exports:', Object.keys(module));
process.exit(1);
}
const createServer = module.default;
console.log('β
Module loaded successfully');
console.log('π§ Creating server instance...');
// Mock config
const server = createServer({ config: { volume: 50, voiceGender: 'male' } });
if (!server) {
console.error('β Server instance is null/undefined');
process.exit(1);
}
console.log('β
Server instance created');
console.log('Server info:', server.name, server.version);
// Verify capabilities if possible (private property usually)
// But just getting here means imports worked!
console.log('π Build verification PASSED!');
process.exit(0);
} catch (error) {
console.error('β Verification FAILED:', error);
process.exit(1);
}