openclaw-plugin-vt-sentinel 0.8.0 → 0.8.1

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -169,7 +169,7 @@ function generateUpdateCommands(opts) {
169
169
  lines.push('');
170
170
  lines.push(` 2b. Back up and clean the config entry:`);
171
171
  // Generate a safe node -e script for config cleanup
172
- const cleanupScript = `node -e "const fs=require('fs'),p='${configPath.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}';try{const b=fs.readFileSync(p,'utf8');fs.writeFileSync(p+'.bak',b);const c=JSON.parse(b);if(c.plugins){delete(c.plugins.entries||{})['${PACKAGE_NAME}'];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)}"`;
172
+ const cleanupScript = `node -e "const fs=require('fs'),p='${configPath.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}';try{const b=fs.readFileSync(p,'utf8');fs.writeFileSync(p+'.bak',b);const c=JSON.parse(b);if(c.plugins){delete(c.plugins.entries||{})['${PACKAGE_NAME}'];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);process.exit(1)}"`;
173
173
  lines.push(` ${cleanupScript}`);
174
174
  lines.push('');
175
175
  lines.push(` 2c. Reinstall:`);
@@ -183,7 +183,11 @@ async function checkForUpdates(logger, callbacks) {
183
183
  try {
184
184
  const currentVersion = getCurrentVersion();
185
185
  const latestVersion = await fetchLatestVersion();
186
- if (latestVersion && isNewerVersion(latestVersion, currentVersion)) {
186
+ if (!latestVersion) {
187
+ callbacks?.onError();
188
+ return;
189
+ }
190
+ if (isNewerVersion(latestVersion, currentVersion)) {
187
191
  logger.info(`[VT-Sentinel] Update available: ${currentVersion} → ${latestVersion}. ` +
188
192
  `Use vt_sentinel_update to check upgrade instructions.`);
189
193
  callbacks?.onNewer(latestVersion);
@@ -1026,7 +1030,8 @@ function vtSentinelPlugin(api) {
1026
1030
  },
1027
1031
  required: [],
1028
1032
  },
1029
- execute: async (_ctx, params) => {
1033
+ execute: async (_ctx, rawParams) => {
1034
+ const params = rawParams || {};
1030
1035
  // Strict validation: reject non-boolean confirm
1031
1036
  if ('confirm' in params && typeof params.confirm !== 'boolean') {
1032
1037
  return textResponse('Error: confirm must be true or false');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-plugin-vt-sentinel",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "VirusTotal Sentinel for OpenClaw - Malware detection and AI-powered code analysis",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",