import fs from 'node:fs'; import path from 'node:path'; const root = path.resolve(import.meta.dirname, '..'); const checks = [ // Core plugin files path.join(root, 'plugin', 'index.ts'), path.join(root, 'plugin', 'turn-manager.ts'), path.join(root, 'plugin', 'openclaw.plugin.json'), path.join(root, 'plugin', 'package.json'), // Sidecar path.join(root, 'services', 'main.mjs'), path.join(root, 'services', 'no-reply-api', 'server.mjs'), path.join(root, 'services', 'moderator', 'index.mjs'), ]; let ok = true; for (const p of checks) { if (!fs.existsSync(p)) { ok = false; console.error(`missing: ${p}`); } } const manifestPath = path.join(root, 'plugin', 'openclaw.plugin.json'); if (fs.existsSync(manifestPath)) { const m = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); for (const k of ['id', 'entry', 'configSchema']) { if (!(k in m)) { ok = false; console.error(`manifest missing key: ${k}`); } } } if (!ok) process.exit(1); console.log('plugin file check: ok');