openclaw-plugin-vt-sentinel 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -170,10 +170,12 @@ function generateUpdateCommands(opts) {
|
|
|
170
170
|
lines.push(` rm -rf ${quotedExtDir} (Linux/macOS)`);
|
|
171
171
|
lines.push(` rmdir /s /q ${quotedExtDir.replace(/\//g, '\\\\')} (Windows)`);
|
|
172
172
|
lines.push('');
|
|
173
|
-
lines.push(` 2b. Back up and clean the
|
|
174
|
-
// Generate a safe node -e script for config cleanup
|
|
173
|
+
lines.push(` 2b. Back up and clean the stale install entry (preserves your config):`);
|
|
174
|
+
// Generate a safe node -e script for config cleanup.
|
|
175
|
+
// Only deletes plugins.installs (stale install metadata), NOT plugins.entries (user config with apiKey etc.).
|
|
176
|
+
// Tries json5 parser first (likely available as openclaw dependency), falls back to JSON.parse.
|
|
175
177
|
const safeConfigPath = configPath.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/"/g, '\\"');
|
|
176
|
-
const cleanupScript = `node -e "const fs=require('fs'),p='${safeConfigPath}';try{const b=fs.readFileSync(p,'utf8');fs.writeFileSync(p+'.bak',b);const
|
|
178
|
+
const cleanupScript = `node -e "const fs=require('fs'),p='${safeConfigPath}';try{const b=fs.readFileSync(p,'utf8');fs.writeFileSync(p+'.bak',b);const P=(()=>{try{return require('json5').parse}catch{return JSON.parse}})();const c=P(b);if(c.plugins&&c.plugins.installs){delete c.plugins.installs['${PACKAGE_NAME}'];}fs.writeFileSync(p,JSON.stringify(c,null,2));console.log('Config cleaned (backup: '+p+'.bak)')}catch(e){console.error('Failed: '+e.message+'. Manually remove ${PACKAGE_NAME} from plugins.installs in '+p);process.exit(1)}"`;
|
|
177
179
|
lines.push(` ${cleanupScript}`);
|
|
178
180
|
lines.push('');
|
|
179
181
|
lines.push(` 2c. Reinstall:`);
|
package/package.json
CHANGED