// 测试系统信息插件
const os = require('os');

// 模拟插件安装
const plugin = require('./index.js');
const mockPlugin = plugin({});
const registeredTools = [];

const mockFramework = {
  registerTool: (tool) => {
    registeredTools.push(tool.name);
    console.log('✓ Registered tool:', tool.name);
  },
  callTool: async (name, args) => {
    if (name === 'get_disk_info') {
      // 模拟磁盘信息获取
      return { success: true, data: [] };
    }
  }
};

console.log('\n=== Testing System Info Plugin ===\n');
mockPlugin.install(mockFramework);

console.log('\n✓ Plugin name:', mockPlugin.name);
console.log('✓ Plugin version:', mockPlugin.version);
console.log('✓ Plugin description:', mockPlugin.description);

console.log('\n✓ Total tools registered:', registeredTools.length);
console.log('✓ Tools:', registeredTools.join(', '));

console.log('\n=== System Information Preview ===\n');
console.log('Hostname:', os.hostname());
console.log('Platform:', os.platform());
console.log('OS Type:', os.type());
console.log('CPU Count:', os.cpus().length);
console.log('Total Memory:', (os.totalmem() / 1024 / 1024 / 1024).toFixed(2), 'GB');
console.log('Node Version:', process.version);

console.log('\n✓ All tests passed!');
