specmem-hardwicksoftware 3.5.19 → 3.5.21

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.

Potentially problematic release.


This version of specmem-hardwicksoftware might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specmem-hardwicksoftware",
3
- "version": "3.5.19",
3
+ "version": "3.5.21",
4
4
  "type": "module",
5
5
  "description": "SpecMem - Speculative Memory for Claude Code. Auto-configures hooks, docker, embeddings. https://justcalljon.pro",
6
6
  "main": "dist/index.js",
@@ -30,6 +30,40 @@ const isGlobalInstall = process.env.npm_config_global === 'true' ||
30
30
  process.env.npm_lifecycle_event === 'postinstall' &&
31
31
  !__dirname.includes(process.cwd());
32
32
 
33
+ // ============================================================================
34
+ // PLATFORM CHECK - Linux only for now
35
+ // ============================================================================
36
+ const currentPlatform = require('os').platform();
37
+ if (currentPlatform === 'win32') {
38
+ console.log('\n\x1b[31m╔════════════════════════════════════════════════════════════╗\x1b[0m');
39
+ console.log('\x1b[31m║\x1b[0m \x1b[1m\x1b[31m⚠ SPECMEM IS LINUX-ONLY (for now)\x1b[0m \x1b[31m║\x1b[0m');
40
+ console.log('\x1b[31m╠════════════════════════════════════════════════════════════╣\x1b[0m');
41
+ console.log('\x1b[31m║\x1b[0m \x1b[31m║\x1b[0m');
42
+ console.log('\x1b[31m║\x1b[0m Windows support coming soon! \x1b[31m║\x1b[0m');
43
+ console.log('\x1b[31m║\x1b[0m \x1b[31m║\x1b[0m');
44
+ console.log('\x1b[31m║\x1b[0m Options: \x1b[31m║\x1b[0m');
45
+ console.log('\x1b[31m║\x1b[0m • Use WSL2 (Windows Subsystem for Linux) \x1b[31m║\x1b[0m');
46
+ console.log('\x1b[31m║\x1b[0m • Use a Linux VM or Docker container \x1b[31m║\x1b[0m');
47
+ console.log('\x1b[31m║\x1b[0m • Use a Linux VPS \x1b[31m║\x1b[0m');
48
+ console.log('\x1b[31m║\x1b[0m \x1b[31m║\x1b[0m');
49
+ console.log('\x1b[31m╚════════════════════════════════════════════════════════════╝\x1b[0m\n');
50
+ process.exit(0);
51
+ }
52
+
53
+ if (currentPlatform === 'darwin') {
54
+ console.log('\n\x1b[33m╔════════════════════════════════════════════════════════════╗\x1b[0m');
55
+ console.log('\x1b[33m║\x1b[0m \x1b[1m\x1b[33m⚠ MACOS SUPPORT IS EXPERIMENTAL\x1b[0m \x1b[33m║\x1b[0m');
56
+ console.log('\x1b[33m╠════════════════════════════════════════════════════════════╣\x1b[0m');
57
+ console.log('\x1b[33m║\x1b[0m \x1b[33m║\x1b[0m');
58
+ console.log('\x1b[33m║\x1b[0m SpecMem is primarily developed for Linux. \x1b[33m║\x1b[0m');
59
+ console.log('\x1b[33m║\x1b[0m Some features may not work correctly on macOS. \x1b[33m║\x1b[0m');
60
+ console.log('\x1b[33m║\x1b[0m \x1b[33m║\x1b[0m');
61
+ console.log('\x1b[33m║\x1b[0m Proceeding with installation... \x1b[33m║\x1b[0m');
62
+ console.log('\x1b[33m║\x1b[0m \x1b[33m║\x1b[0m');
63
+ console.log('\x1b[33m╚════════════════════════════════════════════════════════════╝\x1b[0m\n');
64
+ // Continue with install but warn
65
+ }
66
+
33
67
  if (!isGlobalInstall) {
34
68
  console.log('\n\x1b[33m╔════════════════════════════════════════════════════════════╗\x1b[0m');
35
69
  console.log('\x1b[33m║\x1b[0m \x1b[1m\x1b[31m⚠ SPECMEM MUST BE INSTALLED GLOBALLY\x1b[0m \x1b[33m║\x1b[0m');
@@ -92,6 +126,15 @@ const IS_MAC = PLATFORM === 'darwin';
92
126
  const IS_LINUX = PLATFORM === 'linux';
93
127
  const IS_WINDOWS = PLATFORM === 'win32';
94
128
 
129
+ // Detect if running inside Docker container
130
+ const IS_DOCKER = fs.existsSync('/.dockerenv') ||
131
+ (fs.existsSync('/proc/1/cgroup') &&
132
+ fs.readFileSync('/proc/1/cgroup', 'utf8').includes('docker'));
133
+
134
+ // Skip embeddings flag (for low-resource or containerized environments)
135
+ const SKIP_EMBEDDINGS = process.env.SPECMEM_SKIP_EMBEDDINGS === 'true' ||
136
+ process.env.SPECMEM_LITE === 'true';
137
+
95
138
  /**
96
139
  * Run a command and return success/output
97
140
  */
@@ -507,6 +550,25 @@ function adjustPgAuth() {
507
550
  function setupDocker() {
508
551
  log.header('Checking Docker');
509
552
 
553
+ // Skip if requested or in lite mode
554
+ if (SKIP_EMBEDDINGS) {
555
+ log.info('Skipping Docker/embeddings setup (SPECMEM_SKIP_EMBEDDINGS=true)');
556
+ log.info('SpecMem will use API-based embeddings as fallback');
557
+ return true;
558
+ }
559
+
560
+ // Warn if running inside Docker (Docker-in-Docker is complex)
561
+ if (IS_DOCKER) {
562
+ log.warn('Running inside Docker container detected!');
563
+ log.info('Docker-in-Docker requires special setup.');
564
+ log.info('Options:');
565
+ log.info(' 1. Mount host Docker socket: -v /var/run/docker.sock:/var/run/docker.sock');
566
+ log.info(' 2. Use privileged mode: --privileged');
567
+ log.info(' 3. Skip local embeddings: export SPECMEM_SKIP_EMBEDDINGS=true');
568
+ log.info('');
569
+ log.info('Attempting to continue anyway...');
570
+ }
571
+
510
572
  // Check if Docker is already installed
511
573
  if (commandExists('docker')) {
512
574
  log.success('Docker is installed');
@@ -574,7 +636,25 @@ function startDockerDaemon() {
574
636
  return false;
575
637
 
576
638
  } else if (IS_LINUX) {
577
- // Try systemctl first
639
+ // In Docker container, systemctl won't work
640
+ if (IS_DOCKER) {
641
+ log.warn('Inside Docker container - systemctl unavailable');
642
+ log.info('Checking if Docker socket is mounted...');
643
+
644
+ if (fs.existsSync('/var/run/docker.sock')) {
645
+ if (run('docker info', { silent: true }).success) {
646
+ log.success('Docker socket available (mounted from host)');
647
+ return true;
648
+ }
649
+ }
650
+
651
+ log.warn('Docker socket not available in container');
652
+ log.info('SpecMem will work without local embeddings');
653
+ log.info('To enable: run container with -v /var/run/docker.sock:/var/run/docker.sock');
654
+ return false;
655
+ }
656
+
657
+ // Try systemctl first (only on non-containerized Linux)
578
658
  log.step(1, 'Starting Docker via systemctl...');
579
659
  run('sudo systemctl start docker');
580
660
  run('sudo systemctl enable docker');