agent-mp 0.5.29 → 0.5.31
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 +3 -0
- package/dist/core/engine.js +13 -6
- package/package.json +1 -1
package/dist/commands/repl.js
CHANGED
|
@@ -244,6 +244,9 @@ function detectModels(cliName) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function buildCmd(cliName, model) {
|
|
247
|
+
// openai-compatible no es un CLI real — es la API de Qwen via API key
|
|
248
|
+
if (cliName === 'openai-compatible')
|
|
249
|
+
cliName = 'qwen';
|
|
247
250
|
const info = CLI_REGISTRY[cliName];
|
|
248
251
|
if (!info)
|
|
249
252
|
return `${cliName} -m ${model}`;
|
package/dist/core/engine.js
CHANGED
|
@@ -1007,12 +1007,17 @@ REGLA: Al terminar, reporta todo lo que encontraste de forma clara y estructurad
|
|
|
1007
1007
|
const resultPath = path.join(taskDir, 'result.md');
|
|
1008
1008
|
if (await fileExists(resultPath)) {
|
|
1009
1009
|
const result = await readFile(resultPath);
|
|
1010
|
-
|
|
1010
|
+
// Buscar el veredicto principal en las primeras líneas (donde está "**Verdict: PASS/FAIL**")
|
|
1011
|
+
const firstLines = result.split('\n').slice(0, 10).join('\n');
|
|
1012
|
+
const verdict = firstLines.includes('Verdict: FAIL') || firstLines.includes('❌') ? 'FAIL' : 'PASS';
|
|
1011
1013
|
ctx += `- RESULTADO PREVIO: ${verdict}\n`;
|
|
1012
1014
|
if (verdict === 'FAIL') {
|
|
1013
1015
|
ctx += `\n⚠️ ESTA TAREA YA FALLÓ ANTES. Razones del FAIL:\n${result.slice(0, 1500)}\n`;
|
|
1014
1016
|
ctx += `\nIMPORTANTE: Si el usuario pide re-implementar, debés corregir ESPECÍFICAMENTE los puntos marcados como FAIL.\n`;
|
|
1015
1017
|
}
|
|
1018
|
+
else {
|
|
1019
|
+
ctx += `\n✅ La tarea ya fue completada exitosamente.\n`;
|
|
1020
|
+
}
|
|
1016
1021
|
}
|
|
1017
1022
|
// Leer spec.md si existe
|
|
1018
1023
|
const specPath = path.join(this.projectDir, '.agent', 'docs', featureId, 'spec.md');
|
|
@@ -1043,11 +1048,13 @@ ${specContent}
|
|
|
1043
1048
|
CONTEXTO DEL PROYECTO:
|
|
1044
1049
|
${context}
|
|
1045
1050
|
|
|
1046
|
-
INSTRUCCIONES:
|
|
1047
|
-
1.
|
|
1048
|
-
2.
|
|
1049
|
-
3.
|
|
1050
|
-
4.
|
|
1051
|
+
INSTRUCCIONES CRÍTICAS:
|
|
1052
|
+
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.
|
|
1053
|
+
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.).
|
|
1054
|
+
3. Generá steps CONCRETOS y DIRECTOS para implementar lo que dice el spec.md — sin sobre-analizar.
|
|
1055
|
+
4. Si el spec.md dice "script que muestra la hora", los steps son: (1) crear el script, (2) hacerlo ejecutable. No más.
|
|
1056
|
+
5. Definí acceptance_criteria medibles leyendo archivos.
|
|
1057
|
+
6. Responde SOLO con este JSON exacto, sin texto adicional:
|
|
1051
1058
|
|
|
1052
1059
|
{"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":""}}}`;
|
|
1053
1060
|
const res = await this.runWithFallback('orchestrator', prompt, 'Planificacion');
|