pumuki-ast-hooks 5.4.7 → 5.4.8

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": "pumuki-ast-hooks",
3
- "version": "5.4.7",
3
+ "version": "5.4.8",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -18,6 +18,8 @@
18
18
  const fs = require('fs');
19
19
  const path = require('path');
20
20
  const { execSync } = require('child_process');
21
+ const crypto = require('crypto');
22
+ const os = require('os');
21
23
  const env = require('../../config/env');
22
24
 
23
25
  // Removed global requires for performance (Lazy Loading)
@@ -54,7 +56,10 @@ function resolveRepoRoot() {
54
56
 
55
57
  const REPO_ROOT = resolveRepoRoot();
56
58
 
57
- const MCP_LOCK_DIR = path.join(REPO_ROOT, '.audit_tmp', 'mcp-singleton.lock');
59
+ // Create unique lock per project using hash of REPO_ROOT
60
+ // This allows multiple projects to run MCP simultaneously
61
+ const repoHash = crypto.createHash('md5').update(REPO_ROOT).digest('hex').substring(0, 8);
62
+ const MCP_LOCK_DIR = path.join(os.tmpdir(), `mcp-ast-intelligence-${repoHash}.lock`);
58
63
  const MCP_LOCK_PID = path.join(MCP_LOCK_DIR, 'pid');
59
64
 
60
65
  let MCP_IS_PRIMARY = true;
@@ -160,11 +165,7 @@ function installStdioExitHandlers() {
160
165
  }
161
166
 
162
167
  function acquireSingletonLock() {
163
- try {
164
- fs.mkdirSync(path.join(REPO_ROOT, '.audit_tmp'), { recursive: true });
165
- } catch (error) {
166
- logMcpError('acquireSingletonLock (create .audit_tmp)', error);
167
- }
168
+ // No need to create .audit_tmp since lock is in /tmp/
168
169
 
169
170
  try {
170
171
  fs.mkdirSync(MCP_LOCK_DIR);