@deinossrl/dgp-agent 1.5.1 → 1.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.
- package/CHANGELOG.md +15 -0
- package/index.mjs +34 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.5.3] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Status simplificado: En lugar del bloque grande cada ciclo, ahora muestra una línea breve cada 10 minutos
|
|
7
|
+
- Formato: `[timestamp] version | commit_hash | branch`
|
|
8
|
+
- Reportes a la plataforma son silenciosos (sin logs innecesarios)
|
|
9
|
+
- El comando `dgp-agent status` sigue mostrando el detalle completo
|
|
10
|
+
|
|
11
|
+
## [1.5.2] - 2026-01-12
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Ahora verifica que los 3 ejecutables existan (pg_dump, pg_restore, psql)
|
|
15
|
+
- Si falta psql.exe, reinstala PostgreSQL automáticamente
|
|
16
|
+
- Resuelve "psql no disponible" en upgrades desde versiones anteriores
|
|
17
|
+
|
|
3
18
|
## [1.5.1] - 2026-01-12
|
|
4
19
|
|
|
5
20
|
### Changed
|
package/index.mjs
CHANGED
|
@@ -1430,20 +1430,26 @@ async function findOrInstallPgDump() {
|
|
|
1430
1430
|
const isWindows = process.platform === 'win32';
|
|
1431
1431
|
const executableName = isWindows ? 'pg_dump.exe' : 'pg_dump';
|
|
1432
1432
|
const restoreExecutableName = isWindows ? 'pg_restore.exe' : 'pg_restore';
|
|
1433
|
+
const psqlExecutableName = isWindows ? 'psql.exe' : 'psql';
|
|
1433
1434
|
|
|
1434
|
-
// 1. Verificar si ya están
|
|
1435
|
+
// 1. Verificar si ya están LOS 3 ejecutables en nuestro BIN_DIR
|
|
1435
1436
|
const localPgDump = join(BIN_DIR, executableName);
|
|
1436
1437
|
const localPgRestore = join(BIN_DIR, restoreExecutableName);
|
|
1438
|
+
const localPsql = join(BIN_DIR, psqlExecutableName);
|
|
1437
1439
|
|
|
1438
|
-
if (existsSync(localPgDump) && existsSync(localPgRestore)) {
|
|
1440
|
+
if (existsSync(localPgDump) && existsSync(localPgRestore) && existsSync(localPsql)) {
|
|
1439
1441
|
return localPgDump;
|
|
1440
1442
|
}
|
|
1441
1443
|
|
|
1442
1444
|
// Si falta alguno, avisar y continuar con la instalación
|
|
1443
|
-
if (existsSync(localPgDump)
|
|
1444
|
-
logInfo('pg_dump
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1445
|
+
if (!existsSync(localPgDump)) {
|
|
1446
|
+
logInfo('pg_dump no encontrado, instalando PostgreSQL...');
|
|
1447
|
+
}
|
|
1448
|
+
if (!existsSync(localPgRestore)) {
|
|
1449
|
+
logInfo('pg_restore no encontrado, instalando PostgreSQL...');
|
|
1450
|
+
}
|
|
1451
|
+
if (!existsSync(localPsql)) {
|
|
1452
|
+
logInfo('psql no encontrado, instalando PostgreSQL...');
|
|
1447
1453
|
}
|
|
1448
1454
|
|
|
1449
1455
|
// 2. Buscar en PATH
|
|
@@ -2789,7 +2795,7 @@ async function executeGitCommitPush(command, useAI = false) {
|
|
|
2789
2795
|
}
|
|
2790
2796
|
|
|
2791
2797
|
/**
|
|
2792
|
-
* Muestra el estado en consola
|
|
2798
|
+
* Muestra el estado en consola (formato completo)
|
|
2793
2799
|
*/
|
|
2794
2800
|
function printStatus(status) {
|
|
2795
2801
|
console.log('');
|
|
@@ -2814,6 +2820,14 @@ function printStatus(status) {
|
|
|
2814
2820
|
console.log('');
|
|
2815
2821
|
}
|
|
2816
2822
|
|
|
2823
|
+
/**
|
|
2824
|
+
* Muestra una línea breve con el estado (versión, commit, fecha)
|
|
2825
|
+
*/
|
|
2826
|
+
function printBriefStatus(status) {
|
|
2827
|
+
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
2828
|
+
console.log(`${colors.gray}[${now}] v${AGENT_VERSION} | ${status.last_commit.hash} | ${status.branch}${colors.reset}`);
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2817
2831
|
/**
|
|
2818
2832
|
* Loop principal del agente - SIEMPRE inteligente
|
|
2819
2833
|
*/
|
|
@@ -2907,17 +2921,25 @@ async function runAgent() {
|
|
|
2907
2921
|
logInfo('Presiona Ctrl+C para detener');
|
|
2908
2922
|
console.log('');
|
|
2909
2923
|
|
|
2924
|
+
// Contador para mostrar status breve cada 10 minutos
|
|
2925
|
+
let statusCycleCount = 0;
|
|
2926
|
+
const CYCLES_PER_10_MIN = Math.floor(600 / CONFIG.interval); // 600s = 10 min
|
|
2927
|
+
|
|
2910
2928
|
// Status reporting cycle
|
|
2911
2929
|
const runStatusCycle = async () => {
|
|
2912
2930
|
try {
|
|
2913
2931
|
const status = getRepoStatus();
|
|
2914
|
-
printStatus(status);
|
|
2915
2932
|
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2933
|
+
// Mostrar status breve cada 10 minutos (no cada ciclo)
|
|
2934
|
+
if (statusCycleCount % CYCLES_PER_10_MIN === 0) {
|
|
2935
|
+
printBriefStatus(status);
|
|
2936
|
+
}
|
|
2937
|
+
statusCycleCount++;
|
|
2938
|
+
|
|
2939
|
+
// Reportar silenciosamente a la plataforma
|
|
2940
|
+
await reportStatus(status);
|
|
2919
2941
|
} catch (error) {
|
|
2920
|
-
|
|
2942
|
+
// Silent fail - no spam logs
|
|
2921
2943
|
}
|
|
2922
2944
|
};
|
|
2923
2945
|
|