#!/usr/bin/env node
import { chromium } from 'playwright';
import fs from 'fs';
import path from 'path';
const screenshotsDir = './screenshots';
if (!fs.existsSync(screenshotsDir)) {
fs.mkdirSync(screenshotsDir, { recursive: true });
}
async function verifyDeployments() {
console.log('š Verifying Smithery.ai deployments...');
const browser = await chromium.launch({
headless: false,
slowMo: 1000
});
const context = await browser.newContext();
const page = await context.newPage();
// Test different URL patterns for both repositories
const testUrls = [
// wuolah-mcp variations
'https://smithery.ai/server/@samihalawa/wuolah-mcp',
'https://smithery.ai/server/@samihalawa/wuolah-mcp-server',
'https://smithery.ai/server/samihalawa/wuolah-mcp',
// huggingface-mcp variations
'https://smithery.ai/server/@samihalawa/huggingface-mcp',
'https://smithery.ai/server/@samihalawa/huggingface-mcp-server',
'https://smithery.ai/server/samihalawa/huggingface-mcp',
// Search for both repositories
'https://smithery.ai/?q=samihalawa%2Fwuolah-mcp',
'https://smithery.ai/?q=samihalawa%2Fhuggingface-mcp'
];
const verificationResults = [];
for (const url of testUrls) {
console.log(`š Testing: ${url}`);
try {
const response = await page.goto(url, {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
const pageContent = await page.content();
const title = await page.title();
const isSuccess = response.status() === 200 &&
!pageContent.includes('404') &&
!pageContent.includes('Not Found');
const urlSafeName = url.replace(/[^a-zA-Z0-9]/g, '_');
await page.screenshot({ path: path.join(screenshotsDir, `verify_${urlSafeName}.png`) });
verificationResults.push({
url: url,
status: response.status(),
success: isSuccess,
title: title,
timestamp: new Date().toISOString()
});
console.log(`${isSuccess ? 'ā
' : 'ā'} ${url}: ${response.status()} - ${title}`);
} catch (error) {
console.log(`ā Error testing ${url}:`, error.message);
verificationResults.push({
url: url,
status: 'ERROR',
success: false,
error: error.message,
timestamp: new Date().toISOString()
});
}
}
// Also check the profile page for deployed servers
console.log('š Checking profile page...');
try {
await page.goto('https://smithery.ai/profile/@samihalawa', {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
await page.screenshot({ path: path.join(screenshotsDir, 'profile_page.png') });
const profileContent = await page.content();
verificationResults.push({
url: 'https://smithery.ai/profile/@samihalawa',
status: 200,
success: true,
title: 'Profile Page',
timestamp: new Date().toISOString()
});
} catch (error) {
console.log('ā Error checking profile page:', error.message);
}
await browser.close();
// Generate report
const report = {
timestamp: new Date().toISOString(),
verificationResults: verificationResults,
summary: {
totalUrlsTested: testUrls.length,
successfulResponses: verificationResults.filter(r => r.success).length,
failedResponses: verificationResults.filter(r => !r.success).length,
deployedServers: verificationResults.filter(r => r.success && r.status === 200).map(r => r.url)
}
};
fs.writeFileSync('./deployment_verification_report.json', JSON.stringify(report, null, 2));
console.log('\\nš VERIFICATION SUMMARY:');
console.log('========================');
console.log(`Total URLs tested: ${report.summary.totalUrlsTested}`);
console.log(`Successful responses: ${report.summary.successfulResponses}`);
console.log(`Failed responses: ${report.summary.failedResponses}`);
console.log('');
console.log('š SUCCESSFULLY DEPLOYED SERVERS:');
report.summary.deployedServers.forEach(url => {
console.log(`ā
${url}`);
});
console.log('\\nš Full report saved to: deployment_verification_report.json');
return report;
}
verifyDeployments().catch(console.error);