agent-rev 0.5.31 → 0.5.32
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/dist/core/engine.js +42 -33
- package/package.json +1 -1
package/dist/core/engine.js
CHANGED
|
@@ -416,35 +416,17 @@ Los archivos raw YA ESTÁN en el CONTEXTO DEL PROYECTO arriba.
|
|
|
416
416
|
|
|
417
417
|
REGLAS CRÍTICAS:
|
|
418
418
|
1. ANTES DE ESCRIBIR CUALQUIER COSA: leé completo el CONTEXTO DEL PROYECTO, incluyendo la sección "TAREA EXISTENTE" si está presente.
|
|
419
|
-
2. SI EXISTE
|
|
420
|
-
-
|
|
419
|
+
2. SI EXISTE SPEC.MD en el contexto (bajo "SPEC.MD EXISTENTE"):
|
|
420
|
+
- **NO lo regeneres desde cero** — ese documento es VIVO y lo edita el humano.
|
|
421
|
+
- Identificá qué secciones ya están completas (Objetivo, Alcance, Criterios, etc.).
|
|
422
|
+
- Identificá qué información FALTA o está incompleta.
|
|
423
|
+
- Hacé SOLO las preguntas necesarias para completar lo que falta.
|
|
424
|
+
- Si el spec.md ya está completo, NO hagas preguntas — usá el existente.
|
|
425
|
+
3. SI EXISTE "TAREA EXISTENTE" en el contexto:
|
|
421
426
|
- Si hay RESULTADO PREVIO: FAIL: informá al usuario qué falló y preguntá si quiere corregir eso específico.
|
|
422
|
-
- Si ya hay plan.json:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
5. Si los archivos ya tienen suficiente información para entender el objetivo, NO hagas preguntas — usá el spec existente.
|
|
426
|
-
6. Cuando tengas todo claro (o si ya hay spec), generá el spec.md SOLO si NO existe uno previo:
|
|
427
|
-
|
|
428
|
-
=== SPEC.MD ===
|
|
429
|
-
# Feature: ${activeFeatureId}
|
|
430
|
-
|
|
431
|
-
## Objetivo
|
|
432
|
-
[descripción clara del objetivo]
|
|
433
|
-
|
|
434
|
-
## Alcance
|
|
435
|
-
[qué incluye y qué no incluye]
|
|
436
|
-
|
|
437
|
-
## Historias de Usuario / Requerimientos
|
|
438
|
-
[detalle de cada requerimiento]
|
|
439
|
-
|
|
440
|
-
## Criterios de Aceptación
|
|
441
|
-
[lista de criterios verificables]
|
|
442
|
-
|
|
443
|
-
## Notas Técnicas
|
|
444
|
-
[consideraciones de implementación]
|
|
445
|
-
=== END SPEC.MD ===
|
|
446
|
-
|
|
447
|
-
7. Cuando el spec esté aprobado (o si ya existe), escribí EXACTAMENTE al final: ${READY_SENTINEL}` : `
|
|
427
|
+
- Si ya hay plan.json: la tarea ya está definida — NO generes spec.
|
|
428
|
+
4. NUNCA reemplaces el spec.md existente — si necesitás actualizarlo, solo sugerí los cambios puntuales.
|
|
429
|
+
5. Cuando tengas todo claro (o si ya hay spec), escribí EXACTAMENTE al final: ${READY_SENTINEL}` : `
|
|
448
430
|
MODO TAREA LIBRE — No se especificó feature todavía.
|
|
449
431
|
${featureListBlock}
|
|
450
432
|
REGLAS:
|
|
@@ -468,9 +450,10 @@ ${conversationHistory}
|
|
|
468
450
|
INSTRUCCIONES GENERALES:
|
|
469
451
|
- Hablá en forma NATURAL, como un compañero de equipo experimentado.
|
|
470
452
|
- ANTES DE RESPONDER: leé todo el CONTEXTO DEL PROYECTO, incluyendo "TAREA EXISTENTE" si está presente.
|
|
453
|
+
- **SPEC.MD ES DOCUMENTO VIVO**: Si ya existe spec.md, NO lo regeneres — es un documento que el humano va construyendo y editando. Solo identificá qué falta y preguntá para completar.
|
|
471
454
|
- Si hay una TAREA EXISTENTE con RESULTADO PREVIO: FAIL, informá al usuario qué falló y preguntá si quiere corregir eso específico.
|
|
472
455
|
- Si ya hay SPEC.MD o plan.json para la tarea, NO los regeneres — usá los existentes.
|
|
473
|
-
- NO preguntés cosas que ya están respondidas en los archivos raw, TAREA EXISTENTE o la conversación.
|
|
456
|
+
- NO preguntés cosas que ya están respondidas en los archivos raw, TAREA EXISTENTE, SPEC.MD o la conversación.
|
|
474
457
|
- Hacé como máximo UNA pregunta por turno.
|
|
475
458
|
- NO uses JSON, hablá normalmente.
|
|
476
459
|
- Sé directo y eficiente — respetá el tiempo del programador.${specInstructions}`;
|
|
@@ -621,12 +604,38 @@ INSTRUCCIONES GENERALES:
|
|
|
621
604
|
const confirm = await ask(' ¿Confirmás lanzar el orchestrator? (y/n): ', this.rl);
|
|
622
605
|
if (confirm.toLowerCase() === 'y' || confirm.toLowerCase() === 's') {
|
|
623
606
|
let specPath;
|
|
624
|
-
if (activeFeatureId
|
|
607
|
+
if (activeFeatureId) {
|
|
625
608
|
const specDir = path.join(this.projectDir, '.agent', 'docs', activeFeatureId);
|
|
626
609
|
const specFile = path.join(specDir, 'spec.md');
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
610
|
+
// Si ya existe spec.md y hay contenido nuevo, ACTUALIZAR incrementalmente
|
|
611
|
+
if (await fileExists(specFile) && pendingSpecContent) {
|
|
612
|
+
const existingSpec = await readFile(specFile);
|
|
613
|
+
// Si el contenido es sustancialmente diferente, preguntar al usuario
|
|
614
|
+
if (existingSpec.trim() !== pendingSpecContent.trim()) {
|
|
615
|
+
console.log(chalk.yellow('\n ⚠️ Ya existe un spec.md con este contenido:'));
|
|
616
|
+
console.log(chalk.dim(' ' + existingSpec.split('\n').slice(0, 10).join('\n ')));
|
|
617
|
+
const action = await ask('\n ¿Qué querés hacer? (r=reemplazar / m=mantener el existente / e=editar): ', this.rl);
|
|
618
|
+
if (action.toLowerCase() === 'r') {
|
|
619
|
+
await writeFile(specFile, pendingSpecContent);
|
|
620
|
+
log.ok(`spec.md reemplazado`);
|
|
621
|
+
}
|
|
622
|
+
else if (action.toLowerCase() === 'e') {
|
|
623
|
+
console.log(chalk.dim(' Editá el archivo spec.md manualmente y luego volvé a ejecutar.'));
|
|
624
|
+
return { task: conversationHistory, specPath: undefined, featureId: activeFeatureId };
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
log.ok(`spec.md existente mantenido`);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
else if (pendingSpecContent) {
|
|
632
|
+
// No existe spec.md — crearlo
|
|
633
|
+
await writeFile(specFile, pendingSpecContent);
|
|
634
|
+
log.ok(`spec.md guardado en ${path.relative(this.projectDir, specFile)}`);
|
|
635
|
+
}
|
|
636
|
+
if (await fileExists(specFile)) {
|
|
637
|
+
specPath = specFile;
|
|
638
|
+
}
|
|
630
639
|
}
|
|
631
640
|
return { task: conversationHistory, specPath, featureId: activeFeatureId };
|
|
632
641
|
}
|