@contextfort-ai/openclaw-secure 0.1.6 → 0.1.7

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.
@@ -19,6 +19,9 @@ module.exports = function createSkillsGuard({ readFileSync, httpsRequest, baseDi
19
19
  };
20
20
  }
21
21
 
22
+ let PACKAGE_VERSION;
23
+ try { PACKAGE_VERSION = require(path.join(baseDir, 'package.json')).version; } catch { PACKAGE_VERSION = 'unknown'; }
24
+
22
25
  const track = analytics ? analytics.track.bind(analytics) : () => {};
23
26
  const SKILL_CACHE_FILE = path.join(baseDir, 'monitor', '.skill_scan_cache.json');
24
27
  const INSTALL_ID_FILE = path.join(baseDir, 'monitor', '.install_id');
@@ -133,7 +136,8 @@ module.exports = function createSkillsGuard({ readFileSync, httpsRequest, baseDi
133
136
  function loadScanCache() {
134
137
  try {
135
138
  const data = JSON.parse(readFileSync(SKILL_CACHE_FILE, 'utf8'));
136
- if (data.hashes) {
139
+ const versionChanged = data.version !== PACKAGE_VERSION;
140
+ if (data.hashes && !versionChanged) {
137
141
  for (const [k, v] of Object.entries(data.hashes)) {
138
142
  skillContentHashes.set(k, v);
139
143
  }
@@ -151,6 +155,7 @@ module.exports = function createSkillsGuard({ readFileSync, httpsRequest, baseDi
151
155
  function saveScanCache() {
152
156
  try {
153
157
  const data = {
158
+ version: PACKAGE_VERSION,
154
159
  hashes: Object.fromEntries(skillContentHashes),
155
160
  flagged: Object.fromEntries(flaggedSkills),
156
161
  updated: new Date().toISOString()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextfort-ai/openclaw-secure",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Runtime security guard for OpenClaw — blocks malicious commands before they execute",
5
5
  "bin": {
6
6
  "openclaw-secure": "./bin/openclaw-secure.js"