dev/zhi #1
28
index.js
28
index.js
@@ -1,21 +1,19 @@
|
|||||||
// PaddedCell Plugin Entry Point
|
const { pcexec } = require('./pcexec/dist/index.js');
|
||||||
export const id = 'padded-cell';
|
const {
|
||||||
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 {
|
|
||||||
safeRestart,
|
safeRestart,
|
||||||
createSafeRestartTool,
|
createSafeRestartTool,
|
||||||
StatusManager,
|
StatusManager,
|
||||||
createApiServer,
|
createApiServer,
|
||||||
startApiServer
|
startApiServer,
|
||||||
} from './safe-restart/dist/index.js';
|
SlashCommandHandler
|
||||||
|
} = require('./safe-restart/dist/index.js');
|
||||||
|
|
||||||
// Default export
|
module.exports = {
|
||||||
export default {
|
pcexec,
|
||||||
id,
|
safeRestart,
|
||||||
name,
|
createSafeRestartTool,
|
||||||
version,
|
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'));
|
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
|
// Create root index.js entry point (copy from source)
|
||||||
const indexJs = `const { pcexec } = require('./pcexec/dist/index.js');
|
copyFileSync(join(__dirname, 'index.js'), join(DIST_DIR, 'index.js'));
|
||||||
const {
|
logSuccess('Copied index.js entry point');
|
||||||
safeRestart,
|
|
||||||
createSafeRestartTool,
|
|
||||||
StatusManager,
|
|
||||||
createApiServer,
|
|
||||||
startApiServer,
|
|
||||||
SlashCommandHandler
|
|
||||||
} = require('./safe-restart/dist/index.js');
|
|
||||||
|
|
||||||
module.exports = {
|
// Copy openclaw.plugin.json from source
|
||||||
pcexec,
|
copyFileSync(join(__dirname, 'openclaw.plugin.json'), join(DIST_DIR, 'openclaw.plugin.json'));
|
||||||
safeRestart,
|
logSuccess('Copied openclaw.plugin.json');
|
||||||
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');
|
|
||||||
|
|
||||||
// Create bin directory and install pass_mgr binary
|
// Create bin directory and install pass_mgr binary
|
||||||
mkdirSync(binDir, { recursive: true });
|
mkdirSync(binDir, { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user