shieldcortex 4.0.1 → 4.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shieldcortex",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Trustworthy memory and security for AI agents. Recall debugging, review queue, OpenClaw session capture, and memory poisoning defence for Claude Code, Codex, OpenClaw, LangChain, and MCP agents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  * - SHIELDCORTEX_SKIP_AUTO_OPENCLAW=1 is set
10
10
  * - Running as a local/dev install (npm_config_global !== 'true')
11
11
  */
12
- import { existsSync, copyFileSync, mkdirSync, readdirSync } from 'fs';
12
+ import { existsSync, copyFileSync, mkdirSync, readdirSync, readFileSync } from 'fs';
13
13
  import { join, dirname } from 'path';
14
14
  import { homedir } from 'os';
15
15
  import { spawnSync } from 'child_process';
@@ -28,8 +28,8 @@ function isDockerEnvironment() {
28
28
  if (process.env.DOCKER === 'true' || process.env.DOCKER === '1') return true;
29
29
  if (process.env.container === 'docker') return true;
30
30
  try {
31
- const { readFileSync } = await import('fs').catch(() => ({ readFileSync: null }));
32
- // Sync fallback — import() can't be used synchronously here
31
+ const cgroup = readFileSync('/proc/1/cgroup', 'utf8');
32
+ if (cgroup.includes('docker') || cgroup.includes('kubepods') || cgroup.includes('containerd')) return true;
33
33
  } catch { /* ignore */ }
34
34
  return false;
35
35
  }