agent-mp 0.5.19 → 0.5.20

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.
Files changed (2) hide show
  1. package/dist/core/engine.js +13 -100
  2. package/package.json +1 -1
@@ -1513,73 +1513,6 @@ QUE NO HACER
1513
1513
  - NO documentar componentes triviales (scripts, docs, configs sueltas) con su propia carpeta — mencionalos en NIVEL 0 y listo
1514
1514
  - NO inventar endpoints, env vars, puertos o schemas que no leiste
1515
1515
 
1516
- ================================================================
1517
- DIRECTORIO .agent/docs/ — FLUJOS POR FUNCIONALIDAD (orientado a desarrolladores)
1518
- ================================================================
1519
- Ademas de los archivos de context/, generar docs de flujos. Objetivo: un dev que llega al proyecto puede buscar "como funciona el login" o "donde esta el endpoint de clientes" y encontrar exactamente que archivos tocar, en que orden, y por que.
1520
-
1521
- Generar UN archivo por cada flujo funcional principal que puedas identificar de los CONTROLLER/ROUTER leidos.
1522
- Si no hay controllers, inferir los flujos desde el MANIFEST y el ENTRY POINT.
1523
-
1524
- INDICE OBLIGATORIO:
1525
- === .agent/docs/README.md ===
1526
- # Flujos del proyecto — Indice
1527
-
1528
- | Flujo | Descripcion | Componente(s) |
1529
- |-------|-------------|---------------|
1530
- | [nombre-flujo](nombre-flujo.md) | 1 linea que explica que hace | componente-a, componente-b |
1531
- ...
1532
-
1533
- POR CADA FLUJO:
1534
- === .agent/docs/[nombre-flujo].md ===
1535
- Nombre del archivo: kebab-case del nombre del flujo (auth.md, crear-cliente.md, consulta-ventas.md)
1536
-
1537
- Estructura de cada archivo de flujo:
1538
-
1539
- # Flujo: [Nombre legible]
1540
-
1541
- ## Qué hace
1542
- 1 linea en lenguaje de negocio: "Permite al usuario X hacer Y"
1543
-
1544
- ## Componentes involucrados
1545
- - [componente-a]: rol en este flujo
1546
- - [componente-b]: rol en este flujo
1547
-
1548
- ## Traza técnica paso a paso
1549
- Numberar cada paso. Incluir archivo y funcion/clase cuando fue leido.
1550
- 1. Cliente/Frontend → METODO /ruta/endpoint (archivo: ruta/al/Controller)
1551
- 2. Middleware/Guard/Filter valida/transforma (archivo: ruta/al/Filter o Config)
1552
- 3. Service/UseCase ejecuta la logica (archivo: ruta/al/Service)
1553
- 4. Repository/DAO consulta o escribe en DB (archivo: ruta/al/Repository → tabla o coleccion)
1554
- 5. Respuesta: codigo HTTP + shape de respuesta
1555
-
1556
- ## Archivos involucrados y por qué
1557
- Esta tabla es lo mas importante para un dev nuevo: tiene que saber QUE archivo y POR QUE esta en el flujo.
1558
- | Archivo (ruta relativa al componente) | Por que esta en este flujo |
1559
- |---------------------------------------|---------------------------|
1560
- | ruta/Controller | Recibe el request y delega |
1561
- | ruta/Service | Contiene la logica de negocio |
1562
- | ruta/Repository | Lee o escribe en la base de datos |
1563
- | ruta/Entity o Schema | Define la forma del dato |
1564
- | ruta/Config o Filter | Aplica seguridad / transformacion |
1565
-
1566
- ## Variables / configuracion relevante
1567
- Solo las que afectan directamente este flujo (env vars, properties, feature flags).
1568
-
1569
- ## Como probar este flujo
1570
- - Endpoint: METODO /ruta
1571
- - Body o params de ejemplo
1572
- - Respuesta exitosa: codigo + campos
1573
- - Errores comunes: codigo + cuando ocurre
1574
-
1575
- ================================================================
1576
- CALIBRACION DE DETALLE — docs/
1577
- ================================================================
1578
- - README.md: una fila por flujo, no mas
1579
- - Por flujo: 30-80 lineas. Concreto. Si un paso no fue leido, omitirlo.
1580
- - NO inventar nombres de archivos. Si no se leyo un Service para este flujo, no lo pongas.
1581
- - Generar entre 2 y 8 flujos segun la cantidad de controllers/features encontrados.
1582
-
1583
1516
  ================================================================
1584
1517
  FORMATO DE SALIDA — OBLIGATORIO
1585
1518
  ================================================================
@@ -1591,9 +1524,8 @@ Ejemplos de marcadores validos:
1591
1524
  === .agent/context/architecture.md ===
1592
1525
  === .agent/context/datamart-data-access-api/architecture.md ===
1593
1526
  === .agent/context/datamart-data-access-api/modules/auth.md ===
