siesa-agents 2.1.24 → 2.1.25-dev.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SIESA Agents
1
+ # SIESA BMAD Agents
2
2
 
3
3
  Paquete para instalar y configurar agentes SIESA en tu proyecto.
4
4
 
@@ -52,7 +52,6 @@ El paquete instala las siguientes carpetas en tu directorio actual:
52
52
  - **`.bmad-core/`** - Archivos principales del sistema BMAD
53
53
  - **`.vscode/`** - Configuración de Visual Studio Code
54
54
  - **`.github/`** - Configuración de GitHub Actions y workflows
55
- - **`.claude/`** - Configuración de Claude Code Commands y workflows
56
55
 
57
56
  ## Características
58
57
 
@@ -71,17 +70,22 @@ El paquete instala las siguientes carpetas en tu directorio actual:
71
70
 
72
71
  Para actualizar una instalación existente, simplemente ejecuta el comando nuevamente:
73
72
 
73
+ **Versión estable (recomendado):**
74
74
  ```bash
75
75
  npx siesa-agents
76
76
  ```
77
77
 
78
+ **Versión de desarrollo:**
79
+ ```bash
80
+ npx siesa-agents@dev
81
+ ```
82
+
78
83
  El sistema detectará automáticamente que ya existe una instalación y la actualizará.
79
84
 
80
85
  ## Requisitos
81
86
 
82
87
  - Node.js >= 14.0.0
83
88
  - npm >= 6.0.0
84
- - Python >= 3.7 (requerido para hooks de Claude Code)
85
89
 
86
90
  ## Estructura de archivos instalados
87
91
 
@@ -95,6 +99,8 @@ tu-proyecto/
95
99
  └── [workflows y configuración de GitHub]
