pumuki-ast-hooks 5.3.6 → 5.3.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.3.6",
3
+ "version": "5.3.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": {
@@ -12,5 +12,5 @@ Source: file
12
12
 
13
13
  ℹ️ Data is stale. Ensure guards are running and refreshing token usage.
14
14
 
15
- Last updated: 2025-12-29T16:15:44.360Z
15
+ Last updated: 2025-12-29T16:45:45.428Z
16
16
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -526,3 +526,13 @@
526
526
  {"timestamp":"2025-12-29T16:09:44.150Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"46322b8d-19ff-4888-8ce9-d901a54191d4","type":"token_ok"},"context":{}}
527
527
  {"timestamp":"2025-12-29T16:12:44.258Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"eac1ff0f-5133-41b1-a324-40c38c8b8f02","type":"token_ok"},"context":{}}
528
528
  {"timestamp":"2025-12-29T16:15:44.361Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"b013b103-7ea4-4f60-aebd-e9c0b4f21438","type":"token_ok"},"context":{}}
529
+ {"timestamp":"2025-12-29T16:18:44.475Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"adfff9a0-05b6-495e-ae81-38855a5dca1a","type":"token_ok"},"context":{}}
530
+ {"timestamp":"2025-12-29T16:21:44.578Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"c252550d-1535-4f24-be5f-fe09722460df","type":"token_ok"},"context":{}}
531
+ {"timestamp":"2025-12-29T16:24:44.692Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"06440138-fee0-484f-804c-dee11c93267f","type":"token_ok"},"context":{}}
532
+ {"timestamp":"2025-12-29T16:27:44.777Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"4d383913-396e-47d2-8e63-0fdc1065870c","type":"token_ok"},"context":{}}
533
+ {"timestamp":"2025-12-29T16:30:44.889Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"6107b078-cca4-4c2c-b81e-81ac891c5373","type":"token_ok"},"context":{}}
534
+ {"timestamp":"2025-12-29T16:33:45.003Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"e8722220-25f5-45a3-90ff-5f8d7a288d50","type":"token_ok"},"context":{}}
535
+ {"timestamp":"2025-12-29T16:36:45.100Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"57eedfdf-21d0-4371-970d-4baae6b3a1ce","type":"token_ok"},"context":{}}
536
+ {"timestamp":"2025-12-29T16:39:45.200Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"93142073-89d9-4c17-9152-6bf6ce181423","type":"token_ok"},"context":{}}
537
+ {"timestamp":"2025-12-29T16:42:45.315Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"3eea7b8e-8d7a-41c7-a6a2-a2576ca928d5","type":"token_ok"},"context":{}}
538
+ {"timestamp":"2025-12-29T16:45:45.428Z","level":"debug","component":"NotificationCenter","event":"Notification enqueued","data":{"id":"4d18abda-f1d8-4f81-aeb5-f9a2d40b240f","type":"token_ok"},"context":{}}
@@ -1582,3 +1582,33 @@
1582
1582
  {"timestamp":"2025-12-29T16:15:44.350Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1583
1583
  {"timestamp":"2025-12-29T16:15:44.351Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1584
1584
  {"timestamp":"2025-12-29T16:15:44.362Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1585
+ {"timestamp":"2025-12-29T16:18:44.466Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1586
+ {"timestamp":"2025-12-29T16:18:44.467Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1587
+ {"timestamp":"2025-12-29T16:18:44.476Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1588
+ {"timestamp":"2025-12-29T16:21:44.567Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1589
+ {"timestamp":"2025-12-29T16:21:44.568Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1590
+ {"timestamp":"2025-12-29T16:21:44.579Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1591
+ {"timestamp":"2025-12-29T16:24:44.682Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1592
+ {"timestamp":"2025-12-29T16:24:44.683Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1593
+ {"timestamp":"2025-12-29T16:24:44.692Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1594
+ {"timestamp":"2025-12-29T16:27:44.767Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1595
+ {"timestamp":"2025-12-29T16:27:44.768Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1596
+ {"timestamp":"2025-12-29T16:27:44.777Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1597
+ {"timestamp":"2025-12-29T16:30:44.879Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1598
+ {"timestamp":"2025-12-29T16:30:44.879Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1599
+ {"timestamp":"2025-12-29T16:30:44.890Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1600
+ {"timestamp":"2025-12-29T16:33:44.993Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1601
+ {"timestamp":"2025-12-29T16:33:44.994Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1602
+ {"timestamp":"2025-12-29T16:33:45.003Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1603
+ {"timestamp":"2025-12-29T16:36:45.089Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1604
+ {"timestamp":"2025-12-29T16:36:45.090Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1605
+ {"timestamp":"2025-12-29T16:36:45.100Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1606
+ {"timestamp":"2025-12-29T16:39:45.188Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1607
+ {"timestamp":"2025-12-29T16:39:45.190Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1608
+ {"timestamp":"2025-12-29T16:39:45.200Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1609
+ {"timestamp":"2025-12-29T16:42:45.305Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1610
+ {"timestamp":"2025-12-29T16:42:45.306Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1611
+ {"timestamp":"2025-12-29T16:42:45.315Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
1612
+ {"timestamp":"2025-12-29T16:45:45.419Z","level":"debug","component":"TokenMonitor","event":"CURSOR_SERVICE_USING_FILE","data":{"usage":{"tokensUsed":0,"maxTokens":1000000,"percentUsed":72.36585,"timestamp":"2025-12-29T15:38:11.174Z","source":"file","untrusted":false}},"context":{}}
1613
+ {"timestamp":"2025-12-29T16:45:45.420Z","level":"debug","component":"TokenMonitor","event":"TOKEN_MONITOR_METRICS","data":{"timestamp":"2025-12-29T15:38:11.174Z","tokensUsed":0,"maxTokens":1000000,"percentUsed":0,"remainingTokens":1000000,"level":"ok","source":"file","stale":true,"untrusted":false},"context":{}}
1614
+ {"timestamp":"2025-12-29T16:45:45.429Z","level":"info","component":"TokenMonitor","event":"TOKEN_MONITOR_RESULT","data":{"level":"ok","percentUsed":0,"tokensUsed":0,"maxTokens":1000000,"source":"file","stale":true,"untrusted":false},"context":{"message":"Result level=ok percent=0% used=0/1000000 source=file (stale)"}}
@@ -3,93 +3,94 @@ const path = require('path');
3
3
  const { execSync, spawnSync } = require('child_process');
4
4
 
5
5
  const COLORS = {
6
- reset: '\x1b[0m',
7
- blue: '\x1b[34m',
8
- green: '\x1b[32m',
9
- yellow: '\x1b[33m',
10
- red: '\x1b[31m',
11
- cyan: '\x1b[36m'
6
+ reset: '\x1b[0m',
7
+ blue: '\x1b[34m',
8
+ green: '\x1b[32m',
9
+ yellow: '\x1b[33m',
10
+ red: '\x1b[31m',
11
+ cyan: '\x1b[36m'
12
12
  };
13
13
 
14
14
  class GitEnvironmentService {
15
- constructor(targetRoot) {
16
- this.targetRoot = targetRoot || process.cwd();
15
+ constructor(targetRoot, version = 'unknown') {
16
+ this.targetRoot = targetRoot || process.cwd();
17
+ this.version = version;
18
+ }
19
+
20
+ checkGitRepository() {
21
+ const gitDir = path.join(this.targetRoot, '.git');
22
+ if (!fs.existsSync(gitDir)) {
23
+ this.logError('❌ CRITICAL: Git repository not found!');
24
+ this.logWarning(' This library REQUIRES a Git repository to function properly.');
25
+ this.logInfo(' Please run: git init\n');
26
+ this.logWarning('⚠️ Without Git:');
27
+ this.logInfo(' • Pre-commit hooks cannot be installed');
28
+ this.logInfo(' • Git Flow automation will not work');
29
+ this.logInfo(' • Code analysis on commits is disabled\n');
30
+ return false;
17
31
  }
18
32
 
19
- checkGitRepository() {
20
- const gitDir = path.join(this.targetRoot, '.git');
21
- if (!fs.existsSync(gitDir)) {
22
- this.logError('❌ CRITICAL: Git repository not found!');
23
- this.logWarning(' This library REQUIRES a Git repository to function properly.');
24
- this.logInfo(' Please run: git init\n');
25
- this.logWarning('⚠️ Without Git:');
26
- this.logInfo(' Pre-commit hooks cannot be installed');
27
- this.logInfo(' Git Flow automation will not work');
28
- this.logInfo(' Code analysis on commits is disabled\n');
29
- return false;
30
- }
31
-
32
- try {
33
- execSync('git rev-parse --show-toplevel', {
34
- cwd: this.targetRoot,
35
- stdio: 'ignore'
36
- });
37
- return true;
38
- } catch (err) {
39
- this.logError('❌ Git repository is not properly initialized!');
40
- this.logWarning(' Found .git directory but git commands fail.');
41
- this.logInfo(' Please ensure Git is installed and working.\n');
42
- return false;
43
- }
33
+ try {
34
+ execSync('git rev-parse --show-toplevel', {
35
+ cwd: this.targetRoot,
36
+ stdio: 'ignore'
37
+ });
38
+ return true;
39
+ } catch (err) {
40
+ this.logError(' Git repository is not properly initialized!');
41
+ this.logWarning(' Found .git directory but git commands fail.');
42
+ this.logInfo(' Please ensure Git is installed and working.\n');
43
+ return false;
44
44
  }
45
-
46
- ensureGitInfoExclude() {
47
- const gitDir = path.join(this.targetRoot, '.git');
48
- if (!fs.existsSync(gitDir)) return;
49
-
50
- const excludePath = path.join(gitDir, 'info', 'exclude');
51
- fs.mkdirSync(path.dirname(excludePath), { recursive: true });
52
-
53
- const header = '# AST Intelligence Hooks (generated artifacts)';
54
- const patterns = [
55
- '.AI_TOKEN_STATUS.txt',
56
- '.audit-reports/*.log',
57
- '.realtime-guard.pid',
58
- '.token-monitor-guard.pid'
59
- ];
60
-
61
- let existing = '';
62
- if (fs.existsSync(excludePath)) {
63
- existing = fs.readFileSync(excludePath, 'utf8');
64
- if (existing.includes(header)) return;
65
- }
66
-
67
- const block = '\n' + header + '\n' + patterns.join('\n') + '\n';
68
- fs.appendFileSync(excludePath, block);
69
- this.logSuccess(' ✅ Added artifact patterns to .git/info/exclude');
45
+ }
46
+
47
+ ensureGitInfoExclude() {
48
+ const gitDir = path.join(this.targetRoot, '.git');
49
+ if (!fs.existsSync(gitDir)) return;
50
+
51
+ const excludePath = path.join(gitDir, 'info', 'exclude');
52
+ fs.mkdirSync(path.dirname(excludePath), { recursive: true });
53
+
54
+ const header = '# AST Intelligence Hooks (generated artifacts)';
55
+ const patterns = [
56
+ '.AI_TOKEN_STATUS.txt',
57
+ '.audit-reports/*.log',
58
+ '.realtime-guard.pid',
59
+ '.token-monitor-guard.pid'
60
+ ];
61
+
62
+ let existing = '';
63
+ if (fs.existsSync(excludePath)) {
64
+ existing = fs.readFileSync(excludePath, 'utf8');
65
+ if (existing.includes(header)) return;
70
66
  }
71
67
 
72
- installGitHooks() {
73
- const gitHooksDir = path.join(this.targetRoot, '.git/hooks');
74
-
75
- if (!fs.existsSync(gitHooksDir)) {
76
- this.logError('✗ .git/hooks directory not found');
77
- this.logWarning(' Git hooks cannot be installed without a valid Git repository.');
78
- return;
79
- }
68
+ const block = '\n' + header + '\n' + patterns.join('\n') + '\n';
69
+ fs.appendFileSync(excludePath, block);
70
+ this.logSuccess(' ✅ Added artifact patterns to .git/info/exclude');
71
+ }
80
72
 
81
- const preCommitHook = this.getPreCommitHookContent();
82
- const preCommitPath = path.join(gitHooksDir, 'pre-commit');
73
+ installGitHooks() {
74
+ const gitHooksDir = path.join(this.targetRoot, '.git/hooks');
83
75
 
84
- fs.writeFileSync(preCommitPath, preCommitHook);
85
- fs.chmodSync(preCommitPath, '755');
86
- this.logSuccess(' Installed pre-commit hook');
76
+ if (!fs.existsSync(gitHooksDir)) {
77
+ this.logError('✗ .git/hooks directory not found');
78
+ this.logWarning(' Git hooks cannot be installed without a valid Git repository.');
79
+ return;
87
80
  }
88
81
 
89
- getPreCommitHookContent() {
90
- return `#!/bin/bash
82
+ const preCommitHook = this.getPreCommitHookContent();
83
+ const preCommitPath = path.join(gitHooksDir, 'pre-commit');
84
+
85
+ fs.writeFileSync(preCommitPath, preCommitHook);
86
+ fs.chmodSync(preCommitPath, '755');
87
+ this.logSuccess(' ✅ Installed pre-commit hook');
88
+ }
89
+
90
+ getPreCommitHookContent() {
91
+ return `#!/bin/bash
91
92
  # AST Intelligence Hooks - Pre-commit
92
- # Auto-generated by @pumuki/ast-intelligence-hooks v5.3.1
93
+ # Auto-generated by pumuki-ast-hooks v${this.version}
93
94
 
94
95
  # Check for bypass
95
96
  if [[ -n "\${GIT_BYPASS_HOOK}" ]]; then
@@ -155,12 +156,12 @@ fi
155
156
  echo "⚠️ ast-intelligence-hooks not found"
156
157
  exit 0
157
158
  `;
158
- }
159
+ }
159
160
 
160
- logInfo(msg) { process.stdout.write(`${COLORS.cyan}${msg}${COLORS.reset}\n`); }
161
- logSuccess(msg) { process.stdout.write(`${COLORS.green}${msg}${COLORS.reset}\n`); }
162
- logWarning(msg) { process.stdout.write(`${COLORS.yellow}${msg}${COLORS.reset}\n`); }
163
- logError(msg) { process.stdout.write(`${COLORS.red}${msg}${COLORS.reset}\n`); }
161
+ logInfo(msg) { process.stdout.write(`${COLORS.cyan}${msg}${COLORS.reset}\n`); }
162
+ logSuccess(msg) { process.stdout.write(`${COLORS.green}${msg}${COLORS.reset}\n`); }
163
+ logWarning(msg) { process.stdout.write(`${COLORS.yellow}${msg}${COLORS.reset}\n`); }
164
+ logError(msg) { process.stdout.write(`${COLORS.red}${msg}${COLORS.reset}\n`); }
164
165
  }
165
166
 
166
167
  module.exports = GitEnvironmentService;
@@ -23,6 +23,15 @@ class InstallService {
23
23
  // Assuming this script is located at scripts/hooks-system/application/services/installation/InstallService.js
24
24
  this.hookSystemRoot = path.resolve(__dirname, '../../../');
25
25
 
26
+ // Read version dynamically from package.json
27
+ const packageJsonPath = path.resolve(this.hookSystemRoot, '../package.json');
28
+ try {
29
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
30
+ this.version = pkg.version || 'unknown';
31
+ } catch {
32
+ this.version = 'unknown';
33
+ }
34
+
26
35
  // Initialize Audit Logger
27
36
  const auditLogPath = path.join(this.targetRoot, '.audit-reports', 'install.log');
28
37
  if (!fs.existsSync(path.dirname(auditLogPath))) {
@@ -39,7 +48,7 @@ class InstallService {
39
48
  }
40
49
  });
41
50
 
42
- this.gitService = new GitEnvironmentService(this.targetRoot);
51
+ this.gitService = new GitEnvironmentService(this.targetRoot, this.version);
43
52
  this.platformService = new PlatformDetectorService(this.targetRoot);
44
53
  this.fsInstaller = new FileSystemInstallerService(this.targetRoot, this.hookSystemRoot, this.logger);
45
54
  this.configGenerator = new ConfigurationGeneratorService(this.targetRoot, this.hookSystemRoot);
@@ -98,10 +107,11 @@ class InstallService {
98
107
  }
99
108
 
100
109
  printHeader() {
110
+ const versionPadded = `v${this.version}`.padStart(24).padEnd(48);
101
111
  process.stdout.write(`${COLORS.blue}
102
112
  ╔════════════════════════════════════════════════════════════════╗
103
113
  ║ AST Intelligence Hooks - Installation Wizard ║
104
- v5.3.1 ║
114
+ ║${versionPadded}
105
115
  ╚════════════════════════════════════════════════════════════════╝
106
116
  ${COLORS.reset}\n`);
107
117
  }
@@ -56,7 +56,13 @@ source "$INFRASTRUCTURE_DIR/eslint/eslint-integration.sh"
56
56
 
57
57
  # Initialize
58
58
  START_TIME=$(date +%s)
59
- ROOT_DIR=$(pwd)
59
+
60
+ # Determine repository root using git
61
+ if command -v git >/dev/null 2>&1; then
62
+ ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
63
+ else
64
+ ROOT_DIR=$(pwd)
65
+ fi
60
66
 
61
67
  # Default to temp directories to avoid polluting repositories.
62
68
  # Can be overridden by setting AUDIT_TMP / AUDIT_REPORTS.