From e97ce0208e16b957f36fd20a8daef9045386652d Mon Sep 17 00:00:00 2001 From: zhi Date: Thu, 5 Mar 2026 14:49:03 +0000 Subject: [PATCH] fix: add configSchema and root index.js to plugin manifest - OpenClaw requires configSchema in plugin manifest - Add root index.js as entry point (like Dirigent) - Update install script to generate correct manifest --- install.mjs | 34 ++++++++++++++++++++++++++++++++-- openclaw.plugin.json | 8 +++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/install.mjs b/install.mjs index cecf888..42b63c3 100755 --- a/install.mjs +++ b/install.mjs @@ -299,13 +299,43 @@ async function installComponents(env) { copyDir(join(__dirname, 'safe-restart'), join(DIST_DIR, 'safe-restart')); logSuccess('Copied safe-restart to dist/padded-cell/'); + // Create root index.js entry point + const indexJs = `const { pcexec } = require('./pcexec/dist/index.js'); +const { + safeRestart, + createSafeRestartTool, + StatusManager, + createApiServer, + startApiServer, + SlashCommandHandler +} = require('./safe-restart/dist/index.js'); + +module.exports = { + pcexec, + safeRestart, + createSafeRestartTool, + StatusManager, + createApiServer, + startApiServer, + SlashCommandHandler, +}; +`; + writeFileSync(join(DIST_DIR, 'index.js'), indexJs); + logSuccess('Created index.js entry point'); + // Create openclaw.plugin.json const manifest = { id: PLUGIN_NAME, name: 'PaddedCell', version: '0.1.0', description: 'Secure password management, safe execution, and coordinated restart', - entry: './safe-restart/dist/index.js', + entry: './index.js', + configSchema: { + type: 'object', + properties: { + enabled: { type: 'boolean', default: true } + } + }, tools: [ { name: 'pcexec', @@ -320,7 +350,7 @@ async function installComponents(env) { ] }; writeFileSync(join(DIST_DIR, 'openclaw.plugin.json'), JSON.stringify(manifest, null, 2)); - logSuccess('Created openclaw.plugin.json in dist/padded-cell/'); + logSuccess('Created openclaw.plugin.json'); // Create bin directory and install pass_mgr binary mkdirSync(binDir, { recursive: true }); diff --git a/openclaw.plugin.json b/openclaw.plugin.json index 162f222..908bc6f 100644 --- a/openclaw.plugin.json +++ b/openclaw.plugin.json @@ -3,7 +3,13 @@ "name": "PaddedCell", "version": "0.1.0", "description": "Secure password management, safe execution, and coordinated restart", - "entry": "./safe-restart/dist/index.js", + "entry": "./index.js", + "configSchema": { + "type": "object", + "properties": { + "enabled": { "type": "boolean", "default": true } + } + }, "tools": [ { "name": "pcexec",