96
100
  ```
97
101
 
102
+
103
+
98
104
  ## Soporte
99
105
 
100
106
  Si encuentras algún problema durante la instalación, por favor verifica:
@@ -109,7 +115,4 @@ MIT
109
115
 
110
116
  ## Autor
111
117
 
112
- SIESA - Sistemas de Información Empresarial
113
-
114
- ---
115
- *Versión actualizada automáticamente por CI/CD*
118
+ SIESA - Sistemas de Información Empresarial
package/bin/install.js CHANGED
@@ -4,6 +4,7 @@ const fs = require('fs-extra');
4
4
  const path = require('path');
5
5
  const readline = require('readline');
6
6
 
7
+
7
8
  class SiesaBmadInstaller {
8
9
  constructor() {
9
10
  // Definir las carpetas primero (nombres en el paquete vs nombres finales)
@@ -12,20 +13,12 @@ class SiesaBmadInstaller {
12
13
  { source: 'vscode', target: '.vscode' },
13
14
  { source: 'github', target: '.github' },
14
15
  { source: 'claude', target: '.claude' },
16
+ { source: 'kiro', target: '.kiro' },
15
17
  { source: 'resources', target: '.resources' }
16
18
  ];
17
-
18
- // Lista de archivos que se preservan automáticamente (no se crean backups)
19
- this.ignoredFiles = [
20
- 'data/technical-preferences.md'
21
- ];
22
-
23
19
  this.targetDir = process.cwd();
24
20
  // Intentar múltiples ubicaciones posibles para el paquete
25
21
  this.packageDir = this.findPackageDir();
26
-
27
- // Almacenamiento temporal para contenido de archivos ignorados
28
- this.preservedContent = new Map();
29
22
  }
30
23
 
31
24
  showBanner() {
@@ -36,7 +29,8 @@ class SiesaBmadInstaller {
36
29
  console.log('╚════██║██║██╔══╝ ╚════██║██╔══██║ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║');
37
30
  console.log('███████║██║███████╗███████║██║ ██║ ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║');
38
31
  console.log('╚══════╝╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝');
39
- console.log('');
32
+ console.log('Version de Desarrollador');
33
+ console.log('\n');
40
34
  }
41
35
 
42
36
  findPackageDir() {
@@ -80,7 +74,7 @@ class SiesaBmadInstaller {
80
74
  try {
81
75
  // Verificar si ya existe una instalación
82
76
  const hasExistingInstallation = this.checkExistingInstallation();
83
-
77
+
84
78
  if (hasExistingInstallation) {
85
79
  console.log('🔄 Instalación existente detectada. Actualizando...');
86
80
  await this.update();
@@ -133,8 +127,7 @@ class SiesaBmadInstaller {
133
127
  modifiedFiles.push({
134
128
  folder: mapping.target,
135
129
  file: relativePath,
136
- fullPath: targetFile,
137
- is_ignored: this.ignoredFiles.includes(relativePath)
130
+ fullPath: targetFile
138
131
  });
139
132
  }
140
133
  } catch (error) {
@@ -146,8 +139,7 @@ class SiesaBmadInstaller {
146
139
  modifiedFiles.push({
147
140
  folder: mapping.target,
148
141
  file: relativePath,
149
- fullPath: targetFile,
150
- is_ignored: this.ignoredFiles.includes(relativePath)
142
+ fullPath: targetFile
151
143
  });
152
144
  }
153
145
  }
@@ -178,10 +170,6 @@ class SiesaBmadInstaller {
178
170
  }
179
171
 
180
172
  async promptUser(modifiedFiles) {
181
-
182
- const hasNonIgnoredFiles = modifiedFiles.some(file => file.is_ignored == false)
183
- if (!hasNonIgnoredFiles) return '2'
184
-
185
173
  console.log('\n⚠️ Se detectaron archivos modificados:');
186
174
 
187
175
  // Agrupar por carpeta
@@ -222,22 +210,16 @@ class SiesaBmadInstaller {
222
210
  console.log('\n🔄 Creando backup de archivos modificados...');
223
211
 
224
212
  for (const item of modifiedFiles) {
225
- // No crear backup de archivos ignorados
226
- if (item.is_ignored) {
227
- console.log(`✓ Preservando: ${item.file} (sin backup)`);
228
- continue;
229
- }
230
-
231
213
  const originalPath = item.fullPath;
232
214
  const backupPath = this.getBackupPath(originalPath);
233
215
 
234
216
  try {
235
217
  await fs.copy(originalPath, backupPath);
236
-
218
+
237
219
  // Determinar tipo de backup para mostrar mensaje apropiado
238
220
  const backupName = path.basename(backupPath);
239
221
  const isVersionedBackup = backupName.includes('_bk_');
240
-
222
+
241
223
  if (isVersionedBackup) {
242
224
  console.log(`✓ Backup versionado: ${path.relative(this.targetDir, backupPath)}`);
243
225
  } else {
@@ -256,7 +238,7 @@ class SiesaBmadInstaller {
256
238
 
257
239
  // Primer intento: archivo_bk.ext
258
240
  const basicBackupPath = path.join(dir, `${name}_bk${ext}`);
259
-
241
+
260
242
  // Si no existe, usar el nombre básico
261
243
  if (!fs.existsSync(basicBackupPath)) {
262
244
  return basicBackupPath;
@@ -265,12 +247,12 @@ class SiesaBmadInstaller {
265
247
  // Si ya existe _bk, crear versión con timestamp
266
248
  const now = new Date();
267
249
  const timestamp = now.getFullYear().toString() +
268
- (now.getMonth() + 1).toString().padStart(2, '0') +
269
- now.getDate().toString().padStart(2, '0') + '_' +
270
- now.getHours().toString().padStart(2, '0') +
271
- now.getMinutes().toString().padStart(2, '0') +
272
- now.getSeconds().toString().padStart(2, '0');
273
-
250
+ (now.getMonth() + 1).toString().padStart(2, '0') +
251
+ now.getDate().toString().padStart(2, '0') + '_' +
252
+ now.getHours().toString().padStart(2, '0') +
253
+ now.getMinutes().toString().padStart(2, '0') +
254
+ now.getSeconds().toString().padStart(2, '0');
255
+
274
256
  return path.join(dir, `${name}_bk_${timestamp}${ext}`);
275
257
  }
276
258
 
@@ -291,27 +273,18 @@ class SiesaBmadInstaller {
291
273
  async copyWithBackupPreservation(sourcePath, targetPath) {
292
274
  // Obtener todos los archivos backup existentes
293
275
  const backupFiles = await this.findBackupFiles(targetPath);
294
-
295
- // Copiar la carpeta preservando technical-preferences.md
276
+
277
+ // Copiar la carpeta completa sobrescribiendo
296
278
  await fs.copy(sourcePath, targetPath, {
297
279
  overwrite: true,
298
- recursive: true,
299
- filter: (src) => {
300
- const relativePath = path.relative(sourcePath, src);
301
- // No sobrescribir archivos ignorados si ya existen
302
- if (this.ignoredFiles.includes(relativePath)) {
303
- const targetFile = path.join(targetPath, relativePath);
304
- return !fs.existsSync(targetFile);
305
- }
306
- return true;
307
- }
280
+ recursive: true
308
281
  });
309
282
 
310
283
  // Restaurar los archivos backup
311
284
  for (const backupFile of backupFiles) {
312
285
  const backupSourcePath = backupFile.tempPath;
313
286
  const backupTargetPath = backupFile.originalPath;
314
-
287
+
315
288
  try {
316
289
  await fs.copy(backupSourcePath, backupTargetPath);
317
290
  // Limpiar archivo temporal
@@ -336,10 +309,10 @@ class SiesaBmadInstaller {
336
309
  if (fileName.includes('_bk')) {
337
310
  const tempPath = path.join(require('os').tmpdir(), `backup_${Date.now()}_${fileName}`);
338
311
  const relativePath = path.relative(targetPath, filePath);
339
-
312
+
340
313
  // Crear copia temporal del backup
341
314
  await fs.copy(filePath, tempPath);
342
-
315
+
343
316
  backupFiles.push({
344
317
  originalPath: filePath,
345
318
  tempPath: tempPath,
@@ -359,16 +332,7 @@ class SiesaBmadInstaller {
359
332
  if (fs.existsSync(sourcePath)) {
360
333
  await fs.copy(sourcePath, targetPath, {
361
334
  overwrite: true,
362
- recursive: true,
363
- filter: (src) => {
364
- const relativePath = path.relative(sourcePath, src);
365
- // No sobrescribir archivos ignorados si ya existen
366
- if (this.ignoredFiles.includes(relativePath)) {
367
- const targetFile = path.join(targetPath, relativePath);
368
- return !fs.existsSync(targetFile);
369
- }
370
- return true;
371
- }
335
+ recursive: true
372
336
  });
373
337
  } else {
374
338
  console.warn(`⚠️ Carpeta ${mapping.source} no encontrada en el paquete`);
@@ -404,9 +368,6 @@ class SiesaBmadInstaller {
404
368
  await this.performUpdateWithBackups();
405
369
  } else {
406
370
  // Si no hay backups, hacer actualización normal (remover y copiar)
407
- // Pero primero preservar archivos ignorados
408
- await this.preserveIgnoredFiles();
409
-
410
371
  for (const mapping of this.folderMappings) {
411
372
  const targetPath = path.join(this.targetDir, mapping.target);
412
373
 
@@ -417,64 +378,7 @@ class SiesaBmadInstaller {
417
378
 
418
379
  // Realizar instalación nueva
419
380
  await this.performInstallation();
420
-
421
- // Restaurar archivos ignorados
422
- await this.restoreIgnoredFiles();
423
- }
424
- }
425
-
426
- async preserveIgnoredFiles() {
427
- console.log('🔒 Preservando archivos de configuración...');
428
-
429
- for (const mapping of this.folderMappings) {
430
- const targetFolderPath = path.join(this.targetDir, mapping.target);
431
-
432
- if (!fs.existsSync(targetFolderPath)) {
433
- continue;
434
- }
435
-
436
- for (const ignoredFile of this.ignoredFiles) {
437
- const filePath = path.join(targetFolderPath, ignoredFile);
438
-
439
- if (fs.existsSync(filePath)) {
440
- try {
441
- const content = await fs.readFile(filePath, 'utf8');
442
- const key = `${mapping.target}/${ignoredFile}`;
443
- this.preservedContent.set(key, content);
444
- console.log(`✓ Preservando: ${ignoredFile}`);
445
- } catch (error) {
446
- console.warn(`⚠️ Error leyendo ${ignoredFile}: ${error.message}`);
447
- }
448
- }
449
- }
450
- }
451
- }
452
-
453
- async restoreIgnoredFiles() {
454
- if (this.preservedContent.size === 0) {
455
- return;
456
- }
457
-
458
- console.log('🔄 Restaurando archivos de configuración...');
459
-
460
- for (const [key, content] of this.preservedContent) {
461
- const [targetFolder, ...filePathParts] = key.split('/');
462
- const filePath = path.join(this.targetDir, targetFolder, ...filePathParts);
463
-
464
- try {
465
- // Asegurar que el directorio existe
466
- await fs.ensureDir(path.dirname(filePath));
467
-
468
- // Restaurar el contenido
469
- await fs.writeFile(filePath, content, 'utf8');
470
- console.log(`✓ Restaurado: ${filePathParts.join('/')}`);
471
- } catch (error) {
472
- console.warn(`⚠️ Error restaurando ${filePathParts.join('/')}: ${error.message}`);
473
- }
474
381
  }
475
-
476
- // Limpiar el mapa después de restaurar
477
- this.preservedContent.clear();
478
382
  }
479
383
 
480
384
  showPostInstallMessage() {
@@ -81,8 +81,6 @@ dependencies:
81
81
  - architect-checklist.md
82
82
  data:
83
83
  - technical-preferences.md
84
- - technology-stack.md
85
- - architecture-patterns.md
86
84
  tasks:
87
85
  - create-deep-research-prompt.md
88
86
  - create-doc.md
@@ -60,7 +60,6 @@ commands:
60
60
  dependencies:
61
61
  data:
62
62
  - technical-preferences.md
63
- - technology-stack.md
64
63
  - technical-preferences-ux.md
65
64
  tasks:
66
65
  - create-doc.md