diff --git a/plugin/package.json b/plugin/package.json new file mode 100644 index 0000000..9095670 --- /dev/null +++ b/plugin/package.json @@ -0,0 +1,10 @@ +{ + "name": "whispergate-plugin", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "WhisperGate OpenClaw plugin", + "scripts": { + "check": "node ../scripts/check-plugin-files.mjs" + } +} diff --git a/scripts/check-plugin-files.mjs b/scripts/check-plugin-files.mjs new file mode 100644 index 0000000..9f48f57 --- /dev/null +++ b/scripts/check-plugin-files.mjs @@ -0,0 +1,29 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +const root = path.resolve(process.cwd(), '..'); +const pluginDir = path.join(root, 'plugin'); +const required = ['index.ts', 'rules.ts', 'openclaw.plugin.json', 'README.md', 'package.json']; + +let ok = true; +for (const f of required) { + const p = path.join(pluginDir, f); + if (!fs.existsSync(p)) { + ok = false; + console.error(`missing: ${p}`); + } +} + +const manifestPath = path.join(pluginDir, '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');