dev/zhi #1
28
index.js
28
index.js
@@ -1,21 +1,19 @@
|
||||
// PaddedCell Plugin Entry Point
|
||||
export const id = 'padded-cell';
|
||||
export const name = 'PaddedCell';
|
||||
export const version = '0.1.0';
|
||||
|
||||
// Export tools (will be loaded by OpenClaw)
|
||||
export { pcexec } from './pcexec/dist/index.js';
|
||||
export {
|
||||
const { pcexec } = require('./pcexec/dist/index.js');
|
||||
const {
|
||||
safeRestart,
|
||||
createSafeRestartTool,
|
||||
StatusManager,
|
||||
createApiServer,
|
||||
startApiServer
|
||||
} from './safe-restart/dist/index.js';
|
||||
startApiServer,
|
||||
SlashCommandHandler
|
||||
} = require('./safe-restart/dist/index.js');
|
||||
|
||||
// Default export
|
||||
export default {
|
||||
id,
|
||||
name,
|
||||
version,
|
||||
module.exports = {
|
||||
pcexec,
|
||||
safeRestart,
|
||||
createSafeRestartTool,
|
||||
StatusManager,
|
||||
createApiServer,
|
||||
startApiServer,
|
||||
SlashCommandHandler,
|
||||
};
|
||||
|
||||
57
install.mjs
57
install.mjs
@@ -299,58 +299,13 @@ 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');
|
||||
// Create root index.js entry point (copy from source)
|
||||
copyFileSync(join(__dirname, 'index.js'), join(DIST_DIR, 'index.js'));
|
||||
logSuccess('Copied index.js entry point');
|
||||
|
||||
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: './index.js',
|
||||
configSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
enabled: { type: 'boolean', default: true }
|
||||
}
|
||||
},
|
||||
tools: [
|
||||
{
|
||||
name: 'pcexec',
|
||||
entry: './pcexec/dist/index.js',
|
||||
description: 'Safe exec with password sanitization'
|
||||
},
|
||||
{
|
||||
name: 'safe_restart',
|
||||
entry: './safe-restart/dist/index.js',
|
||||
description: 'Safe coordinated restart'
|
||||
}
|
||||
]
|
||||
};
|
||||
writeFileSync(join(DIST_DIR, 'openclaw.plugin.json'), JSON.stringify(manifest, null, 2));
|
||||
logSuccess('Created openclaw.plugin.json');
|
||||
// Copy openclaw.plugin.json from source
|
||||
copyFileSync(join(__dirname, 'openclaw.plugin.json'), join(DIST_DIR, 'openclaw.plugin.json'));
|
||||
logSuccess('Copied openclaw.plugin.json');
|
||||
|
||||
// Create bin directory and install pass_mgr binary
|
||||
mkdirSync(binDir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user