agentic-kdd 2.1.11 → 2.2.13

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.
Files changed (2) hide show
  1. package/bin/akdd.js +132 -49
  2. package/package.json +2 -2
package/bin/akdd.js CHANGED
@@ -8,106 +8,189 @@ const { dashboard } = require('../src/dashboard');
8
8
  const { analyze } = require('../src/analyze');
9
9
  const pkg = require('../package.json');
10
10
  const path = require('path');
11
+ const fs = require('fs');
11
12
  const { execSync } = require('child_process');
12
13
 
13
- const args = process.argv.slice(2);
14
+ const args = process.argv.slice(2);
14
15
  const command = args[0];
15
- const arg1 = args[1];
16
+ const arg1 = args[1];
17
+ const arg2 = args[2];
16
18
 
17
19
  const HELP = `
18
20
  Agentic KDD v${pkg.version}
19
21
  Autonomous development pipeline with Knowledge-Driven Development
20
22
 
21
23
  Usage:
22
- akdd init Install Agentic KDD in the current project
23
- akdd update Update agents (memory stays intact)
24
- akdd analyze Analyze project code and auto-build knowledge graph
25
- akdd graph Sync memory + show graph stats
26
- akdd sync Sync memory files to SQLite graph
27
- akdd stats Show graph stats and HIGH rules
28
- akdd coala Show CoALA memory stats (procedural + episodic + semantic)
29
- akdd metricas Show agent KPIs (Goal Attainment, Autonomy, etc.)
30
- akdd buscar Hybrid search across all 3 memory layers
31
- akdd impacto Show impact of touching a module/file
32
- akdd semantico Semantic search (needs API key)
33
- akdd decay Apply temporal decay to stale patterns
34
- akdd dashboard Open visual dashboard in browser
35
- akdd --version Show version
36
- akdd --help Show this help
24
+ akdd init Install Agentic KDD in the current project
25
+ akdd update Update agents + engine (memory stays intact)
26
+ akdd analyze Analyze project code and auto-build knowledge graph
27
+ akdd sync Sync memory files to SQLite graph
28
+ akdd graph Sync memory + show graph stats
29
+ akdd stats Show graph stats and HIGH rules
30
+ akdd coala Show CoALA memory stats (procedural + episodic + semantic)
31
+ akdd metricas Show agent KPIs (Goal Attainment, Autonomy, etc.)
32
+ akdd buscar Hybrid search across all 3 memory layers
33
+ akdd impacto Show impact of touching a module/file
34
+ akdd decay Apply temporal decay to stale patterns
35
+ akdd dashboard Open visual dashboard in browser
36
+
37
+ Intelligence v2.2:
38
+ akdd git-context Analyze git diff + risk assessment from episodic memory
39
+ akdd predict Show predictive patterns detected from episodic memory
40
+ akdd embed-status Check local embeddings status (all-MiniLM-L6-v2)
41
+ akdd embed-install Install local embeddings (~23MB, 100% offline)
42
+ akdd ci-install Install GitHub Actions workflow for auto CI/CD memory
43
+ akdd ci-status Show last CI/CD reports stored in memory
44
+ akdd ci-report Report CI result to memory (called by CI workflow)
45
+
46
+ akdd --version Show version
47
+ akdd --help Show this help
37
48
 
38
49
  After init, open the project in Cursor or Claude Code and type:
39
50
  aa: [your task]
40
51
  `;
41
52
 
