@deinossrl/dgp-agent 1.5.2 → 1.5.4
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 +16 -0
- package/index.mjs +35 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.5.4] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **CRÍTICO**: Ahora configura PGPASSWORD antes de ejecutar psql para crear schemas
|
|
7
|
+
- **CRÍTICO**: Corregido password para Supabase - usa database password en vez de service_role_key
|
|
8
|
+
- Resuelve "Password for user postgres..." - ahora se autentica automáticamente
|
|
9
|
+
- Aplica a pg_dump, pg_restore y psql para conexiones Supabase y PostgreSQL
|
|
10
|
+
|
|
11
|
+
## [1.5.3] - 2026-01-12
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Status simplificado: En lugar del bloque grande cada ciclo, ahora muestra una línea breve cada 10 minutos
|
|
15
|
+
- Formato: `[timestamp] version | commit_hash | branch`
|
|
16
|
+
- Reportes a la plataforma son silenciosos (sin logs innecesarios)
|
|
17
|
+
- El comando `dgp-agent status` sigue mostrando el detalle completo
|
|
18
|
+
|
|
3
19
|
## [1.5.2] - 2026-01-12
|
|
4
20
|
|
|
5
21
|
### Fixed
|
package/index.mjs
CHANGED
|
@@ -1723,9 +1723,9 @@ async function executePgDump(command) {
|
|
|
1723
1723
|
pgDumpArgs.push(`--username=postgres`);
|
|
1724
1724
|
pgDumpArgs.push(`--dbname=postgres`);
|
|
1725
1725
|
|
|
1726
|
-
//
|
|
1727
|
-
if (params.
|
|
1728
|
-
process.env.PGPASSWORD = params.
|
|
1726
|
+
// Database password (no service_role_key)
|
|
1727
|
+
if (params.password_encrypted) {
|
|
1728
|
+
process.env.PGPASSWORD = params.password_encrypted;
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
1731
|
|
|
@@ -2067,6 +2067,11 @@ async function executePgRestore(command) {
|
|
|
2067
2067
|
if (!existsSync(psqlExe)) {
|
|
2068
2068
|
logInfo('psql no disponible, schemas deben existir previamente');
|
|
2069
2069
|
} else {
|
|
2070
|
+
// Configurar PGPASSWORD para psql (database password, no service_role_key)
|
|
2071
|
+
if (params.password_encrypted) {
|
|
2072
|
+
process.env.PGPASSWORD = params.password_encrypted;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2070
2075
|
// Crear cada schema
|
|
2071
2076
|
for (const schemaName of schemas) {
|
|
2072
2077
|
try {
|
|
@@ -2133,9 +2138,9 @@ async function executePgRestore(command) {
|
|
|
2133
2138
|
pgRestoreArgs.push(`--username=postgres`);
|
|
2134
2139
|
pgRestoreArgs.push(`--dbname=postgres`);
|
|
2135
2140
|
|
|
2136
|
-
//
|
|
2137
|
-
if (
|
|
2138
|
-
process.env.PGPASSWORD =
|
|
2141
|
+
// Database password (no service_role_key)
|
|
2142
|
+
if (params.password_encrypted) {
|
|
2143
|
+
process.env.PGPASSWORD = params.password_encrypted;
|
|
2139
2144
|
}
|
|
2140
2145
|
} else if (target_environment.connection_type === 'postgresql') {
|
|
2141
2146
|
pgRestoreArgs.push(`--host=${target_environment.db_host}`);
|
|
@@ -2143,8 +2148,8 @@ async function executePgRestore(command) {
|
|
|
2143
2148
|
pgRestoreArgs.push(`--username=${target_environment.db_user}`);
|
|
2144
2149
|
pgRestoreArgs.push(`--dbname=${target_environment.db_name}`);
|
|
2145
2150
|
|
|
2146
|
-
if (
|
|
2147
|
-
process.env.PGPASSWORD =
|
|
2151
|
+
if (params.password_encrypted) {
|
|
2152
|
+
process.env.PGPASSWORD = params.password_encrypted;
|
|
2148
2153
|
}
|
|
2149
2154
|
}
|
|
2150
2155
|
|
|
@@ -2795,7 +2800,7 @@ async function executeGitCommitPush(command, useAI = false) {
|
|
|
2795
2800
|
}
|
|
2796
2801
|
|
|
2797
2802
|
/**
|
|
2798
|
-
* Muestra el estado en consola
|
|
2803
|
+
* Muestra el estado en consola (formato completo)
|
|
2799
2804
|
*/
|
|
2800
2805
|
function printStatus(status) {
|
|
2801
2806
|
console.log('');
|
|
@@ -2820,6 +2825,14 @@ function printStatus(status) {
|
|
|
2820
2825
|
console.log('');
|
|
2821
2826
|
}
|
|
2822
2827
|
|
|
2828
|
+
/**
|
|
2829
|
+
* Muestra una línea breve con el estado (versión, commit, fecha)
|
|
2830
|
+
*/
|
|
2831
|
+
function printBriefStatus(status) {
|
|
2832
|
+
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
2833
|
+
console.log(`${colors.gray}[${now}] v${AGENT_VERSION} | ${status.last_commit.hash} | ${status.branch}${colors.reset}`);
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2823
2836
|
/**
|
|
2824
2837
|
* Loop principal del agente - SIEMPRE inteligente
|
|
2825
2838
|
*/
|
|
@@ -2913,17 +2926,25 @@ async function runAgent() {
|
|
|
2913
2926
|
logInfo('Presiona Ctrl+C para detener');
|
|
2914
2927
|
console.log('');
|
|
2915
2928
|
|
|
2929
|
+
// Contador para mostrar status breve cada 10 minutos
|
|
2930
|
+
let statusCycleCount = 0;
|
|
2931
|
+
const CYCLES_PER_10_MIN = Math.floor(600 / CONFIG.interval); // 600s = 10 min
|
|
2932
|
+
|
|
2916
2933
|
// Status reporting cycle
|
|
2917
2934
|
const runStatusCycle = async () => {
|
|
2918
2935
|
try {
|
|
2919
2936
|
const status = getRepoStatus();
|
|
2920
|
-
printStatus(status);
|
|
2921
2937
|
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2938
|
+
// Mostrar status breve cada 10 minutos (no cada ciclo)
|
|
2939
|
+
if (statusCycleCount % CYCLES_PER_10_MIN === 0) {
|
|
2940
|
+
printBriefStatus(status);
|
|
2941
|
+
}
|
|
2942
|
+
statusCycleCount++;
|
|
2943
|
+
|
|
2944
|
+
// Reportar silenciosamente a la plataforma
|
|
2945
|
+
await reportStatus(status);
|
|
2925
2946
|
} catch (error) {
|
|
2926
|
-
|
|
2947
|
+
// Silent fail - no spam logs
|
|
2927
2948
|
}
|
|
2928
2949
|
};
|
|
2929
2950
|
|