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:
34
install.mjs
34
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 });
|
||||
|
||||
Reference in New Issue
Block a user