1594
- === .agent/docs/README.md ===
1595
- === .agent/docs/auth.md ===
1596
- === .agent/docs/consulta-ventas.md ===
1527
+ === .agent/context/nexus-core-api/architecture.md ===
1528
+ === .agent/context/nexus-core-api/modules/clients.md ===
1597
1529
 
1598
1530
  === .agent/context/architecture.md ===
1599
1531
  [contenido NIVEL 0]
@@ -1604,19 +1536,12 @@ Ejemplos de marcadores validos:
1604
1536
  === .agent/context/nombre-componente/modules/auth.md ===
1605
1537
  [contenido NIVEL 2]
1606
1538
 
1607
- === .agent/docs/README.md ===
1608
- [indice de flujos]
1609
-
1610
- === .agent/docs/auth.md ===
1611
- [flujo de autenticacion]
1612
-
1613
1539
  REGLAS DE PATHS:
1614
1540
  - Arquitectura global: === .agent/context/architecture.md ===
1615
1541
  - Por componente: === .agent/context/[nombre-componente]/architecture.md ===
1616
1542
  - Por modulo interno: === .agent/context/[nombre-componente]/modules/[nombre-modulo].md ===
1617
- - Indice de flujos: === .agent/docs/README.md ===
1618
- - Por flujo: === .agent/docs/[nombre-flujo].md ===
1619
1543
  - Documenta TODOS los componentes no triviales del DIRECTORIO_TRABAJO
1544
+ - NO escribir nada bajo .agent/docs/ — esa carpeta es de uso manual
1620
1545
  - Si existe documentacion previa, ACTUALIZALA preservando lo que sigue siendo valido y agregando lo nuevo`;
1621
1546
  const res = await this.runWithFallback('explorer', prompt, 'Exploracion');
1622
1547
  const text = extractCliText(res);
@@ -1646,36 +1571,24 @@ REGLAS DE PATHS:
1646
1571
  content = content.replace(/^```markdown\s*/i, '').replace(/^```\s*$/gm, '').trim();
1647
1572
  if (!content)
1648
1573
  continue;
1649
- // Detect routing: .agent/docs/ docsDir, .agent/context/ contextDir
1650
- const isDocsFile = /^\.agent[\/\\]docs[\/\\]/i.test(fileName);
1574
+ // All explorer output goes under .agent/context/ docs/ is manual-only
1575
+ const relPath = fileName.replace(/^\.agent\/context\//i, '').replace(/^\/+/, '');
1651
1576
  let targetPath = null;
1652
- if (isDocsFile) {
1653
- // .agent/docs/README.md → docsDir/README.md
1654
- // .agent/docs/auth.md → docsDir/auth.md
1655
- const docsRel = fileName.replace(/^\.agent[\/\\]docs[\/\\]/i, '').replace(/^\/+/, '');
1656
- if (docsRel && docsRel.endsWith('.md')) {
1657
- targetPath = path.join(docsDir, ...docsRel.split(/[\/\\]/).filter(Boolean));
1658
- }
1577
+ if (relPath === 'architecture.md' || relPath === 'ARCHITECTURE.md') {
1578
+ targetPath = mainArchPath;
1659
1579
  }
1660
1580
  else {
1661
- // .agent/context/ files (existing behaviour)
1662
- const relPath = fileName.replace(/^\.agent\/context\//i, '').replace(/^\/+/, '');
1663
- if (relPath === 'architecture.md' || relPath === 'ARCHITECTURE.md') {
1664
- targetPath = mainArchPath;
1581
+ const pathParts = relPath.split(/[\/\\]/).filter(Boolean);
1582
+ if (pathParts.length >= 3 && pathParts[pathParts.length - 2] === 'modules') {
1583
+ targetPath = path.join(contextDir, pathParts[pathParts.length - 3], 'modules', pathParts[pathParts.length - 1]);
1665
1584
  }
1666
- else {
1667
- const pathParts = relPath.split(/[\/\\]/).filter(Boolean);
1668
- if (pathParts.length >= 3 && pathParts[pathParts.length - 2] === 'modules') {
1669
- targetPath = path.join(contextDir, pathParts[pathParts.length - 3], 'modules', pathParts[pathParts.length - 1]);
1670
- }
1671
- else if (pathParts.length >= 2) {
1672
- targetPath = path.join(contextDir, pathParts[pathParts.length - 2], pathParts[pathParts.length - 1]);
1673
- }
1585
+ else if (pathParts.length >= 2) {
1586
+ targetPath = path.join(contextDir, pathParts[pathParts.length - 2], pathParts[pathParts.length - 1]);
1674
1587
  }
1675
1588
  }
1676
1589
  if (!targetPath)
1677
1590
  continue;
1678
- pendingWrites.push({ targetPath, content, label: fileName.trim() });
1591
+ pendingWrites.push({ targetPath, content, label: relPath });
1679
1592
  }
1680
1593
  if (pendingWrites.length === 0) {
1681
1594
  log.error('Explorer devolvio texto pero ningun bloque === *.md === fue parseable.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",