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
This commit is contained in:
zhi
2026-03-05 14:49:03 +00:00
parent 6454004d66
commit e97ce0208e
2 changed files with 39 additions and 3 deletions

View File

@@ -299,13 +299,43 @@ async function installComponents(env) {
copyDir(join(__dirname, 'safe-restart'), join(DIST_DIR, 'safe-restart')); copyDir(join(__dirname, 'safe-restart'), join(DIST_DIR, 'safe-restart'));
logSuccess('Copied safe-restart to dist/padded-cell/'); 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 // Create openclaw.plugin.json
const manifest = { const manifest = {
id: PLUGIN_NAME, id: PLUGIN_NAME,
name: 'PaddedCell', name: 'PaddedCell',
version: '0.1.0', version: '0.1.0',
description: 'Secure password management, safe execution, and coordinated restart', 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: [ tools: [
{ {
name: 'pcexec', name: 'pcexec',
@@ -320,7 +350,7 @@ async function installComponents(env) {
] ]
}; };
writeFileSync(join(DIST_DIR, 'openclaw.plugin.json'), JSON.stringify(manifest, null, 2)); 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 // Create bin directory and install pass_mgr binary
mkdirSync(binDir, { recursive: true }); mkdirSync(binDir, { recursive: true });

View File

@@ -3,7 +3,13 @@
"name": "PaddedCell", "name": "PaddedCell",
"version": "0.1.0", "version": "0.1.0",
"description": "Secure password management, safe execution, and coordinated restart", "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": [ "tools": [
{ {
"name": "pcexec", "name": "pcexec",