agent-mp 0.5.2 → 0.5.3

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.
@@ -994,6 +994,16 @@ export async function runRepl(resumeSession) {
994
994
  const dir = await resolveProjectDir(process.cwd());
995
995
  const config = await loadProjectConfig(dir);
996
996
  if (args[0] === 'orch' || args[0] === 'orchestrator') {
997
+ // Ensure documentation exists before orchestrator runs
998
+ const contextDir = path.join(dir, '.agent', 'context');
999
+ const archPath = path.join(contextDir, 'architecture.md');
1000
+ if (!(await fileExists(archPath))) {
1001
+ fi.println(chalk.yellow('\n ── Generando documentación del proyecto ──'));
1002
+ fi.println(chalk.dim(' El orquestador necesita conocer la estructura del proyecto primero.\n'));
1003
+ const prepEngine = new AgentEngine(config, dir, gCoordinatorCmd, rl, fi, handleCmd);
1004
+ await prepEngine.runExplorer('Document the complete project structure, services, dependencies, and entry points. Create/update .agent/context/architecture.md');
1005
+ fi.println(chalk.green(' ✓ Documentación del proyecto generada.\n'));
1006
+ }
997
1007
  const task = args.slice(1).join(' ');
998
1008
  const engine = new AgentEngine(config, dir, gCoordinatorCmd, rl, fi, handleCmd);
999
1009
  const result = await engine.runOrchestrator(task);
@@ -1106,6 +1116,16 @@ export async function runRepl(resumeSession) {
1106
1116
  fi.println(chalk.red(' No roles configured. Run /config-multi first.'));
1107
1117
  }
1108
1118
  else {
1119
+ // Before running the orchestrator, ensure project documentation exists
1120
+ const contextDir = path.join(dir, '.agent', 'context');
1121
+ const archPath = path.join(contextDir, 'architecture.md');
1122
+ if (!(await fileExists(archPath))) {
1123
+ fi.println(chalk.yellow('\n ── Generando documentación del proyecto ──'));
1124
+ fi.println(chalk.dim(' El orquestador necesita conocer la estructura del proyecto primero.\n'));
1125
+ const engine = new AgentEngine(config, dir, gCoordinatorCmd, rl, fi, handleCmd);
1126
+ await engine.runExplorer('Document the complete project structure, services, dependencies, and entry points. Create/update .agent/context/architecture.md');
1127
+ fi.println(chalk.green(' ✓ Documentación del proyecto generada.\n'));
1128
+ }
1109
1129
  const engine = new AgentEngine(config, dir, gCoordinatorCmd, rl, fi, handleCmd);
1110
1130
  await engine.runFullCycle(trimmed);
1111
1131
  session.messages.push({ role: 'agent', content: `[task cycle completed for: ${trimmed}]`, ts: new Date().toISOString() });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",