agentic-kdd 2.1.8 → 2.1.10

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/package.json +1 -1
  2. package/src/update.js +58 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-kdd",
3
- "version": "2.1.8",
3
+ "version": "2.1.10",
4
4
  "description": "Autonomous development pipeline with KDD — aa: · ag: · audit: · Visual Dashboard. Works with Cursor and Claude Code.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/update.js CHANGED
@@ -9,13 +9,11 @@ const ora = require('ora');
9
9
  const GITHUB_REPO = 'Adrianlpz211/Agentic-KDD';
10
10
  const TEMP_DIR = path.join(require('os').tmpdir(), 'agentic-kdd-update');
11
11
 
12
- // ── Comando: akdd update ───────────────────────────────────────
13
12
  async function update() {
14
13
  const projectPath = process.cwd();
15
14
 
16
15
  console.log('\n' + chalk.bold.blue(' Agentic KDD') + chalk.gray(' — updating...\n'));
17
16
 
18
- // Verificar que está instalado
19
17
  if (!fs.existsSync(path.join(projectPath, '.agentic', 'config.md'))) {
20
18
  console.log(chalk.yellow(' Agentic KDD is not installed in this project.'));
21
19
  console.log(chalk.gray(' Run akdd init to install it.\n'));
@@ -27,59 +25,103 @@ async function update() {
27
25
  try {
28
26
  const tmpFile = path.join(require('os').tmpdir(), 'agentic-kdd-update.tar.gz');
29
27
 
30
- // Descargar
31
28
  execSync(
32
29
  `curl -sL "https://github.com/${GITHUB_REPO}/archive/refs/heads/main.tar.gz" -o "${tmpFile}"`,
33
30
  { stdio: 'pipe' }
34
31
  );
35
32
 
36
- // Extraer
37
33
  fs.ensureDirSync(TEMP_DIR);
38
34
  execSync(`tar -xzf "${tmpFile}" -C "${TEMP_DIR}" --strip-components=1`, { stdio: 'pipe' });
39
35
  fs.removeSync(tmpFile);
40
36
 
41
- spinner.text = 'Updating agents (keeping your memory intact)...';
37
+ spinner.text = 'Updating system files (keeping your memory intact)...';
42
38
 
43
- // Actualizar SOLO los agentes no tocar memoria ni config
39
+ // ── LO QUE SE ACTUALIZA (sistema) ────────────────────────────────────────
40
+
41
+ // 1. Agentes — siempre sobreescribir
44
42
  const agentsSrc = path.join(TEMP_DIR, '.agentic', 'agentes');
45
43
  const agentsDest = path.join(projectPath, '.agentic', 'agentes');
46
-
47
44
  if (fs.existsSync(agentsSrc)) {
48
45
  fs.copySync(agentsSrc, agentsDest, { overwrite: true });
49
46
  }
50
47
 
51
- // Actualizar CLAUDE.md y cursor rules
48
+ // 2. Grafo — crítico: grafo.cjs + schema.sql + watch-errors.cjs
49
+ const grafoSrc = path.join(TEMP_DIR, '.agentic', 'grafo');
50
+ const grafoDest = path.join(projectPath, '.agentic', 'grafo');
51
+ if (fs.existsSync(grafoSrc)) {
52
+ fs.copySync(grafoSrc, grafoDest, { overwrite: true });
53
+ }
54
+
55
+ // 3. Dashboard
56
+ const dashSrc = path.join(TEMP_DIR, 'dashboard.cjs');
57
+ const dashDest = path.join(projectPath, 'dashboard.cjs');
58
+ if (fs.existsSync(dashSrc)) {
59
+ fs.copySync(dashSrc, dashDest, { overwrite: true });
60
+ }
61
+
62
+ // 4. Audit department
63
+ const auditSrc = path.join(TEMP_DIR, '.audit');
64
+ const auditDest = path.join(projectPath, '.audit');
65
+ if (fs.existsSync(auditSrc)) {
66
+ fs.copySync(auditSrc, auditDest, { overwrite: true });
67
+ }
68
+
69
+ // 5. CLAUDE.md, _LOCKS.md, cursorrules
52
70
  const filesToUpdate = ['CLAUDE.md', '_LOCKS.md'];
53
71
  for (const file of filesToUpdate) {
54
72
  const src = path.join(TEMP_DIR, file);
55
73
  const dest = path.join(projectPath, file);
56
- if (fs.existsSync(src)) {
57
- fs.copySync(src, dest, { overwrite: true });
58
- }
74
+ if (fs.existsSync(src)) fs.copySync(src, dest, { overwrite: true });
59
75
  }
60
76
 
61
- // Actualizar cursor rules
62
77
  const cursorSrc = path.join(TEMP_DIR, '.cursor');
63
78
  const cursorDest = path.join(projectPath, '.cursor');
64
79
  if (fs.existsSync(cursorSrc)) {
65
80
  fs.copySync(cursorSrc, cursorDest, { overwrite: true });
66
81
  }
67
82
 
83
+ const cursorrulesSrc = path.join(TEMP_DIR, '.cursorrules');
84
+ const cursorrulesDest = path.join(projectPath, '.cursorrules');
85
+ if (fs.existsSync(cursorrulesSrc)) {
86
+ fs.copySync(cursorrulesSrc, cursorrulesDest, { overwrite: true });
87
+ }
88
+
89
+ // ── LO QUE NO SE TOCA (memoria del usuario) ──────────────────────────────
90
+ // .agentic/memoria/ → errores.md, patrones.md, decisiones.md
91
+ // .agentic/config.md → configuración del proyecto
92
+ // .agentic/conocimiento/ → documentación del proyecto
93
+ // .agentic/specs/ → specs generadas
94
+ // .agentic/PLAN.md → plan activo
95
+ // memoria.db → grafo SQLite (datos del usuario)
96
+
68
97
  // Limpiar temp
69
98
  fs.removeSync(TEMP_DIR);
70
99
 
100
+ // Reconstruir better-sqlite3 si es necesario
101
+ spinner.text = 'Checking dependencies...';
102
+ try {
103
+ require('child_process').execSync('npm rebuild better-sqlite3', {
104
+ stdio: 'pipe', cwd: projectPath
105
+ });
106
+ } catch(e) {}
107
+
71
108
  spinner.succeed(chalk.green('Updated successfully!'));
72
109
 
73
110
  console.log('\n' + chalk.bold(' What was updated:'));
74
111
  console.log(chalk.gray(' ✓ Agent instructions (.agentic/agentes/)'));
75
- console.log(chalk.gray(' ✓ CLAUDE.md'));
76
- console.log(chalk.gray(' ✓ Cursor rules\n'));
112
+ console.log(chalk.gray(' ✓ Knowledge graph engine (.agentic/grafo/)'));
113
+ console.log(chalk.gray(' ✓ Dashboard (dashboard.cjs)'));
114
+ console.log(chalk.gray(' ✓ QA department (.audit/)'));
115
+ console.log(chalk.gray(' ✓ CLAUDE.md + Cursor rules'));
77
116
 
78
- console.log(chalk.bold(' What was kept intact:'));
117
+ console.log('\n' + chalk.bold(' What was kept intact:'));
79
118
  console.log(chalk.gray(' ✓ Your project memory (.agentic/memoria/)'));
80
119
  console.log(chalk.gray(' ✓ Your project config (.agentic/config.md)'));
81
120
  console.log(chalk.gray(' ✓ Your knowledge base (.agentic/conocimiento/)'));
82
- console.log(chalk.gray(' ✓ Your PLAN.md\n'));
121
+ console.log(chalk.gray(' ✓ Your PLAN.md'));
122
+ console.log(chalk.gray(' ✓ Your knowledge graph data (memoria.db)\n'));
123
+
124
+ console.log(chalk.dim(' Tip: run akdd sync to update the graph with latest memory.\n'));
83
125
 
84
126
  } catch (err) {
85
127
  spinner.fail(chalk.red('Update failed'));