42
- function runGrafo(cmd, extra) {
43
- const grafo = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
44
- const fs = require('fs');
45
- if (!fs.existsSync(grafo)) {
46
- console.log('\n grafo.cjs not found. Run akdd update first.\n');
53
+ function findGrafo() {
54
+ const p = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
55
+ if (!fs.existsSync(p)) {
56
+ console.log('\n grafo.cjs not found. Run: akdd update\n');
47
57
  process.exit(1);
48
58
  }
59
+ return p;
60
+ }
61
+
62
+ function runGrafo(cmd, extra) {
63
+ const grafo = findGrafo();
49
64
  try {
50
- const out = execSync(`node "${grafo}" ${cmd}${extra?' '+extra:''}`, {
65
+ execSync(`node "${grafo}" ${cmd}${extra ? ' ' + extra : ''}`, {
51
66
  stdio: 'inherit', cwd: process.cwd()
52
67
  });
53
- } catch(e) {
54
- process.exit(1);
55
- }
68
+ } catch(e) { process.exit(1); }
69
+ }
70
+
71
+ function runGrafoPipe(cmd, extra) {
72
+ const grafo = findGrafo();
73
+ try {
74
+ return execSync(`node "${grafo}" ${cmd}${extra ? ' ' + extra : ''}`, {
75
+ stdio: 'pipe', cwd: process.cwd()
76
+ }).toString();
77
+ } catch(e) { return ''; }
56
78
  }
57
79
 
58
80
  switch (command) {
81
+
82
+ // ── Comandos existentes ─────────────────────────────────────────────────────
59
83
  case 'init':
60
- init();
61
- break;
84
+ init(); break;
85
+
62
86
  case 'update':
63
- update();
64
- break;
87
+ update(); break;
88
+
65
89
  case 'analyze':
66
90
  case 'analizar':
67
- analyze();
68
- break;
91
+ analyze(); break;
92
+
69
93
  case 'graph':
70
- graph();
71
- break;
94
+ graph(); break;
95
+
72
96
  case 'sync':
73
- runGrafo('sync');
74
- break;
97
+ runGrafo('sync'); break;
98
+
75
99
  case 'stats':
76
- runGrafo('stats');
77
- break;
100
+ runGrafo('stats'); break;
101
+
78
102
  case 'coala':
79
- runGrafo('coala');
80
- break;
103
+ runGrafo('coala'); break;
104
+
81
105
  case 'metricas':
82
- runGrafo('metricas');
83
- break;
84
- case 'semantico':
85
- if (!arg1) { console.log('\n Uso: akdd semantico "tu query"\n'); break; }
86
- runGrafo('semantico', `"${arg1}"`);
87
- break;
106
+ runGrafo('metricas'); break;
107
+
88
108
  case 'buscar':
89
109
  if (!arg1) { console.log('\n Uso: akdd buscar "query" [area]\n'); break; }
90
110
  runGrafo('buscar', `"${arg1}"${arg2 ? ' ' + arg2 : ''}`);
91
111
  break;
112
+
92
113
  case 'impacto':
93
114
  if (!arg1) { console.log('\n Uso: akdd impacto "NombreModulo"\n'); break; }
94
115
  runGrafo('impacto', `"${arg1}"`);
95
116
  break;
117
+
96
118
  case 'decay':
97
- runGrafo('decay');
98
- break;
119
+ runGrafo('decay'); break;
120
+
99
121
  case 'dashboard':
100
- dashboard();
122
+ dashboard(); break;
123
+
124
+ // ── v2.2: Intelligence features ────────────────────────────────────────────
125
+
126
+ case 'git-context': {
127
+ if (args.includes('--install-hook')) {
128
+ runGrafo('git-context', '--install-hook');
129
+ break;
130
+ }
131
+ runGrafo('git-context');
132
+ break;
133
+ }
134
+
135
+ case 'predict': {
136
+ runGrafo('predict');
137
+ break;
138
+ }
139
+
140
+ case 'embed-status': {
141
+ runGrafo('embed-status');
142
+ break;
143
+ }
144
+
145
+ case 'embed-install': {
146
+ runGrafo('embed-install');
147
+ break;
148
+ }
149
+
150
+ case 'ci-install': {
151
+ runGrafo('ci-install');
152
+ break;
153
+ }
154
+
155
+ case 'ci-status': {
156
+ runGrafo('ci-status');
101
157
  break;
158
+ }
159
+
160
+ case 'ci-report': {
161
+ // Llamado por GitHub Actions — no interrumpir el CI si falla
162
+ const grafo = path.join(process.cwd(), '.agentic', 'grafo', 'grafo.cjs');
163
+ if (!fs.existsSync(grafo)) { process.exit(0); }
164
+
165
+ const esExito = args.includes('--success');
166
+ const outputIdx = args.indexOf('--output');
167
+ const outputFile = outputIdx >= 0 ? args[outputIdx + 1] : null;
168
+
169
+ const flags = [
170
+ esExito ? '--success' : '',
171
+ outputFile ? `--output "${outputFile}"` : ''
172
+ ].filter(Boolean).join(' ');
173
+
174
+ try {
175
+ execSync(`node "${grafo}" ci-report ${flags}`, {
176
+ stdio: 'inherit', cwd: process.cwd(), timeout: 60000
177
+ });
178
+ } catch(e) { process.exit(0); } // no fallar el CI
179
+ break;
180
+ }
181
+
182
+ // ── Meta ────────────────────────────────────────────────────────────────────
102
183
  case '--version':
103
184
  case '-v':
104
185
  console.log(pkg.version);
105
186
  break;
187
+
106
188
  case '--help':
107
189
  case '-h':
108
190
  case undefined:
109
191
  console.log(HELP);
110
192
  break;
193
+
111
194
  default:
112
195
  console.log(`\n Unknown command: ${command}`);
113
196
  console.log(' Run akdd --help for usage\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentic-kdd",
3
- "version": "2.1.11",
4
- "description": "Autonomous development pipeline with KDD — aa: · ag: · audit: · Visual Dashboard. Works with Cursor and Claude Code.",
3
+ "version": "2.2.13",
4
+ "description": "Autonomous development pipeline with KDD — aa: · ag: · audit: · Git Context · Prediction · Local Embeddings · CI/CD. Works with Cursor and Claude Code.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
7
7
  "akdd": "bin/akdd.js"