agent-rev 0.5.32 → 0.5.34
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/commands/repl.js +56 -0
- package/dist/core/engine.js +34 -4
- package/package.json +1 -1
package/dist/commands/repl.js
CHANGED
|
@@ -855,6 +855,9 @@ function cmdHelp(fi) {
|
|
|
855
855
|
{ key: '/run rev <id>', value: 'Run only reviewer' },
|
|
856
856
|
{ key: '/run explorer [task]', value: 'Run only explorer' },
|
|
857
857
|
{ key: '/explorer [task]', value: 'Run explorer (shortcut)' },
|
|
858
|
+
{ key: '/orch <feature-id>', value: 'Lanza SOLO orchestrator — genera plan.json' },
|
|
859
|
+
{ key: '/impl <task-id>', value: 'Lanza SOLO implementor — ejecuta plan existente' },
|
|
860
|
+
{ key: '/rev <task-id>', value: 'Lanza SOLO reviewer — valida implementación' },
|
|
858
861
|
{ key: '/model', value: 'Cambiar modelo del coordinador' },
|
|
859
862
|
{ key: '/provider', value: 'Cambiar proveedor activo (Gemini / Qwen)' },
|
|
860
863
|
{ key: '/login', value: 'Configurar API key (Qwen o Gemini)' },
|
|
@@ -1196,6 +1199,59 @@ export async function runRepl(resumeSession) {
|
|
|
1196
1199
|
});
|
|
1197
1200
|
break;
|
|
1198
1201
|
}
|
|
1202
|
+
// Comandos cortos para lanzar roles directamente
|
|
1203
|
+
case 'orch': {
|
|
1204
|
+
// /orch <feature-id> — lanza solo orchestrator sin preguntas
|
|
1205
|
+
const featureId = args.join(' ').trim();
|
|
1206
|
+
if (!featureId) {
|
|
1207
|
+
fi.println(chalk.red(' Uso: /orch <feature-id>'));
|
|
1208
|
+
break;
|
|
1209
|
+
}
|
|
1210
|
+
await withEngine(async (engine) => {
|
|
1211
|
+
const result = await engine.runOrchestrator(`.agent/docs/${featureId}`, undefined, featureId);
|
|
1212
|
+
fi.println(chalk.green(` ✓ Task ID: ${result.taskId}`));
|
|
1213
|
+
fi.println(chalk.green(` ✓ Plan: .agent/tasks/${result.taskId}/plan.json`));
|
|
1214
|
+
});
|
|
1215
|
+
break;
|
|
1216
|
+
}
|
|
1217
|
+
case 'impl': {
|
|
1218
|
+
// /impl <task-id> — lanza solo implementor con plan existente
|
|
1219
|
+
const taskId = args.join(' ').trim();
|
|
1220
|
+
if (!taskId) {
|
|
1221
|
+
fi.println(chalk.red(' Uso: /impl <task-id>'));
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
1224
|
+
await withEngine(async (engine) => {
|
|
1225
|
+
const taskDir = path.join(engine['projectDir'], '.agent', 'tasks', taskId);
|
|
1226
|
+
if (!await fileExists(taskDir)) {
|
|
1227
|
+
fi.println(chalk.red(` ✗ Task "${taskId}" no existe`));
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
const plan = await readJson(path.join(taskDir, 'plan.json'));
|
|
1231
|
+
await engine.runImplementor(taskId, plan);
|
|
1232
|
+
fi.println(chalk.green(` ✓ Implementación completada`));
|
|
1233
|
+
});
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
1236
|
+
case 'rev': {
|
|
1237
|
+
// /rev <task-id> — lanza solo reviewer
|
|
1238
|
+
const taskId = args.join(' ').trim();
|
|
1239
|
+
if (!taskId) {
|
|
1240
|
+
fi.println(chalk.red(' Uso: /rev <task-id>'));
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
await withEngine(async (engine) => {
|
|
1244
|
+
const taskDir = path.join(engine['projectDir'], '.agent', 'tasks', taskId);
|
|
1245
|
+
if (!await fileExists(taskDir)) {
|
|
1246
|
+
fi.println(chalk.red(` ✗ Task "${taskId}" no existe`));
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
const plan = await readJson(path.join(taskDir, 'plan.json'));
|
|
1250
|
+
const progress = await readJson(path.join(taskDir, 'progress.json'));
|
|
1251
|
+
await engine.runReviewer(taskId, plan, progress);
|
|
1252
|
+
});
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1199
1255
|
case 'models':
|
|
1200
1256
|
case 'model':
|
|
1201
1257
|
await withRl((rl) => cmdModels(args[0], fi, rl));
|
package/dist/core/engine.js
CHANGED
|
@@ -1043,6 +1043,31 @@ REGLA: Al terminar, reporta todo lo que encontraste de forma clara y estructurad
|
|
|
1043
1043
|
const taskId = await this.generateTaskId(task, featureId);
|
|
1044
1044
|
const taskDir = path.join(this.projectDir, '.agent', 'tasks', taskId);
|
|
1045
1045
|
log.phase(1, 'Planificacion', this.config.roles.orchestrator.cli, this.config.roles.orchestrator.model);
|
|
1046
|
+
// VERIFICAR SI YA EXISTE UN PLAN PARA ESTA TAREA
|
|
1047
|
+
const existingPlanPath = path.join(taskDir, 'plan.json');
|
|
1048
|
+
if (await fileExists(existingPlanPath)) {
|
|
1049
|
+
const existingPlan = await readJson(existingPlanPath);
|
|
1050
|
+
console.log(chalk.yellow('\n ⚠️ Ya existe un plan para esta tarea:'));
|
|
1051
|
+
console.log(chalk.dim(` Descripción: ${existingPlan.description?.slice(0, 100) || 'N/A'}`));
|
|
1052
|
+
console.log(chalk.dim(` Steps: ${existingPlan.steps?.length || 0}`));
|
|
1053
|
+
const action = await ask('\n ¿Qué querés hacer? (v=ver plan completo / r=regenerar / m=mantener y continuar): ', this.rl);
|
|
1054
|
+
if (action.toLowerCase() === 'v') {
|
|
1055
|
+
console.log('');
|
|
1056
|
+
console.log(chalk.cyan(' === plan.json ==='));
|
|
1057
|
+
console.log(chalk.white(JSON.stringify(existingPlan, null, 2).slice(0, 2000)));
|
|
1058
|
+
console.log(chalk.cyan(' ================='));
|
|
1059
|
+
const retry = await ask(' ¿Regenerar igual? (y/n): ', this.rl);
|
|
1060
|
+
if (retry.toLowerCase() !== 'y') {
|
|
1061
|
+
log.info('Usando plan existente.');
|
|
1062
|
+
return { taskId, plan: existingPlan };
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
else if (action.toLowerCase() === 'm') {
|
|
1066
|
+
log.info('Usando plan existente.');
|
|
1067
|
+
return { taskId, plan: existingPlan };
|
|
1068
|
+
}
|
|
1069
|
+
// Si es 'r', continúa generando nuevo plan
|
|
1070
|
+
}
|
|
1046
1071
|
const context = await this.buildOrchestratorContext();
|
|
1047
1072
|
let specContent = '';
|
|
1048
1073
|
if (specPath && await fileExists(specPath)) {
|
|
@@ -1060,10 +1085,15 @@ ${context}
|
|
|
1060
1085
|
INSTRUCCIONES CRÍTICAS:
|
|
1061
1086
|
1. Si hay SPEC.MD, ESE ES EL DOCUMENTO PRIMARIO — define completamente la tarea. Los archivos raw son solo contexto histórico, NO los uses para definir la implementación.
|
|
1062
1087
|
2. Ignorá cualquier información que NO tenga relación directa con la tarea del spec.md (ej: listas de modelos, ejemplos genéricos, etc.).
|
|
1063
|
-
3.
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1088
|
+
3. **GENERÁ STEPS DE IMPLEMENTACIÓN CONCRETOS** — NO steps sobre "leer", "analizar", "identificar". El implementor ya sabe leer.
|
|
1089
|
+
- ❌ MAL: "Leer spec.md para identificar requerimientos"
|
|
1090
|
+
- ❌ MAL: "Analizar archivos raw como contexto"
|
|
1091
|
+
- ✅ BIEN: "Crear script clock.sh con formato HH:MM:SS, sleep 1, trap SIGINT"
|
|
1092
|
+
- ✅ BIEN: "Hacer ejecutable el script con chmod +x"
|
|
1093
|
+
4. Cada step debe tener una descripción de **ACCIÓN** (crear, modificar, instalar, configurar) y los archivos específicos que se van a crear/modificar.
|
|
1094
|
+
5. Si el spec.md dice "script que muestra la hora", los steps son: (1) crear el script, (2) hacerlo ejecutable. No más.
|
|
1095
|
+
6. Definí acceptance_criteria medibles leyendo archivos.
|
|
1096
|
+
7. Responde SOLO con este JSON exacto, sin texto adicional:
|
|
1067
1097
|
|
|
1068
1098
|
{"plan":{"task_id":"${taskId}","description":"${task}","steps":[{"num":1,"description":"descripcion concreta del paso","files":["archivo/a/crear.ts"],"status":"pending"}],"acceptance_criteria":["criterio verificable"],"deliberation":{"needed":false,"question":""}}}`;
|
|
1069
1099
|
const res = await this.runWithFallback('orchestrator', prompt, 'Planificacion');
|